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.S4 = 0; |
var.S4 = 0; |
178 |
} |
} |
179 |
|
|
180 |
void FEVdetector::GetEntry(Int_t i){ |
void FEVdetector::GetEntry(Int_t i){ |
181 |
thisentry = i; |
thisentry = i; |
182 |
otr->GetEntry(i); |
if ( level.file == 2 ){ |
183 |
// if ( level.file == 2 ){ |
L2->GetEntry(i); |
184 |
// ShowInfo("TrkLevel2"); |
ShowInfo("RunInfo"); |
185 |
// ShowInfo("ToFLevel2"); |
ShowInfo("SoftInfo"); |
186 |
// ShowInfo("CaloLevel2"); |
ShowInfo("TrigLevel2"); |
187 |
// }; |
ShowInfo("OrbitalInfo"); |
188 |
// PrintData(otr,-1LL,44); |
ShowInfo("ToFLevel2"); |
189 |
|
ShowInfo("TrkLevel2"); |
190 |
|
ShowInfo("AcLevel2"); |
191 |
|
ShowInfo("CaloLevel2"); |
192 |
|
ShowInfo("CaloLevel1"); |
193 |
|
ShowInfo("S4Level2"); |
194 |
|
ShowInfo("NDLevel2"); |
195 |
|
} else { |
196 |
|
otr->GetEntry(i); |
197 |
|
}; |
198 |
} |
} |
199 |
|
|
200 |
void FEVdetector::SetEntry(Int_t i){ |
void FEVdetector::SetEntry(Int_t i){ |
315 |
}; |
}; |
316 |
} |
} |
317 |
|
|
|
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"); |
|
|
}; |
|
|
|
|
|
|
|
318 |
void FEVdetector::ShowInfo(TString detector){ |
void FEVdetector::ShowInfo(TString detector){ |
319 |
// |
// |
320 |
TBranch *b1 = 0; |
TBranch *b1 = 0; |
321 |
TBranch *b3 = 0; |
// TBranch *b3 = 0; |
322 |
TObjArray *branch_array = 0; |
TObjArray *branch_array = 0; |
323 |
TObjArray *leaf_array = 0; |
// TObjArray *leaf_array = 0; |
324 |
|
// |
325 |
|
if ( !strcmp(detector.Data(),"RunInfo") || !strcmp(detector.Data(),"SoftInfo") ){ |
326 |
|
if ( runtree ) b1 = runtree->FindBranch(detector.Data()); |
327 |
|
} else { |
328 |
|
b1 = otr->FindBranch(detector.Data()); |
329 |
|
}; |
330 |
|
// |
331 |
|
if ( !b1 ) return; |
332 |
|
// |
333 |
|
Int_t dlen = 10; |
334 |
|
// |
335 |
|
char o[200000]; |
336 |
|
char col[13]; |
337 |
|
char col2[13]; |
338 |
// |
// |
339 |
b1 = otr->FindBranch(detector.Data()); |
setcolor(col,RESET, GREEN, WHITE); |
340 |
Int_t dlen = 44; |
sprintf(o,"%s======> EVENT:%i\n",col, thisentry); |
341 |
// |
// |
342 |
printf("======> EVENT:%i\n", thisentry); |
setcolor(col,RESET, RED, WHITE); |
343 |
|
sprintf(o,"%s%sBranch %s\n",o,col,b1->GetName()); |
344 |
|
setcolor(col,RESET, BLACK, WHITE); |
345 |
|
sprintf(o,"%s%s",o,col); |
346 |
// |
// |
|
printf("Branch %s\n",b1->GetName()); |
|
347 |
branch_array = b1->GetListOfBranches(); |
branch_array = b1->GetListOfBranches(); |
348 |
// |
// |
349 |
Int_t j = 0; |
Int_t j = 0; |
355 |
Int_t atype = tb->GetStreamerType() - 20; |
Int_t atype = tb->GetStreamerType() - 20; |
356 |
Int_t len = (tb->GetInfo()->GetLengths())[tb->GetID()]; |
Int_t len = (tb->GetInfo()->GetLengths())[tb->GetID()]; |
357 |
Int_t length = min(len,dlen); |
Int_t length = min(len,dlen); |
358 |
// printf("SubBranches : %s type is %i tb getname %s\n",((TBranch*)branch_array->At(l))->GetName(),type,tb->GetName()); |
// |
359 |
|
// printf("Branches : type is %i type is %i tb getname %s slen %i slength %i\n",atype,type,tb->GetName(),len,length); |
360 |
switch (type){ |
switch (type){ |
361 |
case 0: |
case 0: |
362 |
// |
// |
365 |
// |
// |
366 |
// NAME |
// NAME |
367 |
// |
// |
368 |
// printf(" ATYPE IS %i \n",atype); |
setcolor(col,RESET, BLUE, WHITE); |
369 |
printf(" %-15s =",((TBranch*)branch_array->At(l))->GetName()); |
setcolor(col2,RESET, BLACK, WHITE); |
370 |
|
sprintf(o,"%s%s %-15s%s =",o,col,((TBranch*)branch_array->At(l))->GetName(),col2); |
371 |
|
// |
372 |
j = 0; |
j = 0; |
373 |
// |
// |
374 |
// VALUES |
// VALUES |
375 |
// |
// |
376 |
|
// |
377 |
|
// Integer |
378 |
|
// |
379 |
if ( atype == 3 || atype == -17 ){ |
if ( atype == 3 || atype == -17 ){ |
380 |
while ( j < length ){ |
while ( j < length ){ |
381 |
if ( j < length -1 ){ |
if ( j < length -1 ){ |
382 |
printf(" %llu ,",(ULong64_t)tb->GetValue(j,0)); |
sprintf(o,"%s %i ,",o,(Int_t)tb->GetValue(j,0)); |
383 |
} else { |
} else { |
384 |
printf(" %llu",(ULong64_t)tb->GetValue(j,0)); |
sprintf(o,"%s %i",o,(Int_t)tb->GetValue(j,0)); |
385 |
}; |
}; |
386 |
j++; |
j++; |
387 |
}; |
}; |
388 |
} else { |
}; |
389 |
|
// |
390 |
|
// Unsigned integer |
391 |
|
// |
392 |
|
if ( atype == -7 || atype == 13 ){ |
393 |
while ( j < length ){ |
while ( j < length ){ |
394 |
if ( j < length -1 ){ |
if ( j < length -1 ){ |
395 |
printf(" %f ,",tb->GetValue(j,0)); |
sprintf(o,"%s %i ,",o,(UInt_t)tb->GetValue(j,0)); |
396 |
} else { |
} else { |
397 |
printf(" %f",tb->GetValue(j,0)); |
sprintf(o,"%s %i",o,(UInt_t)tb->GetValue(j,0)); |
398 |
}; |
}; |
399 |
j++; |
j++; |
400 |
}; |
}; |
401 |
}; |
}; |
|
printf("\n"); |
|
|
break; |
|
|
case 3: |
|
402 |
// |
// |
403 |
// IS A TCLONESARRAY |
// Float |
|
// |
|
|
printf(" %-15s = %d\n", tb->GetName(), tb->GetNdata()); |
|
404 |
// |
// |
405 |
if ( tb->GetNdata() ){ |
if ( atype == -15 || atype == 5 ){ |
406 |
|
while ( j < length ){ |
407 |
printf(" auiauiaui\n"); |
if ( j < length -1 ){ |
408 |
TClonesArray *cl = (TClonesArray*)tb->GetObject(); |
sprintf(o,"%s %f ,",o,tb->GetValue(j,0)); |
409 |
// |
} else { |
410 |
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(); |
|
411 |
}; |
}; |
412 |
|
j++; |
413 |
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; |
|
|
// }; |
|
|
}; |
|
|
|
|
|
}; |
|
414 |
}; |
}; |
415 |
|
// |
416 |
|
// Strings |
417 |
|
// |
418 |
|
if ( atype == 45 ){ |
419 |
// TBranchElement *p=(TBranchElement*)cl->At(ll); |
// TString *stringa = (TString*)(tb->GetValuePointer()); |
420 |
// Int_t plen = (p->GetInfo()->GetLengths())[p->GetID()]; |
// int pointer = (tb->GetInfo()->GetOffsets())[tb->GetID()]; |
421 |
// Int_t plen = -1; |
// TString *stringa = (TString*)(tb->GetInfo()->GetOffsets())[tb->GetID()]; |
422 |
// printf("SubBranches : %s plen is %i \n",p->GetName(),plen); |
// TString *stringa = (TString*)tb->GetAddress(); |
423 |
|
// printf(" address 0x%X \n",tb->GetAddress()); |
424 |
|
// printf(" pointer 0x%X \n",tb->GetValuePointer()); |
425 |
|
// printf(" object 0x%X \n",tb->GetObject()); |
426 |
|
// printf("stringa %s lung %i\n",stringa->Data(),stringa->Length()); |
427 |
// TLeafElement* leaf = (TLeafElement*)(p->UncheckedAt(0)); |
// TLeaf *striglia = tb->FindLeaf(tb->GetName()); |
428 |
// printf("xoxoxo leaf : %s plen is %i \n",leaf->GetName(),leaf->GetLen()); |
// if ( striglia ){ |
429 |
|
// char *pointer = (char *)striglia->GetValuePointer(); |
430 |
// Int_t n = tb->GetNdata(); |
// TString *pr= (TString*)pointer; |
431 |
// n = n * leaf->GetLenStatic(); |
// printf("ciao %s \n",pr->Data()); |
432 |
// if (tb->GetInfo()) { |
// }; |
433 |
// n = 16; |
sprintf(o,"%s TString ",o); |
434 |
// tb->GetInfo()->PrintValue(tb->GetName(), tb->GetAddress(), atype, n, 44); |
}; |
435 |
//tb->GetObject()->GetInfo()->PrintValue(tb->GetName(), tb->GetObject(), atype, n, lenmax); |
// |
436 |
// } |
// TArray |
437 |
|
// |
438 |
// TClonesArray* clones = (TClonesArray*) cl->At(ll); |
if ( atype == 42 ){ |
439 |
// if ( tb->GetInfo() ) { |
// |
440 |
// tb->GetInfo()->PrintValueClones(tb->GetName(), cl, tb->GetID(), tb->GetOffset(), 44); |
// TObjArray *cl = (TObjArray*)tb->GetObject(); |
|
// }; |
|
|
|
|
|
// b3 = (TBranch*)cl->At(l); |
|
|
// leaf_array = b3->GetListOfLeaves(); |
|
|
// for(Int_t l=0;l<(leaf_array->GetLast());l++){ |
|
|
// printf("Leaf : %s\n",((TLeaf*)leaf_array->At(l))->GetName()); |
|
|
|
|
|
|
|
|
// // TBranch *bcl = (TBranch*)leaf_array->At(l); |
|
|
// //bcl = b1->GetListOfLeaves(); |
|
|
// //for(Int_t l=0;l<(leaf_array->GetLast()+1);l++){ |
|
|
// // 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++){ |
|
441 |
// // |
// // |
442 |
|
// TClass *myc = cl->IsA(); |
443 |
// // |
// // |
444 |
// // }; |
// printf("qui \n"); |
445 |
|
// // |
446 |
// TBranchElement *tb2 = (TBranchElement*)cl->UncheckedAt(ln); |
// // determine offset to fetch data |
447 |
// Int_t type2 = tb2->GetType(); |
// // |
448 |
// Int_t atype2 = tb2->GetStreamerType() - 20; |
// int thisoffset = 0; |
449 |
// Int_t len2 = (tb2->GetInfo()->GetLengths())[tb2->GetID()]; |
// TRealData *rd = myc->GetRealData(tb->GetName()); |
450 |
// Int_t length2 = min(len2,dlen); |
// if ( rd ){ |
451 |
// printf("SubSubBranches : %s type is %i \n",tb2->GetName(),type2); |
// thisoffset = rd->GetThisOffset(); |
452 |
|
// }; |
453 |
// switch (type2){ |
// Int_t niente = 0; |
454 |
// case 0: |
// TStreamerElement *tste = tb->GetInfo()->GetStreamerElement(rd->GetName(),niente); |
455 |
// // |
// printf(" typename %s \n",tste->GetTypeName()); |
456 |
// // IS A VARIABLE |
// // |
457 |
|
// // TArrayI |
458 |
|
// // |
459 |
|
// if ( !strcmp(tste->GetTypeName(),"TArrayI") ){ |
460 |
// // |
// // |
461 |
|
// printf("qua \n"); |
462 |
|
// char *pointer = (char*)cl->At(0); |
463 |
|
// // char *pu = thisoffset + pointer; |
464 |
|
// int pu = (int)tste->GetTObjectOffset(); |
465 |
|
// TArrayI arr = (TArrayI)*pu; |
466 |
|
// // TArrayI arr = (TArrayI)(thisoffset); |
467 |
|
// //TArrayI *arr = (TArrayI*)pu; |
468 |
|
// //TArraI arr = (TArrayI) |
469 |
|
// Int_t jj=0; |
470 |
|
// j=0; |
471 |
|
// printf("quii \n"); |
472 |
|
// Int_t arlen = min(arr.GetSize(),dlen); |
473 |
// // |
// // |
474 |
// // NAME |
// printf("que \n"); |
475 |
|
// setcolor(col,RESET, BLUE, WHITE); |
476 |
|
// setcolor(col2,RESET, BLACK, WHITE); |
477 |
|
// sprintf(o,"%s%s %s[%i]%s = ",o,col,tb->GetName(),arr.GetSize(),col2); |
478 |
// // |
// // |
479 |
// printf(" ATYPE IS %i \n",atype2); |
// // while ( j < tb->GetNdata() ){ |
|
// printf(" %-15s =",tb2->GetName()); |
|
|
// j = 0; |
|
480 |
// // |
// // |
481 |
// // VALUES |
// printf("quo \n"); |
482 |
|
// // pointer = (char*)cl->UncheckedAt(j); |
483 |
|
// // pu = pointer + thisoffset; |
484 |
|
// // arr = (TArrayI*)(thisoffset); |
485 |
// // |
// // |
486 |
// if ( atype2 == 3 || atype2 == -17 ){ |
// while ( jj < arlen ){ |
487 |
// while ( j < length2 ){ |
// if ( jj < arlen-1 ){ |
488 |
// if ( j < length2 -1 ){ |
// sprintf(o,"%s %i ,",o,arr.At(jj)); |
489 |
// printf(" %llu ,",(ULong64_t)tb2->GetValue(j,0)); |
// } else { |
490 |
// } 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++; |
|
491 |
// }; |
// }; |
492 |
|
// jj++; |
493 |
// }; |
// }; |
494 |
// printf("\n"); |
// // if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); |
495 |
// break; |
// // j++; |
496 |
|
// // }; |
497 |
// }; |
// }; |
|
// //printf(" Element %i name %s\n",ln,cl->GetName()); |
|
|
// }; |
|
|
|
|
|
// TBranchElement *tb = (TBranchElement*)branch_array->At(l); |
|
|
// Int_t type = tb->GetType(); |
|
|
// printf("SubBranches : %s type is %i tb getname %s\n",((TBranch*)branch_array->At(l))->GetName(),type,tb->GetName()); |
|
|
// switch (type){ |
|
|
// case 0: |
|
|
// // |
|
|
// // IS A VARIABLE |
|
|
// // |
|
|
// Int_t atype = tb->GetStreamerType() - 20; |
|
|
// Int_t len = (tb->GetInfo()->GetLengths())[tb->GetID()]; |
|
|
// Int_t length = min(len,dlen); |
|
|
// // |
|
|
// // NAME |
|
|
// // |
|
|
// printf(" ATYPE IS %i \n",atype); |
|
|
// printf(" %-15s =",((TBranch*)branch_array->At(l))->GetName()); |
|
|
// j = 0; |
|
498 |
// // |
// // |
499 |
// // VALUES |
// // TArrayF |
500 |
// // |
// // |
501 |
// if ( atype == 3 || atype == -17 ){ |
// if ( !strcmp(tste->GetTypeName(),"TArrayF") ){ |
502 |
// while ( j < length ){ |
// // |
503 |
// if ( j < length -1 ){ |
// char *pointer = (char*)cl->UncheckedAt(0); |
504 |
// printf(" %llu ,",(ULong64_t)tb->GetValue(j,0)); |
// char *pu = pointer + thisoffset; |
505 |
// } else { |
// TArrayF *arr = (TArrayF*)(pu); |
506 |
// printf(" %llu",(ULong64_t)tb->GetValue(j,0)); |
// Int_t jj=0; |
507 |
// }; |
// Int_t arlen = min(arr->GetSize(),dlen); |
508 |
// j++; |
// // |
509 |
// }; |
// setcolor(col,RESET, BLUE, WHITE); |
510 |
// } else { |
// setcolor(col2,RESET, BLACK, WHITE); |
511 |
// while ( j < length ){ |
// sprintf(o,"%s%s %s[%i]%s = ",o,col,tb->GetName(),arr->GetSize(),col2); |
512 |
// if ( j < length -1 ){ |
// // |
513 |
// printf(" %f ,",tb->GetValue(j,0)); |
// while ( j < tb->GetNdata() ){ |
514 |
// } else { |
// // |
515 |
// printf(" %f",tb->GetValue(j,0)); |
// pointer = (char*)cl->UncheckedAt(j); |
516 |
|
// pu = pointer + thisoffset; |
517 |
|
// arr = (TArrayF*)(pu); |
518 |
|
// // |
519 |
|
// while ( jj < arlen ){ |
520 |
|
// if ( jj < arlen-1 ){ |
521 |
|
// sprintf(o,"%s %f ,",o,arr->At(jj)); |
522 |
|
// } else { |
523 |
|
// sprintf(o,"%s %f",o,arr->At(jj)); |
524 |
|
// }; |
525 |
|
// jj++; |
526 |
// }; |
// }; |
527 |
|
// if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); |
528 |
// j++; |
// j++; |
529 |
// }; |
// }; |
530 |
// }; |
// }; |
531 |
// printf("\n"); |
// sprintf(o,"%s\n",o); |
532 |
|
// |
533 |
|
sprintf(o,"%s TArray ",o); |
534 |
|
// |
535 |
|
}; |
536 |
|
// |
537 |
|
sprintf(o,"%s\n",o); |
538 |
|
break; |
539 |
|
case 3: |
540 |
|
// |
541 |
|
// IS A TCLONESARRAY |
542 |
|
// |
543 |
|
setcolor(col,RESET, BLUE, WHITE); |
544 |
|
setcolor(col2,RESET, BLACK, WHITE); |
545 |
|
sprintf(o,"%s%s %-15s%s = %d\n",o,col,tb->GetName(), col2, tb->GetNdata()); |
546 |
|
|
547 |
|
// |
548 |
|
if ( tb->GetNdata() ){ |
549 |
|
// |
550 |
|
TClonesArray *cl = (TClonesArray*)tb->GetObject(); |
551 |
|
// |
552 |
|
TClass *myc = cl->GetClass(); |
553 |
|
// |
554 |
|
TList *lme = myc->GetListOfDataMembers(); |
555 |
|
TIter next(lme); |
556 |
|
TBranchElement *tb2 = 0; |
557 |
|
// |
558 |
|
while ( (tb2 = (TBranchElement*)next()) ){ |
559 |
|
// |
560 |
|
const char *name = tb2->GetName(); |
561 |
|
TBranch *foglia = tb->FindBranch(name); |
562 |
|
if ( foglia ){ |
563 |
|
// |
564 |
|
TBranchElement *stb = (TBranchElement*)tb->FindBranch(name); |
565 |
|
Int_t stype = stb->GetType(); |
566 |
|
Int_t satype = stb->GetStreamerType() - 20; |
567 |
|
Int_t slen = (stb->GetInfo()->GetLengths())[stb->GetID()]; |
568 |
|
Int_t slength = min(slen,dlen); |
569 |
|
// printf("SubBranches : atype is %i type is %i tb getname %s slen %i slength %i\n",satype,stype,stb->GetName(),slen,slength); |
570 |
|
switch (stype){ |
571 |
|
case 31: |
572 |
|
// |
573 |
|
// IS A VARIABLE |
574 |
|
// |
575 |
|
// |
576 |
|
// NAME |
577 |
|
// |
578 |
|
j = 0; |
579 |
|
// |
580 |
|
// VALUES |
581 |
|
// |
582 |
|
if ( satype == 41 || satype == 44){ |
583 |
|
// |
584 |
|
// skip TRef |
585 |
|
// |
586 |
|
break; |
587 |
|
}; |
588 |
|
// |
589 |
|
// Integer |
590 |
|
// |
591 |
|
if ( satype == -17 ){ |
592 |
|
// |
593 |
|
setcolor(col,RESET, BLUE, WHITE); |
594 |
|
setcolor(col2,RESET, BLACK, WHITE); |
595 |
|
sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2); |
596 |
|
while ( j < cl->GetEntriesFast() ){ |
597 |
|
if ( j < cl->GetEntriesFast() -1 ){ |
598 |
|
sprintf(o,"%s %i ,",o,(Int_t)stb->GetValue(j,slength)); |
599 |
|
} else { |
600 |
|
sprintf(o,"%s %i",o,(Int_t)stb->GetValue(j,slength)); |
601 |
|
}; |
602 |
|
j++; |
603 |
|
}; |
604 |
|
}; |
605 |
|
// |
606 |
|
// Float |
607 |
|
// |
608 |
|
if ( satype == -15 ){ |
609 |
|
// |
610 |
|
setcolor(col,RESET, BLUE, WHITE); |
611 |
|
setcolor(col2,RESET, BLACK, WHITE); |
612 |
|
sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2); |
613 |
|
while ( j < cl->GetEntriesFast() ){ |
614 |
|
if ( j < cl->GetEntriesFast() -1 ){ |
615 |
|
sprintf(o,"%s %f ,",o,stb->GetValue(j,slength)); |
616 |
|
} else { |
617 |
|
sprintf(o,"%s %f",o,stb->GetValue(j,slength)); |
618 |
|
}; |
619 |
|
j++; |
620 |
|
}; |
621 |
|
}; |
622 |
|
// |
623 |
|
// Array of float |
624 |
|
// |
625 |
|
if ( satype == 5 ){ |
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 |
|
Bool_t bold = true; |
631 |
|
while ( j < tb->GetNdata() ){ |
632 |
|
if ( bold ){ |
633 |
|
setcolor(col,RESET, BLACK, WHITE); |
634 |
|
sprintf(o,"%s%s",o,col); |
635 |
|
} else { |
636 |
|
setcolor(col,BOLD, BLACK, WHITE); |
637 |
|
sprintf(o,"%s%s",o,col); |
638 |
|
}; |
639 |
|
Int_t jj = 0; |
640 |
|
while ( jj < slength ){ |
641 |
|
if ( jj < slength-1 ){ |
642 |
|
sprintf(o,"%s %f ,",o,stb->GetValue(j,jj,true)); |
643 |
|
} else { |
644 |
|
sprintf(o,"%s %f",o,stb->GetValue(j,jj,true)); |
645 |
|
}; |
646 |
|
jj++; |
647 |
|
}; |
648 |
|
if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); |
649 |
|
if ( !bold ){ |
650 |
|
bold = true; |
651 |
|
} else { |
652 |
|
bold = false; |
653 |
|
}; |
654 |
|
j++; |
655 |
|
}; |
656 |
|
if ( bold ){ |
657 |
|
setcolor(col,RESET, BLACK, WHITE); |
658 |
|
sprintf(o,"%s%s",o,col); |
659 |
|
}; |
660 |
|
}; |
661 |
|
// |
662 |
|
// Array of integers |
663 |
|
// |
664 |
|
if ( satype == 3 ){ |
665 |
|
// |
666 |
|
setcolor(col,RESET, BLUE, WHITE); |
667 |
|
setcolor(col2,RESET, BLACK, WHITE); |
668 |
|
sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2); |
669 |
|
while ( j < tb->GetNdata() ){ |
670 |
|
Int_t jj = 0; |
671 |
|
while ( jj < slength ){ |
672 |
|
if ( jj < slength-1 ){ |
673 |
|
sprintf(o,"%s %i ,",o,(Int_t)stb->GetValue(j,jj,true)); |
674 |
|
} else { |
675 |
|
sprintf(o,"%s %i",o,(Int_t)stb->GetValue(j,jj,true)); |
676 |
|
}; |
677 |
|
jj++; |
678 |
|
}; |
679 |
|
if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); |
680 |
|
j++; |
681 |
|
}; |
682 |
|
}; |
683 |
|
|
684 |
|
// |
685 |
|
// TArray |
686 |
|
// |
687 |
|
if ( satype == 42 ){ |
688 |
|
// |
689 |
|
// determine offset to fetch data |
690 |
|
// |
691 |
|
int thisoffset = 0; |
692 |
|
TRealData *rd = myc->GetRealData(foglia->GetName()); |
693 |
|
if ( rd ){ |
694 |
|
thisoffset = rd->GetThisOffset(); |
695 |
|
}; |
696 |
|
Int_t niente = 0; |
697 |
|
TStreamerElement *tste = stb->GetInfo()->GetStreamerElement(rd->GetName(),niente); |
698 |
|
// |
699 |
|
// TArrayI |
700 |
|
// |
701 |
|
if ( !strcmp(tste->GetTypeName(),"TArrayI") ){ |
702 |
|
// |
703 |
|
char *pointer = (char*)cl->UncheckedAt(0); |
704 |
|
char *pu = pointer + thisoffset; |
705 |
|
TArrayI *arr = (TArrayI*)(pu); |
706 |
|
Int_t jj=0; |
707 |
|
Int_t arlen = min(arr->GetSize(),dlen); |
708 |
|
// |
709 |
|
setcolor(col,RESET, BLUE, WHITE); |
710 |
|
setcolor(col2,RESET, BLACK, WHITE); |
711 |
|
sprintf(o,"%s%s %s[%i]%s = ",o,col,foglia->GetName(),arr->GetSize(),col2); |
712 |
|
// |
713 |
|
while ( j < tb->GetNdata() ){ |
714 |
|
// |
715 |
|
pointer = (char*)cl->UncheckedAt(j); |
716 |
|
pu = pointer + thisoffset; |
717 |
|
arr = (TArrayI*)(pu); |
718 |
|
// |
719 |
|
while ( jj < arlen ){ |
720 |
|
if ( jj < arlen-1 ){ |
721 |
|
sprintf(o,"%s %i ,",o,arr->At(jj)); |
722 |
|
} else { |
723 |
|
sprintf(o,"%s %i",o,arr->At(jj)); |
724 |
|
}; |
725 |
|
jj++; |
726 |
|
}; |
727 |
|
if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); |
728 |
|
j++; |
729 |
|
}; |
730 |
|
}; |
731 |
|
// |
732 |
|
// TArrayF |
733 |
|
// |
734 |
|
if ( !strcmp(tste->GetTypeName(),"TArrayF") ){ |
735 |
|
// |
736 |
|
char *pointer = (char*)cl->UncheckedAt(0); |
737 |
|
char *pu = pointer + thisoffset; |
738 |
|
TArrayF *arr = (TArrayF*)(pu); |
739 |
|
Int_t jj=0; |
740 |
|
Int_t arlen = min(arr->GetSize(),dlen); |
741 |
|
// |
742 |
|
setcolor(col,RESET, BLUE, WHITE); |
743 |
|
setcolor(col2,RESET, BLACK, WHITE); |
744 |
|
sprintf(o,"%s%s %s[%i]%s = ",o,col,foglia->GetName(),arr->GetSize(),col2); |
745 |
|
// |
746 |
|
while ( j < tb->GetNdata() ){ |
747 |
|
// |
748 |
|
pointer = (char*)cl->UncheckedAt(j); |
749 |
|
pu = pointer + thisoffset; |
750 |
|
arr = (TArrayF*)(pu); |
751 |
|
// |
752 |
|
while ( jj < arlen ){ |
753 |
|
if ( jj < arlen-1 ){ |
754 |
|
sprintf(o,"%s %f ,",o,arr->At(jj)); |
755 |
|
} else { |
756 |
|
sprintf(o,"%s %f",o,arr->At(jj)); |
757 |
|
}; |
758 |
|
jj++; |
759 |
|
}; |
760 |
|
if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); |
761 |
|
j++; |
762 |
|
}; |
763 |
|
}; |
764 |
|
}; |
765 |
|
sprintf(o,"%s\n",o); |
766 |
|
break; |
767 |
|
}; |
768 |
|
}; |
769 |
|
}; |
770 |
|
}; |
771 |
break; |
break; |
772 |
}; |
}; |
773 |
// b3 = (TBranch*)branch_array->At(l); |
}; |
774 |
// leaf_array = b1->GetListOfLeaves(); |
// pamgui->DIALOG(0,o); |
775 |
// 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)); |
|
|
// }; |
|
|
// }; |
|
|
|
|
|
}; |
|
|
|
|
776 |
}; |
}; |
777 |
|
|
778 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
779 |
void FEVdetector::GetGeneralInfo(){ |
void FEVdetector::GetGeneralInfo(){ |
780 |
// |
// |
781 |
// Get Orbital Time information and header event number |
// Get Orbital Time information and header event number |
785 |
headcold = headc; |
headcold = headc; |
786 |
headc = ph->Counter; |
headc = ph->Counter; |
787 |
var.headc = (int)ph->Counter; |
var.headc = (int)ph->Counter; |
788 |
OBT = ph->OrbitalTime; |
OBT = (UInt_t)ph->OrbitalTime; |
789 |
DOBT = OBT - OOBT; |
DOBT = OBT - OOBT; |
790 |
OOBT = OBT; |
OOBT = OBT; |
791 |
if ( thisentry == minevent || DOBT < 0 || (headc-headcold-1)!=0 ) DOBT = 0; |
if ( thisentry == minevent || DOBT < 0 || (headc-headcold-1)!=0 ) DOBT = 0; |
974 |
// |
// |
975 |
} |
} |
976 |
|
|
977 |
Int_t FEVdetector::Load(TTree &mainotr, TFile &mainfile){ |
TChain* FEVdetector::Load(TFile &mainfile){ |
978 |
//Int_t FEVdetector::Load(TChain &mainotr, TFile &mainfile){ |
// |
979 |
file = &mainfile; |
file = &mainfile; |
980 |
otr = &mainotr; |
// |
981 |
L2 = new PamLevel2(); |
L2 = new PamLevel2(); |
982 |
// |
// |
983 |
if ( level.file == 2 ){ |
if ( level.file == 2 ){ |
984 |
// otr = L2->LoadPamTrees(file); |
// |
985 |
printf(" %s \n",ddec.Data()); |
printf(" %s \n",ddec.Data()); |
986 |
// otr->Refresh(); |
otr = L2->GetPamTree(gSystem->DirName(file->GetName()),file->GetName(),ddec.Data()); |
987 |
// otr->Clear(); |
runtree = L2->GetRunTree(gSystem->DirName(file->GetName()),file->GetName()); |
|
// otr = new TTree(); |
|
|
otr = L2->GetPamTree(file,ddec.Data()); |
|
988 |
// |
// |
989 |
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/"; |
|
990 |
// |
// |
|
//L2->GetTrkLevel2()->LoadField(magfie.str().c_str()); |
|
991 |
} else { |
} else { |
992 |
// |
// |
993 |
// load calorimeter ADC2MIP conversion file |
// load calorimeter ADC2MIP conversion file |
1031 |
trigger = new pamela::trigger::TriggerEvent(); |
trigger = new pamela::trigger::TriggerEvent(); |
1032 |
eh = new pamela::EventHeader(); |
eh = new pamela::EventHeader(); |
1033 |
ph = new pamela::PscuHeader(); |
ph = new pamela::PscuHeader(); |
1034 |
// oinfoL2 = new OrbitalInfo(); |
// runinfo = new ItoRunInfo(file); |
|
runinfo = new ItoRunInfo(file); |
|
1035 |
// |
// |
1036 |
de = new pamela::calorimeter::CalorimeterEvent(); |
de = new pamela::calorimeter::CalorimeterEvent(); |
1037 |
trk = new pamela::tracker::TrackerEvent(); |
trk = new pamela::tracker::TrackerEvent(); |
1040 |
s4 = new pamela::S4::S4Event(); |
s4 = new pamela::S4::S4Event(); |
1041 |
tof = new pamela::tof::TofEvent(); |
tof = new pamela::tof::TofEvent(); |
1042 |
// |
// |
1043 |
|
// Load level0 file if the case |
1044 |
|
// |
1045 |
if ( level.file == 0 || level.file == -1 ){ |
if ( level.file == 0 || level.file == -1 ){ |
1046 |
|
otr = new TChain("Physics"); |
1047 |
|
otr->Add(file->GetName(),-1); |
1048 |
otr->SetBranchAddress("Trigger", &trigger); |
otr->SetBranchAddress("Trigger", &trigger); |
1049 |
otr->SetBranchAddress("Header", &eh); |
otr->SetBranchAddress("Header", &eh); |
1050 |
}; |
}; |
|
if ( level.file == 2 && var.RUN){ |
|
|
// otr->AddFriend("OrbitalInfo", file); |
|
|
// otr->SetBranchAddress("OrbitalInfo", &oinfoL2); |
|
|
runinfo->Read(0ULL); |
|
|
}; |
|
1051 |
// |
// |
1052 |
if ( var.TRK ) { |
if ( var.TRK ) { |
1053 |
if ( level.file == 0 || level.file == -1 ){ |
if ( level.file == 0 || level.file == -1 ){ |
1120 |
}; |
}; |
1121 |
}; |
}; |
1122 |
// |
// |
1123 |
// printf("qua\n"); |
if ( !otr ){ |
1124 |
return(1); |
return(0); |
1125 |
|
}; |
1126 |
|
// |
1127 |
|
return otr; |
1128 |
// |
// |
1129 |
} |
} |
1130 |
|
|
1200 |
text->DrawLatex(0.33,txthi,testo.str().c_str()); |
text->DrawLatex(0.33,txthi,testo.str().c_str()); |
1201 |
txthi -= 0.03; |
txthi -= 0.03; |
1202 |
testo2.str(""); |
testo2.str(""); |
1203 |
testo2 << "On Board Time: " << (int)OBT; |
testo2 << "On Board Time: " << (unsigned int)OBT; |
1204 |
if ( DOBT > 0 ) { |
if ( DOBT > 0 ) { |
1205 |
testo2 << " (delta: " << (int)DOBT; |
testo2 << " (delta: " << (unsigned int)DOBT; |
1206 |
testo2 << ")"; |
testo2 << ")"; |
1207 |
}; |
}; |
1208 |
testo2 << " [ms]"; |
testo2 << " [ms]"; |
2621 |
// |
// |
2622 |
Bool_t repeat = true; |
Bool_t repeat = true; |
2623 |
Int_t numtr = 1; |
Int_t numtr = 1; |
2624 |
|
// Int_t numtr = 0; |
2625 |
Int_t repuntil = 0; |
Int_t repuntil = 0; |
2626 |
// |
// |
2627 |
// |
// |
2629 |
// |
// |
2630 |
if ( level.file == 2 ) repuntil = L2->GetToFLevel2()->ntrk(); |
if ( level.file == 2 ) repuntil = L2->GetToFLevel2()->ntrk(); |
2631 |
// printf("repuntil = %i \n",repuntil); |
// printf("repuntil = %i \n",repuntil); |
2632 |
|
//if ( level.file == 2 ) repuntil = L2->GetTrkLevel2()->GetNTracks(); |
2633 |
//repuntil = L2->GetNTracks(); |
//repuntil = L2->GetNTracks(); |
2634 |
// |
// |
2635 |
while ( repeat ){ |
while ( repeat ){ |
2639 |
// |
// |
2640 |
// |
// |
2641 |
ToFTrkVar *ptt = 0; |
ToFTrkVar *ptt = 0; |
2642 |
|
// PamTrack *ptrack = 0; |
2643 |
|
Float_t adc[4][12]; |
2644 |
|
Float_t tdc[4][12]; |
2645 |
|
memset(adc,0,4*12*sizeof(Float_t)); |
2646 |
|
memset(tdc,0,4*12*sizeof(Float_t)); |
2647 |
// |
// |
2648 |
// |
// |
2649 |
|
// if ( repuntil == 0 || var.tofraw ){ |
2650 |
if ( repuntil == 1 || var.tofraw ){ |
if ( repuntil == 1 || var.tofraw ){ |
2651 |
numtr = 0; |
numtr = 0; |
2652 |
ptt = L2->GetToFLevel2()->GetToFTrkVar(0); |
ptt = L2->GetToFLevel2()->GetToFTrkVar(0); |
2657 |
if ( numtr >= repuntil-1 ) repeat = false; |
if ( numtr >= repuntil-1 ) repeat = false; |
2658 |
// |
// |
2659 |
ptt = L2->GetToFLevel2()->GetToFTrkVar(numtr); |
ptt = L2->GetToFLevel2()->GetToFTrkVar(numtr); |
2660 |
|
//ptrack = L2->GetTrack(numtr); |
2661 |
|
//ptt = ptrack->GetToFTrack(); |
2662 |
}; |
}; |
2663 |
// |
// |
2664 |
xp11[0] = 0.; |
xp11[0] = 0.; |
2672 |
// |
// |
2673 |
ii = 2; |
ii = 2; |
2674 |
// |
// |
2675 |
Float_t adc[4][12]; |
Int_t myseq = ptt->trkseqno + 1; |
2676 |
Float_t tdc[4][12]; |
L2->GetToFLevel2()->GetMatrix(myseq,adc,tdc); |
2677 |
L2->GetToFLevel2()->GetMatrix(numtr,adc,tdc); |
// |
2678 |
|
// printf(" qua \n"); |
2679 |
// |
// |
2680 |
for ( Int_t i = 0; i<8; i++ ) { |
for ( Int_t i = 0; i<8; i++ ) { |
2681 |
if ( adc[ch11a[i]][hb11a[i]] < 1000. ){ |
if ( adc[ch11a[i]][hb11a[i]] < 1000. ){ |
5152 |
// first of all plot crosses relatives to tracks |
// first of all plot crosses relatives to tracks |
5153 |
// |
// |
5154 |
if ( L2->GetTrkLevel2()->GetNTracks() > 0 ){ |
if ( L2->GetTrkLevel2()->GetNTracks() > 0 ){ |
5155 |
|
// for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ |
5156 |
|
// TrkTrack *track = L2->GetTrkLevel2()->GetTrack(nt); |
5157 |
for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ |
for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ |
5158 |
TrkTrack *track = L2->GetTrkLevel2()->GetTrack(nt); |
PamTrack *ptrack= L2->GetTrack(nt); |
5159 |
|
TrkTrack *track = ptrack->GetTrkTrack(); |
5160 |
|
// |
5161 |
for (Int_t plane = 0; plane<6; plane++){ |
for (Int_t plane = 0; plane<6; plane++){ |
5162 |
// |
// |
5163 |
x = track->xm[plane]; |
x = track->xm[plane]; |
5899 |
// |
// |
5900 |
// Define variables |
// Define variables |
5901 |
// |
// |
5902 |
Int_t etime = var.etime; |
UInt_t etime = var.etime; |
5903 |
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]; |
5904 |
Int_t badstrip = 0; |
Int_t badstrip = 0; |
5905 |
qtot = 0.; |
qtot = 0.; |
5971 |
if ( calib.ttime[s][b[s]+1] && calib.time[s][b[s]] ){ |
if ( calib.ttime[s][b[s]+1] && calib.time[s][b[s]] ){ |
5972 |
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 ){ |
5973 |
printf(" CALORIMETER: \n" ); |
printf(" CALORIMETER: \n" ); |
5974 |
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]); |
5975 |
printf(" END CALORIMETER. \n\n" ); |
printf(" END CALORIMETER. \n\n" ); |
5976 |
b[s]++; |
b[s]++; |
5977 |
CaloPede(s); |
CaloPede(s); |
6276 |
for (Int_t d = 0; d<48; d++){ |
for (Int_t d = 0; d<48; d++){ |
6277 |
if ( calib.ttime[s][d] != 0 ) calibex++; |
if ( calib.ttime[s][d] != 0 ) calibex++; |
6278 |
if ( calib.time[s][0] != 0 ){ |
if ( calib.time[s][0] != 0 ){ |
6279 |
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]); |
6280 |
if ( calib.time[s][d+1] != 0 ) { |
if ( calib.time[s][d+1] != 0 ) { |
6281 |
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]); |
6282 |
} else { |
} else { |
6283 |
if ( !stop ){ |
if ( !stop ){ |
6284 |
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]); |
6285 |
stop = 1; |
stop = 1; |
6286 |
}; |
}; |
6287 |
}; |
}; |
6288 |
} else { |
} else { |
6289 |
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]); |
6290 |
}; |
}; |
6291 |
}; |
}; |
6292 |
printf("\n"); |
printf("\n"); |
6351 |
calib.ttime[s][inter] = 0; |
calib.ttime[s][inter] = 0; |
6352 |
if ( ce->cstwerr[s] != 0 && ce->cperror[s] == 0 ) { |
if ( ce->cstwerr[s] != 0 && ce->cperror[s] == 0 ) { |
6353 |
//calib.ttime[s][inter] = cph->GetOrbitalTime(); |
//calib.ttime[s][inter] = cph->GetOrbitalTime(); |
6354 |
calib.ttime[s][inter] = cph->OrbitalTime; |
calib.ttime[s][inter] = (UInt_t)cph->OrbitalTime; |
6355 |
inter++; |
inter++; |
6356 |
} else { |
} else { |
6357 |
if ( ce->cstwerr[s] != 0 && ce->cperror[s] != 0 ) { |
if ( ce->cstwerr[s] != 0 && ce->cperror[s] != 0 ) { |
6405 |
tr->GetEntry(ci); |
tr->GetEntry(ci); |
6406 |
cph = ceh->GetPscuHeader(); |
cph = ceh->GetPscuHeader(); |
6407 |
//if ( atime == cph->GetOrbitalTime()){ |
//if ( atime == cph->GetOrbitalTime()){ |
6408 |
if ( atime == cph->OrbitalTime){ |
if ( atime == (UInt_t)cph->OrbitalTime){ |
6409 |
// calib.iev = ce->iev; |
// calib.iev = ce->iev; |
6410 |
if (ce->cstwerr[s] != 0 && ce->cperror[s] == 0 ) { |
if (ce->cstwerr[s] != 0 && ce->cperror[s] == 0 ) { |
6411 |
for ( Int_t d=0 ; d<11 ;d++ ){ |
for ( Int_t d=0 ; d<11 ;d++ ){ |