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 = 0; |
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(){ |
137 |
otr->GetEntry(maxevent); |
printf(" ah \n"); |
138 |
|
// |
139 |
|
if ( level.file == 2 ){ |
140 |
|
L2->GetEntry(maxevent); |
141 |
|
} else { |
142 |
|
otr->GetEntry(maxevent); |
143 |
|
} |
144 |
// |
// |
145 |
if ( level.file < 2 ){ |
if ( level.file < 2 ){ |
146 |
ph = eh->GetPscuHeader(); |
ph = eh->GetPscuHeader(); |
152 |
lastevno = 0; |
lastevno = 0; |
153 |
}; |
}; |
154 |
}; |
}; |
155 |
otr->GetEntry(minevent); |
printf(" mmh minev %u \n",minevent); |
156 |
|
if ( level.file == 2 ){ |
157 |
|
L2->GetEntry(minevent); |
158 |
|
} else { |
159 |
|
otr->GetEntry(minevent); |
160 |
|
} |
161 |
if ( level.file < 2 ){ |
if ( level.file < 2 ){ |
162 |
ph = eh->GetPscuHeader(); |
ph = eh->GetPscuHeader(); |
163 |
firstevno = (int)ph->Counter; |
firstevno = (int)ph->Counter; |
168 |
firstevno = 0; |
firstevno = 0; |
169 |
}; |
}; |
170 |
}; |
}; |
171 |
|
printf(" aaah \n"); |
172 |
} |
} |
173 |
|
|
174 |
void FEVdetector::ClearVariables(){ |
void FEVdetector::ClearVariables(){ |
191 |
} |
} |
192 |
|
|
193 |
void FEVdetector::GetEntry(Int_t i){ |
void FEVdetector::GetEntry(Int_t i){ |
194 |
thisentry = i; |
thisentry = i; |
195 |
otr->GetEntry(i); |
if ( level.file == 2 ){ |
196 |
// if ( level.file == 2 ){ |
printf("qui \n"); |
197 |
// ShowInfo("TrkLevel2"); |
L2->GetEntry(i); |
198 |
// ShowInfo("ToFLevel2"); |
printf("qua \n"); |
199 |
// ShowInfo("CaloLevel2"); |
ShowInfo("RunInfo"); |
200 |
// }; |
ShowInfo("SoftInfo"); |
201 |
// PrintData(otr,-1LL,44); |
ShowInfo("OrbitalInfo"); |
202 |
|
ShowInfo("TrigLevel2"); |
203 |
|
ShowInfo("ToFLevel2"); |
204 |
|
ShowInfo("TrkLevel2"); |
205 |
|
ShowInfo("AcLevel2"); |
206 |
|
ShowInfo("CaloLevel2"); |
207 |
|
ShowInfo("CaloLevel1"); |
208 |
|
ShowInfo("S4Level2"); |
209 |
|
ShowInfo("NDLevel2"); |
210 |
|
} else { |
211 |
|
otr->GetEntry(i); |
212 |
|
ShowInfo("Pscu"); |
213 |
|
ShowInfo("Trigger"); |
214 |
|
ShowInfo("Tof"); |
215 |
|
ShowInfo("Tracker"); |
216 |
|
ShowInfo("Anticounter"); |
217 |
|
ShowInfo("Calorimeter"); |
218 |
|
ShowInfo("Neutron"); |
219 |
|
ShowInfo("S4"); |
220 |
|
}; |
221 |
} |
} |
222 |
|
|
223 |
void FEVdetector::SetEntry(Int_t i){ |
void FEVdetector::SetEntry(Int_t i){ |
338 |
}; |
}; |
339 |
} |
} |
340 |
|
|
|
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"); |
|
|
}; |
|
|
|
|
|
|
|
341 |
void FEVdetector::ShowInfo(TString detector){ |
void FEVdetector::ShowInfo(TString detector){ |
342 |
// |
// |
343 |
TBranch *b1 = 0; |
TBranch *b1 = 0; |
344 |
TBranch *b3 = 0; |
// TBranch *b3 = 0; |
345 |
TObjArray *branch_array = 0; |
TObjArray *branch_array = 0; |
346 |
TObjArray *leaf_array = 0; |
// TObjArray *leaf_array = 0; |
347 |
// |
// |
348 |
b1 = otr->FindBranch(detector.Data()); |
if ( !strcmp(detector.Data(),"RunInfo") || !strcmp(detector.Data(),"SoftInfo") ){ |
349 |
Int_t dlen = 44; |
if ( runtree ) b1 = runtree->FindBranch(detector.Data()); |
350 |
|
} else { |
351 |
|
b1 = otr->FindBranch(detector.Data()); |
352 |
|
}; |
353 |
|
// |
354 |
|
if ( !b1 ) return; |
355 |
|
// |
356 |
|
Int_t dlen = 10; |
357 |
// |
// |
358 |
printf("======> EVENT:%i\n", thisentry); |
char o[200000]; |
359 |
|
char col[13]; |
360 |
|
char col2[13]; |
361 |
|
// |
362 |
|
setcolor(col,RESET, GREEN, WHITE); |
363 |
|
sprintf(o,"%s======> EVENT:%i\n",col, thisentry); |
364 |
|
// |
365 |
|
setcolor(col,RESET, RED, WHITE); |
366 |
|
sprintf(o,"%s%sBranch %s\n",o,col,b1->GetName()); |
367 |
|
setcolor(col,RESET, BLACK, WHITE); |
368 |
|
sprintf(o,"%s%s",o,col); |
369 |
// |
// |
|
printf("Branch %s\n",b1->GetName()); |
|
370 |
branch_array = b1->GetListOfBranches(); |
branch_array = b1->GetListOfBranches(); |
371 |
// |
// |
372 |
Int_t j = 0; |
Int_t j = 0; |
378 |
Int_t atype = tb->GetStreamerType() - 20; |
Int_t atype = tb->GetStreamerType() - 20; |
379 |
Int_t len = (tb->GetInfo()->GetLengths())[tb->GetID()]; |
Int_t len = (tb->GetInfo()->GetLengths())[tb->GetID()]; |
380 |
Int_t length = min(len,dlen); |
Int_t length = min(len,dlen); |
381 |
// printf("SubBranches : %s type is %i tb getname %s\n",((TBranch*)branch_array->At(l))->GetName(),type,tb->GetName()); |
// |
382 |
|
// printf("Branches : type is %i type is %i tb getname %s slen %i slength %i\n",atype,type,tb->GetName(),len,length); |
383 |
switch (type){ |
switch (type){ |
384 |
case 0: |
case 0: |
385 |
// |
// |
388 |
// |
// |
389 |
// NAME |
// NAME |
390 |
// |
// |
391 |
// printf(" ATYPE IS %i \n",atype); |
setcolor(col,RESET, BLUE, WHITE); |
392 |
printf(" %-15s =",((TBranch*)branch_array->At(l))->GetName()); |
setcolor(col2,RESET, BLACK, WHITE); |
393 |
|
sprintf(o,"%s%s %-15s%s =",o,col,((TBranch*)branch_array->At(l))->GetName(),col2); |
394 |
|
// |
395 |
j = 0; |
j = 0; |
396 |
// |
// |
397 |
// VALUES |
// VALUES |
398 |
// |
// |
399 |
|
// |
400 |
|
// Integer |
401 |
|
// |
402 |
if ( atype == 3 || atype == -17 ){ |
if ( atype == 3 || atype == -17 ){ |
403 |
while ( j < length ){ |
while ( j < length ){ |
404 |
if ( j < length -1 ){ |
if ( j < length -1 ){ |
405 |
printf(" %llu ,",(ULong64_t)tb->GetValue(j,0)); |
sprintf(o,"%s %i ,",o,(Int_t)tb->GetValue(j,0)); |
406 |
} else { |
} else { |
407 |
printf(" %llu",(ULong64_t)tb->GetValue(j,0)); |
sprintf(o,"%s %i",o,(Int_t)tb->GetValue(j,0)); |
408 |
}; |
}; |
409 |
j++; |
j++; |
410 |
}; |
}; |
411 |
} else { |
}; |
412 |
|
// |
413 |
|
// Unsigned integer |
414 |
|
// |
415 |
|
if ( atype == -7 || atype == 13 || atype == -9 || atype == -8 || atype == 12 ){ |
416 |
while ( j < length ){ |
while ( j < length ){ |
417 |
if ( j < length -1 ){ |
if ( j < length -1 ){ |
418 |
printf(" %f ,",tb->GetValue(j,0)); |
sprintf(o,"%s %u ,",o,(UInt_t)tb->GetValue(j,0)); |
419 |
} else { |
} else { |
420 |
printf(" %f",tb->GetValue(j,0)); |
sprintf(o,"%s %u",o,(UInt_t)tb->GetValue(j,0)); |
421 |
}; |
}; |
422 |
j++; |
j++; |
423 |
}; |
}; |
424 |
}; |
}; |
|
printf("\n"); |
|
|
break; |
|
|
case 3: |
|
425 |
// |
// |
426 |
// IS A TCLONESARRAY |
// Float |
|
// |
|
|
printf(" %-15s = %d\n", tb->GetName(), tb->GetNdata()); |
|
427 |
// |
// |
428 |
if ( tb->GetNdata() ){ |
if ( atype == -15 || atype == 5 ){ |
429 |
|
while ( j < length ){ |
430 |
printf(" auiauiaui\n"); |
if ( j < length -1 ){ |
431 |
TClonesArray *cl = (TClonesArray*)tb->GetObject(); |
sprintf(o,"%s %f ,",o,tb->GetValue(j,0)); |
432 |
// |
} else { |
433 |
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(); |
|
434 |
}; |
}; |
435 |
|
j++; |
436 |
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; |
|
|
// }; |
|
|
}; |
|
|
|
|
|
}; |
|
437 |
}; |
}; |
438 |
|
// |
439 |
|
// Strings |
440 |
|
// |
441 |
|
if ( atype == 45 ){ |
442 |
// TBranchElement *p=(TBranchElement*)cl->At(ll); |
// TObjArray *cl = (TObjArray*)(tb->GetInfo()->GetOffsets())[tb->GetID()];//tb->GetValuePointer(); |
443 |
// Int_t plen = (p->GetInfo()->GetLengths())[p->GetID()]; |
// TString *stringa = (TString*)(*cl)[0]; |
444 |
// Int_t plen = -1; |
// TBranchElement *utb = (TBranchElement*)tb->GetBranchCount(); |
445 |
// printf("SubBranches : %s plen is %i \n",p->GetName(),plen); |
// TString** stringa = (TString*)(&tb->GetValuePointer()); |
446 |
|
//TStreamerElement *tste = (TStreamerElement*)tb->GetInfo()->GetCurrentElement(); |
447 |
|
|
448 |
|
// char *ladd; |
449 |
|
// ladd = tb->GetValuePointer() |
450 |
// TLeafElement* leaf = (TLeafElement*)(p->UncheckedAt(0)); |
// TString *stringa = (TString*)((tste->GetOffset())); |
451 |
// printf("xoxoxo leaf : %s plen is %i \n",leaf->GetName(),leaf->GetLen()); |
// TString& mstr = *stringa; |
452 |
|
// printf(" la mia stringa %s \n",mstr.Data()); |
453 |
// Int_t n = tb->GetNdata(); |
// printf(" offset %i \n",(Int_t)utb->GetValue(0,0)); |
454 |
// n = n * leaf->GetLenStatic(); |
// int pointer = (tb->GetInfo()->GetOffsets())[tb->GetID()]; |
455 |
// if (tb->GetInfo()) { |
// TString *stringa = (TString*)(tb->GetInfo()->GetOffsets())[tb->GetID()]; |
456 |
// n = 16; |
// TString *stringa = (TString*)tb->GetAddress(); |
457 |
// tb->GetInfo()->PrintValue(tb->GetName(), tb->GetAddress(), atype, n, 44); |
// printf(" address 0x%X \n",tb->GetAddress()); |
458 |
//tb->GetObject()->GetInfo()->PrintValue(tb->GetName(), tb->GetObject(), atype, n, lenmax); |
// printf(" pointer 0x%X \n",tb->GetValuePointer()); |
459 |
// } |
// printf(" object 0x%X \n",tb->GetObject()); |
460 |
|
// printf("stringa %s lung %i\n",stringa.Data(),stringa.Length()); |
461 |
// TClonesArray* clones = (TClonesArray*) cl->At(ll); |
// TLeaf *striglia = tb->FindLeaf(tb->GetName()); |
462 |
// if ( tb->GetInfo() ) { |
// if ( striglia ){ |
463 |
// tb->GetInfo()->PrintValueClones(tb->GetName(), cl, tb->GetID(), tb->GetOffset(), 44); |
// char *pointer = (char *)striglia->GetValuePointer(); |
464 |
// }; |
// TString *pr= (TString*)pointer; |
465 |
|
// printf("ciao %s \n",pr->Data()); |
466 |
// b3 = (TBranch*)cl->At(l); |
// }; |
467 |
// leaf_array = b3->GetListOfLeaves(); |
sprintf(o,"%s TString - not implemented yet -",o); |
468 |
// for(Int_t l=0;l<(leaf_array->GetLast());l++){ |
}; |
469 |
// printf("Leaf : %s\n",((TLeaf*)leaf_array->At(l))->GetName()); |
// |
470 |
|
// TArray |
471 |
|
// |
472 |
// // TBranch *bcl = (TBranch*)leaf_array->At(l); |
if ( atype == 42 ){ |
473 |
// //bcl = b1->GetListOfLeaves(); |
// |
474 |
// //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++){ |
|
475 |
// // |
// // |
476 |
|
// TClass *myc = cl->IsA(); |
477 |
// // |
// // |
478 |
// // }; |
// printf("qui \n"); |
479 |
|
// // |
480 |
// TBranchElement *tb2 = (TBranchElement*)cl->UncheckedAt(ln); |
// // determine offset to fetch data |
481 |
// Int_t type2 = tb2->GetType(); |
// // |
482 |
// Int_t atype2 = tb2->GetStreamerType() - 20; |
// int thisoffset = 0; |
483 |
// Int_t len2 = (tb2->GetInfo()->GetLengths())[tb2->GetID()]; |
// TRealData *rd = myc->GetRealData(tb->GetName()); |
484 |
// Int_t length2 = min(len2,dlen); |
// if ( rd ){ |
485 |
// printf("SubSubBranches : %s type is %i \n",tb2->GetName(),type2); |
// thisoffset = rd->GetThisOffset(); |
486 |
|
// }; |
487 |
// switch (type2){ |
// Int_t niente = 0; |
488 |
// case 0: |
// TStreamerElement *tste = tb->GetInfo()->GetStreamerElement(rd->GetName(),niente); |
489 |
// // |
// printf(" typename %s \n",tste->GetTypeName()); |
490 |
// // IS A VARIABLE |
// // |
491 |
|
// // TArrayI |
492 |
|
// // |
493 |
|
// if ( !strcmp(tste->GetTypeName(),"TArrayI") ){ |
494 |
// // |
// // |
495 |
|
// printf("qua \n"); |
496 |
|
// char *pointer = (char*)cl->At(0); |
497 |
|
// // char *pu = thisoffset + pointer; |
498 |
|
// int pu = (int)tste->GetTObjectOffset(); |
499 |
|
// TArrayI arr = (TArrayI)*pu; |
500 |
|
// // TArrayI arr = (TArrayI)(thisoffset); |
501 |
|
// //TArrayI *arr = (TArrayI*)pu; |
502 |
|
// //TArraI arr = (TArrayI) |
503 |
|
// Int_t jj=0; |
504 |
|
// j=0; |
505 |
|
// printf("quii \n"); |
506 |
|
// Int_t arlen = min(arr.GetSize(),dlen); |
507 |
// // |
// // |
508 |
// // NAME |
// printf("que \n"); |
509 |
|
// setcolor(col,RESET, BLUE, WHITE); |
510 |
|
// setcolor(col2,RESET, BLACK, WHITE); |
511 |
|
// sprintf(o,"%s%s %s[%i]%s = ",o,col,tb->GetName(),arr.GetSize(),col2); |
512 |
// // |
// // |
513 |
// printf(" ATYPE IS %i \n",atype2); |
// // while ( j < tb->GetNdata() ){ |
|
// printf(" %-15s =",tb2->GetName()); |
|
|
// j = 0; |
|
514 |
// // |
// // |
515 |
// // VALUES |
// printf("quo \n"); |
516 |
|
// // pointer = (char*)cl->UncheckedAt(j); |
517 |
|
// // pu = pointer + thisoffset; |
518 |
|
// // arr = (TArrayI*)(thisoffset); |
519 |
// // |
// // |
520 |
// if ( atype2 == 3 || atype2 == -17 ){ |
// while ( jj < arlen ){ |
521 |
// while ( j < length2 ){ |
// if ( jj < arlen-1 ){ |
522 |
// if ( j < length2 -1 ){ |
// sprintf(o,"%s %i ,",o,arr.At(jj)); |
523 |
// printf(" %llu ,",(ULong64_t)tb2->GetValue(j,0)); |
// } else { |
524 |
// } 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++; |
|
525 |
// }; |
// }; |
526 |
|
// jj++; |
527 |
// }; |
// }; |
528 |
// printf("\n"); |
// // if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); |
529 |
// break; |
// // j++; |
530 |
|
// // }; |
531 |
// }; |
// }; |
|
// //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 |
|
532 |
// // |
// // |
533 |
// Int_t atype = tb->GetStreamerType() - 20; |
// // TArrayF |
|
// Int_t len = (tb->GetInfo()->GetLengths())[tb->GetID()]; |
|
|
// Int_t length = min(len,dlen); |
|
534 |
// // |
// // |
535 |
// // NAME |
// if ( !strcmp(tste->GetTypeName(),"TArrayF") ){ |
536 |
// // |
// // |
537 |
// printf(" ATYPE IS %i \n",atype); |
// char *pointer = (char*)cl->UncheckedAt(0); |
538 |
// printf(" %-15s =",((TBranch*)branch_array->At(l))->GetName()); |
// char *pu = pointer + thisoffset; |
539 |
// j = 0; |
// TArrayF *arr = (TArrayF*)(pu); |
540 |
// // |
// Int_t jj=0; |
541 |
// // VALUES |
// Int_t arlen = min(arr->GetSize(),dlen); |
542 |
// // |
// // |
543 |
// if ( atype == 3 || atype == -17 ){ |
// setcolor(col,RESET, BLUE, WHITE); |
544 |
// while ( j < length ){ |
// setcolor(col2,RESET, BLACK, WHITE); |
545 |
// if ( j < length -1 ){ |
// sprintf(o,"%s%s %s[%i]%s = ",o,col,tb->GetName(),arr->GetSize(),col2); |
546 |
// printf(" %llu ,",(ULong64_t)tb->GetValue(j,0)); |
// // |
547 |
// } else { |
// while ( j < tb->GetNdata() ){ |
548 |
// printf(" %llu",(ULong64_t)tb->GetValue(j,0)); |
// // |
549 |
// }; |
// pointer = (char*)cl->UncheckedAt(j); |
550 |
// j++; |
// pu = pointer + thisoffset; |
551 |
// }; |
// arr = (TArrayF*)(pu); |
552 |
// } else { |
// // |
553 |
// while ( j < length ){ |
// while ( jj < arlen ){ |
554 |
// if ( j < length -1 ){ |
// if ( jj < arlen-1 ){ |
555 |
// printf(" %f ,",tb->GetValue(j,0)); |
// sprintf(o,"%s %f ,",o,arr->At(jj)); |
556 |
// } else { |
// } else { |
557 |
// printf(" %f",tb->GetValue(j,0)); |
// sprintf(o,"%s %f",o,arr->At(jj)); |
558 |
|
// }; |
559 |
|
// jj++; |
560 |
// }; |
// }; |
561 |
|
// if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); |
562 |
// j++; |
// j++; |
563 |
// }; |
// }; |
564 |
// }; |
// }; |
565 |
// printf("\n"); |
// sprintf(o,"%s\n",o); |
566 |
|
// |
567 |
|
sprintf(o,"%s TArray - not implemented yet -",o); |
568 |
|
// |
569 |
|
}; |
570 |
|
// |
571 |
|
sprintf(o,"%s\n",o); |
572 |
|
break; |
573 |
|
case 3: |
574 |
|
// |
575 |
|
// IS A TCLONESARRAY |
576 |
|
// |
577 |
|
setcolor(col,RESET, BLUE, WHITE); |
578 |
|
setcolor(col2,RESET, BLACK, WHITE); |
579 |
|
sprintf(o,"%s%s %-15s%s = %d\n",o,col,tb->GetName(), col2, tb->GetNdata()); |
580 |
|
|
581 |
|
// |
582 |
|
if ( tb->GetNdata() ){ |
583 |
|
// |
584 |
|
TClonesArray *cl = (TClonesArray*)tb->GetObject(); |
585 |
|
// |
586 |
|
TClass *myc = cl->GetClass(); |
587 |
|
// |
588 |
|
TList *lme = myc->GetListOfDataMembers(); |
589 |
|
TIter next(lme); |
590 |
|
TBranchElement *tb2 = 0; |
591 |
|
// |
592 |
|
while ( (tb2 = (TBranchElement*)next()) ){ |
593 |
|
// |
594 |
|
const char *name = tb2->GetName(); |
595 |
|
TBranch *foglia = tb->FindBranch(name); |
596 |
|
if ( foglia ){ |
597 |
|
// |
598 |
|
TBranchElement *stb = (TBranchElement*)tb->FindBranch(name); |
599 |
|
Int_t stype = stb->GetType(); |
600 |
|
Int_t satype = stb->GetStreamerType() - 20; |
601 |
|
Int_t slen = (stb->GetInfo()->GetLengths())[stb->GetID()]; |
602 |
|
Int_t slength = min(slen,dlen); |
603 |
|
// printf("SubBranches : atype is %i type is %i tb getname %s slen %i slength %i\n",satype,stype,stb->GetName(),slen,slength); |
604 |
|
switch (stype){ |
605 |
|
case 31: |
606 |
|
// |
607 |
|
// IS A VARIABLE |
608 |
|
// |
609 |
|
// |
610 |
|
// NAME |
611 |
|
// |
612 |
|
j = 0; |
613 |
|
// |
614 |
|
// VALUES |
615 |
|
// |
616 |
|
if ( satype == 41 || satype == 44){ |
617 |
|
// |
618 |
|
// skip TRef |
619 |
|
// |
620 |
|
break; |
621 |
|
}; |
622 |
|
// |
623 |
|
// Integer |
624 |
|
// |
625 |
|
if ( satype == -17 || satype == -9 ){ |
626 |
|
// |
627 |
|
setcolor(col,RESET, BLUE, WHITE); |
628 |
|
setcolor(col2,RESET, BLACK, WHITE); |
629 |
|
sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2); |
630 |
|
while ( j < cl->GetEntriesFast() ){ |
631 |
|
if ( j < cl->GetEntriesFast() -1 ){ |
632 |
|
sprintf(o,"%s %i ,",o,(Int_t)stb->GetValue(j,slength)); |
633 |
|
} else { |
634 |
|
sprintf(o,"%s %i",o,(Int_t)stb->GetValue(j,slength)); |
635 |
|
}; |
636 |
|
j++; |
637 |
|
}; |
638 |
|
}; |
639 |
|
// |
640 |
|
// Float |
641 |
|
// |
642 |
|
if ( satype == -15 ){ |
643 |
|
// |
644 |
|
setcolor(col,RESET, BLUE, WHITE); |
645 |
|
setcolor(col2,RESET, BLACK, WHITE); |
646 |
|
sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2); |
647 |
|
while ( j < cl->GetEntriesFast() ){ |
648 |
|
if ( j < cl->GetEntriesFast() -1 ){ |
649 |
|
sprintf(o,"%s %f ,",o,stb->GetValue(j,slength)); |
650 |
|
} else { |
651 |
|
sprintf(o,"%s %f",o,stb->GetValue(j,slength)); |
652 |
|
}; |
653 |
|
j++; |
654 |
|
}; |
655 |
|
}; |
656 |
|
// |
657 |
|
// Array of float |
658 |
|
// |
659 |
|
if ( satype == 5 ){ |
660 |
|
// |
661 |
|
setcolor(col,RESET, BLUE, WHITE); |
662 |
|
setcolor(col2,RESET, BLACK, WHITE); |
663 |
|
sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2); |
664 |
|
Bool_t bold = true; |
665 |
|
while ( j < tb->GetNdata() ){ |
666 |
|
if ( bold ){ |
667 |
|
setcolor(col,RESET, BLACK, WHITE); |
668 |
|
sprintf(o,"%s%s",o,col); |
669 |
|
} else { |
670 |
|
setcolor(col,BOLD, BLACK, WHITE); |
671 |
|
sprintf(o,"%s%s",o,col); |
672 |
|
}; |
673 |
|
Int_t jj = 0; |
674 |
|
while ( jj < slength ){ |
675 |
|
if ( jj < slength-1 ){ |
676 |
|
sprintf(o,"%s %f ,",o,stb->GetValue(j,jj,true)); |
677 |
|
} else { |
678 |
|
sprintf(o,"%s %f",o,stb->GetValue(j,jj,true)); |
679 |
|
}; |
680 |
|
jj++; |
681 |
|
}; |
682 |
|
if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); |
683 |
|
if ( !bold ){ |
684 |
|
bold = true; |
685 |
|
} else { |
686 |
|
bold = false; |
687 |
|
}; |
688 |
|
j++; |
689 |
|
}; |
690 |
|
if ( bold ){ |
691 |
|
setcolor(col,RESET, BLACK, WHITE); |
692 |
|
sprintf(o,"%s%s",o,col); |
693 |
|
}; |
694 |
|
}; |
695 |
|
// |
696 |
|
// Array of integers |
697 |
|
// |
698 |
|
if ( satype == 3 ){ |
699 |
|
// |
700 |
|
setcolor(col,RESET, BLUE, WHITE); |
701 |
|
setcolor(col2,RESET, BLACK, WHITE); |
702 |
|
sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2); |
703 |
|
while ( j < tb->GetNdata() ){ |
704 |
|
Int_t jj = 0; |
705 |
|
while ( jj < slength ){ |
706 |
|
if ( jj < slength-1 ){ |
707 |
|
sprintf(o,"%s %i ,",o,(Int_t)stb->GetValue(j,jj,true)); |
708 |
|
} else { |
709 |
|
sprintf(o,"%s %i",o,(Int_t)stb->GetValue(j,jj,true)); |
710 |
|
}; |
711 |
|
jj++; |
712 |
|
}; |
713 |
|
if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); |
714 |
|
j++; |
715 |
|
}; |
716 |
|
}; |
717 |
|
|
718 |
|
// |
719 |
|
// TArray |
720 |
|
// |
721 |
|
if ( satype == 42 ){ |
722 |
|
// |
723 |
|
// determine offset to fetch data |
724 |
|
// |
725 |
|
int thisoffset = 0; |
726 |
|
TRealData *rd = myc->GetRealData(foglia->GetName()); |
727 |
|
if ( rd ){ |
728 |
|
thisoffset = rd->GetThisOffset(); |
729 |
|
}; |
730 |
|
Int_t niente = 0; |
731 |
|
TStreamerElement *tste = stb->GetInfo()->GetStreamerElement(rd->GetName(),niente); |
732 |
|
// |
733 |
|
// TArrayI |
734 |
|
// |
735 |
|
if ( !strcmp(tste->GetTypeName(),"TArrayI") ){ |
736 |
|
// |
737 |
|
char *pointer = (char*)cl->UncheckedAt(0); |
738 |
|
char *pu = pointer + thisoffset; |
739 |
|
TArrayI *arr = (TArrayI*)(pu); |
740 |
|
Int_t jj=0; |
741 |
|
Int_t arlen = min(arr->GetSize(),dlen); |
742 |
|
// |
743 |
|
setcolor(col,RESET, BLUE, WHITE); |
744 |
|
setcolor(col2,RESET, BLACK, WHITE); |
745 |
|
sprintf(o,"%s%s %s[%i]%s = ",o,col,foglia->GetName(),arr->GetSize(),col2); |
746 |
|
// |
747 |
|
while ( j < tb->GetNdata() ){ |
748 |
|
// |
749 |
|
pointer = (char*)cl->UncheckedAt(j); |
750 |
|
pu = pointer + thisoffset; |
751 |
|
arr = (TArrayI*)(pu); |
752 |
|
// |
753 |
|
while ( jj < arlen ){ |
754 |
|
if ( jj < arlen-1 ){ |
755 |
|
sprintf(o,"%s %i ,",o,arr->At(jj)); |
756 |
|
} else { |
757 |
|
sprintf(o,"%s %i",o,arr->At(jj)); |
758 |
|
}; |
759 |
|
jj++; |
760 |
|
}; |
761 |
|
if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); |
762 |
|
j++; |
763 |
|
}; |
764 |
|
}; |
765 |
|
// |
766 |
|
// TArrayF |
767 |
|
// |
768 |
|
if ( !strcmp(tste->GetTypeName(),"TArrayF") ){ |
769 |
|
// |
770 |
|
char *pointer = (char*)cl->UncheckedAt(0); |
771 |
|
char *pu = pointer + thisoffset; |
772 |
|
TArrayF *arr = (TArrayF*)(pu); |
773 |
|
Int_t jj=0; |
774 |
|
Int_t arlen = min(arr->GetSize(),dlen); |
775 |
|
// |
776 |
|
setcolor(col,RESET, BLUE, WHITE); |
777 |
|
setcolor(col2,RESET, BLACK, WHITE); |
778 |
|
sprintf(o,"%s%s %s[%i]%s = ",o,col,foglia->GetName(),arr->GetSize(),col2); |
779 |
|
// |
780 |
|
while ( j < tb->GetNdata() ){ |
781 |
|
// |
782 |
|
pointer = (char*)cl->UncheckedAt(j); |
783 |
|
pu = pointer + thisoffset; |
784 |
|
arr = (TArrayF*)(pu); |
785 |
|
// |
786 |
|
while ( jj < arlen ){ |
787 |
|
if ( jj < arlen-1 ){ |
788 |
|
sprintf(o,"%s %f ,",o,arr->At(jj)); |
789 |
|
} else { |
790 |
|
sprintf(o,"%s %f",o,arr->At(jj)); |
791 |
|
}; |
792 |
|
jj++; |
793 |
|
}; |
794 |
|
if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); |
795 |
|
j++; |
796 |
|
}; |
797 |
|
}; |
798 |
|
}; |
799 |
|
sprintf(o,"%s\n",o); |
800 |
|
break; |
801 |
|
}; |
802 |
|
}; |
803 |
|
}; |
804 |
|
}; |
805 |
break; |
break; |
806 |
}; |
}; |
807 |
// b3 = (TBranch*)branch_array->At(l); |
}; |
808 |
// leaf_array = b1->GetListOfLeaves(); |
// pamgui->DIALOG(0,o); |
809 |
// 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)); |
|
|
// }; |
|
|
// }; |
|
|
|
|
|
}; |
|
|
|
|
810 |
}; |
}; |
811 |
|
|
812 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
813 |
void FEVdetector::GetGeneralInfo(){ |
void FEVdetector::GetGeneralInfo(){ |
814 |
// |
// |
815 |
// Get Orbital Time information and header event number |
// Get Orbital Time information and header event number |
819 |
headcold = headc; |
headcold = headc; |
820 |
headc = ph->Counter; |
headc = ph->Counter; |
821 |
var.headc = (int)ph->Counter; |
var.headc = (int)ph->Counter; |
822 |
OBT = ph->OrbitalTime; |
OBT = (UInt_t)ph->OrbitalTime; |
823 |
DOBT = OBT - OOBT; |
DOBT = OBT - OOBT; |
824 |
OOBT = OBT; |
OOBT = OBT; |
825 |
if ( thisentry == minevent || DOBT < 0 || (headc-headcold-1)!=0 ) DOBT = 0; |
if ( thisentry == minevent || DOBT < 0 || (headc-headcold-1)!=0 ) DOBT = 0; |
1008 |
// |
// |
1009 |
} |
} |
1010 |
|
|
1011 |
Int_t FEVdetector::Load(TTree &mainotr, TFile &mainfile){ |
TChain* FEVdetector::Load(TFile &mainfile){ |
1012 |
//Int_t FEVdetector::Load(TChain &mainotr, TFile &mainfile){ |
// |
1013 |
file = &mainfile; |
file = &mainfile; |
1014 |
otr = &mainotr; |
// |
1015 |
L2 = new PamLevel2(); |
if ( !L2 ) L2 = new PamLevel2(); |
1016 |
// |
// |
1017 |
if ( level.file == 2 ){ |
if ( level.file == 2 ){ |
1018 |
// otr = L2->LoadPamTrees(file); |
// |
1019 |
printf(" %s \n",ddec.Data()); |
printf(" %s \n",ddec.Data()); |
1020 |
// otr->Refresh(); |
otr = L2->GetPamTree(gSystem->DirName(file->GetName()),file->GetName(),ddec.Data()); |
1021 |
// otr->Clear(); |
runtree = L2->GetRunTree(gSystem->DirName(file->GetName()),file->GetName()); |
|
// otr = new TTree(); |
|
|
otr = L2->GetPamTree(file,ddec.Data()); |
|
1022 |
// |
// |
1023 |
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/"; |
|
1024 |
// |
// |
1025 |
//L2->GetTrkLevel2()->LoadField(magfie.str().c_str()); |
otr->CanDeleteRefs(true); |
1026 |
|
if ( runtree ) runtree->CanDeleteRefs(true); |
1027 |
|
// |
1028 |
} else { |
} else { |
1029 |
// |
// |
1030 |
// load calorimeter ADC2MIP conversion file |
// load calorimeter ADC2MIP conversion file |
1065 |
}; |
}; |
1066 |
// |
// |
1067 |
// |
// |
1068 |
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(); |
|
1069 |
// |
// |
1070 |
if ( level.file == 0 || level.file == -1 ){ |
if ( level.file == 0 || level.file == -1 ){ |
1071 |
|
// |
1072 |
|
trigger = new pamela::trigger::TriggerEvent(); |
1073 |
|
eh = new pamela::EventHeader(); |
1074 |
|
ph = new pamela::PscuHeader(); |
1075 |
|
de = new pamela::calorimeter::CalorimeterEvent(); |
1076 |
|
trk = new pamela::tracker::TrackerEvent(); |
1077 |
|
ne = new pamela::neutron::NeutronEvent(); |
1078 |
|
ace = new pamela::anticounter::AnticounterEvent(); |
1079 |
|
s4 = new pamela::S4::S4Event(); |
1080 |
|
tof = new pamela::tof::TofEvent(); |
1081 |
|
// |
1082 |
|
otr = new TChain("Physics"); |
1083 |
|
otr->Add(file->GetName(),-1); |
1084 |
otr->SetBranchAddress("Trigger", &trigger); |
otr->SetBranchAddress("Trigger", &trigger); |
1085 |
otr->SetBranchAddress("Header", &eh); |
otr->SetBranchAddress("Header", &eh); |
1086 |
}; |
}; |
|
if ( level.file == 2 && var.RUN){ |
|
|
// otr->AddFriend("OrbitalInfo", file); |
|
|
// otr->SetBranchAddress("OrbitalInfo", &oinfoL2); |
|
|
runinfo->Read(0ULL); |
|
|
}; |
|
1087 |
// |
// |
1088 |
if ( var.TRK ) { |
if ( var.TRK ) { |
1089 |
if ( level.file == 0 || level.file == -1 ){ |
if ( level.file == 0 || level.file == -1 ){ |
1156 |
}; |
}; |
1157 |
}; |
}; |
1158 |
// |
// |
1159 |
// printf("qua\n"); |
if ( !otr ){ |
1160 |
return(1); |
return(0); |
1161 |
|
}; |
1162 |
|
// |
1163 |
|
return otr; |
1164 |
// |
// |
1165 |
} |
} |
1166 |
|
|
1236 |
text->DrawLatex(0.33,txthi,testo.str().c_str()); |
text->DrawLatex(0.33,txthi,testo.str().c_str()); |
1237 |
txthi -= 0.03; |
txthi -= 0.03; |
1238 |
testo2.str(""); |
testo2.str(""); |
1239 |
testo2 << "On Board Time: " << (int)OBT; |
testo2 << "On Board Time: " << (unsigned int)OBT; |
1240 |
if ( DOBT > 0 ) { |
if ( DOBT > 0 ) { |
1241 |
testo2 << " (delta: " << (int)DOBT; |
testo2 << " (delta: " << (unsigned int)DOBT; |
1242 |
testo2 << ")"; |
testo2 << ")"; |
1243 |
}; |
}; |
1244 |
testo2 << " [ms]"; |
testo2 << " [ms]"; |
1856 |
void FEVdetector::ShowTOF(){ |
void FEVdetector::ShowTOF(){ |
1857 |
// |
// |
1858 |
// |
// |
|
// |
|
1859 |
if ( !var.TOF ) return; |
if ( !var.TOF ) return; |
1860 |
// |
// |
1861 |
Int_t tt = 0; |
Int_t tt = 0; |
2656 |
// |
// |
2657 |
Bool_t repeat = true; |
Bool_t repeat = true; |
2658 |
Int_t numtr = 1; |
Int_t numtr = 1; |
2659 |
|
// Int_t numtr = 0; |
2660 |
Int_t repuntil = 0; |
Int_t repuntil = 0; |
2661 |
// |
// |
2662 |
// |
// |
2664 |
// |
// |
2665 |
if ( level.file == 2 ) repuntil = L2->GetToFLevel2()->ntrk(); |
if ( level.file == 2 ) repuntil = L2->GetToFLevel2()->ntrk(); |
2666 |
// printf("repuntil = %i \n",repuntil); |
// printf("repuntil = %i \n",repuntil); |
2667 |
|
//if ( level.file == 2 ) repuntil = L2->GetTrkLevel2()->GetNTracks(); |
2668 |
//repuntil = L2->GetNTracks(); |
//repuntil = L2->GetNTracks(); |
2669 |
// |
// |
2670 |
while ( repeat ){ |
while ( repeat ){ |
2674 |
// |
// |
2675 |
// |
// |
2676 |
ToFTrkVar *ptt = 0; |
ToFTrkVar *ptt = 0; |
2677 |
|
// PamTrack *ptrack = 0; |
2678 |
|
Float_t adc[4][12]; |
2679 |
|
Float_t tdc[4][12]; |
2680 |
|
memset(adc,0,4*12*sizeof(Float_t)); |
2681 |
|
memset(tdc,0,4*12*sizeof(Float_t)); |
2682 |
// |
// |
2683 |
// |
// |
2684 |
|
// if ( repuntil == 0 || var.tofraw ){ |
2685 |
if ( repuntil == 1 || var.tofraw ){ |
if ( repuntil == 1 || var.tofraw ){ |
2686 |
numtr = 0; |
numtr = 0; |
2687 |
ptt = L2->GetToFLevel2()->GetToFTrkVar(0); |
ptt = L2->GetToFLevel2()->GetToFTrkVar(0); |
2691 |
// |
// |
2692 |
if ( numtr >= repuntil-1 ) repeat = false; |
if ( numtr >= repuntil-1 ) repeat = false; |
2693 |
// |
// |
2694 |
ptt = L2->GetToFLevel2()->GetToFTrkVar(numtr); |
// printf(" numtr is %i \n",numtr); |
2695 |
|
ptt = L2->GetToFLevel2()->GetToFTrkVar(numtr); |
2696 |
|
//ptrack = L2->GetTrack(numtr); |
2697 |
|
//ptt = ptrack->GetToFTrack(); |
2698 |
}; |
}; |
2699 |
// |
// |
2700 |
xp11[0] = 0.; |
xp11[0] = 0.; |
2708 |
// |
// |
2709 |
ii = 2; |
ii = 2; |
2710 |
// |
// |
2711 |
Float_t adc[4][12]; |
Int_t myseq = ptt->trkseqno + 1; |
2712 |
Float_t tdc[4][12]; |
L2->GetToFLevel2()->GetMatrix(myseq,adc,tdc); |
2713 |
L2->GetToFLevel2()->GetMatrix(numtr,adc,tdc); |
// |
2714 |
|
// printf(" qua \n"); |
2715 |
// |
// |
2716 |
for ( Int_t i = 0; i<8; i++ ) { |
for ( Int_t i = 0; i<8; i++ ) { |
2717 |
if ( adc[ch11a[i]][hb11a[i]] < 1000. ){ |
if ( adc[ch11a[i]][hb11a[i]] < 1000. ){ |
5188 |
// first of all plot crosses relatives to tracks |
// first of all plot crosses relatives to tracks |
5189 |
// |
// |
5190 |
if ( L2->GetTrkLevel2()->GetNTracks() > 0 ){ |
if ( L2->GetTrkLevel2()->GetNTracks() > 0 ){ |
5191 |
|
// for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ |
5192 |
|
// TrkTrack *track = L2->GetTrkLevel2()->GetTrack(nt); |
5193 |
for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ |
for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ |
5194 |
TrkTrack *track = L2->GetTrkLevel2()->GetTrack(nt); |
PamTrack *ptrack= L2->GetTrack(nt); |
5195 |
|
TrkTrack *track = ptrack->GetTrkTrack(); |
5196 |
|
// |
5197 |
for (Int_t plane = 0; plane<6; plane++){ |
for (Int_t plane = 0; plane<6; plane++){ |
5198 |
// |
// |
5199 |
x = track->xm[plane]; |
x = track->xm[plane]; |
5509 |
// |
// |
5510 |
// |
// |
5511 |
// |
// |
5512 |
if ( var.CALO && false ){ |
if ( var.CALO && var.CALOT ){ |
5513 |
if ( L2->GetCaloLevel2()->npcfit[0] > 0 && L2->GetCaloLevel2()->npcfit[1] > 0 ){ |
if ( L2->GetCaloLevel2()->npcfit[0] > 0 && L2->GetCaloLevel2()->npcfit[1] > 0 ){ |
5514 |
Float_t calx[22]; |
Float_t calx[22]; |
5515 |
Float_t caly[22]; |
Float_t caly[22]; |
5935 |
// |
// |
5936 |
// Define variables |
// Define variables |
5937 |
// |
// |
5938 |
Int_t etime = var.etime; |
UInt_t etime = var.etime; |
5939 |
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]; |
5940 |
Int_t badstrip = 0; |
Int_t badstrip = 0; |
5941 |
qtot = 0.; |
qtot = 0.; |
6007 |
if ( calib.ttime[s][b[s]+1] && calib.time[s][b[s]] ){ |
if ( calib.ttime[s][b[s]+1] && calib.time[s][b[s]] ){ |
6008 |
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 ){ |
6009 |
printf(" CALORIMETER: \n" ); |
printf(" CALORIMETER: \n" ); |
6010 |
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]); |
6011 |
printf(" END CALORIMETER. \n\n" ); |
printf(" END CALORIMETER. \n\n" ); |
6012 |
b[s]++; |
b[s]++; |
6013 |
CaloPede(s); |
CaloPede(s); |
6312 |
for (Int_t d = 0; d<48; d++){ |
for (Int_t d = 0; d<48; d++){ |
6313 |
if ( calib.ttime[s][d] != 0 ) calibex++; |
if ( calib.ttime[s][d] != 0 ) calibex++; |
6314 |
if ( calib.time[s][0] != 0 ){ |
if ( calib.time[s][0] != 0 ){ |
6315 |
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]); |
6316 |
if ( calib.time[s][d+1] != 0 ) { |
if ( calib.time[s][d+1] != 0 ) { |
6317 |
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]); |
6318 |
} else { |
} else { |
6319 |
if ( !stop ){ |
if ( !stop ){ |
6320 |
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]); |
6321 |
stop = 1; |
stop = 1; |
6322 |
}; |
}; |
6323 |
}; |
}; |
6324 |
} else { |
} else { |
6325 |
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]); |
6326 |
}; |
}; |
6327 |
}; |
}; |
6328 |
printf("\n"); |
printf("\n"); |
6387 |
calib.ttime[s][inter] = 0; |
calib.ttime[s][inter] = 0; |
6388 |
if ( ce->cstwerr[s] != 0 && ce->cperror[s] == 0 ) { |
if ( ce->cstwerr[s] != 0 && ce->cperror[s] == 0 ) { |
6389 |
//calib.ttime[s][inter] = cph->GetOrbitalTime(); |
//calib.ttime[s][inter] = cph->GetOrbitalTime(); |
6390 |
calib.ttime[s][inter] = cph->OrbitalTime; |
calib.ttime[s][inter] = (UInt_t)cph->OrbitalTime; |
6391 |
inter++; |
inter++; |
6392 |
} else { |
} else { |
6393 |
if ( ce->cstwerr[s] != 0 && ce->cperror[s] != 0 ) { |
if ( ce->cstwerr[s] != 0 && ce->cperror[s] != 0 ) { |
6441 |
tr->GetEntry(ci); |
tr->GetEntry(ci); |
6442 |
cph = ceh->GetPscuHeader(); |
cph = ceh->GetPscuHeader(); |
6443 |
//if ( atime == cph->GetOrbitalTime()){ |
//if ( atime == cph->GetOrbitalTime()){ |
6444 |
if ( atime == cph->OrbitalTime){ |
if ( atime == (UInt_t)cph->OrbitalTime){ |
6445 |
// calib.iev = ce->iev; |
// calib.iev = ce->iev; |
6446 |
if (ce->cstwerr[s] != 0 && ce->cperror[s] == 0 ) { |
if (ce->cstwerr[s] != 0 && ce->cperror[s] == 0 ) { |
6447 |
for ( Int_t d=0 ; d<11 ;d++ ){ |
for ( Int_t d=0 ; d<11 ;d++ ){ |