46 |
#include <TEllipse.h> |
#include <TEllipse.h> |
47 |
#include <TArrow.h> |
#include <TArrow.h> |
48 |
#include <TStyle.h> |
#include <TStyle.h> |
49 |
|
#include <TStreamerElement.h> |
50 |
|
#include <TRealData.h> |
51 |
// |
// |
52 |
#include <PamelaRun.h> |
#include <PamelaRun.h> |
53 |
#include <physics/calorimeter/CalorimeterEvent.h> |
#include <physics/calorimeter/CalorimeterEvent.h> |
69 |
#include <FEVdetector.h> |
#include <FEVdetector.h> |
70 |
#include <FEventViewer.h> |
#include <FEventViewer.h> |
71 |
#include <feventvstruct.h> |
#include <feventvstruct.h> |
72 |
|
#include <color.h> |
73 |
// |
// |
74 |
extern Bool_t existfile(TString); |
extern Bool_t existfile(TString); |
75 |
// |
// |
83 |
thefigure = &figure; |
thefigure = &figure; |
84 |
checkctrlword(); |
checkctrlword(); |
85 |
var.selex = false; |
var.selex = false; |
86 |
|
var.showall = false; |
87 |
|
|
88 |
|
var.showsi = false; |
89 |
|
var.shownd = false; |
90 |
|
var.shows4 = false; |
91 |
|
var.showorb = false; |
92 |
|
var.showtof = false; |
93 |
|
var.showtrg = false; |
94 |
|
var.showtrk = false; |
95 |
|
var.showcal = false; |
96 |
|
var.showrun = false; |
97 |
|
var.showac = false; |
98 |
|
} |
99 |
|
|
100 |
|
void FEVdetector::Reset(){ |
101 |
|
L2 = NULL; |
102 |
} |
} |
103 |
|
|
104 |
void FEVdetector::checkctrlword(){ |
void FEVdetector::checkctrlword(){ |
107 |
var.AC = 0; |
var.AC = 0; |
108 |
var.RUN = 1; |
var.RUN = 1; |
109 |
var.TRK = 0; |
var.TRK = 0; |
110 |
|
var.ORB = 1; |
111 |
|
var.TRG = 1; |
112 |
var.CALO = 0; |
var.CALO = 0; |
113 |
|
var.CALOT = 0; |
114 |
var.S4 = 0; |
var.S4 = 0; |
115 |
var.ND = 0; |
var.ND = 0; |
116 |
var.INFOS = 0; |
var.INFOS = 0; |
150 |
}; |
}; |
151 |
|
|
152 |
void FEVdetector::GetWindow(){ |
void FEVdetector::GetWindow(){ |
153 |
otr->GetEntry(maxevent); |
// |
154 |
|
if ( level.file == 2 ){ |
155 |
|
// printf("0qui\n"); |
156 |
|
L2->GetEntry(minevent); |
157 |
|
} else { |
158 |
|
otr->GetEntry(minevent); |
159 |
|
} |
160 |
if ( level.file < 2 ){ |
if ( level.file < 2 ){ |
161 |
ph = eh->GetPscuHeader(); |
ph = eh->GetPscuHeader(); |
162 |
lastevno = (int)ph->Counter; |
firstevno = (int)ph->Counter; |
163 |
} else { |
} else { |
164 |
lastevno = L2->GetOrbitalInfo()->pkt_num; // to be changed as soon as we will have pkt_counter in the level2 file! |
if ( var.ORB ){ |
165 |
|
firstevno = L2->GetOrbitalInfo()->pkt_num; |
166 |
|
} else { |
167 |
|
firstevno = 0; |
168 |
|
}; |
169 |
}; |
}; |
170 |
otr->GetEntry(minevent); |
// |
171 |
|
if ( level.file == 2 ){ |
172 |
|
// printf("1qui\n"); |
173 |
|
L2->GetEntry(maxevent); |
174 |
|
} else { |
175 |
|
otr->GetEntry(maxevent); |
176 |
|
} |
177 |
|
// |
178 |
if ( level.file < 2 ){ |
if ( level.file < 2 ){ |
179 |
ph = eh->GetPscuHeader(); |
ph = eh->GetPscuHeader(); |
180 |
firstevno = (int)ph->Counter; |
lastevno = (int)ph->Counter; |
181 |
} else { |
} else { |
182 |
firstevno = L2->GetOrbitalInfo()->pkt_num; // to be changed as soon as we will have pkt_counter in the level2 file! |
if ( var.ORB ){ |
183 |
|
lastevno = L2->GetOrbitalInfo()->pkt_num; |
184 |
|
} else { |
185 |
|
lastevno = 0; |
186 |
|
}; |
187 |
}; |
}; |
188 |
|
// |
189 |
} |
} |
190 |
|
|
191 |
void FEVdetector::ClearVariables(){ |
void FEVdetector::ClearVariables(){ |
208 |
} |
} |
209 |
|
|
210 |
void FEVdetector::GetEntry(Int_t i){ |
void FEVdetector::GetEntry(Int_t i){ |
211 |
thisentry = i; |
thisentry = i; |
212 |
otr->GetEntry(i); |
if ( level.file == 2 ){ |
213 |
// PrintData(otr,-1LL,44); |
// L2->Clear(); |
214 |
|
// printf("qui\n"); |
215 |
|
L2->GetEntry(i); |
216 |
|
if ( var.showall ){ |
217 |
|
ShowInfo("RunInfo"); |
218 |
|
ShowInfo("SoftInfo"); |
219 |
|
ShowInfo("OrbitalInfo"); |
220 |
|
ShowInfo("TrigLevel2"); |
221 |
|
ShowInfo("ToFLevel2"); |
222 |
|
ShowInfo("TrkLevel2"); |
223 |
|
ShowInfo("AcLevel2"); |
224 |
|
ShowInfo("CaloLevel2"); |
225 |
|
ShowInfo("CaloLevel1"); |
226 |
|
ShowInfo("S4Level2"); |
227 |
|
ShowInfo("NDLevel2"); |
228 |
|
} else { |
229 |
|
if ( var.showrun ) ShowInfo("RunInfo"); |
230 |
|
if ( var.showsi ) ShowInfo("SoftInfo"); |
231 |
|
if ( var.showorb ) ShowInfo("OrbitalInfo"); |
232 |
|
if ( var.showtrg ) ShowInfo("TrigLevel2"); |
233 |
|
if ( var.showtof ) ShowInfo("ToFLevel2"); |
234 |
|
if ( var.showtrk ) ShowInfo("TrkLevel2"); |
235 |
|
if ( var.showac ) ShowInfo("AcLevel2"); |
236 |
|
if ( var.showcal ) ShowInfo("CaloLevel2"); |
237 |
|
if ( var.showcal ) ShowInfo("CaloLevel1"); |
238 |
|
if ( var.shows4 ) ShowInfo("S4Level2"); |
239 |
|
if ( var.shownd ) ShowInfo("NDLevel2"); |
240 |
|
}; |
241 |
|
} else { |
242 |
|
otr->GetEntry(i); |
243 |
|
if ( var.showall ){ |
244 |
|
ShowInfo("Pscu"); |
245 |
|
ShowInfo("Trigger"); |
246 |
|
ShowInfo("Tof"); |
247 |
|
ShowInfo("Tracker"); |
248 |
|
ShowInfo("Anticounter"); |
249 |
|
ShowInfo("Calorimeter"); |
250 |
|
ShowInfo("S4"); |
251 |
|
ShowInfo("Neutron"); |
252 |
|
} else { |
253 |
|
if ( var.showorb ) ShowInfo("Pscu"); |
254 |
|
if ( var.showtrg ) ShowInfo("Trigger"); |
255 |
|
if ( var.showtof ) ShowInfo("Tof"); |
256 |
|
if ( var.showtrk ) ShowInfo("Tracker"); |
257 |
|
if ( var.showac ) ShowInfo("Anticounter"); |
258 |
|
if ( var.showcal ) ShowInfo("Calorimeter"); |
259 |
|
if ( var.shows4 ) ShowInfo("S4"); |
260 |
|
if ( var.shownd ) ShowInfo("Neutron"); |
261 |
|
}; |
262 |
|
}; |
263 |
} |
} |
264 |
|
|
265 |
void FEVdetector::SetEntry(Int_t i){ |
void FEVdetector::SetEntry(Int_t i){ |
380 |
}; |
}; |
381 |
} |
} |
382 |
|
|
383 |
void FEVdetector::PrintLeaves(TTree *otr, Int_t i, TBranchElement *tb, Int_t lenmax){ |
void FEVdetector::ShowInfo(TString detector){ |
384 |
// -- Prints values of leaves. |
// |
385 |
|
TBranch *b1 = 0; |
386 |
// tb->ValidateAddress(); |
// TBranch *b3 = 0; |
387 |
printf("son qua \n"); |
TObjArray *branch_array = 0; |
388 |
|
// TObjArray *leaf_array = 0; |
389 |
|
// |
390 |
|
if ( !strcmp(detector.Data(),"RunInfo") || !strcmp(detector.Data(),"SoftInfo") ){ |
391 |
|
if ( L2->GetRunTree() ) b1 = L2->GetRunTree()->FindBranch(detector.Data()); |
392 |
|
} else { |
393 |
|
b1 = otr->FindBranch(detector.Data()); |
394 |
|
}; |
395 |
|
// |
396 |
|
if ( !b1 ) return; |
397 |
|
// |
398 |
|
Int_t dlen = 10; |
399 |
|
// |
400 |
|
char o[200000]; |
401 |
|
char zz[200000]; |
402 |
|
char col[13]; |
403 |
|
char col2[13]; |
404 |
|
// |
405 |
|
setcolor(col,RESET, GREEN, WHITE); |
406 |
|
sprintf(o,"%s======> EVENT:%i\n",col, thisentry); |
407 |
|
sprintf(zz,"======> EVENT:%i\n", thisentry); |
408 |
|
// |
409 |
|
setcolor(col,RESET, RED, WHITE); |
410 |
|
sprintf(o,"%s%sBranch %s\n",o,col,b1->GetName()); |
411 |
|
sprintf(zz,"%sBranch %s\n",zz,b1->GetName()); |
412 |
|
setcolor(col,RESET, BLACK, WHITE); |
413 |
|
sprintf(o,"%s%s",o,col); |
414 |
|
// |
415 |
|
branch_array = b1->GetListOfBranches(); |
416 |
|
// |
417 |
|
Int_t j = 0; |
418 |
|
// |
419 |
|
for(Int_t l=0;l<(branch_array->GetLast()+1);l++){ |
420 |
|
// |
421 |
|
TBranchElement *tb = (TBranchElement*)branch_array->At(l); |
422 |
|
Int_t type = tb->GetType(); |
423 |
|
Int_t atype = tb->GetStreamerType() - 20; |
424 |
|
Int_t len = (tb->GetInfo()->GetLengths())[tb->GetID()]; |
425 |
|
Int_t length = min(len,dlen); |
426 |
|
// |
427 |
|
// printf("Branches : type is %i type is %i tb getname %s slen %i slength %i\n",atype,type,tb->GetName(),len,length); |
428 |
|
switch (type){ |
429 |
|
case 0: |
430 |
|
// |
431 |
|
// IS A VARIABLE |
432 |
|
// |
433 |
|
// |
434 |
|
// NAME |
435 |
|
// |
436 |
|
setcolor(col,RESET, BLUE, WHITE); |
437 |
|
setcolor(col2,RESET, BLACK, WHITE); |
438 |
|
sprintf(o,"%s%s %-15s%s =",o,col,((TBranch*)branch_array->At(l))->GetName(),col2); |
439 |
|
sprintf(zz,"%s %-15s =",zz,((TBranch*)branch_array->At(l))->GetName()); |
440 |
|
// |
441 |
|
j = 0; |
442 |
|
// |
443 |
|
// VALUES |
444 |
|
// |
445 |
|
// |
446 |
|
// Integer |
447 |
|
// |
448 |
|
if ( atype == 3 || atype == -17 ){ |
449 |
|
while ( j < length ){ |
450 |
|
if ( j < length -1 ){ |
451 |
|
sprintf(o,"%s %i ,",o,(Int_t)tb->GetValue(j,0)); |
452 |
|
sprintf(zz,"%s %i ,",zz,(Int_t)tb->GetValue(j,0)); |
453 |
|
} else { |
454 |
|
sprintf(o,"%s %i",o,(Int_t)tb->GetValue(j,0)); |
455 |
|
sprintf(zz,"%s %i",zz,(Int_t)tb->GetValue(j,0)); |
456 |
|
}; |
457 |
|
j++; |
458 |
|
}; |
459 |
|
}; |
460 |
|
// |
461 |
|
// Unsigned integer |
462 |
|
// |
463 |
|
if ( atype == -7 || atype == 13 || atype == -9 || atype == -8 || atype == 12 ){ |
464 |
|
while ( j < length ){ |
465 |
|
if ( j < length -1 ){ |
466 |
|
sprintf(o,"%s %u ,",o,(UInt_t)tb->GetValue(j,0)); |
467 |
|
sprintf(zz,"%s %u ,",zz,(UInt_t)tb->GetValue(j,0)); |
468 |
|
} else { |
469 |
|
sprintf(o,"%s %u",o,(UInt_t)tb->GetValue(j,0)); |
470 |
|
sprintf(zz,"%s %u",zz,(UInt_t)tb->GetValue(j,0)); |
471 |
|
}; |
472 |
|
j++; |
473 |
|
}; |
474 |
|
}; |
475 |
|
// |
476 |
|
// Float |
477 |
|
// |
478 |
|
if ( atype == -15 || atype == 5 ){ |
479 |
|
while ( j < length ){ |
480 |
|
if ( j < length -1 ){ |
481 |
|
sprintf(o,"%s %f ,",o,tb->GetValue(j,0)); |
482 |
|
sprintf(zz,"%s %f ,",zz,tb->GetValue(j,0)); |
483 |
|
} else { |
484 |
|
sprintf(o,"%s %f",o,tb->GetValue(j,0)); |
485 |
|
sprintf(zz,"%s %f",zz,tb->GetValue(j,0)); |
486 |
|
}; |
487 |
|
j++; |
488 |
|
}; |
489 |
|
}; |
490 |
|
// |
491 |
|
// Strings |
492 |
|
// |
493 |
|
if ( atype == 45 ){ |
494 |
|
// TObjArray *cl = (TObjArray*)(tb->GetInfo()->GetOffsets())[tb->GetID()];//tb->GetValuePointer(); |
495 |
|
// TString *stringa = (TString*)(*cl)[0]; |
496 |
|
// TBranchElement *utb = (TBranchElement*)tb->GetBranchCount(); |
497 |
|
// TString** stringa = (TString*)(&tb->GetValuePointer()); |
498 |
|
//TStreamerElement *tste = (TStreamerElement*)tb->GetInfo()->GetCurrentElement(); |
499 |
|
|
500 |
|
// char *ladd; |
501 |
|
// ladd = tb->GetValuePointer() |
502 |
|
// TString *stringa = (TString*)((tste->GetOffset())); |
503 |
|
// TString& mstr = *stringa; |
504 |
|
// printf(" la mia stringa %s \n",mstr.Data()); |
505 |
|
// printf(" offset %i \n",(Int_t)utb->GetValue(0,0)); |
506 |
|
// int pointer = (tb->GetInfo()->GetOffsets())[tb->GetID()]; |
507 |
|
// TString *stringa = (TString*)(tb->GetInfo()->GetOffsets())[tb->GetID()]; |
508 |
|
// TString *stringa = (TString*)tb->GetAddress(); |
509 |
|
// printf(" address 0x%X \n",tb->GetAddress()); |
510 |
|
// printf(" pointer 0x%X \n",tb->GetValuePointer()); |
511 |
|
// printf(" object 0x%X \n",tb->GetObject()); |
512 |
|
// printf("stringa %s lung %i\n",stringa.Data(),stringa.Length()); |
513 |
|
// TLeaf *striglia = tb->FindLeaf(tb->GetName()); |
514 |
|
// if ( striglia ){ |
515 |
|
// char *pointer = (char *)striglia->GetValuePointer(); |
516 |
|
// TString *pr= (TString*)pointer; |
517 |
|
// printf("ciao %s \n",pr->Data()); |
518 |
|
// }; |
519 |
|
sprintf(o,"%s TString - not implemented yet -",o); |
520 |
|
sprintf(zz,"%s TString - not implemented yet -",zz); |
521 |
|
}; |
522 |
|
// |
523 |
|
// TArray |
524 |
|
// |
525 |
|
if ( atype == 42 ){ |
526 |
|
// |
527 |
|
// TObjArray *cl = (TObjArray*)tb->GetObject(); |
528 |
|
// // |
529 |
|
// TClass *myc = cl->IsA(); |
530 |
|
// // |
531 |
|
// printf("qui \n"); |
532 |
|
// // |
533 |
|
// // determine offset to fetch data |
534 |
|
// // |
535 |
|
// int thisoffset = 0; |
536 |
|
// TRealData *rd = myc->GetRealData(tb->GetName()); |
537 |
|
// if ( rd ){ |
538 |
|
// thisoffset = rd->GetThisOffset(); |
539 |
|
// }; |
540 |
|
// Int_t niente = 0; |
541 |
|
// TStreamerElement *tste = tb->GetInfo()->GetStreamerElement(rd->GetName(),niente); |
542 |
|
// printf(" typename %s \n",tste->GetTypeName()); |
543 |
|
// // |
544 |
|
// // TArrayI |
545 |
|
// // |
546 |
|
// if ( !strcmp(tste->GetTypeName(),"TArrayI") ){ |
547 |
|
// // |
548 |
|
// printf("qua \n"); |
549 |
|
// char *pointer = (char*)cl->At(0); |
550 |
|
// // char *pu = thisoffset + pointer; |
551 |
|
// int pu = (int)tste->GetTObjectOffset(); |
552 |
|
// TArrayI arr = (TArrayI)*pu; |
553 |
|
// // TArrayI arr = (TArrayI)(thisoffset); |
554 |
|
// //TArrayI *arr = (TArrayI*)pu; |
555 |
|
// //TArraI arr = (TArrayI) |
556 |
|
// Int_t jj=0; |
557 |
|
// j=0; |
558 |
|
// printf("quii \n"); |
559 |
|
// Int_t arlen = min(arr.GetSize(),dlen); |
560 |
|
// // |
561 |
|
// printf("que \n"); |
562 |
|
// setcolor(col,RESET, BLUE, WHITE); |
563 |
|
// setcolor(col2,RESET, BLACK, WHITE); |
564 |
|
// sprintf(o,"%s%s %s[%i]%s = ",o,col,tb->GetName(),arr.GetSize(),col2); |
565 |
|
// // |
566 |
|
// // while ( j < tb->GetNdata() ){ |
567 |
|
// // |
568 |
|
// printf("quo \n"); |
569 |
|
// // pointer = (char*)cl->UncheckedAt(j); |
570 |
|
// // pu = pointer + thisoffset; |
571 |
|
// // arr = (TArrayI*)(thisoffset); |
572 |
|
// // |
573 |
|
// while ( jj < arlen ){ |
574 |
|
// if ( jj < arlen-1 ){ |
575 |
|
// sprintf(o,"%s %i ,",o,arr.At(jj)); |
576 |
|
// } else { |
577 |
|
// sprintf(o,"%s %i",o,arr.At(jj)); |
578 |
|
// }; |
579 |
|
// jj++; |
580 |
|
// }; |
581 |
|
// // if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); |
582 |
|
// // j++; |
583 |
|
// // }; |
584 |
|
// }; |
585 |
|
// // |
586 |
|
// // TArrayF |
587 |
|
// // |
588 |
|
// if ( !strcmp(tste->GetTypeName(),"TArrayF") ){ |
589 |
|
// // |
590 |
|
// char *pointer = (char*)cl->UncheckedAt(0); |
591 |
|
// char *pu = pointer + thisoffset; |
592 |
|
// TArrayF *arr = (TArrayF*)(pu); |
593 |
|
// Int_t jj=0; |
594 |
|
// Int_t arlen = min(arr->GetSize(),dlen); |
595 |
|
// // |
596 |
|
// setcolor(col,RESET, BLUE, WHITE); |
597 |
|
// setcolor(col2,RESET, BLACK, WHITE); |
598 |
|
// sprintf(o,"%s%s %s[%i]%s = ",o,col,tb->GetName(),arr->GetSize(),col2); |
599 |
|
// // |
600 |
|
// while ( j < tb->GetNdata() ){ |
601 |
|
// // |
602 |
|
// pointer = (char*)cl->UncheckedAt(j); |
603 |
|
// pu = pointer + thisoffset; |
604 |
|
// arr = (TArrayF*)(pu); |
605 |
|
// // |
606 |
|
// while ( jj < arlen ){ |
607 |
|
// if ( jj < arlen-1 ){ |
608 |
|
// sprintf(o,"%s %f ,",o,arr->At(jj)); |
609 |
|
// } else { |
610 |
|
// sprintf(o,"%s %f",o,arr->At(jj)); |
611 |
|
// }; |
612 |
|
// jj++; |
613 |
|
// }; |
614 |
|
// if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); |
615 |
|
// j++; |
616 |
|
// }; |
617 |
|
// }; |
618 |
|
// sprintf(o,"%s\n",o); |
619 |
|
// |
620 |
|
sprintf(o,"%s TArray - not implemented yet -",o); |
621 |
|
sprintf(zz,"%s TArray - not implemented yet -",zz); |
622 |
|
// |
623 |
|
}; |
624 |
|
// |
625 |
|
sprintf(o,"%s\n",o); |
626 |
|
sprintf(zz,"%s\n",zz); |
627 |
|
break; |
628 |
|
case 3: |
629 |
|
// |
630 |
|
// IS A TCLONESARRAY |
631 |
|
// |
632 |
|
setcolor(col,RESET, BLUE, WHITE); |
633 |
|
setcolor(col2,RESET, BLACK, WHITE); |
634 |
|
sprintf(o,"%s%s %-15s%s = %d\n",o,col,tb->GetName(), col2, tb->GetNdata()); |
635 |
|
sprintf(zz,"%s %-15s = %d\n",zz,tb->GetName(), tb->GetNdata()); |
636 |
|
|
637 |
// if (otr->GetMakeClass()) { |
// |
638 |
if (!tb->GetAddress()) { |
if ( tb->GetNdata() ){ |
639 |
printf("esco \n"); |
// |
640 |
return; |
TClonesArray *cl = (TClonesArray*)tb->GetObject(); |
641 |
} |
// |
642 |
if (tb->GetType() == 3 || tb->GetType() == 4) { |
TClass *myc = cl->GetClass(); |
643 |
// TClonesArray or STL container top-level branch. |
// |
644 |
printf("3 o 4 %-15s = %d\n", tb->GetName(), tb->GetNdata()); |
TList *lme = myc->GetListOfDataMembers(); |
645 |
return; |
TIter next(lme); |
646 |
} else if (tb->GetType() == 31 || tb->GetType() == 41) { |
TBranchElement *tb2 = 0; |
647 |
printf(" 31 o 41 \n"); |
// |
648 |
// TClonesArray or STL container sub-branch. |
while ( (tb2 = (TBranchElement*)next()) ){ |
649 |
Int_t n = TMath::Min(10, tb->GetNdata()); |
// |
650 |
Int_t atype = tb->GetStreamerType() + 20; |
const char *name = tb2->GetName(); |
651 |
if (tb->GetStreamerType() == 1) { |
TBranch *foglia = tb->FindBranch(name); |
652 |
// TVirtualStreamerInfo::kOffsetL + TVirtualStreamerInfo::kChar is |
if ( foglia ){ |
653 |
// printed as a string and could print weird characters. |
// |
654 |
// So we print an unsigned char instead (not perfect, but better). |
TBranchElement *stb = (TBranchElement*)tb->FindBranch(name); |
655 |
atype = 20 + 11 ; |
Int_t stype = stb->GetType(); |
656 |
} |
Int_t satype = stb->GetStreamerType() - 20; |
657 |
if (atype > 54) { |
Int_t slen = (stb->GetInfo()->GetLengths())[stb->GetID()]; |
658 |
// FIXME: More logic required here (like in ReadLeaves) |
Int_t slength = min(slen,dlen); |
659 |
printf(">54 %-15s = %d\n", tb->GetName(), tb->GetNdata()); |
// printf("SubBranches : atype is %i type is %i tb getname %s slen %i slength %i\n",satype,stype,stb->GetName(),slen,slength); |
660 |
return; |
switch (stype){ |
661 |
} |
case 31: |
662 |
if (tb->GetStreamerType() > 20) { |
// |
663 |
atype -= 20; |
// IS A VARIABLE |
664 |
TObjArray *prova= otr->GetListOfLeaves(); |
// |
665 |
// TObjArray* leaf2 = (TObjArray*) prova->UncheckedAt(i); |
// |
666 |
//TLeaf* leaf = (TLeaf*)(otr->GetLeaf(tb->GetName())); |
// NAME |
667 |
// TLeafElement* leaf = (TLeafElement*)((TLeaf*)(otr->GetListOfLeaves()->UncheckedAt(i))->GetBranch()->UncheckedAt(0)); |
// |
668 |
TLeafElement* leaf = (TLeafElement*)(prova->UncheckedAt(0)); |
j = 0; |
669 |
n = n * leaf->GetLenStatic(); |
// |
670 |
} |
// VALUES |
671 |
if (tb->GetInfo()) { |
// |
672 |
// n = 16; |
if ( satype == 41 || satype == 44){ |
673 |
tb->GetInfo()->PrintValue(tb->GetName(), tb->GetAddress(), atype, n, lenmax); |
// |
674 |
//tb->GetObject()->GetInfo()->PrintValue(tb->GetName(), tb->GetObject(), atype, n, lenmax); |
// skip TRef |
675 |
} |
// |
676 |
return; |
break; |
677 |
} else if (tb->GetType() <= 2) { |
}; |
678 |
printf(" <=2 \n"); |
// |
679 |
// Branch in split mode. |
// Integer |
680 |
// FIXME: This should probably be < 60 instead. |
// |
681 |
if ((tb->GetStreamerType() > 40) && (tb->GetStreamerType() < 55)) { |
if ( satype == -17 || satype == -9 ){ |
682 |
Int_t atype = tb->GetStreamerType() - 20; |
// |
683 |
TBranchElement* counterElement = (TBranchElement*) tb->GetBranchCount(); |
setcolor(col,RESET, BLUE, WHITE); |
684 |
Int_t n = (Int_t) counterElement->GetValue(0, 0); |
setcolor(col2,RESET, BLACK, WHITE); |
685 |
if (tb->GetInfo()) { |
sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2); |
686 |
tb->GetInfo()->PrintValue(tb->GetName(), tb->GetAddress(), atype, n, lenmax); |
sprintf(zz,"%s %-15s = ",zz,foglia->GetName()); |
687 |
} |
while ( j < cl->GetEntriesFast() ){ |
688 |
} else { |
if ( j < cl->GetEntriesFast() -1 ){ |
689 |
// if (tb->GetInfo()) { |
sprintf(o,"%s %i ,",o,(Int_t)stb->GetValue(j,slength)); |
690 |
// tb->GetInfo()->PrintValue(tb->GetName(), tb->GetObject(), tb->GetID(), -1, lenmax); |
sprintf(zz,"%s %i ,",zz,(Int_t)stb->GetValue(j,slength)); |
691 |
// } |
} else { |
692 |
// } |
sprintf(o,"%s %i",o,(Int_t)stb->GetValue(j,slength)); |
693 |
return; |
sprintf(zz,"%s %i",zz,(Int_t)stb->GetValue(j,slength)); |
694 |
} |
}; |
695 |
} else if (tb->GetType() == 3) { |
j++; |
696 |
printf("3 %-15s = %d\n", tb->GetName(), tb->GetNdata()); |
}; |
697 |
} else if (tb->GetType() == 31) { |
}; |
698 |
printf("31 %-15s = %d\n", tb->GetName(), tb->GetNdata()); |
// |
699 |
// TClonesArray* clones = (TClonesArray*) tb->GetObject(); |
// Float |
700 |
// if (tb->GetInfo()) { |
// |
701 |
// tb->GetInfo()->PrintValueClones(tb->GetName(), clones, tb->GetID(), tb->GetOffset(), lenmax); |
if ( satype == -15 ){ |
702 |
// } |
// |
703 |
} else if (tb->GetType() == 41) { |
setcolor(col,RESET, BLUE, WHITE); |
704 |
printf("41 %-15s = %d\n", tb->GetName(), tb->GetNdata()); |
setcolor(col2,RESET, BLACK, WHITE); |
705 |
// TVirtualCollectionProxy::TPushPop helper(((TBranchElement*) this)->GetCollectionProxy(), fObject); |
sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2); |
706 |
// if (GetInfo()) { |
sprintf(zz,"%s %-15s = ",zz,foglia->GetName()); |
707 |
// GetInfo()->PrintValueSTL(GetName(), ((TBranchElement*) this)->GetCollectionProxy(), fID, fOffset, lenmax); |
while ( j < cl->GetEntriesFast() ){ |
708 |
// } |
if ( j < cl->GetEntriesFast() -1 ){ |
709 |
} else { |
sprintf(o,"%s %f ,",o,stb->GetValue(j,slength)); |
710 |
printf("else %-15s = %d\n", tb->GetName(), tb->GetNdata()); |
sprintf(zz,"%s %f ,",zz,stb->GetValue(j,slength)); |
711 |
// if (GetInfo()) { |
} else { |
712 |
// GetInfo()->PrintValue(GetName(), fObject, fID, -1, lenmax); |
sprintf(o,"%s %f",o,stb->GetValue(j,slength)); |
713 |
// } |
sprintf(zz,"%s %f",zz,stb->GetValue(j,slength)); |
714 |
} |
}; |
715 |
|
j++; |
716 |
|
}; |
717 |
|
}; |
718 |
|
// |
719 |
|
// Array of float |
720 |
|
// |
721 |
|
if ( satype == 5 ){ |
722 |
|
// |
723 |
|
setcolor(col,RESET, BLUE, WHITE); |
724 |
|
setcolor(col2,RESET, BLACK, WHITE); |
725 |
|
sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2); |
726 |
|
sprintf(zz,"%s %-15s = ",zz,foglia->GetName()); |
727 |
|
Bool_t bold = true; |
728 |
|
while ( j < tb->GetNdata() ){ |
729 |
|
if ( bold ){ |
730 |
|
setcolor(col,RESET, BLACK, WHITE); |
731 |
|
sprintf(o,"%s%s",o,col); |
732 |
|
} else { |
733 |
|
setcolor(col,BOLD, BLACK, WHITE); |
734 |
|
sprintf(o,"%s%s",o,col); |
735 |
|
}; |
736 |
|
Int_t jj = 0; |
737 |
|
while ( jj < slength ){ |
738 |
|
if ( jj < slength-1 ){ |
739 |
|
sprintf(o,"%s %f ,",o,stb->GetValue(j,jj,true)); |
740 |
|
sprintf(zz,"%s %f ,",zz,stb->GetValue(j,jj,true)); |
741 |
|
} else { |
742 |
|
sprintf(o,"%s %f",o,stb->GetValue(j,jj,true)); |
743 |
|
sprintf(zz,"%s %f",zz,stb->GetValue(j,jj,true)); |
744 |
|
}; |
745 |
|
jj++; |
746 |
|
}; |
747 |
|
if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); |
748 |
|
if ( j < tb->GetNdata() -1 ) sprintf(zz,"%s ,",zz); |
749 |
|
if ( !bold ){ |
750 |
|
bold = true; |
751 |
|
} else { |
752 |
|
bold = false; |
753 |
|
}; |
754 |
|
j++; |
755 |
|
}; |
756 |
|
if ( bold ){ |
757 |
|
setcolor(col,RESET, BLACK, WHITE); |
758 |
|
sprintf(o,"%s%s",o,col); |
759 |
|
}; |
760 |
|
}; |
761 |
|
// |
762 |
|
// Array of integers |
763 |
|
// |
764 |
|
if ( satype == 3 ){ |
765 |
|
// |
766 |
|
setcolor(col,RESET, BLUE, WHITE); |
767 |
|
setcolor(col2,RESET, BLACK, WHITE); |
768 |
|
sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2); |
769 |
|
sprintf(zz,"%s %-15s = ",zz,foglia->GetName()); |
770 |
|
while ( j < tb->GetNdata() ){ |
771 |
|
Int_t jj = 0; |
772 |
|
while ( jj < slength ){ |
773 |
|
if ( jj < slength-1 ){ |
774 |
|
sprintf(o,"%s %i ,",o,(Int_t)stb->GetValue(j,jj,true)); |
775 |
|
sprintf(zz,"%s %i ,",zz,(Int_t)stb->GetValue(j,jj,true)); |
776 |
|
} else { |
777 |
|
sprintf(o,"%s %i",o,(Int_t)stb->GetValue(j,jj,true)); |
778 |
|
sprintf(zz,"%s %i",zz,(Int_t)stb->GetValue(j,jj,true)); |
779 |
|
}; |
780 |
|
jj++; |
781 |
|
}; |
782 |
|
if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); |
783 |
|
if ( j < tb->GetNdata() -1 ) sprintf(zz,"%s ,",zz); |
784 |
|
j++; |
785 |
|
}; |
786 |
|
}; |
787 |
|
|
788 |
// }; |
// |
789 |
printf("esco qui\n"); |
// TArray |
790 |
|
// |
791 |
|
if ( satype == 42 ){ |
792 |
|
// |
793 |
|
// determine offset to fetch data |
794 |
|
// |
795 |
|
int thisoffset = 0; |
796 |
|
TRealData *rd = myc->GetRealData(foglia->GetName()); |
797 |
|
if ( rd ){ |
798 |
|
thisoffset = rd->GetThisOffset(); |
799 |
|
}; |
800 |
|
Int_t niente = 0; |
801 |
|
TStreamerElement *tste = stb->GetInfo()->GetStreamerElement(rd->GetName(),niente); |
802 |
|
// |
803 |
|
// TArrayI |
804 |
|
// |
805 |
|
if ( !strcmp(tste->GetTypeName(),"TArrayI") ){ |
806 |
|
// |
807 |
|
char *pointer = (char*)cl->UncheckedAt(0); |
808 |
|
char *pu = pointer + thisoffset; |
809 |
|
TArrayI *arr = (TArrayI*)(pu); |
810 |
|
Int_t jj=0; |
811 |
|
Int_t arlen = min(arr->GetSize(),dlen); |
812 |
|
// |
813 |
|
setcolor(col,RESET, BLUE, WHITE); |
814 |
|
setcolor(col2,RESET, BLACK, WHITE); |
815 |
|
sprintf(o,"%s%s %s[%i]%s = ",o,col,foglia->GetName(),arr->GetSize(),col2); |
816 |
|
sprintf(zz,"%s %s[%i] = ",zz,foglia->GetName(),arr->GetSize()); |
817 |
|
// |
818 |
|
while ( j < tb->GetNdata() ){ |
819 |
|
// |
820 |
|
pointer = (char*)cl->UncheckedAt(j); |
821 |
|
pu = pointer + thisoffset; |
822 |
|
arr = (TArrayI*)(pu); |
823 |
|
// |
824 |
|
while ( jj < arlen ){ |
825 |
|
if ( jj < arlen-1 ){ |
826 |
|
sprintf(o,"%s %i ,",o,arr->At(jj)); |
827 |
|
sprintf(zz,"%s %i ,",zz,arr->At(jj)); |
828 |
|
} else { |
829 |
|
sprintf(o,"%s %i",o,arr->At(jj)); |
830 |
|
sprintf(zz,"%s %i",zz,arr->At(jj)); |
831 |
|
}; |
832 |
|
jj++; |
833 |
|
}; |
834 |
|
if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); |
835 |
|
if ( j < tb->GetNdata() -1 ) sprintf(zz,"%s ,",zz); |
836 |
|
j++; |
837 |
|
}; |
838 |
|
}; |
839 |
|
// |
840 |
|
// TArrayF |
841 |
|
// |
842 |
|
if ( !strcmp(tste->GetTypeName(),"TArrayF") ){ |
843 |
|
// |
844 |
|
char *pointer = (char*)cl->UncheckedAt(0); |
845 |
|
char *pu = pointer + thisoffset; |
846 |
|
TArrayF *arr = (TArrayF*)(pu); |
847 |
|
Int_t jj=0; |
848 |
|
Int_t arlen = min(arr->GetSize(),dlen); |
849 |
|
// |
850 |
|
setcolor(col,RESET, BLUE, WHITE); |
851 |
|
setcolor(col2,RESET, BLACK, WHITE); |
852 |
|
sprintf(o,"%s%s %s[%i]%s = ",o,col,foglia->GetName(),arr->GetSize(),col2); |
853 |
|
sprintf(zz,"%s %s[%i] = ",zz,foglia->GetName(),arr->GetSize()); |
854 |
|
// |
855 |
|
while ( j < tb->GetNdata() ){ |
856 |
|
// |
857 |
|
pointer = (char*)cl->UncheckedAt(j); |
858 |
|
pu = pointer + thisoffset; |
859 |
|
arr = (TArrayF*)(pu); |
860 |
|
// |
861 |
|
while ( jj < arlen ){ |
862 |
|
if ( jj < arlen-1 ){ |
863 |
|
sprintf(o,"%s %f ,",o,arr->At(jj)); |
864 |
|
sprintf(zz,"%s %f ,",zz,arr->At(jj)); |
865 |
|
} else { |
866 |
|
sprintf(o,"%s %f",o,arr->At(jj)); |
867 |
|
sprintf(zz,"%s %f",zz,arr->At(jj)); |
868 |
|
}; |
869 |
|
jj++; |
870 |
|
}; |
871 |
|
if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); |
872 |
|
if ( j < tb->GetNdata() -1 ) sprintf(zz,"%s ,",zz); |
873 |
|
j++; |
874 |
|
}; |
875 |
|
}; |
876 |
|
}; |
877 |
|
sprintf(o,"%s\n",o); |
878 |
|
sprintf(zz,"%s\n",zz); |
879 |
|
break; |
880 |
|
}; |
881 |
|
}; |
882 |
|
}; |
883 |
|
}; |
884 |
|
break; |
885 |
|
}; |
886 |
|
}; |
887 |
|
printf("%s\n",o); |
888 |
|
pamgui->DIALOG(4,zz); |
889 |
}; |
}; |
890 |
|
|
|
void FEVdetector::PrintData(TTree *tree, Long64_t entry=-1LL,Int_t lenmax=44){ |
|
|
// -- Print values of all active leaves for entry. |
|
|
// |
|
|
// if entry==-1, print current entry (default) |
|
|
// if a leaf is an array, a maximum of lenmax elements is printed. |
|
|
// |
|
|
if (entry != -1) { |
|
|
tree->GetEntry(entry); |
|
|
} |
|
|
// printf("======> EVENT:%lld\n", thisentry); |
|
|
printf("======> EVENT:%i\n", thisentry); |
|
|
TObjArray* leaves = tree->GetListOfLeaves(); // |
|
|
Int_t nleaves = leaves->GetEntriesFast(); |
|
|
Int_t ltype; |
|
|
for (Int_t i = 0; i < nleaves; i++) { |
|
|
TLeaf* leaf = (TLeaf*) leaves->UncheckedAt(i); |
|
|
TBranch* branch = leaf->GetBranch(); |
|
|
// if (branch->TestBit(kDoNotProcess)) { |
|
|
// continue; |
|
|
// } |
|
|
Int_t len = leaf->GetLen(); |
|
|
if (len <= 0) { |
|
|
continue; |
|
|
} |
|
|
len = TMath::Min(len, lenmax); |
|
|
if (leaf->IsA() == TLeafElement::Class()) { |
|
|
// Double_t value = leaf->GetValue(lenmax); |
|
|
//printf(" ioqui %f \n",value); |
|
|
// ((TBranchElement*)leaf->GetBranch())->PrintValue(i); |
|
|
this->PrintLeaves(otr,i,((TBranchElement*)leaf->GetBranch()), lenmax); |
|
|
//leaf->PrintValue(lenmax); |
|
|
continue; |
|
|
} |
|
|
if (branch->GetListOfBranches()->GetEntriesFast() > 0) { |
|
|
continue; |
|
|
} |
|
|
ltype = 10; |
|
|
if (leaf->IsA() == TLeafF::Class()) { |
|
|
ltype = 5; |
|
|
} |
|
|
if (leaf->IsA() == TLeafD::Class()) { |
|
|
ltype = 5; |
|
|
} |
|
|
if (leaf->IsA() == TLeafC::Class()) { |
|
|
len = 1; |
|
|
ltype = 5; |
|
|
}; |
|
|
printf(" %-15s = ", leaf->GetName()); |
|
|
for (Int_t l = 0; l < len; l++) { |
|
|
Double_t value = leaf->GetValue(l); |
|
|
printf(" ioqui %f \n",value); |
|
|
// leaf->PrintValue(l); |
|
|
if (l == (len - 1)) { |
|
|
printf("\n"); |
|
|
continue; |
|
|
} |
|
|
printf(", "); |
|
|
if ((l % ltype) == 0) { |
|
|
printf("\n "); |
|
|
} |
|
|
} |
|
|
} |
|
|
}; |
|
891 |
|
|
892 |
void FEVdetector::GetGeneralInfo(){ |
void FEVdetector::GetGeneralInfo(){ |
893 |
// |
// |
898 |
headcold = headc; |
headcold = headc; |
899 |
headc = ph->Counter; |
headc = ph->Counter; |
900 |
var.headc = (int)ph->Counter; |
var.headc = (int)ph->Counter; |
901 |
OBT = ph->OrbitalTime; |
OBT = (UInt_t)ph->OrbitalTime; |
902 |
DOBT = OBT - OOBT; |
DOBT = OBT - OOBT; |
903 |
OOBT = OBT; |
OOBT = OBT; |
904 |
if ( thisentry == minevent || DOBT < 0 || (headc-headcold-1)!=0 ) DOBT = 0; |
if ( thisentry == minevent || DOBT < 0 || (headc-headcold-1)!=0 ) DOBT = 0; |
934 |
trcs = (TString)trc.str().c_str(); |
trcs = (TString)trc.str().c_str(); |
935 |
} else { |
} else { |
936 |
headcold = headc; |
headcold = headc; |
937 |
headc = L2->GetOrbitalInfo()->pkt_num; // to be changed as soon as we will have obt in the level2 file! |
if ( var.RUN ){ |
938 |
OBT = L2->GetOrbitalInfo()->OBT; // to be changed as soon as we will have obt in the level2 file! |
var.idrun = L2->GetRunInfo()->ID; |
939 |
DOBT = OBT - OOBT; |
var.idroot = L2->GetRunInfo()->ID_ROOT_L0; |
940 |
OOBT = OBT; |
var.EVF = L2->GetRunInfo()->EV_FROM; |
941 |
if ( thisentry == minevent || DOBT < 0 || (headc-headcold-1)!=0 ) DOBT = 0; |
}; |
942 |
var.etime = OBT; |
if ( var.ORB ){ |
943 |
|
headc = L2->GetOrbitalInfo()->pkt_num; |
944 |
|
OBT = L2->GetOrbitalInfo()->OBT; |
945 |
|
DOBT = OBT - OOBT; |
946 |
|
OOBT = OBT; |
947 |
|
if ( thisentry == minevent || DOBT < 0 || (headc-headcold-1)!=0 ) DOBT = 0; |
948 |
|
var.etime = OBT; |
949 |
|
} else { |
950 |
|
var.etime = 0; |
951 |
|
}; |
952 |
// |
// |
953 |
// who gave the trigger? |
// who gave the trigger? |
954 |
// |
// |
955 |
calotrig = 0; |
Int_t trigconf = 0; |
956 |
if ( L2->GetTrigLevel2()->patterntrig[0] ) calotrig = 1; |
if ( var.TRG ){ |
957 |
toftrig = 0; |
calotrig = 0; |
958 |
if ( L2->GetTrigLevel2()->patterntrig[2] || L2->GetTrigLevel2()->patterntrig[3] || L2->GetTrigLevel2()->patterntrig[4] || L2->GetTrigLevel2()->patterntrig[5] ) toftrig = 1; |
if ( L2->GetTrigLevel2()->patterntrig[0] ) calotrig = 1; |
959 |
s4pulser = 0; |
toftrig = 0; |
960 |
if ( L2->GetTrigLevel2()->patterntrig[1] & (1<<0) ) s4pulser = 1; |
if ( L2->GetTrigLevel2()->patterntrig[2] || L2->GetTrigLevel2()->patterntrig[3] || L2->GetTrigLevel2()->patterntrig[4] || L2->GetTrigLevel2()->patterntrig[5] ) toftrig = 1; |
961 |
// |
s4pulser = 0; |
962 |
// TOF and calorimeter when giving a trigger will always set this flag since the time window of the signal is greater than 100 ns. |
if ( L2->GetTrigLevel2()->patterntrig[1] & (1<<0) ) s4pulser = 1; |
963 |
// S4 sometimes could not set the flag even if the trigger is given. This is a workaround to fix this "bug": |
// |
964 |
// |
// TOF and calorimeter when giving a trigger will always set this flag since the time window of the signal is greater than 100 ns. |
965 |
if ( !calotrig && !toftrig ) s4pulser = 1; |
// S4 sometimes could not set the flag even if the trigger is given. This is a workaround to fix this "bug": |
966 |
// |
// |
967 |
Int_t trigconf = L2->GetTrigLevel2()->trigconf; |
if ( !calotrig && !toftrig ) s4pulser = 1; |
968 |
|
// |
969 |
|
trigconf = L2->GetTrigLevel2()->trigconf; |
970 |
|
} else { |
971 |
|
trigconf = 0; |
972 |
|
} |
973 |
stringstream trc; |
stringstream trc; |
974 |
trc.str(""); |
trc.str(""); |
975 |
if ( trigconf & (1<<0) ) trc << "TOF1"; |
if ( trigconf & (1<<0) ) trc << "TOF1"; |
1057 |
// |
// |
1058 |
if ( level.file == 2 ){ |
if ( level.file == 2 ){ |
1059 |
cintcom.str(""); |
cintcom.str(""); |
1060 |
cintcom << "PamLevel2 *L2 = (PamLevel2*)0x" << hex; |
cintcom << "PamLevel2 *L2 = (PamLevel2*)" << hex; //con const e l2 funziona |
1061 |
cintcom << L2; |
cintcom << L2; |
1062 |
gROOT->ProcessLine(cintcom.str().c_str()); |
gROOT->ProcessLine(cintcom.str().c_str()); |
1063 |
|
// printf(" comando: %s \n",cintcom.str().c_str()); |
1064 |
} else { |
} else { |
1065 |
cintcom.str(""); |
cintcom.str(""); |
1066 |
cintcom << "TTree *otr = (TTree*)0x" << hex; |
cintcom << "TTree *otr = (TTree*)" << hex; |
1067 |
cintcom << otr; |
cintcom << otr; |
1068 |
gROOT->ProcessLine(cintcom.str().c_str()); |
gROOT->ProcessLine(cintcom.str().c_str()); |
1069 |
// |
// |
1070 |
cintcom.str(""); |
cintcom.str(""); |
1071 |
cintcom << "struct Variables &var = (struct Variables &)0x" << hex; |
cintcom << "struct Variables &var = (struct Variables &)" << hex; |
1072 |
cintcom << &var; |
cintcom << &var; |
1073 |
gROOT->ProcessLine(cintcom.str().c_str()); |
gROOT->ProcessLine(cintcom.str().c_str()); |
1074 |
}; |
}; |
1079 |
// |
// |
1080 |
if ( level.file == -1 ) isOK = gApplication->ProcessLine("filter((TTree *)otr,-1,(Variables &)var);"); |
if ( level.file == -1 ) isOK = gApplication->ProcessLine("filter((TTree *)otr,-1,(Variables &)var);"); |
1081 |
// |
// |
1082 |
if ( level.file == 2 ) isOK = gApplication->ProcessLine("filter((PamLevel2 *)L2,2);"); |
// if ( level.file == 2 ) isOK = gApplication->ProcessLine("filter((PamLevel2 *)L2,2);"); |
1083 |
|
if ( level.file == 2 ) isOK = gApplication->ProcessLine("filter();"); |
1084 |
// |
// |
1085 |
// progress bar in text window |
// progress bar in text window |
1086 |
// |
// |
1093 |
// |
// |
1094 |
} |
} |
1095 |
|
|
1096 |
Int_t FEVdetector::Load(TTree &mainotr, TFile &mainfile){ |
TChain* FEVdetector::Load(TString file){ |
1097 |
file = &mainfile; |
// |
1098 |
otr = &mainotr; |
// file = &mainfile; |
|
L2 = new PamLevel2(); |
|
1099 |
// |
// |
1100 |
if ( level.file == 2 ){ |
if ( level.file == 2 ){ |
1101 |
// otr = L2->LoadPamTrees(file); |
// |
1102 |
// printf(" %s \n",ddec.Data()); |
// printf(" %s \n",ddec.Data()); |
1103 |
otr = L2->GetPamTree(file,ddec.Data()); |
if ( !L2 ){ |
1104 |
|
L2 = new PamLevel2("",file.Data(),ddec.Data()); |
1105 |
|
otr = L2->GetPamTree(); |
1106 |
|
// printf(" l2 constructor\n"); |
1107 |
|
// printf(" abst %u obt %u qtot %f \n",L2->GetOrbitalInfo()->absTime,L2->GetOrbitalInfo()->OBT,L2->GetCaloLevel2()->qtot); |
1108 |
|
} else { |
1109 |
|
// |
1110 |
|
// printf(" l2 already exist \n"); |
1111 |
|
otr = L2->GetPamTree(gSystem->DirName(file.Data()),file.Data(),ddec.Data()); |
1112 |
|
L2->GetRunTree(gSystem->DirName(file.Data()),file.Data()); |
1113 |
|
// |
1114 |
|
}; |
1115 |
|
// |
1116 |
// |
// |
1117 |
if ( !otr ) return(0); |
if ( !otr ) return(0); |
|
// ******************** |
|
|
// load magnetic field |
|
|
// ******************** |
|
|
const char *pam_calib = pathtocalibration(); |
|
1118 |
// |
// |
1119 |
stringstream magfie; |
// otr->CanDeleteRefs(true); |
1120 |
magfie.str(""); |
// if ( runtree ) runtree->CanDeleteRefs(true); |
|
// magfie << "/localdisk/mocchiut/test/calib/trk-param/field_param-0/"; |
|
|
magfie << pam_calib; |
|
|
magfie << "/trk-param/field_param-0/"; |
|
1121 |
// |
// |
|
L2->GetTrkLevel2()->LoadField(magfie.str().c_str()); |
|
1122 |
} else { |
} else { |
1123 |
// |
// |
1124 |
// load calorimeter ADC2MIP conversion file |
// load calorimeter ADC2MIP conversion file |
1159 |
}; |
}; |
1160 |
// |
// |
1161 |
// |
// |
1162 |
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(); |
|
1163 |
// |
// |
1164 |
if ( level.file == 0 || level.file == -1 ){ |
if ( level.file == 0 || level.file == -1 ){ |
1165 |
|
// |
1166 |
|
trigger = new pamela::trigger::TriggerEvent(); |
1167 |
|
eh = new pamela::EventHeader(); |
1168 |
|
ph = new pamela::PscuHeader(); |
1169 |
|
de = new pamela::calorimeter::CalorimeterEvent(); |
1170 |
|
trk = new pamela::tracker::TrackerEvent(); |
1171 |
|
ne = new pamela::neutron::NeutronEvent(); |
1172 |
|
ace = new pamela::anticounter::AnticounterEvent(); |
1173 |
|
s4 = new pamela::S4::S4Event(); |
1174 |
|
tof = new pamela::tof::TofEvent(); |
1175 |
|
// |
1176 |
|
otr = new TChain("Physics"); |
1177 |
|
otr->Add(file.Data(),-1); |
1178 |
otr->SetBranchAddress("Trigger", &trigger); |
otr->SetBranchAddress("Trigger", &trigger); |
1179 |
otr->SetBranchAddress("Header", &eh); |
otr->SetBranchAddress("Header", &eh); |
1180 |
}; |
}; |
|
if ( level.file == 2 && var.RUN){ |
|
|
// otr->AddFriend("OrbitalInfo", file); |
|
|
// otr->SetBranchAddress("OrbitalInfo", &oinfoL2); |
|
|
runinfo->Read(0ULL); |
|
|
}; |
|
1181 |
// |
// |
1182 |
if ( var.TRK ) { |
if ( var.TRK ) { |
1183 |
if ( level.file == 0 || level.file == -1 ){ |
if ( level.file == 0 || level.file == -1 ){ |
1250 |
}; |
}; |
1251 |
}; |
}; |
1252 |
// |
// |
1253 |
return(1); |
if ( !otr ){ |
1254 |
|
return(0); |
1255 |
|
}; |
1256 |
|
// |
1257 |
|
return otr; |
1258 |
// |
// |
1259 |
} |
} |
1260 |
|
|
1330 |
text->DrawLatex(0.33,txthi,testo.str().c_str()); |
text->DrawLatex(0.33,txthi,testo.str().c_str()); |
1331 |
txthi -= 0.03; |
txthi -= 0.03; |
1332 |
testo2.str(""); |
testo2.str(""); |
1333 |
testo2 << "On Board Time: " << (int)OBT; |
testo2 << "On Board Time: " << (unsigned int)OBT; |
1334 |
if ( DOBT > 0 ) { |
if ( DOBT > 0 ) { |
1335 |
testo2 << " (delta: " << (int)DOBT; |
testo2 << " (delta: " << (unsigned int)DOBT; |
1336 |
testo2 << ")"; |
testo2 << ")"; |
1337 |
}; |
}; |
1338 |
testo2 << " [ms]"; |
testo2 << " [ms]"; |
1490 |
text->DrawLatex(var.xxvc+0.17*var.sfx,var.yxvc-0.08*var.sfy,"CAS1"); |
text->DrawLatex(var.xxvc+0.17*var.sfx,var.yxvc-0.08*var.sfy,"CAS1"); |
1491 |
text->DrawLatex(var.xyvc-0.192*var.sfx,var.yyvc-0.08*var.sfy,"CAS4"); |
text->DrawLatex(var.xyvc-0.192*var.sfx,var.yyvc-0.08*var.sfy,"CAS4"); |
1492 |
text->DrawLatex(var.xyvc+0.17*var.sfx,var.yyvc-0.08*var.sfy,"CAS3"); |
text->DrawLatex(var.xyvc+0.17*var.sfx,var.yyvc-0.08*var.sfy,"CAS3"); |
1493 |
text->DrawLatex(var.xxvc-0.192*var.sfx,var.yxvc+0.48*var.sfy,"CARD2"); |
text->DrawLatex(var.xxvc-0.222*var.sfx,var.yxvc+0.48*var.sfy,"CARD2"); |
1494 |
text->DrawLatex(var.xxvc+0.155*var.sfx,var.yxvc+0.48*var.sfy,"CARD3"); |
text->DrawLatex(var.xxvc+0.185*var.sfx,var.yxvc+0.48*var.sfy,"CARD3"); |
1495 |
text->DrawLatex(var.xyvc-0.170*var.sfx,var.yyvc+0.48*var.sfy,"CARD1"); |
text->DrawLatex(var.xyvc-0.190*var.sfx,var.yyvc+0.48*var.sfy,"CARD1"); |
1496 |
text->DrawLatex(var.xyvc+0.13*var.sfx,var.yyvc+0.48*var.sfy,"CARD4"); |
text->DrawLatex(var.xyvc+0.16*var.sfx,var.yyvc+0.48*var.sfy,"CARD4"); |
1497 |
text->DrawLatex(var.xxvc-0.192*var.sfx,var.yxvc+0.39*var.sfy,"CAT3"); |
text->DrawLatex(var.xxvc-0.192*var.sfx,var.yxvc+0.39*var.sfy,"CAT3"); |
1498 |
text->DrawLatex(var.xxvc+0.155*var.sfx,var.yxvc+0.39*var.sfy,"CAT4"); |
text->DrawLatex(var.xxvc+0.155*var.sfx,var.yxvc+0.39*var.sfy,"CAT4"); |
1499 |
text->DrawLatex(var.xyvc-0.170*var.sfx,var.yyvc+0.39*var.sfy,"CAT2"); |
text->DrawLatex(var.xyvc-0.170*var.sfx,var.yyvc+0.39*var.sfy,"CAT2"); |
1621 |
// |
// |
1622 |
// print infos on terminal |
// print infos on terminal |
1623 |
// |
// |
1624 |
|
// if ( !var.selex ){ |
1625 |
printf(" File: %s \n",var.thefilename.Data()); |
printf(" File: %s \n",var.thefilename.Data()); |
1626 |
if ( !s4pulser && !calotrig ){ |
if ( !s4pulser && !calotrig ){ |
1627 |
printf(" Pkt_num: %i - Progressive number: %i \n",(int)headc,thisentry+1); |
printf(" Pkt_num: %i - Progressive number: %i \n",(int)headc,thisentry+1); |
1632 |
if ( calotrig ){ |
if ( calotrig ){ |
1633 |
printf(" Pkt_num: %i - Progressive number: %i - CALO trigger -\n",(int)headc,thisentry+1); |
printf(" Pkt_num: %i - Progressive number: %i - CALO trigger -\n",(int)headc,thisentry+1); |
1634 |
}; |
}; |
1635 |
printf(" On Board Time: %i (delta %i) [ms]\n",OBT,DOBT); |
printf(" On Board Time: %u (delta %i) [ms]\n",OBT,DOBT); |
1636 |
const char *trc2 = trcs; |
const char *trc2 = trcs; |
1637 |
printf(" TRIGGER: %s \n",trc2); |
printf(" TRIGGER: %s \n",trc2); |
1638 |
printf(" AC: CARD hit = %i CAT hit = %i CAS hit = %i \n",var.hcard,var.hcat,var.hcas); |
printf(" AC: CARD hit = %i CAT hit = %i CAS hit = %i \n",var.hcard,var.hcat,var.hcas); |
1644 |
printf(" CALO: NSTRIP = %i QTOT = %i [MIP]\n",var.nstrip,var.qtot); |
printf(" CALO: NSTRIP = %i QTOT = %i [MIP]\n",var.nstrip,var.qtot); |
1645 |
printf(" S4: %.2f [MIP] TOF: beta = %.2f \n",var.s4sig,var.beta[4]); |
printf(" S4: %.2f [MIP] TOF: beta = %.2f \n",var.s4sig,var.beta[4]); |
1646 |
printf(" ND: Trigger: neutrons = %i - Background: upper = %i lower = %i \n",var.trup,var.bkup,var.bkbo); |
printf(" ND: Trigger: neutrons = %i - Background: upper = %i lower = %i \n",var.trup,var.bkup,var.bkbo); |
1647 |
|
// }; |
1648 |
// |
// |
1649 |
} |
} |
1650 |
|
|
1952 |
void FEVdetector::ShowTOF(){ |
void FEVdetector::ShowTOF(){ |
1953 |
// |
// |
1954 |
// |
// |
|
// |
|
1955 |
if ( !var.TOF ) return; |
if ( !var.TOF ) return; |
1956 |
// |
// |
1957 |
Int_t tt = 0; |
Int_t tt = 0; |
1958 |
|
Int_t rj = 0; |
1959 |
// |
// |
1960 |
// force level0, i.e. show patterntrig variable! |
// force level0, i.e. show patterntrig variable! |
1961 |
// |
// |
1985 |
Float_t mt31[2][3]; |
Float_t mt31[2][3]; |
1986 |
Float_t mt32[2][3]; |
Float_t mt32[2][3]; |
1987 |
// |
// |
1988 |
|
memset(mt11,0,2*8*sizeof(Float_t)); |
1989 |
|
memset(mt12,0,2*6*sizeof(Float_t)); |
1990 |
|
memset(mt21,0,2*2*sizeof(Float_t)); |
1991 |
|
memset(mt22,0,2*2*sizeof(Float_t)); |
1992 |
|
memset(mt31,0,2*3*sizeof(Float_t)); |
1993 |
|
memset(mt32,0,2*3*sizeof(Float_t)); |
1994 |
|
// |
1995 |
Int_t S3 = 0; |
Int_t S3 = 0; |
1996 |
Int_t S2 = 0; |
Int_t S2 = 0; |
1997 |
Int_t S12 = 0; |
Int_t S12 = 0; |
2156 |
Float_t s12p = 0.055; |
Float_t s12p = 0.055; |
2157 |
ocolo = 10; |
ocolo = 10; |
2158 |
TPolyLine *ftof12ya[6]; |
TPolyLine *ftof12ya[6]; |
2159 |
|
rj=6; |
2160 |
for ( Int_t j=0; j<6; j++){ |
for ( Int_t j=0; j<6; j++){ |
2161 |
|
rj--; |
2162 |
Float_t xc1[4]={ (s12p*j), s12p*(j), s12p*(j+1), (s12p*j)}; |
Float_t xc1[4]={ (s12p*j), s12p*(j), s12p*(j+1), (s12p*j)}; |
2163 |
Float_t yc1[4]={ -ws13, 0., 0., -ws13}; |
Float_t yc1[4]={ -ws13, 0., 0., -ws13}; |
2164 |
Float_t xc[4]; |
Float_t xc[4]; |
2174 |
} else { |
} else { |
2175 |
colo = 1; |
colo = 1; |
2176 |
}; |
}; |
2177 |
ColorMIP(ms12a[j],colo); |
ColorMIP(ms12a[rj],colo); |
2178 |
// |
// |
2179 |
if ( colo != 10 ) ocolo = colo; |
if ( colo != 10 ) ocolo = colo; |
2180 |
if ( mt12[0][j] == 4095. ) colo = noadc; |
if ( mt12[0][rj] == 4095. ) colo = noadc; |
2181 |
// |
// |
2182 |
ftof12ya[j]->SetFillColor(colo); |
ftof12ya[j]->SetFillColor(colo); |
2183 |
ftof12ya[j]->SetLineWidth(1); |
ftof12ya[j]->SetLineWidth(1); |
2187 |
// B |
// B |
2188 |
s12p = 0.055; |
s12p = 0.055; |
2189 |
TPolyLine *ftof12yb[6]; |
TPolyLine *ftof12yb[6]; |
2190 |
|
rj=6; |
2191 |
for ( Int_t j=0; j<6; j++){ |
for ( Int_t j=0; j<6; j++){ |
2192 |
|
rj--; |
2193 |
Float_t xc1[4]={ (s12p*j), s12p*(j+1), s12p*(j+1), (s12p*j)}; |
Float_t xc1[4]={ (s12p*j), s12p*(j+1), s12p*(j+1), (s12p*j)}; |
2194 |
Float_t yc1[4]={ -ws13, -ws13, 0., -ws13}; |
Float_t yc1[4]={ -ws13, -ws13, 0., -ws13}; |
2195 |
Float_t xc[4]; |
Float_t xc[4]; |
2205 |
} else { |
} else { |
2206 |
colo = 1; |
colo = 1; |
2207 |
}; |
}; |
2208 |
ColorMIP(ms12b[j],colo); |
ColorMIP(ms12b[rj],colo); |
2209 |
// |
// |
2210 |
if ( colo != 10 ) ocolo = colo; |
if ( colo != 10 ) ocolo = colo; |
2211 |
if ( mt12[1][j] == 4095. ) colo = noadc; |
if ( mt12[1][rj] == 4095. ) colo = noadc; |
2212 |
// |
// |
2213 |
ftof12yb[j]->SetFillColor(colo); |
ftof12yb[j]->SetFillColor(colo); |
2214 |
ftof12yb[j]->SetLineWidth(1); |
ftof12yb[j]->SetLineWidth(1); |
2242 |
Float_t s21p = 0.075; |
Float_t s21p = 0.075; |
2243 |
ocolo = 10; |
ocolo = 10; |
2244 |
TPolyLine *ftof21ya[2]; |
TPolyLine *ftof21ya[2]; |
2245 |
|
rj=2; |
2246 |
for ( Int_t j=0; j<2; j++){ |
for ( Int_t j=0; j<2; j++){ |
2247 |
|
rj--; |
2248 |
Float_t xc1[4]={ s21p*(j-1), s21p*(j-1), s21p*j, s21p*(j-1)}; |
Float_t xc1[4]={ s21p*(j-1), s21p*(j-1), s21p*j, s21p*(j-1)}; |
2249 |
Float_t yc1[4]={ 0., ws2, ws2, 0.}; |
Float_t yc1[4]={ 0., ws2, ws2, 0.}; |
2250 |
Float_t xc[4]; |
Float_t xc[4]; |
2260 |
} else { |
} else { |
2261 |
colo = 1; |
colo = 1; |
2262 |
}; |
}; |
2263 |
ColorMIP(ms21a[j],colo); |
ColorMIP(ms21a[rj],colo); |
2264 |
// |
// |
2265 |
if ( colo != 10 ) ocolo = colo; |
if ( colo != 10 ) ocolo = colo; |
2266 |
if ( mt21[0][j] == 4095. ) colo = noadc; |
if ( mt21[0][rj] == 4095. ) colo = noadc; |
2267 |
// |
// |
2268 |
ftof21ya[j]->SetFillColor(colo); |
ftof21ya[j]->SetFillColor(colo); |
2269 |
ftof21ya[j]->SetLineWidth(1); |
ftof21ya[j]->SetLineWidth(1); |
2273 |
// B |
// B |
2274 |
s21p = 0.075; |
s21p = 0.075; |
2275 |
TPolyLine *ftof21yb[2]; |
TPolyLine *ftof21yb[2]; |
2276 |
|
rj=2; |
2277 |
for ( Int_t j=0; j<2; j++){ |
for ( Int_t j=0; j<2; j++){ |
2278 |
|
rj--; |
2279 |
Float_t xc1[4]={ s21p*(j-1), s21p*j, s21p*j, s21p*(j-1)}; |
Float_t xc1[4]={ s21p*(j-1), s21p*j, s21p*j, s21p*(j-1)}; |
2280 |
Float_t yc1[4]={ 0., 0., ws2, 0.}; |
Float_t yc1[4]={ 0., 0., ws2, 0.}; |
2281 |
Float_t xc[4]; |
Float_t xc[4]; |
2291 |
} else { |
} else { |
2292 |
colo = 1; |
colo = 1; |
2293 |
}; |
}; |
2294 |
ColorMIP(ms21b[j],colo); |
ColorMIP(ms21b[rj],colo); |
2295 |
// |
// |
2296 |
if ( colo != 10 ) ocolo = colo; |
if ( colo != 10 ) ocolo = colo; |
2297 |
if ( mt21[1][j] == 4095. ) colo = noadc; |
if ( mt21[1][rj] == 4095. ) colo = noadc; |
2298 |
// |
// |
2299 |
ftof21yb[j]->SetFillColor(colo); |
ftof21yb[j]->SetFillColor(colo); |
2300 |
ftof21yb[j]->SetLineWidth(1); |
ftof21yb[j]->SetLineWidth(1); |
2409 |
Float_t s31p = 0.060; |
Float_t s31p = 0.060; |
2410 |
ocolo = 10; |
ocolo = 10; |
2411 |
TPolyLine *ftof31xa[3]; |
TPolyLine *ftof31xa[3]; |
2412 |
|
rj=3; |
2413 |
for ( Int_t j=0; j<3; j++){ |
for ( Int_t j=0; j<3; j++){ |
2414 |
|
rj--; |
2415 |
Float_t xc1[4]={ (s31p*j), (s31p*j), s31p*(j+1), (s31p*j)}; |
Float_t xc1[4]={ (s31p*j), (s31p*j), s31p*(j+1), (s31p*j)}; |
2416 |
Float_t yc1[4]={ 0., ws13, ws13, 0.}; |
Float_t yc1[4]={ 0., ws13, ws13, 0.}; |
2417 |
Float_t xc[4]; |
Float_t xc[4]; |
2427 |
} else { |
} else { |
2428 |
colo = 1; |
colo = 1; |
2429 |
}; |
}; |
2430 |
ColorMIP(ms31a[j],colo); |
ColorMIP(ms31a[rj],colo); |
2431 |
// |
// |
2432 |
if ( colo != 10 ) ocolo = colo; |
if ( colo != 10 ) ocolo = colo; |
2433 |
if ( mt31[0][j] == 4095. ) colo = noadc; |
if ( mt31[0][rj] == 4095. ) colo = noadc; |
2434 |
// |
// |
2435 |
ftof31xa[j]->SetFillColor(colo); |
ftof31xa[j]->SetFillColor(colo); |
2436 |
ftof31xa[j]->SetLineWidth(1); |
ftof31xa[j]->SetLineWidth(1); |
2440 |
// B |
// B |
2441 |
s31p = 0.060; |
s31p = 0.060; |
2442 |
TPolyLine *ftof31xb[3]; |
TPolyLine *ftof31xb[3]; |
2443 |
|
rj=3; |
2444 |
for ( Int_t j=0; j<3; j++){ |
for ( Int_t j=0; j<3; j++){ |
2445 |
|
rj--; |
2446 |
Float_t xc1[4]={ (s31p*j), s31p*(j+1), s31p*(j+1), (s31p*j)}; |
Float_t xc1[4]={ (s31p*j), s31p*(j+1), s31p*(j+1), (s31p*j)}; |
2447 |
Float_t yc1[4]={ 0., 0., ws13, 0.}; |
Float_t yc1[4]={ 0., 0., ws13, 0.}; |
2448 |
Float_t xc[4]; |
Float_t xc[4]; |
2458 |
} else { |
} else { |
2459 |
colo = 1; |
colo = 1; |
2460 |
}; |
}; |
2461 |
ColorMIP(ms31b[j],colo); |
ColorMIP(ms31b[rj],colo); |
2462 |
// |
// |
2463 |
if ( colo != 10 ) ocolo = colo; |
if ( colo != 10 ) ocolo = colo; |
2464 |
if ( mt31[1][j] == 4095. ) colo = noadc; |
if ( mt31[1][rj] == 4095. ) colo = noadc; |
2465 |
// |
// |
2466 |
ftof31xb[j]->SetFillColor(colo); |
ftof31xb[j]->SetFillColor(colo); |
2467 |
ftof31xb[j]->SetLineWidth(1); |
ftof31xb[j]->SetLineWidth(1); |
2493 |
Float_t s32p = 0.050; |
Float_t s32p = 0.050; |
2494 |
ocolo = 10; |
ocolo = 10; |
2495 |
TPolyLine *ftof32ya[3]; |
TPolyLine *ftof32ya[3]; |
2496 |
|
rj=3; |
2497 |
for ( Int_t j=0; j<3; j++){ |
for ( Int_t j=0; j<3; j++){ |
2498 |
|
rj--; |
2499 |
Float_t xc1[4]={ (s32p*j), (s32p*j), s32p*(j+1), (s32p*j)}; |
Float_t xc1[4]={ (s32p*j), (s32p*j), s32p*(j+1), (s32p*j)}; |
2500 |
Float_t yc1[4]={ -ws13, 0., 0., -ws13}; |
Float_t yc1[4]={ -ws13, 0., 0., -ws13}; |
2501 |
Float_t xc[4]; |
Float_t xc[4]; |
2511 |
} else { |
} else { |
2512 |
colo = 1; |
colo = 1; |
2513 |
}; |
}; |
2514 |
ColorMIP(ms32a[j],colo); |
ColorMIP(ms32a[rj],colo); |
2515 |
// |
// |
2516 |
if ( colo != 10 ) ocolo = colo; |
if ( colo != 10 ) ocolo = colo; |
2517 |
if ( mt32[0][j] == 4095. ) colo = noadc; |
if ( mt32[0][rj] == 4095. ) colo = noadc; |
2518 |
// |
// |
2519 |
ftof32ya[j]->SetFillColor(colo); |
ftof32ya[j]->SetFillColor(colo); |
2520 |
ftof32ya[j]->SetLineWidth(1); |
ftof32ya[j]->SetLineWidth(1); |
2523 |
}; |
}; |
2524 |
s32p = 0.050; |
s32p = 0.050; |
2525 |
TPolyLine *ftof32yb[3]; |
TPolyLine *ftof32yb[3]; |
2526 |
|
rj=3; |
2527 |
for ( Int_t j=0; j<3; j++){ |
for ( Int_t j=0; j<3; j++){ |
2528 |
|
rj--; |
2529 |
Float_t xc1[4]={ (s32p*j), s32p*(j+1), s32p*(j+1), (s32p*j)}; |
Float_t xc1[4]={ (s32p*j), s32p*(j+1), s32p*(j+1), (s32p*j)}; |
2530 |
Float_t yc1[4]={ -ws13, -ws13, 0., -ws13}; |
Float_t yc1[4]={ -ws13, -ws13, 0., -ws13}; |
2531 |
Float_t xc[4]; |
Float_t xc[4]; |
2541 |
} else { |
} else { |
2542 |
colo = 1; |
colo = 1; |
2543 |
}; |
}; |
2544 |
ColorMIP(ms32b[j],colo); |
ColorMIP(ms32b[rj],colo); |
2545 |
// |
// |
2546 |
if ( colo != 10 ) ocolo = colo; |
if ( colo != 10 ) ocolo = colo; |
2547 |
if ( mt32[1][j] == 4095. ) colo = noadc; |
if ( mt32[1][rj] == 4095. ) colo = noadc; |
2548 |
// |
// |
2549 |
ftof32yb[j]->SetFillColor(colo); |
ftof32yb[j]->SetFillColor(colo); |
2550 |
ftof32yb[j]->SetLineWidth(1); |
ftof32yb[j]->SetLineWidth(1); |
2775 |
// |
// |
2776 |
// |
// |
2777 |
Bool_t repeat = true; |
Bool_t repeat = true; |
2778 |
Int_t numtr = 1; |
// Int_t numtr = 1; |
2779 |
|
Int_t numtr = 0; |
2780 |
Int_t repuntil = 0; |
Int_t repuntil = 0; |
2781 |
|
Int_t repuntiltr = 0; |
2782 |
// |
// |
2783 |
// |
// |
2784 |
var.tofraw = 0; |
var.tofraw = 0; |
2785 |
// |
// |
2786 |
if ( level.file == 2 ) repuntil = L2->GetToFLevel2()->ntrk(); |
if ( level.file == 2 ) repuntil = L2->GetToFLevel2()->ntrk(); |
2787 |
// printf("repuntil = %i \n",repuntil); |
// printf("repuntil = %i \n",repuntil); |
2788 |
//repuntil = L2->GetNTracks(); |
if ( level.file == 2 ) repuntiltr = L2->GetTrkLevel2()->GetNTracks(); |
2789 |
|
// repuntiltr = L2->GetNTracks(); |
2790 |
// |
// |
2791 |
while ( repeat ){ |
while ( repeat ){ |
2792 |
// printf("B repuntil = %i \n",repuntil); |
// printf("B repuntil = %i \n",repuntil); |
2795 |
// |
// |
2796 |
// |
// |
2797 |
ToFTrkVar *ptt = 0; |
ToFTrkVar *ptt = 0; |
2798 |
|
PamTrack *ptrack = 0; |
2799 |
|
Float_t adc[4][12]; |
2800 |
|
Float_t tdc[4][12]; |
2801 |
|
memset(adc,0,4*12*sizeof(Float_t)); |
2802 |
|
memset(tdc,0,4*12*sizeof(Float_t)); |
2803 |
// |
// |
2804 |
// |
// |
2805 |
|
// if ( repuntil == 0 || var.tofraw ){ |
2806 |
if ( repuntil == 1 || var.tofraw ){ |
if ( repuntil == 1 || var.tofraw ){ |
2807 |
numtr = 0; |
numtr = 0; |
2808 |
ptt = L2->GetToFLevel2()->GetToFTrkVar(0); |
ptt = L2->GetToFLevel2()->GetToFTrkVar(0); |
2810 |
} else { |
} else { |
2811 |
// |
// |
2812 |
// |
// |
2813 |
if ( numtr >= repuntil-1 ) repeat = false; |
if ( numtr >= (repuntiltr-1) ) repeat = false; |
2814 |
// |
// |
2815 |
ptt = L2->GetToFLevel2()->GetToFTrkVar(numtr); |
//printf(" numtr is %i \n",numtr); |
2816 |
|
// ptt = L2->GetToFLevel2()->GetToFTrkVar(numtr); |
2817 |
|
ptrack = L2->GetTrack(numtr); |
2818 |
|
ptt = ptrack->GetToFTrack(); |
2819 |
}; |
}; |
2820 |
// |
// |
2821 |
xp11[0] = 0.; |
xp11[0] = 0.; |
2829 |
// |
// |
2830 |
ii = 2; |
ii = 2; |
2831 |
// |
// |
2832 |
Float_t adc[4][12]; |
Int_t myseq = ptt->trkseqno + 1; |
|
Float_t tdc[4][12]; |
|
|
L2->GetToFLevel2()->GetMatrix(numtr,adc,tdc); |
|
|
|
|
2833 |
// |
// |
2834 |
for ( Int_t i = 0; i<8; i++ ) { |
L2->GetToFLevel2()->GetMatrix(myseq,adc,tdc); |
2835 |
if ( adc[ch11a[i]][hb11a[i]] < 1000. ){ |
// |
2836 |
ms11a[i] = adc[ch11a[i]][hb11a[i]]; |
// printf(" qua \n"); |
2837 |
}; |
// |
2838 |
if ( adc[ch11b[i]][hb11b[i]] < 1000. ){ |
// for ( Int_t i = 0; i<8; i++ ) { |
2839 |
ms11b[i] = adc[ch11b[i]][hb11b[i]]; |
// if ( adc[ch11a[i]][hb11a[i]] < 1000. ){ |
2840 |
}; |
// ms11a[i] = adc[ch11a[i]][hb11a[i]]; |
2841 |
// xp11[i] = 0.; |
// }; |
2842 |
}; |
// if ( adc[ch11b[i]][hb11b[i]] < 1000. ){ |
2843 |
|
// ms11b[i] = adc[ch11b[i]][hb11b[i]]; |
2844 |
|
// }; |
2845 |
|
// xp11[i] = 0.; |
2846 |
|
// }; |
2847 |
|
|
2848 |
Int_t nmtof = 0; |
Int_t nmtof = 0; |
2849 |
Float_t mtof = 0.; |
Float_t mtof = 0.; |
2960 |
if ( level.file == -1 ){ |
if ( level.file == -1 ){ |
2961 |
ColorMIP(ms11a[j]+ms11b[j],colo); |
ColorMIP(ms11a[j]+ms11b[j],colo); |
2962 |
} else { |
} else { |
2963 |
ColorTOFMIP(ms11a[j]+ms11b[j],colo); |
ColorTOFMIP((ms11a[j]+ms11b[j])/2.,colo); |
2964 |
}; |
}; |
2965 |
// |
// |
2966 |
if ( colo != 10 ) ocolo = colo; |
if ( colo != 10 ) ocolo = colo; |
2990 |
ftof11y->Draw(); |
ftof11y->Draw(); |
2991 |
TPolyLine *sftof11[8]; |
TPolyLine *sftof11[8]; |
2992 |
tt = 1; |
tt = 1; |
2993 |
if ( level.file == -1 ) tt = 8; |
rj=1; |
2994 |
|
if ( level.file == -1 ){ |
2995 |
|
tt = 8; |
2996 |
|
rj = 8; |
2997 |
|
}; |
2998 |
for ( Int_t j=0; j<tt; j++){ |
for ( Int_t j=0; j<tt; j++){ |
2999 |
if ( (mt11[0][j]<4095. || mt11[1][j]<4095.)){ |
rj--; |
3000 |
|
if ( (mt11[0][rj]<4095. || mt11[1][rj]<4095.)){ |
3001 |
if ( ocolo == 10 ) ocolo = noadc; |
if ( ocolo == 10 ) ocolo = noadc; |
3002 |
Float_t lowp = (xp11[j]-E11[j])/100.; |
Float_t lowp = -(xp11[rj]+E11[rj])/100.; |
3003 |
Float_t higp = (xp11[j]+E11[j])/100.; |
Float_t higp = -(xp11[rj]-E11[rj])/100.; |
3004 |
if ( lowp < -0.164 ) lowp = -0.164; |
if ( lowp < -0.164 ) lowp = -0.164; |
3005 |
if ( higp > 0.164 ) higp = 0.164; |
if ( higp > 0.164 ) higp = 0.164; |
3006 |
if ( lowp < higp && ( level.file == -1 || (level.file == 2 && xp11[j] != 0.))){ |
if ( lowp < higp && ( level.file == -1 || (level.file == 2 && xp11[rj] != 0.))){ |
3007 |
Float_t nxc1[5]={ lowp, higp, higp, lowp, lowp}; |
Float_t nxc1[5]={ lowp, higp, higp, lowp, lowp}; |
3008 |
Float_t nyc1[5]={ 0.0015, 0.0015, ws13-0.0015, ws13-0.0015, 0.0015}; |
Float_t nyc1[5]={ 0.0015, 0.0015, ws13-0.0015, ws13-0.0015, 0.0015}; |
3009 |
Float_t nxc[5]; |
Float_t nxc[5]; |
3028 |
Float_t s12p = 0.055; |
Float_t s12p = 0.055; |
3029 |
ocolo = 10; |
ocolo = 10; |
3030 |
TPolyLine *ftof12y[6]; |
TPolyLine *ftof12y[6]; |
3031 |
|
rj = 6; |
3032 |
for ( Int_t j=0; j<6; j++){ |
for ( Int_t j=0; j<6; j++){ |
3033 |
|
rj--; |
3034 |
Float_t nxc1[5]={ (s12p*j), (s12p*j), s12p*(j+1), s12p*(j+1), (s12p*j)}; |
Float_t nxc1[5]={ (s12p*j), (s12p*j), s12p*(j+1), s12p*(j+1), (s12p*j)}; |
3035 |
Float_t nyc1[5]={ -ws13, 0., 0., -ws13, -ws13}; |
Float_t nyc1[5]={ -ws13, 0., 0., -ws13, -ws13}; |
3036 |
Float_t nxc[5]; |
Float_t nxc[5]; |
3047 |
colo = 1; |
colo = 1; |
3048 |
}; |
}; |
3049 |
if ( level.file == -1 ){ |
if ( level.file == -1 ){ |
3050 |
ColorMIP(ms12a[j]+ms12b[j],colo); |
ColorMIP(ms12a[rj]+ms12b[rj],colo); |
3051 |
} else { |
} else { |
3052 |
ColorTOFMIP(ms12a[j]+ms12b[j],colo); |
ColorTOFMIP((ms12a[rj]+ms12b[rj])/2.,colo); |
3053 |
}; |
}; |
3054 |
// |
// |
3055 |
if ( colo != 10 ) ocolo = colo; |
if ( colo != 10 ) ocolo = colo; |
3116 |
Float_t s21p = 0.075; |
Float_t s21p = 0.075; |
3117 |
ocolo = 10; |
ocolo = 10; |
3118 |
TPolyLine *ftof21y[2]; |
TPolyLine *ftof21y[2]; |
3119 |
|
rj=2; |
3120 |
for ( Int_t j=0; j<2; j++){ |
for ( Int_t j=0; j<2; j++){ |
3121 |
|
rj--; |
3122 |
Float_t nxc1[5]={ s21p*(j-1), s21p*(j-1), s21p*j,s21p*j, s21p*(j-1)}; |
Float_t nxc1[5]={ s21p*(j-1), s21p*(j-1), s21p*j,s21p*j, s21p*(j-1)}; |
3123 |
Float_t nyc1[5]={ 0., ws2, ws2, 0., 0.}; |
Float_t nyc1[5]={ 0., ws2, ws2, 0., 0.}; |
3124 |
Float_t nxc[5]; |
Float_t nxc[5]; |
3135 |
colo = 1; |
colo = 1; |
3136 |
}; |
}; |
3137 |
if ( level.file == -1 ){ |
if ( level.file == -1 ){ |
3138 |
ColorMIP(ms21a[j]+ms21b[j],colo); |
ColorMIP(ms21a[rj]+ms21b[rj],colo); |
3139 |
} else { |
} else { |
3140 |
ColorTOFMIP(ms21a[j]+ms21b[j],colo); |
ColorTOFMIP((ms21a[rj]+ms21b[rj])/2.,colo); |
3141 |
}; |
}; |
3142 |
// |
// |
3143 |
if ( colo != 10 ) ocolo = colo; |
if ( colo != 10 ) ocolo = colo; |
3223 |
if ( level.file == -1 ){ |
if ( level.file == -1 ){ |
3224 |
ColorMIP(ms22a[j]+ms22b[j],colo); |
ColorMIP(ms22a[j]+ms22b[j],colo); |
3225 |
} else { |
} else { |
3226 |
ColorTOFMIP(ms22a[j]+ms22b[j],colo); |
ColorTOFMIP((ms22a[j]+ms22b[j])/2.,colo); |
3227 |
}; |
}; |
3228 |
// |
// |
3229 |
if ( colo != 10 ) ocolo = colo; |
if ( colo != 10 ) ocolo = colo; |
3254 |
ftof22y->Draw(); |
ftof22y->Draw(); |
3255 |
TPolyLine *sftof22[2]; |
TPolyLine *sftof22[2]; |
3256 |
tt = 1; |
tt = 1; |
3257 |
if ( level.file == -1 ) tt = 2; |
rj = 1; |
3258 |
|
if ( level.file == -1 ){ |
3259 |
|
tt = 2; |
3260 |
|
rj = 2; |
3261 |
|
}; |
3262 |
for (Int_t j=0; j<tt; j++){ |
for (Int_t j=0; j<tt; j++){ |
3263 |
|
rj--; |
3264 |
// for ( Int_t j=0; j<2; j++){ |
// for ( Int_t j=0; j<2; j++){ |
3265 |
if ( (mt22[0][j]<4095. || mt22[1][j]<4095.) ){ |
if ( (mt22[0][rj]<4095. || mt22[1][rj]<4095.) ){ |
3266 |
if ( ocolo == 10 ) ocolo = noadc; |
if ( ocolo == 10 ) ocolo = noadc; |
3267 |
Float_t lowp = (xp22[j]-E22[j])/100.; |
Float_t lowp = -(xp22[rj]+E22[rj])/100.; |
3268 |
Float_t higp = (xp22[j]+E22[j])/100.; |
Float_t higp = -(xp22[rj]-E22[rj])/100.; |
3269 |
if ( lowp < -0.074 ) lowp = -0.074; |
if ( lowp < -0.074 ) lowp = -0.074; |
3270 |
if ( higp > 0.074 ) higp = 0.074; |
if ( higp > 0.074 ) higp = 0.074; |
3271 |
if ( lowp < higp && ( level.file == -1 || (level.file == 2 && xp22[j] != 0.))){ |
if ( lowp < higp && ( level.file == -1 || (level.file == 2 && xp22[rj] != 0.))){ |
3272 |
Float_t nxc1[5]={ lowp, higp, higp, lowp, lowp}; |
Float_t nxc1[5]={ lowp, higp, higp, lowp, lowp}; |
3273 |
Float_t nyc1[5]={ -0.0015, -0.0015, -ws2+0.0015, -ws2+0.0015, -0.0015}; |
Float_t nyc1[5]={ -0.0015, -0.0015, -ws2+0.0015, -ws2+0.0015, -0.0015}; |
3274 |
Float_t nxc[5]; |
Float_t nxc[5]; |
3288 |
}; |
}; |
3289 |
}; |
}; |
3290 |
// |
// |
3291 |
|
//daquiinbasso |
3292 |
// |
// |
3293 |
// S31 X-view |
// S31 X-view |
3294 |
// |
// |
3314 |
if ( level.file == -1 ){ |
if ( level.file == -1 ){ |
3315 |
ColorMIP(ms31a[j]+ms31b[j],colo); |
ColorMIP(ms31a[j]+ms31b[j],colo); |
3316 |
} else { |
} else { |
3317 |
ColorTOFMIP(ms31a[j]+ms31b[j],colo); |
ColorTOFMIP((ms31a[j]+ms31b[j])/2.,colo); |
3318 |
}; |
}; |
3319 |
// |
// |
3320 |
if ( colo != 10 ) ocolo = colo; |
if ( colo != 10 ) ocolo = colo; |
3345 |
ftof31y->Draw(); |
ftof31y->Draw(); |
3346 |
TPolyLine *sftof31[3]; |
TPolyLine *sftof31[3]; |
3347 |
tt = 1; |
tt = 1; |
3348 |
if ( level.file == -1 ) tt = 3; |
rj = 1; |
3349 |
|
if ( level.file == -1 ){ |
3350 |
|
tt = 3; |
3351 |
|
rj = 3; |
3352 |
|
}; |
3353 |
for (Int_t j=0; j<tt; j++){ |
for (Int_t j=0; j<tt; j++){ |
3354 |
|
rj--; |
3355 |
// for ( Int_t j=0; j<3; j++){ |
// for ( Int_t j=0; j<3; j++){ |
3356 |
if ( (mt31[0][j]<4095. || mt31[1][j]<4095.)){ |
if ( (mt31[0][rj]<4095. || mt31[1][rj]<4095.)){ |
3357 |
if ( ocolo == 10 ) ocolo = noadc; |
if ( ocolo == 10 ) ocolo = noadc; |
3358 |
Float_t lowp = (xp31[j]-E31[j])/100.; |
Float_t lowp = -(xp31[rj]+E31[rj])/100.; |
3359 |
Float_t higp = (xp31[j]+E31[j])/100.; |
Float_t higp = -(xp31[rj]-E31[rj])/100.; |
3360 |
if ( lowp < -0.074 ) lowp = -0.074; |
if ( lowp < -0.074 ) lowp = -0.074; |
3361 |
if ( higp > 0.074 ) higp = 0.074; |
if ( higp > 0.074 ) higp = 0.074; |
3362 |
if ( lowp < higp && ( level.file == -1 || (level.file == 2 && xp31[j] != 0.))){ |
if ( lowp < higp && ( level.file == -1 || (level.file == 2 && xp31[rj] != 0.))){ |
3363 |
Float_t nxc1[5]={ lowp, higp, higp, lowp, lowp}; |
Float_t nxc1[5]={ lowp, higp, higp, lowp, lowp}; |
3364 |
Float_t nyc1[5]={ 0.0015, 0.0015, ws13-0.0015, ws13-0.0015, 0.0015}; |
Float_t nyc1[5]={ 0.0015, 0.0015, ws13-0.0015, ws13-0.0015, 0.0015}; |
3365 |
Float_t nxc[5]; |
Float_t nxc[5]; |
3386 |
Float_t s32p = 0.050; |
Float_t s32p = 0.050; |
3387 |
ocolo = 10; |
ocolo = 10; |
3388 |
TPolyLine *ftof32y[3]; |
TPolyLine *ftof32y[3]; |
3389 |
|
rj = 3; |
3390 |
for ( Int_t j=0; j<3; j++){ |
for ( Int_t j=0; j<3; j++){ |
3391 |
|
rj--; |
3392 |
Float_t nxc1[5]={ (s32p*j), (s32p*j), s32p*(j+1),s32p*(j+1), (s32p*j)}; |
Float_t nxc1[5]={ (s32p*j), (s32p*j), s32p*(j+1),s32p*(j+1), (s32p*j)}; |
3393 |
Float_t nyc1[5]={ -ws13, 0., 0., -ws13, -ws13}; |
Float_t nyc1[5]={ -ws13, 0., 0., -ws13, -ws13}; |
3394 |
Float_t nxc[5]; |
Float_t nxc[5]; |
3405 |
colo = 1; |
colo = 1; |
3406 |
}; |
}; |
3407 |
if ( level.file == -1 ){ |
if ( level.file == -1 ){ |
3408 |
ColorMIP(ms32a[j]+ms32b[j],colo); |
ColorMIP(ms32a[rj]+ms32b[rj],colo); |
3409 |
} else { |
} else { |
3410 |
ColorTOFMIP(ms32a[j]+ms32b[j],colo); |
ColorTOFMIP((ms32a[rj]+ms32b[rj])/2.,colo); |
3411 |
}; |
}; |
3412 |
// |
// |
3413 |
if ( colo != 10 ) ocolo = colo; |
if ( colo != 10 ) ocolo = colo; |
4374 |
pcasp4b->Draw("f"); |
pcasp4b->Draw("f"); |
4375 |
pcasp4b->Draw(); |
pcasp4b->Draw(); |
4376 |
}; |
}; |
4377 |
Float_t alfa = 1.2020334; |
// Float_t alfax = 1.2020334; |
4378 |
|
Float_t alfax = 1.22157778; |
4379 |
|
Float_t alfay = 1.27393111; |
4380 |
Float_t lcrd = 0.1815/2.; |
Float_t lcrd = 0.1815/2.; |
4381 |
Float_t wcrd = 0.008; |
Float_t wcrd = 0.008; |
4382 |
if ( true ){ |
if ( true ){ |
4587 |
// |
// |
4588 |
// Float_t cardcx = 0.143168*var.sfx; |
// Float_t cardcx = 0.143168*var.sfx; |
4589 |
//Float_t cardcy = 0.1475*var.sfy; |
//Float_t cardcy = 0.1475*var.sfy; |
4590 |
Float_t cardcx = 0.153168*var.sfx; |
// |
4591 |
Float_t cardcy = 0.1575*var.sfy; |
// Float_t cardcx = 0.153168*var.sfx; |
4592 |
Float_t acrdx[4] = {-lcrd*cos(alfa), lcrd*cos(alfa), -lcrd*cos(alfa)+wcrd*sin(alfa), -lcrd*cos(alfa)}; |
// |
4593 |
Float_t acrdy[4] = {-lcrd*sin(alfa), lcrd*sin(alfa), -lcrd*sin(alfa)-wcrd*cos(alfa), -lcrd*sin(alfa)}; |
Float_t cardcx = (0.19123*(1.-lcrd*cos(alfax)))*var.sfx; |
4594 |
Float_t bcrdx[4] = { lcrd*cos(alfa), lcrd*cos(alfa)+wcrd*sin(alfa), -lcrd*cos(alfa)+wcrd*sin(alfa), lcrd*cos(alfa)}; |
// Float_t cardcy = 0.1575*var.sfy; |
4595 |
Float_t bcrdy[4] = { lcrd*sin(alfa), lcrd*sin(alfa)-wcrd*cos(alfa), -lcrd*sin(alfa)-wcrd*cos(alfa), lcrd*sin(alfa)}; |
Float_t cardcy = (0.179212*(1.-lcrd*sin(alfax)))*var.sfy; |
4596 |
|
Float_t acrdx[4] = {-lcrd*cos(alfax), lcrd*cos(alfax), -lcrd*cos(alfax)+wcrd*sin(alfax), -lcrd*cos(alfax)}; |
4597 |
|
Float_t acrdy[4] = {-lcrd*sin(alfax), lcrd*sin(alfax), -lcrd*sin(alfax)-wcrd*cos(alfax), -lcrd*sin(alfax)}; |
4598 |
|
Float_t bcrdx[4] = { lcrd*cos(alfax), lcrd*cos(alfax)+wcrd*sin(alfax), -lcrd*cos(alfax)+wcrd*sin(alfax), lcrd*cos(alfax)}; |
4599 |
|
Float_t bcrdy[4] = { lcrd*sin(alfax), lcrd*sin(alfax)-wcrd*cos(alfax), -lcrd*sin(alfax)-wcrd*cos(alfax), lcrd*sin(alfax)}; |
4600 |
|
|
4601 |
// |
// |
4602 |
// CARD3 X/ Y |
// CARD3 X/ Y |
4656 |
}; |
}; |
4657 |
|
|
4658 |
if ( true ){ |
if ( true ){ |
4659 |
Float_t acrdx[4] = {-lcrd*cos(alfa), lcrd*cos(alfa), -lcrd*cos(alfa)+wcrd*sin(alfa), -lcrd*cos(alfa)}; |
Float_t acrdx[4] = {-lcrd*cos(alfay), lcrd*cos(alfay), -lcrd*cos(alfay)+wcrd*sin(alfay), -lcrd*cos(alfay)}; |
4660 |
Float_t acrdy[4] = {-lcrd*sin(alfa), lcrd*sin(alfa), -lcrd*sin(alfa)-wcrd*cos(alfa), -lcrd*sin(alfa)}; |
Float_t acrdy[4] = {-lcrd*sin(alfay), lcrd*sin(alfay), -lcrd*sin(alfay)-wcrd*cos(alfay), -lcrd*sin(alfay)}; |
4661 |
Float_t bcrdx[4] = { lcrd*cos(alfa), lcrd*cos(alfa)+wcrd*sin(alfa), -lcrd*cos(alfa)+wcrd*sin(alfa), lcrd*cos(alfa)}; |
Float_t bcrdx[4] = { lcrd*cos(alfay), lcrd*cos(alfay)+wcrd*sin(alfay), -lcrd*cos(alfay)+wcrd*sin(alfay), lcrd*cos(alfay)}; |
4662 |
Float_t bcrdy[4] = { lcrd*sin(alfa), lcrd*sin(alfa)-wcrd*cos(alfa), -lcrd*sin(alfa)-wcrd*cos(alfa), lcrd*sin(alfa)}; |
Float_t bcrdy[4] = { lcrd*sin(alfay), lcrd*sin(alfay)-wcrd*cos(alfay), -lcrd*sin(alfay)-wcrd*cos(alfay), lcrd*sin(alfay)}; |
4663 |
// |
// |
4664 |
// CARD - Y-view |
// CARD - Y-view |
4665 |
// |
// |
4666 |
Float_t cardcx = 0.12*var.sfx; |
// Float_t cardcx = 0.12*var.sfx; |
4667 |
Float_t cardcy = 0.1475*var.sfy; |
Float_t cardcx = (0.16014*(1.-lcrd*cos(alfay)))*var.sfx; |
4668 |
|
// Float_t cardcy = 0.178818*var.sfy; |
4669 |
|
Float_t cardcy = (0.178818*(1.-lcrd*sin(alfay)))*var.sfy; |
4670 |
|
// Float_t cardcy = 0.1475*var.sfy; |
4671 |
// |
// |
4672 |
// CARD4 X Y/ |
// CARD4 X Y/ |
4673 |
// |
// |
5121 |
for (Int_t m = 0; m<3; m++){ |
for (Int_t m = 0; m<3; m++){ |
5122 |
if ( trk->signcluster[l][m] != 0. ){ |
if ( trk->signcluster[l][m] != 0. ){ |
5123 |
if ( planeno == 10 ) { |
if ( planeno == 10 ) { |
|
x = 1024 - trk->addrcluster[l][m]; |
|
|
} else { |
|
5124 |
x = trk->addrcluster[l][m]; |
x = trk->addrcluster[l][m]; |
5125 |
|
} else { |
5126 |
|
x = 1024 - trk->addrcluster[l][m]; |
5127 |
}; |
}; |
5128 |
linea = new TLine(14.+x,0.01,14.+x,0.3); |
linea = new TLine(14.+x,0.01,14.+x,0.3); |
5129 |
linea->SetLineWidth(2); |
linea->SetLineWidth(2); |
5193 |
trkpad[planepad]->cd(); |
trkpad[planepad]->cd(); |
5194 |
trkpad[planepad]->Range(-7.05,0.,7.05,8.); |
trkpad[planepad]->Range(-7.05,0.,7.05,8.); |
5195 |
for (Int_t img=0; img<2; img++){ |
for (Int_t img=0; img<2; img++){ |
5196 |
x = singlet->coord[img]; |
x = -singlet->coord[img]; |
5197 |
Float_t xsig = singlet->sgnl; |
Float_t xsig = singlet->sgnl; |
5198 |
if ( xsig > 8. ) xsig = 8.; |
if ( xsig > 8. ) xsig = 8.; |
5199 |
// |
// |
5249 |
trkpad[planepad]->Range(-8.1,0.,8.1,8.); |
trkpad[planepad]->Range(-8.1,0.,8.1,8.); |
5250 |
// |
// |
5251 |
x = track->xm[plane]; |
x = track->xm[plane]; |
5252 |
Float_t xsig = track->dedx_x[plane]; |
Float_t xsig = fabs(track->dedx_x[plane]); |
5253 |
if ( track->xgood[plane] ){ |
if ( track->XGood(plane) ){ |
5254 |
//if ( x > -100 ){ |
//if ( x > -100 ){ |
5255 |
if ( xsig > 8. ) xsig = 8.; |
if ( xsig > 8. ) xsig = 8.; |
5256 |
if ( var.bw ){ |
if ( var.bw ){ |
5258 |
} else { |
} else { |
5259 |
sigcol2 = 1; |
sigcol2 = 1; |
5260 |
}; |
}; |
5261 |
ColorTRKMIP(track->dedx_x[plane],sigcol2,0); |
ColorTRKMIP(fabs(track->dedx_x[plane]),sigcol2,0); |
5262 |
linea = new TLine(x,0.01,x,xsig); |
linea = new TLine(x,0.01,x,xsig); |
5263 |
linea->SetLineWidth(2); |
linea->SetLineWidth(2); |
5264 |
linea->SetLineColor(sigcol2); |
linea->SetLineColor(sigcol2); |
5278 |
planepad = plane * 2; |
planepad = plane * 2; |
5279 |
trkpad[planepad]->cd(); |
trkpad[planepad]->cd(); |
5280 |
trkpad[planepad]->Range(-7.05,0.,7.05,8.); |
trkpad[planepad]->Range(-7.05,0.,7.05,8.); |
5281 |
x = track->ym[plane]; |
x = -track->ym[plane]; |
5282 |
xsig = track->dedx_y[plane]; |
xsig = fabs(track->dedx_y[plane]); |
5283 |
if ( track->ygood[plane] ){ |
if ( track->YGood(plane) ){ |
5284 |
// if ( x > -100 ){ |
// if ( x > -100 ){ |
5285 |
if ( xsig > 8. ) xsig = 8.; |
if ( xsig > 8. ) xsig = 8.; |
5286 |
if ( var.bw ){ |
if ( var.bw ){ |
5288 |
} else { |
} else { |
5289 |
sigcol2 = 1; |
sigcol2 = 1; |
5290 |
}; |
}; |
5291 |
ColorTRKMIP(track->dedx_y[plane],sigcol2,0); |
ColorTRKMIP(fabs(track->dedx_y[plane]),sigcol2,0); |
5292 |
linea = new TLine(x,0.01,x,xsig); |
linea = new TLine(x,0.01,x,xsig); |
5293 |
linea->SetLineWidth(2); |
linea->SetLineWidth(2); |
5294 |
linea->SetLineColor(sigcol2); |
linea->SetLineColor(sigcol2); |
5331 |
// first of all plot crosses relatives to tracks |
// first of all plot crosses relatives to tracks |
5332 |
// |
// |
5333 |
if ( L2->GetTrkLevel2()->GetNTracks() > 0 ){ |
if ( L2->GetTrkLevel2()->GetNTracks() > 0 ){ |
5334 |
|
// for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ |
5335 |
|
// TrkTrack *track = L2->GetTrkLevel2()->GetTrack(nt); |
5336 |
for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ |
for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ |
5337 |
TrkTrack *track = L2->GetTrkLevel2()->GetTrack(nt); |
PamTrack *ptrack= L2->GetTrack(nt); |
5338 |
|
TrkTrack *track = ptrack->GetTrkTrack(); |
5339 |
|
// |
5340 |
for (Int_t plane = 0; plane<6; plane++){ |
for (Int_t plane = 0; plane<6; plane++){ |
5341 |
// |
// |
5342 |
x = track->xm[plane]; |
x = track->xm[plane]; |
5343 |
Float_t y = track->ym[plane]; |
Float_t y = -track->ym[plane]; |
5344 |
Float_t xsig = track->dedx_x[plane]; |
Float_t xsig = fabs(track->dedx_x[plane]); |
5345 |
Float_t ysig = track->dedx_y[plane]; |
Float_t ysig = fabs(track->dedx_y[plane]); |
5346 |
// if ( x > -100 && y > -100. ){ |
// if ( x > -100 && y > -100. ){ |
5347 |
if ( track->xgood[plane] && track->ygood[plane] ){ |
if ( track->XGood(plane) && track->YGood(plane) ){ |
5348 |
if ( var.bw ){ |
if ( var.bw ){ |
5349 |
sigcol1 = -1; |
sigcol1 = -1; |
5350 |
sigcol2 = -1; |
sigcol2 = -1; |
5462 |
for (Int_t sing = 0; sing < min(totsx,totsy); sing++){ |
for (Int_t sing = 0; sing < min(totsx,totsy); sing++){ |
5463 |
// |
// |
5464 |
x = arrax->At(orderx->At(sing)); |
x = arrax->At(orderx->At(sing)); |
5465 |
Float_t y1 = array1->At(ordery->At(sing)); |
Float_t y1 = -array1->At(ordery->At(sing)); |
5466 |
Float_t y2 = array2->At(ordery->At(sing)); |
Float_t y2 = -array2->At(ordery->At(sing)); |
5467 |
Float_t xsig = sigarrax->At(orderx->At(sing)); |
Float_t xsig = sigarrax->At(orderx->At(sing)); |
5468 |
Float_t ysig = sigarray->At(ordery->At(sing)); |
Float_t ysig = sigarray->At(ordery->At(sing)); |
5469 |
if ( x > -100 && y1 > -100. ){ |
if ( x > -100 && y1 > -100. ){ |
5556 |
for (Int_t m = 0; m<3; m++){ |
for (Int_t m = 0; m<3; m++){ |
5557 |
if ( trk->signcluster[l][m] != 0. ){ |
if ( trk->signcluster[l][m] != 0. ){ |
5558 |
if ( planeno == 10 ) { |
if ( planeno == 10 ) { |
|
x = 1024 - trk->addrcluster[l][m]; |
|
|
} else { |
|
5559 |
x = trk->addrcluster[l][m]; |
x = trk->addrcluster[l][m]; |
5560 |
|
} else { |
5561 |
|
x = 1024 - trk->addrcluster[l][m]; |
5562 |
}; |
}; |
5563 |
x += 1024.; |
x += 1024.; |
5564 |
if ( trk->signcluster[l][m]> ysig ){ |
if ( trk->signcluster[l][m]> ysig ){ |
5565 |
ysig = trk->signcluster[l][m]; |
ysig = trk->signcluster[l][m]; |
5566 |
yh1[ncro] = x-1024.; |
yh1[ncro] = x - 1024.; |
5567 |
yh2[ncro] = x; |
yh2[ncro] = x; |
5568 |
}; |
}; |
5569 |
}; |
}; |
5591 |
for (Int_t m = 0; m<3; m++){ |
for (Int_t m = 0; m<3; m++){ |
5592 |
if ( trk->signcluster[e][m] != 0. ){ |
if ( trk->signcluster[e][m] != 0. ){ |
5593 |
if ( planeno == 10 ) { |
if ( planeno == 10 ) { |
|
x = 1024 - trk->addrcluster[e][m]; |
|
|
} else { |
|
5594 |
x = trk->addrcluster[e][m]; |
x = trk->addrcluster[e][m]; |
5595 |
|
} else { |
5596 |
|
x = 1024 - trk->addrcluster[e][m]; |
5597 |
}; |
}; |
5598 |
x += 1024.; |
x += 1024.; |
5599 |
if ( trk->signcluster[e][m]> ysig ){ |
if ( trk->signcluster[e][m]> ysig ){ |
5600 |
ysig = trk->signcluster[e][m]; |
ysig = trk->signcluster[e][m]; |
5601 |
yh1[ncro] = x-1024.; |
yh1[ncro] = x - 1024.; |
5602 |
yh2[ncro] = x; |
yh2[ncro] = x; |
5603 |
}; |
}; |
5604 |
}; |
}; |
5650 |
|
|
5651 |
void FEVdetector::ShowTrack(){ |
void FEVdetector::ShowTrack(){ |
5652 |
// |
// |
5653 |
|
if ( level.file != 2 ) return; |
5654 |
// |
// |
5655 |
// |
// |
5656 |
if ( var.CALO && false ){ |
// |
5657 |
|
if ( var.CALO && var.CALOT ){ |
5658 |
if ( L2->GetCaloLevel2()->npcfit[0] > 0 && L2->GetCaloLevel2()->npcfit[1] > 0 ){ |
if ( L2->GetCaloLevel2()->npcfit[0] > 0 && L2->GetCaloLevel2()->npcfit[1] > 0 ){ |
5659 |
Float_t calx[22]; |
Float_t calx[22]; |
5660 |
Float_t caly[22]; |
Float_t caly[22]; |
5671 |
}; |
}; |
5672 |
for (Int_t plane = 0; plane < 22; plane++){ |
for (Int_t plane = 0; plane < 22; plane++){ |
5673 |
calx[plane] = (L2->GetCaloLevel2()->cbar[plane][0]/100.)*var.sfx + var.xxvc;; |
calx[plane] = (L2->GetCaloLevel2()->cbar[plane][0]/100.)*var.sfx + var.xxvc;; |
5674 |
caly[plane] = (L2->GetCaloLevel2()->cbar[plane][1]/100.)*var.sfx + var.xyvc; |
caly[plane] = (-L2->GetCaloLevel2()->cbar[plane][1]/100.)*var.sfx + var.xyvc; |
5675 |
// calzx[plane] = zpiano[plane] -5.81*var.sfy/1000. + var.yxvc; |
// calzx[plane] = zpiano[plane] -5.81*var.sfy/1000. + var.yxvc; |
5676 |
calzx[plane] = zpiano[plane] + var.yxvc; |
calzx[plane] = zpiano[plane] + var.yxvc; |
5677 |
calzy[plane] = zpiano[plane] + var.yyvc; |
calzy[plane] = zpiano[plane] + var.yyvc; |
5720 |
// |
// |
5721 |
for (Int_t plane = 0; plane < 22; plane++){ |
for (Int_t plane = 0; plane < 22; plane++){ |
5722 |
calx[plane] = (ctra->tbar[plane][0]/100.)*var.sfx + var.xxvc;; |
calx[plane] = (ctra->tbar[plane][0]/100.)*var.sfx + var.xxvc;; |
5723 |
caly[plane] = (ctra->tbar[plane][1]/100.)*var.sfx + var.xyvc; |
caly[plane] = (-ctra->tbar[plane][1]/100.)*var.sfx + var.xyvc; |
5724 |
// calzx[plane] = zpiano[plane] -5.81*var.sfy/1000. + var.yxvc; |
// calzx[plane] = zpiano[plane] -5.81*var.sfy/1000. + var.yxvc; |
5725 |
calzx[plane] = zpiano[plane] + var.yxvc; |
calzx[plane] = zpiano[plane] + var.yxvc; |
5726 |
calzy[plane] = zpiano[plane] + var.yyvc; |
calzy[plane] = zpiano[plane] + var.yyvc; |
5749 |
}; |
}; |
5750 |
}; |
}; |
5751 |
// |
// |
5752 |
if ( !var.TRK || level.file != 2 ) return; |
if ( !var.TRK ) return; |
5753 |
// |
// |
5754 |
if ( L2->GetTrkLevel2()->GetNTracks() > 0 ){ |
if ( L2->GetTrkLevel2()->GetNTracks() > 0 ){ |
5755 |
for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ |
for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ |
5756 |
|
|
5757 |
// TrkTrack *track = L2->GetTrkLevel2()->GetTrack(nt); |
// TrkTrack *track = L2->GetTrkLevel2()->GetTrack(nt); |
5758 |
|
// printf("qui \n"); |
5759 |
PamTrack *ptrack = L2->GetTrack(nt); |
PamTrack *ptrack = L2->GetTrack(nt); |
5760 |
TrkTrack *track = ptrack->GetTrkTrack(); |
TrkTrack *track = ptrack->GetTrkTrack(); |
5761 |
|
// printf("qua \n"); |
5762 |
Int_t npoint = 100; |
Int_t npoint = 100; |
5763 |
Float_t zin[100]; |
Float_t zin[100]; |
5764 |
Double_t xout[100]; |
Double_t xout[100]; |
5807 |
// |
// |
5808 |
Trajectory *tr = new Trajectory(npoint,zin); |
Trajectory *tr = new Trajectory(npoint,zin); |
5809 |
// |
// |
5810 |
ifail = track->DoTrack2(tr); |
// ifail = track->DoTrack2(tr); |
5811 |
|
ifail = track->DoTrack(tr); |
5812 |
// |
// |
5813 |
if ( !ifail ){ |
if ( !ifail ){ |
5814 |
for ( Int_t e = 0; e < npoint ; e++) { |
for ( Int_t e = 0; e < npoint ; e++) { |
5815 |
tx[e] = ((float)tr->x[e]/100.)*var.sfx + var.xxvc; |
tx[e] = ((float)tr->x[e]/100.)*var.sfx + var.xxvc; |
5816 |
ty[e] = ((float)tr->y[e]/100.)*var.sfx + var.xyvc; |
ty[e] = (-(float)tr->y[e]/100.)*var.sfx + var.xyvc; |
5817 |
if ( e < 50 ) { |
if ( e < 50 ) { |
5818 |
ptx1[e] = ((float)tr->y[e]/100.)*var.sfx + var.xcat; |
ptx1[e] = (-(float)tr->y[e]/100.)*var.sfx + var.xcat; |
5819 |
pty1[e] = ((float)tr->x[e]/100.)*var.sfy + var.ycat; |
pty1[e] = ((float)tr->x[e]/100.)*var.sfy + var.ycat; |
5820 |
} else { |
} else { |
5821 |
ptx2[e-50] = ((float)tr->y[e]/100.)*var.sfx + var.xcat; |
ptx2[e-50] = (-(float)tr->y[e]/100.)*var.sfx + var.xcat; |
5822 |
pty2[e-50] = ((float)tr->x[e]/100.)*var.sfy + var.ycat; |
pty2[e-50] = ((float)tr->x[e]/100.)*var.sfy + var.ycat; |
5823 |
}; |
}; |
5824 |
if ( e > 84 ) { |
if ( e > 84 ) { |
5825 |
tx1[e-85] = ((float)tr->x[e]/100.)*var.nds4 + var.xxvc; |
tx1[e-85] = ((float)tr->x[e]/100.)*var.nds4 + var.xxvc; |
5826 |
ty1[e-85] = ((float)tr->y[e]/100.)*var.nds4 + var.xyvc; |
ty1[e-85] = (-(float)tr->y[e]/100.)*var.nds4 + var.xyvc; |
5827 |
tzx1[e-85] = (0.112)*var.sfy+((float)zin[e]/100.)*var.sfy + var.yxvc; |
tzx1[e-85] = (0.112)*var.sfy+((float)zin[e]/100.)*var.sfy + var.yxvc; |
5828 |
tzy1[e-85] = (0.112)*var.sfy+((float)zin[e]/100.)*var.sfy + var.yyvc; |
tzy1[e-85] = (0.112)*var.sfy+((float)zin[e]/100.)*var.sfy + var.yyvc; |
5829 |
}; |
}; |
5967 |
Int_t se = 5; |
Int_t se = 5; |
5968 |
if ( !l && m%2 == 0 ) se = 3; |
if ( !l && m%2 == 0 ) se = 3; |
5969 |
if ( !l && m%2 != 0 ) se = 2; |
if ( !l && m%2 != 0 ) se = 2; |
5970 |
if ( l && m%2 == 0 ) se = 1; |
if ( l && m%2 != 0 ) se = 1; |
5971 |
if ( l && m%2 != 0 ) se = 0; |
if ( l && m%2 == 0 ) se = 0; |
5972 |
// |
// |
5973 |
// determine what kind of event we are going to analyze |
// determine what kind of event we are going to analyze |
5974 |
// |
// |
6063 |
Xview->Draw("box same"); |
Xview->Draw("box same"); |
6064 |
}; |
}; |
6065 |
if ( l == 1 ) { |
if ( l == 1 ) { |
6066 |
Yview->Fill(n,21-m,1.); |
Yview->Fill(95-n,21-m,1.); |
6067 |
pd2->cd(); |
pd2->cd(); |
6068 |
Yview->Draw("box same"); |
Yview->Draw("box same"); |
6069 |
}; |
}; |
6083 |
// |
// |
6084 |
// Define variables |
// Define variables |
6085 |
// |
// |
6086 |
Int_t etime = var.etime; |
UInt_t etime = var.etime; |
6087 |
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]; |
6088 |
Int_t badstrip = 0; |
Int_t badstrip = 0; |
6089 |
qtot = 0.; |
qtot = 0.; |
6155 |
if ( calib.ttime[s][b[s]+1] && calib.time[s][b[s]] ){ |
if ( calib.ttime[s][b[s]+1] && calib.time[s][b[s]] ){ |
6156 |
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 ){ |
6157 |
printf(" CALORIMETER: \n" ); |
printf(" CALORIMETER: \n" ); |
6158 |
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]); |
6159 |
printf(" END CALORIMETER. \n\n" ); |
printf(" END CALORIMETER. \n\n" ); |
6160 |
b[s]++; |
b[s]++; |
6161 |
CaloPede(s); |
CaloPede(s); |
6175 |
Int_t se = 5; |
Int_t se = 5; |
6176 |
if (l == 0 && m%2 == 0) se = 3; |
if (l == 0 && m%2 == 0) se = 3; |
6177 |
if (l == 0 && m%2 != 0) se = 2; |
if (l == 0 && m%2 != 0) se = 2; |
6178 |
if (l == 1 && m%2 == 0) se = 1; |
if (l == 1 && m%2 != 0) se = 1; |
6179 |
if (l == 1 && m%2 != 0) se = 0; |
if (l == 1 && m%2 == 0) se = 0; |
6180 |
// |
// |
6181 |
// determine what kind of event we are going to analyze |
// determine what kind of event we are going to analyze |
6182 |
// |
// |
6292 |
Xview->Draw("box same"); |
Xview->Draw("box same"); |
6293 |
}; |
}; |
6294 |
if ( l == 1 ) { |
if ( l == 1 ) { |
6295 |
Yview->Fill(n,21-m,1.); |
Yview->Fill(96-n,21-m,1.); |
6296 |
pd2->cd(); |
pd2->cd(); |
6297 |
Yview->Draw("box same"); |
Yview->Draw("box same"); |
6298 |
}; |
}; |
6379 |
// |
// |
6380 |
stringstream xvev; |
stringstream xvev; |
6381 |
stringstream yvev; |
stringstream yvev; |
6382 |
for (Int_t ii = 0; ii < L2->GetCaloLevel2()->nstrip; ii++){ |
// for (Int_t ii = 0; ii < L2->GetCaloLevel2()->nstrip; ii++){ |
6383 |
|
for (Int_t ii = 0; ii < L2->GetCaloLevel1()->istrip; ii++){ |
6384 |
Int_t colo; |
Int_t colo; |
6385 |
Int_t l; |
Int_t l; |
6386 |
Int_t m; |
Int_t m; |
6387 |
Int_t n; |
Int_t n; |
6388 |
Float_t mip = L2->GetCaloLevel1()->DecodeEstrip(ii,l,m,n); |
Bool_t satura = false; |
6389 |
|
Float_t mip = L2->GetCaloLevel1()->DecodeEstrip(ii,l,m,n,satura); |
6390 |
if ( var.bw ){ |
if ( var.bw ){ |
6391 |
colo = -1; |
colo = -1; |
6392 |
} else { |
} else { |
6393 |
colo = 1; |
colo = 1; |
6394 |
}; |
}; |
6395 |
ColorMIP(mip,colo); |
ColorMIP(mip,colo); |
6396 |
if ( l == 0 ) { |
if ( l == 0 ) { |
6397 |
xvev.str(""); |
xvev.str(""); |
6400 |
xvev << " " << l; |
xvev << " " << l; |
6401 |
gDirectory->Delete(xvev.str().c_str()); |
gDirectory->Delete(xvev.str().c_str()); |
6402 |
TH2F *Xview = new TH2F(xvev.str().c_str(),"",96,-0.5,95.5,22,-0.5,21.5); |
TH2F *Xview = new TH2F(xvev.str().c_str(),"",96,-0.5,95.5,22,-0.5,21.5); |
6403 |
Xview->SetFillColor(colo); |
if ( satura ){ |
6404 |
|
Xview->SetFillColor(kBlack); |
6405 |
|
} else { |
6406 |
|
Xview->SetFillColor(colo); |
6407 |
|
}; |
6408 |
Xview->Fill(n,21-m,1.); |
Xview->Fill(n,21-m,1.); |
6409 |
pd1->cd(); |
pd1->cd(); |
6410 |
Xview->Draw("box same"); |
Xview->Draw("box same"); |
6416 |
yvev << " " << l; |
yvev << " " << l; |
6417 |
gDirectory->Delete(yvev.str().c_str()); |
gDirectory->Delete(yvev.str().c_str()); |
6418 |
TH2F *Yview = new TH2F(yvev.str().c_str(),"",96,-0.5,95.5,22,-0.5,21.5); |
TH2F *Yview = new TH2F(yvev.str().c_str(),"",96,-0.5,95.5,22,-0.5,21.5); |
6419 |
Yview->SetFillColor(colo); |
if ( satura ){ |
6420 |
Yview->Fill(n,21-m,1.); |
Yview->SetFillColor(kBlack); |
6421 |
|
} else { |
6422 |
|
Yview->SetFillColor(colo); |
6423 |
|
}; |
6424 |
|
Yview->Fill(96-n,21-m,1.); |
6425 |
pd2->cd(); |
pd2->cd(); |
6426 |
Yview->Draw("box same"); |
Yview->Draw("box same"); |
6427 |
}; |
}; |
6470 |
for (Int_t d = 0; d<48; d++){ |
for (Int_t d = 0; d<48; d++){ |
6471 |
if ( calib.ttime[s][d] != 0 ) calibex++; |
if ( calib.ttime[s][d] != 0 ) calibex++; |
6472 |
if ( calib.time[s][0] != 0 ){ |
if ( calib.time[s][0] != 0 ){ |
6473 |
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]); |
6474 |
if ( calib.time[s][d+1] != 0 ) { |
if ( calib.time[s][d+1] != 0 ) { |
6475 |
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]); |
6476 |
} else { |
} else { |
6477 |
if ( !stop ){ |
if ( !stop ){ |
6478 |
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]); |
6479 |
stop = 1; |
stop = 1; |
6480 |
}; |
}; |
6481 |
}; |
}; |
6482 |
} else { |
} else { |
6483 |
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]); |
6484 |
}; |
}; |
6485 |
}; |
}; |
6486 |
printf("\n"); |
printf("\n"); |
6545 |
calib.ttime[s][inter] = 0; |
calib.ttime[s][inter] = 0; |
6546 |
if ( ce->cstwerr[s] != 0 && ce->cperror[s] == 0 ) { |
if ( ce->cstwerr[s] != 0 && ce->cperror[s] == 0 ) { |
6547 |
//calib.ttime[s][inter] = cph->GetOrbitalTime(); |
//calib.ttime[s][inter] = cph->GetOrbitalTime(); |
6548 |
calib.ttime[s][inter] = cph->OrbitalTime; |
calib.ttime[s][inter] = (UInt_t)cph->OrbitalTime; |
6549 |
inter++; |
inter++; |
6550 |
} else { |
} else { |
6551 |
if ( ce->cstwerr[s] != 0 && ce->cperror[s] != 0 ) { |
if ( ce->cstwerr[s] != 0 && ce->cperror[s] != 0 ) { |
6599 |
tr->GetEntry(ci); |
tr->GetEntry(ci); |
6600 |
cph = ceh->GetPscuHeader(); |
cph = ceh->GetPscuHeader(); |
6601 |
//if ( atime == cph->GetOrbitalTime()){ |
//if ( atime == cph->GetOrbitalTime()){ |
6602 |
if ( atime == cph->OrbitalTime){ |
if ( atime == (UInt_t)cph->OrbitalTime){ |
6603 |
// calib.iev = ce->iev; |
// calib.iev = ce->iev; |
6604 |
if (ce->cstwerr[s] != 0 && ce->cperror[s] == 0 ) { |
if (ce->cstwerr[s] != 0 && ce->cperror[s] == 0 ) { |
6605 |
for ( Int_t d=0 ; d<11 ;d++ ){ |
for ( Int_t d=0 ; d<11 ;d++ ){ |