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 |
// |
// |
89 |
var.SHOWDEC = 0; |
var.SHOWDEC = 0; |
90 |
var.TOF = 0; |
var.TOF = 0; |
91 |
var.AC = 0; |
var.AC = 0; |
92 |
|
var.RUN = 1; |
93 |
var.TRK = 0; |
var.TRK = 0; |
94 |
|
var.ORB = 1; |
95 |
|
var.TRG = 0; |
96 |
var.CALO = 0; |
var.CALO = 0; |
97 |
|
var.CALOT = 0; |
98 |
var.S4 = 0; |
var.S4 = 0; |
99 |
var.ND = 0; |
var.ND = 0; |
100 |
var.INFOS = 0; |
var.INFOS = 0; |
129 |
}; |
}; |
130 |
} |
} |
131 |
|
|
132 |
|
void FEVdetector::SetDDEC(TString de){ |
133 |
|
ddec=de; |
134 |
|
}; |
135 |
|
|
136 |
void FEVdetector::GetWindow(){ |
void FEVdetector::GetWindow(){ |
137 |
otr->GetEntry(maxevent); |
printf(" ah \n"); |
138 |
|
// |
139 |
|
if ( level.file == 2 ){ |
140 |
|
L2->GetEntry(maxevent); |
141 |
|
} else { |
142 |
|
otr->GetEntry(maxevent); |
143 |
|
} |
144 |
|
// |
145 |
if ( level.file < 2 ){ |
if ( level.file < 2 ){ |
146 |
ph = eh->GetPscuHeader(); |
ph = eh->GetPscuHeader(); |
147 |
lastevno = (int)ph->Counter; |
lastevno = (int)ph->Counter; |
148 |
} else { |
} else { |
149 |
lastevno = oinfoL2->pkt_num; // to be changed as soon as we will have pkt_counter in the level2 file! |
if ( var.ORB ){ |
150 |
|
lastevno = L2->GetOrbitalInfo()->pkt_num; |
151 |
|
} else { |
152 |
|
lastevno = 0; |
153 |
|
}; |
154 |
}; |
}; |
155 |
otr->GetEntry(minevent); |
printf(" mmh minev %u \n",minevent); |
156 |
|
if ( level.file == 2 ){ |
157 |
|
L2->GetEntry(minevent); |
158 |
|
} else { |
159 |
|
otr->GetEntry(minevent); |
160 |
|
} |
161 |
if ( level.file < 2 ){ |
if ( level.file < 2 ){ |
162 |
ph = eh->GetPscuHeader(); |
ph = eh->GetPscuHeader(); |
163 |
firstevno = (int)ph->Counter; |
firstevno = (int)ph->Counter; |
164 |
} else { |
} else { |
165 |
firstevno = oinfoL2->pkt_num; // to be changed as soon as we will have pkt_counter in the level2 file! |
if ( var.ORB ){ |
166 |
|
firstevno = L2->GetOrbitalInfo()->pkt_num; |
167 |
|
} else { |
168 |
|
firstevno = 0; |
169 |
|
}; |
170 |
}; |
}; |
171 |
|
printf(" aaah \n"); |
172 |
} |
} |
173 |
|
|
174 |
void FEVdetector::ClearVariables(){ |
void FEVdetector::ClearVariables(){ |
191 |
} |
} |
192 |
|
|
193 |
void FEVdetector::GetEntry(Int_t i){ |
void FEVdetector::GetEntry(Int_t i){ |
194 |
thisentry = i; |
thisentry = i; |
195 |
otr->GetEntry(i); |
if ( level.file == 2 ){ |
196 |
|
printf("qui \n"); |
197 |
|
L2->GetEntry(i); |
198 |
|
printf("qua \n"); |
199 |
|
ShowInfo("RunInfo"); |
200 |
|
ShowInfo("SoftInfo"); |
201 |
|
ShowInfo("OrbitalInfo"); |
202 |
|
ShowInfo("TrigLevel2"); |
203 |
|
ShowInfo("ToFLevel2"); |
204 |
|
ShowInfo("TrkLevel2"); |
205 |
|
ShowInfo("AcLevel2"); |
206 |
|
ShowInfo("CaloLevel2"); |
207 |
|
ShowInfo("CaloLevel1"); |
208 |
|
ShowInfo("S4Level2"); |
209 |
|
ShowInfo("NDLevel2"); |
210 |
|
} else { |
211 |
|
otr->GetEntry(i); |
212 |
|
ShowInfo("Pscu"); |
213 |
|
ShowInfo("Trigger"); |
214 |
|
ShowInfo("Tof"); |
215 |
|
ShowInfo("Tracker"); |
216 |
|
ShowInfo("Anticounter"); |
217 |
|
ShowInfo("Calorimeter"); |
218 |
|
ShowInfo("Neutron"); |
219 |
|
ShowInfo("S4"); |
220 |
|
}; |
221 |
} |
} |
222 |
|
|
223 |
void FEVdetector::SetEntry(Int_t i){ |
void FEVdetector::SetEntry(Int_t i){ |
230 |
return((int)ph->Counter); |
return((int)ph->Counter); |
231 |
} else { |
} else { |
232 |
// return(thisentry); // to be changed as soon as we will have pkt_counter in the level2 file! |
// return(thisentry); // to be changed as soon as we will have pkt_counter in the level2 file! |
233 |
return((int)oinfoL2->pkt_num); // to be changed as soon as we will have pkt_counter in the level2 file! |
return((int)L2->GetOrbitalInfo()->pkt_num); // to be changed as soon as we will have pkt_counter in the level2 file! |
234 |
}; |
}; |
235 |
} |
} |
236 |
|
|
338 |
}; |
}; |
339 |
} |
} |
340 |
|
|
341 |
|
void FEVdetector::ShowInfo(TString detector){ |
342 |
|
// |
343 |
|
TBranch *b1 = 0; |
344 |
|
// TBranch *b3 = 0; |
345 |
|
TObjArray *branch_array = 0; |
346 |
|
// TObjArray *leaf_array = 0; |
347 |
|
// |
348 |
|
if ( !strcmp(detector.Data(),"RunInfo") || !strcmp(detector.Data(),"SoftInfo") ){ |
349 |
|
if ( runtree ) b1 = runtree->FindBranch(detector.Data()); |
350 |
|
} else { |
351 |
|
b1 = otr->FindBranch(detector.Data()); |
352 |
|
}; |
353 |
|
// |
354 |
|
if ( !b1 ) return; |
355 |
|
// |
356 |
|
Int_t dlen = 10; |
357 |
|
// |
358 |
|
char o[200000]; |
359 |
|
char col[13]; |
360 |
|
char col2[13]; |
361 |
|
// |
362 |
|
setcolor(col,RESET, GREEN, WHITE); |
363 |
|
sprintf(o,"%s======> EVENT:%i\n",col, thisentry); |
364 |
|
// |
365 |
|
setcolor(col,RESET, RED, WHITE); |
366 |
|
sprintf(o,"%s%sBranch %s\n",o,col,b1->GetName()); |
367 |
|
setcolor(col,RESET, BLACK, WHITE); |
368 |
|
sprintf(o,"%s%s",o,col); |
369 |
|
// |
370 |
|
branch_array = b1->GetListOfBranches(); |
371 |
|
// |
372 |
|
Int_t j = 0; |
373 |
|
// |
374 |
|
for(Int_t l=0;l<(branch_array->GetLast()+1);l++){ |
375 |
|
// |
376 |
|
TBranchElement *tb = (TBranchElement*)branch_array->At(l); |
377 |
|
Int_t type = tb->GetType(); |
378 |
|
Int_t atype = tb->GetStreamerType() - 20; |
379 |
|
Int_t len = (tb->GetInfo()->GetLengths())[tb->GetID()]; |
380 |
|
Int_t length = min(len,dlen); |
381 |
|
// |
382 |
|
// printf("Branches : type is %i type is %i tb getname %s slen %i slength %i\n",atype,type,tb->GetName(),len,length); |
383 |
|
switch (type){ |
384 |
|
case 0: |
385 |
|
// |
386 |
|
// IS A VARIABLE |
387 |
|
// |
388 |
|
// |
389 |
|
// NAME |
390 |
|
// |
391 |
|
setcolor(col,RESET, BLUE, WHITE); |
392 |
|
setcolor(col2,RESET, BLACK, WHITE); |
393 |
|
sprintf(o,"%s%s %-15s%s =",o,col,((TBranch*)branch_array->At(l))->GetName(),col2); |
394 |
|
// |
395 |
|
j = 0; |
396 |
|
// |
397 |
|
// VALUES |
398 |
|
// |
399 |
|
// |
400 |
|
// Integer |
401 |
|
// |
402 |
|
if ( atype == 3 || atype == -17 ){ |
403 |
|
while ( j < length ){ |
404 |
|
if ( j < length -1 ){ |
405 |
|
sprintf(o,"%s %i ,",o,(Int_t)tb->GetValue(j,0)); |
406 |
|
} else { |
407 |
|
sprintf(o,"%s %i",o,(Int_t)tb->GetValue(j,0)); |
408 |
|
}; |
409 |
|
j++; |
410 |
|
}; |
411 |
|
}; |
412 |
|
// |
413 |
|
// Unsigned integer |
414 |
|
// |
415 |
|
if ( atype == -7 || atype == 13 || atype == -9 || atype == -8 || atype == 12 ){ |
416 |
|
while ( j < length ){ |
417 |
|
if ( j < length -1 ){ |
418 |
|
sprintf(o,"%s %u ,",o,(UInt_t)tb->GetValue(j,0)); |
419 |
|
} else { |
420 |
|
sprintf(o,"%s %u",o,(UInt_t)tb->GetValue(j,0)); |
421 |
|
}; |
422 |
|
j++; |
423 |
|
}; |
424 |
|
}; |
425 |
|
// |
426 |
|
// Float |
427 |
|
// |
428 |
|
if ( atype == -15 || atype == 5 ){ |
429 |
|
while ( j < length ){ |
430 |
|
if ( j < length -1 ){ |
431 |
|
sprintf(o,"%s %f ,",o,tb->GetValue(j,0)); |
432 |
|
} else { |
433 |
|
sprintf(o,"%s %f",o,tb->GetValue(j,0)); |
434 |
|
}; |
435 |
|
j++; |
436 |
|
}; |
437 |
|
}; |
438 |
|
// |
439 |
|
// Strings |
440 |
|
// |
441 |
|
if ( atype == 45 ){ |
442 |
|
// TObjArray *cl = (TObjArray*)(tb->GetInfo()->GetOffsets())[tb->GetID()];//tb->GetValuePointer(); |
443 |
|
// TString *stringa = (TString*)(*cl)[0]; |
444 |
|
// TBranchElement *utb = (TBranchElement*)tb->GetBranchCount(); |
445 |
|
// TString** stringa = (TString*)(&tb->GetValuePointer()); |
446 |
|
//TStreamerElement *tste = (TStreamerElement*)tb->GetInfo()->GetCurrentElement(); |
447 |
|
|
448 |
|
// char *ladd; |
449 |
|
// ladd = tb->GetValuePointer() |
450 |
|
// TString *stringa = (TString*)((tste->GetOffset())); |
451 |
|
// TString& mstr = *stringa; |
452 |
|
// printf(" la mia stringa %s \n",mstr.Data()); |
453 |
|
// printf(" offset %i \n",(Int_t)utb->GetValue(0,0)); |
454 |
|
// int pointer = (tb->GetInfo()->GetOffsets())[tb->GetID()]; |
455 |
|
// TString *stringa = (TString*)(tb->GetInfo()->GetOffsets())[tb->GetID()]; |
456 |
|
// TString *stringa = (TString*)tb->GetAddress(); |
457 |
|
// printf(" address 0x%X \n",tb->GetAddress()); |
458 |
|
// printf(" pointer 0x%X \n",tb->GetValuePointer()); |
459 |
|
// printf(" object 0x%X \n",tb->GetObject()); |
460 |
|
// printf("stringa %s lung %i\n",stringa.Data(),stringa.Length()); |
461 |
|
// TLeaf *striglia = tb->FindLeaf(tb->GetName()); |
462 |
|
// if ( striglia ){ |
463 |
|
// char *pointer = (char *)striglia->GetValuePointer(); |
464 |
|
// TString *pr= (TString*)pointer; |
465 |
|
// printf("ciao %s \n",pr->Data()); |
466 |
|
// }; |
467 |
|
sprintf(o,"%s TString - not implemented yet -",o); |
468 |
|
}; |
469 |
|
// |
470 |
|
// TArray |
471 |
|
// |
472 |
|
if ( atype == 42 ){ |
473 |
|
// |
474 |
|
// TObjArray *cl = (TObjArray*)tb->GetObject(); |
475 |
|
// // |
476 |
|
// TClass *myc = cl->IsA(); |
477 |
|
// // |
478 |
|
// printf("qui \n"); |
479 |
|
// // |
480 |
|
// // determine offset to fetch data |
481 |
|
// // |
482 |
|
// int thisoffset = 0; |
483 |
|
// TRealData *rd = myc->GetRealData(tb->GetName()); |
484 |
|
// if ( rd ){ |
485 |
|
// thisoffset = rd->GetThisOffset(); |
486 |
|
// }; |
487 |
|
// Int_t niente = 0; |
488 |
|
// TStreamerElement *tste = tb->GetInfo()->GetStreamerElement(rd->GetName(),niente); |
489 |
|
// printf(" typename %s \n",tste->GetTypeName()); |
490 |
|
// // |
491 |
|
// // TArrayI |
492 |
|
// // |
493 |
|
// if ( !strcmp(tste->GetTypeName(),"TArrayI") ){ |
494 |
|
// // |
495 |
|
// printf("qua \n"); |
496 |
|
// char *pointer = (char*)cl->At(0); |
497 |
|
// // char *pu = thisoffset + pointer; |
498 |
|
// int pu = (int)tste->GetTObjectOffset(); |
499 |
|
// TArrayI arr = (TArrayI)*pu; |
500 |
|
// // TArrayI arr = (TArrayI)(thisoffset); |
501 |
|
// //TArrayI *arr = (TArrayI*)pu; |
502 |
|
// //TArraI arr = (TArrayI) |
503 |
|
// Int_t jj=0; |
504 |
|
// j=0; |
505 |
|
// printf("quii \n"); |
506 |
|
// Int_t arlen = min(arr.GetSize(),dlen); |
507 |
|
// // |
508 |
|
// printf("que \n"); |
509 |
|
// setcolor(col,RESET, BLUE, WHITE); |
510 |
|
// setcolor(col2,RESET, BLACK, WHITE); |
511 |
|
// sprintf(o,"%s%s %s[%i]%s = ",o,col,tb->GetName(),arr.GetSize(),col2); |
512 |
|
// // |
513 |
|
// // while ( j < tb->GetNdata() ){ |
514 |
|
// // |
515 |
|
// printf("quo \n"); |
516 |
|
// // pointer = (char*)cl->UncheckedAt(j); |
517 |
|
// // pu = pointer + thisoffset; |
518 |
|
// // arr = (TArrayI*)(thisoffset); |
519 |
|
// // |
520 |
|
// while ( jj < arlen ){ |
521 |
|
// if ( jj < arlen-1 ){ |
522 |
|
// sprintf(o,"%s %i ,",o,arr.At(jj)); |
523 |
|
// } else { |
524 |
|
// sprintf(o,"%s %i",o,arr.At(jj)); |
525 |
|
// }; |
526 |
|
// jj++; |
527 |
|
// }; |
528 |
|
// // if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); |
529 |
|
// // j++; |
530 |
|
// // }; |
531 |
|
// }; |
532 |
|
// // |
533 |
|
// // TArrayF |
534 |
|
// // |
535 |
|
// if ( !strcmp(tste->GetTypeName(),"TArrayF") ){ |
536 |
|
// // |
537 |
|
// char *pointer = (char*)cl->UncheckedAt(0); |
538 |
|
// char *pu = pointer + thisoffset; |
539 |
|
// TArrayF *arr = (TArrayF*)(pu); |
540 |
|
// Int_t jj=0; |
541 |
|
// Int_t arlen = min(arr->GetSize(),dlen); |
542 |
|
// // |
543 |
|
// setcolor(col,RESET, BLUE, WHITE); |
544 |
|
// setcolor(col2,RESET, BLACK, WHITE); |
545 |
|
// sprintf(o,"%s%s %s[%i]%s = ",o,col,tb->GetName(),arr->GetSize(),col2); |
546 |
|
// // |
547 |
|
// while ( j < tb->GetNdata() ){ |
548 |
|
// // |
549 |
|
// pointer = (char*)cl->UncheckedAt(j); |
550 |
|
// pu = pointer + thisoffset; |
551 |
|
// arr = (TArrayF*)(pu); |
552 |
|
// // |
553 |
|
// while ( jj < arlen ){ |
554 |
|
// if ( jj < arlen-1 ){ |
555 |
|
// sprintf(o,"%s %f ,",o,arr->At(jj)); |
556 |
|
// } else { |
557 |
|
// sprintf(o,"%s %f",o,arr->At(jj)); |
558 |
|
// }; |
559 |
|
// jj++; |
560 |
|
// }; |
561 |
|
// if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); |
562 |
|
// j++; |
563 |
|
// }; |
564 |
|
// }; |
565 |
|
// sprintf(o,"%s\n",o); |
566 |
|
// |
567 |
|
sprintf(o,"%s TArray - not implemented yet -",o); |
568 |
|
// |
569 |
|
}; |
570 |
|
// |
571 |
|
sprintf(o,"%s\n",o); |
572 |
|
break; |
573 |
|
case 3: |
574 |
|
// |
575 |
|
// IS A TCLONESARRAY |
576 |
|
// |
577 |
|
setcolor(col,RESET, BLUE, WHITE); |
578 |
|
setcolor(col2,RESET, BLACK, WHITE); |
579 |
|
sprintf(o,"%s%s %-15s%s = %d\n",o,col,tb->GetName(), col2, tb->GetNdata()); |
580 |
|
|
581 |
|
// |
582 |
|
if ( tb->GetNdata() ){ |
583 |
|
// |
584 |
|
TClonesArray *cl = (TClonesArray*)tb->GetObject(); |
585 |
|
// |
586 |
|
TClass *myc = cl->GetClass(); |
587 |
|
// |
588 |
|
TList *lme = myc->GetListOfDataMembers(); |
589 |
|
TIter next(lme); |
590 |
|
TBranchElement *tb2 = 0; |
591 |
|
// |
592 |
|
while ( (tb2 = (TBranchElement*)next()) ){ |
593 |
|
// |
594 |
|
const char *name = tb2->GetName(); |
595 |
|
TBranch *foglia = tb->FindBranch(name); |
596 |
|
if ( foglia ){ |
597 |
|
// |
598 |
|
TBranchElement *stb = (TBranchElement*)tb->FindBranch(name); |
599 |
|
Int_t stype = stb->GetType(); |
600 |
|
Int_t satype = stb->GetStreamerType() - 20; |
601 |
|
Int_t slen = (stb->GetInfo()->GetLengths())[stb->GetID()]; |
602 |
|
Int_t slength = min(slen,dlen); |
603 |
|
// printf("SubBranches : atype is %i type is %i tb getname %s slen %i slength %i\n",satype,stype,stb->GetName(),slen,slength); |
604 |
|
switch (stype){ |
605 |
|
case 31: |
606 |
|
// |
607 |
|
// IS A VARIABLE |
608 |
|
// |
609 |
|
// |
610 |
|
// NAME |
611 |
|
// |
612 |
|
j = 0; |
613 |
|
// |
614 |
|
// VALUES |
615 |
|
// |
616 |
|
if ( satype == 41 || satype == 44){ |
617 |
|
// |
618 |
|
// skip TRef |
619 |
|
// |
620 |
|
break; |
621 |
|
}; |
622 |
|
// |
623 |
|
// Integer |
624 |
|
// |
625 |
|
if ( satype == -17 || satype == -9 ){ |
626 |
|
// |
627 |
|
setcolor(col,RESET, BLUE, WHITE); |
628 |
|
setcolor(col2,RESET, BLACK, WHITE); |
629 |
|
sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2); |
630 |
|
while ( j < cl->GetEntriesFast() ){ |
631 |
|
if ( j < cl->GetEntriesFast() -1 ){ |
632 |
|
sprintf(o,"%s %i ,",o,(Int_t)stb->GetValue(j,slength)); |
633 |
|
} else { |
634 |
|
sprintf(o,"%s %i",o,(Int_t)stb->GetValue(j,slength)); |
635 |
|
}; |
636 |
|
j++; |
637 |
|
}; |
638 |
|
}; |
639 |
|
// |
640 |
|
// Float |
641 |
|
// |
642 |
|
if ( satype == -15 ){ |
643 |
|
// |
644 |
|
setcolor(col,RESET, BLUE, WHITE); |
645 |
|
setcolor(col2,RESET, BLACK, WHITE); |
646 |
|
sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2); |
647 |
|
while ( j < cl->GetEntriesFast() ){ |
648 |
|
if ( j < cl->GetEntriesFast() -1 ){ |
649 |
|
sprintf(o,"%s %f ,",o,stb->GetValue(j,slength)); |
650 |
|
} else { |
651 |
|
sprintf(o,"%s %f",o,stb->GetValue(j,slength)); |
652 |
|
}; |
653 |
|
j++; |
654 |
|
}; |
655 |
|
}; |
656 |
|
// |
657 |
|
// Array of float |
658 |
|
// |
659 |
|
if ( satype == 5 ){ |
660 |
|
// |
661 |
|
setcolor(col,RESET, BLUE, WHITE); |
662 |
|
setcolor(col2,RESET, BLACK, WHITE); |
663 |
|
sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2); |
664 |
|
Bool_t bold = true; |
665 |
|
while ( j < tb->GetNdata() ){ |
666 |
|
if ( bold ){ |
667 |
|
setcolor(col,RESET, BLACK, WHITE); |
668 |
|
sprintf(o,"%s%s",o,col); |
669 |
|
} else { |
670 |
|
setcolor(col,BOLD, BLACK, WHITE); |
671 |
|
sprintf(o,"%s%s",o,col); |
672 |
|
}; |
673 |
|
Int_t jj = 0; |
674 |
|
while ( jj < slength ){ |
675 |
|
if ( jj < slength-1 ){ |
676 |
|
sprintf(o,"%s %f ,",o,stb->GetValue(j,jj,true)); |
677 |
|
} else { |
678 |
|
sprintf(o,"%s %f",o,stb->GetValue(j,jj,true)); |
679 |
|
}; |
680 |
|
jj++; |
681 |
|
}; |
682 |
|
if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); |
683 |
|
if ( !bold ){ |
684 |
|
bold = true; |
685 |
|
} else { |
686 |
|
bold = false; |
687 |
|
}; |
688 |
|
j++; |
689 |
|
}; |
690 |
|
if ( bold ){ |
691 |
|
setcolor(col,RESET, BLACK, WHITE); |
692 |
|
sprintf(o,"%s%s",o,col); |
693 |
|
}; |
694 |
|
}; |
695 |
|
// |
696 |
|
// Array of integers |
697 |
|
// |
698 |
|
if ( satype == 3 ){ |
699 |
|
// |
700 |
|
setcolor(col,RESET, BLUE, WHITE); |
701 |
|
setcolor(col2,RESET, BLACK, WHITE); |
702 |
|
sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2); |
703 |
|
while ( j < tb->GetNdata() ){ |
704 |
|
Int_t jj = 0; |
705 |
|
while ( jj < slength ){ |
706 |
|
if ( jj < slength-1 ){ |
707 |
|
sprintf(o,"%s %i ,",o,(Int_t)stb->GetValue(j,jj,true)); |
708 |
|
} else { |
709 |
|
sprintf(o,"%s %i",o,(Int_t)stb->GetValue(j,jj,true)); |
710 |
|
}; |
711 |
|
jj++; |
712 |
|
}; |
713 |
|
if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); |
714 |
|
j++; |
715 |
|
}; |
716 |
|
}; |
717 |
|
|
718 |
|
// |
719 |
|
// TArray |
720 |
|
// |
721 |
|
if ( satype == 42 ){ |
722 |
|
// |
723 |
|
// determine offset to fetch data |
724 |
|
// |
725 |
|
int thisoffset = 0; |
726 |
|
TRealData *rd = myc->GetRealData(foglia->GetName()); |
727 |
|
if ( rd ){ |
728 |
|
thisoffset = rd->GetThisOffset(); |
729 |
|
}; |
730 |
|
Int_t niente = 0; |
731 |
|
TStreamerElement *tste = stb->GetInfo()->GetStreamerElement(rd->GetName(),niente); |
732 |
|
// |
733 |
|
// TArrayI |
734 |
|
// |
735 |
|
if ( !strcmp(tste->GetTypeName(),"TArrayI") ){ |
736 |
|
// |
737 |
|
char *pointer = (char*)cl->UncheckedAt(0); |
738 |
|
char *pu = pointer + thisoffset; |
739 |
|
TArrayI *arr = (TArrayI*)(pu); |
740 |
|
Int_t jj=0; |
741 |
|
Int_t arlen = min(arr->GetSize(),dlen); |
742 |
|
// |
743 |
|
setcolor(col,RESET, BLUE, WHITE); |
744 |
|
setcolor(col2,RESET, BLACK, WHITE); |
745 |
|
sprintf(o,"%s%s %s[%i]%s = ",o,col,foglia->GetName(),arr->GetSize(),col2); |
746 |
|
// |
747 |
|
while ( j < tb->GetNdata() ){ |
748 |
|
// |
749 |
|
pointer = (char*)cl->UncheckedAt(j); |
750 |
|
pu = pointer + thisoffset; |
751 |
|
arr = (TArrayI*)(pu); |
752 |
|
// |
753 |
|
while ( jj < arlen ){ |
754 |
|
if ( jj < arlen-1 ){ |
755 |
|
sprintf(o,"%s %i ,",o,arr->At(jj)); |
756 |
|
} else { |
757 |
|
sprintf(o,"%s %i",o,arr->At(jj)); |
758 |
|
}; |
759 |
|
jj++; |
760 |
|
}; |
761 |
|
if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); |
762 |
|
j++; |
763 |
|
}; |
764 |
|
}; |
765 |
|
// |
766 |
|
// TArrayF |
767 |
|
// |
768 |
|
if ( !strcmp(tste->GetTypeName(),"TArrayF") ){ |
769 |
|
// |
770 |
|
char *pointer = (char*)cl->UncheckedAt(0); |
771 |
|
char *pu = pointer + thisoffset; |
772 |
|
TArrayF *arr = (TArrayF*)(pu); |
773 |
|
Int_t jj=0; |
774 |
|
Int_t arlen = min(arr->GetSize(),dlen); |
775 |
|
// |
776 |
|
setcolor(col,RESET, BLUE, WHITE); |
777 |
|
setcolor(col2,RESET, BLACK, WHITE); |
778 |
|
sprintf(o,"%s%s %s[%i]%s = ",o,col,foglia->GetName(),arr->GetSize(),col2); |
779 |
|
// |
780 |
|
while ( j < tb->GetNdata() ){ |
781 |
|
// |
782 |
|
pointer = (char*)cl->UncheckedAt(j); |
783 |
|
pu = pointer + thisoffset; |
784 |
|
arr = (TArrayF*)(pu); |
785 |
|
// |
786 |
|
while ( jj < arlen ){ |
787 |
|
if ( jj < arlen-1 ){ |
788 |
|
sprintf(o,"%s %f ,",o,arr->At(jj)); |
789 |
|
} else { |
790 |
|
sprintf(o,"%s %f",o,arr->At(jj)); |
791 |
|
}; |
792 |
|
jj++; |
793 |
|
}; |
794 |
|
if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); |
795 |
|
j++; |
796 |
|
}; |
797 |
|
}; |
798 |
|
}; |
799 |
|
sprintf(o,"%s\n",o); |
800 |
|
break; |
801 |
|
}; |
802 |
|
}; |
803 |
|
}; |
804 |
|
}; |
805 |
|
break; |
806 |
|
}; |
807 |
|
}; |
808 |
|
// pamgui->DIALOG(0,o); |
809 |
|
printf("%s\n",o); |
810 |
|
}; |
811 |
|
|
812 |
|
|
813 |
void FEVdetector::GetGeneralInfo(){ |
void FEVdetector::GetGeneralInfo(){ |
814 |
// |
// |
815 |
// Get Orbital Time information and header event number |
// Get Orbital Time information and header event number |
819 |
headcold = headc; |
headcold = headc; |
820 |
headc = ph->Counter; |
headc = ph->Counter; |
821 |
var.headc = (int)ph->Counter; |
var.headc = (int)ph->Counter; |
822 |
OBT = ph->OrbitalTime; |
OBT = (UInt_t)ph->OrbitalTime; |
823 |
DOBT = OBT - OOBT; |
DOBT = OBT - OOBT; |
824 |
OOBT = OBT; |
OOBT = OBT; |
825 |
if ( thisentry == minevent || DOBT < 0 || (headc-headcold-1)!=0 ) DOBT = 0; |
if ( thisentry == minevent || DOBT < 0 || (headc-headcold-1)!=0 ) DOBT = 0; |
855 |
trcs = (TString)trc.str().c_str(); |
trcs = (TString)trc.str().c_str(); |
856 |
} else { |
} else { |
857 |
headcold = headc; |
headcold = headc; |
858 |
headc = oinfoL2->pkt_num; // to be changed as soon as we will have obt in the level2 file! |
if ( var.ORB ){ |
859 |
OBT = oinfoL2->OBT; // to be changed as soon as we will have obt in the level2 file! |
headc = L2->GetOrbitalInfo()->pkt_num; |
860 |
DOBT = OBT - OOBT; |
OBT = L2->GetOrbitalInfo()->OBT; |
861 |
OOBT = OBT; |
DOBT = OBT - OOBT; |
862 |
if ( thisentry == minevent || DOBT < 0 || (headc-headcold-1)!=0 ) DOBT = 0; |
OOBT = OBT; |
863 |
var.etime = OBT; |
if ( thisentry == minevent || DOBT < 0 || (headc-headcold-1)!=0 ) DOBT = 0; |
864 |
|
var.etime = OBT; |
865 |
|
} else { |
866 |
|
var.etime = 0; |
867 |
|
}; |
868 |
// |
// |
869 |
// who gave the trigger? |
// who gave the trigger? |
870 |
// |
// |
871 |
calotrig = 0; |
Int_t trigconf = 0; |
872 |
if ( L2->patterntrig[0] ) calotrig = 1; |
if ( var.TRG ){ |
873 |
toftrig = 0; |
calotrig = 0; |
874 |
if ( L2->patterntrig[2] || L2->patterntrig[3] || L2->patterntrig[4] || L2->patterntrig[5] ) toftrig = 1; |
if ( L2->GetTrigLevel2()->patterntrig[0] ) calotrig = 1; |
875 |
s4pulser = 0; |
toftrig = 0; |
876 |
if ( L2->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; |
877 |
// |
s4pulser = 0; |
878 |
// 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; |
879 |
// S4 sometimes could not set the flag even if the trigger is given. This is a workaround to fix this "bug": |
// |
880 |
// |
// TOF and calorimeter when giving a trigger will always set this flag since the time window of the signal is greater than 100 ns. |
881 |
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": |
882 |
// |
// |
883 |
Int_t trigconf = L2->trigconf; |
if ( !calotrig && !toftrig ) s4pulser = 1; |
884 |
|
// |
885 |
|
trigconf = L2->GetTrigLevel2()->trigconf; |
886 |
|
} else { |
887 |
|
trigconf = 0; |
888 |
|
} |
889 |
stringstream trc; |
stringstream trc; |
890 |
trc.str(""); |
trc.str(""); |
891 |
if ( trigconf & (1<<0) ) trc << "TOF1"; |
if ( trigconf & (1<<0) ) trc << "TOF1"; |
994 |
// |
// |
995 |
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);"); |
996 |
// |
// |
997 |
if ( level.file == 2 ) isOK = gApplication->ProcessLine("filter((PamLevel2 *)L2,2);"); |
// if ( level.file == 2 ) isOK = gApplication->ProcessLine("filter((PamLevel2 *)L2,2);"); |
998 |
|
if ( level.file == 2 ) isOK = gApplication->ProcessLine("filter();"); |
999 |
// |
// |
1000 |
// progress bar in text window |
// progress bar in text window |
1001 |
// |
// |
1008 |
// |
// |
1009 |
} |
} |
1010 |
|
|
1011 |
void FEVdetector::Load(TTree &mainotr, TFile &mainfile){ |
TChain* FEVdetector::Load(TFile &mainfile){ |
1012 |
|
// |
1013 |
|
gObjectTable->Print(); |
1014 |
|
// |
1015 |
file = &mainfile; |
file = &mainfile; |
1016 |
otr = &mainotr; |
// |
1017 |
|
// if ( otr ) otr->Reset(); |
1018 |
|
// if ( runtree ) runtree->Reset(); |
1019 |
|
if ( runtree ){ |
1020 |
|
printf(" runtree residuo \n"); |
1021 |
|
if ( runtree->GetFile() ){ |
1022 |
|
printf("chiudi file \n"); |
1023 |
|
// runtree->GetFile()->Close("R"); |
1024 |
|
}; |
1025 |
|
}; |
1026 |
|
// |
1027 |
|
if ( runtree ){ |
1028 |
|
printf(" clear runtree \n"); |
1029 |
|
runtree->Clear(); |
1030 |
|
printf(" delete runtree \n"); |
1031 |
|
delete runtree; |
1032 |
|
}; |
1033 |
|
// if ( runtree ) runtree->Print(); |
1034 |
|
if ( otr ){ |
1035 |
|
printf(" otr residuo \n"); |
1036 |
|
// if ( otr->GetFile() ) otr->GetFile()->Close("R"); |
1037 |
|
// otr->ResetBranchAddresses(); |
1038 |
|
}; |
1039 |
|
if ( otr ){ |
1040 |
|
printf("proviamo ad ammazzarlo di brutto\n"); |
1041 |
|
// otr->Clear(); |
1042 |
|
printf("proviamo ad ammazzarlo di brutto\n"); |
1043 |
|
otr->Delete(); |
1044 |
|
printf("proviamo ad ammazzarlo di brutto\n"); |
1045 |
|
//delete otr; |
1046 |
|
printf("speriamo sia rimasto secco\n"); |
1047 |
|
}; |
1048 |
|
// if ( otr ){ |
1049 |
|
// otr->DropBaskets(); |
1050 |
|
// otr->Delete("all"); |
1051 |
|
// }; |
1052 |
|
// if ( runtree ){ |
1053 |
|
// runtree->DropBaskets(); |
1054 |
|
// runtree->Delete("all"); |
1055 |
|
// }; |
1056 |
|
if ( runtree ) printf("2 runtree residuo \n"); |
1057 |
|
// if ( runtree ) runtree->Print(); |
1058 |
|
if ( otr ) printf("2 otr residuo \n"); |
1059 |
|
// if ( otr ) otr->Print(); |
1060 |
|
// |
1061 |
L2 = new PamLevel2(); |
L2 = new PamLevel2(); |
1062 |
// |
// |
1063 |
if ( level.file == 2 ){ |
if ( level.file == 2 ){ |
|
// otr = L2->LoadPamTrees(file); |
|
|
otr = L2->GetPamTree(file); |
|
|
// ******************** |
|
|
// load magnetic field |
|
|
// ******************** |
|
|
const char *pam_calib = pathtocalibration(); |
|
1064 |
// |
// |
1065 |
stringstream magfie; |
printf(" %s \n",ddec.Data()); |
1066 |
magfie.str(""); |
otr = L2->GetPamTree(gSystem->DirName(file->GetName()),file->GetName(),ddec.Data()); |
1067 |
// magfie << "/localdisk/mocchiut/test/calib/trk-param/field_param-0/"; |
runtree = L2->GetRunTree(gSystem->DirName(file->GetName()),file->GetName()); |
1068 |
magfie << pam_calib; |
// |
1069 |
magfie << "/trk-param/field_param-0/"; |
if ( !otr ) return(0); |
1070 |
|
// |
1071 |
|
otr->CanDeleteRefs(true); |
1072 |
|
if ( runtree ) runtree->CanDeleteRefs(true); |
1073 |
// |
// |
|
L2->LoadField(magfie.str().c_str()); |
|
1074 |
} else { |
} else { |
1075 |
// |
// |
1076 |
// load calorimeter ADC2MIP conversion file |
// load calorimeter ADC2MIP conversion file |
1110 |
// |
// |
1111 |
}; |
}; |
1112 |
// |
// |
|
|
|
1113 |
// |
// |
1114 |
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(); |
|
1115 |
// |
// |
1116 |
if ( level.file == 0 || level.file == -1 ){ |
if ( level.file == 0 || level.file == -1 ){ |
1117 |
|
// |
1118 |
|
trigger = new pamela::trigger::TriggerEvent(); |
1119 |
|
eh = new pamela::EventHeader(); |
1120 |
|
ph = new pamela::PscuHeader(); |
1121 |
|
de = new pamela::calorimeter::CalorimeterEvent(); |
1122 |
|
trk = new pamela::tracker::TrackerEvent(); |
1123 |
|
ne = new pamela::neutron::NeutronEvent(); |
1124 |
|
ace = new pamela::anticounter::AnticounterEvent(); |
1125 |
|
s4 = new pamela::S4::S4Event(); |
1126 |
|
tof = new pamela::tof::TofEvent(); |
1127 |
|
// |
1128 |
|
otr = new TChain("Physics"); |
1129 |
|
otr->Add(file->GetName(),-1); |
1130 |
otr->SetBranchAddress("Trigger", &trigger); |
otr->SetBranchAddress("Trigger", &trigger); |
1131 |
otr->SetBranchAddress("Header", &eh); |
otr->SetBranchAddress("Header", &eh); |
1132 |
}; |
}; |
|
if ( level.file == 2 ){ |
|
|
otr->AddFriend("OrbitalInfo", file); |
|
|
otr->SetBranchAddress("OrbitalInfo", &oinfoL2); |
|
|
runinfo->Read(0ULL); |
|
|
}; |
|
1133 |
// |
// |
1134 |
if ( var.TRK ) { |
if ( var.TRK ) { |
1135 |
if ( level.file == 0 || level.file == -1 ){ |
if ( level.file == 0 || level.file == -1 ){ |
1201 |
printf("Show the Time of Flight detector, LEVEL2 data \n"); |
printf("Show the Time of Flight detector, LEVEL2 data \n"); |
1202 |
}; |
}; |
1203 |
}; |
}; |
1204 |
|
// |
1205 |
|
if ( !otr ){ |
1206 |
|
return(0); |
1207 |
|
}; |
1208 |
|
// |
1209 |
|
return otr; |
1210 |
// |
// |
1211 |
} |
} |
1212 |
|
|
1282 |
text->DrawLatex(0.33,txthi,testo.str().c_str()); |
text->DrawLatex(0.33,txthi,testo.str().c_str()); |
1283 |
txthi -= 0.03; |
txthi -= 0.03; |
1284 |
testo2.str(""); |
testo2.str(""); |
1285 |
testo2 << "On Board Time: " << (int)OBT; |
testo2 << "On Board Time: " << (unsigned int)OBT; |
1286 |
if ( DOBT > 0 ) { |
if ( DOBT > 0 ) { |
1287 |
testo2 << " (delta: " << (int)DOBT; |
testo2 << " (delta: " << (unsigned int)DOBT; |
1288 |
testo2 << ")"; |
testo2 << ")"; |
1289 |
}; |
}; |
1290 |
testo2 << " [ms]"; |
testo2 << " [ms]"; |
1902 |
void FEVdetector::ShowTOF(){ |
void FEVdetector::ShowTOF(){ |
1903 |
// |
// |
1904 |
// |
// |
|
// |
|
1905 |
if ( !var.TOF ) return; |
if ( !var.TOF ) return; |
1906 |
// |
// |
1907 |
Int_t tt = 0; |
Int_t tt = 0; |
2607 |
ms11b[i] = 0.; |
ms11b[i] = 0.; |
2608 |
} else { |
} else { |
2609 |
ms11b[i] = 1.; |
ms11b[i] = 1.; |
2610 |
}; }; |
}; |
2611 |
|
}; |
2612 |
for ( Int_t i = 0; i<6; i++ ) { |
for ( Int_t i = 0; i<6; i++ ) { |
2613 |
mt12[0][i] = tof->tdc[ch12a[i]][hb12a[i]]; |
mt12[0][i] = tof->tdc[ch12a[i]][hb12a[i]]; |
2614 |
mt12[1][i] = tof->tdc[ch12b[i]][hb12b[i]]; |
mt12[1][i] = tof->tdc[ch12b[i]][hb12b[i]]; |
2702 |
// |
// |
2703 |
Bool_t repeat = true; |
Bool_t repeat = true; |
2704 |
Int_t numtr = 1; |
Int_t numtr = 1; |
2705 |
|
// Int_t numtr = 0; |
2706 |
Int_t repuntil = 0; |
Int_t repuntil = 0; |
2707 |
// |
// |
2708 |
// |
// |
2709 |
var.tofraw = 0; |
var.tofraw = 0; |
2710 |
// |
// |
2711 |
repuntil = L2->ToFLevel2::ntrk(); |
if ( level.file == 2 ) repuntil = L2->GetToFLevel2()->ntrk(); |
2712 |
// printf("repuntil = %i \n",repuntil); |
// printf("repuntil = %i \n",repuntil); |
2713 |
|
//if ( level.file == 2 ) repuntil = L2->GetTrkLevel2()->GetNTracks(); |
2714 |
//repuntil = L2->GetNTracks(); |
//repuntil = L2->GetNTracks(); |
2715 |
// |
// |
2716 |
while ( repeat ){ |
while ( repeat ){ |
2720 |
// |
// |
2721 |
// |
// |
2722 |
ToFTrkVar *ptt = 0; |
ToFTrkVar *ptt = 0; |
2723 |
|
// PamTrack *ptrack = 0; |
2724 |
|
Float_t adc[4][12]; |
2725 |
|
Float_t tdc[4][12]; |
2726 |
|
memset(adc,0,4*12*sizeof(Float_t)); |
2727 |
|
memset(tdc,0,4*12*sizeof(Float_t)); |
2728 |
// |
// |
2729 |
// |
// |
2730 |
|
// if ( repuntil == 0 || var.tofraw ){ |
2731 |
if ( repuntil == 1 || var.tofraw ){ |
if ( repuntil == 1 || var.tofraw ){ |
2732 |
numtr = 0; |
numtr = 0; |
2733 |
ptt = L2->GetToFTrkVar(0); |
ptt = L2->GetToFLevel2()->GetToFTrkVar(0); |
2734 |
repeat = false; |
repeat = false; |
2735 |
} else { |
} else { |
2736 |
// |
// |
2737 |
// |
// |
2738 |
if ( numtr >= repuntil-1 ) repeat = false; |
if ( numtr >= repuntil-1 ) repeat = false; |
2739 |
// |
// |
2740 |
ptt = L2->GetToFTrkVar(numtr); |
// printf(" numtr is %i \n",numtr); |
2741 |
|
ptt = L2->GetToFLevel2()->GetToFTrkVar(numtr); |
2742 |
|
//ptrack = L2->GetTrack(numtr); |
2743 |
|
//ptt = ptrack->GetToFTrack(); |
2744 |
}; |
}; |
2745 |
// |
// |
2746 |
xp11[0] = 0.; |
xp11[0] = 0.; |
2754 |
// |
// |
2755 |
ii = 2; |
ii = 2; |
2756 |
// |
// |
2757 |
Float_t adc[4][12]; |
Int_t myseq = ptt->trkseqno + 1; |
2758 |
Float_t tdc[4][12]; |
L2->GetToFLevel2()->GetMatrix(myseq,adc,tdc); |
2759 |
L2->GetMatrix(numtr,adc,tdc); |
// |
2760 |
|
// printf(" qua \n"); |
2761 |
// |
// |
2762 |
for ( Int_t i = 0; i<8; i++ ) { |
for ( Int_t i = 0; i<8; i++ ) { |
2763 |
if ( adc[ch11a[i]][hb11a[i]] < 1000. ){ |
if ( adc[ch11a[i]][hb11a[i]] < 1000. ){ |
3400 |
// full infos from ac |
// full infos from ac |
3401 |
// |
// |
3402 |
if ( level.file == 2 ){ |
if ( level.file == 2 ){ |
3403 |
hitmapA = L2->hitmap[0]; |
hitmapA = L2->GetAcLevel2()->hitmap[0]; |
3404 |
hitmapB = L2->hitmap[1]; |
hitmapB = L2->GetAcLevel2()->hitmap[1]; |
3405 |
hitstatusA = L2->hitstatus[0]; |
hitstatusA = L2->GetAcLevel2()->hitstatus[0]; |
3406 |
hitstatusB = L2->hitstatus[1]; |
hitstatusB = L2->GetAcLevel2()->hitstatus[1]; |
3407 |
}; |
}; |
3408 |
// |
// |
3409 |
// |
// |
4277 |
pcasp4b->Draw("f"); |
pcasp4b->Draw("f"); |
4278 |
pcasp4b->Draw(); |
pcasp4b->Draw(); |
4279 |
}; |
}; |
4280 |
Float_t alfa = 1.2020334; |
// Float_t alfax = 1.2020334; |
4281 |
|
Float_t alfax = 1.22157778; |
4282 |
|
Float_t alfay = 1.27393111; |
4283 |
Float_t lcrd = 0.1815/2.; |
Float_t lcrd = 0.1815/2.; |
4284 |
Float_t wcrd = 0.008; |
Float_t wcrd = 0.008; |
4285 |
if ( true ){ |
if ( true ){ |
4490 |
// |
// |
4491 |
// Float_t cardcx = 0.143168*var.sfx; |
// Float_t cardcx = 0.143168*var.sfx; |
4492 |
//Float_t cardcy = 0.1475*var.sfy; |
//Float_t cardcy = 0.1475*var.sfy; |
4493 |
Float_t cardcx = 0.153168*var.sfx; |
// |
4494 |
Float_t cardcy = 0.1575*var.sfy; |
// Float_t cardcx = 0.153168*var.sfx; |
4495 |
Float_t acrdx[4] = {-lcrd*cos(alfa), lcrd*cos(alfa), -lcrd*cos(alfa)+wcrd*sin(alfa), -lcrd*cos(alfa)}; |
// |
4496 |
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; |
4497 |
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; |
4498 |
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; |
4499 |
|
Float_t acrdx[4] = {-lcrd*cos(alfax), lcrd*cos(alfax), -lcrd*cos(alfax)+wcrd*sin(alfax), -lcrd*cos(alfax)}; |
4500 |
|
Float_t acrdy[4] = {-lcrd*sin(alfax), lcrd*sin(alfax), -lcrd*sin(alfax)-wcrd*cos(alfax), -lcrd*sin(alfax)}; |
4501 |
|
Float_t bcrdx[4] = { lcrd*cos(alfax), lcrd*cos(alfax)+wcrd*sin(alfax), -lcrd*cos(alfax)+wcrd*sin(alfax), lcrd*cos(alfax)}; |
4502 |
|
Float_t bcrdy[4] = { lcrd*sin(alfax), lcrd*sin(alfax)-wcrd*cos(alfax), -lcrd*sin(alfax)-wcrd*cos(alfax), lcrd*sin(alfax)}; |
4503 |
|
|
4504 |
// |
// |
4505 |
// CARD3 X/ Y |
// CARD3 X/ Y |
4559 |
}; |
}; |
4560 |
|
|
4561 |
if ( true ){ |
if ( true ){ |
4562 |
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)}; |
4563 |
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)}; |
4564 |
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)}; |
4565 |
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)}; |
4566 |
// |
// |
4567 |
// CARD - Y-view |
// CARD - Y-view |
4568 |
// |
// |
4569 |
Float_t cardcx = 0.12*var.sfx; |
// Float_t cardcx = 0.12*var.sfx; |
4570 |
Float_t cardcy = 0.1475*var.sfy; |
Float_t cardcx = (0.16014*(1.-lcrd*cos(alfay)))*var.sfx; |
4571 |
|
// Float_t cardcy = 0.178818*var.sfy; |
4572 |
|
Float_t cardcy = (0.178818*(1.-lcrd*sin(alfay)))*var.sfy; |
4573 |
|
// Float_t cardcy = 0.1475*var.sfy; |
4574 |
// |
// |
4575 |
// CARD4 X Y/ |
// CARD4 X Y/ |
4576 |
// |
// |
4669 |
// |
// |
4670 |
if ( level.file == 2 ){ |
if ( level.file == 2 ){ |
4671 |
for ( Int_t j = 0; j<3; j++ ) { |
for ( Int_t j = 0; j<3; j++ ) { |
4672 |
if ( L2->S4adc != 32. ) ms4[j] = L2->S4calibrated; |
if ( L2->GetS4Level2()->S4adc != 32. ) ms4[j] = L2->GetS4Level2()->S4calibrated; |
4673 |
}; |
}; |
4674 |
}; |
}; |
4675 |
// |
// |
4754 |
}; |
}; |
4755 |
}; |
}; |
4756 |
if ( level.file == 2 ){ |
if ( level.file == 2 ){ |
4757 |
yUpperTrig = (Int_t)L2->trigPhysics; |
yUpperTrig = (Int_t)L2->GetNDLevel2()->trigPhysics; |
4758 |
yUpperBk = (Int_t)L2->upperBack; |
yUpperBk = (Int_t)L2->GetNDLevel2()->upperBack; |
4759 |
yBottomBk = (Int_t)L2->bottomBack; |
yBottomBk = (Int_t)L2->GetNDLevel2()->bottomBack; |
4760 |
}; |
}; |
4761 |
// |
// |
4762 |
var.trup = yUpperTrig; |
var.trup = yUpperTrig; |
5063 |
// |
// |
5064 |
// singlets X |
// singlets X |
5065 |
// |
// |
5066 |
for (Int_t sing = 0; sing < L2->nclsx(); sing++){ |
for (Int_t sing = 0; sing < L2->GetTrkLevel2()->nclsx(); sing++){ |
5067 |
TClonesArray &t = *(L2->SingletX); |
TClonesArray &t = *(L2->GetTrkLevel2()->SingletX); |
5068 |
TrkSinglet *singlet = (TrkSinglet*)t[sing]; |
TrkSinglet *singlet = (TrkSinglet*)t[sing]; |
5069 |
x = (singlet->coord[0]+singlet->coord[1])/2.; |
x = (singlet->coord[0]+singlet->coord[1])/2.; |
5070 |
// |
// |
5088 |
// |
// |
5089 |
// singlets Y |
// singlets Y |
5090 |
// |
// |
5091 |
for (Int_t sing = 0; sing < L2->nclsy(); sing++){ |
for (Int_t sing = 0; sing < L2->GetTrkLevel2()->nclsy(); sing++){ |
5092 |
TClonesArray &t = *(L2->SingletY); |
TClonesArray &t = *(L2->GetTrkLevel2()->SingletY); |
5093 |
TrkSinglet *singlet = (TrkSinglet*)t[sing]; |
TrkSinglet *singlet = (TrkSinglet*)t[sing]; |
5094 |
// |
// |
5095 |
Int_t planepad = (singlet->plane - 1)* 2; |
Int_t planepad = (singlet->plane - 1)* 2; |
5134 |
dcol = 2; |
dcol = 2; |
5135 |
}; |
}; |
5136 |
// |
// |
5137 |
if ( L2->GetNTracks() > 0 ){ |
if ( L2->GetTrkLevel2()->GetNTracks() > 0 ){ |
5138 |
for (Int_t nt = 0; nt < L2->GetNTracks(); nt++){ |
for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ |
5139 |
TrkTrack *track = L2->GetTrack(nt); |
PamTrack *ptrack= L2->GetTrack(nt); |
5140 |
|
TrkTrack *track = ptrack->GetTrkTrack(); |
5141 |
if ( nt == 0 ){ |
if ( nt == 0 ){ |
5142 |
var.rig = 0.; |
var.rig = 0.; |
5143 |
if ( track->al[4] != 0. ) var.rig = 1./track->al[4]; |
if ( track->al[4] != 0. ) var.rig = 1./track->al[4]; |
5233 |
// |
// |
5234 |
// first of all plot crosses relatives to tracks |
// first of all plot crosses relatives to tracks |
5235 |
// |
// |
5236 |
if ( L2->GetNTracks() > 0 ){ |
if ( L2->GetTrkLevel2()->GetNTracks() > 0 ){ |
5237 |
for (Int_t nt = 0; nt < L2->GetNTracks(); nt++){ |
// for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ |
5238 |
TrkTrack *track = L2->GetTrack(nt); |
// TrkTrack *track = L2->GetTrkLevel2()->GetTrack(nt); |
5239 |
|
for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ |
5240 |
|
PamTrack *ptrack= L2->GetTrack(nt); |
5241 |
|
TrkTrack *track = ptrack->GetTrkTrack(); |
5242 |
|
// |
5243 |
for (Int_t plane = 0; plane<6; plane++){ |
for (Int_t plane = 0; plane<6; plane++){ |
5244 |
// |
// |
5245 |
x = track->xm[plane]; |
x = track->xm[plane]; |
5285 |
// |
// |
5286 |
// try to plot crosses relative to singlets |
// try to plot crosses relative to singlets |
5287 |
// |
// |
5288 |
if ( L2->nclsx() > 0 && L2->nclsy() > 0 ){ |
if ( L2->GetTrkLevel2()->nclsx() > 0 && L2->GetTrkLevel2()->nclsy() > 0 ){ |
5289 |
for (Int_t plane = 1; plane<7; plane++){ |
for (Int_t plane = 1; plane<7; plane++){ |
5290 |
// |
// |
5291 |
// count how many singlet in the x and y view for this plane: |
// count how many singlet in the x and y view for this plane: |
5299 |
TArrayF *array2 = new TArrayF(5000); |
TArrayF *array2 = new TArrayF(5000); |
5300 |
TArrayF *sigarrax = new TArrayF(5000); |
TArrayF *sigarrax = new TArrayF(5000); |
5301 |
TArrayF *sigarray = new TArrayF(5000); |
TArrayF *sigarray = new TArrayF(5000); |
5302 |
for (Int_t sing = 0; sing < L2->nclsx(); sing++){ |
for (Int_t sing = 0; sing < L2->GetTrkLevel2()->nclsx(); sing++){ |
5303 |
TClonesArray &t = *(L2->SingletX); |
TClonesArray &t = *(L2->GetTrkLevel2()->SingletX); |
5304 |
TrkSinglet *singlet = (TrkSinglet*)t[sing]; |
TrkSinglet *singlet = (TrkSinglet*)t[sing]; |
5305 |
if ( singlet->plane == plane ){ |
if ( singlet->plane == plane ){ |
5306 |
arrax->AddAt(((singlet->coord[0]+singlet->coord[1])/2.),totsx); |
arrax->AddAt(((singlet->coord[0]+singlet->coord[1])/2.),totsx); |
5329 |
totsx++; |
totsx++; |
5330 |
}; |
}; |
5331 |
}; |
}; |
5332 |
for (Int_t sing = 0; sing < L2->nclsy(); sing++){ |
for (Int_t sing = 0; sing < L2->GetTrkLevel2()->nclsy(); sing++){ |
5333 |
TClonesArray &t = *(L2->SingletY); |
TClonesArray &t = *(L2->GetTrkLevel2()->SingletY); |
5334 |
TrkSinglet *singlet = (TrkSinglet*)t[sing]; |
TrkSinglet *singlet = (TrkSinglet*)t[sing]; |
5335 |
if ( singlet->plane == plane ){ |
if ( singlet->plane == plane ){ |
5336 |
array1->AddAt(singlet->coord[0],totsy); |
array1->AddAt(singlet->coord[0],totsy); |
5555 |
// |
// |
5556 |
// |
// |
5557 |
// |
// |
5558 |
|
if ( var.CALO && var.CALOT ){ |
5559 |
|
if ( L2->GetCaloLevel2()->npcfit[0] > 0 && L2->GetCaloLevel2()->npcfit[1] > 0 ){ |
5560 |
|
Float_t calx[22]; |
5561 |
|
Float_t caly[22]; |
5562 |
|
Float_t calzx[22]; |
5563 |
|
Float_t calzy[22]; |
5564 |
|
Float_t zpiano[22]; |
5565 |
|
zpiano[0] = (CTZ+118.)*var.sfy/1000.; |
5566 |
|
for (Int_t plane = 1; plane < 22; plane++){ |
5567 |
|
if ( !(plane%2) ){ |
5568 |
|
zpiano[plane] = zpiano[plane-1] - 8.09*var.sfy/1000.; |
5569 |
|
}else { |
5570 |
|
zpiano[plane] = zpiano[plane-1] - 10.09*var.sfy/1000.; |
5571 |
|
}; |
5572 |
|
}; |
5573 |
|
for (Int_t plane = 0; plane < 22; plane++){ |
5574 |
|
calx[plane] = (L2->GetCaloLevel2()->cbar[plane][0]/100.)*var.sfx + var.xxvc;; |
5575 |
|
caly[plane] = (L2->GetCaloLevel2()->cbar[plane][1]/100.)*var.sfx + var.xyvc; |
5576 |
|
// calzx[plane] = zpiano[plane] -5.81*var.sfy/1000. + var.yxvc; |
5577 |
|
calzx[plane] = zpiano[plane] + var.yxvc; |
5578 |
|
calzy[plane] = zpiano[plane] + var.yyvc; |
5579 |
|
// printf(" calx %f caly %f calzx %f calzy %f \n",calx[plane],caly[plane],calzx[plane],calzy[plane]); |
5580 |
|
}; |
5581 |
|
// |
5582 |
|
// Calorimeter track |
5583 |
|
// |
5584 |
|
Int_t trcol = 30; |
5585 |
|
if ( var.bw ){ |
5586 |
|
trcol = 14; |
5587 |
|
} else { |
5588 |
|
trcol = 44; |
5589 |
|
}; |
5590 |
|
thefigure->cd(); |
5591 |
|
TPolyLine *trakx = new TPolyLine(22,calx,calzx); |
5592 |
|
trakx->SetLineColor(trcol); |
5593 |
|
if ( L2->GetCaloLevel2()->fitmode[0] == 1 ) trakx->SetLineStyle(3); |
5594 |
|
if ( L2->GetCaloLevel2()->fitmode[0] == 2 ) trakx->SetLineStyle(4); |
5595 |
|
trakx->SetLineWidth(2); |
5596 |
|
trakx->Draw(); |
5597 |
|
TPolyLine *traky = new TPolyLine(22,caly,calzy); |
5598 |
|
traky->SetLineColor(trcol); |
5599 |
|
if ( L2->GetCaloLevel2()->fitmode[1] == 1 ) traky->SetLineStyle(3); |
5600 |
|
if ( L2->GetCaloLevel2()->fitmode[1] == 2 ) traky->SetLineStyle(4); |
5601 |
|
traky->SetLineWidth(2); |
5602 |
|
traky->Draw(); |
5603 |
|
}; |
5604 |
|
if ( L2->GetCaloLevel2()->npcfit[2] > 0 ){ |
5605 |
|
Float_t calx[22]; |
5606 |
|
Float_t caly[22]; |
5607 |
|
Float_t calzx[22]; |
5608 |
|
Float_t calzy[22]; |
5609 |
|
Float_t zpiano[22]; |
5610 |
|
zpiano[0] = (CTZ+118.)*var.sfy/1000.; |
5611 |
|
for (Int_t plane = 1; plane < 22; plane++){ |
5612 |
|
if ( !(plane%2) ){ |
5613 |
|
zpiano[plane] = zpiano[plane-1] - 8.09*var.sfy/1000.; |
5614 |
|
}else { |
5615 |
|
zpiano[plane] = zpiano[plane-1] - 10.09*var.sfy/1000.; |
5616 |
|
}; |
5617 |
|
}; |
5618 |
|
// |
5619 |
|
// |
5620 |
|
CaloTrkVar *ctra = L2->GetCaloStoredTrack(-1); |
5621 |
|
// |
5622 |
|
for (Int_t plane = 0; plane < 22; plane++){ |
5623 |
|
calx[plane] = (ctra->tbar[plane][0]/100.)*var.sfx + var.xxvc;; |
5624 |
|
caly[plane] = (ctra->tbar[plane][1]/100.)*var.sfx + var.xyvc; |
5625 |
|
// calzx[plane] = zpiano[plane] -5.81*var.sfy/1000. + var.yxvc; |
5626 |
|
calzx[plane] = zpiano[plane] + var.yxvc; |
5627 |
|
calzy[plane] = zpiano[plane] + var.yyvc; |
5628 |
|
// printf(" calx %f caly %f calzx %f calzy %f \n",calx[plane],caly[plane],calzx[plane],calzy[plane]); |
5629 |
|
}; |
5630 |
|
// |
5631 |
|
// Calorimeter track |
5632 |
|
// |
5633 |
|
Int_t trcol = 30; |
5634 |
|
if ( var.bw ){ |
5635 |
|
trcol = 16; |
5636 |
|
} else { |
5637 |
|
trcol = 46; |
5638 |
|
}; |
5639 |
|
thefigure->cd(); |
5640 |
|
TPolyLine *trakx = new TPolyLine(22,calx,calzx); |
5641 |
|
trakx->SetLineColor(trcol); |
5642 |
|
trakx->SetLineStyle(3); |
5643 |
|
trakx->SetLineWidth(2); |
5644 |
|
trakx->Draw(); |
5645 |
|
TPolyLine *traky = new TPolyLine(22,caly,calzy); |
5646 |
|
traky->SetLineColor(trcol); |
5647 |
|
traky->SetLineStyle(3); |
5648 |
|
traky->SetLineWidth(2); |
5649 |
|
traky->Draw(); |
5650 |
|
}; |
5651 |
|
}; |
5652 |
|
// |
5653 |
if ( !var.TRK || level.file != 2 ) return; |
if ( !var.TRK || level.file != 2 ) return; |
5654 |
// |
// |
5655 |
if ( L2->GetNTracks() > 0 ){ |
if ( L2->GetTrkLevel2()->GetNTracks() > 0 ){ |
5656 |
for (Int_t nt = 0; nt < L2->GetNTracks(); nt++){ |
for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ |
5657 |
TrkTrack *track = L2->GetTrack(nt); |
|
5658 |
|
// TrkTrack *track = L2->GetTrkLevel2()->GetTrack(nt); |
5659 |
|
PamTrack *ptrack = L2->GetTrack(nt); |
5660 |
|
TrkTrack *track = ptrack->GetTrkTrack(); |
5661 |
Int_t npoint = 100; |
Int_t npoint = 100; |
5662 |
Float_t zin[100]; |
Float_t zin[100]; |
5663 |
Double_t xout[100]; |
Double_t xout[100]; |
5727 |
}; |
}; |
5728 |
tzx[e] = (0.112)*var.sfy+((float)zin[e]/100.)*var.sfy + var.yxvc; |
tzx[e] = (0.112)*var.sfy+((float)zin[e]/100.)*var.sfy + var.yxvc; |
5729 |
tzy[e] = (0.112)*var.sfy+((float)zin[e]/100.)*var.sfy + var.yyvc; |
tzy[e] = (0.112)*var.sfy+((float)zin[e]/100.)*var.sfy + var.yyvc; |
5730 |
|
// printf("tx[e] %f ty [e] %f tzx %f tzy %f \n",tx[e],ty[e],tzx[e],tzy[e]); |
5731 |
}; |
}; |
5732 |
// |
// |
5733 |
// From S1 to CALO |
// From S1 to CALO |
5981 |
// |
// |
5982 |
// Define variables |
// Define variables |
5983 |
// |
// |
5984 |
Int_t etime = var.etime; |
UInt_t etime = var.etime; |
5985 |
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]; |
5986 |
Int_t badstrip = 0; |
Int_t badstrip = 0; |
5987 |
qtot = 0.; |
qtot = 0.; |
6053 |
if ( calib.ttime[s][b[s]+1] && calib.time[s][b[s]] ){ |
if ( calib.ttime[s][b[s]+1] && calib.time[s][b[s]] ){ |
6054 |
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 ){ |
6055 |
printf(" CALORIMETER: \n" ); |
printf(" CALORIMETER: \n" ); |
6056 |
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]); |
6057 |
printf(" END CALORIMETER. \n\n" ); |
printf(" END CALORIMETER. \n\n" ); |
6058 |
b[s]++; |
b[s]++; |
6059 |
CaloPede(s); |
CaloPede(s); |
6277 |
// |
// |
6278 |
stringstream xvev; |
stringstream xvev; |
6279 |
stringstream yvev; |
stringstream yvev; |
6280 |
for (Int_t ii = 0; ii < L2->nstrip; ii++){ |
for (Int_t ii = 0; ii < L2->GetCaloLevel2()->nstrip; ii++){ |
6281 |
Int_t colo; |
Int_t colo; |
6282 |
Int_t l; |
Int_t l; |
6283 |
Int_t m; |
Int_t m; |
6284 |
Int_t n; |
Int_t n; |
6285 |
Float_t mip = L2->DecodeEstrip(ii,l,m,n); |
Float_t mip = L2->GetCaloLevel1()->DecodeEstrip(ii,l,m,n); |
6286 |
if ( var.bw ){ |
if ( var.bw ){ |
6287 |
colo = -1; |
colo = -1; |
6288 |
} else { |
} else { |
6316 |
}; |
}; |
6317 |
pd1->Update(); |
pd1->Update(); |
6318 |
pd2->Update(); |
pd2->Update(); |
6319 |
var.qtot=(int)L2->qtot; |
var.qtot=(int)L2->GetCaloLevel2()->qtot; |
6320 |
var.nstrip=(int)L2->nstrip; |
var.nstrip=(int)L2->GetCaloLevel2()->nstrip; |
6321 |
}; |
}; |
6322 |
} |
} |
6323 |
|
|
6358 |
for (Int_t d = 0; d<48; d++){ |
for (Int_t d = 0; d<48; d++){ |
6359 |
if ( calib.ttime[s][d] != 0 ) calibex++; |
if ( calib.ttime[s][d] != 0 ) calibex++; |
6360 |
if ( calib.time[s][0] != 0 ){ |
if ( calib.time[s][0] != 0 ){ |
6361 |
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]); |
6362 |
if ( calib.time[s][d+1] != 0 ) { |
if ( calib.time[s][d+1] != 0 ) { |
6363 |
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]); |
6364 |
} else { |
} else { |
6365 |
if ( !stop ){ |
if ( !stop ){ |
6366 |
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]); |
6367 |
stop = 1; |
stop = 1; |
6368 |
}; |
}; |
6369 |
}; |
}; |
6370 |
} else { |
} else { |
6371 |
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]); |
6372 |
}; |
}; |
6373 |
}; |
}; |
6374 |
printf("\n"); |
printf("\n"); |
6433 |
calib.ttime[s][inter] = 0; |
calib.ttime[s][inter] = 0; |
6434 |
if ( ce->cstwerr[s] != 0 && ce->cperror[s] == 0 ) { |
if ( ce->cstwerr[s] != 0 && ce->cperror[s] == 0 ) { |
6435 |
//calib.ttime[s][inter] = cph->GetOrbitalTime(); |
//calib.ttime[s][inter] = cph->GetOrbitalTime(); |
6436 |
calib.ttime[s][inter] = cph->OrbitalTime; |
calib.ttime[s][inter] = (UInt_t)cph->OrbitalTime; |
6437 |
inter++; |
inter++; |
6438 |
} else { |
} else { |
6439 |
if ( ce->cstwerr[s] != 0 && ce->cperror[s] != 0 ) { |
if ( ce->cstwerr[s] != 0 && ce->cperror[s] != 0 ) { |
6487 |
tr->GetEntry(ci); |
tr->GetEntry(ci); |
6488 |
cph = ceh->GetPscuHeader(); |
cph = ceh->GetPscuHeader(); |
6489 |
//if ( atime == cph->GetOrbitalTime()){ |
//if ( atime == cph->GetOrbitalTime()){ |
6490 |
if ( atime == cph->OrbitalTime){ |
if ( atime == (UInt_t)cph->OrbitalTime){ |
6491 |
// calib.iev = ce->iev; |
// calib.iev = ce->iev; |
6492 |
if (ce->cstwerr[s] != 0 && ce->cperror[s] == 0 ) { |
if (ce->cstwerr[s] != 0 && ce->cperror[s] == 0 ) { |
6493 |
for ( Int_t d=0 ; d<11 ;d++ ){ |
for ( Int_t d=0 ; d<11 ;d++ ){ |