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 |
// |
// |
91 |
var.AC = 0; |
var.AC = 0; |
92 |
var.RUN = 1; |
var.RUN = 1; |
93 |
var.TRK = 0; |
var.TRK = 0; |
94 |
var.ORB = 0; |
var.ORB = 1; |
95 |
var.TRG = 0; |
var.TRG = 1; |
96 |
var.CALO = 0; |
var.CALO = 0; |
97 |
|
var.CALOT = 0; |
98 |
var.S4 = 0; |
var.S4 = 0; |
99 |
var.ND = 0; |
var.ND = 0; |
100 |
var.INFOS = 0; |
var.INFOS = 0; |
134 |
}; |
}; |
135 |
|
|
136 |
void FEVdetector::GetWindow(){ |
void FEVdetector::GetWindow(){ |
|
otr->GetEntry(maxevent); |
|
137 |
// |
// |
138 |
|
if ( level.file == 2 ){ |
139 |
|
// printf("0qui\n"); |
140 |
|
L2->GetEntry(minevent); |
141 |
|
} else { |
142 |
|
otr->GetEntry(minevent); |
143 |
|
} |
144 |
if ( level.file < 2 ){ |
if ( level.file < 2 ){ |
145 |
ph = eh->GetPscuHeader(); |
ph = eh->GetPscuHeader(); |
146 |
lastevno = (int)ph->Counter; |
firstevno = (int)ph->Counter; |
147 |
} else { |
} else { |
148 |
if ( var.ORB ){ |
if ( var.ORB ){ |
149 |
lastevno = L2->GetOrbitalInfo()->pkt_num; |
firstevno = L2->GetOrbitalInfo()->pkt_num; |
150 |
} else { |
} else { |
151 |
lastevno = 0; |
firstevno = 0; |
152 |
}; |
}; |
153 |
}; |
}; |
154 |
otr->GetEntry(minevent); |
// |
155 |
|
if ( level.file == 2 ){ |
156 |
|
// printf("1qui\n"); |
157 |
|
L2->GetEntry(maxevent); |
158 |
|
} else { |
159 |
|
otr->GetEntry(maxevent); |
160 |
|
} |
161 |
|
// |
162 |
if ( level.file < 2 ){ |
if ( level.file < 2 ){ |
163 |
ph = eh->GetPscuHeader(); |
ph = eh->GetPscuHeader(); |
164 |
firstevno = (int)ph->Counter; |
lastevno = (int)ph->Counter; |
165 |
} else { |
} else { |
166 |
if ( var.ORB ){ |
if ( var.ORB ){ |
167 |
firstevno = L2->GetOrbitalInfo()->pkt_num; |
lastevno = L2->GetOrbitalInfo()->pkt_num; |
168 |
} else { |
} else { |
169 |
firstevno = 0; |
lastevno = 0; |
170 |
}; |
}; |
171 |
}; |
}; |
172 |
|
// |
173 |
} |
} |
174 |
|
|
175 |
void FEVdetector::ClearVariables(){ |
void FEVdetector::ClearVariables(){ |
192 |
} |
} |
193 |
|
|
194 |
void FEVdetector::GetEntry(Int_t i){ |
void FEVdetector::GetEntry(Int_t i){ |
195 |
thisentry = i; |
thisentry = i; |
196 |
otr->GetEntry(i); |
if ( level.file == 2 ){ |
197 |
// if ( level.file == 2 ){ |
L2->Clear(); |
198 |
// ShowInfo("TrkLevel2"); |
// printf("qui\n"); |
199 |
// ShowInfo("ToFLevel2"); |
L2->GetEntry(i); |
200 |
// ShowInfo("CaloLevel2"); |
ShowInfo("RunInfo"); |
201 |
// }; |
ShowInfo("SoftInfo"); |
202 |
// PrintData(otr,-1LL,44); |
ShowInfo("OrbitalInfo"); |
203 |
|
ShowInfo("TrigLevel2"); |
204 |
|
ShowInfo("ToFLevel2"); |
205 |
|
ShowInfo("TrkLevel2"); |
206 |
|
ShowInfo("AcLevel2"); |
207 |
|
ShowInfo("CaloLevel2"); |
208 |
|
ShowInfo("CaloLevel1"); |
209 |
|
ShowInfo("S4Level2"); |
210 |
|
ShowInfo("NDLevel2"); |
211 |
|
} else { |
212 |
|
otr->GetEntry(i); |
213 |
|
ShowInfo("Pscu"); |
214 |
|
ShowInfo("Trigger"); |
215 |
|
ShowInfo("Tof"); |
216 |
|
ShowInfo("Tracker"); |
217 |
|
ShowInfo("Anticounter"); |
218 |
|
ShowInfo("Calorimeter"); |
219 |
|
ShowInfo("Neutron"); |
220 |
|
ShowInfo("S4"); |
221 |
|
}; |
222 |
} |
} |
223 |
|
|
224 |
void FEVdetector::SetEntry(Int_t i){ |
void FEVdetector::SetEntry(Int_t i){ |
339 |
}; |
}; |
340 |
} |
} |
341 |
|
|
|
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"); |
|
|
}; |
|
|
|
|
|
|
|
342 |
void FEVdetector::ShowInfo(TString detector){ |
void FEVdetector::ShowInfo(TString detector){ |
343 |
// |
// |
344 |
TBranch *b1 = 0; |
TBranch *b1 = 0; |
345 |
TBranch *b3 = 0; |
// TBranch *b3 = 0; |
346 |
TObjArray *branch_array = 0; |
TObjArray *branch_array = 0; |
347 |
TObjArray *leaf_array = 0; |
// TObjArray *leaf_array = 0; |
348 |
|
// |
349 |
|
if ( !strcmp(detector.Data(),"RunInfo") || !strcmp(detector.Data(),"SoftInfo") ){ |
350 |
|
if ( L2->GetRunTree() ) b1 = L2->GetRunTree()->FindBranch(detector.Data()); |
351 |
|
} else { |
352 |
|
b1 = otr->FindBranch(detector.Data()); |
353 |
|
}; |
354 |
|
// |
355 |
|
if ( !b1 ) return; |
356 |
|
// |
357 |
|
Int_t dlen = 10; |
358 |
|
// |
359 |
|
char o[200000]; |
360 |
|
char col[13]; |
361 |
|
char col2[13]; |
362 |
// |
// |
363 |
b1 = otr->FindBranch(detector.Data()); |
setcolor(col,RESET, GREEN, WHITE); |
364 |
Int_t dlen = 44; |
sprintf(o,"%s======> EVENT:%i\n",col, thisentry); |
365 |
// |
// |
366 |
printf("======> EVENT:%i\n", thisentry); |
setcolor(col,RESET, RED, WHITE); |
367 |
|
sprintf(o,"%s%sBranch %s\n",o,col,b1->GetName()); |
368 |
|
setcolor(col,RESET, BLACK, WHITE); |
369 |
|
sprintf(o,"%s%s",o,col); |
370 |
// |
// |
|
printf("Branch %s\n",b1->GetName()); |
|
371 |
branch_array = b1->GetListOfBranches(); |
branch_array = b1->GetListOfBranches(); |
372 |
// |
// |
373 |
Int_t j = 0; |
Int_t j = 0; |
379 |
Int_t atype = tb->GetStreamerType() - 20; |
Int_t atype = tb->GetStreamerType() - 20; |
380 |
Int_t len = (tb->GetInfo()->GetLengths())[tb->GetID()]; |
Int_t len = (tb->GetInfo()->GetLengths())[tb->GetID()]; |
381 |
Int_t length = min(len,dlen); |
Int_t length = min(len,dlen); |
382 |
// printf("SubBranches : %s type is %i tb getname %s\n",((TBranch*)branch_array->At(l))->GetName(),type,tb->GetName()); |
// |
383 |
|
// printf("Branches : type is %i type is %i tb getname %s slen %i slength %i\n",atype,type,tb->GetName(),len,length); |
384 |
switch (type){ |
switch (type){ |
385 |
case 0: |
case 0: |
386 |
// |
// |
389 |
// |
// |
390 |
// NAME |
// NAME |
391 |
// |
// |
392 |
// printf(" ATYPE IS %i \n",atype); |
setcolor(col,RESET, BLUE, WHITE); |
393 |
printf(" %-15s =",((TBranch*)branch_array->At(l))->GetName()); |
setcolor(col2,RESET, BLACK, WHITE); |
394 |
|
sprintf(o,"%s%s %-15s%s =",o,col,((TBranch*)branch_array->At(l))->GetName(),col2); |
395 |
|
// |
396 |
j = 0; |
j = 0; |
397 |
// |
// |
398 |
// VALUES |
// VALUES |
399 |
// |
// |
400 |
|
// |
401 |
|
// Integer |
402 |
|
// |
403 |
if ( atype == 3 || atype == -17 ){ |
if ( atype == 3 || atype == -17 ){ |
404 |
while ( j < length ){ |
while ( j < length ){ |
405 |
if ( j < length -1 ){ |
if ( j < length -1 ){ |
406 |
printf(" %llu ,",(ULong64_t)tb->GetValue(j,0)); |
sprintf(o,"%s %i ,",o,(Int_t)tb->GetValue(j,0)); |
407 |
} else { |
} else { |
408 |
printf(" %llu",(ULong64_t)tb->GetValue(j,0)); |
sprintf(o,"%s %i",o,(Int_t)tb->GetValue(j,0)); |
409 |
}; |
}; |
410 |
j++; |
j++; |
411 |
}; |
}; |
412 |
} else { |
}; |
413 |
|
// |
414 |
|
// Unsigned integer |
415 |
|
// |
416 |
|
if ( atype == -7 || atype == 13 || atype == -9 || atype == -8 || atype == 12 ){ |
417 |
while ( j < length ){ |
while ( j < length ){ |
418 |
if ( j < length -1 ){ |
if ( j < length -1 ){ |
419 |
printf(" %f ,",tb->GetValue(j,0)); |
sprintf(o,"%s %u ,",o,(UInt_t)tb->GetValue(j,0)); |
420 |
} else { |
} else { |
421 |
printf(" %f",tb->GetValue(j,0)); |
sprintf(o,"%s %u",o,(UInt_t)tb->GetValue(j,0)); |
422 |
}; |
}; |
423 |
j++; |
j++; |
424 |
}; |
}; |
425 |
}; |
}; |
|
printf("\n"); |
|
|
break; |
|
|
case 3: |
|
426 |
// |
// |
427 |
// IS A TCLONESARRAY |
// Float |
|
// |
|
|
printf(" %-15s = %d\n", tb->GetName(), tb->GetNdata()); |
|
428 |
// |
// |
429 |
if ( tb->GetNdata() ){ |
if ( atype == -15 || atype == 5 ){ |
430 |
|
while ( j < length ){ |
431 |
printf(" auiauiaui\n"); |
if ( j < length -1 ){ |
432 |
TClonesArray *cl = (TClonesArray*)tb->GetObject(); |
sprintf(o,"%s %f ,",o,tb->GetValue(j,0)); |
433 |
// |
} else { |
434 |
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(); |
|
435 |
}; |
}; |
436 |
|
j++; |
437 |
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; |
|
|
// }; |
|
|
}; |
|
|
|
|
|
}; |
|
438 |
}; |
}; |
439 |
|
// |
440 |
|
// Strings |
441 |
|
// |
442 |
|
if ( atype == 45 ){ |
443 |
// TBranchElement *p=(TBranchElement*)cl->At(ll); |
// TObjArray *cl = (TObjArray*)(tb->GetInfo()->GetOffsets())[tb->GetID()];//tb->GetValuePointer(); |
444 |
// Int_t plen = (p->GetInfo()->GetLengths())[p->GetID()]; |
// TString *stringa = (TString*)(*cl)[0]; |
445 |
// Int_t plen = -1; |
// TBranchElement *utb = (TBranchElement*)tb->GetBranchCount(); |
446 |
// printf("SubBranches : %s plen is %i \n",p->GetName(),plen); |
// TString** stringa = (TString*)(&tb->GetValuePointer()); |
447 |
|
//TStreamerElement *tste = (TStreamerElement*)tb->GetInfo()->GetCurrentElement(); |
448 |
|
|
449 |
|
// char *ladd; |
450 |
|
// ladd = tb->GetValuePointer() |
451 |
// TLeafElement* leaf = (TLeafElement*)(p->UncheckedAt(0)); |
// TString *stringa = (TString*)((tste->GetOffset())); |
452 |
// printf("xoxoxo leaf : %s plen is %i \n",leaf->GetName(),leaf->GetLen()); |
// TString& mstr = *stringa; |
453 |
|
// printf(" la mia stringa %s \n",mstr.Data()); |
454 |
// Int_t n = tb->GetNdata(); |
// printf(" offset %i \n",(Int_t)utb->GetValue(0,0)); |
455 |
// n = n * leaf->GetLenStatic(); |
// int pointer = (tb->GetInfo()->GetOffsets())[tb->GetID()]; |
456 |
// if (tb->GetInfo()) { |
// TString *stringa = (TString*)(tb->GetInfo()->GetOffsets())[tb->GetID()]; |
457 |
// n = 16; |
// TString *stringa = (TString*)tb->GetAddress(); |
458 |
// tb->GetInfo()->PrintValue(tb->GetName(), tb->GetAddress(), atype, n, 44); |
// printf(" address 0x%X \n",tb->GetAddress()); |
459 |
//tb->GetObject()->GetInfo()->PrintValue(tb->GetName(), tb->GetObject(), atype, n, lenmax); |
// printf(" pointer 0x%X \n",tb->GetValuePointer()); |
460 |
// } |
// printf(" object 0x%X \n",tb->GetObject()); |
461 |
|
// printf("stringa %s lung %i\n",stringa.Data(),stringa.Length()); |
462 |
// TClonesArray* clones = (TClonesArray*) cl->At(ll); |
// TLeaf *striglia = tb->FindLeaf(tb->GetName()); |
463 |
// if ( tb->GetInfo() ) { |
// if ( striglia ){ |
464 |
// tb->GetInfo()->PrintValueClones(tb->GetName(), cl, tb->GetID(), tb->GetOffset(), 44); |
// char *pointer = (char *)striglia->GetValuePointer(); |
465 |
// }; |
// TString *pr= (TString*)pointer; |
466 |
|
// printf("ciao %s \n",pr->Data()); |
467 |
// b3 = (TBranch*)cl->At(l); |
// }; |
468 |
// leaf_array = b3->GetListOfLeaves(); |
sprintf(o,"%s TString - not implemented yet -",o); |
469 |
// for(Int_t l=0;l<(leaf_array->GetLast());l++){ |
}; |
470 |
// printf("Leaf : %s\n",((TLeaf*)leaf_array->At(l))->GetName()); |
// |
471 |
|
// TArray |
472 |
|
// |
473 |
// // TBranch *bcl = (TBranch*)leaf_array->At(l); |
if ( atype == 42 ){ |
474 |
// //bcl = b1->GetListOfLeaves(); |
// |
475 |
// //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++){ |
|
476 |
// // |
// // |
477 |
|
// TClass *myc = cl->IsA(); |
478 |
// // |
// // |
479 |
// // }; |
// printf("qui \n"); |
480 |
|
// // |
481 |
// TBranchElement *tb2 = (TBranchElement*)cl->UncheckedAt(ln); |
// // determine offset to fetch data |
482 |
// Int_t type2 = tb2->GetType(); |
// // |
483 |
// Int_t atype2 = tb2->GetStreamerType() - 20; |
// int thisoffset = 0; |
484 |
// Int_t len2 = (tb2->GetInfo()->GetLengths())[tb2->GetID()]; |
// TRealData *rd = myc->GetRealData(tb->GetName()); |
485 |
// Int_t length2 = min(len2,dlen); |
// if ( rd ){ |
486 |
// printf("SubSubBranches : %s type is %i \n",tb2->GetName(),type2); |
// thisoffset = rd->GetThisOffset(); |
487 |
|
// }; |
488 |
// switch (type2){ |
// Int_t niente = 0; |
489 |
// case 0: |
// TStreamerElement *tste = tb->GetInfo()->GetStreamerElement(rd->GetName(),niente); |
490 |
// // |
// printf(" typename %s \n",tste->GetTypeName()); |
491 |
// // IS A VARIABLE |
// // |
492 |
|
// // TArrayI |
493 |
|
// // |
494 |
|
// if ( !strcmp(tste->GetTypeName(),"TArrayI") ){ |
495 |
// // |
// // |
496 |
|
// printf("qua \n"); |
497 |
|
// char *pointer = (char*)cl->At(0); |
498 |
|
// // char *pu = thisoffset + pointer; |
499 |
|
// int pu = (int)tste->GetTObjectOffset(); |
500 |
|
// TArrayI arr = (TArrayI)*pu; |
501 |
|
// // TArrayI arr = (TArrayI)(thisoffset); |
502 |
|
// //TArrayI *arr = (TArrayI*)pu; |
503 |
|
// //TArraI arr = (TArrayI) |
504 |
|
// Int_t jj=0; |
505 |
|
// j=0; |
506 |
|
// printf("quii \n"); |
507 |
|
// Int_t arlen = min(arr.GetSize(),dlen); |
508 |
// // |
// // |
509 |
// // NAME |
// printf("que \n"); |
510 |
|
// setcolor(col,RESET, BLUE, WHITE); |
511 |
|
// setcolor(col2,RESET, BLACK, WHITE); |
512 |
|
// sprintf(o,"%s%s %s[%i]%s = ",o,col,tb->GetName(),arr.GetSize(),col2); |
513 |
// // |
// // |
514 |
// printf(" ATYPE IS %i \n",atype2); |
// // while ( j < tb->GetNdata() ){ |
|
// printf(" %-15s =",tb2->GetName()); |
|
|
// j = 0; |
|
515 |
// // |
// // |
516 |
// // VALUES |
// printf("quo \n"); |
517 |
|
// // pointer = (char*)cl->UncheckedAt(j); |
518 |
|
// // pu = pointer + thisoffset; |
519 |
|
// // arr = (TArrayI*)(thisoffset); |
520 |
// // |
// // |
521 |
// if ( atype2 == 3 || atype2 == -17 ){ |
// while ( jj < arlen ){ |
522 |
// while ( j < length2 ){ |
// if ( jj < arlen-1 ){ |
523 |
// if ( j < length2 -1 ){ |
// sprintf(o,"%s %i ,",o,arr.At(jj)); |
524 |
// printf(" %llu ,",(ULong64_t)tb2->GetValue(j,0)); |
// } else { |
525 |
// } 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++; |
|
526 |
// }; |
// }; |
527 |
|
// jj++; |
528 |
// }; |
// }; |
529 |
// printf("\n"); |
// // if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); |
530 |
// break; |
// // j++; |
531 |
|
// // }; |
532 |
// }; |
// }; |
|
// //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); |
|
533 |
// // |
// // |
534 |
// // NAME |
// // TArrayF |
535 |
// // |
// // |
536 |
// printf(" ATYPE IS %i \n",atype); |
// if ( !strcmp(tste->GetTypeName(),"TArrayF") ){ |
537 |
// printf(" %-15s =",((TBranch*)branch_array->At(l))->GetName()); |
// // |
538 |
// j = 0; |
// char *pointer = (char*)cl->UncheckedAt(0); |
539 |
// // |
// char *pu = pointer + thisoffset; |
540 |
// // VALUES |
// TArrayF *arr = (TArrayF*)(pu); |
541 |
// // |
// Int_t jj=0; |
542 |
// if ( atype == 3 || atype == -17 ){ |
// Int_t arlen = min(arr->GetSize(),dlen); |
543 |
// while ( j < length ){ |
// // |
544 |
// if ( j < length -1 ){ |
// setcolor(col,RESET, BLUE, WHITE); |
545 |
// printf(" %llu ,",(ULong64_t)tb->GetValue(j,0)); |
// setcolor(col2,RESET, BLACK, WHITE); |
546 |
// } else { |
// sprintf(o,"%s%s %s[%i]%s = ",o,col,tb->GetName(),arr->GetSize(),col2); |
547 |
// printf(" %llu",(ULong64_t)tb->GetValue(j,0)); |
// // |
548 |
// }; |
// while ( j < tb->GetNdata() ){ |
549 |
// j++; |
// // |
550 |
// }; |
// pointer = (char*)cl->UncheckedAt(j); |
551 |
// } else { |
// pu = pointer + thisoffset; |
552 |
// while ( j < length ){ |
// arr = (TArrayF*)(pu); |
553 |
// if ( j < length -1 ){ |
// // |
554 |
// printf(" %f ,",tb->GetValue(j,0)); |
// while ( jj < arlen ){ |
555 |
// } else { |
// if ( jj < arlen-1 ){ |
556 |
// printf(" %f",tb->GetValue(j,0)); |
// sprintf(o,"%s %f ,",o,arr->At(jj)); |
557 |
|
// } else { |
558 |
|
// sprintf(o,"%s %f",o,arr->At(jj)); |
559 |
|
// }; |
560 |
|
// jj++; |
561 |
// }; |
// }; |
562 |
|
// if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); |
563 |
// j++; |
// j++; |
564 |
// }; |
// }; |
565 |
// }; |
// }; |
566 |
// printf("\n"); |
// sprintf(o,"%s\n",o); |
567 |
|
// |
568 |
|
sprintf(o,"%s TArray - not implemented yet -",o); |
569 |
|
// |
570 |
|
}; |
571 |
|
// |
572 |
|
sprintf(o,"%s\n",o); |
573 |
|
break; |
574 |
|
case 3: |
575 |
|
// |
576 |
|
// IS A TCLONESARRAY |
577 |
|
// |
578 |
|
setcolor(col,RESET, BLUE, WHITE); |
579 |
|
setcolor(col2,RESET, BLACK, WHITE); |
580 |
|
sprintf(o,"%s%s %-15s%s = %d\n",o,col,tb->GetName(), col2, tb->GetNdata()); |
581 |
|
|
582 |
|
// |
583 |
|
if ( tb->GetNdata() ){ |
584 |
|
// |
585 |
|
TClonesArray *cl = (TClonesArray*)tb->GetObject(); |
586 |
|
// |
587 |
|
TClass *myc = cl->GetClass(); |
588 |
|
// |
589 |
|
TList *lme = myc->GetListOfDataMembers(); |
590 |
|
TIter next(lme); |
591 |
|
TBranchElement *tb2 = 0; |
592 |
|
// |
593 |
|
while ( (tb2 = (TBranchElement*)next()) ){ |
594 |
|
// |
595 |
|
const char *name = tb2->GetName(); |
596 |
|
TBranch *foglia = tb->FindBranch(name); |
597 |
|
if ( foglia ){ |
598 |
|
// |
599 |
|
TBranchElement *stb = (TBranchElement*)tb->FindBranch(name); |
600 |
|
Int_t stype = stb->GetType(); |
601 |
|
Int_t satype = stb->GetStreamerType() - 20; |
602 |
|
Int_t slen = (stb->GetInfo()->GetLengths())[stb->GetID()]; |
603 |
|
Int_t slength = min(slen,dlen); |
604 |
|
// printf("SubBranches : atype is %i type is %i tb getname %s slen %i slength %i\n",satype,stype,stb->GetName(),slen,slength); |
605 |
|
switch (stype){ |
606 |
|
case 31: |
607 |
|
// |
608 |
|
// IS A VARIABLE |
609 |
|
// |
610 |
|
// |
611 |
|
// NAME |
612 |
|
// |
613 |
|
j = 0; |
614 |
|
// |
615 |
|
// VALUES |
616 |
|
// |
617 |
|
if ( satype == 41 || satype == 44){ |
618 |
|
// |
619 |
|
// skip TRef |
620 |
|
// |
621 |
|
break; |
622 |
|
}; |
623 |
|
// |
624 |
|
// Integer |
625 |
|
// |
626 |
|
if ( satype == -17 || satype == -9 ){ |
627 |
|
// |
628 |
|
setcolor(col,RESET, BLUE, WHITE); |
629 |
|
setcolor(col2,RESET, BLACK, WHITE); |
630 |
|
sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2); |
631 |
|
while ( j < cl->GetEntriesFast() ){ |
632 |
|
if ( j < cl->GetEntriesFast() -1 ){ |
633 |
|
sprintf(o,"%s %i ,",o,(Int_t)stb->GetValue(j,slength)); |
634 |
|
} else { |
635 |
|
sprintf(o,"%s %i",o,(Int_t)stb->GetValue(j,slength)); |
636 |
|
}; |
637 |
|
j++; |
638 |
|
}; |
639 |
|
}; |
640 |
|
// |
641 |
|
// Float |
642 |
|
// |
643 |
|
if ( satype == -15 ){ |
644 |
|
// |
645 |
|
setcolor(col,RESET, BLUE, WHITE); |
646 |
|
setcolor(col2,RESET, BLACK, WHITE); |
647 |
|
sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2); |
648 |
|
while ( j < cl->GetEntriesFast() ){ |
649 |
|
if ( j < cl->GetEntriesFast() -1 ){ |
650 |
|
sprintf(o,"%s %f ,",o,stb->GetValue(j,slength)); |
651 |
|
} else { |
652 |
|
sprintf(o,"%s %f",o,stb->GetValue(j,slength)); |
653 |
|
}; |
654 |
|
j++; |
655 |
|
}; |
656 |
|
}; |
657 |
|
// |
658 |
|
// Array of float |
659 |
|
// |
660 |
|
if ( satype == 5 ){ |
661 |
|
// |
662 |
|
setcolor(col,RESET, BLUE, WHITE); |
663 |
|
setcolor(col2,RESET, BLACK, WHITE); |
664 |
|
sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2); |
665 |
|
Bool_t bold = true; |
666 |
|
while ( j < tb->GetNdata() ){ |
667 |
|
if ( bold ){ |
668 |
|
setcolor(col,RESET, BLACK, WHITE); |
669 |
|
sprintf(o,"%s%s",o,col); |
670 |
|
} else { |
671 |
|
setcolor(col,BOLD, BLACK, WHITE); |
672 |
|
sprintf(o,"%s%s",o,col); |
673 |
|
}; |
674 |
|
Int_t jj = 0; |
675 |
|
while ( jj < slength ){ |
676 |
|
if ( jj < slength-1 ){ |
677 |
|
sprintf(o,"%s %f ,",o,stb->GetValue(j,jj,true)); |
678 |
|
} else { |
679 |
|
sprintf(o,"%s %f",o,stb->GetValue(j,jj,true)); |
680 |
|
}; |
681 |
|
jj++; |
682 |
|
}; |
683 |
|
if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); |
684 |
|
if ( !bold ){ |
685 |
|
bold = true; |
686 |
|
} else { |
687 |
|
bold = false; |
688 |
|
}; |
689 |
|
j++; |
690 |
|
}; |
691 |
|
if ( bold ){ |
692 |
|
setcolor(col,RESET, BLACK, WHITE); |
693 |
|
sprintf(o,"%s%s",o,col); |
694 |
|
}; |
695 |
|
}; |
696 |
|
// |
697 |
|
// Array of integers |
698 |
|
// |
699 |
|
if ( satype == 3 ){ |
700 |
|
// |
701 |
|
setcolor(col,RESET, BLUE, WHITE); |
702 |
|
setcolor(col2,RESET, BLACK, WHITE); |
703 |
|
sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2); |
704 |
|
while ( j < tb->GetNdata() ){ |
705 |
|
Int_t jj = 0; |
706 |
|
while ( jj < slength ){ |
707 |
|
if ( jj < slength-1 ){ |
708 |
|
sprintf(o,"%s %i ,",o,(Int_t)stb->GetValue(j,jj,true)); |
709 |
|
} else { |
710 |
|
sprintf(o,"%s %i",o,(Int_t)stb->GetValue(j,jj,true)); |
711 |
|
}; |
712 |
|
jj++; |
713 |
|
}; |
714 |
|
if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); |
715 |
|
j++; |
716 |
|
}; |
717 |
|
}; |
718 |
|
|
719 |
|
// |
720 |
|
// TArray |
721 |
|
// |
722 |
|
if ( satype == 42 ){ |
723 |
|
// |
724 |
|
// determine offset to fetch data |
725 |
|
// |
726 |
|
int thisoffset = 0; |
727 |
|
TRealData *rd = myc->GetRealData(foglia->GetName()); |
728 |
|
if ( rd ){ |
729 |
|
thisoffset = rd->GetThisOffset(); |
730 |
|
}; |
731 |
|
Int_t niente = 0; |
732 |
|
TStreamerElement *tste = stb->GetInfo()->GetStreamerElement(rd->GetName(),niente); |
733 |
|
// |
734 |
|
// TArrayI |
735 |
|
// |
736 |
|
if ( !strcmp(tste->GetTypeName(),"TArrayI") ){ |
737 |
|
// |
738 |
|
char *pointer = (char*)cl->UncheckedAt(0); |
739 |
|
char *pu = pointer + thisoffset; |
740 |
|
TArrayI *arr = (TArrayI*)(pu); |
741 |
|
Int_t jj=0; |
742 |
|
Int_t arlen = min(arr->GetSize(),dlen); |
743 |
|
// |
744 |
|
setcolor(col,RESET, BLUE, WHITE); |
745 |
|
setcolor(col2,RESET, BLACK, WHITE); |
746 |
|
sprintf(o,"%s%s %s[%i]%s = ",o,col,foglia->GetName(),arr->GetSize(),col2); |
747 |
|
// |
748 |
|
while ( j < tb->GetNdata() ){ |
749 |
|
// |
750 |
|
pointer = (char*)cl->UncheckedAt(j); |
751 |
|
pu = pointer + thisoffset; |
752 |
|
arr = (TArrayI*)(pu); |
753 |
|
// |
754 |
|
while ( jj < arlen ){ |
755 |
|
if ( jj < arlen-1 ){ |
756 |
|
sprintf(o,"%s %i ,",o,arr->At(jj)); |
757 |
|
} else { |
758 |
|
sprintf(o,"%s %i",o,arr->At(jj)); |
759 |
|
}; |
760 |
|
jj++; |
761 |
|
}; |
762 |
|
if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); |
763 |
|
j++; |
764 |
|
}; |
765 |
|
}; |
766 |
|
// |
767 |
|
// TArrayF |
768 |
|
// |
769 |
|
if ( !strcmp(tste->GetTypeName(),"TArrayF") ){ |
770 |
|
// |
771 |
|
char *pointer = (char*)cl->UncheckedAt(0); |
772 |
|
char *pu = pointer + thisoffset; |
773 |
|
TArrayF *arr = (TArrayF*)(pu); |
774 |
|
Int_t jj=0; |
775 |
|
Int_t arlen = min(arr->GetSize(),dlen); |
776 |
|
// |
777 |
|
setcolor(col,RESET, BLUE, WHITE); |
778 |
|
setcolor(col2,RESET, BLACK, WHITE); |
779 |
|
sprintf(o,"%s%s %s[%i]%s = ",o,col,foglia->GetName(),arr->GetSize(),col2); |
780 |
|
// |
781 |
|
while ( j < tb->GetNdata() ){ |
782 |
|
// |
783 |
|
pointer = (char*)cl->UncheckedAt(j); |
784 |
|
pu = pointer + thisoffset; |
785 |
|
arr = (TArrayF*)(pu); |
786 |
|
// |
787 |
|
while ( jj < arlen ){ |
788 |
|
if ( jj < arlen-1 ){ |
789 |
|
sprintf(o,"%s %f ,",o,arr->At(jj)); |
790 |
|
} else { |
791 |
|
sprintf(o,"%s %f",o,arr->At(jj)); |
792 |
|
}; |
793 |
|
jj++; |
794 |
|
}; |
795 |
|
if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); |
796 |
|
j++; |
797 |
|
}; |
798 |
|
}; |
799 |
|
}; |
800 |
|
sprintf(o,"%s\n",o); |
801 |
|
break; |
802 |
|
}; |
803 |
|
}; |
804 |
|
}; |
805 |
|
}; |
806 |
break; |
break; |
807 |
}; |
}; |
808 |
// b3 = (TBranch*)branch_array->At(l); |
}; |
809 |
// leaf_array = b1->GetListOfLeaves(); |
// pamgui->DIALOG(0,o); |
810 |
// 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)); |
|
|
// }; |
|
|
// }; |
|
|
|
|
|
}; |
|
|
|
|
811 |
}; |
}; |
812 |
|
|
813 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
814 |
void FEVdetector::GetGeneralInfo(){ |
void FEVdetector::GetGeneralInfo(){ |
815 |
// |
// |
816 |
// Get Orbital Time information and header event number |
// Get Orbital Time information and header event number |
820 |
headcold = headc; |
headcold = headc; |
821 |
headc = ph->Counter; |
headc = ph->Counter; |
822 |
var.headc = (int)ph->Counter; |
var.headc = (int)ph->Counter; |
823 |
OBT = ph->OrbitalTime; |
OBT = (UInt_t)ph->OrbitalTime; |
824 |
DOBT = OBT - OOBT; |
DOBT = OBT - OOBT; |
825 |
OOBT = OBT; |
OOBT = OBT; |
826 |
if ( thisentry == minevent || DOBT < 0 || (headc-headcold-1)!=0 ) DOBT = 0; |
if ( thisentry == minevent || DOBT < 0 || (headc-headcold-1)!=0 ) DOBT = 0; |
856 |
trcs = (TString)trc.str().c_str(); |
trcs = (TString)trc.str().c_str(); |
857 |
} else { |
} else { |
858 |
headcold = headc; |
headcold = headc; |
859 |
|
if ( var.RUN ){ |
860 |
|
var.idrun = L2->GetRunInfo()->ID; |
861 |
|
var.idroot = L2->GetRunInfo()->ID_ROOT_L0; |
862 |
|
var.EVF = L2->GetRunInfo()->EV_FROM; |
863 |
|
}; |
864 |
if ( var.ORB ){ |
if ( var.ORB ){ |
865 |
headc = L2->GetOrbitalInfo()->pkt_num; |
headc = L2->GetOrbitalInfo()->pkt_num; |
866 |
OBT = L2->GetOrbitalInfo()->OBT; |
OBT = L2->GetOrbitalInfo()->OBT; |
1014 |
// |
// |
1015 |
} |
} |
1016 |
|
|
1017 |
Int_t FEVdetector::Load(TTree &mainotr, TFile &mainfile){ |
TChain* FEVdetector::Load(TString file){ |
1018 |
//Int_t FEVdetector::Load(TChain &mainotr, TFile &mainfile){ |
// |
1019 |
file = &mainfile; |
// file = &mainfile; |
|
otr = &mainotr; |
|
|
L2 = new PamLevel2(); |
|
1020 |
// |
// |
1021 |
if ( level.file == 2 ){ |
if ( level.file == 2 ){ |
1022 |
// otr = L2->LoadPamTrees(file); |
// |
1023 |
printf(" %s \n",ddec.Data()); |
printf(" %s \n",ddec.Data()); |
1024 |
// otr->Refresh(); |
if ( !L2 ){ |
1025 |
// otr->Clear(); |
L2 = new PamLevel2("",file.Data(),ddec.Data()); |
1026 |
// otr = new TTree(); |
otr = L2->GetPamTree(); |
1027 |
otr = L2->GetPamTree(file,ddec.Data()); |
printf(" l2 constructor\n"); |
1028 |
|
// printf(" abst %u obt %u qtot %f \n",L2->GetOrbitalInfo()->absTime,L2->GetOrbitalInfo()->OBT,L2->GetCaloLevel2()->qtot); |
1029 |
|
} else { |
1030 |
|
// |
1031 |
|
printf(" l2 already exist \n"); |
1032 |
|
otr = L2->GetPamTree(gSystem->DirName(file.Data()),file.Data(),ddec.Data()); |
1033 |
|
L2->GetRunTree(gSystem->DirName(file.Data()),file.Data()); |
1034 |
|
// |
1035 |
|
}; |
1036 |
|
// |
1037 |
// |
// |
1038 |
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/"; |
|
1039 |
// |
// |
1040 |
//L2->GetTrkLevel2()->LoadField(magfie.str().c_str()); |
// otr->CanDeleteRefs(true); |
1041 |
|
// if ( runtree ) runtree->CanDeleteRefs(true); |
1042 |
|
// |
1043 |
} else { |
} else { |
1044 |
// |
// |
1045 |
// load calorimeter ADC2MIP conversion file |
// load calorimeter ADC2MIP conversion file |
1080 |
}; |
}; |
1081 |
// |
// |
1082 |
// |
// |
1083 |
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(); |
|
1084 |
// |
// |
1085 |
if ( level.file == 0 || level.file == -1 ){ |
if ( level.file == 0 || level.file == -1 ){ |
1086 |
|
// |
1087 |
|
trigger = new pamela::trigger::TriggerEvent(); |
1088 |
|
eh = new pamela::EventHeader(); |
1089 |
|
ph = new pamela::PscuHeader(); |
1090 |
|
de = new pamela::calorimeter::CalorimeterEvent(); |
1091 |
|
trk = new pamela::tracker::TrackerEvent(); |
1092 |
|
ne = new pamela::neutron::NeutronEvent(); |
1093 |
|
ace = new pamela::anticounter::AnticounterEvent(); |
1094 |
|
s4 = new pamela::S4::S4Event(); |
1095 |
|
tof = new pamela::tof::TofEvent(); |
1096 |
|
// |
1097 |
|
otr = new TChain("Physics"); |
1098 |
|
otr->Add(file.Data(),-1); |
1099 |
otr->SetBranchAddress("Trigger", &trigger); |
otr->SetBranchAddress("Trigger", &trigger); |
1100 |
otr->SetBranchAddress("Header", &eh); |
otr->SetBranchAddress("Header", &eh); |
1101 |
}; |
}; |
|
if ( level.file == 2 && var.RUN){ |
|
|
// otr->AddFriend("OrbitalInfo", file); |
|
|
// otr->SetBranchAddress("OrbitalInfo", &oinfoL2); |
|
|
runinfo->Read(0ULL); |
|
|
}; |
|
1102 |
// |
// |
1103 |
if ( var.TRK ) { |
if ( var.TRK ) { |
1104 |
if ( level.file == 0 || level.file == -1 ){ |
if ( level.file == 0 || level.file == -1 ){ |
1171 |
}; |
}; |
1172 |
}; |
}; |
1173 |
// |
// |
1174 |
// printf("qua\n"); |
if ( !otr ){ |
1175 |
return(1); |
return(0); |
1176 |
|
}; |
1177 |
|
// |
1178 |
|
return otr; |
1179 |
// |
// |
1180 |
} |
} |
1181 |
|
|
1251 |
text->DrawLatex(0.33,txthi,testo.str().c_str()); |
text->DrawLatex(0.33,txthi,testo.str().c_str()); |
1252 |
txthi -= 0.03; |
txthi -= 0.03; |
1253 |
testo2.str(""); |
testo2.str(""); |
1254 |
testo2 << "On Board Time: " << (int)OBT; |
testo2 << "On Board Time: " << (unsigned int)OBT; |
1255 |
if ( DOBT > 0 ) { |
if ( DOBT > 0 ) { |
1256 |
testo2 << " (delta: " << (int)DOBT; |
testo2 << " (delta: " << (unsigned int)DOBT; |
1257 |
testo2 << ")"; |
testo2 << ")"; |
1258 |
}; |
}; |
1259 |
testo2 << " [ms]"; |
testo2 << " [ms]"; |
1871 |
void FEVdetector::ShowTOF(){ |
void FEVdetector::ShowTOF(){ |
1872 |
// |
// |
1873 |
// |
// |
|
// |
|
1874 |
if ( !var.TOF ) return; |
if ( !var.TOF ) return; |
1875 |
// |
// |
1876 |
Int_t tt = 0; |
Int_t tt = 0; |
2671 |
// |
// |
2672 |
Bool_t repeat = true; |
Bool_t repeat = true; |
2673 |
Int_t numtr = 1; |
Int_t numtr = 1; |
2674 |
|
// Int_t numtr = 0; |
2675 |
Int_t repuntil = 0; |
Int_t repuntil = 0; |
2676 |
// |
// |
2677 |
// |
// |
2679 |
// |
// |
2680 |
if ( level.file == 2 ) repuntil = L2->GetToFLevel2()->ntrk(); |
if ( level.file == 2 ) repuntil = L2->GetToFLevel2()->ntrk(); |
2681 |
// printf("repuntil = %i \n",repuntil); |
// printf("repuntil = %i \n",repuntil); |
2682 |
|
//if ( level.file == 2 ) repuntil = L2->GetTrkLevel2()->GetNTracks(); |
2683 |
//repuntil = L2->GetNTracks(); |
//repuntil = L2->GetNTracks(); |
2684 |
// |
// |
2685 |
while ( repeat ){ |
while ( repeat ){ |
2689 |
// |
// |
2690 |
// |
// |
2691 |
ToFTrkVar *ptt = 0; |
ToFTrkVar *ptt = 0; |
2692 |
|
// PamTrack *ptrack = 0; |
2693 |
|
Float_t adc[4][12]; |
2694 |
|
Float_t tdc[4][12]; |
2695 |
|
memset(adc,0,4*12*sizeof(Float_t)); |
2696 |
|
memset(tdc,0,4*12*sizeof(Float_t)); |
2697 |
// |
// |
2698 |
// |
// |
2699 |
|
// if ( repuntil == 0 || var.tofraw ){ |
2700 |
if ( repuntil == 1 || var.tofraw ){ |
if ( repuntil == 1 || var.tofraw ){ |
2701 |
numtr = 0; |
numtr = 0; |
2702 |
ptt = L2->GetToFLevel2()->GetToFTrkVar(0); |
ptt = L2->GetToFLevel2()->GetToFTrkVar(0); |
2706 |
// |
// |
2707 |
if ( numtr >= repuntil-1 ) repeat = false; |
if ( numtr >= repuntil-1 ) repeat = false; |
2708 |
// |
// |
2709 |
ptt = L2->GetToFLevel2()->GetToFTrkVar(numtr); |
// printf(" numtr is %i \n",numtr); |
2710 |
|
ptt = L2->GetToFLevel2()->GetToFTrkVar(numtr); |
2711 |
|
//ptrack = L2->GetTrack(numtr); |
2712 |
|
//ptt = ptrack->GetToFTrack(); |
2713 |
}; |
}; |
2714 |
// |
// |
2715 |
xp11[0] = 0.; |
xp11[0] = 0.; |
2723 |
// |
// |
2724 |
ii = 2; |
ii = 2; |
2725 |
// |
// |
2726 |
Float_t adc[4][12]; |
Int_t myseq = ptt->trkseqno + 1; |
2727 |
Float_t tdc[4][12]; |
L2->GetToFLevel2()->GetMatrix(myseq,adc,tdc); |
2728 |
L2->GetToFLevel2()->GetMatrix(numtr,adc,tdc); |
// |
2729 |
|
// printf(" qua \n"); |
2730 |
// |
// |
2731 |
for ( Int_t i = 0; i<8; i++ ) { |
for ( Int_t i = 0; i<8; i++ ) { |
2732 |
if ( adc[ch11a[i]][hb11a[i]] < 1000. ){ |
if ( adc[ch11a[i]][hb11a[i]] < 1000. ){ |
5203 |
// first of all plot crosses relatives to tracks |
// first of all plot crosses relatives to tracks |
5204 |
// |
// |
5205 |
if ( L2->GetTrkLevel2()->GetNTracks() > 0 ){ |
if ( L2->GetTrkLevel2()->GetNTracks() > 0 ){ |
5206 |
|
// for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ |
5207 |
|
// TrkTrack *track = L2->GetTrkLevel2()->GetTrack(nt); |
5208 |
for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ |
for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ |
5209 |
TrkTrack *track = L2->GetTrkLevel2()->GetTrack(nt); |
PamTrack *ptrack= L2->GetTrack(nt); |
5210 |
|
TrkTrack *track = ptrack->GetTrkTrack(); |
5211 |
|
// |
5212 |
for (Int_t plane = 0; plane<6; plane++){ |
for (Int_t plane = 0; plane<6; plane++){ |
5213 |
// |
// |
5214 |
x = track->xm[plane]; |
x = track->xm[plane]; |
5522 |
|
|
5523 |
void FEVdetector::ShowTrack(){ |
void FEVdetector::ShowTrack(){ |
5524 |
// |
// |
5525 |
|
if ( level.file != 2 ) return; |
5526 |
// |
// |
5527 |
// |
// |
5528 |
if ( var.CALO && false ){ |
// |
5529 |
|
if ( var.CALO && var.CALOT ){ |
5530 |
if ( L2->GetCaloLevel2()->npcfit[0] > 0 && L2->GetCaloLevel2()->npcfit[1] > 0 ){ |
if ( L2->GetCaloLevel2()->npcfit[0] > 0 && L2->GetCaloLevel2()->npcfit[1] > 0 ){ |
5531 |
Float_t calx[22]; |
Float_t calx[22]; |
5532 |
Float_t caly[22]; |
Float_t caly[22]; |
5621 |
}; |
}; |
5622 |
}; |
}; |
5623 |
// |
// |
5624 |
if ( !var.TRK || level.file != 2 ) return; |
if ( !var.TRK ) return; |
5625 |
// |
// |
5626 |
if ( L2->GetTrkLevel2()->GetNTracks() > 0 ){ |
if ( L2->GetTrkLevel2()->GetNTracks() > 0 ){ |
5627 |
for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ |
for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ |
5628 |
|
|
5629 |
// TrkTrack *track = L2->GetTrkLevel2()->GetTrack(nt); |
// TrkTrack *track = L2->GetTrkLevel2()->GetTrack(nt); |
5630 |
|
// printf("qui \n"); |
5631 |
PamTrack *ptrack = L2->GetTrack(nt); |
PamTrack *ptrack = L2->GetTrack(nt); |
5632 |
TrkTrack *track = ptrack->GetTrkTrack(); |
TrkTrack *track = ptrack->GetTrkTrack(); |
5633 |
|
// printf("qua \n"); |
5634 |
Int_t npoint = 100; |
Int_t npoint = 100; |
5635 |
Float_t zin[100]; |
Float_t zin[100]; |
5636 |
Double_t xout[100]; |
Double_t xout[100]; |
5838 |
Int_t se = 5; |
Int_t se = 5; |
5839 |
if ( !l && m%2 == 0 ) se = 3; |
if ( !l && m%2 == 0 ) se = 3; |
5840 |
if ( !l && m%2 != 0 ) se = 2; |
if ( !l && m%2 != 0 ) se = 2; |
5841 |
if ( l && m%2 == 0 ) se = 1; |
if ( l && m%2 != 0 ) se = 1; |
5842 |
if ( l && m%2 != 0 ) se = 0; |
if ( l && m%2 == 0 ) se = 0; |
5843 |
// |
// |
5844 |
// determine what kind of event we are going to analyze |
// determine what kind of event we are going to analyze |
5845 |
// |
// |
5954 |
// |
// |
5955 |
// Define variables |
// Define variables |
5956 |
// |
// |
5957 |
Int_t etime = var.etime; |
UInt_t etime = var.etime; |
5958 |
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]; |
5959 |
Int_t badstrip = 0; |
Int_t badstrip = 0; |
5960 |
qtot = 0.; |
qtot = 0.; |
6026 |
if ( calib.ttime[s][b[s]+1] && calib.time[s][b[s]] ){ |
if ( calib.ttime[s][b[s]+1] && calib.time[s][b[s]] ){ |
6027 |
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 ){ |
6028 |
printf(" CALORIMETER: \n" ); |
printf(" CALORIMETER: \n" ); |
6029 |
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]); |
6030 |
printf(" END CALORIMETER. \n\n" ); |
printf(" END CALORIMETER. \n\n" ); |
6031 |
b[s]++; |
b[s]++; |
6032 |
CaloPede(s); |
CaloPede(s); |
6046 |
Int_t se = 5; |
Int_t se = 5; |
6047 |
if (l == 0 && m%2 == 0) se = 3; |
if (l == 0 && m%2 == 0) se = 3; |
6048 |
if (l == 0 && m%2 != 0) se = 2; |
if (l == 0 && m%2 != 0) se = 2; |
6049 |
if (l == 1 && m%2 == 0) se = 1; |
if (l == 1 && m%2 != 0) se = 1; |
6050 |
if (l == 1 && m%2 != 0) se = 0; |
if (l == 1 && m%2 == 0) se = 0; |
6051 |
// |
// |
6052 |
// determine what kind of event we are going to analyze |
// determine what kind of event we are going to analyze |
6053 |
// |
// |
6331 |
for (Int_t d = 0; d<48; d++){ |
for (Int_t d = 0; d<48; d++){ |
6332 |
if ( calib.ttime[s][d] != 0 ) calibex++; |
if ( calib.ttime[s][d] != 0 ) calibex++; |
6333 |
if ( calib.time[s][0] != 0 ){ |
if ( calib.time[s][0] != 0 ){ |
6334 |
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]); |
6335 |
if ( calib.time[s][d+1] != 0 ) { |
if ( calib.time[s][d+1] != 0 ) { |
6336 |
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]); |
6337 |
} else { |
} else { |
6338 |
if ( !stop ){ |
if ( !stop ){ |
6339 |
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]); |
6340 |
stop = 1; |
stop = 1; |
6341 |
}; |
}; |
6342 |
}; |
}; |
6343 |
} else { |
} else { |
6344 |
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]); |
6345 |
}; |
}; |
6346 |
}; |
}; |
6347 |
printf("\n"); |
printf("\n"); |
6406 |
calib.ttime[s][inter] = 0; |
calib.ttime[s][inter] = 0; |
6407 |
if ( ce->cstwerr[s] != 0 && ce->cperror[s] == 0 ) { |
if ( ce->cstwerr[s] != 0 && ce->cperror[s] == 0 ) { |
6408 |
//calib.ttime[s][inter] = cph->GetOrbitalTime(); |
//calib.ttime[s][inter] = cph->GetOrbitalTime(); |
6409 |
calib.ttime[s][inter] = cph->OrbitalTime; |
calib.ttime[s][inter] = (UInt_t)cph->OrbitalTime; |
6410 |
inter++; |
inter++; |
6411 |
} else { |
} else { |
6412 |
if ( ce->cstwerr[s] != 0 && ce->cperror[s] != 0 ) { |
if ( ce->cstwerr[s] != 0 && ce->cperror[s] != 0 ) { |
6460 |
tr->GetEntry(ci); |
tr->GetEntry(ci); |
6461 |
cph = ceh->GetPscuHeader(); |
cph = ceh->GetPscuHeader(); |
6462 |
//if ( atime == cph->GetOrbitalTime()){ |
//if ( atime == cph->GetOrbitalTime()){ |
6463 |
if ( atime == cph->OrbitalTime){ |
if ( atime == (UInt_t)cph->OrbitalTime){ |
6464 |
// calib.iev = ce->iev; |
// calib.iev = ce->iev; |
6465 |
if (ce->cstwerr[s] != 0 && ce->cperror[s] == 0 ) { |
if (ce->cstwerr[s] != 0 && ce->cperror[s] == 0 ) { |
6466 |
for ( Int_t d=0 ; d<11 ;d++ ){ |
for ( Int_t d=0 ; d<11 ;d++ ){ |