100 |
// nd_obj = NDLevel2::GetNDLevel2(); |
// nd_obj = NDLevel2::GetNDLevel2(); |
101 |
// ac_obj = AcLevel2::GetAcLevel2(); |
// ac_obj = AcLevel2::GetAcLevel2(); |
102 |
// orb_obj = OrbitalInfo::GetOrbitalInfo(); |
// orb_obj = OrbitalInfo::GetOrbitalInfo(); |
103 |
|
|
104 |
|
h0_obj = 0; |
105 |
|
trk0_obj = 0; |
106 |
|
|
107 |
trk2_obj = 0; |
trk2_obj = 0; |
108 |
trk1_obj = 0; |
trk1_obj = 0; |
109 |
trkh_obj = 0; |
trkh_obj = 0; |
122 |
runfirstentry = 0ULL; |
runfirstentry = 0ULL; |
123 |
runlastentry = 0ULL; |
runlastentry = 0ULL; |
124 |
|
|
125 |
for(Int_t i=0; i<8; i++ )tree_clone[i]=NULL; |
l0_file = NULL; |
126 |
|
l0_tree = NULL; |
127 |
|
iroot = -1; |
128 |
|
dbc = 0; |
129 |
|
|
130 |
|
irun = -1; |
131 |
|
run_tree = NULL; |
132 |
|
run_tree_clone = NULL; |
133 |
|
sel_tree = NULL; |
134 |
|
sel_tree_clone = NULL; |
135 |
|
|
136 |
|
irunentry = -1; |
137 |
|
pam_tree = NULL; |
138 |
|
for(Int_t i=0; i<NCLONES; i++ )pam_tree_clone[i]=NULL; |
139 |
|
|
140 |
|
host = "mysql://localhost/pamelaprod"; |
141 |
|
user = "anonymous"; |
142 |
|
psw = ""; |
143 |
|
const char *pamdbhost=gSystem->Getenv("PAM_DBHOST"); |
144 |
|
const char *pamdbuser=gSystem->Getenv("PAM_DBUSER"); |
145 |
|
const char *pamdbpsw=gSystem->Getenv("PAM_DBPSW"); |
146 |
|
if ( !pamdbhost ) pamdbhost = ""; |
147 |
|
if ( !pamdbuser ) pamdbuser = ""; |
148 |
|
if ( !pamdbpsw ) pamdbpsw = ""; |
149 |
|
if ( strcmp(pamdbhost,"") ) host = pamdbhost; |
150 |
|
if ( strcmp(pamdbuser,"") ) user = pamdbuser; |
151 |
|
if ( strcmp(pamdbpsw,"") ) psw = pamdbpsw; |
152 |
|
|
153 |
|
|
154 |
|
|
155 |
// sorted_tracks = 0;//new TRefArray(); |
// sorted_tracks = 0;//new TRefArray(); |
156 |
|
|
157 |
|
CAL0 = false; |
158 |
CAL1 = true; |
CAL1 = true; |
159 |
CAL2 = true; |
CAL2 = true; |
160 |
TRK2 = true; |
TRK2 = true; |
161 |
TRK1 = false; |
TRK1 = false; |
162 |
TRKh = false; |
TRKh = false; |
163 |
TRG = true; |
TRKh = false; |
164 |
TOF = true; |
TRG = true; |
165 |
S4 = true; |
TOF = true; |
166 |
ND = true; |
TOF0 = false; |
167 |
AC = true; |
S4 = true; |
168 |
ORB = true; |
ND = true; |
169 |
|
AC = true; |
170 |
|
ORB = true; |
171 |
|
|
172 |
RUN = true; |
RUN = true; |
173 |
|
|
174 |
|
SELLI = -1; |
175 |
|
|
176 |
tsorted=0; |
tsorted=0; |
177 |
timage=0; |
timage=0; |
186 |
if(soft_obj)delete soft_obj; //Emiliano |
if(soft_obj)delete soft_obj; //Emiliano |
187 |
|
|
188 |
// cout << "void PamLevel2::Clear()"<<endl; |
// cout << "void PamLevel2::Clear()"<<endl; |
189 |
|
if(h0_obj) delete h0_obj; |
190 |
|
if(trk0_obj) delete trk0_obj; |
191 |
if(trk1_obj) delete trk1_obj; |
if(trk1_obj) delete trk1_obj; |
192 |
if(trk2_obj) delete trk2_obj; |
if(trk2_obj) delete trk2_obj; |
193 |
if(trkh_obj) delete trkh_obj; |
if(trkh_obj) delete trkh_obj; |
208 |
timage->Delete(); |
timage->Delete(); |
209 |
delete timage; |
delete timage; |
210 |
} |
} |
211 |
|
|
212 |
|
if(dbc){ |
213 |
|
dbc->Close(); |
214 |
|
delete dbc; |
215 |
|
} |
216 |
|
|
217 |
|
if(l0_file)l0_file->Close(); |
218 |
|
if(pam_tree)pam_tree->Delete();; |
219 |
|
if(run_tree)run_tree->Delete();; |
220 |
|
if(sel_tree)sel_tree->Delete();; |
221 |
|
for(Int_t i=0; i<NCLONES; i++ )if(pam_tree_clone[i])pam_tree_clone[i]->Delete();; |
222 |
|
if(run_tree_clone)run_tree_clone->Delete();; |
223 |
|
if(sel_tree_clone)sel_tree_clone->Delete();; |
224 |
|
|
225 |
|
|
226 |
}; |
}; |
227 |
|
|
228 |
/** |
/** |
240 |
// if(run_obj) run_obj->Clear(); // Emiliano: Do not deallocate run_obj here, it will give segmentation fault! call clear instead |
// if(run_obj) run_obj->Clear(); // Emiliano: Do not deallocate run_obj here, it will give segmentation fault! call clear instead |
241 |
// if(soft_obj) soft_obj->Clear(); |
// if(soft_obj) soft_obj->Clear(); |
242 |
|
|
243 |
|
if(h0_obj) h0_obj->Clear(); |
244 |
|
if(trk0_obj) trk0_obj->Clear(); |
245 |
if(trk1_obj) trk1_obj->Clear(); |
if(trk1_obj) trk1_obj->Clear(); |
246 |
if(trk2_obj) trk2_obj->Clear(); |
if(trk2_obj) trk2_obj->Clear(); |
247 |
if(trkh_obj) trkh_obj->Clear(); |
if(trkh_obj) trkh_obj->Clear(); |
831 |
|
|
832 |
// if( !detlist.IsNull() ) SetWhichTrees(detlist); |
// if( !detlist.IsNull() ) SetWhichTrees(detlist); |
833 |
// else GetWhichTrees(f); |
// else GetWhichTrees(f); |
834 |
|
|
835 |
|
cout << "TTree *PamLevel2::GetPamTree(TFile *f, TString detlist ) -- obsolte "<<endl; |
836 |
|
|
837 |
SetWhichTrees(detlist); |
SetWhichTrees(detlist); |
838 |
|
|
839 |
TTree *Trout =0; |
TTree *Trout =0; |
841 |
TString fname = f->GetName(); |
TString fname = f->GetName(); |
842 |
if(!CheckLevel2File(fname))return NULL; |
if(!CheckLevel2File(fname))return NULL; |
843 |
|
|
844 |
UInt_t *found=0; |
// UInt_t *found=0; |
845 |
|
|
846 |
cout<< "GetPamTree(TFile*,TString): detector list --> "; |
cout<< "GetPamTree(TFile*,TString): detector list --> "; |
847 |
if(TRK1)cout<<"TRK1 "; |
if(TRK1)cout<<"TRK1 "; |
856 |
if(S4)cout<<"S4 "; |
if(S4)cout<<"S4 "; |
857 |
if(ORB)cout<<"ORB "; |
if(ORB)cout<<"ORB "; |
858 |
cout << endl; |
cout << endl; |
859 |
|
if(SELLI)cout<<">>> Found selection-list <<<"<<endl; |
860 |
|
|
861 |
f->cd(); |
f->cd(); |
862 |
|
|
864 |
TTree *T = (TTree*)f->Get("Tracker"); |
TTree *T = (TTree*)f->Get("Tracker"); |
865 |
if(T && (TRK2||TRK1||TRKh)) { |
if(T && (TRK2||TRK1||TRKh)) { |
866 |
if(TRK2)T->SetBranchAddress("TrkLevel2", GetPointerTo("TrkLevel2")); |
if(TRK2)T->SetBranchAddress("TrkLevel2", GetPointerTo("TrkLevel2")); |
867 |
else T->SetBranchStatus("TrkLevel2",0,found); |
// else T->SetBranchStatus("TrkLevel2",0,found); |
868 |
if(TRK2)cout << "Tracker : set branch address TrkLevel2"<<endl; |
if(TRK2)cout << "Tracker : set branch address TrkLevel2"<<endl; |
869 |
if(TRK1)T->SetBranchAddress("TrkLevel1", GetPointerTo("TrkLevel1")); |
if(TRK1)T->SetBranchAddress("TrkLevel1", GetPointerTo("TrkLevel1")); |
870 |
else T->SetBranchStatus("TrkLevel1",0,found); |
// else T->SetBranchStatus("TrkLevel1",0,found); |
871 |
if(TRK1)cout << "Tracker : set branch address TrkLevel1"<<endl; |
if(TRK1)cout << "Tracker : set branch address TrkLevel1"<<endl; |
872 |
if(TRKh)T->SetBranchAddress("TrkHough", GetPointerTo("TrkHough")); |
if(TRKh)T->SetBranchAddress("TrkHough", GetPointerTo("TrkHough")); |
873 |
else T->SetBranchStatus("TrkHough",0,found); |
// else T->SetBranchStatus("TrkHough",0,found); |
874 |
if(TRKh)cout << "Tracker : set branch address TrkHough"<<endl; |
if(TRKh)cout << "Tracker : set branch address TrkHough"<<endl; |
875 |
if(!Trout)Trout=T; |
if(!Trout)Trout=T; |
876 |
else Trout->AddFriend(T); |
else Trout->AddFriend(T); |
881 |
TTree *C = (TTree*)f->Get("Calorimeter"); |
TTree *C = (TTree*)f->Get("Calorimeter"); |
882 |
if(C && (CAL2||CAL1)) { |
if(C && (CAL2||CAL1)) { |
883 |
if(CAL2)C->SetBranchAddress("CaloLevel2", GetPointerTo("CaloLevel2")); |
if(CAL2)C->SetBranchAddress("CaloLevel2", GetPointerTo("CaloLevel2")); |
884 |
else C->SetBranchStatus("CaloLevel2",0,found); |
// else C->SetBranchStatus("CaloLevel2",0,found); |
885 |
if(CAL2)cout << "Calorimeter : set branch address CaloLevel2"<<endl; |
if(CAL2)cout << "Calorimeter : set branch address CaloLevel2"<<endl; |
886 |
if(CAL1)C->SetBranchAddress("CaloLevel1", GetPointerTo("CaloLevel1")); |
if(CAL1)C->SetBranchAddress("CaloLevel1", GetPointerTo("CaloLevel1")); |
887 |
else C->SetBranchStatus("CaloLevel1",0,found); |
// else C->SetBranchStatus("CaloLevel1",0,found); |
888 |
if(CAL1)cout << "Calorimeter : set branch address CaloLevel1"<<endl; |
if(CAL1)cout << "Calorimeter : set branch address CaloLevel1"<<endl; |
889 |
if(!Trout)Trout=C; |
if(!Trout)Trout=C; |
890 |
else Trout->AddFriend(C); |
else Trout->AddFriend(C); |
952 |
}else{ |
}else{ |
953 |
cout << "OrbitalInfo : missing tree"<<endl; |
cout << "OrbitalInfo : missing tree"<<endl; |
954 |
}; |
}; |
955 |
|
|
956 |
|
TTree *L = (TTree*)f->Get("SelectionList"); |
957 |
|
if(L && SELLI==1) { |
958 |
|
// L->SetBranchAddress("RunEntry",&irun); |
959 |
|
// cout << "SelectionList: set branch address RunEntry"<<endl; |
960 |
|
// L->SetBranchAddress("EventEntry",&irunentry); |
961 |
|
// cout << "SelectionList: set branch address EventEntry"<<endl; |
962 |
|
// if(!Trout)Trout=O; |
963 |
|
// else Trout->AddFriend("SelectionList"); |
964 |
|
cout << " TTree *PamLevel2::GetPamTree(TFile, TString) >>> SelectionList not implemente!!!!"<<endl; |
965 |
|
sel_tree = 0; |
966 |
|
}else{ |
967 |
|
cout << "SelectionList : missing tree"<<endl; |
968 |
|
}; |
969 |
|
|
970 |
cout<<endl<<" Number of entries: "<<Trout->GetEntries()<<endl<<endl; |
cout<<endl<<" Number of entries: "<<Trout->GetEntries()<<endl<<endl; |
971 |
|
|
972 |
|
pam_tree = (TChain*)Trout; |
973 |
|
|
974 |
return Trout; |
return Trout; |
975 |
|
|
976 |
} |
} |
999 |
// char *fullpath; |
// char *fullpath; |
1000 |
// const char *fullpath; |
// const char *fullpath; |
1001 |
|
|
1002 |
// if no input file list is given: |
// if input file list is given: |
1003 |
if ( flisttxt != "" ){ |
if ( flisttxt != "" ){ |
1004 |
|
|
1005 |
// if( !gSystem->IsFileInIncludePath(flisttxt,&fullpath) ){ |
// if( !gSystem->IsFileInIncludePath(flisttxt,&fullpath) ){ |
1009 |
// } |
// } |
1010 |
// flisttxt = fullpath; |
// flisttxt = fullpath; |
1011 |
|
|
1012 |
|
if ( !flisttxt.EndsWith(".root") ){ |
1013 |
flisttxt = gSystem->ConcatFileName(gSystem->DirName(flisttxt),gSystem->BaseName(flisttxt)); |
flisttxt = gSystem->ConcatFileName(gSystem->DirName(flisttxt),gSystem->BaseName(flisttxt)); |
1014 |
|
|
1015 |
if( !gSystem->ChangeDirectory(ddir) ){ |
if( !gSystem->ChangeDirectory(ddir) ){ |
1040 |
// cout <<"(2) " << file << endl; |
// cout <<"(2) " << file << endl; |
1041 |
// if( gSystem->IsFileInIncludePath(file,&fullpath) ){ |
// if( gSystem->IsFileInIncludePath(file,&fullpath) ){ |
1042 |
// if( (fullpath = gSystem->FindFile(ddir,file)) ){ |
// if( (fullpath = gSystem->FindFile(ddir,file)) ){ |
1043 |
char *fullpath = gSystem->ConcatFileName(gSystem->DirName(ddir),gSystem->BaseName(file)); |
if( file.EndsWith(".root") ){ |
1044 |
contents->Add(new TSystemFile(fullpath,gSystem->DirName(fullpath)));// add file to the list |
char *fullpath = gSystem->ConcatFileName(gSystem->DirName(ddir),gSystem->BaseName(file)); |
1045 |
delete fullpath; |
contents->Add(new TSystemFile(fullpath,gSystem->DirName(fullpath)));// add file to the list |
1046 |
|
delete fullpath; |
1047 |
|
} |
1048 |
// }else{ |
// }else{ |
1049 |
// if(file.Data()!="")cout << "File: "<<file<<" ---> missing "<< endl; |
// if(file.Data()!="")cout << "File: "<<file<<" ---> missing "<< endl; |
1050 |
// }; |
// }; |
1051 |
}; |
}; |
1052 |
in.close(); |
in.close(); |
1053 |
|
} else { |
1054 |
|
char *fullpath = gSystem->ConcatFileName(gSystem->DirName(flisttxt),gSystem->BaseName(flisttxt)); |
1055 |
|
contents->Add(new TSystemFile(fullpath,gSystem->DirName(fullpath)));// add file to the list |
1056 |
|
delete fullpath; |
1057 |
|
}; |
1058 |
}else{ |
}else{ |
1059 |
|
|
1060 |
cout << "No input file list given."<<endl; |
cout << "No input file list given."<<endl; |
1132 |
TChain *N = 0; |
TChain *N = 0; |
1133 |
TChain *A = 0; |
TChain *A = 0; |
1134 |
TChain *B = 0; |
TChain *B = 0; |
1135 |
|
|
1136 |
|
TChain *L = 0; |
1137 |
|
|
1138 |
if(TRK2||TRK1||TRKh) T = new TChain("Tracker"); |
if(TRK2||TRK1||TRKh) T = new TChain("Tracker"); |
1139 |
if(CAL2||CAL1) C = new TChain("Calorimeter"); |
if(CAL2||CAL1) C = new TChain("Calorimeter"); |
1143 |
if(ND) N = new TChain("NeutronD"); |
if(ND) N = new TChain("NeutronD"); |
1144 |
if(AC) A = new TChain("Anticounter"); |
if(AC) A = new TChain("Anticounter"); |
1145 |
if(ORB) B = new TChain("OrbitalInfo"); |
if(ORB) B = new TChain("OrbitalInfo"); |
1146 |
|
|
1147 |
|
L = new TChain("SelectionList"); |
1148 |
|
|
1149 |
// loop over files and create chains |
// loop over files and create chains |
1150 |
TIter next(fl); |
TIter next(fl); |
1161 |
if(ND) N->Add(name); |
if(ND) N->Add(name); |
1162 |
if(AC) A->Add(name); |
if(AC) A->Add(name); |
1163 |
if(ORB) B->Add(name); |
if(ORB) B->Add(name); |
1164 |
|
if(SELLI==1) L->Add(name); |
1165 |
}; |
}; |
1166 |
} |
} |
1167 |
|
|
1168 |
cout << "done chain \n"; |
cout << "done chain \n"; |
1169 |
|
|
1170 |
UInt_t *found=0; |
// UInt_t *found=0; |
1171 |
// Tracker |
// Tracker |
1172 |
if(T && (TRK2||TRK1||TRKh)) { |
if(T && (TRK2||TRK1||TRKh)) { |
1173 |
if(TRK2)T->SetBranchAddress("TrkLevel2", GetPointerTo("TrkLevel2")); |
if(TRK2)T->SetBranchAddress("TrkLevel2", GetPointerTo("TrkLevel2")); |
1174 |
else T->SetBranchStatus("TrkLevel2",0,found); |
// else T->SetBranchStatus("TrkLevel2",0,found); |
1175 |
if(TRK2)cout << "Tracker : set branch address TrkLevel2"<<endl; |
if(TRK2)cout << "Tracker : set branch address TrkLevel2"<<endl; |
1176 |
if(TRK1)T->SetBranchAddress("TrkLevel1", GetPointerTo("TrkLevel1")); |
if(TRK1)T->SetBranchAddress("TrkLevel1", GetPointerTo("TrkLevel1")); |
1177 |
else T->SetBranchStatus("TrkLevel1",0,found); |
// else T->SetBranchStatus("TrkLevel1",0,found); |
1178 |
if(TRK1)cout << "Tracker : set branch address TrkLevel1"<<endl; |
if(TRK1)cout << "Tracker : set branch address TrkLevel1"<<endl; |
1179 |
if(TRKh)T->SetBranchAddress("TrkHough", GetPointerTo("TrkHough")); |
if(TRKh)T->SetBranchAddress("TrkHough", GetPointerTo("TrkHough")); |
1180 |
else T->SetBranchStatus("TrkHough",0,found); |
// else T->SetBranchStatus("TrkHough",0,found); |
1181 |
if(TRKh)cout << "Tracker : set branch address TrkHough"<<endl; |
if(TRKh)cout << "Tracker : set branch address TrkHough"<<endl; |
1182 |
if(!Trout)Trout=T; |
if(!Trout)Trout=T; |
1183 |
else Trout->AddFriend("Tracker"); |
else Trout->AddFriend("Tracker"); |
1187 |
// Calorimeter |
// Calorimeter |
1188 |
if(C && (CAL2||CAL1)) { |
if(C && (CAL2||CAL1)) { |
1189 |
if(CAL2)C->SetBranchAddress("CaloLevel2", GetPointerTo("CaloLevel2")); |
if(CAL2)C->SetBranchAddress("CaloLevel2", GetPointerTo("CaloLevel2")); |
1190 |
else C->SetBranchStatus("CaloLevel2",0,found); |
// else C->SetBranchStatus("CaloLevel2",0,found); |
1191 |
if(CAL2)cout << "Calorimeter : set branch address CaloLevel2"<<endl; |
if(CAL2)cout << "Calorimeter : set branch address CaloLevel2"<<endl; |
1192 |
if(CAL1)C->SetBranchAddress("CaloLevel1", GetPointerTo("CaloLevel1")); |
if(CAL1)C->SetBranchAddress("CaloLevel1", GetPointerTo("CaloLevel1")); |
1193 |
else C->SetBranchStatus("CaloLevel1",0,found); |
// else C->SetBranchStatus("CaloLevel1",0,found); |
1194 |
if(CAL1)cout << "Calorimeter : set branch address CaloLevel1"<<endl; |
if(CAL1)cout << "Calorimeter : set branch address CaloLevel1"<<endl; |
1195 |
if(!Trout)Trout=C; |
if(!Trout)Trout=C; |
1196 |
else Trout->AddFriend("Calorimeter"); |
else Trout->AddFriend("Calorimeter"); |
1251 |
}else{ |
}else{ |
1252 |
cout << "OrbitalInfo : missing tree"<<endl; |
cout << "OrbitalInfo : missing tree"<<endl; |
1253 |
}; |
}; |
1254 |
|
|
1255 |
|
// Selection List |
1256 |
|
if(L && SELLI==1) { |
1257 |
|
cout<<">>> Found selection-list <<<"<<endl; |
1258 |
|
L->SetBranchAddress("RunEntry",&irun); |
1259 |
|
cout << "SelectionList: set branch address RunEntry"<<endl; |
1260 |
|
L->SetBranchAddress("EventEntry",&irunentry); |
1261 |
|
cout << "SelectionList: set branch address EventEntry"<<endl; |
1262 |
|
sel_tree = L; |
1263 |
|
// if(!Trout)Trout=O; |
1264 |
|
// else Trout->AddFriend("SelectionList"); |
1265 |
|
}else{ |
1266 |
|
// cout << "SelectionList : missing tree"<<endl; |
1267 |
|
if(L)L->Delete(); |
1268 |
|
}; |
1269 |
|
|
1270 |
// cout<<endl<<" Number of entries: "<<Trout->GetEntries()<<endl<<endl; |
// cout<<endl<<" Number of entries: "<<Trout->GetEntries()<<endl<<endl; |
1271 |
|
|
1272 |
|
pam_tree = Trout; |
1273 |
// // Tracker |
|
|
// if(TRK2||TRK1||TRKh){ |
|
|
// if(!Tout)Tout=T; |
|
|
// else Tout->AddFriend("Tracker"); |
|
|
// } |
|
|
// // 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=R; |
|
|
// else Tout->AddFriend("Trigger"); |
|
|
// }; |
|
|
// // S4 |
|
|
// if(S4) { |
|
|
// if(!Tout)Tout=S; |
|
|
// else Tout->AddFriend("S4"); |
|
|
// }; |
|
|
// // Neutron Detector |
|
|
// if(ND) { |
|
|
// if(!Tout)Tout=N; |
|
|
// else Tout->AddFriend("NeutronD"); |
|
|
// }; |
|
|
// // Anticounters |
|
|
// if(AC) { |
|
|
// if(!Tout)Tout=A; |
|
|
// else Tout->AddFriend("Anticounter"); |
|
|
// }; |
|
|
// // OrbitalInfo |
|
|
// if(ORB) { |
|
|
// if(!Tout)Tout=B; |
|
|
// else Tout->AddFriend("OrbitalInfo"); |
|
|
// }; |
|
|
|
|
|
// cout<<endl<<" Number of entries: "<<Tout->GetEntries()<<endl<<endl; |
|
|
|
|
|
// if( Tout->GetEntries() )PamLevel2::SetBranchAddress( Tout ); |
|
|
|
|
1274 |
return Trout; |
return Trout; |
1275 |
} |
} |
1276 |
|
|
1352 |
t->SetBranchAddress("OrbitalInfo", GetPointerTo("OrbitalInfo")); |
t->SetBranchAddress("OrbitalInfo", GetPointerTo("OrbitalInfo")); |
1353 |
cout << "OrbitalInfo : set branch address OrbitalInfo"<<endl; |
cout << "OrbitalInfo : set branch address OrbitalInfo"<<endl; |
1354 |
}; |
}; |
1355 |
|
// SelectionList |
1356 |
|
if(SELLI==1) { |
1357 |
|
t->SetBranchAddress("RunEntry", &irun); |
1358 |
|
cout << "SelectionList: set branch address RunEntry"<<endl; |
1359 |
|
t->SetBranchAddress("EventEntry", &irunentry); |
1360 |
|
cout << "SelectionList: set branch address EventEntry"<<endl; |
1361 |
|
}; |
1362 |
|
|
1363 |
} |
} |
1364 |
/** |
/** |
1432 |
t->SetBranchAddress("OrbitalInfo", GetPointerTo("OrbitalInfo")); |
t->SetBranchAddress("OrbitalInfo", GetPointerTo("OrbitalInfo")); |
1433 |
cout << "OrbitalInfo : set branch address OrbitalInfo"<<endl; |
cout << "OrbitalInfo : set branch address OrbitalInfo"<<endl; |
1434 |
}; |
}; |
1435 |
|
// SelectionList |
1436 |
|
if(SELLI==1) { |
1437 |
|
t->SetBranchAddress("RunEntry", &irun); |
1438 |
|
cout << "SelectionList: set branch address RunEntry"<<endl; |
1439 |
|
t->SetBranchAddress("EventEntry", &irunentry); |
1440 |
|
cout << "SelectionList: set branch address EventEntry"<<endl; |
1441 |
|
}; |
1442 |
|
|
1443 |
} |
} |
1444 |
|
|
1466 |
R->Add(name); |
R->Add(name); |
1467 |
}; |
}; |
1468 |
} |
} |
1469 |
|
|
1470 |
|
if(R->GetNtrees()){ |
1471 |
|
|
1472 |
R->SetBranchAddress("RunInfo", GetPointerTo("RunInfo")); |
R->SetBranchAddress("RunInfo", GetPointerTo("RunInfo")); |
1473 |
cout << "Run : set branch address RunInfo"<<endl; |
cout << "Run : set branch address RunInfo"<<endl; |
1474 |
R->SetBranchAddress("SoftInfo", GetPointerTo("SoftInfo")); // Emiliano |
R->SetBranchAddress("SoftInfo", GetPointerTo("SoftInfo")); // Emiliano |
1475 |
cout << "Software : set branch address SoftInfo"<<endl; // Emiliano |
cout << "Software : set branch address SoftInfo"<<endl; // Emiliano |
1476 |
|
}else{ |
1477 |
|
delete R; |
1478 |
|
R=0; |
1479 |
|
} |
1480 |
|
|
1481 |
|
run_tree = R; |
1482 |
|
|
1483 |
return R; |
return R; |
1484 |
|
|
1485 |
} |
} |
1494 |
*/ |
*/ |
1495 |
TTree *PamLevel2::GetRunTree(TFile *f){ |
TTree *PamLevel2::GetRunTree(TFile *f){ |
1496 |
|
|
1497 |
|
cout << "TTree *PamLevel2::GetRunTree(TFile *f) -- obsolte "<<endl; |
1498 |
|
|
1499 |
TTree *R = (TTree*)f->Get("Run"); |
TTree *R = (TTree*)f->Get("Run"); |
1500 |
|
|
1501 |
R->SetBranchAddress("RunInfo", GetPointerTo("RunInfo")); |
if(R){ |
1502 |
cout << "Run : set branch address RunInfo"<<endl; |
R->SetBranchAddress("RunInfo", GetPointerTo("RunInfo")); |
1503 |
R->SetBranchAddress("SoftInfo", GetPointerTo("SoftInfo")); // Emiliano |
cout << "Run : set branch address RunInfo"<<endl; |
1504 |
cout << "Software : set branch address SoftInfo"<<endl; // Emiliano |
R->SetBranchAddress("SoftInfo", GetPointerTo("SoftInfo")); // Emiliano |
1505 |
|
cout << "Software : set branch address SoftInfo"<<endl; // Emiliano |
1506 |
|
} |
1507 |
|
|
1508 |
|
run_tree = (TChain*)R; |
1509 |
|
|
1510 |
return R; |
return R; |
1511 |
|
|
1512 |
} |
} |
1521 |
// |
// |
1522 |
if ( run->GetEntries() <= 0 ) return(false); |
if ( run->GetEntries() <= 0 ) return(false); |
1523 |
// |
// |
1524 |
|
|
1525 |
Int_t oldrun = irun; |
Int_t oldrun = irun; |
1526 |
if ( irun < 0 ){ |
// -------------------------------------- |
1527 |
irun = 0; |
// if it is a full file (not preselected) |
1528 |
run->GetEntry(0); |
// -------------------------------------- |
1529 |
runfirstentry = 0ULL; |
if(SELLI==0){ |
1530 |
runlastentry += (ULong64_t)(this->GetRunInfo()->NEVENTS) - 1ULL; |
if ( irun < 0 ){ |
1531 |
}; |
irun = 0; |
1532 |
while ( iev > (runfirstentry+(ULong64_t)(this->GetRunInfo()->NEVENTS-1)) && irun < run->GetEntries() ){ |
run->GetEntry(0); |
1533 |
// printf(" iev %llu %u %llu \n",iev,this->GetRunInfo()->NEVENTS,(ULong64_t)(runfirstentry+(ULong64_t)(this->GetRunInfo()->NEVENTS))); |
runfirstentry = 0ULL; |
1534 |
irun++; |
runlastentry += (ULong64_t)(this->GetRunInfo()->NEVENTS) - 1ULL; |
1535 |
run->GetEntry(irun); |
}; |
1536 |
runfirstentry = runlastentry+1ULL; |
|
1537 |
runlastentry += (ULong64_t)(this->GetRunInfo()->NEVENTS); |
if( !GetOrbitalInfo() ){ |
1538 |
|
cout << "Bool_t PamLevel2::UpdateRunInfo(TChain *run, ULong64_t iev) -- ERROR -- missing OrbitalInfo "<<endl; |
1539 |
|
return(false); |
1540 |
|
} |
1541 |
|
// modificato il controllo sull'aggiornamento del run, per evitare problemi |
1542 |
|
// dovuti agli eventi annidati (NB! NEVENTS conta anche questi!!) |
1543 |
|
while ( GetOrbitalInfo()->absTime > GetRunInfo()->RUNTRAILER_TIME && irun < run->GetEntries() ){ |
1544 |
|
// while ( iev > (runfirstentry+(ULong64_t)(this->GetRunInfo()->NEVENTS-1)) && irun < run->GetEntries() ){ |
1545 |
|
// printf(" iev %llu %u %llu \n",iev,this->GetRunInfo()->NEVENTS,(ULong64_t)(runfirstentry+(ULong64_t)(this->GetRunInfo()->NEVENTS))); |
1546 |
|
irun++; |
1547 |
|
run->GetEntry(irun); |
1548 |
|
runfirstentry = runlastentry+1ULL; |
1549 |
|
runlastentry += (ULong64_t)(this->GetRunInfo()->NEVENTS); |
1550 |
|
}; |
1551 |
|
|
1552 |
|
// |
1553 |
|
if ( irun == oldrun || irun >= run->GetEntries() ) return(false); |
1554 |
|
// |
1555 |
|
// printf(" iev %llu irun %i nevents %u 1st %llu last %llu \n",iev,irun,this->GetRunInfo()->NEVENTS,(ULong64_t)runfirstentry,(ULong64_t)runlastentry); |
1556 |
|
// |
1557 |
|
return(true); |
1558 |
}; |
}; |
1559 |
// |
// ---------------------------------------------------- |
1560 |
if ( irun == oldrun || irun >= run->GetEntries() ) return(false); |
// if it is a preselected file (there is SelectionList) |
1561 |
// |
// NBNB - the event tree MUST be read first |
1562 |
// printf(" iev %llu irun %i nevents %u 1st %llu last %llu \n",iev,irun,this->GetRunInfo()->NEVENTS,(ULong64_t)runfirstentry,(ULong64_t)runlastentry); |
// ---------------------------------------------------- |
1563 |
// |
if(SELLI==1){ |
1564 |
return(true); |
sel_tree->GetEntry(iev); |
1565 |
|
if(irun != oldrun){ |
1566 |
|
run->GetEntry(irun); |
1567 |
|
return true; |
1568 |
|
} |
1569 |
|
return false; |
1570 |
|
} |
1571 |
|
|
1572 |
|
return false; |
1573 |
// |
// |
1574 |
}; |
}; |
1575 |
/** |
/** |
1592 |
void PamLevel2::SetWhichTrees(TString detlist){ |
void PamLevel2::SetWhichTrees(TString detlist){ |
1593 |
|
|
1594 |
if(detlist.IsNull() || detlist.Contains("+ALL", TString::kIgnoreCase)){ |
if(detlist.IsNull() || detlist.Contains("+ALL", TString::kIgnoreCase)){ |
1595 |
|
CAL0 = false; |
1596 |
CAL1 = true; |
CAL1 = true; |
1597 |
CAL2 = true; |
CAL2 = true; |
1598 |
TRK2 = true; |
TRK2 = true; |
1599 |
TRK1 = false; |
TRK1 = false; |
1600 |
TRKh = false; |
TRKh = false; |
1601 |
|
TRK0 = false; |
1602 |
TRG = true; |
TRG = true; |
1603 |
TOF = true; |
TOF = true; |
1604 |
|
TOF0 = false; |
1605 |
S4 = true; |
S4 = true; |
1606 |
ND = true; |
ND = true; |
1607 |
AC = true; |
AC = true; |
1608 |
ORB = true; |
ORB = true; |
1609 |
}else if( detlist.Contains("-ALL", TString::kIgnoreCase) ){ |
}else if( detlist.Contains("-ALL", TString::kIgnoreCase) ){ |
1610 |
|
CAL0 = false; |
1611 |
CAL1 = false; |
CAL1 = false; |
1612 |
CAL2 = false; |
CAL2 = false; |
1613 |
TRK2 = false; |
TRK2 = false; |
1614 |
TRK1 = false; |
TRK1 = false; |
1615 |
TRKh = false; |
TRKh = false; |
1616 |
|
TRK0 = false; |
1617 |
TRG = false; |
TRG = false; |
1618 |
TOF = false; |
TOF = false; |
1619 |
|
TOF0 = false; |
1620 |
S4 = false; |
S4 = false; |
1621 |
ND = false; |
ND = false; |
1622 |
AC = false; |
AC = false; |
1628 |
if ( detlist.Contains("-CAL1", TString::kIgnoreCase) )CAL1=false; |
if ( detlist.Contains("-CAL1", TString::kIgnoreCase) )CAL1=false; |
1629 |
if ( detlist.Contains("+CAL1", TString::kIgnoreCase) )CAL1=true; |
if ( detlist.Contains("+CAL1", TString::kIgnoreCase) )CAL1=true; |
1630 |
}; |
}; |
1631 |
|
|
1632 |
|
if( detlist.Contains("CAL0", TString::kIgnoreCase) ){ |
1633 |
|
if ( detlist.Contains("-CAL0", TString::kIgnoreCase) )CAL0=false; |
1634 |
|
if ( detlist.Contains("+CAL0", TString::kIgnoreCase) )CAL0=true; |
1635 |
|
}; |
1636 |
|
|
1637 |
if( detlist.Contains("CAL2", TString::kIgnoreCase)){ |
if( detlist.Contains("CAL2", TString::kIgnoreCase)){ |
1638 |
if ( detlist.Contains("-CAL2", TString::kIgnoreCase) )CAL2=false; |
if ( detlist.Contains("-CAL2", TString::kIgnoreCase) )CAL2=false; |
1645 |
CAL1=false; |
CAL1=false; |
1646 |
} |
} |
1647 |
// ------------------------------------------------------------------------- |
// ------------------------------------------------------------------------- |
1648 |
|
if( detlist.Contains("TRK0", TString::kIgnoreCase) ){ |
1649 |
|
if ( detlist.Contains("-TRK0", TString::kIgnoreCase) )TRK0=false; |
1650 |
|
if ( detlist.Contains("+TRK0", TString::kIgnoreCase) )TRK0=true; |
1651 |
|
}; |
1652 |
|
|
1653 |
if( detlist.Contains("TRK1", TString::kIgnoreCase) ){ |
if( detlist.Contains("TRK1", TString::kIgnoreCase) ){ |
1654 |
if ( detlist.Contains("-TRK1", TString::kIgnoreCase) )TRK1=false; |
if ( detlist.Contains("-TRK1", TString::kIgnoreCase) )TRK1=false; |
1655 |
if ( detlist.Contains("+TRK1", TString::kIgnoreCase) )TRK1=true; |
if ( detlist.Contains("+TRK1", TString::kIgnoreCase) )TRK1=true; |
1678 |
|
|
1679 |
if( detlist.Contains("-TOF", TString::kIgnoreCase) )TOF = false; |
if( detlist.Contains("-TOF", TString::kIgnoreCase) )TOF = false; |
1680 |
else if( detlist.Contains("+TOF", TString::kIgnoreCase) )TOF = true; |
else if( detlist.Contains("+TOF", TString::kIgnoreCase) )TOF = true; |
1681 |
|
|
1682 |
|
if( detlist.Contains("-TOF0", TString::kIgnoreCase) )TOF0 = false; |
1683 |
|
else if( detlist.Contains("+TOF0", TString::kIgnoreCase) )TOF0 = true; |
1684 |
|
|
1685 |
if( detlist.Contains("-S4", TString::kIgnoreCase) )S4 = false; |
if( detlist.Contains("-S4", TString::kIgnoreCase) )S4 = false; |
1686 |
else if( detlist.Contains("+S4", TString::kIgnoreCase) )S4 = true; |
else if( detlist.Contains("+S4", TString::kIgnoreCase) )S4 = true; |
1715 |
* Set tree/branch detector flags from the content of a tree |
* Set tree/branch detector flags from the content of a tree |
1716 |
*/ |
*/ |
1717 |
void PamLevel2::GetWhichTrees(TFile* f){ |
void PamLevel2::GetWhichTrees(TFile* f){ |
1718 |
|
|
1719 |
|
|
1720 |
|
|
1721 |
|
cout << "void PamLevel2::GetWhichTrees(TFile* f) --- WARNING!! --- ...potrebbe non funzionare "<<endl; |
1722 |
// ----------- |
// ----------- |
1723 |
// reset flags |
// reset flags |
1724 |
// ----------- |
// ----------- |
1890 |
|
|
1891 |
Bool_t RUN__ok = false; |
Bool_t RUN__ok = false; |
1892 |
|
|
1893 |
|
Bool_t SELLI__ok = false; |
1894 |
|
|
1895 |
cout << "Checking file: "<<name<<endl; |
cout << "Checking file: "<<name<<endl; |
1896 |
TFile *f = new TFile(name.Data()); |
TFile *f = new TFile(name.Data()); |
1907 |
|
|
1908 |
while( (key = (TKey*)next()) ){ |
while( (key = (TKey*)next()) ){ |
1909 |
|
|
1910 |
|
// cout << key->GetName() << endl; |
1911 |
// cout << key->GetName() << ""<<key->GetClassName()<<endl; |
// cout << key->GetName() << ""<<key->GetClassName()<<endl; |
1912 |
// cout << " Get tree: " << f->Get(key->GetName())<<endl; |
// cout << " Get tree: " << f->Get(key->GetName())<<endl; |
1913 |
// nev_previous = nev; |
// nev_previous = nev; |
1918 |
// return false; |
// return false; |
1919 |
// }; |
// }; |
1920 |
|
|
1921 |
|
|
1922 |
if( !strcmp(key->GetName(),"Run" ) )RUN__ok = true; |
if( !strcmp(key->GetName(),"Run" ) )RUN__ok = true; |
1923 |
|
|
1924 |
//========================================================= |
//========================================================= |
1925 |
|
if( !strcmp(key->GetName(),"SelectionList" ) ){ |
1926 |
|
SELLI__ok = true; |
1927 |
|
if(SELLI==1){ |
1928 |
|
Int_t nevt = ((TTree*)f->Get("SelectionList"))->GetEntries(); |
1929 |
|
if( nev && nevt!=nev){ |
1930 |
|
cout << "File: "<< f->GetName() <<" discarded ---- SelectionList tree has "<<nevt<<" events instead of "<<nev<< endl; |
1931 |
|
return false; |
1932 |
|
} |
1933 |
|
nev=nevt; |
1934 |
|
} |
1935 |
|
} |
1936 |
|
|
1937 |
|
//========================================================= |
1938 |
if( !strcmp(key->GetName(),"Trigger" ) ){ |
if( !strcmp(key->GetName(),"Trigger" ) ){ |
1939 |
TRG__ok = true; |
TRG__ok = true; |
1940 |
if(TRG){ |
if(TRG){ |
2046 |
}; |
}; |
2047 |
|
|
2048 |
}; |
}; |
2049 |
|
|
2050 |
|
if( SELLI==-1 )SELLI = (Int_t)SELLI__ok; |
2051 |
|
if( SELLI==0 && SELLI__ok ){ |
2052 |
|
cout << "File: "<< f->GetName() <<" discarded ---- found SelectionList (it is not a full-event file)" << endl; |
2053 |
|
return false; |
2054 |
|
} |
2055 |
|
if( SELLI==1 && !SELLI__ok ){ |
2056 |
|
cout << "File: "<< f->GetName() <<" discarded ---- SelectionList missing" << endl; |
2057 |
|
return false; |
2058 |
|
} |
2059 |
|
|
2060 |
|
// cout << "SELLI "<<SELLI<<endl; |
2061 |
|
|
2062 |
// cout<< "CheckLevel2File(TString): detector list --> "; |
// cout<< "CheckLevel2File(TString): detector list --> "; |
2063 |
// if(TRK1__ok)cout<<"TRK1 "; |
// if(TRK1__ok)cout<<"TRK1 "; |
2064 |
// if(TRK2__ok)cout<<"TRK2 "; |
// if(TRK2__ok)cout<<"TRK2 "; |
2167 |
cout << "Create clones of PAMELA trees "<<endl; |
cout << "Create clones of PAMELA trees "<<endl; |
2168 |
|
|
2169 |
Int_t i=0; |
Int_t i=0; |
2170 |
tree_clone[i] = fChain->GetTree()->CloneTree(0); |
pam_tree_clone[i] = fChain->GetTree()->CloneTree(0); |
2171 |
TString name = tree_clone[i]->GetName(); |
TString name = pam_tree_clone[i]->GetName(); |
2172 |
name.Append("_clone"); |
name.Append("_clone"); |
2173 |
// tree_clone[i]->SetName(name.Data()); |
// pam_tree_clone[i]->SetName(name.Data()); |
2174 |
cout << tree_clone[i]->GetName() <<endl; |
cout << pam_tree_clone[i]->GetName() <<endl; |
2175 |
i++; |
i++; |
2176 |
|
|
2177 |
TList *li = fChain->GetListOfFriends(); |
TList *li = fChain->GetListOfFriends(); |
2181 |
while( (T_friend = (TFriendElement*)next()) ){ |
while( (T_friend = (TFriendElement*)next()) ){ |
2182 |
// cout<<T_friend->IsA()->GetName()<<" "<<T_friend->GetName()<<hex << T_friend->GetTree() << dec<<endl; |
// cout<<T_friend->IsA()->GetName()<<" "<<T_friend->GetName()<<hex << T_friend->GetTree() << dec<<endl; |
2183 |
// cout<<T_friend->GetTree()->GetName()<< endl; |
// cout<<T_friend->GetTree()->GetName()<< endl; |
2184 |
tree_clone[i] = T_friend->GetTree()->CloneTree(0); |
pam_tree_clone[i] = T_friend->GetTree()->CloneTree(0); |
2185 |
tree_clone[i]->SetAutoSave(1000000); |
pam_tree_clone[i]->SetAutoSave(1000000); |
2186 |
name = tree_clone[i]->GetName(); |
name = pam_tree_clone[i]->GetName(); |
2187 |
name.Append("_clone"); |
name.Append("_clone"); |
2188 |
// tree_clone[i]->SetName(name.Data()); |
// pam_tree_clone[i]->SetName(name.Data()); |
2189 |
cout << tree_clone[i]->GetName() << endl; |
cout << pam_tree_clone[i]->GetName() << endl; |
2190 |
i++; |
i++; |
2191 |
} |
} |
2192 |
|
|
2206 |
cout << "+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+" <<endl; |
cout << "+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+" <<endl; |
2207 |
cout << "Create new PAMELA trees "<<endl; |
cout << "Create new PAMELA trees "<<endl; |
2208 |
|
|
|
Int_t i=0; |
|
2209 |
|
|
2210 |
|
run_tree_clone = new TTree("Run","PAMELA Level2 data from the GL_RUN table "); |
2211 |
|
run_tree_clone->Branch("RunInfo","GL_RUN",GetPointerTo("RunInfo")); |
2212 |
|
cout << "Run : branch RunInfo"<<endl; |
2213 |
|
run_tree_clone->Branch("SoftInfo","SoftInfo",GetPointerTo("SoftInfo")); |
2214 |
|
cout << "Run : branch SoftInfo"<<endl; |
2215 |
|
|
2216 |
|
|
2217 |
|
|
2218 |
|
sel_tree_clone = new TTree("SelectionList","List of selected events "); |
2219 |
|
sel_tree_clone->Branch("RunEntry",&irun,"runentry/I"); |
2220 |
|
sel_tree_clone->Branch("EventEntry",&irunentry,"eventry/I"); |
2221 |
|
|
2222 |
|
|
2223 |
|
Int_t i=0; |
2224 |
if(TRK1||TRK2||TRKh){ |
if(TRK1||TRK2||TRKh){ |
2225 |
tree_clone[i] = new TTree("Tracker","PAMELA tracker level2 data "); |
pam_tree_clone[i] = new TTree("Tracker","PAMELA tracker level2 data "); |
2226 |
if(TRK1) { |
if(TRK1) { |
2227 |
tree_clone[i]->Branch("TrkLevel1","TrkLevel1", GetPointerTo("TrkLevel1")); |
pam_tree_clone[i]->Branch("TrkLevel1","TrkLevel1", GetPointerTo("TrkLevel1")); |
2228 |
tree_clone[i]->BranchRef(); |
pam_tree_clone[i]->BranchRef(); |
2229 |
cout << "Tracker : branch TrkLevel1"<<endl; |
cout << "Tracker : branch TrkLevel1"<<endl; |
2230 |
|
cout << "CreateCloneTrees " << GetTrkLevel1()<<endl; |
2231 |
}; |
}; |
2232 |
if(TRK2) { |
if(TRK2) { |
2233 |
tree_clone[i]->Branch("TrkLevel2", "TrkLevel2",GetPointerTo("TrkLevel2")); |
pam_tree_clone[i]->Branch("TrkLevel2", "TrkLevel2",GetPointerTo("TrkLevel2")); |
2234 |
cout << "Tracker : branch TrkLevel2"<<endl; |
cout << "Tracker : branch TrkLevel2"<<endl; |
2235 |
}; |
}; |
2236 |
if(TRKh) { |
if(TRKh) { |
2237 |
tree_clone[i]->Branch("TrkHough","TrkHough", GetPointerTo("TrkHough")); |
pam_tree_clone[i]->Branch("TrkHough","TrkHough", GetPointerTo("TrkHough")); |
2238 |
cout << "Tracker : branch TrkHough"<<endl; |
cout << "Tracker : branch TrkHough"<<endl; |
2239 |
}; |
}; |
2240 |
i++; |
i++; |
2242 |
|
|
2243 |
// Calorimeter |
// Calorimeter |
2244 |
if(CAL1||CAL2){ |
if(CAL1||CAL2){ |
2245 |
tree_clone[i] = new TTree("Calorimeter","PAMELA calorimeter level2 data "); |
pam_tree_clone[i] = new TTree("Calorimeter","PAMELA calorimeter level2 data "); |
2246 |
if(CAL1) { |
if(CAL1) { |
2247 |
tree_clone[i]->Branch("CaloLevel1", "CaloLevel1", GetPointerTo("CaloLevel1")); |
pam_tree_clone[i]->Branch("CaloLevel1", "CaloLevel1", GetPointerTo("CaloLevel1")); |
2248 |
cout << "Calorimeter : branch CaloLevel1"<<endl; |
cout << "Calorimeter : branch CaloLevel1"<<endl; |
2249 |
}; |
}; |
2250 |
if(CAL2) { |
if(CAL2) { |
2251 |
tree_clone[i]->Branch("CaloLevel2","CaloLevel2", GetPointerTo("CaloLevel2")); |
pam_tree_clone[i]->Branch("CaloLevel2","CaloLevel2", GetPointerTo("CaloLevel2")); |
2252 |
cout << "Calorimeter : branch CaloLevel2"<<endl; |
cout << "Calorimeter : branch CaloLevel2"<<endl; |
2253 |
}; |
}; |
2254 |
i++; |
i++; |
2256 |
|
|
2257 |
// ToF |
// ToF |
2258 |
if(TOF) { |
if(TOF) { |
2259 |
tree_clone[i] = new TTree("ToF","PAMELA ToF level2 data "); |
pam_tree_clone[i] = new TTree("ToF","PAMELA ToF level2 data "); |
2260 |
tree_clone[i]->Branch("ToFLevel2","ToFLevel2", GetPointerTo("ToFLevel2")); |
pam_tree_clone[i]->Branch("ToFLevel2","ToFLevel2", GetPointerTo("ToFLevel2")); |
2261 |
cout << "ToF : branch ToFLevel2"<<endl; |
cout << "ToF : branch ToFLevel2"<<endl; |
2262 |
i++; |
i++; |
2263 |
}; |
}; |
2264 |
// Trigger |
// Trigger |
2265 |
if(TRG) { |
if(TRG) { |
2266 |
tree_clone[i] = new TTree("Trigger","PAMELA trigger level2 data "); |
pam_tree_clone[i] = new TTree("Trigger","PAMELA trigger level2 data "); |
2267 |
tree_clone[i]->Branch("TrigLevel2","TrigLevel2", GetPointerTo("TrigLevel2")); |
pam_tree_clone[i]->Branch("TrigLevel2","TrigLevel2", GetPointerTo("TrigLevel2")); |
2268 |
cout << "Trigger : branch TrigLevel2"<<endl; |
cout << "Trigger : branch TrigLevel2"<<endl; |
2269 |
i++; |
i++; |
2270 |
}; |
}; |
2271 |
// S4 |
// S4 |
2272 |
if(S4) { |
if(S4) { |
2273 |
tree_clone[i] = new TTree("S4","PAMELA S4 level2 data "); |
pam_tree_clone[i] = new TTree("S4","PAMELA S4 level2 data "); |
2274 |
tree_clone[i]->Branch("S4Level2","S4Level2", GetPointerTo("S4Level2")); |
pam_tree_clone[i]->Branch("S4Level2","S4Level2", GetPointerTo("S4Level2")); |
2275 |
cout << "S4 : branch S4Level2"<<endl; |
cout << "S4 : branch S4Level2"<<endl; |
2276 |
i++; |
i++; |
2277 |
}; |
}; |
2278 |
// Neutron Detector |
// Neutron Detector |
2279 |
if(ND) { |
if(ND) { |
2280 |
tree_clone[i] = new TTree("NeutronD","PAMELA neutron detector level2 data "); |
pam_tree_clone[i] = new TTree("NeutronD","PAMELA neutron detector level2 data "); |
2281 |
tree_clone[i]->Branch("NDLevel2","NDLevel2", GetPointerTo("NDLevel2")); |
pam_tree_clone[i]->Branch("NDLevel2","NDLevel2", GetPointerTo("NDLevel2")); |
2282 |
cout << "NeutronD : branch NDLevel2"<<endl; |
cout << "NeutronD : branch NDLevel2"<<endl; |
2283 |
i++; |
i++; |
2284 |
}; |
}; |
2285 |
// Anticounters |
// Anticounters |
2286 |
if(AC) { |
if(AC) { |
2287 |
tree_clone[i] = new TTree("Anticounter","PAMELA anticounter detector level2 data "); |
pam_tree_clone[i] = new TTree("Anticounter","PAMELA anticounter detector level2 data "); |
2288 |
tree_clone[i]->Branch("AcLevel2","AcLevel2", GetPointerTo("AcLevel2")); |
pam_tree_clone[i]->Branch("AcLevel2","AcLevel2", GetPointerTo("AcLevel2")); |
2289 |
cout << "Anticounter : branch AcLevel2"<<endl; |
cout << "Anticounter : branch AcLevel2"<<endl; |
2290 |
i++; |
i++; |
2291 |
}; |
}; |
2292 |
// OrbitalInfo |
// OrbitalInfo |
2293 |
if(ORB) { |
if(ORB) { |
2294 |
tree_clone[i] = new TTree("OrbitalInfo","PAMELA oribital info "); |
pam_tree_clone[i] = new TTree("OrbitalInfo","PAMELA oribital info "); |
2295 |
tree_clone[i]->Branch("OrbitalInfo","OrbitalInfo", GetPointerTo("OrbitalInfo")); |
pam_tree_clone[i]->Branch("OrbitalInfo","OrbitalInfo", GetPointerTo("OrbitalInfo")); |
2296 |
cout << "OrbitalInfo : branch OrbitalInfo"<<endl; |
cout << "OrbitalInfo : branch OrbitalInfo"<<endl; |
2297 |
i++; |
i++; |
2298 |
}; |
}; |
2307 |
*/ |
*/ |
2308 |
//void PamLevel2::FillNewPamTree(TTree *T){ |
//void PamLevel2::FillNewPamTree(TTree *T){ |
2309 |
void PamLevel2::FillCloneTrees(){ |
void PamLevel2::FillCloneTrees(){ |
2310 |
|
|
2311 |
for(Int_t i=0; i<8; i++){ |
// cout << "PamLevel2::FillCloneTrees()" << irunentry << endl; |
2312 |
if(tree_clone[i])tree_clone[i]->Fill(); |
|
2313 |
|
for(Int_t i=0; i<NCLONES; i++){ |
2314 |
|
if(pam_tree_clone[i])pam_tree_clone[i]->Fill(); |
2315 |
} |
} |
2316 |
|
if(sel_tree_clone)sel_tree_clone->Fill(); |
2317 |
|
|
2318 |
} |
} |
2319 |
|
|
2320 |
|
|
2321 |
TTree* PamLevel2::GetCloneTree(TString name){ |
TTree* PamLevel2::GetCloneTree(TString name){ |
2322 |
|
|
2323 |
for(Int_t i=0; i<8; i++){ |
for(Int_t i=0; i<NCLONES; i++){ |
2324 |
if(tree_clone[i]){ |
if(pam_tree_clone[i]){ |
2325 |
TString na = tree_clone[i]->GetName(); |
TString na = pam_tree_clone[i]->GetName(); |
2326 |
if(!name.CompareTo(na))return tree_clone[i]; |
if(!name.CompareTo(na))return pam_tree_clone[i]; |
2327 |
}; |
}; |
2328 |
} |
} |
2329 |
|
if(run_tree_clone){ |
2330 |
|
TString na = run_tree_clone->GetName(); |
2331 |
|
if(!name.CompareTo(na))return run_tree_clone; |
2332 |
|
} |
2333 |
|
if(sel_tree_clone){ |
2334 |
|
TString na = sel_tree_clone->GetName(); |
2335 |
|
if(!name.CompareTo(na))return sel_tree_clone; |
2336 |
|
} |
2337 |
return NULL; |
return NULL; |
2338 |
|
|
2339 |
} |
} |
2340 |
void PamLevel2::WriteCloneTrees(){ |
void PamLevel2::WriteCloneTrees(){ |
2341 |
cout << "+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+" <<endl; |
cout << "+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+" <<endl; |
2342 |
cout << "Write clones of PAMELA trees "<<endl; |
cout << "Write clones of PAMELA trees "<<endl; |
2343 |
for(Int_t i=0; i<8; i++){ |
cout << run_tree_clone->GetName()<<endl; |
2344 |
if(tree_clone[i]){ |
run_tree_clone->Write(); |
2345 |
cout << tree_clone[i]->GetName()<<endl; |
cout << sel_tree_clone->GetName()<<endl; |
2346 |
tree_clone[i]->Write(); |
sel_tree_clone->Write(); |
2347 |
|
for(Int_t i=0; i<NCLONES; i++){ |
2348 |
|
if(pam_tree_clone[i]){ |
2349 |
|
cout << pam_tree_clone[i]->GetName()<<endl; |
2350 |
|
pam_tree_clone[i]->Write(); |
2351 |
}; |
}; |
2352 |
} |
} |
2353 |
cout << "+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+" <<endl; |
cout << "+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+" <<endl; |
2355 |
} |
} |
2356 |
|
|
2357 |
/** |
/** |
2358 |
* Create a new (empty) Pamela trees |
* Method to get level2-trees entry, the corresponding run entry and (if required) the level0 entry. |
2359 |
*/ |
*/ |
2360 |
// TTree* PamLevel2::GetNewPamTree(){ |
Int_t PamLevel2::GetEntry(Int_t iee){ |
2361 |
|
|
2362 |
|
if(!pam_tree){ |
2363 |
|
cout << " Int_t PamLevel2::GetEntry(Int_t) -- ERROR -- level2 trees not loaded"<<endl; |
2364 |
|
return 0; |
2365 |
|
} |
2366 |
|
|
2367 |
// if(tree_clone)return tree_clone; |
Int_t ii=0; |
2368 |
|
//------------------------------- |
2369 |
|
ii = iee; |
2370 |
|
if( !pam_tree->GetEntry(ii) ) return 0; |
2371 |
|
//------------------------------- |
2372 |
|
|
2373 |
|
if(!run_tree ){ |
2374 |
|
cout << " Int_t PamLevel2::GetEntry(Int_t) -- ERROR -- run tree not loaded"<<endl; |
2375 |
|
return 0; |
2376 |
|
} |
2377 |
|
|
2378 |
// TTree *Tout = 0; |
ii = iee; |
2379 |
|
Bool_t UPDATED = UpdateRunInfo(run_tree,ii); |
2380 |
// cout << "+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+" <<endl; |
if(SELLI==0)irunentry = iee-runfirstentry; |
2381 |
// cout << "Create new PAMELA trees "<<endl; |
if(UPDATED && run_tree_clone)run_tree_clone->Fill(); |
2382 |
|
|
2383 |
|
// cout << "PamLevel2::GetEntry("<<iee<<") "<<irun<<" "<<runfirstentry<<" "<<irunentry<<endl; |
2384 |
|
|
2385 |
|
if( TRK0 || CAL0 || TOF0 )GetYodaEntry( ); |
2386 |
|
|
2387 |
|
return 1; |
2388 |
|
|
2389 |
|
} |
2390 |
|
|
2391 |
|
/** |
2392 |
|
* Method to retrieve the level0 tree (YODA tree) that contains the current event. |
2393 |
|
* Given the run ID (...), if needed it query the DB and load the proper file. |
2394 |
|
* @return Pointer to the tree |
2395 |
|
*/ |
2396 |
|
|
2397 |
|
|
2398 |
|
TTree* PamLevel2::GetYodaTree( ){ |
2399 |
|
|
2400 |
|
// cout << "TTree* PamLevel2::GetYodaTree( )"<<endl; |
2401 |
|
//=================================== |
2402 |
|
// check if iroot has changed |
2403 |
|
//=================================== |
2404 |
|
if( irun<0 ){ |
2405 |
|
cout << "PamLevel2::GetYodaTree() -- ERROR "<<endl; |
2406 |
|
cout << "In order to use this method you have to load the RunInfo tree "<<endl; |
2407 |
|
cout << "with the method TChain* PamLevel2::GetRunTree(TString, TString)"<<endl; |
2408 |
|
// cout << " - read the event with PamLevel2::GetEntry(Int_t)"<<endl; |
2409 |
|
return NULL; |
2410 |
|
} |
2411 |
|
Int_t irootnew = run_obj->ID_ROOT_L0; |
2412 |
|
// cout << "iroot "<<iroot<<endl; |
2413 |
|
// cout << "irootnew "<<irootnew<<endl; |
2414 |
|
|
2415 |
|
//=================================== |
2416 |
|
// load the level0 file |
2417 |
|
// (if not already loaded) |
2418 |
|
//=================================== |
2419 |
|
if( iroot != irootnew || !l0_tree){ |
2420 |
|
iroot = irootnew; |
2421 |
|
//=================================== |
2422 |
|
// open the DB connection |
2423 |
|
// (if not already opened) |
2424 |
|
//=================================== |
2425 |
|
if(!dbc || (dbc && !dbc->IsConnected())){ |
2426 |
|
cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl; |
2427 |
|
cout<<"Connecting to DB"<<endl; |
2428 |
|
cout<<"HOST "<<host<<endl; |
2429 |
|
cout<<"USER "<<user<<endl; |
2430 |
|
cout<<"PSW "<<psw<<endl; |
2431 |
|
dbc = TSQLServer::Connect(host.Data(),user.Data(),psw.Data()); |
2432 |
|
if( !dbc )return NULL; |
2433 |
|
if( !dbc->IsConnected() )return NULL; |
2434 |
|
// cout<<"...done"<<endl; |
2435 |
|
cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl; |
2436 |
|
}else{ |
2437 |
|
// cout<<"DB already connected"<<endl; |
2438 |
|
} |
2439 |
|
GL_ROOT glroot = GL_ROOT(); |
2440 |
|
if( glroot.Query_GL_ROOT(iroot,dbc) ){ |
2441 |
|
cout << "TTree* PamLevel2::GetYodaTree( ) -- ERROR -- level0 file iroot = "<<iroot<< " does not exists"<<endl; |
2442 |
|
return NULL; |
2443 |
|
}; |
2444 |
|
TString filename = glroot.PATH + glroot.NAME; |
2445 |
|
if(l0_file){ |
2446 |
|
l0_file->Close(); |
2447 |
|
l0_file->Delete(); |
2448 |
|
} |
2449 |
|
cout << "Opening LEVEL0 file: "<< filename << endl; |
2450 |
|
FileStat_t t; |
2451 |
|
if( gSystem->GetPathInfo(filename.Data(),t) ){ |
2452 |
|
cout << " PamLevel2::GetYodaTree() -- ERROR opening file "<<endl; |
2453 |
|
return NULL; |
2454 |
|
} |
2455 |
|
l0_file = new TFile(filename); |
2456 |
|
if( !l0_file )return NULL; |
2457 |
|
l0_tree = (TTree*)l0_file->Get("Physics"); |
2458 |
|
if(!h0_obj)h0_obj = new EventHeader(); |
2459 |
|
l0_tree->SetBranchAddress("Header" ,&h0_obj); |
2460 |
|
//--------------------------------------------------- |
2461 |
|
// TRACKER: |
2462 |
|
if(TRK0){ |
2463 |
|
if(!trk0_obj){ |
2464 |
|
trk0_obj = new TrkLevel0(); |
2465 |
|
trk0_obj->Set(); |
2466 |
|
}; |
2467 |
|
l0_tree->SetBranchAddress("Tracker" ,trk0_obj->GetPointerToTrackerEvent()); |
2468 |
|
TrkParams::SetCalib(run_obj,dbc); |
2469 |
|
} |
2470 |
|
//--------------------------------------------------- |
2471 |
|
// CALORIMETER: |
2472 |
|
if(CAL0){ |
2473 |
|
cout << "PamLevel2::GetYodaTree() --- level0 calorimeter not implemented "<<endl; |
2474 |
|
} |
2475 |
|
//--------------------------------------------------- |
2476 |
|
// TOF: |
2477 |
|
if(TOF0){ |
2478 |
|
cout << "PamLevel2::GetYodaTree() --- level0 TOF not implemented "<<endl; |
2479 |
|
} |
2480 |
|
|
2481 |
|
}; |
2482 |
|
|
2483 |
|
// cout << l0_tree << endl; |
2484 |
|
|
2485 |
// if(TRK1||TRK2||TRKh){ |
return l0_tree; |
|
// TTree *T = new TTree("Tracker_clone","PAMELA tracker level2 data "); |
|
|
// if(TRK1) { |
|
|
// trk1_clone = new TrkLevel1(); |
|
|
// T->Branch("TrkLevel1","TrkLevel1", &trk1_clone); |
|
|
// T->BranchRef(); |
|
|
// cout << "Tracker : branch TrkLevel1"<<endl; |
|
|
// }; |
|
|
// if(TRK2) { |
|
|
// trk2_clone = new TrkLevel2(); |
|
|
// T->Branch("TrkLevel2", "TrkLevel2",&trk2_clone); |
|
|
// cout << "Tracker : branch TrkLevel2"<<endl; |
|
|
// }; |
|
|
// if(TRKh) { |
|
|
// trkh_clone = new TrkHough(); |
|
|
// T->Branch("TrkHough","TrkHough", &trkh_clone); |
|
|
// cout << "Tracker : branch TrkHough"<<endl; |
|
|
// }; |
|
|
// if(!Tout)Tout=T; |
|
|
// else Tout->AddFriend("Tracker_clone"); |
|
|
// } |
|
|
|
|
|
// // Calorimeter |
|
|
// if(CAL1||CAL2){ |
|
|
// TTree *C = new TTree("Calorimeter_clone","PAMELA calorimeter level2 data "); |
|
|
// if(CAL1) { |
|
|
// calo1_clone = new CaloLevel1(); |
|
|
// C->Branch("CaloLevel1", "CaloLevel1", &calo1_clone); |
|
|
// cout << "Calorimeter : branch CaloLevel1"<<endl; |
|
|
// }; |
|
|
// if(CAL2) { |
|
|
// calo2_clone = new CaloLevel2(); |
|
|
// C->Branch("CaloLevel2","CaloLevel2", &calo2_clone); |
|
|
// cout << "Calorimeter : branch CaloLevel2"<<endl; |
|
|
// }; |
|
|
// if(!Tout)Tout=C; |
|
|
// else Tout->AddFriend("Calorimeter_clone"); |
|
|
// } |
|
|
|
|
|
// // ToF |
|
|
// if(TOF) { |
|
|
// TTree *O = new TTree("ToF_clone","PAMELA ToF level2 data "); |
|
|
// tof_clone = new ToFLevel2(); |
|
|
// O->Branch("ToFLevel2","ToFLevel2", &tof_clone); |
|
|
// cout << "ToF : branch ToFLevel2"<<endl; |
|
|
// if(!Tout)Tout=O; |
|
|
// else Tout->AddFriend("ToF_clone"); |
|
|
// }; |
|
|
// // Trigger |
|
|
// if(TRG) { |
|
|
// TTree *R = new TTree("Trigger_clone","PAMELA trigger level2 data "); |
|
|
// trig_clone = new TrigLevel2(); |
|
|
// R->Branch("TrigLevel2","TrigLevel2", &trig_clone); |
|
|
// cout << "Trigger : branch TrigLevel2"<<endl; |
|
|
// if(!Tout)Tout=R; |
|
|
// else Tout->AddFriend("Trigger_clone"); |
|
|
// }; |
|
|
// // S4 |
|
|
// if(S4) { |
|
|
// TTree *S = new TTree("S4_clone","PAMELA S4 level2 data "); |
|
|
// s4_clone = new S4Level2(); |
|
|
// S->Branch("S4Level2","S4Level2", &s4_clone); |
|
|
// cout << "S4 : branch S4Level2"<<endl; |
|
|
// if(!Tout)Tout=S; |
|
|
// else Tout->AddFriend("S4_clone"); |
|
|
// }; |
|
|
// // Neutron Detector |
|
|
// if(ND) { |
|
|
// TTree *N = new TTree("NeutronD_clone","PAMELA neutron detector level2 data "); |
|
|
// nd_clone = new NDLevel2(); |
|
|
// N->Branch("NDLevel2","NDLevel2", &nd_clone); |
|
|
// cout << "NeutronD : branch NDLevel2"<<endl; |
|
|
// if(!Tout)Tout=N; |
|
|
// else Tout->AddFriend("NeutronD_clone"); |
|
|
// }; |
|
|
// // Anticounters |
|
|
// if(AC) { |
|
|
// TTree *A = new TTree("Anticounter_clone","PAMELA anticounter detector level2 data "); |
|
|
// ac_clone = new AcLevel2(); |
|
|
// A->Branch("AcLevel2","AcLevel2", &ac_clone); |
|
|
// cout << "Anticounter : branch AcLevel2"<<endl; |
|
|
// if(!Tout)Tout=A; |
|
|
// else Tout->AddFriend("Anticounter_clone"); |
|
|
// }; |
|
|
// // OrbitalInfo |
|
|
// if(ORB) { |
|
|
// TTree *B = new TTree("OrbitalInfo_clone","PAMELA oribital info "); |
|
|
// orb_clone = new OrbitalInfo(); |
|
|
// B->Branch("OrbitalInfo","OrbitalInfo", &orb_clone); |
|
|
// cout << "OrbitalInfo : branch OrbitalInfo"<<endl; |
|
|
// if(!Tout)Tout=B; |
|
|
// else Tout->AddFriend("OrbitalInfo_clone"); |
|
|
// }; |
|
|
// cout << "+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+" <<endl; |
|
2486 |
|
|
2487 |
// tree_clone = Tout; |
} |
|
// tree_clone->SetDirectory(0); |
|
2488 |
|
|
2489 |
// return Tout; |
/** |
2490 |
// } |
* Method to retrieve the level0 tree (YODA tree) that contains the current event. |
2491 |
// /** |
*/ |
2492 |
// * Fill a tree (created with GetNewPamTree) |
Int_t PamLevel2::GetYodaEntry(){ |
|
// * |
|
|
// */ |
|
|
// //void PamLevel2::FillNewPamTree(TTree *T){ |
|
|
// void PamLevel2::FillNewPamTree(){ |
|
|
|
|
2493 |
|
|
2494 |
// if(trk1_clone) *trk1_clone = *trk1_obj; |
// cout << "Int_t PamLevel2::GetYodaEntry()"<<endl; |
2495 |
// if(trk2_clone){ |
if(!GetYodaTree())return 0; |
2496 |
// trk2_clone->Clear(); |
|
2497 |
// trk2_obj->Copy(*trk2_clone); |
// --------------------------------- |
2498 |
// // *trk2_clone = *trk2_obj; |
// if file is NOT a preselected file |
2499 |
// } |
// --------------------------------- |
2500 |
// if(trkh_clone) *trkh_clone = *trkh_obj; |
Int_t quellagiusta = irunentry + run_obj->EV_FROM; |
|
// if(calo1_clone){ |
|
|
// // *calo1_clone = *calo1_obj; |
|
|
// calo1_clone->Clear(); |
|
|
// calo1_obj->Copy(*calo1_clone); |
|
|
// } |
|
|
// if(calo2_clone){ |
|
|
// // *calo2_clone = *calo2_obj; |
|
|
// calo2_clone->Clear(); |
|
|
// calo2_obj->Copy(*calo2_clone); |
|
|
// } |
|
|
// if(tof_clone) *tof_clone = *tof_obj; |
|
|
// if(trig_clone) *trig_clone = *trig_obj; |
|
|
// if(s4_clone) *s4_clone = *s4_obj; |
|
|
// if(nd_clone) *nd_clone = *nd_obj; |
|
|
// if(ac_clone) *ac_clone = *ac_obj; |
|
|
// if(orb_clone) *orb_clone = *orb_obj; |
|
|
|
|
|
// TTree *T = tree_clone; |
|
|
|
|
|
// T->Fill(); //fill main tree |
|
|
// // cout<<T->IsA()->GetName()<<" "<<T->GetName()<<endl; |
|
|
// TList *li = T->GetListOfFriends(); |
|
|
// TIter next(li); |
|
|
// TFriendElement* T_friend=0; |
|
|
// while( (T_friend = (TFriendElement*)next()) ){ |
|
|
// // cout<<T_friend->IsA()->GetName()<<" "<<T_friend->GetName()<<hex << T_friend->GetTree() << dec<<endl; |
|
|
// T_friend->GetTree()->Fill();//fill friends |
|
|
// } |
|
2501 |
|
|
2502 |
// } |
if( !GetOrbitalInfo() ){ |
2503 |
|
cout << "Int_t PamLevel2::GetYodaEntry() -- ERROR -- missing OrbitalInfo "<<endl; |
2504 |
|
return 0; |
2505 |
|
} |
2506 |
|
|
2507 |
|
// --------------------------------------------------------------------- |
2508 |
|
// ATTENTION!!! |
2509 |
|
// If data are not pre-processed with cleaner, the level0 tree may contain |
2510 |
|
// spurious nested physics packets. |
2511 |
|
// The GL_RUN variables EV_FROM, EV_TO and NEVENTS counts also these entries |
2512 |
|
// while level2 tree DOES NOT!! |
2513 |
|
// This means that "quellagiusta" in these cases is not correct. |
2514 |
|
// In order to retrieve the correct level0 event, I implemented a check |
2515 |
|
// of the OBT and pkt-number. In case of mismatch, the level0 entry number |
2516 |
|
// is shift forward until when the packets match. |
2517 |
|
// --------------------------------------------------------------------- |
2518 |
|
Int_t answer = 0; |
2519 |
|
Int_t shift =0; |
2520 |
|
do{ |
2521 |
|
// if(shift>0){ |
2522 |
|
// cout << " level0 <--> level2 mismatch ( irun "<<irun<<" irunentry "<<irunentry<<" shift "<<shift<<" )"<<endl; |
2523 |
|
// } |
2524 |
|
answer = GetYodaTree()->GetEntry(quellagiusta+shift); |
2525 |
|
shift++; |
2526 |
|
if( !GetEventHeader() ){ |
2527 |
|
cout << "Int_t PamLevel2::GetYodaEntry() -- ERROR -- missing EventHeader "<<endl; |
2528 |
|
return 0; |
2529 |
|
} |
2530 |
|
// if( (quellagiusta+shift) == GetYodaTree()->GetEntries()+1 )cout << ">>> end of level0 tree <<<"<<endl; |
2531 |
|
}while( ( (UInt_t)(GetOrbitalInfo()->OBT) != (UInt_t)(GetEventHeader()->GetPscuHeader()->GetOrbitalTime()) || GetOrbitalInfo()->pkt_num != (UInt_t)(GetEventHeader()->GetPscuHeader()->GetCounter())) && (quellagiusta+shift) < (UInt_t)(GetYodaTree()->GetEntries()) ); |
2532 |
|
|
2533 |
|
// cout << "LA ENTRY GIUSTA E`: "<<quellagiusta<<" (spero...)"<<endl; |
2534 |
|
// return GetYodaTree()->GetEntry(quellagiusta); |
2535 |
|
|
2536 |
|
return answer; |
2537 |
|
|
2538 |
|
} |