#include //-------------------------------------- // // //-------------------------------------- /** * Default constructor */ PamTrack::PamTrack(){ trk_track = this->TrkTrack::GetTrkTrack(); calo_track = this->CaloTrkVar::GetCaloTrkVar(); tof_track = this->ToFTrkVar::GetToFTrkVar(); }; //-------------------------------------- // // //-------------------------------------- /** * Constructor */ PamTrack::PamTrack(TrkTrack* t, CaloTrkVar* c, ToFTrkVar* o){ trk_track = this->TrkTrack::GetTrkTrack(); calo_track = this->CaloTrkVar::GetCaloTrkVar(); tof_track = this->ToFTrkVar::GetToFTrkVar(); if(t) *trk_track = *t; if(c) *calo_track = *c; if(o) *tof_track = *o; }; //-------------------------------------- // // //-------------------------------------- /** * Constructor */ PamLevel2::PamLevel2(){ trk1_obj = this->TrkLevel1::GetTrkLevel1(); trk2_obj = this->TrkLevel2::GetTrkLevel2(); trkh_obj = this->TrkHough::GetTrkHough(); calo1_obj = this->CaloLevel1::GetCaloLevel1(); calo2_obj = this->CaloLevel2::GetCaloLevel2(); tof_obj = this->ToFLevel2::GetToFLevel2(); trig_obj = this->TrigLevel2::GetTrigLevel2(); s4_obj = this->S4Level2::GetS4Level2(); nd_obj = this->NDLevel2::GetNDLevel2(); ac_obj = this->AcLevel2::GetAcLevel2(); orb_obj = this->OrbitalInfo::GetOrbitalInfo(); run_obj = new GL_RUN(); sorted_tracks = new TRefArray(); CAL2 = true; TRK2 = true; TRK1 = false; TRKh = false; TRG = true; TOF = true; S4 = true; ND = true; AC = true; ORB = true; }; /** * Destructor */ PamLevel2::~PamLevel2(){ TrkLevel1::Clear(); TrkLevel2::Clear(); CaloLevel2::Clear(); ToFLevel2::Clear(); TrigLevel2::Clear(); S4Level2::Clear(); NDLevel2::Clear(); AcLevel2::Clear(); OrbitalInfo::Clear(); delete run_obj; // delete sorted_tracks; sorted_tracks->Delete(); // clean the reference array }; /** * Clear the event */ void PamLevel2::Clear(){ TrkLevel1::Clear(); TrkLevel2::Clear(); CaloLevel2::Clear(); ToFLevel2::Clear(); TrigLevel2::Clear(); S4Level2::Clear(); NDLevel2::Clear(); AcLevel2::Clear(); OrbitalInfo::Clear(); sorted_tracks->Delete(); // clean the reference array }; //-------------------------------------- // // //-------------------------------------- /** * Retrieves the calorimeter track matching the seqno-th tracker stored track. * (If seqno = -1 retrieves the self-trigger calorimeter track) */ CaloTrkVar *PamLevel2::GetCaloStoredTrack(int seqno){ if( CaloLevel2::ntrk()==0 ){ cout << "PamLevel2::GetCaloStoredTrack(int) : requested tracker SeqNo "<< seqno <<" but no Calorimeter tracks are stored"<trkseqno && it_calo < CaloLevel2::ntrk()); if(!c || seqno != c->trkseqno){ c = 0; if(seqno!=-1)cout << "PamLevel2::GetCaloStoredTrack(int) : requested tracker SeqNo "<< seqno <<" does not match Calorimeter stored tracks"<trkseqno && it_tof < ToFLevel2::ntrk()); if(!c || seqno != c->trkseqno){ c = 0; if(seqno!=-1)cout << "PamLevel2::GetToFStoredTrack(int) : requested tracker SeqNo "<< seqno <<" does not match ToF stored tracks"<GetSeqNo()); if(TOF) o = GetToFStoredTrack(t->GetSeqNo()); // if(t && c && o)track = new PamTrack(t,c,o); PamTrack *track = new PamTrack(t,c,o); return track; }; //-------------------------------------- // // //-------------------------------------- /** * Retrieves the it-th stored track. * It override TrkLevel2::GetTrack(int it). * @param itrk Track number, ranging from 0 to GetNTracks(). */ PamTrack* PamLevel2::GetStoredTrack(Int_t itrk){ PamTrack *track = 0; if( itrk >=0 && itrk < TrkLevel2::ntrk() ){ TrkTrack *t = TrkLevel2::GetStoredTrack(itrk); track = GetPamTrackAlong(t); }else{ cout << "PamLevel2::GetStoredTrack(int) : tracker track SeqNo "<< itrk <<" does not exist (GetNTracks() = "<Delete(); //temporaneo??? // loop over the tracks sorted by the tracker Bool_t use_TRK = how.Contains("TRK", TString::kIgnoreCase); Bool_t use_CAL = how.Contains("CAL", TString::kIgnoreCase); Bool_t use_TOF = how.Contains("TOF", TString::kIgnoreCase); if( !CAL2 && use_CAL) use_CAL = false; if( !TOF && use_TOF) use_TOF = false; if( !TRK2 ){ cout << "SortTracks() : without tracker does not work!!! (not yet)" << endl; return; }; for(Int_t i=0; i < TrkLevel2::GetNTracks(); i++){ TrkTrack *ts = 0; // get tracker tracks TrkTrack *tp = TrkLevel2::GetTrack(i); //tracker CaloTrkVar *cp = 0; ToFTrkVar *op = 0; // if track has an image, check image selection if(tp->HasImage()){ TrkTrack *ti = TrkLevel2::GetTrackImage(i); //tracker (image) CaloTrkVar *ci = 0; ToFTrkVar *oi = 0; //assign starting scores Int_t tp_score = 0; //main track sorted by the tracker Int_t ti_score = 0; //image track // ------------------------ // calorimeter check // ------------------------ // check the Y spatial residual on the first calorimeter plane // (cut on calorimeter variables from Emiliano) if( use_CAL && npcfit[1] > 15 && //no. of fit planes on Y view varcfit[1] < 1000. && //fit variance on Y view true){ cp = GetCaloStoredTrack(tp->GetSeqNo()); ci = GetCaloStoredTrack(ti->GetSeqNo()); Float_t resy_p = cp->tbar[0][1] - cbar[0][1]; if(resy_p < 0)resy_p= - resy_p; Float_t resy_i = ci->tbar[0][1] - cbar[0][1]; if(resy_i < 0)resy_i= - resy_i; if(resy_p <= resy_i) tp_score++; else ti_score++; }; // ------------------------ // TOF check // ------------------------ // check the number of hit pmts along the track // on S12 S21 and S32, where paddles are parallel to Y axis if( use_TOF ){ Int_t nphit_p =0; Int_t nphit_i =0; op = GetToFStoredTrack(tp->GetSeqNo()); oi = GetToFStoredTrack(ti->GetSeqNo()); /* cout << "track: npmtadc "<< op->npmtadc << endl; cout << "track: npmttdc "<< op->npmttdc << endl; cout << "image: npmtadc "<< oi->npmtadc << endl; cout << "image: npmttdc "<< oi->npmttdc << endl;*/ for (Int_t ih=0; ih < op->npmtadc; ih++){ Int_t pl = GetPlaneIndex( (op->pmtadc).At(ih) ); if(pl == 1 || pl == 2 || pl == 5)nphit_p++; }; for (Int_t ih=0; ih < oi->npmtadc; ih++){ Int_t pl = GetPlaneIndex( (oi->pmtadc).At(ih) ); if(pl == 1 || pl == 2 || pl == 5)nphit_i++; }; if( use_TOF && (nphit_p+nphit_i) !=0 && true){ if( nphit_p >= nphit_i) tp_score++; else ti_score++; }; }; if(tp_score == ti_score) use_TRK = true; // ------------------------ // tracker check // ------------------------ // chi**2 difference is not always large enough to distinguish among // the real track and its image. // Tracker check will be applied always when calorimeter and tof information is ambiguous. if(use_TRK){ if( tp->chi2 > 0 && tp->chi2 < ti->chi2 ) tp_score++ ; else if( ti->chi2 > 0 && ti->chi2 < tp->chi2 ) ti_score++ ; }; // ------------------------ // the winner is.... // ------------------------ if (tp_score > ti_score) ts = tp;//the track sorted by the tracker!! else if (tp_score < ti_score) ts = ti;//its image!! else { ts = tp; // cout << "Warning - track image ambiguity not solved" << endl; // cout << ts->GetNtot() << " "<< ts->chi2 << " " << npcfit[1] << " "<< nphit_p << endl; }; }else{ ts = tp; }; // cout <<" SortTracks() "<Add(ts);//save the track in the sorted array // cout << "SortTracks:: sorted_tracks->Add(it) "<=0 && it < TrkLevel2::GetNTracks() && itGetEntriesFast() ){ TrkTrack *t = (TrkTrack*)sorted_tracks->At(it); track = GetPamTrackAlong(t); }else{ cout << "PamLevel2::GetTrack(int) : tracker track SeqNo "<< it <<" does not exist (GetNTracks() = "<=0 && it < TrkLevel2::GetNTracks() ){ TrkTrack *temp = (TrkTrack*)sorted_tracks->At(it); if( temp->HasImage() ){ TrkTrack *t = TrkLevel2::GetStoredTrack(temp->GetImageSeqNo()); image = GetPamTrackAlong(t); }else{ cout <<"PamLevel2::GetTrackImage(int) : Track SeqNo "<Get("Tracker"); if(T && (TRK2||TRK1||TRKh)) { if(TRK2)T->SetBranchAddress("TrkLevel2", GetPointerToTrk(2)); if(TRK2)cout << "Tracker : set branch address TrkLevel2"<SetBranchAddress("TrkLevel1", GetPointerToTrk(1)); if(TRK1)cout << "Tracker : set branch address TrkLevel1"<SetBranchAddress("TrkHough", GetPointerToTrk(3)); // if(TRKh)cout << "Tracker : set branch address TrkHough"<Get("Calorimeter"); if(C && CAL2) { C->SetBranchAddress("CaloLevel2", GetPointerToCalo()); cout << "Calorimeter : set branch address CaloLevel2"<AddFriend(C); }else{ cout << "Calorimeter : missing tree"<Get("ToF"); if(O && TOF) { O->SetBranchAddress("ToFLevel2", GetPointerToToF()); cout << "ToF : set branch address ToFLevel2"<AddFriend(O); }else{ cout << "ToF : missing tree"<Get("Trigger"); if(R && TRG) { R->SetBranchAddress("TrigLevel2", GetPointerToTrig()); cout << "Trigger : set branch address TrigLevel2"<AddFriend(R); }else{ cout << "Trigger : missing tree"<Get("S4"); if(S && S4) { S->SetBranchAddress("S4Level2", GetPointerToS4()); cout << "S4 : set branch address S4Level2"<AddFriend(S); }else{ cout << "S4 : missing tree"<Get("NeutronD"); if(N && ND) { N->SetBranchAddress("NDLevel2", GetPointerToND()); cout << "NeutronD : set branch address NDLevel2"<AddFriend(N); }else{ cout << "NeutronD : missing tree"<Get("Anticounter"); if(A && AC) { A->SetBranchAddress("AcLevel2", GetPointerToAc()); cout << "Anticounter : set branch address AcLevel2"<AddFriend(A); }else{ cout << "Anticounter : missing tree"<Get("OrbitalInfo"); if(B && ORB) { B->SetBranchAddress("OrbitalInfo", GetPointerToOrb()); cout << "OrbitalInfo : set branch address OrbitalInfo"<AddFriend(B); }else{ cout << "OrbitalInfo : missing tree"<GetEntries()<WorkingDirectory(); if(ddir=="")ddir = wdir; // TSystemDirectory *datadir = new TSystemDirectory(gSystem->BaseName(ddir),ddir); cout << "Level2 data directory : "<< ddir << endl; TList *contents = new TList; // create output list contents->SetOwner(); char *fullpath; // if no input file list is given: if ( flisttxt != "" ){ if( !gSystem->IsFileInIncludePath(flisttxt,&fullpath) )return 0; // flisttxt = gSystem->ConcatFileName(gSystem->DirName(flisttxt),gSystem->BaseName(flisttxt)); flisttxt = fullpath; if( !gSystem->ChangeDirectory(ddir) )return 0; cout <<"Input file list : " << flisttxt <> file; if (!in.good()) break; // cout <<"(1) " << file << endl; if(file.Contains("#"))file = file(0,file.First("#")); // cout <<"(2) " << file << endl; if( gSystem->IsFileInIncludePath(file,&fullpath) ){ contents->Add(new TSystemFile(fullpath,gSystem->DirName(fullpath)));// add file to the list }else{ if(file.Data()!="")cout << "File: "< missing "<< endl; }; }; in.close(); }else{ cout << "No input file list given."<WorkingDirectory()<< endl; TSystemDirectory *datadir = new TSystemDirectory(gSystem->BaseName(ddir),ddir); TList *temp = datadir->GetListOfFiles(); // temp->Print(); // cout << "*************************************" << endl; TIter next(temp); TSystemFile *questo = 0; while ( (questo = (TSystemFile*) next()) ) { TString name = questo-> GetName(); if( name.EndsWith(".root") ){ char *fullpath; gSystem->IsFileInIncludePath(name,&fullpath); contents->Add(new TSystemFile(fullpath,gSystem->DirName(fullpath))); }; } delete temp; delete datadir; }; gSystem->ChangeDirectory(wdir); // back to the working directory // cout << endl << "Selected files:" << endl; // contents->Print(); cout << contents->GetEntries()<<" files selected\n"; // cout << endl; // cout << "Working directory: "<< gSystem->WorkingDirectory()<< endl; return contents; }; //-------------------------------------- // // //-------------------------------------- /** * Get the Pamela detector chains from a list of files and make them friends. * @param fl Pointer to a TList of TSystemFiles * @param detlist String to select trees to be included * @return Pointer to a TChain */ TChain *PamLevel2::GetPamTree(TList *fl, TString detlist="+ALL"){ // TChain *Tout=0; // if(Tout)Tout->Delete(); // Tout = NULL; TChain *Tout =0; SetWhichTrees(detlist); TChain *T = 0; TChain *C = 0; TChain *O = 0; TChain *R = 0; TChain *S = 0; TChain *N = 0; TChain *A = 0; TChain *B = 0; if(TRK2||TRK1||TRKh) T = new TChain("Tracker"); if(CAL2||CAL1) C = new TChain("Calorimeter"); if(TOF) O = new TChain("ToF"); if(TRG) R = new TChain("Trigger"); if(S4) S = new TChain("S4"); if(ND) N = new TChain("NeutronD"); if(AC) A = new TChain("Anticounter"); if(ORB) B = new TChain("OrbitalInfo"); // loop over files and create chains TIter next(fl); TSystemFile *questo = 0; while ( (questo = (TSystemFile*) next()) ) { TString name = questo->GetName(); // cout << "File: "<< name << endl; if( CheckLevel2File(name) ){ if(TRK2||TRK1||TRKh) T->Add(name); if(CAL1||CAL2) C->Add(name); if(TOF) O->Add(name); if(TRG) R->Add(name); if(S4) S->Add(name); if(ND) N->Add(name); if(AC) A->Add(name); if(ORB) B->Add(name); }; } cout << "done chain \n"; // Tracker if(TRK2||TRK1||TRKh)if(!Tout)Tout=T; // Calorimeter if(CAL2||CAL1) { if(!Tout)Tout=C; else Tout->AddFriend("Calorimeter"); }; // ToF if(TOF) { if(!Tout)Tout=O; else Tout->AddFriend("ToF"); }; // Trigger if(TRG) { if(!Tout)Tout=O; else Tout->AddFriend("Trigger"); }; // S4 if(S4) { if(!Tout)Tout=O; else Tout->AddFriend("S4"); }; // Neutron Detector if(ND) { if(!Tout)Tout=O; else Tout->AddFriend("NeutronD"); }; // Anticounters if(AC) { if(!Tout)Tout=O; else Tout->AddFriend("Anticounter"); }; // OrbitalInfo if(ORB) { if(!Tout)Tout=O; else Tout->AddFriend("OrbitalInfo"); }; // cout<GetEntries()<GetEntries() )PamLevel2::SetBranchAddress(); if( Tout->GetEntries() )PamLevel2::SetBranchAddress( Tout ); return Tout; } //-------------------------------------- // // //-------------------------------------- /** * Set branch addresses for Pamela friend trees */ void PamLevel2::SetBranchAddress(TTree *t){ TRK2 = TRK2 & t->GetBranchStatus("TrkLevel2"); TRK1 = TRK1 & t->GetBranchStatus("TrkLevel1"); TRKh = TRKh & t->GetBranchStatus("TrkHough"); CAL2 = CAL2 & t->GetBranchStatus("CaloLevel2"); CAL1 = CAL1 & t->GetBranchStatus("CaloLevel1"); TOF = TOF & t->GetBranchStatus("ToFLevel2"); TRG = TRG & t->GetBranchStatus("TrigLevel2"); S4 = S4 & t->GetBranchStatus("S4Level2"); ND = ND & t->GetBranchStatus("NDLevel2"); AC = AC & t->GetBranchStatus("AcLevel2"); ORB = ORB & t->GetBranchStatus("OrbitalInfo"); // Tracker if(TRK1) { t->SetBranchAddress("TrkLevel1", GetPointerToTrk(1)); cout << "Tracker : set branch address TrkLevel1"<SetBranchAddress("TrkLevel2", GetPointerToTrk(2)); cout << "Tracker : set branch address TrkLevel2"<SetBranchAddress("TrkHough", GetPointerToTrk(3)); cout << "Tracker : set branch address TrkHough"<SetBranchAddress("CaloLevel1", GetPointerToCalo(1)); cout << "Calorimeter : set branch address CaloLevel1"<SetBranchAddress("CaloLevel2", GetPointerToCalo(2)); cout << "Calorimeter : set branch address CaloLevel2"<SetBranchAddress("ToFLevel2", GetPointerToToF()); cout << "ToF : set branch address ToFLevel2"<SetBranchAddress("TrigLevel2", GetPointerToTrig()); cout << "Trigger : set branch address TrigLevel2"<SetBranchAddress("S4Level2", GetPointerToS4()); cout << "S4 : set branch address S4Level2"<SetBranchAddress("NDLevel2", GetPointerToND()); cout << "NeutronD : set branch address NDLevel2"<SetBranchAddress("AcLevel2", GetPointerToAc()); cout << "Anticounter : set branch address AcLevel2"<SetBranchAddress("OrbitalInfo", GetPointerToOrb()); cout << "OrbitalInfo : set branch address OrbitalInfo"<GetBranchStatus("TrkLevel2"); TRK1 = TRK1 & t->GetBranchStatus("TrkLevel1"); TRKh = TRKh & t->GetBranchStatus("TrkHough"); CAL1 = CAL1 & t->GetBranchStatus("CaloLevel1"); CAL2 = CAL2 & t->GetBranchStatus("CaloLevel2"); TOF = TOF & t->GetBranchStatus("ToFLevel2"); TRG = TRG & t->GetBranchStatus("TrigLevel2"); S4 = S4 & t->GetBranchStatus("S4Level2"); ND = ND & t->GetBranchStatus("NDLevel2"); AC = AC & t->GetBranchStatus("AcLevel2"); ORB = ORB & t->GetBranchStatus("OrbitalInfo"); // Tracker if(TRK1) { t->SetBranchAddress("TrkLevel1", GetPointerToTrk(1)); cout << "Tracker : set branch address TrkLevel1"<SetBranchAddress("TrkLevel2", GetPointerToTrk(2)); cout << "Tracker : set branch address TrkLevel2"<SetBranchAddress("TrkHough", GetPointerToTrk(3)); cout << "Tracker : set branch address TrkHough"<SetBranchAddress("CaloLevel1", GetPointerToCalo(1)); cout << "Calorimeter : set branch address CaloLevel1"<SetBranchAddress("CaloLevel2", GetPointerToCalo(2)); cout << "Calorimeter : set branch address CaloLevel2"<SetBranchAddress("ToFLevel2", GetPointerToToF()); cout << "ToF : set branch address ToFLevel2"<SetBranchAddress("TrigLevel2", GetPointerToTrig()); cout << "Trigger : set branch address TrigLevel2"<SetBranchAddress("S4Level2", GetPointerToS4()); cout << "S4 : set branch address S4Level2"<SetBranchAddress("NDLevel2", GetPointerToND()); cout << "NeutronD : set branch address NDLevel2"<SetBranchAddress("AcLevel2", GetPointerToAc()); cout << "Anticounter : set branch address AcLevel2"<SetBranchAddress("OrbitalInfo", GetPointerToOrb()); cout << "OrbitalInfo : set branch address OrbitalInfo"<GetName(); // cout << "File: "<< name << endl; if( CheckLevel2File(name) ){ R->Add(name); }; } R->SetBranchAddress("RunInfo", GetPointerToRun()); cout << "Run : set branch address RunInfo"<Get("Run"); R->SetBranchAddress("RunInfo", GetPointerToRun()); cout << "Run : set branch address RunInfo"<IsZombie() ){ cout << "File: "<< f->GetName() <<" discarded ---- Non valid root file"<< endl; return false; } // cout << "Get list of keys: "<GetListOfKeys(); // lk->Print(); TIter next(lk); TKey *key =0; Int_t nev = 0; while( (key = (TKey*)next()) ){ // cout << key->GetName() << endl; // cout << " Get tree: " << f->Get(key->GetName())<GetClassName()=="TTree" && nev_previous && nev != nev_previous ){ // nev = ((TTree*)f->Get(key->GetName()))->GetEntries(); // cout << "File: "<< f->GetName() <<" discarded ---- "<< key->GetName() << " tree: n.entries does not match "<GetName(),"Run" ) )RUN__ok = true; //========================================================= if( !strcmp(key->GetName(),"Trigger" ) ){ TRG__ok = true; if(TRG){ Int_t nevt = ((TTree*)f->Get("Trigger"))->GetEntries(); if( nev && nevt!=nev){ cout << "File: "<< f->GetName() <<" discarded ---- Trigger tree has "<GetName(),"ToF" ) ){ TOF__ok = true; if(TOF){ Int_t nevt = ((TTree*)f->Get("ToF"))->GetEntries(); if( nev && nevt!=nev){ cout << "File: "<< f->GetName() <<" discarded ---- ToF tree has "<GetName(),"S4" ) ){ S4__ok = true; if(S4){ Int_t nevt = ((TTree*)f->Get("S4"))->GetEntries(); if( nev && nevt!=nev){ cout << "File: "<< f->GetName() <<" discarded ---- S4 tree has "<GetName(),"NeutronD" ) ){ ND__ok = true; if(ND){ Int_t nevt = ((TTree*)f->Get("NeutronD"))->GetEntries(); if( nev && nevt!=nev){ cout << "File: "<< f->GetName() <<" discarded ---- NeutronD tree has "<GetName(),"Anticounter") ){ AC__ok = true; if(AC){ Int_t nevt = ((TTree*)f->Get("Anticounter"))->GetEntries(); if( nev && nevt!=nev){ cout << "File: "<< f->GetName() <<" discarded ---- Anticounter tree has "<GetName(),"OrbitalInfo") ){ ORB__ok = true; if(ORB){ Int_t nevt = ((TTree*)f->Get("OrbitalInfo"))->GetEntries(); if( nev && nevt!=nev){ cout << "File: "<< f->GetName() <<" discarded ---- OrbitalInfo tree has "<GetName(),"Tracker" ) ){ TTree *T = (TTree*)f->Get("Tracker"); if(TRK1||TRK2||TRKh){ Int_t nevt = T->GetEntries(); if( nev && nevt!=nev){ cout << "File: "<< f->GetName() <<" discarded ---- Tracker tree has "<GetListOfBranches()->GetEntries(); i++){ TString name = T->GetListOfBranches()->At(i)->GetName(); if( !name.CompareTo("TrkLevel1") )TRK1__ok=true; if( !name.CompareTo("TrkLevel2") )TRK2__ok=true; if( !name.CompareTo("TrkHough") )TRKh__ok=true; }; T->Delete(); }; //========================================================= if( !strcmp(key->GetName(),"Calorimeter" ) ){ TTree *T = (TTree*)f->Get("Calorimeter"); if(CAL1||CAL2){ Int_t nevt = T->GetEntries(); if( nev && nevt!=nev){ cout << "File: "<< f->GetName() <<" discarded ---- Calorimeter tree has "<GetListOfBranches()->GetEntries(); i++){ TString name = T->GetListOfBranches()->At(i)->GetName(); if( !name.CompareTo("CaloLevel1") )CAL1__ok=true; if( !name.CompareTo("CaloLevel2") )CAL2__ok=true; }; T->Delete(); }; }; if(!RUN__ok) { cout << "File: "<< f->GetName() <<" discarded ---- Missing RunInfo tree"<< endl; return false; }; if(CAL1 && !CAL1__ok){ cout << "File: "<< f->GetName() <<" discarded ---- Missing CaloLevel1 branch"<< endl; return false; }; if(CAL2 && !CAL2__ok){ cout << "File: "<< f->GetName() <<" discarded ---- Missing CaloLevel2 branch"<< endl; return false; }; if(TRK2 && !TRK2__ok){ cout << "File: "<< f->GetName() <<" discarded ---- Missing TrkLevel2 branch"<< endl; return false; }; if(TRK1 && !TRK1__ok){ cout << "File: "<< f->GetName() <<" discarded ---- Missing TrkLevel1 branch"<< endl; return false; }; if(TRKh && !TRKh__ok){ cout << "File: "<< f->GetName() <<" discarded ---- Missing TrkHough branch"<< endl; return false; }; if(ORB && !ORB__ok){ cout << "File: "<< f->GetName() <<" discarded ---- Missing ORB tree"<< endl; return false; }; if(AC && !AC__ok){ cout << "File: "<< f->GetName() <<" discarded ---- Missing AC tree"<< endl; return false; }; if(S4 && !S4__ok){ cout << "File: "<< f->GetName() <<" discarded ---- Missing S4 tree"<< endl; return false; }; if(TOF && !TOF__ok){ cout << "File: "<< f->GetName() <<" discarded ---- Missing ToF tree"<< endl; return false; }; if(ND && !ND__ok){ cout << "File: "<< f->GetName() <<" discarded ---- Missing ND tree"<< endl; return false; }; if(TRG && !TRG__ok){ cout << "File: "<< f->GetName() <<" discarded ---- Missing Trigger tree"<< endl; return false; }; lk->Delete(); f->Close(); return true; };