403 |
GetRunTree(listf); |
GetRunTree(listf); |
404 |
}; |
}; |
405 |
|
|
406 |
|
PamLevel2::PamLevel2(TString ddir,TList *list,TString detlist){ |
407 |
|
Initialize(); |
408 |
|
GetPamTree(list,detlist); |
409 |
|
GetRunTree(list); |
410 |
|
}; |
411 |
/** |
/** |
412 |
* Constructor |
* Constructor |
413 |
* @param ddir Name of directory where level2 files are stored. |
* @param ddir Name of directory where level2 files are stored. |
725 |
// |
// |
726 |
}; |
}; |
727 |
|
|
728 |
Bool_t PamLevel2::IsGood(){ |
Bool_t PamLevel2::IsGood(Bool_t strict){ |
729 |
Bool_t goodev=true; |
Bool_t goodev=true; |
730 |
// if(trk2_obj && trk2_obj->UnpackError() != 0 ) goodev = false; |
// |
731 |
if(calo2_obj && calo2_obj->good != 1) goodev = false; |
if(calo2_obj && !calo2_obj->IsGood(strict) ) goodev = false; |
732 |
|
// |
733 |
|
if ( strict ){ |
734 |
|
if(trk2_obj && trk2_obj->UnpackError() != 0 ) goodev = false; |
735 |
if(tof_obj && tof_obj->unpackError != 0) goodev = false; |
if(tof_obj && tof_obj->unpackError != 0) goodev = false; |
736 |
if(trig_obj && trig_obj->unpackError != 0) goodev = false; |
if(trig_obj && trig_obj->unpackError != 0) goodev = false; |
737 |
if(s4_obj && s4_obj->unpackError != 0) goodev = false; |
if(s4_obj && s4_obj->unpackError != 0) goodev = false; |
738 |
if(nd_obj && nd_obj->unpackError != 0) goodev = false; |
if(nd_obj && nd_obj->unpackError != 0) goodev = false; |
739 |
if(ac_obj && ac_obj->unpackError != 255) goodev = false; |
if(ac_obj && (ac_obj->unpackError != 0 || ((ac_obj->status[0]>>3)&1) || ((ac_obj->status[0]>>3)&1)) ) goodev = false; |
740 |
// if(orb_obj) |
// if(orb_obj) |
741 |
return goodev; |
} else { |
742 |
|
if(nd_obj && nd_obj->unpackError != 0) goodev = false; |
743 |
|
if(ac_obj && (ac_obj->unpackError != 0 || ((ac_obj->status[0]>>3)&1) || ((ac_obj->status[0]>>3)&1)) ) goodev = false; |
744 |
|
}; |
745 |
|
return(goodev); |
746 |
}; |
}; |
747 |
|
|
748 |
//-------------------------------------- |
//-------------------------------------- |
768 |
return &trk2_obj; |
return &trk2_obj; |
769 |
}; |
}; |
770 |
if(!objname.CompareTo("TrkHough")) { |
if(!objname.CompareTo("TrkHough")) { |
771 |
if(!trkh_obj) trkh_obj = new TrkHough(); |
if(!trkh_obj) { |
772 |
|
trkh_obj = new TrkHough(); |
773 |
|
trkh_obj->Set(); |
774 |
|
} |
775 |
return &trkh_obj; |
return &trkh_obj; |
776 |
}; |
}; |
777 |
if(!objname.CompareTo("CaloLevel1")) { |
if(!objname.CompareTo("CaloLevel1")) { |
2752 |
// -------------------------------------- |
// -------------------------------------- |
2753 |
// ---> exit with TRUE |
// ---> exit with TRUE |
2754 |
// -------------------------------------- |
// -------------------------------------- |
2755 |
cout << endl << " ))))) UPDATE RUN INFO ((((( @iev "<<iev<<" run "<<GetRunInfo()->ID<<" irun "<<irun<<endl; |
if(DBG)cout << endl << " ))))) UPDATE RUN INFO ((((( @iev "<<iev<<" run "<<GetRunInfo()->ID<<" irun "<<irun<<endl; |
2756 |
|
// ---------------------------------------------------- |
2757 |
|
// update the tracker parameters |
2758 |
|
// (non ho trovato nessun altro modo sicuro di farlo...) |
2759 |
|
// ---------------------------------------------------- |
2760 |
|
if(!dbc || (dbc && !dbc->IsConnected()) )SetDBConnection(); |
2761 |
|
TrkParams::Set(GetRunInfo() ,dbc); |
2762 |
|
if(dbc)dbc->Close(); |
2763 |
|
|
2764 |
// ---------------------------------------------------- |
// ---------------------------------------------------- |
2765 |
// then check if the run has a fragment |
// then check if the run has a fragment |
2766 |
// in this case we have to switch to the next fragment |
// in this case we have to switch to the next fragment |
2769 |
if( |
if( |
2770 |
GetRunInfo()->ID_RUN_FRAG != 0 && |
GetRunInfo()->ID_RUN_FRAG != 0 && |
2771 |
// GetRunInfo()->ID_RUN_FRAG != GetRunInfo()->ID && |
// GetRunInfo()->ID_RUN_FRAG != GetRunInfo()->ID && |
2772 |
|
DBG && |
2773 |
true ){ |
true ){ |
2774 |
cout << "* fragment *"<<endl; |
cout << "* fragment *"<<endl; |
2775 |
} |
} |
2815 |
cout << " obt "<<obt; |
cout << " obt "<<obt; |
2816 |
cout <<" >> "<<GetRunInfo()->RUNHEADER_OBT<<" "<<GetRunInfo()->RUNTRAILER_OBT; |
cout <<" >> "<<GetRunInfo()->RUNHEADER_OBT<<" "<<GetRunInfo()->RUNTRAILER_OBT; |
2817 |
cout << " *** JUMP RUN *** irun "<<irun; |
cout << " *** JUMP RUN *** irun "<<irun; |
|
// if(!SECONDO_GIRO)cout << " (don't worry)"; |
|
|
// else cout << " (start worring...)"; |
|
2818 |
cout << endl; |
cout << endl; |
2819 |
} |
} |
2820 |
// irun++; |
// irun++; |
2846 |
cout << " obt "<<obt; |
cout << " obt "<<obt; |
2847 |
cout <<" >> "<<GetRunInfo()->RUNHEADER_OBT<<" "<<GetRunInfo()->RUNTRAILER_OBT; |
cout <<" >> "<<GetRunInfo()->RUNHEADER_OBT<<" "<<GetRunInfo()->RUNTRAILER_OBT; |
2848 |
} |
} |
2849 |
cout << endl; |
if(DBG)cout << endl; |
2850 |
cout << endl << " ))))) UPDATE RUN INFO ((((( @iev "<<iev<<" run "<<GetRunInfo()->ID<<" (run-entry "<<irun<<")"<<endl; |
if(DBG)cout << endl << " ))))) UPDATE RUN INFO ((((( @iev "<<iev<<" run "<<GetRunInfo()->ID<<" (run-entry "<<irun<<")"<<endl; |
2851 |
|
// ---------------------------------------------------- |
2852 |
|
// update the tracker parameters |
2853 |
|
// (non ho trovato nessun altro modo sicuro di farlo...) |
2854 |
|
// ---------------------------------------------------- |
2855 |
|
if(!dbc || (dbc && !dbc->IsConnected()) )SetDBConnection(); |
2856 |
|
TrkParams::Set(GetRunInfo() ,dbc); |
2857 |
|
if(dbc)dbc->Close(); |
2858 |
// cout << endl; |
// cout << endl; |
2859 |
prevshift = 0; |
prevshift = 0; |
2860 |
return true; |
return true; |
3926 |
// } |
// } |
3927 |
|
|
3928 |
if ( TRK0 ){ |
if ( TRK0 ){ |
3929 |
TrkParams::Load(6); |
// TrkParams::Load(6); |
3930 |
if( !TrkParams::IsLoaded(6) ){ |
// if( !TrkParams::IsLoaded(6) ){ |
3931 |
cout << " TTree* PamLevel2::GetYodaTree( ) -- WARNING -- VK-mask not loaded"<<endl; |
// cout << " TTree* PamLevel2::GetYodaTree( ) -- WARNING -- VK-mask not loaded"<<endl; |
3932 |
}; |
// }; |
3933 |
if(!dbc || (dbc && !dbc->IsConnected()))SetDBConnection(); |
// if(!dbc || (dbc && !dbc->IsConnected()))SetDBConnection(); |
3934 |
TrkParams::SetCalib(run_obj,dbc); |
TrkParams::SetCalib(run_obj,dbc); |
3935 |
TrkParams::LoadCalib( ); |
TrkParams::LoadCalib( ); |
3936 |
if( !TrkParams::CalibIsLoaded() ){ |
if( !TrkParams::CalibIsLoaded() ){ |
3937 |
cout << " TTree* PamLevel2::GetYodaTree( ) -- WARNING -- Calibration not loaded"<<endl; |
cout << " TTree* PamLevel2::GetYodaTree( ) -- WARNING -- Calibration not loaded"<<endl; |
3938 |
}; |
}; |
3939 |
dbc->Close(); // EMILIANO, do not leave open connections, open only when needed |
// if(dbc)dbc->Close(); // EMILIANO, do not leave open connections, open only when needed |
3940 |
} |
} |
3941 |
|
|
3942 |
|
|
4005 |
do{ |
do{ |
4006 |
if(shift>0){ |
if(shift>0){ |
4007 |
cout << " PKTNUM L2 --- "<< pktn << " --- L0 --- "<< GetEventHeader()->GetPscuHeader()->GetCounter()<<endl; |
cout << " PKTNUM L2 --- "<< pktn << " --- L0 --- "<< GetEventHeader()->GetPscuHeader()->GetCounter()<<endl; |
4008 |
cout << " RUN: ID "<< GetRunInfo()->ID << " ID_ROOT_L0 "<<run_obj->ID_ROOT_L0<<" ID_RUN_FRAG "<<GetRunInfo()->ID_RUN_FRAG << " EV_FROM "<<GetRunInfo()->EV_FROM <<endl; |
if(DBG)cout << " RUN: ID "<< GetRunInfo()->ID << " ID_ROOT_L0 "<<run_obj->ID_ROOT_L0<<" ID_RUN_FRAG "<<GetRunInfo()->ID_RUN_FRAG << " EV_FROM "<<GetRunInfo()->EV_FROM <<endl; |
4009 |
cout << " L2 <--> L0 mismatch ( irun "<<irun<<" irunentry "<<irunentry<<" shift "<<shift<<" prevshift "<<prevshift<<" )"<<endl; |
if(DBG)cout << " L2 <--> L0 mismatch ( irun "<<irun<<" irunentry "<<irunentry<<" shift "<<shift<<" prevshift "<<prevshift<<" )"<<endl; |
4010 |
} |
} |
4011 |
answer = l0_tree->GetEntry(quellagiusta+(Long64_t)shift+(Long64_t)prevshift); |
answer = l0_tree->GetEntry(quellagiusta+(Long64_t)shift+(Long64_t)prevshift); |
4012 |
shift++; |
shift++; |
4039 |
&& (quellagiusta+(Long64_t)shift) < GetYodaTree()->GetEntries() && shift < maxshift); |
&& (quellagiusta+(Long64_t)shift) < GetYodaTree()->GetEntries() && shift < maxshift); |
4040 |
|
|
4041 |
if ( (quellagiusta+(Long64_t)shift+(Long64_t)prevshift) > GetYodaTree()->GetEntries() || shift == maxshift ) { |
if ( (quellagiusta+(Long64_t)shift+(Long64_t)prevshift) > GetYodaTree()->GetEntries() || shift == maxshift ) { |
4042 |
cout << " Big trouble here, no such event in Level0 data! " <<endl; |
cout << " Big trouble here, no such event in Level0 data! (NB maxshift set to "<<maxshift<<" )" <<endl; |
4043 |
return 0; |
return 0; |
4044 |
} |
} |
4045 |
// cout << "LA ENTRY GIUSTA E`: "<<quellagiusta<<" (spero...)"<<endl; |
// cout << "LA ENTRY GIUSTA E`: "<<quellagiusta<<" (spero...)"<<endl; |
4054 |
*/ |
*/ |
4055 |
Bool_t PamLevel2::SetDBConnection(){ |
Bool_t PamLevel2::SetDBConnection(){ |
4056 |
|
|
4057 |
|
// cout << "PamLevel2::SetDBConnection()" << endl; |
4058 |
if(DBG){ |
if(DBG){ |
4059 |
cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl; |
cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl; |
4060 |
cout<<"Connecting to DB"<<endl; |
cout<<"Connecting to DB"<<endl; |