69 |
#include <FEVdetector.h> |
#include <FEVdetector.h> |
70 |
#include <FEventViewer.h> |
#include <FEventViewer.h> |
71 |
#include <feventvstruct.h> |
#include <feventvstruct.h> |
72 |
|
#include <color.h> |
73 |
// |
// |
74 |
extern Bool_t existfile(TString); |
extern Bool_t existfile(TString); |
75 |
// |
// |
83 |
thefigure = &figure; |
thefigure = &figure; |
84 |
checkctrlword(); |
checkctrlword(); |
85 |
var.selex = false; |
var.selex = false; |
86 |
|
var.showall = false; |
87 |
|
|
88 |
|
var.showsi = false; |
89 |
|
var.shownd = false; |
90 |
|
var.shows4 = false; |
91 |
|
var.showorb = false; |
92 |
|
var.showtof = false; |
93 |
|
var.showtrg = false; |
94 |
|
var.showtrk = false; |
95 |
|
var.showcal = false; |
96 |
|
var.showrun = false; |
97 |
|
var.showac = false; |
98 |
} |
} |
99 |
|
|
100 |
void FEVdetector::checkctrlword(){ |
void FEVdetector::checkctrlword(){ |
103 |
var.AC = 0; |
var.AC = 0; |
104 |
var.RUN = 1; |
var.RUN = 1; |
105 |
var.TRK = 0; |
var.TRK = 0; |
106 |
var.ORB = 0; |
var.ORB = 1; |
107 |
var.TRG = 0; |
var.TRG = 1; |
108 |
var.CALO = 0; |
var.CALO = 0; |
109 |
|
var.CALOT = 0; |
110 |
var.S4 = 0; |
var.S4 = 0; |
111 |
var.ND = 0; |
var.ND = 0; |
112 |
var.INFOS = 0; |
var.INFOS = 0; |
146 |
}; |
}; |
147 |
|
|
148 |
void FEVdetector::GetWindow(){ |
void FEVdetector::GetWindow(){ |
|
otr->GetEntry(maxevent); |
|
149 |
// |
// |
150 |
|
if ( level.file == 2 ){ |
151 |
|
// printf("0qui\n"); |
152 |
|
L2->GetEntry(minevent); |
153 |
|
} else { |
154 |
|
otr->GetEntry(minevent); |
155 |
|
} |
156 |
if ( level.file < 2 ){ |
if ( level.file < 2 ){ |
157 |
ph = eh->GetPscuHeader(); |
ph = eh->GetPscuHeader(); |
158 |
lastevno = (int)ph->Counter; |
firstevno = (int)ph->Counter; |
159 |
} else { |
} else { |
160 |
if ( var.ORB ){ |
if ( var.ORB ){ |
161 |
lastevno = L2->GetOrbitalInfo()->pkt_num; |
firstevno = L2->GetOrbitalInfo()->pkt_num; |
162 |
} else { |
} else { |
163 |
lastevno = 0; |
firstevno = 0; |
164 |
}; |
}; |
165 |
}; |
}; |
166 |
otr->GetEntry(minevent); |
// |
167 |
|
if ( level.file == 2 ){ |
168 |
|
// printf("1qui\n"); |
169 |
|
L2->GetEntry(maxevent); |
170 |
|
} else { |
171 |
|
otr->GetEntry(maxevent); |
172 |
|
} |
173 |
|
// |
174 |
if ( level.file < 2 ){ |
if ( level.file < 2 ){ |
175 |
ph = eh->GetPscuHeader(); |
ph = eh->GetPscuHeader(); |
176 |
firstevno = (int)ph->Counter; |
lastevno = (int)ph->Counter; |
177 |
} else { |
} else { |
178 |
if ( var.ORB ){ |
if ( var.ORB ){ |
179 |
firstevno = L2->GetOrbitalInfo()->pkt_num; |
lastevno = L2->GetOrbitalInfo()->pkt_num; |
180 |
} else { |
} else { |
181 |
firstevno = 0; |
lastevno = 0; |
182 |
}; |
}; |
183 |
}; |
}; |
184 |
|
// |
185 |
} |
} |
186 |
|
|
187 |
void FEVdetector::ClearVariables(){ |
void FEVdetector::ClearVariables(){ |
204 |
} |
} |
205 |
|
|
206 |
void FEVdetector::GetEntry(Int_t i){ |
void FEVdetector::GetEntry(Int_t i){ |
207 |
thisentry = i; |
thisentry = i; |
208 |
otr->GetEntry(i); |
if ( level.file == 2 ){ |
209 |
// if ( level.file == 2 ){ |
L2->Clear(); |
210 |
// ShowInfo("TrkLevel2"); |
// printf("qui\n"); |
211 |
// ShowInfo("ToFLevel2"); |
L2->GetEntry(i); |
212 |
// ShowInfo("CaloLevel2"); |
if ( var.showall ){ |
213 |
// }; |
ShowInfo("RunInfo"); |
214 |
// PrintData(otr,-1LL,44); |
ShowInfo("SoftInfo"); |
215 |
|
ShowInfo("OrbitalInfo"); |
216 |
|
ShowInfo("TrigLevel2"); |
217 |
|
ShowInfo("ToFLevel2"); |
218 |
|
ShowInfo("TrkLevel2"); |
219 |
|
ShowInfo("AcLevel2"); |
220 |
|
ShowInfo("CaloLevel2"); |
221 |
|
ShowInfo("CaloLevel1"); |
222 |
|
ShowInfo("S4Level2"); |
223 |
|
ShowInfo("NDLevel2"); |
224 |
|
} else { |
225 |
|
if ( var.showrun ) ShowInfo("RunInfo"); |
226 |
|
if ( var.showsi ) ShowInfo("SoftInfo"); |
227 |
|
if ( var.showorb ) ShowInfo("OrbitalInfo"); |
228 |
|
if ( var.showtrg ) ShowInfo("TrigLevel2"); |
229 |
|
if ( var.showtof ) ShowInfo("ToFLevel2"); |
230 |
|
if ( var.showtrk ) ShowInfo("TrkLevel2"); |
231 |
|
if ( var.showac ) ShowInfo("AcLevel2"); |
232 |
|
if ( var.showcal ) ShowInfo("CaloLevel2"); |
233 |
|
if ( var.showcal ) ShowInfo("CaloLevel1"); |
234 |
|
if ( var.shows4 ) ShowInfo("S4Level2"); |
235 |
|
if ( var.shownd ) ShowInfo("NDLevel2"); |
236 |
|
}; |
237 |
|
} else { |
238 |
|
otr->GetEntry(i); |
239 |
|
if ( var.showall ){ |
240 |
|
ShowInfo("Pscu"); |
241 |
|
ShowInfo("Trigger"); |
242 |
|
ShowInfo("Tof"); |
243 |
|
ShowInfo("Tracker"); |
244 |
|
ShowInfo("Anticounter"); |
245 |
|
ShowInfo("Calorimeter"); |
246 |
|
ShowInfo("S4"); |
247 |
|
ShowInfo("Neutron"); |
248 |
|
} else { |
249 |
|
if ( var.showorb ) ShowInfo("Pscu"); |
250 |
|
if ( var.showtrg ) ShowInfo("Trigger"); |
251 |
|
if ( var.showtof ) ShowInfo("Tof"); |
252 |
|
if ( var.showtrk ) ShowInfo("Tracker"); |
253 |
|
if ( var.showac ) ShowInfo("Anticounter"); |
254 |
|
if ( var.showcal ) ShowInfo("Calorimeter"); |
255 |
|
if ( var.shows4 ) ShowInfo("S4"); |
256 |
|
if ( var.shownd ) ShowInfo("Neutron"); |
257 |
|
}; |
258 |
|
}; |
259 |
} |
} |
260 |
|
|
261 |
void FEVdetector::SetEntry(Int_t i){ |
void FEVdetector::SetEntry(Int_t i){ |
376 |
}; |
}; |
377 |
} |
} |
378 |
|
|
|
void FEVdetector::PrintLeaves(TTree *otr, Int_t i, TBranchElement *tb, Int_t lenmax){ |
|
|
// -- Prints values of leaves. |
|
|
|
|
|
// tb->ValidateAddress(); |
|
|
printf("son qua \n"); |
|
|
|
|
|
// if (otr->GetMakeClass()) { |
|
|
if (!tb->GetAddress()) { |
|
|
printf("esco \n"); |
|
|
return; |
|
|
} |
|
|
if (tb->GetType() == 3 || tb->GetType() == 4) { |
|
|
// TClonesArray or STL container top-level branch. |
|
|
printf("3 o 4 %-15s = %d\n", tb->GetName(), tb->GetNdata()); |
|
|
return; |
|
|
} else if (tb->GetType() == 31 || tb->GetType() == 41) { |
|
|
printf(" 31 o 41 \n"); |
|
|
// TClonesArray or STL container sub-branch. |
|
|
Int_t n = TMath::Min(10, tb->GetNdata()); |
|
|
Int_t atype = tb->GetStreamerType() + 20; |
|
|
if (tb->GetStreamerType() == 1) { |
|
|
// TVirtualStreamerInfo::kOffsetL + TVirtualStreamerInfo::kChar is |
|
|
// printed as a string and could print weird characters. |
|
|
// So we print an unsigned char instead (not perfect, but better). |
|
|
atype = 20 + 11 ; |
|
|
} |
|
|
if (atype > 54) { |
|
|
// FIXME: More logic required here (like in ReadLeaves) |
|
|
printf(">54 %-15s = %d\n", tb->GetName(), tb->GetNdata()); |
|
|
return; |
|
|
} |
|
|
if (tb->GetStreamerType() > 20) { |
|
|
atype -= 20; |
|
|
// TObjArray *prova= otr->GetListOfLeaves(); |
|
|
// // TObjArray* leaf2 = (TObjArray*) prova->UncheckedAt(i); |
|
|
// //TLeaf* leaf = (TLeaf*)(otr->GetLeaf(tb->GetName())); |
|
|
// // TLeafElement* leaf = (TLeafElement*)((TLeaf*)(otr->GetListOfLeaves()->UncheckedAt(i))->GetBranch()->UncheckedAt(0)); |
|
|
// TLeafElement* leaf = (TLeafElement*)(prova->UncheckedAt(0)); |
|
|
// n = n * leaf->GetLenStatic(); |
|
|
} |
|
|
if (tb->GetInfo()) { |
|
|
// n = 16; |
|
|
// tb->GetInfo()->PrintValue(tb->GetName(), tb->GetAddress(), atype, n, lenmax); |
|
|
//tb->GetObject()->GetInfo()->PrintValue(tb->GetName(), tb->GetObject(), atype, n, lenmax); |
|
|
} |
|
|
return; |
|
|
} else if (tb->GetType() <= 2) { |
|
|
printf(" <=2 \n"); |
|
|
// Branch in split mode. |
|
|
// FIXME: This should probably be < 60 instead. |
|
|
if ((tb->GetStreamerType() > 40) && (tb->GetStreamerType() < 55)) { |
|
|
Int_t atype = tb->GetStreamerType() - 20; |
|
|
TBranchElement* counterElement = (TBranchElement*) tb->GetBranchCount(); |
|
|
Int_t n = (Int_t) counterElement->GetValue(0, 0); |
|
|
if (tb->GetInfo()) { |
|
|
tb->GetInfo()->PrintValue(tb->GetName(), tb->GetAddress(), atype, n, lenmax); |
|
|
} |
|
|
} else { |
|
|
// if (tb->GetInfo()) { |
|
|
// tb->GetInfo()->PrintValue(tb->GetName(), tb->GetObject(), tb->GetID(), -1, lenmax); |
|
|
// } |
|
|
// } |
|
|
return; |
|
|
} |
|
|
} else if (tb->GetType() == 3) { |
|
|
printf("3 %-15s = %d\n", tb->GetName(), tb->GetNdata()); |
|
|
} else if (tb->GetType() == 31) { |
|
|
printf("31 %-15s = %d\n", tb->GetName(), tb->GetNdata()); |
|
|
// TClonesArray* clones = (TClonesArray*) tb->GetObject(); |
|
|
// if (tb->GetInfo()) { |
|
|
// tb->GetInfo()->PrintValueClones(tb->GetName(), clones, tb->GetID(), tb->GetOffset(), lenmax); |
|
|
// } |
|
|
} else if (tb->GetType() == 41) { |
|
|
printf("41 %-15s = %d\n", tb->GetName(), tb->GetNdata()); |
|
|
// TVirtualCollectionProxy::TPushPop helper(((TBranchElement*) this)->GetCollectionProxy(), fObject); |
|
|
// if (GetInfo()) { |
|
|
// GetInfo()->PrintValueSTL(GetName(), ((TBranchElement*) this)->GetCollectionProxy(), fID, fOffset, lenmax); |
|
|
// } |
|
|
} else { |
|
|
printf("else %-15s = %d\n", tb->GetName(), tb->GetNdata()); |
|
|
// if (GetInfo()) { |
|
|
// GetInfo()->PrintValue(GetName(), fObject, fID, -1, lenmax); |
|
|
// } |
|
|
} |
|
|
|
|
|
// }; |
|
|
printf("esco qui\n"); |
|
|
}; |
|
|
|
|
|
|
|
379 |
void FEVdetector::ShowInfo(TString detector){ |
void FEVdetector::ShowInfo(TString detector){ |
380 |
// |
// |
381 |
TBranch *b1 = 0; |
TBranch *b1 = 0; |
382 |
TBranch *b3 = 0; |
// TBranch *b3 = 0; |
383 |
TObjArray *branch_array = 0; |
TObjArray *branch_array = 0; |
384 |
TObjArray *leaf_array = 0; |
// TObjArray *leaf_array = 0; |
385 |
|
// |
386 |
|
if ( !strcmp(detector.Data(),"RunInfo") || !strcmp(detector.Data(),"SoftInfo") ){ |
387 |
|
if ( L2->GetRunTree() ) b1 = L2->GetRunTree()->FindBranch(detector.Data()); |
388 |
|
} else { |
389 |
|
b1 = otr->FindBranch(detector.Data()); |
390 |
|
}; |
391 |
|
// |
392 |
|
if ( !b1 ) return; |
393 |
|
// |
394 |
|
Int_t dlen = 10; |
395 |
|
// |
396 |
|
char o[200000]; |
397 |
|
char col[13]; |
398 |
|
char col2[13]; |
399 |
// |
// |
400 |
b1 = otr->FindBranch(detector.Data()); |
setcolor(col,RESET, GREEN, WHITE); |
401 |
Int_t dlen = 44; |
sprintf(o,"%s======> EVENT:%i\n",col, thisentry); |
402 |
// |
// |
403 |
printf("======> EVENT:%i\n", thisentry); |
setcolor(col,RESET, RED, WHITE); |
404 |
|
sprintf(o,"%s%sBranch %s\n",o,col,b1->GetName()); |
405 |
|
setcolor(col,RESET, BLACK, WHITE); |
406 |
|
sprintf(o,"%s%s",o,col); |
407 |
// |
// |
|
printf("Branch %s\n",b1->GetName()); |
|
408 |
branch_array = b1->GetListOfBranches(); |
branch_array = b1->GetListOfBranches(); |
409 |
// |
// |
410 |
Int_t j = 0; |
Int_t j = 0; |
416 |
Int_t atype = tb->GetStreamerType() - 20; |
Int_t atype = tb->GetStreamerType() - 20; |
417 |
Int_t len = (tb->GetInfo()->GetLengths())[tb->GetID()]; |
Int_t len = (tb->GetInfo()->GetLengths())[tb->GetID()]; |
418 |
Int_t length = min(len,dlen); |
Int_t length = min(len,dlen); |
419 |
// printf("SubBranches : %s type is %i tb getname %s\n",((TBranch*)branch_array->At(l))->GetName(),type,tb->GetName()); |
// |
420 |
|
// printf("Branches : type is %i type is %i tb getname %s slen %i slength %i\n",atype,type,tb->GetName(),len,length); |
421 |
switch (type){ |
switch (type){ |
422 |
case 0: |
case 0: |
423 |
// |
// |
426 |
// |
// |
427 |
// NAME |
// NAME |
428 |
// |
// |
429 |
// printf(" ATYPE IS %i \n",atype); |
setcolor(col,RESET, BLUE, WHITE); |
430 |
printf(" %-15s =",((TBranch*)branch_array->At(l))->GetName()); |
setcolor(col2,RESET, BLACK, WHITE); |
431 |
|
sprintf(o,"%s%s %-15s%s =",o,col,((TBranch*)branch_array->At(l))->GetName(),col2); |
432 |
|
// |
433 |
j = 0; |
j = 0; |
434 |
// |
// |
435 |
// VALUES |
// VALUES |
436 |
// |
// |
437 |
|
// |
438 |
|
// Integer |
439 |
|
// |
440 |
if ( atype == 3 || atype == -17 ){ |
if ( atype == 3 || atype == -17 ){ |
441 |
while ( j < length ){ |
while ( j < length ){ |
442 |
if ( j < length -1 ){ |
if ( j < length -1 ){ |
443 |
printf(" %llu ,",(ULong64_t)tb->GetValue(j,0)); |
sprintf(o,"%s %i ,",o,(Int_t)tb->GetValue(j,0)); |
444 |
} else { |
} else { |
445 |
printf(" %llu",(ULong64_t)tb->GetValue(j,0)); |
sprintf(o,"%s %i",o,(Int_t)tb->GetValue(j,0)); |
446 |
}; |
}; |
447 |
j++; |
j++; |
448 |
}; |
}; |
449 |
} else { |
}; |
450 |
|
// |
451 |
|
// Unsigned integer |
452 |
|
// |
453 |
|
if ( atype == -7 || atype == 13 || atype == -9 || atype == -8 || atype == 12 ){ |
454 |
while ( j < length ){ |
while ( j < length ){ |
455 |
if ( j < length -1 ){ |
if ( j < length -1 ){ |
456 |
printf(" %f ,",tb->GetValue(j,0)); |
sprintf(o,"%s %u ,",o,(UInt_t)tb->GetValue(j,0)); |
457 |
} else { |
} else { |
458 |
printf(" %f",tb->GetValue(j,0)); |
sprintf(o,"%s %u",o,(UInt_t)tb->GetValue(j,0)); |
459 |
}; |
}; |
460 |
j++; |
j++; |
461 |
}; |
}; |
462 |
}; |
}; |
|
printf("\n"); |
|
|
break; |
|
|
case 3: |
|
463 |
// |
// |
464 |
// IS A TCLONESARRAY |
// Float |
|
// |
|
|
printf(" %-15s = %d\n", tb->GetName(), tb->GetNdata()); |
|
465 |
// |
// |
466 |
if ( tb->GetNdata() ){ |
if ( atype == -15 || atype == 5 ){ |
467 |
|
while ( j < length ){ |
468 |
printf(" auiauiaui\n"); |
if ( j < length -1 ){ |
469 |
TClonesArray *cl = (TClonesArray*)tb->GetObject(); |
sprintf(o,"%s %f ,",o,tb->GetValue(j,0)); |
470 |
// |
} else { |
471 |
printf(" name %s\n",cl->GetName()); |
sprintf(o,"%s %f",o,tb->GetValue(j,0)); |
|
// |
|
|
TClass *myc = cl->GetClass(); |
|
|
// |
|
|
TList *lme = myc->GetListOfDataMembers(); |
|
|
TIter next(lme); |
|
|
Int_t ls=0; |
|
|
TBranchElement *tb2 = 0; |
|
|
printf("la classe %s contiene:\n",myc->GetName()); |
|
|
while ( (tb2 = (TBranchElement*)next()) ){ |
|
|
// |
|
|
printf(" Memeber %i is %s \n",ls,tb2->GetName()); |
|
|
|
|
|
Int_t thisoffset = 0; |
|
|
TRealData *rd = myc->GetRealData(tb2->GetName()); |
|
|
if ( rd ){ |
|
|
printf(" rd name %s offset %i \n",rd->GetName(),rd->GetThisOffset()); |
|
|
thisoffset = rd->GetThisOffset(); |
|
472 |
}; |
}; |
473 |
|
j++; |
474 |
ls++; |
}; |
|
|
|
|
// }; |
|
|
|
|
|
for (Int_t ll=0; ll<cl->GetEntriesFast();ll++){ |
|
|
// |
|
|
printf(" Entry %i 0x%X\n",ll,cl->At(ll)); |
|
|
|
|
|
// tb->GetInfo()->PrintValue(rd->GetName(), (char*)cl->At(ll)+thisoffset, 0, ls, 44); |
|
|
|
|
|
// printf(" value1 = %i \n",&((*cl->At(ll))<<thisoffset))); |
|
|
|
|
|
// char *point = 0; |
|
|
|
|
|
// myc->BuildRealData(point); |
|
|
|
|
|
// point = (char*)cl->At(ll); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// printf(" uncheck 0x%X \n",cl->UncheckedAt(ll)); |
|
|
|
|
|
|
|
|
|
|
|
// TLeafElement* leaf = (TLeafElement*)(cl->UncheckedAt(ll)); |
|
|
// Int_t n = n * leaf->GetLenStatic(); |
|
|
// Int_t n = leaf->GetLenStatic(); |
|
|
//printf(" len static is %i name %s\n",n,leaf->GetName()); |
|
|
// TLeaf *foglia = tb2->FindLeaf(tb2->GetName()); |
|
|
|
|
|
// printf(" foglia lunga %i 0x%X \n",foglia->GetLen(),foglia); |
|
|
|
|
|
// |
|
|
// char *pointer = (char*)cl->UnchekedAt(ll); |
|
|
// char *ladd = pointer + offset; |
|
|
// Int_t *count = (Int_t*)(pointer+((tb2->GetMethods())[ls])); |
|
|
|
|
|
|
|
|
|
|
|
// printf(" lunghezza del clone secondo getentriesfast %i \n",cl->GetEntriesFast()); |
|
|
// tb->GetInfo()->PrintValueClones(tb->GetName(), cl, tb->GetID(), tb->GetOffset(), length); |
|
|
// tb->GetInfo()->PrintValueClones(tb2->GetName(),cl,ls,tb->GetOffset(),44); |
|
|
// TStreamerElement *aElement = (TStreamerElement *)tb2->GetElement()// Int_t type2 = tb2->GetType(); |
|
|
// Int_t atype2 = tb2->GetStreamerType() - 20; |
|
|
// printf(" subsubsubleaves : %s type is %i \n",tb2->GetName(),type2); |
|
|
// Int_t len2 = (tb2->GetInfo()->GetLengths())[tb2->GetID()]; |
|
|
// Int_t length2 = min(len2,dlen); |
|
|
// switch (type2){ |
|
|
// case 0: |
|
|
// // |
|
|
// // IS A VARIABLE |
|
|
// // |
|
|
// // |
|
|
// // NAME |
|
|
// // |
|
|
// printf(" ATYPE IS %i \n",atype2); |
|
|
// printf(" %-15s =",tb2->GetName()); |
|
|
// j = 0; |
|
|
// // |
|
|
// // VALUES |
|
|
// // |
|
|
// if ( atype2 == 3 || atype2 == -17 ){ |
|
|
// while ( j < length2 ){ |
|
|
// if ( j < length2 -1 ){ |
|
|
// printf(" %llu ,",(ULong64_t)tb2->GetValue(j,0)); |
|
|
// } else { |
|
|
// printf(" %llu",(ULong64_t)tb2->GetValue(j,0)); |
|
|
// }; |
|
|
// j++; |
|
|
// }; |
|
|
// } else { |
|
|
// while ( j < length2 ){ |
|
|
// if ( j < length2 -1 ){ |
|
|
// printf(" %f ,",tb2->GetValue(j,0)); |
|
|
// } else { |
|
|
// printf(" %f",tb2->GetValue(j,0)); |
|
|
// }; |
|
|
// j++; |
|
|
// }; |
|
|
// }; |
|
|
// printf("\n"); |
|
|
// break; |
|
|
// }; |
|
|
}; |
|
|
|
|
|
}; |
|
475 |
}; |
}; |
476 |
|
// |
477 |
|
// Strings |
478 |
|
// |
479 |
|
if ( atype == 45 ){ |
480 |
// TBranchElement *p=(TBranchElement*)cl->At(ll); |
// TObjArray *cl = (TObjArray*)(tb->GetInfo()->GetOffsets())[tb->GetID()];//tb->GetValuePointer(); |
481 |
// Int_t plen = (p->GetInfo()->GetLengths())[p->GetID()]; |
// TString *stringa = (TString*)(*cl)[0]; |
482 |
// Int_t plen = -1; |
// TBranchElement *utb = (TBranchElement*)tb->GetBranchCount(); |
483 |
// printf("SubBranches : %s plen is %i \n",p->GetName(),plen); |
// TString** stringa = (TString*)(&tb->GetValuePointer()); |
484 |
|
//TStreamerElement *tste = (TStreamerElement*)tb->GetInfo()->GetCurrentElement(); |
485 |
|
|
486 |
|
// char *ladd; |
487 |
|
// ladd = tb->GetValuePointer() |
488 |
// TLeafElement* leaf = (TLeafElement*)(p->UncheckedAt(0)); |
// TString *stringa = (TString*)((tste->GetOffset())); |
489 |
// printf("xoxoxo leaf : %s plen is %i \n",leaf->GetName(),leaf->GetLen()); |
// TString& mstr = *stringa; |
490 |
|
// printf(" la mia stringa %s \n",mstr.Data()); |
491 |
// Int_t n = tb->GetNdata(); |
// printf(" offset %i \n",(Int_t)utb->GetValue(0,0)); |
492 |
// n = n * leaf->GetLenStatic(); |
// int pointer = (tb->GetInfo()->GetOffsets())[tb->GetID()]; |
493 |
// if (tb->GetInfo()) { |
// TString *stringa = (TString*)(tb->GetInfo()->GetOffsets())[tb->GetID()]; |
494 |
// n = 16; |
// TString *stringa = (TString*)tb->GetAddress(); |
495 |
// tb->GetInfo()->PrintValue(tb->GetName(), tb->GetAddress(), atype, n, 44); |
// printf(" address 0x%X \n",tb->GetAddress()); |
496 |
//tb->GetObject()->GetInfo()->PrintValue(tb->GetName(), tb->GetObject(), atype, n, lenmax); |
// printf(" pointer 0x%X \n",tb->GetValuePointer()); |
497 |
// } |
// printf(" object 0x%X \n",tb->GetObject()); |
498 |
|
// printf("stringa %s lung %i\n",stringa.Data(),stringa.Length()); |
499 |
// TClonesArray* clones = (TClonesArray*) cl->At(ll); |
// TLeaf *striglia = tb->FindLeaf(tb->GetName()); |
500 |
// if ( tb->GetInfo() ) { |
// if ( striglia ){ |
501 |
// tb->GetInfo()->PrintValueClones(tb->GetName(), cl, tb->GetID(), tb->GetOffset(), 44); |
// char *pointer = (char *)striglia->GetValuePointer(); |
502 |
// }; |
// TString *pr= (TString*)pointer; |
503 |
|
// printf("ciao %s \n",pr->Data()); |
504 |
// b3 = (TBranch*)cl->At(l); |
// }; |
505 |
// leaf_array = b3->GetListOfLeaves(); |
sprintf(o,"%s TString - not implemented yet -",o); |
506 |
// for(Int_t l=0;l<(leaf_array->GetLast());l++){ |
}; |
507 |
// printf("Leaf : %s\n",((TLeaf*)leaf_array->At(l))->GetName()); |
// |
508 |
|
// TArray |
509 |
|
// |
510 |
// // TBranch *bcl = (TBranch*)leaf_array->At(l); |
if ( atype == 42 ){ |
511 |
// //bcl = b1->GetListOfLeaves(); |
// |
512 |
// //for(Int_t l=0;l<(leaf_array->GetLast()+1);l++){ |
// TObjArray *cl = (TObjArray*)tb->GetObject(); |
|
// // printf(" value: %f \n",otr->GetLeaf(((TLeaf*)leaf_array->At(l))->GetName())->GetValue(0)); |
|
|
// // printf(" value: %f \n",otr->GetLeaf(((TLeaf*)(branch_array->At(l))->GetName()))->GetValue(0)); |
|
|
// //}; |
|
|
// }; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// // Int_t n = TMath::Min(10, tb->GetNdata()); |
|
|
// Int_t n = tb->GetNdata(); |
|
|
// Int_t atype2 = tb->GetStreamerType() + 20; |
|
|
|
|
|
// if (tb->GetStreamerType() == 1) { |
|
|
// // TVirtualStreamerInfo::kOffsetL + TVirtualStreamerInfo::kChar is |
|
|
// // printed as a string and could print weird characters. |
|
|
// // So we print an unsigned char instead (not perfect, but better). |
|
|
// atype2 = 20 + 11 ; |
|
|
// printf("qui\n"); |
|
|
// } |
|
|
// if (atype2 > 54) { |
|
|
// // FIXME: More logic required here (like in ReadLeaves) |
|
|
// printf(">54 %-15s = %d\n", tb->GetName(), tb->GetNdata()); |
|
|
|
|
|
// } else { |
|
|
// if (tb->GetStreamerType() > 20) { |
|
|
// atype2 -= 20; |
|
|
// // TObjArray *prova= otr->GetListOfLeaves(); |
|
|
// // TObjArray* leaf2 = (TObjArray*) prova->UncheckedAt(i); |
|
|
// //TLeaf* leaf = (TLeaf*)(otr->GetLeaf(tb->GetName())); |
|
|
// // TLeafElement* leaf = (TLeafElement*)((TLeaf*)(otr->GetListOfLeaves()->UncheckedAt(i))->GetBranch()->UncheckedAt(0)); |
|
|
// TLeafElement* leaf = (TLeafElement*)(cl->UncheckedAt(0)); |
|
|
// n = n * leaf->GetLenStatic(); |
|
|
// } |
|
|
// if (tb->GetInfo()) { |
|
|
// // n = 16; |
|
|
// tb->GetInfo()->PrintValue(tb->GetName(), tb->GetAddress(), atype2, n, 44); |
|
|
// //tb->GetObject()->GetInfo()->PrintValue(tb->GetName(), tb->GetObject(), atype, n, lenmax); |
|
|
// } |
|
|
// }; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// //cl->First(); |
|
|
|
|
|
// b3 = (TBranch*)c1->First(); |
|
|
// leaf_array = cl->GetListOfLeaves(); |
|
|
// for(Int_t l=0;l<(leaf_array->GetLast()+1);l++){ |
|
|
// printf("Leaf : %s\n",((TLeaf*)leaf_array->At(l))->GetName()); |
|
|
// }; |
|
|
// // for (Int_t ln=0; ln<cl->GetEntriesFast() ;ln++){ |
|
513 |
// // |
// // |
514 |
|
// TClass *myc = cl->IsA(); |
515 |
// // |
// // |
516 |
// // }; |
// printf("qui \n"); |
517 |
|
// // |
518 |
// TBranchElement *tb2 = (TBranchElement*)cl->UncheckedAt(ln); |
// // determine offset to fetch data |
519 |
// Int_t type2 = tb2->GetType(); |
// // |
520 |
// Int_t atype2 = tb2->GetStreamerType() - 20; |
// int thisoffset = 0; |
521 |
// Int_t len2 = (tb2->GetInfo()->GetLengths())[tb2->GetID()]; |
// TRealData *rd = myc->GetRealData(tb->GetName()); |
522 |
// Int_t length2 = min(len2,dlen); |
// if ( rd ){ |
523 |
// printf("SubSubBranches : %s type is %i \n",tb2->GetName(),type2); |
// thisoffset = rd->GetThisOffset(); |
524 |
|
// }; |
525 |
// switch (type2){ |
// Int_t niente = 0; |
526 |
// case 0: |
// TStreamerElement *tste = tb->GetInfo()->GetStreamerElement(rd->GetName(),niente); |
527 |
// // |
// printf(" typename %s \n",tste->GetTypeName()); |
528 |
// // IS A VARIABLE |
// // |
529 |
|
// // TArrayI |
530 |
|
// // |
531 |
|
// if ( !strcmp(tste->GetTypeName(),"TArrayI") ){ |
532 |
// // |
// // |
533 |
|
// printf("qua \n"); |
534 |
|
// char *pointer = (char*)cl->At(0); |
535 |
|
// // char *pu = thisoffset + pointer; |
536 |
|
// int pu = (int)tste->GetTObjectOffset(); |
537 |
|
// TArrayI arr = (TArrayI)*pu; |
538 |
|
// // TArrayI arr = (TArrayI)(thisoffset); |
539 |
|
// //TArrayI *arr = (TArrayI*)pu; |
540 |
|
// //TArraI arr = (TArrayI) |
541 |
|
// Int_t jj=0; |
542 |
|
// j=0; |
543 |
|
// printf("quii \n"); |
544 |
|
// Int_t arlen = min(arr.GetSize(),dlen); |
545 |
// // |
// // |
546 |
// // NAME |
// printf("que \n"); |
547 |
|
// setcolor(col,RESET, BLUE, WHITE); |
548 |
|
// setcolor(col2,RESET, BLACK, WHITE); |
549 |
|
// sprintf(o,"%s%s %s[%i]%s = ",o,col,tb->GetName(),arr.GetSize(),col2); |
550 |
// // |
// // |
551 |
// printf(" ATYPE IS %i \n",atype2); |
// // while ( j < tb->GetNdata() ){ |
|
// printf(" %-15s =",tb2->GetName()); |
|
|
// j = 0; |
|
552 |
// // |
// // |
553 |
// // VALUES |
// printf("quo \n"); |
554 |
|
// // pointer = (char*)cl->UncheckedAt(j); |
555 |
|
// // pu = pointer + thisoffset; |
556 |
|
// // arr = (TArrayI*)(thisoffset); |
557 |
// // |
// // |
558 |
// if ( atype2 == 3 || atype2 == -17 ){ |
// while ( jj < arlen ){ |
559 |
// while ( j < length2 ){ |
// if ( jj < arlen-1 ){ |
560 |
// if ( j < length2 -1 ){ |
// sprintf(o,"%s %i ,",o,arr.At(jj)); |
561 |
// printf(" %llu ,",(ULong64_t)tb2->GetValue(j,0)); |
// } else { |
562 |
// } else { |
// sprintf(o,"%s %i",o,arr.At(jj)); |
|
// printf(" %llu",(ULong64_t)tb2->GetValue(j,0)); |
|
|
// }; |
|
|
// j++; |
|
|
// }; |
|
|
// } else { |
|
|
// while ( j < length2 ){ |
|
|
// if ( j < length2 -1 ){ |
|
|
// printf(" %f ,",tb2->GetValue(j,0)); |
|
|
// } else { |
|
|
// printf(" %f",tb2->GetValue(j,0)); |
|
|
// }; |
|
|
// j++; |
|
563 |
// }; |
// }; |
564 |
|
// jj++; |
565 |
// }; |
// }; |
566 |
// printf("\n"); |
// // if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); |
567 |
// break; |
// // j++; |
568 |
|
// // }; |
569 |
// }; |
// }; |
|
// //printf(" Element %i name %s\n",ln,cl->GetName()); |
|
|
// }; |
|
|
|
|
|
// TBranchElement *tb = (TBranchElement*)branch_array->At(l); |
|
|
// Int_t type = tb->GetType(); |
|
|
// printf("SubBranches : %s type is %i tb getname %s\n",((TBranch*)branch_array->At(l))->GetName(),type,tb->GetName()); |
|
|
// switch (type){ |
|
|
// case 0: |
|
|
// // |
|
|
// // IS A VARIABLE |
|
|
// // |
|
|
// Int_t atype = tb->GetStreamerType() - 20; |
|
|
// Int_t len = (tb->GetInfo()->GetLengths())[tb->GetID()]; |
|
|
// Int_t length = min(len,dlen); |
|
|
// // |
|
|
// // NAME |
|
570 |
// // |
// // |
571 |
// printf(" ATYPE IS %i \n",atype); |
// // TArrayF |
|
// printf(" %-15s =",((TBranch*)branch_array->At(l))->GetName()); |
|
|
// j = 0; |
|
572 |
// // |
// // |
573 |
// // VALUES |
// if ( !strcmp(tste->GetTypeName(),"TArrayF") ){ |
574 |
// // |
// // |
575 |
// if ( atype == 3 || atype == -17 ){ |
// char *pointer = (char*)cl->UncheckedAt(0); |
576 |
// while ( j < length ){ |
// char *pu = pointer + thisoffset; |
577 |
// if ( j < length -1 ){ |
// TArrayF *arr = (TArrayF*)(pu); |
578 |
// printf(" %llu ,",(ULong64_t)tb->GetValue(j,0)); |
// Int_t jj=0; |
579 |
// } else { |
// Int_t arlen = min(arr->GetSize(),dlen); |
580 |
// printf(" %llu",(ULong64_t)tb->GetValue(j,0)); |
// // |
581 |
// }; |
// setcolor(col,RESET, BLUE, WHITE); |
582 |
// j++; |
// setcolor(col2,RESET, BLACK, WHITE); |
583 |
// }; |
// sprintf(o,"%s%s %s[%i]%s = ",o,col,tb->GetName(),arr->GetSize(),col2); |
584 |
// } else { |
// // |
585 |
// while ( j < length ){ |
// while ( j < tb->GetNdata() ){ |
586 |
// if ( j < length -1 ){ |
// // |
587 |
// printf(" %f ,",tb->GetValue(j,0)); |
// pointer = (char*)cl->UncheckedAt(j); |
588 |
// } else { |
// pu = pointer + thisoffset; |
589 |
// printf(" %f",tb->GetValue(j,0)); |
// arr = (TArrayF*)(pu); |
590 |
|
// // |
591 |
|
// while ( jj < arlen ){ |
592 |
|
// if ( jj < arlen-1 ){ |
593 |
|
// sprintf(o,"%s %f ,",o,arr->At(jj)); |
594 |
|
// } else { |
595 |
|
// sprintf(o,"%s %f",o,arr->At(jj)); |
596 |
|
// }; |
597 |
|
// jj++; |
598 |
// }; |
// }; |
599 |
|
// if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); |
600 |
// j++; |
// j++; |
601 |
// }; |
// }; |
602 |
// }; |
// }; |
603 |
// printf("\n"); |
// sprintf(o,"%s\n",o); |
604 |
|
// |
605 |
|
sprintf(o,"%s TArray - not implemented yet -",o); |
606 |
|
// |
607 |
|
}; |
608 |
|
// |
609 |
|
sprintf(o,"%s\n",o); |
610 |
|
break; |
611 |
|
case 3: |
612 |
|
// |
613 |
|
// IS A TCLONESARRAY |
614 |
|
// |
615 |
|
setcolor(col,RESET, BLUE, WHITE); |
616 |
|
setcolor(col2,RESET, BLACK, WHITE); |
617 |
|
sprintf(o,"%s%s %-15s%s = %d\n",o,col,tb->GetName(), col2, tb->GetNdata()); |
618 |
|
|
619 |
|
// |
620 |
|
if ( tb->GetNdata() ){ |
621 |
|
// |
622 |
|
TClonesArray *cl = (TClonesArray*)tb->GetObject(); |
623 |
|
// |
624 |
|
TClass *myc = cl->GetClass(); |
625 |
|
// |
626 |
|
TList *lme = myc->GetListOfDataMembers(); |
627 |
|
TIter next(lme); |
628 |
|
TBranchElement *tb2 = 0; |
629 |
|
// |
630 |
|
while ( (tb2 = (TBranchElement*)next()) ){ |
631 |
|
// |
632 |
|
const char *name = tb2->GetName(); |
633 |
|
TBranch *foglia = tb->FindBranch(name); |
634 |
|
if ( foglia ){ |
635 |
|
// |
636 |
|
TBranchElement *stb = (TBranchElement*)tb->FindBranch(name); |
637 |
|
Int_t stype = stb->GetType(); |
638 |
|
Int_t satype = stb->GetStreamerType() - 20; |
639 |
|
Int_t slen = (stb->GetInfo()->GetLengths())[stb->GetID()]; |
640 |
|
Int_t slength = min(slen,dlen); |
641 |
|
// printf("SubBranches : atype is %i type is %i tb getname %s slen %i slength %i\n",satype,stype,stb->GetName(),slen,slength); |
642 |
|
switch (stype){ |
643 |
|
case 31: |
644 |
|
// |
645 |
|
// IS A VARIABLE |
646 |
|
// |
647 |
|
// |
648 |
|
// NAME |
649 |
|
// |
650 |
|
j = 0; |
651 |
|
// |
652 |
|
// VALUES |
653 |
|
// |
654 |
|
if ( satype == 41 || satype == 44){ |
655 |
|
// |
656 |
|
// skip TRef |
657 |
|
// |
658 |
|
break; |
659 |
|
}; |
660 |
|
// |
661 |
|
// Integer |
662 |
|
// |
663 |
|
if ( satype == -17 || satype == -9 ){ |
664 |
|
// |
665 |
|
setcolor(col,RESET, BLUE, WHITE); |
666 |
|
setcolor(col2,RESET, BLACK, WHITE); |
667 |
|
sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2); |
668 |
|
while ( j < cl->GetEntriesFast() ){ |
669 |
|
if ( j < cl->GetEntriesFast() -1 ){ |
670 |
|
sprintf(o,"%s %i ,",o,(Int_t)stb->GetValue(j,slength)); |
671 |
|
} else { |
672 |
|
sprintf(o,"%s %i",o,(Int_t)stb->GetValue(j,slength)); |
673 |
|
}; |
674 |
|
j++; |
675 |
|
}; |
676 |
|
}; |
677 |
|
// |
678 |
|
// Float |
679 |
|
// |
680 |
|
if ( satype == -15 ){ |
681 |
|
// |
682 |
|
setcolor(col,RESET, BLUE, WHITE); |
683 |
|
setcolor(col2,RESET, BLACK, WHITE); |
684 |
|
sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2); |
685 |
|
while ( j < cl->GetEntriesFast() ){ |
686 |
|
if ( j < cl->GetEntriesFast() -1 ){ |
687 |
|
sprintf(o,"%s %f ,",o,stb->GetValue(j,slength)); |
688 |
|
} else { |
689 |
|
sprintf(o,"%s %f",o,stb->GetValue(j,slength)); |
690 |
|
}; |
691 |
|
j++; |
692 |
|
}; |
693 |
|
}; |
694 |
|
// |
695 |
|
// Array of float |
696 |
|
// |
697 |
|
if ( satype == 5 ){ |
698 |
|
// |
699 |
|
setcolor(col,RESET, BLUE, WHITE); |
700 |
|
setcolor(col2,RESET, BLACK, WHITE); |
701 |
|
sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2); |
702 |
|
Bool_t bold = true; |
703 |
|
while ( j < tb->GetNdata() ){ |
704 |
|
if ( bold ){ |
705 |
|
setcolor(col,RESET, BLACK, WHITE); |
706 |
|
sprintf(o,"%s%s",o,col); |
707 |
|
} else { |
708 |
|
setcolor(col,BOLD, BLACK, WHITE); |
709 |
|
sprintf(o,"%s%s",o,col); |
710 |
|
}; |
711 |
|
Int_t jj = 0; |
712 |
|
while ( jj < slength ){ |
713 |
|
if ( jj < slength-1 ){ |
714 |
|
sprintf(o,"%s %f ,",o,stb->GetValue(j,jj,true)); |
715 |
|
} else { |
716 |
|
sprintf(o,"%s %f",o,stb->GetValue(j,jj,true)); |
717 |
|
}; |
718 |
|
jj++; |
719 |
|
}; |
720 |
|
if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); |
721 |
|
if ( !bold ){ |
722 |
|
bold = true; |
723 |
|
} else { |
724 |
|
bold = false; |
725 |
|
}; |
726 |
|
j++; |
727 |
|
}; |
728 |
|
if ( bold ){ |
729 |
|
setcolor(col,RESET, BLACK, WHITE); |
730 |
|
sprintf(o,"%s%s",o,col); |
731 |
|
}; |
732 |
|
}; |
733 |
|
// |
734 |
|
// Array of integers |
735 |
|
// |
736 |
|
if ( satype == 3 ){ |
737 |
|
// |
738 |
|
setcolor(col,RESET, BLUE, WHITE); |
739 |
|
setcolor(col2,RESET, BLACK, WHITE); |
740 |
|
sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2); |
741 |
|
while ( j < tb->GetNdata() ){ |
742 |
|
Int_t jj = 0; |
743 |
|
while ( jj < slength ){ |
744 |
|
if ( jj < slength-1 ){ |
745 |
|
sprintf(o,"%s %i ,",o,(Int_t)stb->GetValue(j,jj,true)); |
746 |
|
} else { |
747 |
|
sprintf(o,"%s %i",o,(Int_t)stb->GetValue(j,jj,true)); |
748 |
|
}; |
749 |
|
jj++; |
750 |
|
}; |
751 |
|
if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); |
752 |
|
j++; |
753 |
|
}; |
754 |
|
}; |
755 |
|
|
756 |
|
// |
757 |
|
// TArray |
758 |
|
// |
759 |
|
if ( satype == 42 ){ |
760 |
|
// |
761 |
|
// determine offset to fetch data |
762 |
|
// |
763 |
|
int thisoffset = 0; |
764 |
|
TRealData *rd = myc->GetRealData(foglia->GetName()); |
765 |
|
if ( rd ){ |
766 |
|
thisoffset = rd->GetThisOffset(); |
767 |
|
}; |
768 |
|
Int_t niente = 0; |
769 |
|
TStreamerElement *tste = stb->GetInfo()->GetStreamerElement(rd->GetName(),niente); |
770 |
|
// |
771 |
|
// TArrayI |
772 |
|
// |
773 |
|
if ( !strcmp(tste->GetTypeName(),"TArrayI") ){ |
774 |
|
// |
775 |
|
char *pointer = (char*)cl->UncheckedAt(0); |
776 |
|
char *pu = pointer + thisoffset; |
777 |
|
TArrayI *arr = (TArrayI*)(pu); |
778 |
|
Int_t jj=0; |
779 |
|
Int_t arlen = min(arr->GetSize(),dlen); |
780 |
|
// |
781 |
|
setcolor(col,RESET, BLUE, WHITE); |
782 |
|
setcolor(col2,RESET, BLACK, WHITE); |
783 |
|
sprintf(o,"%s%s %s[%i]%s = ",o,col,foglia->GetName(),arr->GetSize(),col2); |
784 |
|
// |
785 |
|
while ( j < tb->GetNdata() ){ |
786 |
|
// |
787 |
|
pointer = (char*)cl->UncheckedAt(j); |
788 |
|
pu = pointer + thisoffset; |
789 |
|
arr = (TArrayI*)(pu); |
790 |
|
// |
791 |
|
while ( jj < arlen ){ |
792 |
|
if ( jj < arlen-1 ){ |
793 |
|
sprintf(o,"%s %i ,",o,arr->At(jj)); |
794 |
|
} else { |
795 |
|
sprintf(o,"%s %i",o,arr->At(jj)); |
796 |
|
}; |
797 |
|
jj++; |
798 |
|
}; |
799 |
|
if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); |
800 |
|
j++; |
801 |
|
}; |
802 |
|
}; |
803 |
|
// |
804 |
|
// TArrayF |
805 |
|
// |
806 |
|
if ( !strcmp(tste->GetTypeName(),"TArrayF") ){ |
807 |
|
// |
808 |
|
char *pointer = (char*)cl->UncheckedAt(0); |
809 |
|
char *pu = pointer + thisoffset; |
810 |
|
TArrayF *arr = (TArrayF*)(pu); |
811 |
|
Int_t jj=0; |
812 |
|
Int_t arlen = min(arr->GetSize(),dlen); |
813 |
|
// |
814 |
|
setcolor(col,RESET, BLUE, WHITE); |
815 |
|
setcolor(col2,RESET, BLACK, WHITE); |
816 |
|
sprintf(o,"%s%s %s[%i]%s = ",o,col,foglia->GetName(),arr->GetSize(),col2); |
817 |
|
// |
818 |
|
while ( j < tb->GetNdata() ){ |
819 |
|
// |
820 |
|
pointer = (char*)cl->UncheckedAt(j); |
821 |
|
pu = pointer + thisoffset; |
822 |
|
arr = (TArrayF*)(pu); |
823 |
|
// |
824 |
|
while ( jj < arlen ){ |
825 |
|
if ( jj < arlen-1 ){ |
826 |
|
sprintf(o,"%s %f ,",o,arr->At(jj)); |
827 |
|
} else { |
828 |
|
sprintf(o,"%s %f",o,arr->At(jj)); |
829 |
|
}; |
830 |
|
jj++; |
831 |
|
}; |
832 |
|
if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); |
833 |
|
j++; |
834 |
|
}; |
835 |
|
}; |
836 |
|
}; |
837 |
|
sprintf(o,"%s\n",o); |
838 |
|
break; |
839 |
|
}; |
840 |
|
}; |
841 |
|
}; |
842 |
|
}; |
843 |
break; |
break; |
844 |
}; |
}; |
845 |
// b3 = (TBranch*)branch_array->At(l); |
}; |
846 |
// leaf_array = b1->GetListOfLeaves(); |
// pamgui->DIALOG(0,o); |
847 |
// for(Int_t l=0;l<(leaf_array->GetLast()+1);l++){ |
printf("%s\n",o); |
|
// printf("Leaf : %s\n",((TLeaf*)leaf_array->At(l))->GetName()); |
|
|
// printf(" value: %f \n",otr->GetLeaf(((TLeaf*)leaf_array->At(l))->GetName())->GetValue(0)); |
|
|
// printf(" value: %f \n",otr->GetLeaf(((TLeaf*)(branch_array->At(l))->GetName()))->GetValue(0)); |
|
|
// }; |
|
|
// }; |
|
|
|
|
|
}; |
|
|
|
|
848 |
}; |
}; |
849 |
|
|
850 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
851 |
void FEVdetector::GetGeneralInfo(){ |
void FEVdetector::GetGeneralInfo(){ |
852 |
// |
// |
853 |
// Get Orbital Time information and header event number |
// Get Orbital Time information and header event number |
857 |
headcold = headc; |
headcold = headc; |
858 |
headc = ph->Counter; |
headc = ph->Counter; |
859 |
var.headc = (int)ph->Counter; |
var.headc = (int)ph->Counter; |
860 |
OBT = ph->OrbitalTime; |
OBT = (UInt_t)ph->OrbitalTime; |
861 |
DOBT = OBT - OOBT; |
DOBT = OBT - OOBT; |
862 |
OOBT = OBT; |
OOBT = OBT; |
863 |
if ( thisentry == minevent || DOBT < 0 || (headc-headcold-1)!=0 ) DOBT = 0; |
if ( thisentry == minevent || DOBT < 0 || (headc-headcold-1)!=0 ) DOBT = 0; |
893 |
trcs = (TString)trc.str().c_str(); |
trcs = (TString)trc.str().c_str(); |
894 |
} else { |
} else { |
895 |
headcold = headc; |
headcold = headc; |
896 |
|
if ( var.RUN ){ |
897 |
|
var.idrun = L2->GetRunInfo()->ID; |
898 |
|
var.idroot = L2->GetRunInfo()->ID_ROOT_L0; |
899 |
|
var.EVF = L2->GetRunInfo()->EV_FROM; |
900 |
|
}; |
901 |
if ( var.ORB ){ |
if ( var.ORB ){ |
902 |
headc = L2->GetOrbitalInfo()->pkt_num; |
headc = L2->GetOrbitalInfo()->pkt_num; |
903 |
OBT = L2->GetOrbitalInfo()->OBT; |
OBT = L2->GetOrbitalInfo()->OBT; |
1051 |
// |
// |
1052 |
} |
} |
1053 |
|
|
1054 |
Int_t FEVdetector::Load(TTree &mainotr, TFile &mainfile){ |
TChain* FEVdetector::Load(TString file){ |
1055 |
//Int_t FEVdetector::Load(TChain &mainotr, TFile &mainfile){ |
// |
1056 |
file = &mainfile; |
// file = &mainfile; |
|
otr = &mainotr; |
|
|
L2 = new PamLevel2(); |
|
1057 |
// |
// |
1058 |
if ( level.file == 2 ){ |
if ( level.file == 2 ){ |
1059 |
// otr = L2->LoadPamTrees(file); |
// |
1060 |
printf(" %s \n",ddec.Data()); |
printf(" %s \n",ddec.Data()); |
1061 |
// otr->Refresh(); |
if ( !L2 ){ |
1062 |
// otr->Clear(); |
L2 = new PamLevel2("",file.Data(),ddec.Data()); |
1063 |
// otr = new TTree(); |
otr = L2->GetPamTree(); |
1064 |
otr = L2->GetPamTree(file,ddec.Data()); |
printf(" l2 constructor\n"); |
1065 |
|
// printf(" abst %u obt %u qtot %f \n",L2->GetOrbitalInfo()->absTime,L2->GetOrbitalInfo()->OBT,L2->GetCaloLevel2()->qtot); |
1066 |
|
} else { |
1067 |
|
// |
1068 |
|
printf(" l2 already exist \n"); |
1069 |
|
otr = L2->GetPamTree(gSystem->DirName(file.Data()),file.Data(),ddec.Data()); |
1070 |
|
L2->GetRunTree(gSystem->DirName(file.Data()),file.Data()); |
1071 |
|
// |
1072 |
|
}; |
1073 |
|
// |
1074 |
// |
// |
1075 |
if ( !otr ) return(0); |
if ( !otr ) return(0); |
|
// ******************** |
|
|
// load magnetic field |
|
|
// ******************** |
|
|
// const char *pam_calib = pathtocalibration(); |
|
|
// |
|
|
// stringstream magfie; |
|
|
// magfie.str(""); |
|
|
// magfie << "/localdisk/mocchiut/test/calib/trk-param/field_param-0/"; |
|
|
// magfie << pam_calib; |
|
|
//magfie << "/trk-param/field_param-0/"; |
|
1076 |
// |
// |
1077 |
//L2->GetTrkLevel2()->LoadField(magfie.str().c_str()); |
// otr->CanDeleteRefs(true); |
1078 |
|
// if ( runtree ) runtree->CanDeleteRefs(true); |
1079 |
|
// |
1080 |
} else { |
} else { |
1081 |
// |
// |
1082 |
// load calorimeter ADC2MIP conversion file |
// load calorimeter ADC2MIP conversion file |
1117 |
}; |
}; |
1118 |
// |
// |
1119 |
// |
// |
1120 |
trigger = new pamela::trigger::TriggerEvent(); |
// Load level0 file if the case |
|
eh = new pamela::EventHeader(); |
|
|
ph = new pamela::PscuHeader(); |
|
|
// oinfoL2 = new OrbitalInfo(); |
|
|
runinfo = new ItoRunInfo(file); |
|
|
// |
|
|
de = new pamela::calorimeter::CalorimeterEvent(); |
|
|
trk = new pamela::tracker::TrackerEvent(); |
|
|
ne = new pamela::neutron::NeutronEvent(); |
|
|
ace = new pamela::anticounter::AnticounterEvent(); |
|
|
s4 = new pamela::S4::S4Event(); |
|
|
tof = new pamela::tof::TofEvent(); |
|
1121 |
// |
// |
1122 |
if ( level.file == 0 || level.file == -1 ){ |
if ( level.file == 0 || level.file == -1 ){ |
1123 |
|
// |
1124 |
|
trigger = new pamela::trigger::TriggerEvent(); |
1125 |
|
eh = new pamela::EventHeader(); |
1126 |
|
ph = new pamela::PscuHeader(); |
1127 |
|
de = new pamela::calorimeter::CalorimeterEvent(); |
1128 |
|
trk = new pamela::tracker::TrackerEvent(); |
1129 |
|
ne = new pamela::neutron::NeutronEvent(); |
1130 |
|
ace = new pamela::anticounter::AnticounterEvent(); |
1131 |
|
s4 = new pamela::S4::S4Event(); |
1132 |
|
tof = new pamela::tof::TofEvent(); |
1133 |
|
// |
1134 |
|
otr = new TChain("Physics"); |
1135 |
|
otr->Add(file.Data(),-1); |
1136 |
otr->SetBranchAddress("Trigger", &trigger); |
otr->SetBranchAddress("Trigger", &trigger); |
1137 |
otr->SetBranchAddress("Header", &eh); |
otr->SetBranchAddress("Header", &eh); |
1138 |
}; |
}; |
|
if ( level.file == 2 && var.RUN){ |
|
|
// otr->AddFriend("OrbitalInfo", file); |
|
|
// otr->SetBranchAddress("OrbitalInfo", &oinfoL2); |
|
|
runinfo->Read(0ULL); |
|
|
}; |
|
1139 |
// |
// |
1140 |
if ( var.TRK ) { |
if ( var.TRK ) { |
1141 |
if ( level.file == 0 || level.file == -1 ){ |
if ( level.file == 0 || level.file == -1 ){ |
1208 |
}; |
}; |
1209 |
}; |
}; |
1210 |
// |
// |
1211 |
// printf("qua\n"); |
if ( !otr ){ |
1212 |
return(1); |
return(0); |
1213 |
|
}; |
1214 |
|
// |
1215 |
|
return otr; |
1216 |
// |
// |
1217 |
} |
} |
1218 |
|
|
1288 |
text->DrawLatex(0.33,txthi,testo.str().c_str()); |
text->DrawLatex(0.33,txthi,testo.str().c_str()); |
1289 |
txthi -= 0.03; |
txthi -= 0.03; |
1290 |
testo2.str(""); |
testo2.str(""); |
1291 |
testo2 << "On Board Time: " << (int)OBT; |
testo2 << "On Board Time: " << (unsigned int)OBT; |
1292 |
if ( DOBT > 0 ) { |
if ( DOBT > 0 ) { |
1293 |
testo2 << " (delta: " << (int)DOBT; |
testo2 << " (delta: " << (unsigned int)DOBT; |
1294 |
testo2 << ")"; |
testo2 << ")"; |
1295 |
}; |
}; |
1296 |
testo2 << " [ms]"; |
testo2 << " [ms]"; |
1579 |
// |
// |
1580 |
// print infos on terminal |
// print infos on terminal |
1581 |
// |
// |
1582 |
|
// if ( !var.selex ){ |
1583 |
printf(" File: %s \n",var.thefilename.Data()); |
printf(" File: %s \n",var.thefilename.Data()); |
1584 |
if ( !s4pulser && !calotrig ){ |
if ( !s4pulser && !calotrig ){ |
1585 |
printf(" Pkt_num: %i - Progressive number: %i \n",(int)headc,thisentry+1); |
printf(" Pkt_num: %i - Progressive number: %i \n",(int)headc,thisentry+1); |
1590 |
if ( calotrig ){ |
if ( calotrig ){ |
1591 |
printf(" Pkt_num: %i - Progressive number: %i - CALO trigger -\n",(int)headc,thisentry+1); |
printf(" Pkt_num: %i - Progressive number: %i - CALO trigger -\n",(int)headc,thisentry+1); |
1592 |
}; |
}; |
1593 |
printf(" On Board Time: %i (delta %i) [ms]\n",OBT,DOBT); |
printf(" On Board Time: %u (delta %i) [ms]\n",OBT,DOBT); |
1594 |
const char *trc2 = trcs; |
const char *trc2 = trcs; |
1595 |
printf(" TRIGGER: %s \n",trc2); |
printf(" TRIGGER: %s \n",trc2); |
1596 |
printf(" AC: CARD hit = %i CAT hit = %i CAS hit = %i \n",var.hcard,var.hcat,var.hcas); |
printf(" AC: CARD hit = %i CAT hit = %i CAS hit = %i \n",var.hcard,var.hcat,var.hcas); |
1602 |
printf(" CALO: NSTRIP = %i QTOT = %i [MIP]\n",var.nstrip,var.qtot); |
printf(" CALO: NSTRIP = %i QTOT = %i [MIP]\n",var.nstrip,var.qtot); |
1603 |
printf(" S4: %.2f [MIP] TOF: beta = %.2f \n",var.s4sig,var.beta[4]); |
printf(" S4: %.2f [MIP] TOF: beta = %.2f \n",var.s4sig,var.beta[4]); |
1604 |
printf(" ND: Trigger: neutrons = %i - Background: upper = %i lower = %i \n",var.trup,var.bkup,var.bkbo); |
printf(" ND: Trigger: neutrons = %i - Background: upper = %i lower = %i \n",var.trup,var.bkup,var.bkbo); |
1605 |
|
// }; |
1606 |
// |
// |
1607 |
} |
} |
1608 |
|
|
1910 |
void FEVdetector::ShowTOF(){ |
void FEVdetector::ShowTOF(){ |
1911 |
// |
// |
1912 |
// |
// |
|
// |
|
1913 |
if ( !var.TOF ) return; |
if ( !var.TOF ) return; |
1914 |
// |
// |
1915 |
Int_t tt = 0; |
Int_t tt = 0; |
2710 |
// |
// |
2711 |
Bool_t repeat = true; |
Bool_t repeat = true; |
2712 |
Int_t numtr = 1; |
Int_t numtr = 1; |
2713 |
|
// Int_t numtr = 0; |
2714 |
Int_t repuntil = 0; |
Int_t repuntil = 0; |
2715 |
// |
// |
2716 |
// |
// |
2718 |
// |
// |
2719 |
if ( level.file == 2 ) repuntil = L2->GetToFLevel2()->ntrk(); |
if ( level.file == 2 ) repuntil = L2->GetToFLevel2()->ntrk(); |
2720 |
// printf("repuntil = %i \n",repuntil); |
// printf("repuntil = %i \n",repuntil); |
2721 |
|
//if ( level.file == 2 ) repuntil = L2->GetTrkLevel2()->GetNTracks(); |
2722 |
//repuntil = L2->GetNTracks(); |
//repuntil = L2->GetNTracks(); |
2723 |
// |
// |
2724 |
while ( repeat ){ |
while ( repeat ){ |
2728 |
// |
// |
2729 |
// |
// |
2730 |
ToFTrkVar *ptt = 0; |
ToFTrkVar *ptt = 0; |
2731 |
|
// PamTrack *ptrack = 0; |
2732 |
|
Float_t adc[4][12]; |
2733 |
|
Float_t tdc[4][12]; |
2734 |
|
memset(adc,0,4*12*sizeof(Float_t)); |
2735 |
|
memset(tdc,0,4*12*sizeof(Float_t)); |
2736 |
// |
// |
2737 |
// |
// |
2738 |
|
// if ( repuntil == 0 || var.tofraw ){ |
2739 |
if ( repuntil == 1 || var.tofraw ){ |
if ( repuntil == 1 || var.tofraw ){ |
2740 |
numtr = 0; |
numtr = 0; |
2741 |
ptt = L2->GetToFLevel2()->GetToFTrkVar(0); |
ptt = L2->GetToFLevel2()->GetToFTrkVar(0); |
2745 |
// |
// |
2746 |
if ( numtr >= repuntil-1 ) repeat = false; |
if ( numtr >= repuntil-1 ) repeat = false; |
2747 |
// |
// |
2748 |
ptt = L2->GetToFLevel2()->GetToFTrkVar(numtr); |
// printf(" numtr is %i \n",numtr); |
2749 |
|
ptt = L2->GetToFLevel2()->GetToFTrkVar(numtr); |
2750 |
|
//ptrack = L2->GetTrack(numtr); |
2751 |
|
//ptt = ptrack->GetToFTrack(); |
2752 |
}; |
}; |
2753 |
// |
// |
2754 |
xp11[0] = 0.; |
xp11[0] = 0.; |
2762 |
// |
// |
2763 |
ii = 2; |
ii = 2; |
2764 |
// |
// |
2765 |
Float_t adc[4][12]; |
Int_t myseq = ptt->trkseqno + 1; |
2766 |
Float_t tdc[4][12]; |
L2->GetToFLevel2()->GetMatrix(myseq,adc,tdc); |
2767 |
L2->GetToFLevel2()->GetMatrix(numtr,adc,tdc); |
// |
2768 |
|
// printf(" qua \n"); |
2769 |
// |
// |
2770 |
for ( Int_t i = 0; i<8; i++ ) { |
for ( Int_t i = 0; i<8; i++ ) { |
2771 |
if ( adc[ch11a[i]][hb11a[i]] < 1000. ){ |
if ( adc[ch11a[i]][hb11a[i]] < 1000. ){ |
5161 |
// |
// |
5162 |
x = track->xm[plane]; |
x = track->xm[plane]; |
5163 |
Float_t xsig = track->dedx_x[plane]; |
Float_t xsig = track->dedx_x[plane]; |
5164 |
if ( track->xgood[plane] ){ |
if ( track->XGood(plane) ){ |
5165 |
//if ( x > -100 ){ |
//if ( x > -100 ){ |
5166 |
if ( xsig > 8. ) xsig = 8.; |
if ( xsig > 8. ) xsig = 8.; |
5167 |
if ( var.bw ){ |
if ( var.bw ){ |
5191 |
trkpad[planepad]->Range(-7.05,0.,7.05,8.); |
trkpad[planepad]->Range(-7.05,0.,7.05,8.); |
5192 |
x = track->ym[plane]; |
x = track->ym[plane]; |
5193 |
xsig = track->dedx_y[plane]; |
xsig = track->dedx_y[plane]; |
5194 |
if ( track->ygood[plane] ){ |
if ( track->YGood(plane) ){ |
5195 |
// if ( x > -100 ){ |
// if ( x > -100 ){ |
5196 |
if ( xsig > 8. ) xsig = 8.; |
if ( xsig > 8. ) xsig = 8.; |
5197 |
if ( var.bw ){ |
if ( var.bw ){ |
5242 |
// first of all plot crosses relatives to tracks |
// first of all plot crosses relatives to tracks |
5243 |
// |
// |
5244 |
if ( L2->GetTrkLevel2()->GetNTracks() > 0 ){ |
if ( L2->GetTrkLevel2()->GetNTracks() > 0 ){ |
5245 |
|
// for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ |
5246 |
|
// TrkTrack *track = L2->GetTrkLevel2()->GetTrack(nt); |
5247 |
for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ |
for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ |
5248 |
TrkTrack *track = L2->GetTrkLevel2()->GetTrack(nt); |
PamTrack *ptrack= L2->GetTrack(nt); |
5249 |
|
TrkTrack *track = ptrack->GetTrkTrack(); |
5250 |
|
// |
5251 |
for (Int_t plane = 0; plane<6; plane++){ |
for (Int_t plane = 0; plane<6; plane++){ |
5252 |
// |
// |
5253 |
x = track->xm[plane]; |
x = track->xm[plane]; |
5255 |
Float_t xsig = track->dedx_x[plane]; |
Float_t xsig = track->dedx_x[plane]; |
5256 |
Float_t ysig = track->dedx_y[plane]; |
Float_t ysig = track->dedx_y[plane]; |
5257 |
// if ( x > -100 && y > -100. ){ |
// if ( x > -100 && y > -100. ){ |
5258 |
if ( track->xgood[plane] && track->ygood[plane] ){ |
if ( track->XGood(plane) && track->YGood(plane) ){ |
5259 |
if ( var.bw ){ |
if ( var.bw ){ |
5260 |
sigcol1 = -1; |
sigcol1 = -1; |
5261 |
sigcol2 = -1; |
sigcol2 = -1; |
5561 |
|
|
5562 |
void FEVdetector::ShowTrack(){ |
void FEVdetector::ShowTrack(){ |
5563 |
// |
// |
5564 |
|
if ( level.file != 2 ) return; |
5565 |
// |
// |
5566 |
// |
// |
5567 |
if ( var.CALO && false ){ |
// |
5568 |
|
if ( var.CALO && var.CALOT ){ |
5569 |
if ( L2->GetCaloLevel2()->npcfit[0] > 0 && L2->GetCaloLevel2()->npcfit[1] > 0 ){ |
if ( L2->GetCaloLevel2()->npcfit[0] > 0 && L2->GetCaloLevel2()->npcfit[1] > 0 ){ |
5570 |
Float_t calx[22]; |
Float_t calx[22]; |
5571 |
Float_t caly[22]; |
Float_t caly[22]; |
5660 |
}; |
}; |
5661 |
}; |
}; |
5662 |
// |
// |
5663 |
if ( !var.TRK || level.file != 2 ) return; |
if ( !var.TRK ) return; |
5664 |
// |
// |
5665 |
if ( L2->GetTrkLevel2()->GetNTracks() > 0 ){ |
if ( L2->GetTrkLevel2()->GetNTracks() > 0 ){ |
5666 |
for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ |
for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ |
5667 |
|
|
5668 |
// TrkTrack *track = L2->GetTrkLevel2()->GetTrack(nt); |
// TrkTrack *track = L2->GetTrkLevel2()->GetTrack(nt); |
5669 |
|
// printf("qui \n"); |
5670 |
PamTrack *ptrack = L2->GetTrack(nt); |
PamTrack *ptrack = L2->GetTrack(nt); |
5671 |
TrkTrack *track = ptrack->GetTrkTrack(); |
TrkTrack *track = ptrack->GetTrkTrack(); |
5672 |
|
// printf("qua \n"); |
5673 |
Int_t npoint = 100; |
Int_t npoint = 100; |
5674 |
Float_t zin[100]; |
Float_t zin[100]; |
5675 |
Double_t xout[100]; |
Double_t xout[100]; |
5877 |
Int_t se = 5; |
Int_t se = 5; |
5878 |
if ( !l && m%2 == 0 ) se = 3; |
if ( !l && m%2 == 0 ) se = 3; |
5879 |
if ( !l && m%2 != 0 ) se = 2; |
if ( !l && m%2 != 0 ) se = 2; |
5880 |
if ( l && m%2 == 0 ) se = 1; |
if ( l && m%2 != 0 ) se = 1; |
5881 |
if ( l && m%2 != 0 ) se = 0; |
if ( l && m%2 == 0 ) se = 0; |
5882 |
// |
// |
5883 |
// determine what kind of event we are going to analyze |
// determine what kind of event we are going to analyze |
5884 |
// |
// |
5993 |
// |
// |
5994 |
// Define variables |
// Define variables |
5995 |
// |
// |
5996 |
Int_t etime = var.etime; |
UInt_t etime = var.etime; |
5997 |
Float_t estrip[2][22][96], ener, basel,sdexy[2][22][96],sdexyc[2][22][96]; |
Float_t estrip[2][22][96], ener, basel,sdexy[2][22][96],sdexyc[2][22][96]; |
5998 |
Int_t badstrip = 0; |
Int_t badstrip = 0; |
5999 |
qtot = 0.; |
qtot = 0.; |
6065 |
if ( calib.ttime[s][b[s]+1] && calib.time[s][b[s]] ){ |
if ( calib.ttime[s][b[s]+1] && calib.time[s][b[s]] ){ |
6066 |
while ( etime > calib.time[s][b[s]] && calib.time[s][b[s]] != 0 ){ |
while ( etime > calib.time[s][b[s]] && calib.time[s][b[s]] != 0 ){ |
6067 |
printf(" CALORIMETER: \n" ); |
printf(" CALORIMETER: \n" ); |
6068 |
printf(" - Section %i, event at time %i while old calibration time limit at %i. Use new calibration at time %i -\n",s,etime,calib.time[s][b[s]],calib.ttime[s][b[s]+1]); |
printf(" - Section %i, event at time %u while old calibration time limit at %u. Use new calibration at time %u -\n",s,(UInt_t)etime,(UInt_t)calib.time[s][b[s]],(UInt_t)calib.ttime[s][b[s]+1]); |
6069 |
printf(" END CALORIMETER. \n\n" ); |
printf(" END CALORIMETER. \n\n" ); |
6070 |
b[s]++; |
b[s]++; |
6071 |
CaloPede(s); |
CaloPede(s); |
6085 |
Int_t se = 5; |
Int_t se = 5; |
6086 |
if (l == 0 && m%2 == 0) se = 3; |
if (l == 0 && m%2 == 0) se = 3; |
6087 |
if (l == 0 && m%2 != 0) se = 2; |
if (l == 0 && m%2 != 0) se = 2; |
6088 |
if (l == 1 && m%2 == 0) se = 1; |
if (l == 1 && m%2 != 0) se = 1; |
6089 |
if (l == 1 && m%2 != 0) se = 0; |
if (l == 1 && m%2 == 0) se = 0; |
6090 |
// |
// |
6091 |
// determine what kind of event we are going to analyze |
// determine what kind of event we are going to analyze |
6092 |
// |
// |
6370 |
for (Int_t d = 0; d<48; d++){ |
for (Int_t d = 0; d<48; d++){ |
6371 |
if ( calib.ttime[s][d] != 0 ) calibex++; |
if ( calib.ttime[s][d] != 0 ) calibex++; |
6372 |
if ( calib.time[s][0] != 0 ){ |
if ( calib.time[s][0] != 0 ){ |
6373 |
if ( d == 0 ) printf(" Section %i from time 0 to time %i use calibration at time %i \n",s,calib.time[s][d],calib.ttime[s][d]); |
if ( d == 0 ) printf(" Section %i from time 0 to time %u use calibration at time %u \n",s,calib.time[s][d],calib.ttime[s][d]); |
6374 |
if ( calib.time[s][d+1] != 0 ) { |
if ( calib.time[s][d+1] != 0 ) { |
6375 |
printf(" Section %i from time %i to time %i use calibration at time %i \n",s,calib.time[s][d],calib.time[s][d+1],calib.ttime[s][d+1]); |
printf(" Section %i from time %u to time %u use calibration at time %u \n",s,calib.time[s][d],calib.time[s][d+1],calib.ttime[s][d+1]); |
6376 |
} else { |
} else { |
6377 |
if ( !stop ){ |
if ( !stop ){ |
6378 |
printf(" Section %i from time %i use calibration at time %i \n",s,calib.time[s][d],calib.ttime[s][d+1]); |
printf(" Section %i from time %u use calibration at time %u \n",s,calib.time[s][d],calib.ttime[s][d+1]); |
6379 |
stop = 1; |
stop = 1; |
6380 |
}; |
}; |
6381 |
}; |
}; |
6382 |
} else { |
} else { |
6383 |
if ( calib.ttime[s][d] != 0 ) printf(" Section %i from time 0 use calibration at time %i \n",s,calib.ttime[s][d]); |
if ( calib.ttime[s][d] != 0 ) printf(" Section %i from time 0 use calibration at time %u \n",s,calib.ttime[s][d]); |
6384 |
}; |
}; |
6385 |
}; |
}; |
6386 |
printf("\n"); |
printf("\n"); |
6445 |
calib.ttime[s][inter] = 0; |
calib.ttime[s][inter] = 0; |
6446 |
if ( ce->cstwerr[s] != 0 && ce->cperror[s] == 0 ) { |
if ( ce->cstwerr[s] != 0 && ce->cperror[s] == 0 ) { |
6447 |
//calib.ttime[s][inter] = cph->GetOrbitalTime(); |
//calib.ttime[s][inter] = cph->GetOrbitalTime(); |
6448 |
calib.ttime[s][inter] = cph->OrbitalTime; |
calib.ttime[s][inter] = (UInt_t)cph->OrbitalTime; |
6449 |
inter++; |
inter++; |
6450 |
} else { |
} else { |
6451 |
if ( ce->cstwerr[s] != 0 && ce->cperror[s] != 0 ) { |
if ( ce->cstwerr[s] != 0 && ce->cperror[s] != 0 ) { |
6499 |
tr->GetEntry(ci); |
tr->GetEntry(ci); |
6500 |
cph = ceh->GetPscuHeader(); |
cph = ceh->GetPscuHeader(); |
6501 |
//if ( atime == cph->GetOrbitalTime()){ |
//if ( atime == cph->GetOrbitalTime()){ |
6502 |
if ( atime == cph->OrbitalTime){ |
if ( atime == (UInt_t)cph->OrbitalTime){ |
6503 |
// calib.iev = ce->iev; |
// calib.iev = ce->iev; |
6504 |
if (ce->cstwerr[s] != 0 && ce->cperror[s] == 0 ) { |
if (ce->cstwerr[s] != 0 && ce->cperror[s] == 0 ) { |
6505 |
for ( Int_t d=0 ; d<11 ;d++ ){ |
for ( Int_t d=0 ; d<11 ;d++ ){ |