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 |
|
extern Bool_t NODB; |
76 |
// |
// |
77 |
|
|
78 |
using namespace std; |
using namespace std; |
84 |
thefigure = &figure; |
thefigure = &figure; |
85 |
checkctrlword(); |
checkctrlword(); |
86 |
var.selex = false; |
var.selex = false; |
87 |
|
var.showall = false; |
88 |
|
|
89 |
|
var.showsi = false; |
90 |
|
var.shownd = false; |
91 |
|
var.shows4 = false; |
92 |
|
var.showorb = false; |
93 |
|
var.showtof = false; |
94 |
|
var.showtrg = false; |
95 |
|
var.showtrk = false; |
96 |
|
var.showcal = false; |
97 |
|
var.showrun = false; |
98 |
|
var.showac = false; |
99 |
|
} |
100 |
|
|
101 |
|
void FEVdetector::Reset(){ |
102 |
|
L2 = NULL; |
103 |
} |
} |
104 |
|
|
105 |
void FEVdetector::checkctrlword(){ |
void FEVdetector::checkctrlword(){ |
108 |
var.AC = 0; |
var.AC = 0; |
109 |
var.RUN = 1; |
var.RUN = 1; |
110 |
var.TRK = 0; |
var.TRK = 0; |
111 |
|
var.ORB = 1; |
112 |
|
var.TRG = 1; |
113 |
var.CALO = 0; |
var.CALO = 0; |
114 |
|
var.CALOT = 0; |
115 |
var.S4 = 0; |
var.S4 = 0; |
116 |
var.ND = 0; |
var.ND = 0; |
117 |
var.INFOS = 0; |
var.INFOS = 0; |
118 |
var.VINFOS = 0; |
var.VINFOS = 0; |
119 |
var.PALETTE = 0; |
var.PALETTE = 0; |
120 |
|
var.PATTRIG = 1; |
121 |
if ( *ctrlword & (1<<0) ) { |
if ( *ctrlword & (1<<0) ) { |
122 |
var.PALETTE = 1; |
var.PALETTE = 1; |
123 |
}; |
}; |
145 |
if ( *ctrlword & (1<<8) ) { |
if ( *ctrlword & (1<<8) ) { |
146 |
var.TOF = 1; |
var.TOF = 1; |
147 |
}; |
}; |
148 |
|
if ( *ctrlword & (1<<9) ) { |
149 |
|
var.PATTRIG = 1; |
150 |
|
}; |
151 |
} |
} |
152 |
|
|
153 |
void FEVdetector::SetDDEC(TString de){ |
void FEVdetector::SetDDEC(TString de){ |
155 |
}; |
}; |
156 |
|
|
157 |
void FEVdetector::GetWindow(){ |
void FEVdetector::GetWindow(){ |
158 |
otr->GetEntry(maxevent); |
// |
159 |
|
if ( level.file == 2 ){ |
160 |
|
// printf("0qui\n"); |
161 |
|
L2->GetEntry(minevent); |
162 |
|
} else { |
163 |
|
otr->GetEntry(minevent); |
164 |
|
} |
165 |
if ( level.file < 2 ){ |
if ( level.file < 2 ){ |
166 |
ph = eh->GetPscuHeader(); |
ph = eh->GetPscuHeader(); |
167 |
lastevno = (int)ph->Counter; |
firstevno = (int)ph->Counter; |
168 |
} else { |
} else { |
169 |
lastevno = L2->GetOrbitalInfo()->pkt_num; // to be changed as soon as we will have pkt_counter in the level2 file! |
if ( var.ORB ){ |
170 |
|
firstevno = L2->GetOrbitalInfo()->pkt_num; |
171 |
|
} else { |
172 |
|
firstevno = 0; |
173 |
|
}; |
174 |
}; |
}; |
175 |
otr->GetEntry(minevent); |
// |
176 |
|
if ( level.file == 2 ){ |
177 |
|
// printf("1qui\n"); |
178 |
|
L2->GetEntry(maxevent); |
179 |
|
} else { |
180 |
|
otr->GetEntry(maxevent); |
181 |
|
} |
182 |
|
// |
183 |
if ( level.file < 2 ){ |
if ( level.file < 2 ){ |
184 |
ph = eh->GetPscuHeader(); |
ph = eh->GetPscuHeader(); |
185 |
firstevno = (int)ph->Counter; |
lastevno = (int)ph->Counter; |
186 |
} else { |
} else { |
187 |
firstevno = L2->GetOrbitalInfo()->pkt_num; // to be changed as soon as we will have pkt_counter in the level2 file! |
if ( var.ORB ){ |
188 |
|
lastevno = L2->GetOrbitalInfo()->pkt_num; |
189 |
|
} else { |
190 |
|
lastevno = 0; |
191 |
|
}; |
192 |
}; |
}; |
193 |
|
// |
194 |
} |
} |
195 |
|
|
196 |
void FEVdetector::ClearVariables(){ |
void FEVdetector::ClearVariables(){ |
213 |
} |
} |
214 |
|
|
215 |
void FEVdetector::GetEntry(Int_t i){ |
void FEVdetector::GetEntry(Int_t i){ |
216 |
thisentry = i; |
thisentry = i; |
217 |
otr->GetEntry(i); |
if ( level.file == 2 ){ |
218 |
// PrintData(otr,-1LL,44); |
// L2->Clear(); |
219 |
|
// printf("qui\n"); |
220 |
|
L2->GetEntry(i); |
221 |
|
if ( var.showall ){ |
222 |
|
ShowInfo("RunInfo"); |
223 |
|
ShowInfo("SoftInfo"); |
224 |
|
ShowInfo("OrbitalInfo"); |
225 |
|
ShowInfo("TrigLevel2"); |
226 |
|
ShowInfo("ToFLevel2"); |
227 |
|
ShowInfo("TrkLevel2"); |
228 |
|
ShowInfo("AcLevel2"); |
229 |
|
ShowInfo("CaloLevel2"); |
230 |
|
ShowInfo("CaloLevel1"); |
231 |
|
ShowInfo("S4Level2"); |
232 |
|
ShowInfo("NDLevel2"); |
233 |
|
} else { |
234 |
|
if ( var.showrun ) ShowInfo("RunInfo"); |
235 |
|
if ( var.showsi ) ShowInfo("SoftInfo"); |
236 |
|
if ( var.showorb ) ShowInfo("OrbitalInfo"); |
237 |
|
if ( var.showtrg ) ShowInfo("TrigLevel2"); |
238 |
|
if ( var.showtof ) ShowInfo("ToFLevel2"); |
239 |
|
if ( var.showtrk ) ShowInfo("TrkLevel2"); |
240 |
|
if ( var.showac ) ShowInfo("AcLevel2"); |
241 |
|
if ( var.showcal ) ShowInfo("CaloLevel2"); |
242 |
|
if ( var.showcal ) ShowInfo("CaloLevel1"); |
243 |
|
if ( var.shows4 ) ShowInfo("S4Level2"); |
244 |
|
if ( var.shownd ) ShowInfo("NDLevel2"); |
245 |
|
}; |
246 |
|
} else { |
247 |
|
otr->GetEntry(i); |
248 |
|
if ( var.showall ){ |
249 |
|
ShowInfo("Pscu"); |
250 |
|
ShowInfo("Trigger"); |
251 |
|
ShowInfo("Tof"); |
252 |
|
ShowInfo("Tracker"); |
253 |
|
ShowInfo("Anticounter"); |
254 |
|
ShowInfo("Calorimeter"); |
255 |
|
ShowInfo("S4"); |
256 |
|
ShowInfo("Neutron"); |
257 |
|
} else { |
258 |
|
if ( var.showorb ) ShowInfo("Pscu"); |
259 |
|
if ( var.showtrg ) ShowInfo("Trigger"); |
260 |
|
if ( var.showtof ) ShowInfo("Tof"); |
261 |
|
if ( var.showtrk ) ShowInfo("Tracker"); |
262 |
|
if ( var.showac ) ShowInfo("Anticounter"); |
263 |
|
if ( var.showcal ) ShowInfo("Calorimeter"); |
264 |
|
if ( var.shows4 ) ShowInfo("S4"); |
265 |
|
if ( var.shownd ) ShowInfo("Neutron"); |
266 |
|
}; |
267 |
|
}; |
268 |
} |
} |
269 |
|
|
270 |
void FEVdetector::SetEntry(Int_t i){ |
void FEVdetector::SetEntry(Int_t i){ |
385 |
}; |
}; |
386 |
} |
} |
387 |
|
|
388 |
void FEVdetector::PrintLeaves(TTree *otr, Int_t i, TBranchElement *tb, Int_t lenmax){ |
void FEVdetector::ShowInfo(TString detector){ |
389 |
// -- Prints values of leaves. |
// |
390 |
|
TBranch *b1 = 0; |
391 |
// tb->ValidateAddress(); |
// TBranch *b3 = 0; |
392 |
printf("son qua \n"); |
TObjArray *branch_array = 0; |
393 |
|
// TObjArray *leaf_array = 0; |
394 |
|
// |
395 |
|
if ( !strcmp(detector.Data(),"RunInfo") || !strcmp(detector.Data(),"SoftInfo") ){ |
396 |
|
if ( L2->GetRunTree() ) b1 = L2->GetRunTree()->FindBranch(detector.Data()); |
397 |
|
} else { |
398 |
|
b1 = otr->FindBranch(detector.Data()); |
399 |
|
}; |
400 |
|
// |
401 |
|
if ( !b1 ) return; |
402 |
|
// |
403 |
|
Int_t dlen = 10; |
404 |
|
// |
405 |
|
char o[200000]; |
406 |
|
char zz[200000]; |
407 |
|
char col[13]; |
408 |
|
char col2[13]; |
409 |
|
// |
410 |
|
setcolor(col,RESET, GREEN, WHITE); |
411 |
|
sprintf(o,"%s======> EVENT:%i\n",col, thisentry); |
412 |
|
sprintf(zz,"======> EVENT:%i\n", thisentry); |
413 |
|
// |
414 |
|
setcolor(col,RESET, RED, WHITE); |
415 |
|
sprintf(o,"%s%sBranch %s\n",o,col,b1->GetName()); |
416 |
|
sprintf(zz,"%sBranch %s\n",zz,b1->GetName()); |
417 |
|
setcolor(col,RESET, BLACK, WHITE); |
418 |
|
sprintf(o,"%s%s",o,col); |
419 |
|
// |
420 |
|
branch_array = b1->GetListOfBranches(); |
421 |
|
// |
422 |
|
Int_t j = 0; |
423 |
|
// |
424 |
|
for(Int_t l=0;l<(branch_array->GetLast()+1);l++){ |
425 |
|
// |
426 |
|
TBranchElement *tb = (TBranchElement*)branch_array->At(l); |
427 |
|
Int_t type = tb->GetType(); |
428 |
|
Int_t atype = tb->GetStreamerType() - 20; |
429 |
|
// Int_t len = (tb->GetInfo()->GetLengths())[tb->GetID()]; |
430 |
|
Int_t len = tb->GetInfo()->GetLength(tb->GetID()); |
431 |
|
Int_t length = min(len,dlen); |
432 |
|
// |
433 |
|
// printf("Branches : type is %i type is %i tb getname %s slen %i slength %i\n",atype,type,tb->GetName(),len,length); |
434 |
|
switch (type){ |
435 |
|
case 0: |
436 |
|
// |
437 |
|
// IS A VARIABLE |
438 |
|
// |
439 |
|
// |
440 |
|
// NAME |
441 |
|
// |
442 |
|
setcolor(col,RESET, BLUE, WHITE); |
443 |
|
setcolor(col2,RESET, BLACK, WHITE); |
444 |
|
sprintf(o,"%s%s %-15s%s =",o,col,((TBranch*)branch_array->At(l))->GetName(),col2); |
445 |
|
sprintf(zz,"%s %-15s =",zz,((TBranch*)branch_array->At(l))->GetName()); |
446 |
|
// |
447 |
|
j = 0; |
448 |
|
// |
449 |
|
// VALUES |
450 |
|
// |
451 |
|
// |
452 |
|
// Integer |
453 |
|
// |
454 |
|
if ( atype == 3 || atype == -17 ){ |
455 |
|
while ( j < length ){ |
456 |
|
if ( j < length -1 ){ |
457 |
|
sprintf(o,"%s %i ,",o,(Int_t)tb->GetValue(j,0)); |
458 |
|
sprintf(zz,"%s %i ,",zz,(Int_t)tb->GetValue(j,0)); |
459 |
|
} else { |
460 |
|
sprintf(o,"%s %i",o,(Int_t)tb->GetValue(j,0)); |
461 |
|
sprintf(zz,"%s %i",zz,(Int_t)tb->GetValue(j,0)); |
462 |
|
}; |
463 |
|
j++; |
464 |
|
}; |
465 |
|
}; |
466 |
|
// |
467 |
|
// Unsigned integer |
468 |
|
// |
469 |
|
if ( atype == -7 || atype == 13 || atype == -9 || atype == -8 || atype == 12 ){ |
470 |
|
while ( j < length ){ |
471 |
|
if ( j < length -1 ){ |
472 |
|
sprintf(o,"%s %u ,",o,(UInt_t)tb->GetValue(j,0)); |
473 |
|
sprintf(zz,"%s %u ,",zz,(UInt_t)tb->GetValue(j,0)); |
474 |
|
} else { |
475 |
|
sprintf(o,"%s %u",o,(UInt_t)tb->GetValue(j,0)); |
476 |
|
sprintf(zz,"%s %u",zz,(UInt_t)tb->GetValue(j,0)); |
477 |
|
}; |
478 |
|
j++; |
479 |
|
}; |
480 |
|
}; |
481 |
|
// |
482 |
|
// Float |
483 |
|
// |
484 |
|
if ( atype == -15 || atype == 5 ){ |
485 |
|
while ( j < length ){ |
486 |
|
if ( j < length -1 ){ |
487 |
|
sprintf(o,"%s %f ,",o,tb->GetValue(j,0)); |
488 |
|
sprintf(zz,"%s %f ,",zz,tb->GetValue(j,0)); |
489 |
|
} else { |
490 |
|
sprintf(o,"%s %f",o,tb->GetValue(j,0)); |
491 |
|
sprintf(zz,"%s %f",zz,tb->GetValue(j,0)); |
492 |
|
}; |
493 |
|
j++; |
494 |
|
}; |
495 |
|
}; |
496 |
|
// |
497 |
|
// Strings |
498 |
|
// |
499 |
|
if ( atype == 45 ){ |
500 |
|
// TObjArray *cl = (TObjArray*)(tb->GetInfo()->GetOffsets())[tb->GetID()];//tb->GetValuePointer(); |
501 |
|
// TString *stringa = (TString*)(*cl)[0]; |
502 |
|
// TBranchElement *utb = (TBranchElement*)tb->GetBranchCount(); |
503 |
|
// TString** stringa = (TString*)(&tb->GetValuePointer()); |
504 |
|
//TStreamerElement *tste = (TStreamerElement*)tb->GetInfo()->GetCurrentElement(); |
505 |
|
|
506 |
|
// char *ladd; |
507 |
|
// ladd = tb->GetValuePointer() |
508 |
|
// TString *stringa = (TString*)((tste->GetOffset())); |
509 |
|
// TString& mstr = *stringa; |
510 |
|
// printf(" la mia stringa %s \n",mstr.Data()); |
511 |
|
// printf(" offset %i \n",(Int_t)utb->GetValue(0,0)); |
512 |
|
// int pointer = (tb->GetInfo()->GetOffsets())[tb->GetID()]; |
513 |
|
// TString *stringa = (TString*)(tb->GetInfo()->GetOffsets())[tb->GetID()]; |
514 |
|
// TString *stringa = (TString*)tb->GetAddress(); |
515 |
|
// printf(" address 0x%X \n",tb->GetAddress()); |
516 |
|
// printf(" pointer 0x%X \n",tb->GetValuePointer()); |
517 |
|
// printf(" object 0x%X \n",tb->GetObject()); |
518 |
|
// printf("stringa %s lung %i\n",stringa.Data(),stringa.Length()); |
519 |
|
// TLeaf *striglia = tb->FindLeaf(tb->GetName()); |
520 |
|
// if ( striglia ){ |
521 |
|
// char *pointer = (char *)striglia->GetValuePointer(); |
522 |
|
// TString *pr= (TString*)pointer; |
523 |
|
// printf("ciao %s \n",pr->Data()); |
524 |
|
// }; |
525 |
|
sprintf(o,"%s TString - not implemented yet -",o); |
526 |
|
sprintf(zz,"%s TString - not implemented yet -",zz); |
527 |
|
}; |
528 |
|
// |
529 |
|
// TArray |
530 |
|
// |
531 |
|
if ( atype == 42 ){ |
532 |
|
// |
533 |
|
// TObjArray *cl = (TObjArray*)tb->GetObject(); |
534 |
|
// // |
535 |
|
// TClass *myc = cl->IsA(); |
536 |
|
// // |
537 |
|
// printf("qui \n"); |
538 |
|
// // |
539 |
|
// // determine offset to fetch data |
540 |
|
// // |
541 |
|
// int thisoffset = 0; |
542 |
|
// TRealData *rd = myc->GetRealData(tb->GetName()); |
543 |
|
// if ( rd ){ |
544 |
|
// thisoffset = rd->GetThisOffset(); |
545 |
|
// }; |
546 |
|
// Int_t niente = 0; |
547 |
|
// TStreamerElement *tste = tb->GetInfo()->GetStreamerElement(rd->GetName(),niente); |
548 |
|
// printf(" typename %s \n",tste->GetTypeName()); |
549 |
|
// // |
550 |
|
// // TArrayI |
551 |
|
// // |
552 |
|
// if ( !strcmp(tste->GetTypeName(),"TArrayI") ){ |
553 |
|
// // |
554 |
|
// printf("qua \n"); |
555 |
|
// char *pointer = (char*)cl->At(0); |
556 |
|
// // char *pu = thisoffset + pointer; |
557 |
|
// int pu = (int)tste->GetTObjectOffset(); |
558 |
|
// TArrayI arr = (TArrayI)*pu; |
559 |
|
// // TArrayI arr = (TArrayI)(thisoffset); |
560 |
|
// //TArrayI *arr = (TArrayI*)pu; |
561 |
|
// //TArraI arr = (TArrayI) |
562 |
|
// Int_t jj=0; |
563 |
|
// j=0; |
564 |
|
// printf("quii \n"); |
565 |
|
// Int_t arlen = min(arr.GetSize(),dlen); |
566 |
|
// // |
567 |
|
// printf("que \n"); |
568 |
|
// setcolor(col,RESET, BLUE, WHITE); |
569 |
|
// setcolor(col2,RESET, BLACK, WHITE); |
570 |
|
// sprintf(o,"%s%s %s[%i]%s = ",o,col,tb->GetName(),arr.GetSize(),col2); |
571 |
|
// // |
572 |
|
// // while ( j < tb->GetNdata() ){ |
573 |
|
// // |
574 |
|
// printf("quo \n"); |
575 |
|
// // pointer = (char*)cl->UncheckedAt(j); |
576 |
|
// // pu = pointer + thisoffset; |
577 |
|
// // arr = (TArrayI*)(thisoffset); |
578 |
|
// // |
579 |
|
// while ( jj < arlen ){ |
580 |
|
// if ( jj < arlen-1 ){ |
581 |
|
// sprintf(o,"%s %i ,",o,arr.At(jj)); |
582 |
|
// } else { |
583 |
|
// sprintf(o,"%s %i",o,arr.At(jj)); |
584 |
|
// }; |
585 |
|
// jj++; |
586 |
|
// }; |
587 |
|
// // if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); |
588 |
|
// // j++; |
589 |
|
// // }; |
590 |
|
// }; |
591 |
|
// // |
592 |
|
// // TArrayF |
593 |
|
// // |
594 |
|
// if ( !strcmp(tste->GetTypeName(),"TArrayF") ){ |
595 |
|
// // |
596 |
|
// char *pointer = (char*)cl->UncheckedAt(0); |
597 |
|
// char *pu = pointer + thisoffset; |
598 |
|
// TArrayF *arr = (TArrayF*)(pu); |
599 |
|
// Int_t jj=0; |
600 |
|
// Int_t arlen = min(arr->GetSize(),dlen); |
601 |
|
// // |
602 |
|
// setcolor(col,RESET, BLUE, WHITE); |
603 |
|
// setcolor(col2,RESET, BLACK, WHITE); |
604 |
|
// sprintf(o,"%s%s %s[%i]%s = ",o,col,tb->GetName(),arr->GetSize(),col2); |
605 |
|
// // |
606 |
|
// while ( j < tb->GetNdata() ){ |
607 |
|
// // |
608 |
|
// pointer = (char*)cl->UncheckedAt(j); |
609 |
|
// pu = pointer + thisoffset; |
610 |
|
// arr = (TArrayF*)(pu); |
611 |
|
// // |
612 |
|
// while ( jj < arlen ){ |
613 |
|
// if ( jj < arlen-1 ){ |
614 |
|
// sprintf(o,"%s %f ,",o,arr->At(jj)); |
615 |
|
// } else { |
616 |
|
// sprintf(o,"%s %f",o,arr->At(jj)); |
617 |
|
// }; |
618 |
|
// jj++; |
619 |
|
// }; |
620 |
|
// if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); |
621 |
|
// j++; |
622 |
|
// }; |
623 |
|
// }; |
624 |
|
// sprintf(o,"%s\n",o); |
625 |
|
// |
626 |
|
sprintf(o,"%s TArray - not implemented yet -",o); |
627 |
|
sprintf(zz,"%s TArray - not implemented yet -",zz); |
628 |
|
// |
629 |
|
}; |
630 |
|
// |
631 |
|
sprintf(o,"%s\n",o); |
632 |
|
sprintf(zz,"%s\n",zz); |
633 |
|
break; |
634 |
|
case 3: |
635 |
|
// |
636 |
|
// IS A TCLONESARRAY |
637 |
|
// |
638 |
|
setcolor(col,RESET, BLUE, WHITE); |
639 |
|
setcolor(col2,RESET, BLACK, WHITE); |
640 |
|
sprintf(o,"%s%s %-15s%s = %d\n",o,col,tb->GetName(), col2, tb->GetNdata()); |
641 |
|
sprintf(zz,"%s %-15s = %d\n",zz,tb->GetName(), tb->GetNdata()); |
642 |
|
|
643 |
// if (otr->GetMakeClass()) { |
// |
644 |
if (!tb->GetAddress()) { |
if ( tb->GetNdata() ){ |
645 |
printf("esco \n"); |
// |
646 |
return; |
TClonesArray *cl = (TClonesArray*)tb->GetObject(); |
647 |
} |
// |
648 |
if (tb->GetType() == 3 || tb->GetType() == 4) { |
TClass *myc = cl->GetClass(); |
649 |
// TClonesArray or STL container top-level branch. |
// |
650 |
printf("3 o 4 %-15s = %d\n", tb->GetName(), tb->GetNdata()); |
TList *lme = myc->GetListOfDataMembers(); |
651 |
return; |
TIter next(lme); |
652 |
} else if (tb->GetType() == 31 || tb->GetType() == 41) { |
TBranchElement *tb2 = 0; |
653 |
printf(" 31 o 41 \n"); |
// |
654 |
// TClonesArray or STL container sub-branch. |
while ( (tb2 = (TBranchElement*)next()) ){ |
655 |
Int_t n = TMath::Min(10, tb->GetNdata()); |
// |
656 |
Int_t atype = tb->GetStreamerType() + 20; |
const char *name = tb2->GetName(); |
657 |
if (tb->GetStreamerType() == 1) { |
TBranch *foglia = tb->FindBranch(name); |
658 |
// TVirtualStreamerInfo::kOffsetL + TVirtualStreamerInfo::kChar is |
if ( foglia ){ |
659 |
// printed as a string and could print weird characters. |
// |
660 |
// So we print an unsigned char instead (not perfect, but better). |
TBranchElement *stb = (TBranchElement*)tb->FindBranch(name); |
661 |
atype = 20 + 11 ; |
Int_t stype = stb->GetType(); |
662 |
} |
Int_t satype = stb->GetStreamerType() - 20; |
663 |
if (atype > 54) { |
// Int_t slen = (stb->GetInfo()->GetLengths())[stb->GetID()]; |
664 |
// FIXME: More logic required here (like in ReadLeaves) |
Int_t slen = stb->GetInfo()->GetLength(stb->GetID()); |
665 |
printf(">54 %-15s = %d\n", tb->GetName(), tb->GetNdata()); |
Int_t slength = min(slen,dlen); |
666 |
return; |
// printf("SubBranches : atype is %i type is %i tb getname %s slen %i slength %i\n",satype,stype,stb->GetName(),slen,slength); |
667 |
} |
switch (stype){ |
668 |
if (tb->GetStreamerType() > 20) { |
case 31: |
669 |
atype -= 20; |
// |
670 |
TObjArray *prova= otr->GetListOfLeaves(); |
// IS A VARIABLE |
671 |
// TObjArray* leaf2 = (TObjArray*) prova->UncheckedAt(i); |
// |
672 |
//TLeaf* leaf = (TLeaf*)(otr->GetLeaf(tb->GetName())); |
// |
673 |
// TLeafElement* leaf = (TLeafElement*)((TLeaf*)(otr->GetListOfLeaves()->UncheckedAt(i))->GetBranch()->UncheckedAt(0)); |
// NAME |
674 |
TLeafElement* leaf = (TLeafElement*)(prova->UncheckedAt(0)); |
// |
675 |
n = n * leaf->GetLenStatic(); |
j = 0; |
676 |
} |
// |
677 |
if (tb->GetInfo()) { |
// VALUES |
678 |
// n = 16; |
// |
679 |
tb->GetInfo()->PrintValue(tb->GetName(), tb->GetAddress(), atype, n, lenmax); |
if ( satype == 41 || satype == 44){ |
680 |
//tb->GetObject()->GetInfo()->PrintValue(tb->GetName(), tb->GetObject(), atype, n, lenmax); |
// |
681 |
} |
// skip TRef |
682 |
return; |
// |
683 |
} else if (tb->GetType() <= 2) { |
break; |
684 |
printf(" <=2 \n"); |
}; |
685 |
// Branch in split mode. |
// |
686 |
// FIXME: This should probably be < 60 instead. |
// Integer |
687 |
if ((tb->GetStreamerType() > 40) && (tb->GetStreamerType() < 55)) { |
// |
688 |
Int_t atype = tb->GetStreamerType() - 20; |
if ( satype == -17 || satype == -9 ){ |
689 |
TBranchElement* counterElement = (TBranchElement*) tb->GetBranchCount(); |
// |
690 |
Int_t n = (Int_t) counterElement->GetValue(0, 0); |
setcolor(col,RESET, BLUE, WHITE); |
691 |
if (tb->GetInfo()) { |
setcolor(col2,RESET, BLACK, WHITE); |
692 |
tb->GetInfo()->PrintValue(tb->GetName(), tb->GetAddress(), atype, n, lenmax); |
sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2); |
693 |
} |
sprintf(zz,"%s %-15s = ",zz,foglia->GetName()); |
694 |
} else { |
while ( j < cl->GetEntriesFast() ){ |
695 |
// if (tb->GetInfo()) { |
if ( j < cl->GetEntriesFast() -1 ){ |
696 |
// tb->GetInfo()->PrintValue(tb->GetName(), tb->GetObject(), tb->GetID(), -1, lenmax); |
sprintf(o,"%s %i ,",o,(Int_t)stb->GetValue(j,slength)); |
697 |
// } |
sprintf(zz,"%s %i ,",zz,(Int_t)stb->GetValue(j,slength)); |
698 |
// } |
} else { |
699 |
return; |
sprintf(o,"%s %i",o,(Int_t)stb->GetValue(j,slength)); |
700 |
} |
sprintf(zz,"%s %i",zz,(Int_t)stb->GetValue(j,slength)); |
701 |
} else if (tb->GetType() == 3) { |
}; |
702 |
printf("3 %-15s = %d\n", tb->GetName(), tb->GetNdata()); |
j++; |
703 |
} else if (tb->GetType() == 31) { |
}; |
704 |
printf("31 %-15s = %d\n", tb->GetName(), tb->GetNdata()); |
}; |
705 |
// TClonesArray* clones = (TClonesArray*) tb->GetObject(); |
// |
706 |
// if (tb->GetInfo()) { |
// Float |
707 |
// tb->GetInfo()->PrintValueClones(tb->GetName(), clones, tb->GetID(), tb->GetOffset(), lenmax); |
// |
708 |
// } |
if ( satype == -15 ){ |
709 |
} else if (tb->GetType() == 41) { |
// |
710 |
printf("41 %-15s = %d\n", tb->GetName(), tb->GetNdata()); |
setcolor(col,RESET, BLUE, WHITE); |
711 |
// TVirtualCollectionProxy::TPushPop helper(((TBranchElement*) this)->GetCollectionProxy(), fObject); |
setcolor(col2,RESET, BLACK, WHITE); |
712 |
// if (GetInfo()) { |
sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2); |
713 |
// GetInfo()->PrintValueSTL(GetName(), ((TBranchElement*) this)->GetCollectionProxy(), fID, fOffset, lenmax); |
sprintf(zz,"%s %-15s = ",zz,foglia->GetName()); |
714 |
// } |
while ( j < cl->GetEntriesFast() ){ |
715 |
} else { |
if ( j < cl->GetEntriesFast() -1 ){ |
716 |
printf("else %-15s = %d\n", tb->GetName(), tb->GetNdata()); |
sprintf(o,"%s %f ,",o,stb->GetValue(j,slength)); |
717 |
// if (GetInfo()) { |
sprintf(zz,"%s %f ,",zz,stb->GetValue(j,slength)); |
718 |
// GetInfo()->PrintValue(GetName(), fObject, fID, -1, lenmax); |
} else { |
719 |
// } |
sprintf(o,"%s %f",o,stb->GetValue(j,slength)); |
720 |
} |
sprintf(zz,"%s %f",zz,stb->GetValue(j,slength)); |
721 |
|
}; |
722 |
|
j++; |
723 |
|
}; |
724 |
|
}; |
725 |
|
// |
726 |
|
// Array of float |
727 |
|
// |
728 |
|
if ( satype == 5 ){ |
729 |
|
// |
730 |
|
setcolor(col,RESET, BLUE, WHITE); |
731 |
|
setcolor(col2,RESET, BLACK, WHITE); |
732 |
|
sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2); |
733 |
|
sprintf(zz,"%s %-15s = ",zz,foglia->GetName()); |
734 |
|
Bool_t bold = true; |
735 |
|
while ( j < tb->GetNdata() ){ |
736 |
|
if ( bold ){ |
737 |
|
setcolor(col,RESET, BLACK, WHITE); |
738 |
|
sprintf(o,"%s%s",o,col); |
739 |
|
} else { |
740 |
|
setcolor(col,BOLD, BLACK, WHITE); |
741 |
|
sprintf(o,"%s%s",o,col); |
742 |
|
}; |
743 |
|
Int_t jj = 0; |
744 |
|
while ( jj < slength ){ |
745 |
|
if ( jj < slength-1 ){ |
746 |
|
sprintf(o,"%s %f ,",o,stb->GetValue(j,jj,true)); |
747 |
|
sprintf(zz,"%s %f ,",zz,stb->GetValue(j,jj,true)); |
748 |
|
} else { |
749 |
|
sprintf(o,"%s %f",o,stb->GetValue(j,jj,true)); |
750 |
|
sprintf(zz,"%s %f",zz,stb->GetValue(j,jj,true)); |
751 |
|
}; |
752 |
|
jj++; |
753 |
|
}; |
754 |
|
if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); |
755 |
|
if ( j < tb->GetNdata() -1 ) sprintf(zz,"%s ,",zz); |
756 |
|
if ( !bold ){ |
757 |
|
bold = true; |
758 |
|
} else { |
759 |
|
bold = false; |
760 |
|
}; |
761 |
|
j++; |
762 |
|
}; |
763 |
|
if ( bold ){ |
764 |
|
setcolor(col,RESET, BLACK, WHITE); |
765 |
|
sprintf(o,"%s%s",o,col); |
766 |
|
}; |
767 |
|
}; |
768 |
|
// |
769 |
|
// Array of integers |
770 |
|
// |
771 |
|
if ( satype == 3 ){ |
772 |
|
// |
773 |
|
setcolor(col,RESET, BLUE, WHITE); |
774 |
|
setcolor(col2,RESET, BLACK, WHITE); |
775 |
|
sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2); |
776 |
|
sprintf(zz,"%s %-15s = ",zz,foglia->GetName()); |
777 |
|
while ( j < tb->GetNdata() ){ |
778 |
|
Int_t jj = 0; |
779 |
|
while ( jj < slength ){ |
780 |
|
if ( jj < slength-1 ){ |
781 |
|
sprintf(o,"%s %i ,",o,(Int_t)stb->GetValue(j,jj,true)); |
782 |
|
sprintf(zz,"%s %i ,",zz,(Int_t)stb->GetValue(j,jj,true)); |
783 |
|
} else { |
784 |
|
sprintf(o,"%s %i",o,(Int_t)stb->GetValue(j,jj,true)); |
785 |
|
sprintf(zz,"%s %i",zz,(Int_t)stb->GetValue(j,jj,true)); |
786 |
|
}; |
787 |
|
jj++; |
788 |
|
}; |
789 |
|
if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); |
790 |
|
if ( j < tb->GetNdata() -1 ) sprintf(zz,"%s ,",zz); |
791 |
|
j++; |
792 |
|
}; |
793 |
|
}; |
794 |
|
|
795 |
// }; |
// |
796 |
printf("esco qui\n"); |
// TArray |
797 |
|
// |
798 |
|
if ( satype == 42 ){ |
799 |
|
// |
800 |
|
// determine offset to fetch data |
801 |
|
// |
802 |
|
int thisoffset = 0; |
803 |
|
TRealData *rd = myc->GetRealData(foglia->GetName()); |
804 |
|
if ( rd ){ |
805 |
|
thisoffset = rd->GetThisOffset(); |
806 |
|
}; |
807 |
|
Int_t niente = 0; |
808 |
|
TStreamerElement *tste = stb->GetInfo()->GetStreamerElement(rd->GetName(),niente); |
809 |
|
// |
810 |
|
// TArrayI |
811 |
|
// |
812 |
|
if ( !strcmp(tste->GetTypeName(),"TArrayI") ){ |
813 |
|
// |
814 |
|
char *pointer = (char*)cl->UncheckedAt(0); |
815 |
|
char *pu = pointer + thisoffset; |
816 |
|
TArrayI *arr = (TArrayI*)(pu); |
817 |
|
Int_t jj=0; |
818 |
|
Int_t arlen = min(arr->GetSize(),dlen); |
819 |
|
// |
820 |
|
setcolor(col,RESET, BLUE, WHITE); |
821 |
|
setcolor(col2,RESET, BLACK, WHITE); |
822 |
|
sprintf(o,"%s%s %s[%i]%s = ",o,col,foglia->GetName(),arr->GetSize(),col2); |
823 |
|
sprintf(zz,"%s %s[%i] = ",zz,foglia->GetName(),arr->GetSize()); |
824 |
|
// |
825 |
|
while ( j < tb->GetNdata() ){ |
826 |
|
// |
827 |
|
pointer = (char*)cl->UncheckedAt(j); |
828 |
|
pu = pointer + thisoffset; |
829 |
|
arr = (TArrayI*)(pu); |
830 |
|
// |
831 |
|
while ( jj < arlen ){ |
832 |
|
if ( jj < arlen-1 ){ |
833 |
|
sprintf(o,"%s %i ,",o,arr->At(jj)); |
834 |
|
sprintf(zz,"%s %i ,",zz,arr->At(jj)); |
835 |
|
} else { |
836 |
|
sprintf(o,"%s %i",o,arr->At(jj)); |
837 |
|
sprintf(zz,"%s %i",zz,arr->At(jj)); |
838 |
|
}; |
839 |
|
jj++; |
840 |
|
}; |
841 |
|
if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); |
842 |
|
if ( j < tb->GetNdata() -1 ) sprintf(zz,"%s ,",zz); |
843 |
|
j++; |
844 |
|
}; |
845 |
|
}; |
846 |
|
// |
847 |
|
// TArrayF |
848 |
|
// |
849 |
|
if ( !strcmp(tste->GetTypeName(),"TArrayF") ){ |
850 |
|
// |
851 |
|
char *pointer = (char*)cl->UncheckedAt(0); |
852 |
|
char *pu = pointer + thisoffset; |
853 |
|
TArrayF *arr = (TArrayF*)(pu); |
854 |
|
Int_t jj=0; |
855 |
|
Int_t arlen = min(arr->GetSize(),dlen); |
856 |
|
// |
857 |
|
setcolor(col,RESET, BLUE, WHITE); |
858 |
|
setcolor(col2,RESET, BLACK, WHITE); |
859 |
|
sprintf(o,"%s%s %s[%i]%s = ",o,col,foglia->GetName(),arr->GetSize(),col2); |
860 |
|
sprintf(zz,"%s %s[%i] = ",zz,foglia->GetName(),arr->GetSize()); |
861 |
|
// |
862 |
|
while ( j < tb->GetNdata() ){ |
863 |
|
// |
864 |
|
pointer = (char*)cl->UncheckedAt(j); |
865 |
|
pu = pointer + thisoffset; |
866 |
|
arr = (TArrayF*)(pu); |
867 |
|
// |
868 |
|
while ( jj < arlen ){ |
869 |
|
if ( jj < arlen-1 ){ |
870 |
|
sprintf(o,"%s %f ,",o,arr->At(jj)); |
871 |
|
sprintf(zz,"%s %f ,",zz,arr->At(jj)); |
872 |
|
} else { |
873 |
|
sprintf(o,"%s %f",o,arr->At(jj)); |
874 |
|
sprintf(zz,"%s %f",zz,arr->At(jj)); |
875 |
|
}; |
876 |
|
jj++; |
877 |
|
}; |
878 |
|
if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); |
879 |
|
if ( j < tb->GetNdata() -1 ) sprintf(zz,"%s ,",zz); |
880 |
|
j++; |
881 |
|
}; |
882 |
|
}; |
883 |
|
}; |
884 |
|
sprintf(o,"%s\n",o); |
885 |
|
sprintf(zz,"%s\n",zz); |
886 |
|
break; |
887 |
|
}; |
888 |
|
}; |
889 |
|
}; |
890 |
|
}; |
891 |
|
break; |
892 |
|
}; |
893 |
|
}; |
894 |
|
printf("%s\n",o); |
895 |
|
pamgui->DIALOG(4,zz); |
896 |
}; |
}; |
897 |
|
|
|
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 "); |
|
|
} |
|
|
} |
|
|
} |
|
|
}; |
|
898 |
|
|
899 |
void FEVdetector::GetGeneralInfo(){ |
void FEVdetector::GetGeneralInfo(){ |
900 |
// |
// |
905 |
headcold = headc; |
headcold = headc; |
906 |
headc = ph->Counter; |
headc = ph->Counter; |
907 |
var.headc = (int)ph->Counter; |
var.headc = (int)ph->Counter; |
908 |
OBT = ph->OrbitalTime; |
OBT = (UInt_t)ph->OrbitalTime; |
909 |
DOBT = OBT - OOBT; |
DOBT = OBT - OOBT; |
910 |
OOBT = OBT; |
OOBT = OBT; |
911 |
if ( thisentry == minevent || DOBT < 0 || (headc-headcold-1)!=0 ) DOBT = 0; |
if ( thisentry == minevent || DOBT < 0 || (headc-headcold-1)!=0 ) DOBT = 0; |
941 |
trcs = (TString)trc.str().c_str(); |
trcs = (TString)trc.str().c_str(); |
942 |
} else { |
} else { |
943 |
headcold = headc; |
headcold = headc; |
944 |
headc = L2->GetOrbitalInfo()->pkt_num; // to be changed as soon as we will have obt in the level2 file! |
if ( var.RUN ){ |
945 |
OBT = L2->GetOrbitalInfo()->OBT; // to be changed as soon as we will have obt in the level2 file! |
var.idrun = L2->GetRunInfo()->ID; |
946 |
DOBT = OBT - OOBT; |
var.idroot = L2->GetRunInfo()->ID_ROOT_L0; |
947 |
OOBT = OBT; |
var.EVF = L2->GetRunInfo()->EV_FROM; |
948 |
if ( thisentry == minevent || DOBT < 0 || (headc-headcold-1)!=0 ) DOBT = 0; |
}; |
949 |
var.etime = OBT; |
if ( var.ORB ){ |
950 |
|
headc = L2->GetOrbitalInfo()->pkt_num; |
951 |
|
OBT = L2->GetOrbitalInfo()->OBT; |
952 |
|
DOBT = OBT - OOBT; |
953 |
|
OOBT = OBT; |
954 |
|
if ( thisentry == minevent || DOBT < 0 || (headc-headcold-1)!=0 ) DOBT = 0; |
955 |
|
var.etime = OBT; |
956 |
|
} else { |
957 |
|
var.etime = 0; |
958 |
|
}; |
959 |
// |
// |
960 |
// who gave the trigger? |
// who gave the trigger? |
961 |
// |
// |
962 |
calotrig = 0; |
Int_t trigconf = 0; |
963 |
if ( L2->GetTrigLevel2()->patterntrig[0] ) calotrig = 1; |
if ( var.TRG ){ |
964 |
toftrig = 0; |
calotrig = 0; |
965 |
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; |
966 |
s4pulser = 0; |
toftrig = 0; |
967 |
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; |
968 |
// |
s4pulser = 0; |
969 |
// 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; |
970 |
// S4 sometimes could not set the flag even if the trigger is given. This is a workaround to fix this "bug": |
// |
971 |
// |
// TOF and calorimeter when giving a trigger will always set this flag since the time window of the signal is greater than 100 ns. |
972 |
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": |
973 |
// |
// |
974 |
Int_t trigconf = L2->GetTrigLevel2()->trigconf; |
if ( !calotrig && !toftrig ) s4pulser = 1; |
975 |
|
// |
976 |
|
trigconf = L2->GetTrigLevel2()->trigconf; |
977 |
|
} else { |
978 |
|
trigconf = 0; |
979 |
|
} |
980 |
stringstream trc; |
stringstream trc; |
981 |
trc.str(""); |
trc.str(""); |
982 |
if ( trigconf & (1<<0) ) trc << "TOF1"; |
if ( trigconf & (1<<0) ) trc << "TOF1"; |
1064 |
// |
// |
1065 |
if ( level.file == 2 ){ |
if ( level.file == 2 ){ |
1066 |
cintcom.str(""); |
cintcom.str(""); |
1067 |
cintcom << "PamLevel2 *L2 = (PamLevel2*)0x" << hex; |
cintcom << "PamLevel2 *L2 = (PamLevel2*)" << hex; //con const e l2 funziona |
1068 |
cintcom << L2; |
cintcom << L2; |
1069 |
gROOT->ProcessLine(cintcom.str().c_str()); |
gROOT->ProcessLine(cintcom.str().c_str()); |
1070 |
|
// printf(" comando: %s \n",cintcom.str().c_str()); |
1071 |
} else { |
} else { |
1072 |
cintcom.str(""); |
cintcom.str(""); |
1073 |
cintcom << "TTree *otr = (TTree*)0x" << hex; |
cintcom << "TTree *otr = (TTree*)" << hex; |
1074 |
cintcom << otr; |
cintcom << otr; |
1075 |
gROOT->ProcessLine(cintcom.str().c_str()); |
gROOT->ProcessLine(cintcom.str().c_str()); |
1076 |
// |
// |
1077 |
cintcom.str(""); |
cintcom.str(""); |
1078 |
cintcom << "struct Variables &var = (struct Variables &)0x" << hex; |
cintcom << "struct Variables &var = (struct Variables &)" << hex; |
1079 |
cintcom << &var; |
cintcom << &var; |
1080 |
gROOT->ProcessLine(cintcom.str().c_str()); |
gROOT->ProcessLine(cintcom.str().c_str()); |
1081 |
}; |
}; |
1086 |
// |
// |
1087 |
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);"); |
1088 |
// |
// |
1089 |
if ( level.file == 2 ) isOK = gApplication->ProcessLine("filter((PamLevel2 *)L2,2);"); |
// if ( level.file == 2 ) isOK = gApplication->ProcessLine("filter((PamLevel2 *)L2,2);"); |
1090 |
|
if ( level.file == 2 ) isOK = gApplication->ProcessLine("filter();"); |
1091 |
// |
// |
1092 |
// progress bar in text window |
// progress bar in text window |
1093 |
// |
// |
1100 |
// |
// |
1101 |
} |
} |
1102 |
|
|
1103 |
Int_t FEVdetector::Load(TTree &mainotr, TFile &mainfile){ |
TChain* FEVdetector::Load(TString file){ |
1104 |
file = &mainfile; |
// |
1105 |
otr = &mainotr; |
// file = &mainfile; |
|
L2 = new PamLevel2(); |
|
1106 |
// |
// |
1107 |
if ( level.file == 2 ){ |
if ( level.file == 2 ){ |
1108 |
// otr = L2->LoadPamTrees(file); |
// |
1109 |
// printf(" %s \n",ddec.Data()); |
// printf(" %s \n",ddec.Data()); |
1110 |
otr = L2->GetPamTree(file,ddec.Data()); |
if ( !L2 ){ |
1111 |
|
L2 = new PamLevel2("",file.Data(),ddec.Data()); |
1112 |
|
if ( NODB ) L2->NoDBconnections(); |
1113 |
|
otr = L2->GetPamTree(); |
1114 |
|
// printf(" l2 constructor\n"); |
1115 |
|
// printf(" abst %u obt %u qtot %f \n",L2->GetOrbitalInfo()->absTime,L2->GetOrbitalInfo()->OBT,L2->GetCaloLevel2()->qtot); |
1116 |
|
} else { |
1117 |
|
// |
1118 |
|
// printf(" l2 already exist \n"); |
1119 |
|
otr = L2->GetPamTree(gSystem->DirName(file.Data()),file.Data(),ddec.Data()); |
1120 |
|
L2->GetRunTree(gSystem->DirName(file.Data()),file.Data()); |
1121 |
|
// |
1122 |
|
}; |
1123 |
|
// |
1124 |
// |
// |
1125 |
if ( !otr ) return(0); |
if ( !otr ) return(0); |
|
// ******************** |
|
|
// load magnetic field |
|
|
// ******************** |
|
|
const char *pam_calib = pathtocalibration(); |
|
1126 |
// |
// |
1127 |
stringstream magfie; |
// otr->CanDeleteRefs(true); |
1128 |
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/"; |
|
1129 |
// |
// |
|
L2->GetTrkLevel2()->LoadField(magfie.str().c_str()); |
|
1130 |
} else { |
} else { |
1131 |
// |
// |
1132 |
// load calorimeter ADC2MIP conversion file |
// load calorimeter ADC2MIP conversion file |
1167 |
}; |
}; |
1168 |
// |
// |
1169 |
// |
// |
1170 |
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(); |
|
1171 |
// |
// |
1172 |
if ( level.file == 0 || level.file == -1 ){ |
if ( level.file == 0 || level.file == -1 ){ |
1173 |
|
// |
1174 |
|
trigger = new pamela::trigger::TriggerEvent(); |
1175 |
|
eh = new pamela::EventHeader(); |
1176 |
|
ph = new pamela::PscuHeader(); |
1177 |
|
de = new pamela::calorimeter::CalorimeterEvent(); |
1178 |
|
trk = new pamela::tracker::TrackerEvent(); |
1179 |
|
ne = new pamela::neutron::NeutronEvent(); |
1180 |
|
ace = new pamela::anticounter::AnticounterEvent(); |
1181 |
|
s4 = new pamela::S4::S4Event(); |
1182 |
|
tof = new pamela::tof::TofEvent(); |
1183 |
|
// |
1184 |
|
otr = new TChain("Physics"); |
1185 |
|
otr->Add(file.Data(),-1); |
1186 |
otr->SetBranchAddress("Trigger", &trigger); |
otr->SetBranchAddress("Trigger", &trigger); |
1187 |
otr->SetBranchAddress("Header", &eh); |
otr->SetBranchAddress("Header", &eh); |
1188 |
}; |
}; |
|
if ( level.file == 2 && var.RUN){ |
|
|
// otr->AddFriend("OrbitalInfo", file); |
|
|
// otr->SetBranchAddress("OrbitalInfo", &oinfoL2); |
|
|
runinfo->Read(0ULL); |
|
|
}; |
|
1189 |
// |
// |
1190 |
if ( var.TRK ) { |
if ( var.TRK ) { |
1191 |
if ( level.file == 0 || level.file == -1 ){ |
if ( level.file == 0 || level.file == -1 ){ |
1258 |
}; |
}; |
1259 |
}; |
}; |
1260 |
// |
// |
1261 |
return(1); |
if ( !otr ){ |
1262 |
|
return(0); |
1263 |
|
}; |
1264 |
|
// |
1265 |
|
return otr; |
1266 |
// |
// |
1267 |
} |
} |
1268 |
|
|
1269 |
|
bool bit(int decimal, char pos) |
1270 |
|
{ |
1271 |
|
return( (decimal>>pos)%2 ); |
1272 |
|
} |
1273 |
|
// |
1274 |
|
// THE PATTERN TRIGGER |
1275 |
|
// |
1276 |
|
void FEVdetector::ShowTRG(){ |
1277 |
|
// |
1278 |
|
if ( level.file != 2 ) return; |
1279 |
|
// |
1280 |
|
if ( !var.TRG ) return; |
1281 |
|
// |
1282 |
|
int S11[8]; |
1283 |
|
S11[0] = 0; |
1284 |
|
S11[1] = 0; |
1285 |
|
S11[2] = 0; |
1286 |
|
S11[3] = 0; |
1287 |
|
S11[4] = 0; |
1288 |
|
S11[5] = 0; |
1289 |
|
S11[6] = 0; |
1290 |
|
S11[7] = 0; |
1291 |
|
|
1292 |
|
int S12[6]; |
1293 |
|
S12[0] = 0; |
1294 |
|
S12[1] = 0; |
1295 |
|
S12[2] = 0; |
1296 |
|
S12[3] = 0; |
1297 |
|
S12[4] = 0; |
1298 |
|
S12[5] = 0; |
1299 |
|
|
1300 |
|
int S21[2]; |
1301 |
|
S21[0] = 0; |
1302 |
|
S21[1] = 0; |
1303 |
|
|
1304 |
|
int S22[2]; |
1305 |
|
S22[0] = 0; |
1306 |
|
S22[1] = 0; |
1307 |
|
|
1308 |
|
int S31[3]; |
1309 |
|
S31[0] = 0; |
1310 |
|
S31[1] = 0; |
1311 |
|
S31[2] = 0; |
1312 |
|
|
1313 |
|
int S32[3]; |
1314 |
|
S32[0] = 0; |
1315 |
|
S32[1] = 0; |
1316 |
|
S32[2] = 0; |
1317 |
|
|
1318 |
|
//S3 |
1319 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[2],0) ) S31[0]++; |
1320 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[2],1) ) S31[1]++; |
1321 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[2],2) ) S31[2]++; |
1322 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[2],3) ) S31[0]++; |
1323 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[2],4) ) S31[1]++; |
1324 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[2],5) ) S31[2]++; |
1325 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[2],6) ) S32[0]++; |
1326 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[2],7) ) S32[1]++; |
1327 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[2],8) ) S32[2]++; |
1328 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[2],9) ) S32[0]++; |
1329 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[2],10) ) S32[1]++; |
1330 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[2],11) ) S32[2]++; |
1331 |
|
//S2 |
1332 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[3],0) ) S21[0]++; |
1333 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[3],1) ) S21[1]++; |
1334 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[3],2) ) S21[0]++; |
1335 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[3],3) ) S21[1]++; |
1336 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[3],4) ) S22[0]++; |
1337 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[3],5) ) S22[1]++; |
1338 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[3],6) ) S22[0]++; |
1339 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[3],7) ) S22[1]++; |
1340 |
|
//S12 |
1341 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[4],0) ) S12[0]++; |
1342 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[4],1) ) S12[1]++; |
1343 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[4],2) ) S12[2]++; |
1344 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[4],3) ) S12[3]++; |
1345 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[4],4) ) S12[4]++; |
1346 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[4],5) ) S12[5]++; |
1347 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[4],6) ) S12[0]++; |
1348 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[4],7) ) S12[1]++; |
1349 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[4],8) ) S12[2]++; |
1350 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[4],9) ) S12[3]++; |
1351 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[4],10) ) S12[4]++; |
1352 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[4],11) ) S12[5]++; |
1353 |
|
//S11 |
1354 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[5],0) ) S11[0]++; |
1355 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[5],1) ) S11[1]++; |
1356 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[5],2) ) S11[2]++; |
1357 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[5],3) ) S11[3]++; |
1358 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[5],4) ) S11[4]++; |
1359 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[5],5) ) S11[5]++; |
1360 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[5],6) ) S11[6]++; |
1361 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[5],7) ) S11[7]++; |
1362 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[5],8) ) S11[0]++; |
1363 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[5],9) ) S11[1]++; |
1364 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[5],10) ) S11[2]++; |
1365 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[5],11) ) S11[3]++; |
1366 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[5],12) ) S11[4]++; |
1367 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[5],13) ) S11[5]++; |
1368 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[5],14) ) S11[6]++; |
1369 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[5],15) ) S11[7]++; |
1370 |
|
|
1371 |
|
|
1372 |
|
// |
1373 |
|
Int_t rj = 0; |
1374 |
|
Float_t xs2x = var.xxvc; |
1375 |
|
Float_t ys2x = var.yxvc + 0.36*var.sfy; |
1376 |
|
Float_t xs2y = var.xyvc; |
1377 |
|
Float_t ys2y = var.yyvc + 0.36*var.sfy; |
1378 |
|
Float_t ws2 = 0.005; |
1379 |
|
Float_t ws13 = 0.007; |
1380 |
|
Int_t noadc; |
1381 |
|
if ( var.bw ){ |
1382 |
|
noadc=12; |
1383 |
|
} else { |
1384 |
|
noadc=kRed; |
1385 |
|
}; |
1386 |
|
// |
1387 |
|
// S11 X-view |
1388 |
|
// |
1389 |
|
Float_t s11p = 0.051; |
1390 |
|
TPolyLine *ftrg11x[8]; |
1391 |
|
for ( Int_t j=0; j<8; j++){ |
1392 |
|
Float_t nxc1[5]={ (s11p*j), (s11p*j), s11p*(j+1), s11p*(j+1), (s11p*j)}; |
1393 |
|
Float_t nyc1[5]={ 0., ws13, ws13, 0., 0.}; |
1394 |
|
Float_t nxc[5]; |
1395 |
|
Float_t nyc[5]; |
1396 |
|
for (Int_t i = 0; i<5 ; i++) { |
1397 |
|
nxc[i]= xs2x + (-0.204+nxc1[i])*var.sfx; |
1398 |
|
nyc[i] = ys2x + (0.295+nyc1[i])*var.sfy; |
1399 |
|
}; |
1400 |
|
ftrg11x[j] = new TPolyLine(5,nxc,nyc); |
1401 |
|
ftrg11x[j]->SetLineColor(noadc); |
1402 |
|
ftrg11x[j]->SetLineWidth(S11[j]); |
1403 |
|
if ( S11[j] ) ftrg11x[j]->Draw(); |
1404 |
|
}; |
1405 |
|
// |
1406 |
|
// S12 Y-view |
1407 |
|
// |
1408 |
|
Float_t s12p = 0.055; |
1409 |
|
TPolyLine *ftrg12y[6]; |
1410 |
|
rj = 6; |
1411 |
|
for ( Int_t j=0; j<6; j++){ |
1412 |
|
rj--; |
1413 |
|
Float_t nxc1[5]={ (s12p*j), (s12p*j), s12p*(j+1), s12p*(j+1), (s12p*j)}; |
1414 |
|
Float_t nyc1[5]={ -ws13, 0., 0., -ws13, -ws13}; |
1415 |
|
Float_t nxc[5]; |
1416 |
|
Float_t nyc[5]; |
1417 |
|
for (Int_t i = 0; i<5 ; i++) { |
1418 |
|
nxc[i]= xs2y + (-0.165+nxc1[i])*var.sfx; |
1419 |
|
nyc[i] = ys2y + (0.295+nyc1[i])*var.sfy; |
1420 |
|
}; |
1421 |
|
ftrg12y[j] = new TPolyLine(5,nxc,nyc); |
1422 |
|
ftrg12y[j]->SetLineColor(noadc); |
1423 |
|
ftrg12y[j]->SetLineWidth(S12[rj]); |
1424 |
|
if ( S12[rj] ) ftrg12y[j]->Draw(); |
1425 |
|
}; |
1426 |
|
|
1427 |
|
|
1428 |
|
// |
1429 |
|
// S21 Y-view |
1430 |
|
// |
1431 |
|
Float_t s21p = 0.075; |
1432 |
|
TPolyLine *ftrg21y[2]; |
1433 |
|
rj=2; |
1434 |
|
for ( Int_t j=0; j<2; j++){ |
1435 |
|
rj--; |
1436 |
|
Float_t nxc1[5]={ s21p*(j-1), s21p*(j-1), s21p*j,s21p*j, s21p*(j-1)}; |
1437 |
|
Float_t nyc1[5]={ 0., ws2, ws2, 0., 0.}; |
1438 |
|
Float_t nxc[5]; |
1439 |
|
Float_t nyc[5]; |
1440 |
|
for (Int_t i = 0; i<5 ; i++) { |
1441 |
|
nxc[i]= xs2y + nxc1[i]*var.sfx; |
1442 |
|
nyc[i] = ys2y + nyc1[i]*var.sfy; |
1443 |
|
// printf(" TRG i %i x %f y %f \n",i,nxc[i],nyc[i]); |
1444 |
|
}; |
1445 |
|
ftrg21y[j] = new TPolyLine(5,nxc,nyc); |
1446 |
|
ftrg21y[j]->SetLineColor(noadc); |
1447 |
|
ftrg21y[j]->SetLineWidth(S21[j]); |
1448 |
|
if ( S21[j]) ftrg21y[j]->Draw(); |
1449 |
|
}; |
1450 |
|
|
1451 |
|
// |
1452 |
|
// S22 X-view |
1453 |
|
// |
1454 |
|
Float_t s22p = 0.090; |
1455 |
|
TPolyLine *ftrg22x[2]; |
1456 |
|
for ( Int_t j=0; j<2; j++){ |
1457 |
|
Float_t nxc1[5]={ s22p*(j-1), s22p*(j-1), s22p*j, s22p*j, s22p*(j-1)}; |
1458 |
|
Float_t nyc1[5]={ -ws2, 0., 0., -ws2, -ws2}; |
1459 |
|
Float_t nxc[5]; |
1460 |
|
Float_t nyc[5]; |
1461 |
|
for (Int_t i = 0; i<5 ; i++) { |
1462 |
|
nxc[i]= xs2x + nxc1[i]*var.sfx; |
1463 |
|
nyc[i] = ys2x + nyc1[i]*var.sfy; |
1464 |
|
}; |
1465 |
|
ftrg22x[j] = new TPolyLine(5,nxc,nyc); |
1466 |
|
ftrg22x[j]->SetLineColor(noadc); |
1467 |
|
ftrg22x[j]->SetLineWidth(S22[j]); |
1468 |
|
if ( S22[j] ) ftrg22x[j]->Draw(); |
1469 |
|
}; |
1470 |
|
// |
1471 |
|
// S31 X-view |
1472 |
|
// |
1473 |
|
Float_t s31p = 0.060; |
1474 |
|
TPolyLine *ftrg31x[3]; |
1475 |
|
for ( Int_t j=0; j<3; j++){ |
1476 |
|
Float_t nxc1[5]={ (s31p*j), (s31p*j), s31p*(j+1), s31p*(j+1), (s31p*j)}; |
1477 |
|
Float_t nyc1[5]={ 0., ws13, ws13, 0., 0.}; |
1478 |
|
Float_t nxc[5]; |
1479 |
|
Float_t nyc[5]; |
1480 |
|
for (Int_t i = 0; i<5 ; i++) { |
1481 |
|
nxc[i]= xs2x + (-0.090+nxc1[i])*var.sfx; |
1482 |
|
nyc[i] = ys2x + (-0.488+nyc1[i])*var.sfy; |
1483 |
|
}; |
1484 |
|
ftrg31x[j] = new TPolyLine(5,nxc,nyc); |
1485 |
|
ftrg31x[j]->SetLineColor(noadc); |
1486 |
|
ftrg31x[j]->SetLineWidth(S31[j]); |
1487 |
|
if ( S31[j] ) ftrg31x[j]->Draw(); |
1488 |
|
}; |
1489 |
|
|
1490 |
|
// |
1491 |
|
// S32 Y-view |
1492 |
|
// |
1493 |
|
Float_t s32p = 0.050; |
1494 |
|
TPolyLine *ftrg32y[3]; |
1495 |
|
rj = 3; |
1496 |
|
for ( Int_t j=0; j<3; j++){ |
1497 |
|
rj--; |
1498 |
|
Float_t nxc1[5]={ (s32p*j), (s32p*j), s32p*(j+1),s32p*(j+1), (s32p*j)}; |
1499 |
|
Float_t nyc1[5]={ -ws13, 0., 0., -ws13, -ws13}; |
1500 |
|
Float_t nxc[5]; |
1501 |
|
Float_t nyc[5]; |
1502 |
|
for (Int_t i = 0; i<5 ; i++) { |
1503 |
|
nxc[i]= xs2y + (-0.075+nxc1[i])*var.sfx; |
1504 |
|
nyc[i] = ys2y + (-0.488+nyc1[i])*var.sfy; |
1505 |
|
}; |
1506 |
|
ftrg32y[j] = new TPolyLine(5,nxc,nyc); |
1507 |
|
ftrg32y[j]->SetLineColor(noadc); |
1508 |
|
ftrg32y[j]->SetLineWidth(S32[rj]); |
1509 |
|
if ( S32[rj] ) ftrg32y[j]->Draw(); |
1510 |
|
} |
1511 |
|
} |
1512 |
|
|
1513 |
void FEVdetector::DisplayEvent(){ |
void FEVdetector::DisplayEvent(){ |
1514 |
TLatex *text=new TLatex(); |
TLatex *text=new TLatex(); |
1515 |
stringstream testo; |
stringstream testo; |
1525 |
thefigure->cd(); |
thefigure->cd(); |
1526 |
ShowTOF(); |
ShowTOF(); |
1527 |
// |
// |
1528 |
|
// show pattern trigger if the case |
1529 |
|
// |
1530 |
|
thefigure->cd(); |
1531 |
|
if ( var.PATTRIG ){ |
1532 |
|
ShowTRG(); |
1533 |
|
thefigure->Modified(); |
1534 |
|
thefigure->Update(); |
1535 |
|
} |
1536 |
|
// |
1537 |
// show anticounters |
// show anticounters |
1538 |
// |
// |
1539 |
thefigure->cd(); |
thefigure->cd(); |
1591 |
text->DrawLatex(0.33,txthi,testo.str().c_str()); |
text->DrawLatex(0.33,txthi,testo.str().c_str()); |
1592 |
txthi -= 0.03; |
txthi -= 0.03; |
1593 |
testo2.str(""); |
testo2.str(""); |
1594 |
testo2 << "On Board Time: " << (int)OBT; |
testo2 << "On Board Time: " << (unsigned int)OBT; |
1595 |
if ( DOBT > 0 ) { |
if ( DOBT > 0 ) { |
1596 |
testo2 << " (delta: " << (int)DOBT; |
testo2 << " (delta: " << (unsigned int)DOBT; |
1597 |
testo2 << ")"; |
testo2 << ")"; |
1598 |
}; |
}; |
1599 |
testo2 << " [ms]"; |
testo2 << " [ms]"; |
1630 |
testo3 << "S4: ";// << setprecision(2); |
testo3 << "S4: ";// << setprecision(2); |
1631 |
testo3 << var.s4sig << " [MIP] TOF: #beta = "; |
testo3 << var.s4sig << " [MIP] TOF: #beta = "; |
1632 |
testo3 << setprecision(3) << var.beta[4]; |
testo3 << setprecision(3) << var.beta[4]; |
1633 |
|
if ( level.file == 2 ){ |
1634 |
|
testo3 << " SVL cutoff: "; |
1635 |
|
testo3 << setprecision(3) << L2->GetOrbitalInfo()->GetCutoffSVL();//quiquiqui |
1636 |
|
} |
1637 |
text->DrawLatex(0.33,txthi,testo3.str().c_str()); |
text->DrawLatex(0.33,txthi,testo3.str().c_str()); |
1638 |
txthi -= 0.03; |
txthi -= 0.03; |
1639 |
testo3.str(""); |
testo3.str(""); |
1755 |
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"); |
1756 |
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"); |
1757 |
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"); |
1758 |
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"); |
1759 |
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"); |
1760 |
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"); |
1761 |
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"); |
1762 |
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"); |
1763 |
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"); |
1764 |
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"); |
1886 |
// |
// |
1887 |
// print infos on terminal |
// print infos on terminal |
1888 |
// |
// |
1889 |
|
// if ( !var.selex ){ |
1890 |
printf(" File: %s \n",var.thefilename.Data()); |
printf(" File: %s \n",var.thefilename.Data()); |
1891 |
if ( !s4pulser && !calotrig ){ |
if ( !s4pulser && !calotrig ){ |
1892 |
printf(" Pkt_num: %i - Progressive number: %i \n",(int)headc,thisentry+1); |
printf(" Pkt_num: %i - Progressive number: %i \n",(int)headc,thisentry+1); |
1897 |
if ( calotrig ){ |
if ( calotrig ){ |
1898 |
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); |
1899 |
}; |
}; |
1900 |
printf(" On Board Time: %i (delta %i) [ms]\n",OBT,DOBT); |
printf(" On Board Time: %u (delta %i) [ms]\n",OBT,DOBT); |
1901 |
const char *trc2 = trcs; |
const char *trc2 = trcs; |
1902 |
printf(" TRIGGER: %s \n",trc2); |
printf(" TRIGGER: %s \n",trc2); |
1903 |
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); |
1909 |
printf(" CALO: NSTRIP = %i QTOT = %i [MIP]\n",var.nstrip,var.qtot); |
printf(" CALO: NSTRIP = %i QTOT = %i [MIP]\n",var.nstrip,var.qtot); |
1910 |
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]); |
1911 |
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); |
1912 |
|
// }; |
1913 |
// |
// |
1914 |
} |
} |
1915 |
|
|
2217 |
void FEVdetector::ShowTOF(){ |
void FEVdetector::ShowTOF(){ |
2218 |
// |
// |
2219 |
// |
// |
|
// |
|
2220 |
if ( !var.TOF ) return; |
if ( !var.TOF ) return; |
2221 |
// |
// |
2222 |
Int_t tt = 0; |
Int_t tt = 0; |
2223 |
|
Int_t rj = 0; |
2224 |
// |
// |
2225 |
// force level0, i.e. show patterntrig variable! |
// force level0, i.e. show patterntrig variable! |
2226 |
// |
// |
2250 |
Float_t mt31[2][3]; |
Float_t mt31[2][3]; |
2251 |
Float_t mt32[2][3]; |
Float_t mt32[2][3]; |
2252 |
// |
// |
2253 |
|
memset(mt11,0,2*8*sizeof(Float_t)); |
2254 |
|
memset(mt12,0,2*6*sizeof(Float_t)); |
2255 |
|
memset(mt21,0,2*2*sizeof(Float_t)); |
2256 |
|
memset(mt22,0,2*2*sizeof(Float_t)); |
2257 |
|
memset(mt31,0,2*3*sizeof(Float_t)); |
2258 |
|
memset(mt32,0,2*3*sizeof(Float_t)); |
2259 |
|
// |
2260 |
Int_t S3 = 0; |
Int_t S3 = 0; |
2261 |
Int_t S2 = 0; |
Int_t S2 = 0; |
2262 |
Int_t S12 = 0; |
Int_t S12 = 0; |
2421 |
Float_t s12p = 0.055; |
Float_t s12p = 0.055; |
2422 |
ocolo = 10; |
ocolo = 10; |
2423 |
TPolyLine *ftof12ya[6]; |
TPolyLine *ftof12ya[6]; |
2424 |
|
rj=6; |
2425 |
for ( Int_t j=0; j<6; j++){ |
for ( Int_t j=0; j<6; j++){ |
2426 |
|
rj--; |
2427 |
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)}; |
2428 |
Float_t yc1[4]={ -ws13, 0., 0., -ws13}; |
Float_t yc1[4]={ -ws13, 0., 0., -ws13}; |
2429 |
Float_t xc[4]; |
Float_t xc[4]; |
2439 |
} else { |
} else { |
2440 |
colo = 1; |
colo = 1; |
2441 |
}; |
}; |
2442 |
ColorMIP(ms12a[j],colo); |
ColorMIP(ms12a[rj],colo); |
2443 |
// |
// |
2444 |
if ( colo != 10 ) ocolo = colo; |
if ( colo != 10 ) ocolo = colo; |
2445 |
if ( mt12[0][j] == 4095. ) colo = noadc; |
if ( mt12[0][rj] == 4095. ) colo = noadc; |
2446 |
// |
// |
2447 |
ftof12ya[j]->SetFillColor(colo); |
ftof12ya[j]->SetFillColor(colo); |
2448 |
ftof12ya[j]->SetLineWidth(1); |
ftof12ya[j]->SetLineWidth(1); |
2452 |
// B |
// B |
2453 |
s12p = 0.055; |
s12p = 0.055; |
2454 |
TPolyLine *ftof12yb[6]; |
TPolyLine *ftof12yb[6]; |
2455 |
|
rj=6; |
2456 |
for ( Int_t j=0; j<6; j++){ |
for ( Int_t j=0; j<6; j++){ |
2457 |
|
rj--; |
2458 |
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)}; |
2459 |
Float_t yc1[4]={ -ws13, -ws13, 0., -ws13}; |
Float_t yc1[4]={ -ws13, -ws13, 0., -ws13}; |
2460 |
Float_t xc[4]; |
Float_t xc[4]; |
2470 |
} else { |
} else { |
2471 |
colo = 1; |
colo = 1; |
2472 |
}; |
}; |
2473 |
ColorMIP(ms12b[j],colo); |
ColorMIP(ms12b[rj],colo); |
2474 |
// |
// |
2475 |
if ( colo != 10 ) ocolo = colo; |
if ( colo != 10 ) ocolo = colo; |
2476 |
if ( mt12[1][j] == 4095. ) colo = noadc; |
if ( mt12[1][rj] == 4095. ) colo = noadc; |
2477 |
// |
// |
2478 |
ftof12yb[j]->SetFillColor(colo); |
ftof12yb[j]->SetFillColor(colo); |
2479 |
ftof12yb[j]->SetLineWidth(1); |
ftof12yb[j]->SetLineWidth(1); |
2507 |
Float_t s21p = 0.075; |
Float_t s21p = 0.075; |
2508 |
ocolo = 10; |
ocolo = 10; |
2509 |
TPolyLine *ftof21ya[2]; |
TPolyLine *ftof21ya[2]; |
2510 |
|
rj=2; |
2511 |
for ( Int_t j=0; j<2; j++){ |
for ( Int_t j=0; j<2; j++){ |
2512 |
|
rj--; |
2513 |
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)}; |
2514 |
Float_t yc1[4]={ 0., ws2, ws2, 0.}; |
Float_t yc1[4]={ 0., ws2, ws2, 0.}; |
2515 |
Float_t xc[4]; |
Float_t xc[4]; |
2525 |
} else { |
} else { |
2526 |
colo = 1; |
colo = 1; |
2527 |
}; |
}; |
2528 |
ColorMIP(ms21a[j],colo); |
ColorMIP(ms21a[rj],colo); |
2529 |
// |
// |
2530 |
if ( colo != 10 ) ocolo = colo; |
if ( colo != 10 ) ocolo = colo; |
2531 |
if ( mt21[0][j] == 4095. ) colo = noadc; |
if ( mt21[0][rj] == 4095. ) colo = noadc; |
2532 |
// |
// |
2533 |
ftof21ya[j]->SetFillColor(colo); |
ftof21ya[j]->SetFillColor(colo); |
2534 |
ftof21ya[j]->SetLineWidth(1); |
ftof21ya[j]->SetLineWidth(1); |
2538 |
// B |
// B |
2539 |
s21p = 0.075; |
s21p = 0.075; |
2540 |
TPolyLine *ftof21yb[2]; |
TPolyLine *ftof21yb[2]; |
2541 |
|
rj=2; |
2542 |
for ( Int_t j=0; j<2; j++){ |
for ( Int_t j=0; j<2; j++){ |
2543 |
|
rj--; |
2544 |
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)}; |
2545 |
Float_t yc1[4]={ 0., 0., ws2, 0.}; |
Float_t yc1[4]={ 0., 0., ws2, 0.}; |
2546 |
Float_t xc[4]; |
Float_t xc[4]; |
2556 |
} else { |
} else { |
2557 |
colo = 1; |
colo = 1; |
2558 |
}; |
}; |
2559 |
ColorMIP(ms21b[j],colo); |
ColorMIP(ms21b[rj],colo); |
2560 |
// |
// |
2561 |
if ( colo != 10 ) ocolo = colo; |
if ( colo != 10 ) ocolo = colo; |
2562 |
if ( mt21[1][j] == 4095. ) colo = noadc; |
if ( mt21[1][rj] == 4095. ) colo = noadc; |
2563 |
// |
// |
2564 |
ftof21yb[j]->SetFillColor(colo); |
ftof21yb[j]->SetFillColor(colo); |
2565 |
ftof21yb[j]->SetLineWidth(1); |
ftof21yb[j]->SetLineWidth(1); |
2674 |
Float_t s31p = 0.060; |
Float_t s31p = 0.060; |
2675 |
ocolo = 10; |
ocolo = 10; |
2676 |
TPolyLine *ftof31xa[3]; |
TPolyLine *ftof31xa[3]; |
2677 |
|
rj=3; |
2678 |
for ( Int_t j=0; j<3; j++){ |
for ( Int_t j=0; j<3; j++){ |
2679 |
|
rj--; |
2680 |
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)}; |
2681 |
Float_t yc1[4]={ 0., ws13, ws13, 0.}; |
Float_t yc1[4]={ 0., ws13, ws13, 0.}; |
2682 |
Float_t xc[4]; |
Float_t xc[4]; |
2692 |
} else { |
} else { |
2693 |
colo = 1; |
colo = 1; |
2694 |
}; |
}; |
2695 |
ColorMIP(ms31a[j],colo); |
ColorMIP(ms31a[rj],colo); |
2696 |
// |
// |
2697 |
if ( colo != 10 ) ocolo = colo; |
if ( colo != 10 ) ocolo = colo; |
2698 |
if ( mt31[0][j] == 4095. ) colo = noadc; |
if ( mt31[0][rj] == 4095. ) colo = noadc; |
2699 |
// |
// |
2700 |
ftof31xa[j]->SetFillColor(colo); |
ftof31xa[j]->SetFillColor(colo); |
2701 |
ftof31xa[j]->SetLineWidth(1); |
ftof31xa[j]->SetLineWidth(1); |
2705 |
// B |
// B |
2706 |
s31p = 0.060; |
s31p = 0.060; |
2707 |
TPolyLine *ftof31xb[3]; |
TPolyLine *ftof31xb[3]; |
2708 |
|
rj=3; |
2709 |
for ( Int_t j=0; j<3; j++){ |
for ( Int_t j=0; j<3; j++){ |
2710 |
|
rj--; |
2711 |
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)}; |
2712 |
Float_t yc1[4]={ 0., 0., ws13, 0.}; |
Float_t yc1[4]={ 0., 0., ws13, 0.}; |
2713 |
Float_t xc[4]; |
Float_t xc[4]; |
2723 |
} else { |
} else { |
2724 |
colo = 1; |
colo = 1; |
2725 |
}; |
}; |
2726 |
ColorMIP(ms31b[j],colo); |
ColorMIP(ms31b[rj],colo); |
2727 |
// |
// |
2728 |
if ( colo != 10 ) ocolo = colo; |
if ( colo != 10 ) ocolo = colo; |
2729 |
if ( mt31[1][j] == 4095. ) colo = noadc; |
if ( mt31[1][rj] == 4095. ) colo = noadc; |
2730 |
// |
// |
2731 |
ftof31xb[j]->SetFillColor(colo); |
ftof31xb[j]->SetFillColor(colo); |
2732 |
ftof31xb[j]->SetLineWidth(1); |
ftof31xb[j]->SetLineWidth(1); |
2758 |
Float_t s32p = 0.050; |
Float_t s32p = 0.050; |
2759 |
ocolo = 10; |
ocolo = 10; |
2760 |
TPolyLine *ftof32ya[3]; |
TPolyLine *ftof32ya[3]; |
2761 |
|
rj=3; |
2762 |
for ( Int_t j=0; j<3; j++){ |
for ( Int_t j=0; j<3; j++){ |
2763 |
|
rj--; |
2764 |
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)}; |
2765 |
Float_t yc1[4]={ -ws13, 0., 0., -ws13}; |
Float_t yc1[4]={ -ws13, 0., 0., -ws13}; |
2766 |
Float_t xc[4]; |
Float_t xc[4]; |
2776 |
} else { |
} else { |
2777 |
colo = 1; |
colo = 1; |
2778 |
}; |
}; |
2779 |
ColorMIP(ms32a[j],colo); |
ColorMIP(ms32a[rj],colo); |
2780 |
// |
// |
2781 |
if ( colo != 10 ) ocolo = colo; |
if ( colo != 10 ) ocolo = colo; |
2782 |
if ( mt32[0][j] == 4095. ) colo = noadc; |
if ( mt32[0][rj] == 4095. ) colo = noadc; |
2783 |
// |
// |
2784 |
ftof32ya[j]->SetFillColor(colo); |
ftof32ya[j]->SetFillColor(colo); |
2785 |
ftof32ya[j]->SetLineWidth(1); |
ftof32ya[j]->SetLineWidth(1); |
2788 |
}; |
}; |
2789 |
s32p = 0.050; |
s32p = 0.050; |
2790 |
TPolyLine *ftof32yb[3]; |
TPolyLine *ftof32yb[3]; |
2791 |
|
rj=3; |
2792 |
for ( Int_t j=0; j<3; j++){ |
for ( Int_t j=0; j<3; j++){ |
2793 |
|
rj--; |
2794 |
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)}; |
2795 |
Float_t yc1[4]={ -ws13, -ws13, 0., -ws13}; |
Float_t yc1[4]={ -ws13, -ws13, 0., -ws13}; |
2796 |
Float_t xc[4]; |
Float_t xc[4]; |
2806 |
} else { |
} else { |
2807 |
colo = 1; |
colo = 1; |
2808 |
}; |
}; |
2809 |
ColorMIP(ms32b[j],colo); |
ColorMIP(ms32b[rj],colo); |
2810 |
// |
// |
2811 |
if ( colo != 10 ) ocolo = colo; |
if ( colo != 10 ) ocolo = colo; |
2812 |
if ( mt32[1][j] == 4095. ) colo = noadc; |
if ( mt32[1][rj] == 4095. ) colo = noadc; |
2813 |
// |
// |
2814 |
ftof32yb[j]->SetFillColor(colo); |
ftof32yb[j]->SetFillColor(colo); |
2815 |
ftof32yb[j]->SetLineWidth(1); |
ftof32yb[j]->SetLineWidth(1); |
3040 |
// |
// |
3041 |
// |
// |
3042 |
Bool_t repeat = true; |
Bool_t repeat = true; |
3043 |
Int_t numtr = 1; |
// Int_t numtr = 1; |
3044 |
|
Int_t numtr = 0; |
3045 |
Int_t repuntil = 0; |
Int_t repuntil = 0; |
3046 |
|
Int_t repuntiltr = 0; |
3047 |
// |
// |
3048 |
// |
// |
3049 |
var.tofraw = 0; |
var.tofraw = 0; |
3050 |
// |
// |
3051 |
if ( level.file == 2 ) repuntil = L2->GetToFLevel2()->ntrk(); |
if ( level.file == 2 ) repuntil = L2->GetToFLevel2()->ntrk(); |
3052 |
// printf("repuntil = %i \n",repuntil); |
// printf("repuntil = %i \n",repuntil); |
3053 |
//repuntil = L2->GetNTracks(); |
if ( level.file == 2 ) repuntiltr = L2->GetTrkLevel2()->GetNTracks(); |
3054 |
|
// repuntiltr = L2->GetNTracks(); |
3055 |
// |
// |
3056 |
while ( repeat ){ |
while ( repeat ){ |
3057 |
// printf("B repuntil = %i \n",repuntil); |
// printf("B repuntil = %i \n",repuntil); |
3060 |
// |
// |
3061 |
// |
// |
3062 |
ToFTrkVar *ptt = 0; |
ToFTrkVar *ptt = 0; |
3063 |
|
PamTrack *ptrack = 0; |
3064 |
|
Float_t adc[4][12]; |
3065 |
|
Float_t tdc[4][12]; |
3066 |
|
memset(adc,0,4*12*sizeof(Float_t)); |
3067 |
|
memset(tdc,0,4*12*sizeof(Float_t)); |
3068 |
// |
// |
3069 |
// |
// |
3070 |
|
Int_t myseq = 0; |
3071 |
|
// if ( repuntil == 0 || var.tofraw ){ |
3072 |
if ( repuntil == 1 || var.tofraw ){ |
if ( repuntil == 1 || var.tofraw ){ |
3073 |
numtr = 0; |
numtr = 0; |
3074 |
ptt = L2->GetToFLevel2()->GetToFTrkVar(0); |
ptt = L2->GetToFLevel2()->GetToFTrkVar(0); |
3075 |
repeat = false; |
repeat = false; |
3076 |
} else { |
} else { |
3077 |
// |
// |
3078 |
|
// printf(" deH_ \n"); |
3079 |
// |
// |
3080 |
if ( numtr >= repuntil-1 ) repeat = false; |
if ( numtr == 0 ){ |
3081 |
// |
// printf(" ques \n"); |
3082 |
ptt = L2->GetToFLevel2()->GetToFTrkVar(numtr); |
ptt = L2->GetToFLevel2()->GetToFTrkVar(0); |
3083 |
|
myseq = 0; |
3084 |
|
// printf(" que \n"); |
3085 |
|
|
3086 |
|
} else { |
3087 |
|
if ( numtr >= (repuntiltr-1) ) repeat = false; |
3088 |
|
// |
3089 |
|
printf(" numtr is %i \n",numtr); |
3090 |
|
// ptt = L2->GetToFLevel2()->GetToFTrkVar(numtr); |
3091 |
|
ptrack = L2->GetTrack(numtr-1); |
3092 |
|
ptt = ptrack->GetToFTrack(); |
3093 |
|
myseq = ptt->trkseqno + 1; |
3094 |
|
}; |
3095 |
}; |
}; |
3096 |
// |
// |
3097 |
xp11[0] = 0.; |
xp11[0] = 0.; |
3105 |
// |
// |
3106 |
ii = 2; |
ii = 2; |
3107 |
// |
// |
3108 |
Float_t adc[4][12]; |
// Int_t myseq = ptt->trkseqno + 1; |
|
Float_t tdc[4][12]; |
|
|
L2->GetToFLevel2()->GetMatrix(numtr,adc,tdc); |
|
|
|
|
3109 |
// |
// |
3110 |
for ( Int_t i = 0; i<8; i++ ) { |
// printf(" qui \n"); |
3111 |
if ( adc[ch11a[i]][hb11a[i]] < 1000. ){ |
L2->GetToFLevel2()->GetMatrix(myseq,adc,tdc); |
3112 |
ms11a[i] = adc[ch11a[i]][hb11a[i]]; |
// |
3113 |
}; |
// printf(" qua \n"); |
3114 |
if ( adc[ch11b[i]][hb11b[i]] < 1000. ){ |
// |
3115 |
ms11b[i] = adc[ch11b[i]][hb11b[i]]; |
// for ( Int_t i = 0; i<8; i++ ) { |
3116 |
}; |
// if ( adc[ch11a[i]][hb11a[i]] < 1000. ){ |
3117 |
// xp11[i] = 0.; |
// ms11a[i] = adc[ch11a[i]][hb11a[i]]; |
3118 |
}; |
// }; |
3119 |
|
// if ( adc[ch11b[i]][hb11b[i]] < 1000. ){ |
3120 |
|
// ms11b[i] = adc[ch11b[i]][hb11b[i]]; |
3121 |
|
// }; |
3122 |
|
// xp11[i] = 0.; |
3123 |
|
// }; |
3124 |
|
|
3125 |
Int_t nmtof = 0; |
Int_t nmtof = 0; |
3126 |
Float_t mtof = 0.; |
Float_t mtof = 0.; |
3237 |
if ( level.file == -1 ){ |
if ( level.file == -1 ){ |
3238 |
ColorMIP(ms11a[j]+ms11b[j],colo); |
ColorMIP(ms11a[j]+ms11b[j],colo); |
3239 |
} else { |
} else { |
3240 |
ColorTOFMIP(ms11a[j]+ms11b[j],colo); |
ColorTOFMIP((ms11a[j]+ms11b[j])/2.,colo); |
3241 |
}; |
}; |
3242 |
// |
// |
3243 |
if ( colo != 10 ) ocolo = colo; |
if ( colo != 10 ) ocolo = colo; |
3267 |
ftof11y->Draw(); |
ftof11y->Draw(); |
3268 |
TPolyLine *sftof11[8]; |
TPolyLine *sftof11[8]; |
3269 |
tt = 1; |
tt = 1; |
3270 |
if ( level.file == -1 ) tt = 8; |
rj=1; |
3271 |
|
if ( level.file == -1 ){ |
3272 |
|
tt = 8; |
3273 |
|
rj = 8; |
3274 |
|
}; |
3275 |
for ( Int_t j=0; j<tt; j++){ |
for ( Int_t j=0; j<tt; j++){ |
3276 |
if ( (mt11[0][j]<4095. || mt11[1][j]<4095.)){ |
rj--; |
3277 |
|
if ( (mt11[0][rj]<4095. || mt11[1][rj]<4095.)){ |
3278 |
if ( ocolo == 10 ) ocolo = noadc; |
if ( ocolo == 10 ) ocolo = noadc; |
3279 |
Float_t lowp = (xp11[j]-E11[j])/100.; |
Float_t lowp = -(xp11[rj]+E11[rj])/100.; |
3280 |
Float_t higp = (xp11[j]+E11[j])/100.; |
Float_t higp = -(xp11[rj]-E11[rj])/100.; |
3281 |
if ( lowp < -0.164 ) lowp = -0.164; |
if ( lowp < -0.164 ) lowp = -0.164; |
3282 |
if ( higp > 0.164 ) higp = 0.164; |
if ( higp > 0.164 ) higp = 0.164; |
3283 |
if ( lowp < higp && ( level.file == -1 || (level.file == 2 && xp11[j] != 0.))){ |
if ( lowp < higp && ( level.file == -1 || (level.file == 2 && xp11[rj] != 0.))){ |
3284 |
Float_t nxc1[5]={ lowp, higp, higp, lowp, lowp}; |
Float_t nxc1[5]={ lowp, higp, higp, lowp, lowp}; |
3285 |
Float_t nyc1[5]={ 0.0015, 0.0015, ws13-0.0015, ws13-0.0015, 0.0015}; |
Float_t nyc1[5]={ 0.0015, 0.0015, (float)(ws13-0.0015), (float)(ws13-0.0015), 0.0015}; |
3286 |
Float_t nxc[5]; |
Float_t nxc[5]; |
3287 |
Float_t nyc[5]; |
Float_t nyc[5]; |
3288 |
for (Int_t i = 0; i<5 ; i++) { |
for (Int_t i = 0; i<5 ; i++) { |
3305 |
Float_t s12p = 0.055; |
Float_t s12p = 0.055; |
3306 |
ocolo = 10; |
ocolo = 10; |
3307 |
TPolyLine *ftof12y[6]; |
TPolyLine *ftof12y[6]; |
3308 |
|
rj = 6; |
3309 |
for ( Int_t j=0; j<6; j++){ |
for ( Int_t j=0; j<6; j++){ |
3310 |
|
rj--; |
3311 |
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)}; |
3312 |
Float_t nyc1[5]={ -ws13, 0., 0., -ws13, -ws13}; |
Float_t nyc1[5]={ -ws13, 0., 0., -ws13, -ws13}; |
3313 |
Float_t nxc[5]; |
Float_t nxc[5]; |
3324 |
colo = 1; |
colo = 1; |
3325 |
}; |
}; |
3326 |
if ( level.file == -1 ){ |
if ( level.file == -1 ){ |
3327 |
ColorMIP(ms12a[j]+ms12b[j],colo); |
ColorMIP(ms12a[rj]+ms12b[rj],colo); |
3328 |
} else { |
} else { |
3329 |
ColorTOFMIP(ms12a[j]+ms12b[j],colo); |
ColorTOFMIP((ms12a[rj]+ms12b[rj])/2.,colo); |
3330 |
}; |
}; |
3331 |
// |
// |
3332 |
if ( colo != 10 ) ocolo = colo; |
if ( colo != 10 ) ocolo = colo; |
3368 |
if ( higp > 0.203 ) higp = 0.203; |
if ( higp > 0.203 ) higp = 0.203; |
3369 |
if ( lowp < higp && ( level.file == -1 || (level.file == 2 && xp12[j] != 0.))){ |
if ( lowp < higp && ( level.file == -1 || (level.file == 2 && xp12[j] != 0.))){ |
3370 |
Float_t nxc1[5]={ lowp, higp, higp, lowp, lowp}; |
Float_t nxc1[5]={ lowp, higp, higp, lowp, lowp}; |
3371 |
Float_t nyc1[5]={ -0.0015, -0.0015, -ws13+0.0015, -ws13+0.0015, -0.0015}; |
Float_t nyc1[5]={ -0.0015, -0.0015, (float)(-ws13+0.0015), (float)(-ws13+0.0015), -0.0015}; |
3372 |
Float_t nxc[5]; |
Float_t nxc[5]; |
3373 |
Float_t nyc[5]; |
Float_t nyc[5]; |
3374 |
for (Int_t i = 0; i<5 ; i++) { |
for (Int_t i = 0; i<5 ; i++) { |
3393 |
Float_t s21p = 0.075; |
Float_t s21p = 0.075; |
3394 |
ocolo = 10; |
ocolo = 10; |
3395 |
TPolyLine *ftof21y[2]; |
TPolyLine *ftof21y[2]; |
3396 |
|
rj=2; |
3397 |
for ( Int_t j=0; j<2; j++){ |
for ( Int_t j=0; j<2; j++){ |
3398 |
|
rj--; |
3399 |
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)}; |
3400 |
Float_t nyc1[5]={ 0., ws2, ws2, 0., 0.}; |
Float_t nyc1[5]={ 0., ws2, ws2, 0., 0.}; |
3401 |
Float_t nxc[5]; |
Float_t nxc[5]; |
3403 |
for (Int_t i = 0; i<5 ; i++) { |
for (Int_t i = 0; i<5 ; i++) { |
3404 |
nxc[i]= xs2y + nxc1[i]*var.sfx; |
nxc[i]= xs2y + nxc1[i]*var.sfx; |
3405 |
nyc[i] = ys2y + nyc1[i]*var.sfy; |
nyc[i] = ys2y + nyc1[i]*var.sfy; |
3406 |
|
// printf(" TOF i %i x %f y %f \n",i,nxc[i],nyc[i]); |
3407 |
}; |
}; |
3408 |
ftof21y[j] = new TPolyLine(5,nxc,nyc); |
ftof21y[j] = new TPolyLine(5,nxc,nyc); |
3409 |
ftof21y[j]->SetLineColor(1); |
ftof21y[j]->SetLineColor(1); |
3413 |
colo = 1; |
colo = 1; |
3414 |
}; |
}; |
3415 |
if ( level.file == -1 ){ |
if ( level.file == -1 ){ |
3416 |
ColorMIP(ms21a[j]+ms21b[j],colo); |
ColorMIP(ms21a[rj]+ms21b[rj],colo); |
3417 |
} else { |
} else { |
3418 |
ColorTOFMIP(ms21a[j]+ms21b[j],colo); |
ColorTOFMIP((ms21a[rj]+ms21b[rj])/2.,colo); |
3419 |
}; |
}; |
3420 |
// |
// |
3421 |
if ( colo != 10 ) ocolo = colo; |
if ( colo != 10 ) ocolo = colo; |
3457 |
if ( higp > 0.089 ) higp = 0.089; |
if ( higp > 0.089 ) higp = 0.089; |
3458 |
if ( lowp < higp && ( level.file == -1 || (level.file == 2 && xp21[j] != 0.))){ |
if ( lowp < higp && ( level.file == -1 || (level.file == 2 && xp21[j] != 0.))){ |
3459 |
Float_t nxc1[5]={ lowp, higp, higp, lowp, lowp}; |
Float_t nxc1[5]={ lowp, higp, higp, lowp, lowp}; |
3460 |
Float_t nyc1[5]={ 0.0015, 0.0015, ws2-0.0015, ws2-0.0015, 0.}; |
Float_t nyc1[5]={ 0.0015, 0.0015, (float)(ws2-0.0015), (float)(ws2-0.0015), 0.}; |
3461 |
Float_t nxc[5]; |
Float_t nxc[5]; |
3462 |
Float_t nyc[5]; |
Float_t nyc[5]; |
3463 |
for (Int_t i = 0; i<5 ; i++) { |
for (Int_t i = 0; i<5 ; i++) { |
3501 |
if ( level.file == -1 ){ |
if ( level.file == -1 ){ |
3502 |
ColorMIP(ms22a[j]+ms22b[j],colo); |
ColorMIP(ms22a[j]+ms22b[j],colo); |
3503 |
} else { |
} else { |
3504 |
ColorTOFMIP(ms22a[j]+ms22b[j],colo); |
ColorTOFMIP((ms22a[j]+ms22b[j])/2.,colo); |
3505 |
}; |
}; |
3506 |
// |
// |
3507 |
if ( colo != 10 ) ocolo = colo; |
if ( colo != 10 ) ocolo = colo; |
3532 |
ftof22y->Draw(); |
ftof22y->Draw(); |
3533 |
TPolyLine *sftof22[2]; |
TPolyLine *sftof22[2]; |
3534 |
tt = 1; |
tt = 1; |
3535 |
if ( level.file == -1 ) tt = 2; |
rj = 1; |
3536 |
|
if ( level.file == -1 ){ |
3537 |
|
tt = 2; |
3538 |
|
rj = 2; |
3539 |
|
}; |
3540 |
for (Int_t j=0; j<tt; j++){ |
for (Int_t j=0; j<tt; j++){ |
3541 |
|
rj--; |
3542 |
// for ( Int_t j=0; j<2; j++){ |
// for ( Int_t j=0; j<2; j++){ |
3543 |
if ( (mt22[0][j]<4095. || mt22[1][j]<4095.) ){ |
if ( (mt22[0][rj]<4095. || mt22[1][rj]<4095.) ){ |
3544 |
if ( ocolo == 10 ) ocolo = noadc; |
if ( ocolo == 10 ) ocolo = noadc; |
3545 |
Float_t lowp = (xp22[j]-E22[j])/100.; |
Float_t lowp = -(xp22[rj]+E22[rj])/100.; |
3546 |
Float_t higp = (xp22[j]+E22[j])/100.; |
Float_t higp = -(xp22[rj]-E22[rj])/100.; |
3547 |
if ( lowp < -0.074 ) lowp = -0.074; |
if ( lowp < -0.074 ) lowp = -0.074; |
3548 |
if ( higp > 0.074 ) higp = 0.074; |
if ( higp > 0.074 ) higp = 0.074; |
3549 |
if ( lowp < higp && ( level.file == -1 || (level.file == 2 && xp22[j] != 0.))){ |
if ( lowp < higp && ( level.file == -1 || (level.file == 2 && xp22[rj] != 0.))){ |
3550 |
Float_t nxc1[5]={ lowp, higp, higp, lowp, lowp}; |
Float_t nxc1[5]={ lowp, higp, higp, lowp, lowp}; |
3551 |
Float_t nyc1[5]={ -0.0015, -0.0015, -ws2+0.0015, -ws2+0.0015, -0.0015}; |
Float_t nyc1[5]={ -0.0015, -0.0015, (float)(-ws2+0.0015), (float)(-ws2+0.0015), -0.0015}; |
3552 |
Float_t nxc[5]; |
Float_t nxc[5]; |
3553 |
Float_t nyc[5]; |
Float_t nyc[5]; |
3554 |
for (Int_t i = 0; i<5 ; i++) { |
for (Int_t i = 0; i<5 ; i++) { |
3566 |
}; |
}; |
3567 |
}; |
}; |
3568 |
// |
// |
3569 |
|
//daquiinbasso |
3570 |
// |
// |
3571 |
// S31 X-view |
// S31 X-view |
3572 |
// |
// |
3592 |
if ( level.file == -1 ){ |
if ( level.file == -1 ){ |
3593 |
ColorMIP(ms31a[j]+ms31b[j],colo); |
ColorMIP(ms31a[j]+ms31b[j],colo); |
3594 |
} else { |
} else { |
3595 |
ColorTOFMIP(ms31a[j]+ms31b[j],colo); |
ColorTOFMIP((ms31a[j]+ms31b[j])/2.,colo); |
3596 |
}; |
}; |
3597 |
// |
// |
3598 |
if ( colo != 10 ) ocolo = colo; |
if ( colo != 10 ) ocolo = colo; |
3623 |
ftof31y->Draw(); |
ftof31y->Draw(); |
3624 |
TPolyLine *sftof31[3]; |
TPolyLine *sftof31[3]; |
3625 |
tt = 1; |
tt = 1; |
3626 |
if ( level.file == -1 ) tt = 3; |
rj = 1; |
3627 |
|
if ( level.file == -1 ){ |
3628 |
|
tt = 3; |
3629 |
|
rj = 3; |
3630 |
|
}; |
3631 |
for (Int_t j=0; j<tt; j++){ |
for (Int_t j=0; j<tt; j++){ |
3632 |
|
rj--; |
3633 |
// for ( Int_t j=0; j<3; j++){ |
// for ( Int_t j=0; j<3; j++){ |
3634 |
if ( (mt31[0][j]<4095. || mt31[1][j]<4095.)){ |
if ( (mt31[0][rj]<4095. || mt31[1][rj]<4095.)){ |
3635 |
if ( ocolo == 10 ) ocolo = noadc; |
if ( ocolo == 10 ) ocolo = noadc; |
3636 |
Float_t lowp = (xp31[j]-E31[j])/100.; |
Float_t lowp = -(xp31[rj]+E31[rj])/100.; |
3637 |
Float_t higp = (xp31[j]+E31[j])/100.; |
Float_t higp = -(xp31[rj]-E31[rj])/100.; |
3638 |
if ( lowp < -0.074 ) lowp = -0.074; |
if ( lowp < -0.074 ) lowp = -0.074; |
3639 |
if ( higp > 0.074 ) higp = 0.074; |
if ( higp > 0.074 ) higp = 0.074; |
3640 |
if ( lowp < higp && ( level.file == -1 || (level.file == 2 && xp31[j] != 0.))){ |
if ( lowp < higp && ( level.file == -1 || (level.file == 2 && xp31[rj] != 0.))){ |
3641 |
Float_t nxc1[5]={ lowp, higp, higp, lowp, lowp}; |
Float_t nxc1[5]={ lowp, higp, higp, lowp, lowp}; |
3642 |
Float_t nyc1[5]={ 0.0015, 0.0015, ws13-0.0015, ws13-0.0015, 0.0015}; |
Float_t nyc1[5]={ 0.0015, 0.0015, (float)(ws13-0.0015), (float)(ws13-0.0015), 0.0015}; |
3643 |
Float_t nxc[5]; |
Float_t nxc[5]; |
3644 |
Float_t nyc[5]; |
Float_t nyc[5]; |
3645 |
for (Int_t i = 0; i<5 ; i++) { |
for (Int_t i = 0; i<5 ; i++) { |
3664 |
Float_t s32p = 0.050; |
Float_t s32p = 0.050; |
3665 |
ocolo = 10; |
ocolo = 10; |
3666 |
TPolyLine *ftof32y[3]; |
TPolyLine *ftof32y[3]; |
3667 |
|
rj = 3; |
3668 |
for ( Int_t j=0; j<3; j++){ |
for ( Int_t j=0; j<3; j++){ |
3669 |
|
rj--; |
3670 |
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)}; |
3671 |
Float_t nyc1[5]={ -ws13, 0., 0., -ws13, -ws13}; |
Float_t nyc1[5]={ -ws13, 0., 0., -ws13, -ws13}; |
3672 |
Float_t nxc[5]; |
Float_t nxc[5]; |
3683 |
colo = 1; |
colo = 1; |
3684 |
}; |
}; |
3685 |
if ( level.file == -1 ){ |
if ( level.file == -1 ){ |
3686 |
ColorMIP(ms32a[j]+ms32b[j],colo); |
ColorMIP(ms32a[rj]+ms32b[rj],colo); |
3687 |
} else { |
} else { |
3688 |
ColorTOFMIP(ms32a[j]+ms32b[j],colo); |
ColorTOFMIP((ms32a[rj]+ms32b[rj])/2.,colo); |
3689 |
}; |
}; |
3690 |
// |
// |
3691 |
if ( colo != 10 ) ocolo = colo; |
if ( colo != 10 ) ocolo = colo; |
3727 |
if ( higp > 0.089 ) higp = 0.089; |
if ( higp > 0.089 ) higp = 0.089; |
3728 |
if ( lowp < higp && ( level.file == -1 || (level.file == 2 && xp32[j] != 0.))){ |
if ( lowp < higp && ( level.file == -1 || (level.file == 2 && xp32[j] != 0.))){ |
3729 |
Float_t nxc1[5]={ lowp, higp, higp, lowp, lowp}; |
Float_t nxc1[5]={ lowp, higp, higp, lowp, lowp}; |
3730 |
Float_t nyc1[5]={ -0.0015, -0.0015, -ws13+0.0015, -ws13+0.0015, -0.0015}; |
Float_t nyc1[5]={ -0.0015, -0.0015, (float)(-ws13+0.0015), (float)(-ws13+0.0015), -0.0015}; |
3731 |
Float_t nxc[5]; |
Float_t nxc[5]; |
3732 |
Float_t nyc[5]; |
Float_t nyc[5]; |
3733 |
for (Int_t i = 0; i<5 ; i++) { |
for (Int_t i = 0; i<5 ; i++) { |
4103 |
// |
// |
4104 |
if ( true ){ |
if ( true ){ |
4105 |
// PMTs |
// PMTs |
4106 |
Float_t xc1[5]={ 0., 0.014*var.sfx, 0.014*var.sfx-var.sfx*var.sfx*pmt1*cos(apmt1), -var.sfx*var.sfx*pmt1*cos(apmt1), 0.}; |
Float_t xc1[5]={ 0., (float)(0.014*var.sfx), (float)(0.014*var.sfx-var.sfx*var.sfx*pmt1*cos(apmt1)), (float)(-var.sfx*var.sfx*pmt1*cos(apmt1)), 0.}; |
4107 |
Float_t yc1[5]={ 0., 0.011*var.sfy, 0.011*var.sfy+var.sfy*var.sfy*pmt1*sin(apmt1), var.sfy*var.sfy*pmt1*sin(apmt1), 0.}; |
Float_t yc1[5]={ 0., (float)(0.011*var.sfy), (float)(0.011*var.sfy+var.sfy*var.sfy*pmt1*sin(apmt1)), (float)(var.sfy*var.sfy*pmt1*sin(apmt1)), 0.}; |
4108 |
Float_t xc2[5]={ 0., 0.011*var.sfx, 0.011*var.sfx-pmt2*var.sfx*var.sfx*cos(apmt2), -pmt2*var.sfx*var.sfx*cos(apmt2), 0.}; |
Float_t xc2[5]={ 0., (float)(0.011*var.sfx), (float)(0.011*var.sfx-pmt2*var.sfx*var.sfx*cos(apmt2)), (float)(-pmt2*var.sfx*var.sfx*cos(apmt2)), 0.}; |
4109 |
Float_t yc2[5]={ 0., 0.015*var.sfy, 0.015*var.sfy+var.sfy*pmt2*var.sfy*sin(apmt2), var.sfy*pmt2*var.sfy*sin(apmt2), 0.}; |
Float_t yc2[5]={ 0., (float)(0.015*var.sfy), (float)(0.015*var.sfy+var.sfy*pmt2*var.sfy*sin(apmt2)), (float)(var.sfy*pmt2*var.sfy*sin(apmt2)), 0.}; |
4110 |
// SCINTs |
// SCINTs |
4111 |
Float_t xcc1[10]={-0.149, -0.090165, -0.090165, -0.149, -0.242, -0.257, -0.212, -0.257, -0.242, -0.149}; |
Float_t xcc1[10]={-0.149, -0.090165, -0.090165, -0.149, -0.242, -0.257, -0.212, -0.257, -0.242, -0.149}; |
4112 |
Float_t ycc1[10]={ 0.169, 0.108165, -0.108165, -0.169, -0.169, -0.158, 0., 0.158, 0.169, 0.169}; |
Float_t ycc1[10]={ 0.169, 0.108165, -0.108165, -0.169, -0.169, -0.158, 0., 0.158, 0.169, 0.169}; |
4652 |
pcasp4b->Draw("f"); |
pcasp4b->Draw("f"); |
4653 |
pcasp4b->Draw(); |
pcasp4b->Draw(); |
4654 |
}; |
}; |
4655 |
Float_t alfa = 1.2020334; |
// Float_t alfax = 1.2020334; |
4656 |
|
Float_t alfax = 1.22157778; |
4657 |
|
Float_t alfay = 1.27393111; |
4658 |
Float_t lcrd = 0.1815/2.; |
Float_t lcrd = 0.1815/2.; |
4659 |
Float_t wcrd = 0.008; |
Float_t wcrd = 0.008; |
4660 |
if ( true ){ |
if ( true ){ |
4865 |
// |
// |
4866 |
// Float_t cardcx = 0.143168*var.sfx; |
// Float_t cardcx = 0.143168*var.sfx; |
4867 |
//Float_t cardcy = 0.1475*var.sfy; |
//Float_t cardcy = 0.1475*var.sfy; |
4868 |
Float_t cardcx = 0.153168*var.sfx; |
// |
4869 |
Float_t cardcy = 0.1575*var.sfy; |
// Float_t cardcx = 0.153168*var.sfx; |
4870 |
Float_t acrdx[4] = {-lcrd*cos(alfa), lcrd*cos(alfa), -lcrd*cos(alfa)+wcrd*sin(alfa), -lcrd*cos(alfa)}; |
// |
4871 |
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; |
4872 |
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; |
4873 |
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; |
4874 |
|
Float_t acrdx[4] = {-lcrd*cos(alfax), lcrd*cos(alfax), -lcrd*cos(alfax)+wcrd*sin(alfax), -lcrd*cos(alfax)}; |
4875 |
|
Float_t acrdy[4] = {-lcrd*sin(alfax), lcrd*sin(alfax), -lcrd*sin(alfax)-wcrd*cos(alfax), -lcrd*sin(alfax)}; |
4876 |
|
Float_t bcrdx[4] = { lcrd*cos(alfax), lcrd*cos(alfax)+wcrd*sin(alfax), -lcrd*cos(alfax)+wcrd*sin(alfax), lcrd*cos(alfax)}; |
4877 |
|
Float_t bcrdy[4] = { lcrd*sin(alfax), lcrd*sin(alfax)-wcrd*cos(alfax), -lcrd*sin(alfax)-wcrd*cos(alfax), lcrd*sin(alfax)}; |
4878 |
|
|
4879 |
// |
// |
4880 |
// CARD3 X/ Y |
// CARD3 X/ Y |
4934 |
}; |
}; |
4935 |
|
|
4936 |
if ( true ){ |
if ( true ){ |
4937 |
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)}; |
4938 |
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)}; |
4939 |
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)}; |
4940 |
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)}; |
4941 |
// |
// |
4942 |
// CARD - Y-view |
// CARD - Y-view |
4943 |
// |
// |
4944 |
Float_t cardcx = 0.12*var.sfx; |
// Float_t cardcx = 0.12*var.sfx; |
4945 |
Float_t cardcy = 0.1475*var.sfy; |
Float_t cardcx = (0.16014*(1.-lcrd*cos(alfay)))*var.sfx; |
4946 |
|
// Float_t cardcy = 0.178818*var.sfy; |
4947 |
|
Float_t cardcy = (0.178818*(1.-lcrd*sin(alfay)))*var.sfy; |
4948 |
|
// Float_t cardcy = 0.1475*var.sfy; |
4949 |
// |
// |
4950 |
// CARD4 X Y/ |
// CARD4 X Y/ |
4951 |
// |
// |
5399 |
for (Int_t m = 0; m<3; m++){ |
for (Int_t m = 0; m<3; m++){ |
5400 |
if ( trk->signcluster[l][m] != 0. ){ |
if ( trk->signcluster[l][m] != 0. ){ |
5401 |
if ( planeno == 10 ) { |
if ( planeno == 10 ) { |
|
x = 1024 - trk->addrcluster[l][m]; |
|
|
} else { |
|
5402 |
x = trk->addrcluster[l][m]; |
x = trk->addrcluster[l][m]; |
5403 |
|
} else { |
5404 |
|
x = 1024 - trk->addrcluster[l][m]; |
5405 |
}; |
}; |
5406 |
linea = new TLine(14.+x,0.01,14.+x,0.3); |
linea = new TLine(14.+x,0.01,14.+x,0.3); |
5407 |
linea->SetLineWidth(2); |
linea->SetLineWidth(2); |
5471 |
trkpad[planepad]->cd(); |
trkpad[planepad]->cd(); |
5472 |
trkpad[planepad]->Range(-7.05,0.,7.05,8.); |
trkpad[planepad]->Range(-7.05,0.,7.05,8.); |
5473 |
for (Int_t img=0; img<2; img++){ |
for (Int_t img=0; img<2; img++){ |
5474 |
x = singlet->coord[img]; |
x = -singlet->coord[img]; |
5475 |
Float_t xsig = singlet->sgnl; |
Float_t xsig = singlet->sgnl; |
5476 |
if ( xsig > 8. ) xsig = 8.; |
if ( xsig > 8. ) xsig = 8.; |
5477 |
// |
// |
5527 |
trkpad[planepad]->Range(-8.1,0.,8.1,8.); |
trkpad[planepad]->Range(-8.1,0.,8.1,8.); |
5528 |
// |
// |
5529 |
x = track->xm[plane]; |
x = track->xm[plane]; |
5530 |
Float_t xsig = track->dedx_x[plane]; |
Float_t xsig = fabs(track->dedx_x[plane]); |
5531 |
if ( track->xgood[plane] ){ |
if ( track->XGood(plane) ){ |
5532 |
//if ( x > -100 ){ |
//if ( x > -100 ){ |
5533 |
if ( xsig > 8. ) xsig = 8.; |
if ( xsig > 8. ) xsig = 8.; |
5534 |
if ( var.bw ){ |
if ( var.bw ){ |
5536 |
} else { |
} else { |
5537 |
sigcol2 = 1; |
sigcol2 = 1; |
5538 |
}; |
}; |
5539 |
ColorTRKMIP(track->dedx_x[plane],sigcol2,0); |
ColorTRKMIP(fabs(track->dedx_x[plane]),sigcol2,0); |
5540 |
linea = new TLine(x,0.01,x,xsig); |
linea = new TLine(x,0.01,x,xsig); |
5541 |
linea->SetLineWidth(2); |
linea->SetLineWidth(2); |
5542 |
linea->SetLineColor(sigcol2); |
linea->SetLineColor(sigcol2); |
5543 |
linea->Draw(); |
linea->Draw(); |
5544 |
Float_t tx[5] = {x-0.3, x+0.3, x+0.3, x-0.3, x-0.3}; |
Float_t tx[5] = {(float)(x-0.3), (float)(x+0.3), (float)(x+0.3), (float)(x-0.3), (float)(x-0.3)}; |
5545 |
Float_t tz[5] = {0., 0., 0.5, 0.5, 0.}; |
Float_t tz[5] = {0., 0., 0.5, 0.5, 0.}; |
5546 |
TPolyLine *tlinea = new TPolyLine(5,tx,tz); |
TPolyLine *tlinea = new TPolyLine(5,tx,tz); |
5547 |
tlinea->SetLineWidth(1); |
tlinea->SetLineWidth(1); |
5556 |
planepad = plane * 2; |
planepad = plane * 2; |
5557 |
trkpad[planepad]->cd(); |
trkpad[planepad]->cd(); |
5558 |
trkpad[planepad]->Range(-7.05,0.,7.05,8.); |
trkpad[planepad]->Range(-7.05,0.,7.05,8.); |
5559 |
x = track->ym[plane]; |
x = -track->ym[plane]; |
5560 |
xsig = track->dedx_y[plane]; |
xsig = fabs(track->dedx_y[plane]); |
5561 |
if ( track->ygood[plane] ){ |
if ( track->YGood(plane) ){ |
5562 |
// if ( x > -100 ){ |
// if ( x > -100 ){ |
5563 |
if ( xsig > 8. ) xsig = 8.; |
if ( xsig > 8. ) xsig = 8.; |
5564 |
if ( var.bw ){ |
if ( var.bw ){ |
5566 |
} else { |
} else { |
5567 |
sigcol2 = 1; |
sigcol2 = 1; |
5568 |
}; |
}; |
5569 |
ColorTRKMIP(track->dedx_y[plane],sigcol2,0); |
ColorTRKMIP(fabs(track->dedx_y[plane]),sigcol2,0); |
5570 |
linea = new TLine(x,0.01,x,xsig); |
linea = new TLine(x,0.01,x,xsig); |
5571 |
linea->SetLineWidth(2); |
linea->SetLineWidth(2); |
5572 |
linea->SetLineColor(sigcol2); |
linea->SetLineColor(sigcol2); |
5573 |
linea->Draw(); |
linea->Draw(); |
5574 |
Float_t tx[5] = {x-0.3, x+0.3, x+0.3, x-0.3, x-0.3}; |
Float_t tx[5] = {(float)(x-0.3), (float)(x+0.3), (float)(x+0.3), (float)(x-0.3), (float)(x-0.3)}; |
5575 |
Float_t tz[5] = {0., 0., 0.5, 0.5, 0.}; |
Float_t tz[5] = {0., 0., 0.5, 0.5, 0.}; |
5576 |
TPolyLine *tlinea = new TPolyLine(5,tx,tz); |
TPolyLine *tlinea = new TPolyLine(5,tx,tz); |
5577 |
tlinea->SetLineColor(dcol); |
tlinea->SetLineColor(dcol); |
5609 |
// first of all plot crosses relatives to tracks |
// first of all plot crosses relatives to tracks |
5610 |
// |
// |
5611 |
if ( L2->GetTrkLevel2()->GetNTracks() > 0 ){ |
if ( L2->GetTrkLevel2()->GetNTracks() > 0 ){ |
5612 |
|
// for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ |
5613 |
|
// TrkTrack *track = L2->GetTrkLevel2()->GetTrack(nt); |
5614 |
for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ |
for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ |
5615 |
TrkTrack *track = L2->GetTrkLevel2()->GetTrack(nt); |
PamTrack *ptrack= L2->GetTrack(nt); |
5616 |
|
TrkTrack *track = ptrack->GetTrkTrack(); |
5617 |
|
// |
5618 |
for (Int_t plane = 0; plane<6; plane++){ |
for (Int_t plane = 0; plane<6; plane++){ |
5619 |
// |
// |
5620 |
x = track->xm[plane]; |
x = track->xm[plane]; |
5621 |
Float_t y = track->ym[plane]; |
Float_t y = -track->ym[plane]; |
5622 |
Float_t xsig = track->dedx_x[plane]; |
Float_t xsig = fabs(track->dedx_x[plane]); |
5623 |
Float_t ysig = track->dedx_y[plane]; |
Float_t ysig = fabs(track->dedx_y[plane]); |
5624 |
// if ( x > -100 && y > -100. ){ |
// if ( x > -100 && y > -100. ){ |
5625 |
if ( track->xgood[plane] && track->ygood[plane] ){ |
if ( track->XGood(plane) && track->YGood(plane) ){ |
5626 |
if ( var.bw ){ |
if ( var.bw ){ |
5627 |
sigcol1 = -1; |
sigcol1 = -1; |
5628 |
sigcol2 = -1; |
sigcol2 = -1; |
5740 |
for (Int_t sing = 0; sing < min(totsx,totsy); sing++){ |
for (Int_t sing = 0; sing < min(totsx,totsy); sing++){ |
5741 |
// |
// |
5742 |
x = arrax->At(orderx->At(sing)); |
x = arrax->At(orderx->At(sing)); |
5743 |
Float_t y1 = array1->At(ordery->At(sing)); |
Float_t y1 = -array1->At(ordery->At(sing)); |
5744 |
Float_t y2 = array2->At(ordery->At(sing)); |
Float_t y2 = -array2->At(ordery->At(sing)); |
5745 |
Float_t xsig = sigarrax->At(orderx->At(sing)); |
Float_t xsig = sigarrax->At(orderx->At(sing)); |
5746 |
Float_t ysig = sigarray->At(ordery->At(sing)); |
Float_t ysig = sigarray->At(ordery->At(sing)); |
5747 |
if ( x > -100 && y1 > -100. ){ |
if ( x > -100 && y1 > -100. ){ |
5834 |
for (Int_t m = 0; m<3; m++){ |
for (Int_t m = 0; m<3; m++){ |
5835 |
if ( trk->signcluster[l][m] != 0. ){ |
if ( trk->signcluster[l][m] != 0. ){ |
5836 |
if ( planeno == 10 ) { |
if ( planeno == 10 ) { |
|
x = 1024 - trk->addrcluster[l][m]; |
|
|
} else { |
|
5837 |
x = trk->addrcluster[l][m]; |
x = trk->addrcluster[l][m]; |
5838 |
|
} else { |
5839 |
|
x = 1024 - trk->addrcluster[l][m]; |
5840 |
}; |
}; |
5841 |
x += 1024.; |
x += 1024.; |
5842 |
if ( trk->signcluster[l][m]> ysig ){ |
if ( trk->signcluster[l][m]> ysig ){ |
5843 |
ysig = trk->signcluster[l][m]; |
ysig = trk->signcluster[l][m]; |
5844 |
yh1[ncro] = x-1024.; |
yh1[ncro] = x - 1024.; |
5845 |
yh2[ncro] = x; |
yh2[ncro] = x; |
5846 |
}; |
}; |
5847 |
}; |
}; |
5869 |
for (Int_t m = 0; m<3; m++){ |
for (Int_t m = 0; m<3; m++){ |
5870 |
if ( trk->signcluster[e][m] != 0. ){ |
if ( trk->signcluster[e][m] != 0. ){ |
5871 |
if ( planeno == 10 ) { |
if ( planeno == 10 ) { |
|
x = 1024 - trk->addrcluster[e][m]; |
|
|
} else { |
|
5872 |
x = trk->addrcluster[e][m]; |
x = trk->addrcluster[e][m]; |
5873 |
|
} else { |
5874 |
|
x = 1024 - trk->addrcluster[e][m]; |
5875 |
}; |
}; |
5876 |
x += 1024.; |
x += 1024.; |
5877 |
if ( trk->signcluster[e][m]> ysig ){ |
if ( trk->signcluster[e][m]> ysig ){ |
5878 |
ysig = trk->signcluster[e][m]; |
ysig = trk->signcluster[e][m]; |
5879 |
yh1[ncro] = x-1024.; |
yh1[ncro] = x - 1024.; |
5880 |
yh2[ncro] = x; |
yh2[ncro] = x; |
5881 |
}; |
}; |
5882 |
}; |
}; |
5928 |
|
|
5929 |
void FEVdetector::ShowTrack(){ |
void FEVdetector::ShowTrack(){ |
5930 |
// |
// |
5931 |
|
if ( level.file != 2 ) return; |
5932 |
|
// |
5933 |
// |
// |
5934 |
// |
// |
5935 |
if ( var.CALO && false ){ |
if ( var.CALO && var.CALOT ){ |
5936 |
if ( L2->GetCaloLevel2()->npcfit[0] > 0 && L2->GetCaloLevel2()->npcfit[1] > 0 ){ |
if ( L2->GetCaloLevel2()->npcfit[0] > 0 && L2->GetCaloLevel2()->npcfit[1] > 0 ){ |
5937 |
Float_t calx[22]; |
Float_t calx[22]; |
5938 |
Float_t caly[22]; |
Float_t caly[22]; |
5949 |
}; |
}; |
5950 |
for (Int_t plane = 0; plane < 22; plane++){ |
for (Int_t plane = 0; plane < 22; plane++){ |
5951 |
calx[plane] = (L2->GetCaloLevel2()->cbar[plane][0]/100.)*var.sfx + var.xxvc;; |
calx[plane] = (L2->GetCaloLevel2()->cbar[plane][0]/100.)*var.sfx + var.xxvc;; |
5952 |
caly[plane] = (L2->GetCaloLevel2()->cbar[plane][1]/100.)*var.sfx + var.xyvc; |
caly[plane] = (-L2->GetCaloLevel2()->cbar[plane][1]/100.)*var.sfx + var.xyvc; |
5953 |
// calzx[plane] = zpiano[plane] -5.81*var.sfy/1000. + var.yxvc; |
// calzx[plane] = zpiano[plane] -5.81*var.sfy/1000. + var.yxvc; |
5954 |
calzx[plane] = zpiano[plane] + var.yxvc; |
calzx[plane] = zpiano[plane] + var.yxvc; |
5955 |
calzy[plane] = zpiano[plane] + var.yyvc; |
calzy[plane] = zpiano[plane] + var.yyvc; |
5998 |
// |
// |
5999 |
for (Int_t plane = 0; plane < 22; plane++){ |
for (Int_t plane = 0; plane < 22; plane++){ |
6000 |
calx[plane] = (ctra->tbar[plane][0]/100.)*var.sfx + var.xxvc;; |
calx[plane] = (ctra->tbar[plane][0]/100.)*var.sfx + var.xxvc;; |
6001 |
caly[plane] = (ctra->tbar[plane][1]/100.)*var.sfx + var.xyvc; |
caly[plane] = (-ctra->tbar[plane][1]/100.)*var.sfx + var.xyvc; |
6002 |
// calzx[plane] = zpiano[plane] -5.81*var.sfy/1000. + var.yxvc; |
// calzx[plane] = zpiano[plane] -5.81*var.sfy/1000. + var.yxvc; |
6003 |
calzx[plane] = zpiano[plane] + var.yxvc; |
calzx[plane] = zpiano[plane] + var.yxvc; |
6004 |
calzy[plane] = zpiano[plane] + var.yyvc; |
calzy[plane] = zpiano[plane] + var.yyvc; |
6027 |
}; |
}; |
6028 |
}; |
}; |
6029 |
// |
// |
6030 |
if ( !var.TRK || level.file != 2 ) return; |
if ( !var.TRK ) return; |
6031 |
// |
// |
6032 |
if ( L2->GetTrkLevel2()->GetNTracks() > 0 ){ |
if ( L2->GetTrkLevel2()->GetNTracks() > 0 ){ |
6033 |
for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ |
for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ |
6034 |
|
|
6035 |
// TrkTrack *track = L2->GetTrkLevel2()->GetTrack(nt); |
// TrkTrack *track = L2->GetTrkLevel2()->GetTrack(nt); |
6036 |
|
// printf("qui \n"); |
6037 |
PamTrack *ptrack = L2->GetTrack(nt); |
PamTrack *ptrack = L2->GetTrack(nt); |
6038 |
TrkTrack *track = ptrack->GetTrkTrack(); |
TrkTrack *track = ptrack->GetTrkTrack(); |
6039 |
|
// printf("qua \n"); |
6040 |
Int_t npoint = 100; |
Int_t npoint = 100; |
6041 |
Float_t zin[100]; |
Float_t zin[100]; |
6042 |
Double_t xout[100]; |
// Double_t xout[100]; |
6043 |
Double_t yout[100]; |
// Double_t yout[100]; |
6044 |
Int_t ifail = 0; |
Int_t ifail = 0; |
6045 |
Int_t trcol = 10; |
Int_t trcol = 10; |
6046 |
// |
// |
6058 |
Float_t tzy1[15]; |
Float_t tzy1[15]; |
6059 |
// |
// |
6060 |
for ( Int_t e = 0; e < 100 ; e++) { |
for ( Int_t e = 0; e < 100 ; e++) { |
6061 |
xout[e] = 0.; |
// xout[e] = 0.; |
6062 |
yout[e] = 0.; |
// yout[e] = 0.; |
6063 |
// |
// |
6064 |
tx[e] = 0.; |
tx[e] = 0.; |
6065 |
ty[e] = 0.; |
ty[e] = 0.; |
6085 |
// |
// |
6086 |
Trajectory *tr = new Trajectory(npoint,zin); |
Trajectory *tr = new Trajectory(npoint,zin); |
6087 |
// |
// |
6088 |
ifail = track->DoTrack2(tr); |
// ifail = track->DoTrack2(tr); |
6089 |
|
ifail = track->DoTrack(tr); |
6090 |
// |
// |
6091 |
if ( !ifail ){ |
if ( !ifail ){ |
6092 |
for ( Int_t e = 0; e < npoint ; e++) { |
for ( Int_t e = 0; e < npoint ; e++) { |
6093 |
tx[e] = ((float)tr->x[e]/100.)*var.sfx + var.xxvc; |
tx[e] = ((float)tr->x[e]/100.)*var.sfx + var.xxvc; |
6094 |
ty[e] = ((float)tr->y[e]/100.)*var.sfx + var.xyvc; |
ty[e] = (-(float)tr->y[e]/100.)*var.sfx + var.xyvc; |
6095 |
if ( e < 50 ) { |
if ( e < 50 ) { |
6096 |
ptx1[e] = ((float)tr->y[e]/100.)*var.sfx + var.xcat; |
ptx1[e] = (-(float)tr->y[e]/100.)*var.sfx + var.xcat; |
6097 |
pty1[e] = ((float)tr->x[e]/100.)*var.sfy + var.ycat; |
pty1[e] = ((float)tr->x[e]/100.)*var.sfy + var.ycat; |
6098 |
} else { |
} else { |
6099 |
ptx2[e-50] = ((float)tr->y[e]/100.)*var.sfx + var.xcat; |
ptx2[e-50] = (-(float)tr->y[e]/100.)*var.sfx + var.xcat; |
6100 |
pty2[e-50] = ((float)tr->x[e]/100.)*var.sfy + var.ycat; |
pty2[e-50] = ((float)tr->x[e]/100.)*var.sfy + var.ycat; |
6101 |
}; |
}; |
6102 |
if ( e > 84 ) { |
if ( e > 84 ) { |
6103 |
tx1[e-85] = ((float)tr->x[e]/100.)*var.nds4 + var.xxvc; |
tx1[e-85] = ((float)tr->x[e]/100.)*var.nds4 + var.xxvc; |
6104 |
ty1[e-85] = ((float)tr->y[e]/100.)*var.nds4 + var.xyvc; |
ty1[e-85] = (-(float)tr->y[e]/100.)*var.nds4 + var.xyvc; |
6105 |
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; |
6106 |
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; |
6107 |
}; |
}; |
6234 |
// |
// |
6235 |
stringstream xevent; |
stringstream xevent; |
6236 |
stringstream yevent; |
stringstream yevent; |
6237 |
Float_t sdexy[2][22][96]; |
// Float_t sdexy[2][22][96]; |
6238 |
Float_t sdexyc[2][22][96]; |
// Float_t sdexyc[2][22][96]; |
6239 |
// |
// |
6240 |
for (Int_t m = 0; m < 22; m++){ |
for (Int_t m = 0; m < 22; m++){ |
6241 |
for (Int_t l = 0; l < 2; l++){ |
for (Int_t l = 0; l < 2; l++){ |
6245 |
Int_t se = 5; |
Int_t se = 5; |
6246 |
if ( !l && m%2 == 0 ) se = 3; |
if ( !l && m%2 == 0 ) se = 3; |
6247 |
if ( !l && m%2 != 0 ) se = 2; |
if ( !l && m%2 != 0 ) se = 2; |
6248 |
if ( l && m%2 == 0 ) se = 1; |
if ( l && m%2 != 0 ) se = 1; |
6249 |
if ( l && m%2 != 0 ) se = 0; |
if ( l && m%2 == 0 ) se = 0; |
6250 |
// |
// |
6251 |
// determine what kind of event we are going to analyze |
// determine what kind of event we are going to analyze |
6252 |
// |
// |
6253 |
bool isCOMP = 0; |
// bool isCOMP = 0; |
6254 |
bool isFULL = 0; |
// bool isFULL = 0; |
6255 |
bool isRAW = 0; |
bool isRAW = 0; |
6256 |
if ( de->stwerr[se] & (1 << 16) ) isCOMP = 1; |
// if ( de->stwerr[se] & (1 << 16) ) isCOMP = 1; |
6257 |
if ( de->stwerr[se] & (1 << 17) ) isFULL = 1; |
// if ( de->stwerr[se] & (1 << 17) ) isFULL = 1; |
6258 |
if ( de->stwerr[se] & (1 << 3) ) isRAW = 1; |
if ( de->stwerr[se] & (1 << 3) ) isRAW = 1; |
6259 |
// |
// |
6260 |
// save the prevoius energy deposit and calibration in sbase, sdexy, sdexyc |
// save the prevoius energy deposit and calibration in sbase, sdexy, sdexyc |
6264 |
for (Int_t nn = 0; nn < 96; nn++){ |
for (Int_t nn = 0; nn < 96; nn++){ |
6265 |
if ( nn%16 == 0 ) pre++; |
if ( nn%16 == 0 ) pre++; |
6266 |
evento.base[l][m][pre] = calib.calbase[l][m][pre]; |
evento.base[l][m][pre] = calib.calbase[l][m][pre]; |
6267 |
sdexy[l][m][nn] = evento.dexy[l][m][nn]; |
// sdexy[l][m][nn] = evento.dexy[l][m][nn]; |
6268 |
evento.dexy[l][m][nn] = de->dexy[l][m][nn] ; |
evento.dexy[l][m][nn] = de->dexy[l][m][nn] ; |
6269 |
sdexyc[l][m][nn] = evento.dexy[l][m][nn]; |
// sdexyc[l][m][nn] = evento.dexy[l][m][nn]; |
6270 |
evento.dexyc[l][m][nn] = de->dexy[l][m][nn] ; |
evento.dexyc[l][m][nn] = de->dexy[l][m][nn] ; |
6271 |
}; |
}; |
6272 |
}; |
}; |
6341 |
Xview->Draw("box same"); |
Xview->Draw("box same"); |
6342 |
}; |
}; |
6343 |
if ( l == 1 ) { |
if ( l == 1 ) { |
6344 |
Yview->Fill(n,21-m,1.); |
Yview->Fill(95-n,21-m,1.); |
6345 |
pd2->cd(); |
pd2->cd(); |
6346 |
Yview->Draw("box same"); |
Yview->Draw("box same"); |
6347 |
}; |
}; |
6361 |
// |
// |
6362 |
// Define variables |
// Define variables |
6363 |
// |
// |
6364 |
Int_t etime = var.etime; |
UInt_t etime = var.etime; |
6365 |
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]; |
6366 |
Int_t badstrip = 0; |
Int_t badstrip = 0; |
6367 |
qtot = 0.; |
qtot = 0.; |
6368 |
nstrip = 0; |
nstrip = 0; |
6433 |
if ( calib.ttime[s][b[s]+1] && calib.time[s][b[s]] ){ |
if ( calib.ttime[s][b[s]+1] && calib.time[s][b[s]] ){ |
6434 |
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 ){ |
6435 |
printf(" CALORIMETER: \n" ); |
printf(" CALORIMETER: \n" ); |
6436 |
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]); |
6437 |
printf(" END CALORIMETER. \n\n" ); |
printf(" END CALORIMETER. \n\n" ); |
6438 |
b[s]++; |
b[s]++; |
6439 |
CaloPede(s); |
CaloPede(s); |
6453 |
Int_t se = 5; |
Int_t se = 5; |
6454 |
if (l == 0 && m%2 == 0) se = 3; |
if (l == 0 && m%2 == 0) se = 3; |
6455 |
if (l == 0 && m%2 != 0) se = 2; |
if (l == 0 && m%2 != 0) se = 2; |
6456 |
if (l == 1 && m%2 == 0) se = 1; |
if (l == 1 && m%2 != 0) se = 1; |
6457 |
if (l == 1 && m%2 != 0) se = 0; |
if (l == 1 && m%2 == 0) se = 0; |
6458 |
// |
// |
6459 |
// determine what kind of event we are going to analyze |
// determine what kind of event we are going to analyze |
6460 |
// |
// |
6461 |
bool isCOMP = 0; |
// bool isCOMP = 0; |
6462 |
bool isFULL = 0; |
// bool isFULL = 0; |
6463 |
bool isRAW = 0; |
bool isRAW = 0; |
6464 |
if ( de->stwerr[se] & (1 << 16) ) isCOMP = 1; |
// if ( de->stwerr[se] & (1 << 16) ) isCOMP = 1; |
6465 |
if ( de->stwerr[se] & (1 << 17) ) isFULL = 1; |
// if ( de->stwerr[se] & (1 << 17) ) isFULL = 1; |
6466 |
if ( de->stwerr[se] & (1 << 3) ) isRAW = 1; |
if ( de->stwerr[se] & (1 << 3) ) isRAW = 1; |
6467 |
// |
// |
6468 |
// save the prevoius energy deposit and calibration in sbase, sdexy, sdexyc |
// save the prevoius energy deposit and calibration in sbase, sdexy, sdexyc |
6472 |
for (Int_t nn = 0; nn < 96; nn++){ |
for (Int_t nn = 0; nn < 96; nn++){ |
6473 |
if ( nn%16 == 0 ) pre++; |
if ( nn%16 == 0 ) pre++; |
6474 |
evento.base[l][m][pre] = calib.calbase[l][m][pre]; |
evento.base[l][m][pre] = calib.calbase[l][m][pre]; |
6475 |
sdexy[l][m][nn] = evento.dexy[l][m][nn]; |
// sdexy[l][m][nn] = evento.dexy[l][m][nn]; |
6476 |
evento.dexy[l][m][nn] = de->dexy[l][m][nn] ; |
evento.dexy[l][m][nn] = de->dexy[l][m][nn] ; |
6477 |
sdexyc[l][m][nn] = evento.dexy[l][m][nn]; |
// sdexyc[l][m][nn] = evento.dexy[l][m][nn]; |
6478 |
evento.dexyc[l][m][nn] = de->dexy[l][m][nn] ; |
evento.dexyc[l][m][nn] = de->dexy[l][m][nn] ; |
6479 |
}; |
}; |
6480 |
}; |
}; |
6483 |
// |
// |
6484 |
Int_t done = 0; |
Int_t done = 0; |
6485 |
Int_t rdone = 0; |
Int_t rdone = 0; |
6486 |
Int_t fdone = 0; |
// Int_t fdone = 0; |
6487 |
pre = -1; |
pre = -1; |
6488 |
for (Int_t n =0 ; n < 96; n++){ |
for (Int_t n =0 ; n < 96; n++){ |
6489 |
if ( n%16 == 0 ) { |
if ( n%16 == 0 ) { |
6490 |
pre++; |
pre++; |
6491 |
done = 0; |
done = 0; |
6492 |
rdone = 0; |
rdone = 0; |
6493 |
fdone = 0; |
// fdone = 0; |
6494 |
}; |
}; |
6495 |
// |
// |
6496 |
// baseline check and calculation |
// baseline check and calculation |
6570 |
Xview->Draw("box same"); |
Xview->Draw("box same"); |
6571 |
}; |
}; |
6572 |
if ( l == 1 ) { |
if ( l == 1 ) { |
6573 |
Yview->Fill(n,21-m,1.); |
Yview->Fill(96-n,21-m,1.); |
6574 |
pd2->cd(); |
pd2->cd(); |
6575 |
Yview->Draw("box same"); |
Yview->Draw("box same"); |
6576 |
}; |
}; |
6657 |
// |
// |
6658 |
stringstream xvev; |
stringstream xvev; |
6659 |
stringstream yvev; |
stringstream yvev; |
6660 |
for (Int_t ii = 0; ii < L2->GetCaloLevel2()->nstrip; ii++){ |
// for (Int_t ii = 0; ii < L2->GetCaloLevel2()->nstrip; ii++){ |
6661 |
|
for (Int_t ii = 0; ii < L2->GetCaloLevel1()->istrip; ii++){ |
6662 |
Int_t colo; |
Int_t colo; |
6663 |
Int_t l; |
Int_t l; |
6664 |
Int_t m; |
Int_t m; |
6665 |
Int_t n; |
Int_t n; |
6666 |
Float_t mip = L2->GetCaloLevel1()->DecodeEstrip(ii,l,m,n); |
Bool_t satura = false; |
6667 |
|
Float_t mip = L2->GetCaloLevel1()->DecodeEstrip(ii,l,m,n,satura); |
6668 |
if ( var.bw ){ |
if ( var.bw ){ |
6669 |
colo = -1; |
colo = -1; |
6670 |
} else { |
} else { |
6671 |
colo = 1; |
colo = 1; |
6672 |
}; |
}; |
6673 |
ColorMIP(mip,colo); |
ColorMIP(mip,colo); |
6674 |
if ( l == 0 ) { |
if ( l == 0 ) { |
6675 |
xvev.str(""); |
xvev.str(""); |
6678 |
xvev << " " << l; |
xvev << " " << l; |
6679 |
gDirectory->Delete(xvev.str().c_str()); |
gDirectory->Delete(xvev.str().c_str()); |
6680 |
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); |
6681 |
Xview->SetFillColor(colo); |
if ( satura ){ |
6682 |
|
Xview->SetFillColor(kBlack); |
6683 |
|
} else { |
6684 |
|
Xview->SetFillColor(colo); |
6685 |
|
}; |
6686 |
Xview->Fill(n,21-m,1.); |
Xview->Fill(n,21-m,1.); |
6687 |
pd1->cd(); |
pd1->cd(); |
6688 |
Xview->Draw("box same"); |
Xview->Draw("box same"); |
6694 |
yvev << " " << l; |
yvev << " " << l; |
6695 |
gDirectory->Delete(yvev.str().c_str()); |
gDirectory->Delete(yvev.str().c_str()); |
6696 |
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); |
6697 |
Yview->SetFillColor(colo); |
if ( satura ){ |
6698 |
Yview->Fill(n,21-m,1.); |
Yview->SetFillColor(kBlack); |
6699 |
|
} else { |
6700 |
|
Yview->SetFillColor(colo); |
6701 |
|
}; |
6702 |
|
Yview->Fill(96-n,21-m,1.); |
6703 |
pd2->cd(); |
pd2->cd(); |
6704 |
Yview->Draw("box same"); |
Yview->Draw("box same"); |
6705 |
}; |
}; |
6712 |
} |
} |
6713 |
|
|
6714 |
void FEVdetector::Calo1stcalib(){ |
void FEVdetector::Calo1stcalib(){ |
6715 |
Float_t estrip[2][22][96]; |
// Float_t estrip[2][22][96]; |
6716 |
// |
// |
6717 |
// this is the value of the mip for each strip. To be changed when we will have the real values |
// this is the value of the mip for each strip. To be changed when we will have the real values |
6718 |
// |
// |
6730 |
for (Int_t k = 0; k < 22; k++ ){ |
for (Int_t k = 0; k < 22; k++ ){ |
6731 |
for (Int_t l = 0; l < 96; l++ ){ |
for (Int_t l = 0; l < 96; l++ ){ |
6732 |
calib.calped[m][k][l] = 0. ; |
calib.calped[m][k][l] = 0. ; |
6733 |
estrip[m][k][l] = 0.; |
// estrip[m][k][l] = 0.; |
6734 |
}; |
}; |
6735 |
}; |
}; |
6736 |
} |
} |
6748 |
for (Int_t d = 0; d<48; d++){ |
for (Int_t d = 0; d<48; d++){ |
6749 |
if ( calib.ttime[s][d] != 0 ) calibex++; |
if ( calib.ttime[s][d] != 0 ) calibex++; |
6750 |
if ( calib.time[s][0] != 0 ){ |
if ( calib.time[s][0] != 0 ){ |
6751 |
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]); |
6752 |
if ( calib.time[s][d+1] != 0 ) { |
if ( calib.time[s][d+1] != 0 ) { |
6753 |
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]); |
6754 |
} else { |
} else { |
6755 |
if ( !stop ){ |
if ( !stop ){ |
6756 |
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]); |
6757 |
stop = 1; |
stop = 1; |
6758 |
}; |
}; |
6759 |
}; |
}; |
6760 |
} else { |
} else { |
6761 |
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]); |
6762 |
}; |
}; |
6763 |
}; |
}; |
6764 |
printf("\n"); |
printf("\n"); |
6823 |
calib.ttime[s][inter] = 0; |
calib.ttime[s][inter] = 0; |
6824 |
if ( ce->cstwerr[s] != 0 && ce->cperror[s] == 0 ) { |
if ( ce->cstwerr[s] != 0 && ce->cperror[s] == 0 ) { |
6825 |
//calib.ttime[s][inter] = cph->GetOrbitalTime(); |
//calib.ttime[s][inter] = cph->GetOrbitalTime(); |
6826 |
calib.ttime[s][inter] = cph->OrbitalTime; |
calib.ttime[s][inter] = (UInt_t)cph->OrbitalTime; |
6827 |
inter++; |
inter++; |
6828 |
} else { |
} else { |
6829 |
if ( ce->cstwerr[s] != 0 && ce->cperror[s] != 0 ) { |
if ( ce->cstwerr[s] != 0 && ce->cperror[s] != 0 ) { |
6877 |
tr->GetEntry(ci); |
tr->GetEntry(ci); |
6878 |
cph = ceh->GetPscuHeader(); |
cph = ceh->GetPscuHeader(); |
6879 |
//if ( atime == cph->GetOrbitalTime()){ |
//if ( atime == cph->GetOrbitalTime()){ |
6880 |
if ( atime == cph->OrbitalTime){ |
if ( atime == (UInt_t)cph->OrbitalTime){ |
6881 |
// calib.iev = ce->iev; |
// calib.iev = ce->iev; |
6882 |
if (ce->cstwerr[s] != 0 && ce->cperror[s] == 0 ) { |
if (ce->cstwerr[s] != 0 && ce->cperror[s] == 0 ) { |
6883 |
for ( Int_t d=0 ; d<11 ;d++ ){ |
for ( Int_t d=0 ; d<11 ;d++ ){ |