I have a tree containing a TString leaf LaserDumpName that I want to cut on with a simple macro or with TTreeViewer. However the string functions don’t seem to work. How do I access them? In the code snippet below the scan returns all LaserDumpName variables rather than selecting those beginning with the DDon string. I’ve tried many workarounds and variations of this macro without success.
#include "TString.h"
#include "TROOT.h"
#include "TSystem.h"
#include "TFile.h"
#include "TTree.h"
void traplifetime(TFile* f) {
TTree* tree=(TTree*)f->Get("vars");
TString DDon("DD on res");
TCut DDonc=TCut("rfout>0.533&&LaserDumpName->BeginsWith(DDon)");
tree->Scan("LaserDumpName",DDonc;
}