--- PamelaLevel2/doc/examples/Loop.cpp 2006/12/11 18:29:01 1.2 +++ PamelaLevel2/doc/examples/Loop.cpp 2007/01/15 11:51:39 1.4 @@ -10,6 +10,7 @@ #include #include #include +#include #include #include @@ -20,6 +21,13 @@ //=================================== // global variables //=================================== +Bool_t DEBUG; +TString DIR; +TString LIST; +TString OPTIONS; +ULong64_t MAXEV; +TString OUTFILE; + PamLevel2 *event = NULL; TChain *tree = NULL; TFile *outfh = NULL; @@ -51,7 +59,7 @@ return 0; } fieldpath.Append("/trk-param/field_param-0/"); - event->LoadField(fieldpath.Data()); + event->GetTrkLevel2()->LoadField(fieldpath.Data()); //------------------------------ @@ -77,8 +85,6 @@ if( !Select(event) )return false; -// cout <TrkLevel2::ntrk()<FillCloneTrees(); if(fillHistos)FillHistos(event); @@ -111,6 +117,8 @@ //000000000000000000000000000000000000000000 //========================================== Int_t Loop(TString ddir,TString list, ULong64_t nmax, TString options, TString outfile){ + +// gObjectTable->Print(); if(options.Contains("fillTree"))fillTree=true; if(options.Contains("fillHisto"))fillHistos=true; @@ -153,6 +161,7 @@ // read input file/list // -------------------- event = new PamLevel2(); + if(DEBUG)gObjectTable->Print(); if(list.Contains(".root")){ stringstream command; command.str(""); @@ -163,6 +172,7 @@ }else{ tree = event->GetPamTree(ddir,list,options); }; +// gObjectTable->Print(); tree->SetCacheSize(0); // --------------- @@ -179,12 +189,14 @@ cout << endl<<" Start loop over events: "<< nmax<Start("event-loop"); TString current_file = ""; + if(DEBUG)gObjectTable->Print(); for(ULong64_t iev=0; ievClear(); @@ -192,26 +204,22 @@ get++; if( Process(iev) ){ sel++; - if(event->TrkLevel2::ntrk() >0)ntrk++; } if(current_file.CompareTo(tree->GetFile()->GetName())){ current_file=tree->GetFile()->GetName(); cout << iev<< " -> "<< current_file << endl; -// cout << tree->GetFile()->GetName() << endl; }; -// if( fillTree && !(sel%10000) ) -// if(event->TrkLevel2::ntrk() >0)ntrk++; }else{ cout << "Chain entry "<Print(); + }; benchmark->Show("event-loop"); cout << sel <<" selected events over "<Print(); + event->Clear(); // -------------- // close and exit // -------------- @@ -225,13 +233,13 @@ #if !defined(__CINT__) -// input parameters -Bool_t DEBUG; -TString DIR; -TString LIST; -TString OPTIONS; -ULong64_t MAXEV; -TString OUTFILE; +// // input parameters +// Bool_t DEBUG; +// TString DIR; +// TString LIST; +// TString OPTIONS; +// ULong64_t MAXEV; +// TString OUTFILE; void usage(){