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); |
// |
138 |
|
if ( level.file == 2 ){ |
139 |
|
// printf("0qui\n"); |
140 |
|
L2->GetEntry(minevent); |
141 |
|
} else { |
142 |
|
otr->GetEntry(minevent); |
143 |
|
} |
144 |
if ( level.file < 2 ){ |
if ( level.file < 2 ){ |
145 |
ph = eh->GetPscuHeader(); |
ph = eh->GetPscuHeader(); |
146 |
lastevno = (int)ph->Counter; |
firstevno = (int)ph->Counter; |
147 |
} else { |
} else { |
148 |
lastevno = L2->GetOrbitalInfo()->pkt_num; // to be changed as soon as we will have pkt_counter in the level2 file! |
if ( var.ORB ){ |
149 |
|
firstevno = L2->GetOrbitalInfo()->pkt_num; |
150 |
|
} else { |
151 |
|
firstevno = 0; |
152 |
|
}; |
153 |
}; |
}; |
154 |
otr->GetEntry(minevent); |
// |
155 |
|
if ( level.file == 2 ){ |
156 |
|
// printf("1qui\n"); |
157 |
|
L2->GetEntry(maxevent); |
158 |
|
} else { |
159 |
|
otr->GetEntry(maxevent); |
160 |
|
} |
161 |
|
// |
162 |
if ( level.file < 2 ){ |
if ( level.file < 2 ){ |
163 |
ph = eh->GetPscuHeader(); |
ph = eh->GetPscuHeader(); |
164 |
firstevno = (int)ph->Counter; |
lastevno = (int)ph->Counter; |
165 |
} else { |
} else { |
166 |
firstevno = L2->GetOrbitalInfo()->pkt_num; // to be changed as soon as we will have pkt_counter in the level2 file! |
if ( var.ORB ){ |
167 |
|
lastevno = L2->GetOrbitalInfo()->pkt_num; |
168 |
|
} else { |
169 |
|
lastevno = 0; |
170 |
|
}; |
171 |
}; |
}; |
172 |
|
// |
173 |
} |
} |
174 |
|
|
175 |
void FEVdetector::ClearVariables(){ |
void FEVdetector::ClearVariables(){ |
192 |
} |
} |
193 |
|
|
194 |
void FEVdetector::GetEntry(Int_t i){ |
void FEVdetector::GetEntry(Int_t i){ |
195 |
thisentry = i; |
thisentry = i; |
196 |
otr->GetEntry(i); |
if ( level.file == 2 ){ |
197 |
|
L2->Clear(); |
198 |
|
// printf("qui\n"); |
199 |
|
L2->GetEntry(i); |
200 |
|
ShowInfo("RunInfo"); |
201 |
|
ShowInfo("SoftInfo"); |
202 |
|
ShowInfo("OrbitalInfo"); |
203 |
|
ShowInfo("TrigLevel2"); |
204 |
|
ShowInfo("ToFLevel2"); |
205 |
|
ShowInfo("TrkLevel2"); |
206 |
|
ShowInfo("AcLevel2"); |
207 |
|
ShowInfo("CaloLevel2"); |
208 |
|
ShowInfo("CaloLevel1"); |
209 |
|
ShowInfo("S4Level2"); |
210 |
|
ShowInfo("NDLevel2"); |
211 |
|
} else { |
212 |
|
otr->GetEntry(i); |
213 |
|
ShowInfo("Pscu"); |
214 |
|
ShowInfo("Trigger"); |
215 |
|
ShowInfo("Tof"); |
216 |
|
ShowInfo("Tracker"); |
217 |
|
ShowInfo("Anticounter"); |
218 |
|
ShowInfo("Calorimeter"); |
219 |
|
ShowInfo("Neutron"); |
220 |
|
ShowInfo("S4"); |
221 |
|
}; |
222 |
} |
} |
223 |
|
|
224 |
void FEVdetector::SetEntry(Int_t i){ |
void FEVdetector::SetEntry(Int_t i){ |
339 |
}; |
}; |
340 |
} |
} |
341 |
|
|
342 |
|
void FEVdetector::ShowInfo(TString detector){ |
343 |
|
// |
344 |
|
TBranch *b1 = 0; |
345 |
|
// TBranch *b3 = 0; |
346 |
|
TObjArray *branch_array = 0; |
347 |
|
// TObjArray *leaf_array = 0; |
348 |
|
// |
349 |
|
if ( !strcmp(detector.Data(),"RunInfo") || !strcmp(detector.Data(),"SoftInfo") ){ |
350 |
|
if ( L2->GetRunTree() ) b1 = L2->GetRunTree()->FindBranch(detector.Data()); |
351 |
|
} else { |
352 |
|
b1 = otr->FindBranch(detector.Data()); |
353 |
|
}; |
354 |
|
// |
355 |
|
if ( !b1 ) return; |
356 |
|
// |
357 |
|
Int_t dlen = 10; |
358 |
|
// |
359 |
|
char o[200000]; |
360 |
|
char col[13]; |
361 |
|
char col2[13]; |
362 |
|
// |
363 |
|
setcolor(col,RESET, GREEN, WHITE); |
364 |
|
sprintf(o,"%s======> EVENT:%i\n",col, thisentry); |
365 |
|
// |
366 |
|
setcolor(col,RESET, RED, WHITE); |
367 |
|
sprintf(o,"%s%sBranch %s\n",o,col,b1->GetName()); |
368 |
|
setcolor(col,RESET, BLACK, WHITE); |
369 |
|
sprintf(o,"%s%s",o,col); |
370 |
|
// |
371 |
|
branch_array = b1->GetListOfBranches(); |
372 |
|
// |
373 |
|
Int_t j = 0; |
374 |
|
// |
375 |
|
for(Int_t l=0;l<(branch_array->GetLast()+1);l++){ |
376 |
|
// |
377 |
|
TBranchElement *tb = (TBranchElement*)branch_array->At(l); |
378 |
|
Int_t type = tb->GetType(); |
379 |
|
Int_t atype = tb->GetStreamerType() - 20; |
380 |
|
Int_t len = (tb->GetInfo()->GetLengths())[tb->GetID()]; |
381 |
|
Int_t length = min(len,dlen); |
382 |
|
// |
383 |
|
// printf("Branches : type is %i type is %i tb getname %s slen %i slength %i\n",atype,type,tb->GetName(),len,length); |
384 |
|
switch (type){ |
385 |
|
case 0: |
386 |
|
// |
387 |
|
// IS A VARIABLE |
388 |
|
// |
389 |
|
// |
390 |
|
// NAME |
391 |
|
// |
392 |
|
setcolor(col,RESET, BLUE, WHITE); |
393 |
|
setcolor(col2,RESET, BLACK, WHITE); |
394 |
|
sprintf(o,"%s%s %-15s%s =",o,col,((TBranch*)branch_array->At(l))->GetName(),col2); |
395 |
|
// |
396 |
|
j = 0; |
397 |
|
// |
398 |
|
// VALUES |
399 |
|
// |
400 |
|
// |
401 |
|
// Integer |
402 |
|
// |
403 |
|
if ( atype == 3 || atype == -17 ){ |
404 |
|
while ( j < length ){ |
405 |
|
if ( j < length -1 ){ |
406 |
|
sprintf(o,"%s %i ,",o,(Int_t)tb->GetValue(j,0)); |
407 |
|
} else { |
408 |
|
sprintf(o,"%s %i",o,(Int_t)tb->GetValue(j,0)); |
409 |
|
}; |
410 |
|
j++; |
411 |
|
}; |
412 |
|
}; |
413 |
|
// |
414 |
|
// Unsigned integer |
415 |
|
// |
416 |
|
if ( atype == -7 || atype == 13 || atype == -9 || atype == -8 || atype == 12 ){ |
417 |
|
while ( j < length ){ |
418 |
|
if ( j < length -1 ){ |
419 |
|
sprintf(o,"%s %u ,",o,(UInt_t)tb->GetValue(j,0)); |
420 |
|
} else { |
421 |
|
sprintf(o,"%s %u",o,(UInt_t)tb->GetValue(j,0)); |
422 |
|
}; |
423 |
|
j++; |
424 |
|
}; |
425 |
|
}; |
426 |
|
// |
427 |
|
// Float |
428 |
|
// |
429 |
|
if ( atype == -15 || atype == 5 ){ |
430 |
|
while ( j < length ){ |
431 |
|
if ( j < length -1 ){ |
432 |
|
sprintf(o,"%s %f ,",o,tb->GetValue(j,0)); |
433 |
|
} else { |
434 |
|
sprintf(o,"%s %f",o,tb->GetValue(j,0)); |
435 |
|
}; |
436 |
|
j++; |
437 |
|
}; |
438 |
|
}; |
439 |
|
// |
440 |
|
// Strings |
441 |
|
// |
442 |
|
if ( atype == 45 ){ |
443 |
|
// TObjArray *cl = (TObjArray*)(tb->GetInfo()->GetOffsets())[tb->GetID()];//tb->GetValuePointer(); |
444 |
|
// TString *stringa = (TString*)(*cl)[0]; |
445 |
|
// TBranchElement *utb = (TBranchElement*)tb->GetBranchCount(); |
446 |
|
// TString** stringa = (TString*)(&tb->GetValuePointer()); |
447 |
|
//TStreamerElement *tste = (TStreamerElement*)tb->GetInfo()->GetCurrentElement(); |
448 |
|
|
449 |
|
// char *ladd; |
450 |
|
// ladd = tb->GetValuePointer() |
451 |
|
// TString *stringa = (TString*)((tste->GetOffset())); |
452 |
|
// TString& mstr = *stringa; |
453 |
|
// printf(" la mia stringa %s \n",mstr.Data()); |
454 |
|
// printf(" offset %i \n",(Int_t)utb->GetValue(0,0)); |
455 |
|
// int pointer = (tb->GetInfo()->GetOffsets())[tb->GetID()]; |
456 |
|
// TString *stringa = (TString*)(tb->GetInfo()->GetOffsets())[tb->GetID()]; |
457 |
|
// TString *stringa = (TString*)tb->GetAddress(); |
458 |
|
// printf(" address 0x%X \n",tb->GetAddress()); |
459 |
|
// printf(" pointer 0x%X \n",tb->GetValuePointer()); |
460 |
|
// printf(" object 0x%X \n",tb->GetObject()); |
461 |
|
// printf("stringa %s lung %i\n",stringa.Data(),stringa.Length()); |
462 |
|
// TLeaf *striglia = tb->FindLeaf(tb->GetName()); |
463 |
|
// if ( striglia ){ |
464 |
|
// char *pointer = (char *)striglia->GetValuePointer(); |
465 |
|
// TString *pr= (TString*)pointer; |
466 |
|
// printf("ciao %s \n",pr->Data()); |
467 |
|
// }; |
468 |
|
sprintf(o,"%s TString - not implemented yet -",o); |
469 |
|
}; |
470 |
|
// |
471 |
|
// TArray |
472 |
|
// |
473 |
|
if ( atype == 42 ){ |
474 |
|
// |
475 |
|
// TObjArray *cl = (TObjArray*)tb->GetObject(); |
476 |
|
// // |
477 |
|
// TClass *myc = cl->IsA(); |
478 |
|
// // |
479 |
|
// printf("qui \n"); |
480 |
|
// // |
481 |
|
// // determine offset to fetch data |
482 |
|
// // |
483 |
|
// int thisoffset = 0; |
484 |
|
// TRealData *rd = myc->GetRealData(tb->GetName()); |
485 |
|
// if ( rd ){ |
486 |
|
// thisoffset = rd->GetThisOffset(); |
487 |
|
// }; |
488 |
|
// Int_t niente = 0; |
489 |
|
// TStreamerElement *tste = tb->GetInfo()->GetStreamerElement(rd->GetName(),niente); |
490 |
|
// printf(" typename %s \n",tste->GetTypeName()); |
491 |
|
// // |
492 |
|
// // TArrayI |
493 |
|
// // |
494 |
|
// if ( !strcmp(tste->GetTypeName(),"TArrayI") ){ |
495 |
|
// // |
496 |
|
// printf("qua \n"); |
497 |
|
// char *pointer = (char*)cl->At(0); |
498 |
|
// // char *pu = thisoffset + pointer; |
499 |
|
// int pu = (int)tste->GetTObjectOffset(); |
500 |
|
// TArrayI arr = (TArrayI)*pu; |
501 |
|
// // TArrayI arr = (TArrayI)(thisoffset); |
502 |
|
// //TArrayI *arr = (TArrayI*)pu; |
503 |
|
// //TArraI arr = (TArrayI) |
504 |
|
// Int_t jj=0; |
505 |
|
// j=0; |
506 |
|
// printf("quii \n"); |
507 |
|
// Int_t arlen = min(arr.GetSize(),dlen); |
508 |
|
// // |
509 |
|
// printf("que \n"); |
510 |
|
// setcolor(col,RESET, BLUE, WHITE); |
511 |
|
// setcolor(col2,RESET, BLACK, WHITE); |
512 |
|
// sprintf(o,"%s%s %s[%i]%s = ",o,col,tb->GetName(),arr.GetSize(),col2); |
513 |
|
// // |
514 |
|
// // while ( j < tb->GetNdata() ){ |
515 |
|
// // |
516 |
|
// printf("quo \n"); |
517 |
|
// // pointer = (char*)cl->UncheckedAt(j); |
518 |
|
// // pu = pointer + thisoffset; |
519 |
|
// // arr = (TArrayI*)(thisoffset); |
520 |
|
// // |
521 |
|
// while ( jj < arlen ){ |
522 |
|
// if ( jj < arlen-1 ){ |
523 |
|
// sprintf(o,"%s %i ,",o,arr.At(jj)); |
524 |
|
// } else { |
525 |
|
// sprintf(o,"%s %i",o,arr.At(jj)); |
526 |
|
// }; |
527 |
|
// jj++; |
528 |
|
// }; |
529 |
|
// // if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); |
530 |
|
// // j++; |
531 |
|
// // }; |
532 |
|
// }; |
533 |
|
// // |
534 |
|
// // TArrayF |
535 |
|
// // |
536 |
|
// if ( !strcmp(tste->GetTypeName(),"TArrayF") ){ |
537 |
|
// // |
538 |
|
// char *pointer = (char*)cl->UncheckedAt(0); |
539 |
|
// char *pu = pointer + thisoffset; |
540 |
|
// TArrayF *arr = (TArrayF*)(pu); |
541 |
|
// Int_t jj=0; |
542 |
|
// Int_t arlen = min(arr->GetSize(),dlen); |
543 |
|
// // |
544 |
|
// setcolor(col,RESET, BLUE, WHITE); |
545 |
|
// setcolor(col2,RESET, BLACK, WHITE); |
546 |
|
// sprintf(o,"%s%s %s[%i]%s = ",o,col,tb->GetName(),arr->GetSize(),col2); |
547 |
|
// // |
548 |
|
// while ( j < tb->GetNdata() ){ |
549 |
|
// // |
550 |
|
// pointer = (char*)cl->UncheckedAt(j); |
551 |
|
// pu = pointer + thisoffset; |
552 |
|
// arr = (TArrayF*)(pu); |
553 |
|
// // |
554 |
|
// while ( jj < arlen ){ |
555 |
|
// if ( jj < arlen-1 ){ |
556 |
|
// sprintf(o,"%s %f ,",o,arr->At(jj)); |
557 |
|
// } else { |
558 |
|
// sprintf(o,"%s %f",o,arr->At(jj)); |
559 |
|
// }; |
560 |
|
// jj++; |
561 |
|
// }; |
562 |
|
// if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); |
563 |
|
// j++; |
564 |
|
// }; |
565 |
|
// }; |
566 |
|
// sprintf(o,"%s\n",o); |
567 |
|
// |
568 |
|
sprintf(o,"%s TArray - not implemented yet -",o); |
569 |
|
// |
570 |
|
}; |
571 |
|
// |
572 |
|
sprintf(o,"%s\n",o); |
573 |
|
break; |
574 |
|
case 3: |
575 |
|
// |
576 |
|
// IS A TCLONESARRAY |
577 |
|
// |
578 |
|
setcolor(col,RESET, BLUE, WHITE); |
579 |
|
setcolor(col2,RESET, BLACK, WHITE); |
580 |
|
sprintf(o,"%s%s %-15s%s = %d\n",o,col,tb->GetName(), col2, tb->GetNdata()); |
581 |
|
|
582 |
|
// |
583 |
|
if ( tb->GetNdata() ){ |
584 |
|
// |
585 |
|
TClonesArray *cl = (TClonesArray*)tb->GetObject(); |
586 |
|
// |
587 |
|
TClass *myc = cl->GetClass(); |
588 |
|
// |
589 |
|
TList *lme = myc->GetListOfDataMembers(); |
590 |
|
TIter next(lme); |
591 |
|
TBranchElement *tb2 = 0; |
592 |
|
// |
593 |
|
while ( (tb2 = (TBranchElement*)next()) ){ |
594 |
|
// |
595 |
|
const char *name = tb2->GetName(); |
596 |
|
TBranch *foglia = tb->FindBranch(name); |
597 |
|
if ( foglia ){ |
598 |
|
// |
599 |
|
TBranchElement *stb = (TBranchElement*)tb->FindBranch(name); |
600 |
|
Int_t stype = stb->GetType(); |
601 |
|
Int_t satype = stb->GetStreamerType() - 20; |
602 |
|
Int_t slen = (stb->GetInfo()->GetLengths())[stb->GetID()]; |
603 |
|
Int_t slength = min(slen,dlen); |
604 |
|
// printf("SubBranches : atype is %i type is %i tb getname %s slen %i slength %i\n",satype,stype,stb->GetName(),slen,slength); |
605 |
|
switch (stype){ |
606 |
|
case 31: |
607 |
|
// |
608 |
|
// IS A VARIABLE |
609 |
|
// |
610 |
|
// |
611 |
|
// NAME |
612 |
|
// |
613 |
|
j = 0; |
614 |
|
// |
615 |
|
// VALUES |
616 |
|
// |
617 |
|
if ( satype == 41 || satype == 44){ |
618 |
|
// |
619 |
|
// skip TRef |
620 |
|
// |
621 |
|
break; |
622 |
|
}; |
623 |
|
// |
624 |
|
// Integer |
625 |
|
// |
626 |
|
if ( satype == -17 || satype == -9 ){ |
627 |
|
// |
628 |
|
setcolor(col,RESET, BLUE, WHITE); |
629 |
|
setcolor(col2,RESET, BLACK, WHITE); |
630 |
|
sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2); |
631 |
|
while ( j < cl->GetEntriesFast() ){ |
632 |
|
if ( j < cl->GetEntriesFast() -1 ){ |
633 |
|
sprintf(o,"%s %i ,",o,(Int_t)stb->GetValue(j,slength)); |
634 |
|
} else { |
635 |
|
sprintf(o,"%s %i",o,(Int_t)stb->GetValue(j,slength)); |
636 |
|
}; |
637 |
|
j++; |
638 |
|
}; |
639 |
|
}; |
640 |
|
// |
641 |
|
// Float |
642 |
|
// |
643 |
|
if ( satype == -15 ){ |
644 |
|
// |
645 |
|
setcolor(col,RESET, BLUE, WHITE); |
646 |
|
setcolor(col2,RESET, BLACK, WHITE); |
647 |
|
sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2); |
648 |
|
while ( j < cl->GetEntriesFast() ){ |
649 |
|
if ( j < cl->GetEntriesFast() -1 ){ |
650 |
|
sprintf(o,"%s %f ,",o,stb->GetValue(j,slength)); |
651 |
|
} else { |
652 |
|
sprintf(o,"%s %f",o,stb->GetValue(j,slength)); |
653 |
|
}; |
654 |
|
j++; |
655 |
|
}; |
656 |
|
}; |
657 |
|
// |
658 |
|
// Array of float |
659 |
|
// |
660 |
|
if ( satype == 5 ){ |
661 |
|
// |
662 |
|
setcolor(col,RESET, BLUE, WHITE); |
663 |
|
setcolor(col2,RESET, BLACK, WHITE); |
664 |
|
sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2); |
665 |
|
Bool_t bold = true; |
666 |
|
while ( j < tb->GetNdata() ){ |
667 |
|
if ( bold ){ |
668 |
|
setcolor(col,RESET, BLACK, WHITE); |
669 |
|
sprintf(o,"%s%s",o,col); |
670 |
|
} else { |
671 |
|
setcolor(col,BOLD, BLACK, WHITE); |
672 |
|
sprintf(o,"%s%s",o,col); |
673 |
|
}; |
674 |
|
Int_t jj = 0; |
675 |
|
while ( jj < slength ){ |
676 |
|
if ( jj < slength-1 ){ |
677 |
|
sprintf(o,"%s %f ,",o,stb->GetValue(j,jj,true)); |
678 |
|
} else { |
679 |
|
sprintf(o,"%s %f",o,stb->GetValue(j,jj,true)); |
680 |
|
}; |
681 |
|
jj++; |
682 |
|
}; |
683 |
|
if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); |
684 |
|
if ( !bold ){ |
685 |
|
bold = true; |
686 |
|
} else { |
687 |
|
bold = false; |
688 |
|
}; |
689 |
|
j++; |
690 |
|
}; |
691 |
|
if ( bold ){ |
692 |
|
setcolor(col,RESET, BLACK, WHITE); |
693 |
|
sprintf(o,"%s%s",o,col); |
694 |
|
}; |
695 |
|
}; |
696 |
|
// |
697 |
|
// Array of integers |
698 |
|
// |
699 |
|
if ( satype == 3 ){ |
700 |
|
// |
701 |
|
setcolor(col,RESET, BLUE, WHITE); |
702 |
|
setcolor(col2,RESET, BLACK, WHITE); |
703 |
|
sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2); |
704 |
|
while ( j < tb->GetNdata() ){ |
705 |
|
Int_t jj = 0; |
706 |
|
while ( jj < slength ){ |
707 |
|
if ( jj < slength-1 ){ |
708 |
|
sprintf(o,"%s %i ,",o,(Int_t)stb->GetValue(j,jj,true)); |
709 |
|
} else { |
710 |
|
sprintf(o,"%s %i",o,(Int_t)stb->GetValue(j,jj,true)); |
711 |
|
}; |
712 |
|
jj++; |
713 |
|
}; |
714 |
|
if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); |
715 |
|
j++; |
716 |
|
}; |
717 |
|
}; |
718 |
|
|
719 |
|
// |
720 |
|
// TArray |
721 |
|
// |
722 |
|
if ( satype == 42 ){ |
723 |
|
// |
724 |
|
// determine offset to fetch data |
725 |
|
// |
726 |
|
int thisoffset = 0; |
727 |
|
TRealData *rd = myc->GetRealData(foglia->GetName()); |
728 |
|
if ( rd ){ |
729 |
|
thisoffset = rd->GetThisOffset(); |
730 |
|
}; |
731 |
|
Int_t niente = 0; |
732 |
|
TStreamerElement *tste = stb->GetInfo()->GetStreamerElement(rd->GetName(),niente); |
733 |
|
// |
734 |
|
// TArrayI |
735 |
|
// |
736 |
|
if ( !strcmp(tste->GetTypeName(),"TArrayI") ){ |
737 |
|
// |
738 |
|
char *pointer = (char*)cl->UncheckedAt(0); |
739 |
|
char *pu = pointer + thisoffset; |
740 |
|
TArrayI *arr = (TArrayI*)(pu); |
741 |
|
Int_t jj=0; |
742 |
|
Int_t arlen = min(arr->GetSize(),dlen); |
743 |
|
// |
744 |
|
setcolor(col,RESET, BLUE, WHITE); |
745 |
|
setcolor(col2,RESET, BLACK, WHITE); |
746 |
|
sprintf(o,"%s%s %s[%i]%s = ",o,col,foglia->GetName(),arr->GetSize(),col2); |
747 |
|
// |
748 |
|
while ( j < tb->GetNdata() ){ |
749 |
|
// |
750 |
|
pointer = (char*)cl->UncheckedAt(j); |
751 |
|
pu = pointer + thisoffset; |
752 |
|
arr = (TArrayI*)(pu); |
753 |
|
// |
754 |
|
while ( jj < arlen ){ |
755 |
|
if ( jj < arlen-1 ){ |
756 |
|
sprintf(o,"%s %i ,",o,arr->At(jj)); |
757 |
|
} else { |
758 |
|
sprintf(o,"%s %i",o,arr->At(jj)); |
759 |
|
}; |
760 |
|
jj++; |
761 |
|
}; |
762 |
|
if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); |
763 |
|
j++; |
764 |
|
}; |
765 |
|
}; |
766 |
|
// |
767 |
|
// TArrayF |
768 |
|
// |
769 |
|
if ( !strcmp(tste->GetTypeName(),"TArrayF") ){ |
770 |
|
// |
771 |
|
char *pointer = (char*)cl->UncheckedAt(0); |
772 |
|
char *pu = pointer + thisoffset; |
773 |
|
TArrayF *arr = (TArrayF*)(pu); |
774 |
|
Int_t jj=0; |
775 |
|
Int_t arlen = min(arr->GetSize(),dlen); |
776 |
|
// |
777 |
|
setcolor(col,RESET, BLUE, WHITE); |
778 |
|
setcolor(col2,RESET, BLACK, WHITE); |
779 |
|
sprintf(o,"%s%s %s[%i]%s = ",o,col,foglia->GetName(),arr->GetSize(),col2); |
780 |
|
// |
781 |
|
while ( j < tb->GetNdata() ){ |
782 |
|
// |
783 |
|
pointer = (char*)cl->UncheckedAt(j); |
784 |
|
pu = pointer + thisoffset; |
785 |
|
arr = (TArrayF*)(pu); |
786 |
|
// |
787 |
|
while ( jj < arlen ){ |
788 |
|
if ( jj < arlen-1 ){ |
789 |
|
sprintf(o,"%s %f ,",o,arr->At(jj)); |
790 |
|
} else { |
791 |
|
sprintf(o,"%s %f",o,arr->At(jj)); |
792 |
|
}; |
793 |
|
jj++; |
794 |
|
}; |
795 |
|
if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); |
796 |
|
j++; |
797 |
|
}; |
798 |
|
}; |
799 |
|
}; |
800 |
|
sprintf(o,"%s\n",o); |
801 |
|
break; |
802 |
|
}; |
803 |
|
}; |
804 |
|
}; |
805 |
|
}; |
806 |
|
break; |
807 |
|
}; |
808 |
|
}; |
809 |
|
// pamgui->DIALOG(0,o); |
810 |
|
printf("%s\n",o); |
811 |
|
}; |
812 |
|
|
813 |
|
|
814 |
void FEVdetector::GetGeneralInfo(){ |
void FEVdetector::GetGeneralInfo(){ |
815 |
// |
// |
816 |
// Get Orbital Time information and header event number |
// Get Orbital Time information and header event number |
820 |
headcold = headc; |
headcold = headc; |
821 |
headc = ph->Counter; |
headc = ph->Counter; |
822 |
var.headc = (int)ph->Counter; |
var.headc = (int)ph->Counter; |
823 |
OBT = ph->OrbitalTime; |
OBT = (UInt_t)ph->OrbitalTime; |
824 |
DOBT = OBT - OOBT; |
DOBT = OBT - OOBT; |
825 |
OOBT = OBT; |
OOBT = OBT; |
826 |
if ( thisentry == minevent || DOBT < 0 || (headc-headcold-1)!=0 ) DOBT = 0; |
if ( thisentry == minevent || DOBT < 0 || (headc-headcold-1)!=0 ) DOBT = 0; |
856 |
trcs = (TString)trc.str().c_str(); |
trcs = (TString)trc.str().c_str(); |
857 |
} else { |
} else { |
858 |
headcold = headc; |
headcold = headc; |
859 |
headc = L2->GetOrbitalInfo()->pkt_num; // to be changed as soon as we will have obt in the level2 file! |
if ( var.RUN ){ |
860 |
OBT = L2->GetOrbitalInfo()->OBT; // to be changed as soon as we will have obt in the level2 file! |
var.idrun = L2->GetRunInfo()->ID; |
861 |
DOBT = OBT - OOBT; |
var.idroot = L2->GetRunInfo()->ID_ROOT_L0; |
862 |
OOBT = OBT; |
var.EVF = L2->GetRunInfo()->EV_FROM; |
863 |
if ( thisentry == minevent || DOBT < 0 || (headc-headcold-1)!=0 ) DOBT = 0; |
}; |
864 |
var.etime = OBT; |
if ( var.ORB ){ |
865 |
|
headc = L2->GetOrbitalInfo()->pkt_num; |
866 |
|
OBT = L2->GetOrbitalInfo()->OBT; |
867 |
|
DOBT = OBT - OOBT; |
868 |
|
OOBT = OBT; |
869 |
|
if ( thisentry == minevent || DOBT < 0 || (headc-headcold-1)!=0 ) DOBT = 0; |
870 |
|
var.etime = OBT; |
871 |
|
} else { |
872 |
|
var.etime = 0; |
873 |
|
}; |
874 |
// |
// |
875 |
// who gave the trigger? |
// who gave the trigger? |
876 |
// |
// |
877 |
calotrig = 0; |
Int_t trigconf = 0; |
878 |
if ( L2->GetTrigLevel2()->patterntrig[0] ) calotrig = 1; |
if ( var.TRG ){ |
879 |
toftrig = 0; |
calotrig = 0; |
880 |
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; |
881 |
s4pulser = 0; |
toftrig = 0; |
882 |
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; |
883 |
// |
s4pulser = 0; |
884 |
// 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; |
885 |
// S4 sometimes could not set the flag even if the trigger is given. This is a workaround to fix this "bug": |
// |
886 |
// |
// TOF and calorimeter when giving a trigger will always set this flag since the time window of the signal is greater than 100 ns. |
887 |
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": |
888 |
// |
// |
889 |
Int_t trigconf = L2->GetTrigLevel2()->trigconf; |
if ( !calotrig && !toftrig ) s4pulser = 1; |
890 |
|
// |
891 |
|
trigconf = L2->GetTrigLevel2()->trigconf; |
892 |
|
} else { |
893 |
|
trigconf = 0; |
894 |
|
} |
895 |
stringstream trc; |
stringstream trc; |
896 |
trc.str(""); |
trc.str(""); |
897 |
if ( trigconf & (1<<0) ) trc << "TOF1"; |
if ( trigconf & (1<<0) ) trc << "TOF1"; |
1000 |
// |
// |
1001 |
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);"); |
1002 |
// |
// |
1003 |
if ( level.file == 2 ) isOK = gApplication->ProcessLine("filter((PamLevel2 *)L2,2);"); |
// if ( level.file == 2 ) isOK = gApplication->ProcessLine("filter((PamLevel2 *)L2,2);"); |
1004 |
|
if ( level.file == 2 ) isOK = gApplication->ProcessLine("filter();"); |
1005 |
// |
// |
1006 |
// progress bar in text window |
// progress bar in text window |
1007 |
// |
// |
1014 |
// |
// |
1015 |
} |
} |
1016 |
|
|
1017 |
void FEVdetector::Load(TTree &mainotr, TFile &mainfile){ |
TChain* FEVdetector::Load(TString file){ |
1018 |
file = &mainfile; |
// |
1019 |
otr = &mainotr; |
// file = &mainfile; |
|
L2 = new PamLevel2(); |
|
1020 |
// |
// |
1021 |
if ( level.file == 2 ){ |
if ( level.file == 2 ){ |
|
// otr = L2->LoadPamTrees(file); |
|
|
otr = L2->GetPamTree(file,"+ALL +CAL1 -TRKh -TRK1"); |
|
|
// ******************** |
|
|
// load magnetic field |
|
|
// ******************** |
|
|
const char *pam_calib = pathtocalibration(); |
|
1022 |
// |
// |
1023 |
stringstream magfie; |
printf(" %s \n",ddec.Data()); |
1024 |
magfie.str(""); |
if ( !L2 ){ |
1025 |
// magfie << "/localdisk/mocchiut/test/calib/trk-param/field_param-0/"; |
L2 = new PamLevel2("",file.Data(),ddec.Data()); |
1026 |
magfie << pam_calib; |
otr = L2->GetPamTree(); |
1027 |
magfie << "/trk-param/field_param-0/"; |
printf(" l2 constructor\n"); |
1028 |
|
// printf(" abst %u obt %u qtot %f \n",L2->GetOrbitalInfo()->absTime,L2->GetOrbitalInfo()->OBT,L2->GetCaloLevel2()->qtot); |
1029 |
|
} else { |
1030 |
|
// |
1031 |
|
printf(" l2 already exist \n"); |
1032 |
|
otr = L2->GetPamTree(gSystem->DirName(file.Data()),file.Data(),ddec.Data()); |
1033 |
|
L2->GetRunTree(gSystem->DirName(file.Data()),file.Data()); |
1034 |
|
// |
1035 |
|
}; |
1036 |
|
// |
1037 |
|
// |
1038 |
|
if ( !otr ) return(0); |
1039 |
|
// |
1040 |
|
// otr->CanDeleteRefs(true); |
1041 |
|
// if ( runtree ) runtree->CanDeleteRefs(true); |
1042 |
// |
// |
|
L2->GetTrkLevel2()->LoadField(magfie.str().c_str()); |
|
1043 |
} else { |
} else { |
1044 |
// |
// |
1045 |
// load calorimeter ADC2MIP conversion file |
// load calorimeter ADC2MIP conversion file |
1079 |
// |
// |
1080 |
}; |
}; |
1081 |
// |
// |
|
|
|
1082 |
// |
// |
1083 |
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(); |
|
1084 |
// |
// |
1085 |
if ( level.file == 0 || level.file == -1 ){ |
if ( level.file == 0 || level.file == -1 ){ |
1086 |
|
// |
1087 |
|
trigger = new pamela::trigger::TriggerEvent(); |
1088 |
|
eh = new pamela::EventHeader(); |
1089 |
|
ph = new pamela::PscuHeader(); |
1090 |
|
de = new pamela::calorimeter::CalorimeterEvent(); |
1091 |
|
trk = new pamela::tracker::TrackerEvent(); |
1092 |
|
ne = new pamela::neutron::NeutronEvent(); |
1093 |
|
ace = new pamela::anticounter::AnticounterEvent(); |
1094 |
|
s4 = new pamela::S4::S4Event(); |
1095 |
|
tof = new pamela::tof::TofEvent(); |
1096 |
|
// |
1097 |
|
otr = new TChain("Physics"); |
1098 |
|
otr->Add(file.Data(),-1); |
1099 |
otr->SetBranchAddress("Trigger", &trigger); |
otr->SetBranchAddress("Trigger", &trigger); |
1100 |
otr->SetBranchAddress("Header", &eh); |
otr->SetBranchAddress("Header", &eh); |
1101 |
}; |
}; |
|
if ( level.file == 2 ){ |
|
|
// otr->AddFriend("OrbitalInfo", file); |
|
|
// otr->SetBranchAddress("OrbitalInfo", &oinfoL2); |
|
|
runinfo->Read(0ULL); |
|
|
}; |
|
1102 |
// |
// |
1103 |
if ( var.TRK ) { |
if ( var.TRK ) { |
1104 |
if ( level.file == 0 || level.file == -1 ){ |
if ( level.file == 0 || level.file == -1 ){ |
1170 |
printf("Show the Time of Flight detector, LEVEL2 data \n"); |
printf("Show the Time of Flight detector, LEVEL2 data \n"); |
1171 |
}; |
}; |
1172 |
}; |
}; |
1173 |
|
// |
1174 |
|
if ( !otr ){ |
1175 |
|
return(0); |
1176 |
|
}; |
1177 |
|
// |
1178 |
|
return otr; |
1179 |
// |
// |
1180 |
} |
} |
1181 |
|
|
1251 |
text->DrawLatex(0.33,txthi,testo.str().c_str()); |
text->DrawLatex(0.33,txthi,testo.str().c_str()); |
1252 |
txthi -= 0.03; |
txthi -= 0.03; |
1253 |
testo2.str(""); |
testo2.str(""); |
1254 |
testo2 << "On Board Time: " << (int)OBT; |
testo2 << "On Board Time: " << (unsigned int)OBT; |
1255 |
if ( DOBT > 0 ) { |
if ( DOBT > 0 ) { |
1256 |
testo2 << " (delta: " << (int)DOBT; |
testo2 << " (delta: " << (unsigned int)DOBT; |
1257 |
testo2 << ")"; |
testo2 << ")"; |
1258 |
}; |
}; |
1259 |
testo2 << " [ms]"; |
testo2 << " [ms]"; |
1871 |
void FEVdetector::ShowTOF(){ |
void FEVdetector::ShowTOF(){ |
1872 |
// |
// |
1873 |
// |
// |
|
// |
|
1874 |
if ( !var.TOF ) return; |
if ( !var.TOF ) return; |
1875 |
// |
// |
1876 |
Int_t tt = 0; |
Int_t tt = 0; |
2576 |
ms11b[i] = 0.; |
ms11b[i] = 0.; |
2577 |
} else { |
} else { |
2578 |
ms11b[i] = 1.; |
ms11b[i] = 1.; |
2579 |
}; }; |
}; |
2580 |
|
}; |
2581 |
for ( Int_t i = 0; i<6; i++ ) { |
for ( Int_t i = 0; i<6; i++ ) { |
2582 |
mt12[0][i] = tof->tdc[ch12a[i]][hb12a[i]]; |
mt12[0][i] = tof->tdc[ch12a[i]][hb12a[i]]; |
2583 |
mt12[1][i] = tof->tdc[ch12b[i]][hb12b[i]]; |
mt12[1][i] = tof->tdc[ch12b[i]][hb12b[i]]; |
2671 |
// |
// |
2672 |
Bool_t repeat = true; |
Bool_t repeat = true; |
2673 |
Int_t numtr = 1; |
Int_t numtr = 1; |
2674 |
|
// Int_t numtr = 0; |
2675 |
Int_t repuntil = 0; |
Int_t repuntil = 0; |
2676 |
// |
// |
2677 |
// |
// |
2678 |
var.tofraw = 0; |
var.tofraw = 0; |
2679 |
// |
// |
2680 |
repuntil = L2->GetToFLevel2()->ntrk(); |
if ( level.file == 2 ) repuntil = L2->GetToFLevel2()->ntrk(); |
2681 |
// printf("repuntil = %i \n",repuntil); |
// printf("repuntil = %i \n",repuntil); |
2682 |
|
//if ( level.file == 2 ) repuntil = L2->GetTrkLevel2()->GetNTracks(); |
2683 |
//repuntil = L2->GetNTracks(); |
//repuntil = L2->GetNTracks(); |
2684 |
// |
// |
2685 |
while ( repeat ){ |
while ( repeat ){ |
2689 |
// |
// |
2690 |
// |
// |
2691 |
ToFTrkVar *ptt = 0; |
ToFTrkVar *ptt = 0; |
2692 |
|
// PamTrack *ptrack = 0; |
2693 |
|
Float_t adc[4][12]; |
2694 |
|
Float_t tdc[4][12]; |
2695 |
|
memset(adc,0,4*12*sizeof(Float_t)); |
2696 |
|
memset(tdc,0,4*12*sizeof(Float_t)); |
2697 |
// |
// |
2698 |
// |
// |
2699 |
|
// if ( repuntil == 0 || var.tofraw ){ |
2700 |
if ( repuntil == 1 || var.tofraw ){ |
if ( repuntil == 1 || var.tofraw ){ |
2701 |
numtr = 0; |
numtr = 0; |
2702 |
ptt = L2->GetToFLevel2()->GetToFTrkVar(0); |
ptt = L2->GetToFLevel2()->GetToFTrkVar(0); |
2706 |
// |
// |
2707 |
if ( numtr >= repuntil-1 ) repeat = false; |
if ( numtr >= repuntil-1 ) repeat = false; |
2708 |
// |
// |
2709 |
ptt = L2->GetToFLevel2()->GetToFTrkVar(numtr); |
// printf(" numtr is %i \n",numtr); |
2710 |
|
ptt = L2->GetToFLevel2()->GetToFTrkVar(numtr); |
2711 |
|
//ptrack = L2->GetTrack(numtr); |
2712 |
|
//ptt = ptrack->GetToFTrack(); |
2713 |
}; |
}; |
2714 |
// |
// |
2715 |
xp11[0] = 0.; |
xp11[0] = 0.; |
2723 |
// |
// |
2724 |
ii = 2; |
ii = 2; |
2725 |
// |
// |
2726 |
Float_t adc[4][12]; |
Int_t myseq = ptt->trkseqno + 1; |
2727 |
Float_t tdc[4][12]; |
L2->GetToFLevel2()->GetMatrix(myseq,adc,tdc); |
2728 |
L2->GetToFLevel2()->GetMatrix(numtr,adc,tdc); |
// |
2729 |
|
// printf(" qua \n"); |
2730 |
// |
// |
2731 |
for ( Int_t i = 0; i<8; i++ ) { |
for ( Int_t i = 0; i<8; i++ ) { |
2732 |
if ( adc[ch11a[i]][hb11a[i]] < 1000. ){ |
if ( adc[ch11a[i]][hb11a[i]] < 1000. ){ |
4246 |
pcasp4b->Draw("f"); |
pcasp4b->Draw("f"); |
4247 |
pcasp4b->Draw(); |
pcasp4b->Draw(); |
4248 |
}; |
}; |
4249 |
Float_t alfa = 1.2020334; |
// Float_t alfax = 1.2020334; |
4250 |
|
Float_t alfax = 1.22157778; |
4251 |
|
Float_t alfay = 1.27393111; |
4252 |
Float_t lcrd = 0.1815/2.; |
Float_t lcrd = 0.1815/2.; |
4253 |
Float_t wcrd = 0.008; |
Float_t wcrd = 0.008; |
4254 |
if ( true ){ |
if ( true ){ |
4459 |
// |
// |
4460 |
// Float_t cardcx = 0.143168*var.sfx; |
// Float_t cardcx = 0.143168*var.sfx; |
4461 |
//Float_t cardcy = 0.1475*var.sfy; |
//Float_t cardcy = 0.1475*var.sfy; |
4462 |
Float_t cardcx = 0.153168*var.sfx; |
// |
4463 |
Float_t cardcy = 0.1575*var.sfy; |
// Float_t cardcx = 0.153168*var.sfx; |
4464 |
Float_t acrdx[4] = {-lcrd*cos(alfa), lcrd*cos(alfa), -lcrd*cos(alfa)+wcrd*sin(alfa), -lcrd*cos(alfa)}; |
// |
4465 |
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; |
4466 |
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; |
4467 |
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; |
4468 |
|
Float_t acrdx[4] = {-lcrd*cos(alfax), lcrd*cos(alfax), -lcrd*cos(alfax)+wcrd*sin(alfax), -lcrd*cos(alfax)}; |
4469 |
|
Float_t acrdy[4] = {-lcrd*sin(alfax), lcrd*sin(alfax), -lcrd*sin(alfax)-wcrd*cos(alfax), -lcrd*sin(alfax)}; |
4470 |
|
Float_t bcrdx[4] = { lcrd*cos(alfax), lcrd*cos(alfax)+wcrd*sin(alfax), -lcrd*cos(alfax)+wcrd*sin(alfax), lcrd*cos(alfax)}; |
4471 |
|
Float_t bcrdy[4] = { lcrd*sin(alfax), lcrd*sin(alfax)-wcrd*cos(alfax), -lcrd*sin(alfax)-wcrd*cos(alfax), lcrd*sin(alfax)}; |
4472 |
|
|
4473 |
// |
// |
4474 |
// CARD3 X/ Y |
// CARD3 X/ Y |
4528 |
}; |
}; |
4529 |
|
|
4530 |
if ( true ){ |
if ( true ){ |
4531 |
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)}; |
4532 |
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)}; |
4533 |
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)}; |
4534 |
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)}; |
4535 |
// |
// |
4536 |
// CARD - Y-view |
// CARD - Y-view |
4537 |
// |
// |
4538 |
Float_t cardcx = 0.12*var.sfx; |
// Float_t cardcx = 0.12*var.sfx; |
4539 |
Float_t cardcy = 0.1475*var.sfy; |
Float_t cardcx = (0.16014*(1.-lcrd*cos(alfay)))*var.sfx; |
4540 |
|
// Float_t cardcy = 0.178818*var.sfy; |
4541 |
|
Float_t cardcy = (0.178818*(1.-lcrd*sin(alfay)))*var.sfy; |
4542 |
|
// Float_t cardcy = 0.1475*var.sfy; |
4543 |
// |
// |
4544 |
// CARD4 X Y/ |
// CARD4 X Y/ |
4545 |
// |
// |
5105 |
// |
// |
5106 |
if ( L2->GetTrkLevel2()->GetNTracks() > 0 ){ |
if ( L2->GetTrkLevel2()->GetNTracks() > 0 ){ |
5107 |
for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ |
for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ |
5108 |
TrkTrack *track = L2->GetTrkLevel2()->GetTrack(nt); |
PamTrack *ptrack= L2->GetTrack(nt); |
5109 |
|
TrkTrack *track = ptrack->GetTrkTrack(); |
5110 |
if ( nt == 0 ){ |
if ( nt == 0 ){ |
5111 |
var.rig = 0.; |
var.rig = 0.; |
5112 |
if ( track->al[4] != 0. ) var.rig = 1./track->al[4]; |
if ( track->al[4] != 0. ) var.rig = 1./track->al[4]; |
5203 |
// first of all plot crosses relatives to tracks |
// first of all plot crosses relatives to tracks |
5204 |
// |
// |
5205 |
if ( L2->GetTrkLevel2()->GetNTracks() > 0 ){ |
if ( L2->GetTrkLevel2()->GetNTracks() > 0 ){ |
5206 |
|
// for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ |
5207 |
|
// TrkTrack *track = L2->GetTrkLevel2()->GetTrack(nt); |
5208 |
for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ |
for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ |
5209 |
TrkTrack *track = L2->GetTrkLevel2()->GetTrack(nt); |
PamTrack *ptrack= L2->GetTrack(nt); |
5210 |
|
TrkTrack *track = ptrack->GetTrkTrack(); |
5211 |
|
// |
5212 |
for (Int_t plane = 0; plane<6; plane++){ |
for (Int_t plane = 0; plane<6; plane++){ |
5213 |
// |
// |
5214 |
x = track->xm[plane]; |
x = track->xm[plane]; |
5522 |
|
|
5523 |
void FEVdetector::ShowTrack(){ |
void FEVdetector::ShowTrack(){ |
5524 |
// |
// |
5525 |
|
if ( level.file != 2 ) return; |
5526 |
// |
// |
5527 |
// |
// |
5528 |
if ( var.CALO && false ){ |
// |
5529 |
|
if ( var.CALO && var.CALOT ){ |
5530 |
if ( L2->GetCaloLevel2()->npcfit[0] > 0 && L2->GetCaloLevel2()->npcfit[1] > 0 ){ |
if ( L2->GetCaloLevel2()->npcfit[0] > 0 && L2->GetCaloLevel2()->npcfit[1] > 0 ){ |
5531 |
Float_t calx[22]; |
Float_t calx[22]; |
5532 |
Float_t caly[22]; |
Float_t caly[22]; |
5621 |
}; |
}; |
5622 |
}; |
}; |
5623 |
// |
// |
5624 |
if ( !var.TRK || level.file != 2 ) return; |
if ( !var.TRK ) return; |
5625 |
// |
// |
5626 |
if ( L2->GetTrkLevel2()->GetNTracks() > 0 ){ |
if ( L2->GetTrkLevel2()->GetNTracks() > 0 ){ |
5627 |
for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ |
for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ |
5628 |
TrkTrack *track = L2->GetTrkLevel2()->GetTrack(nt); |
|
5629 |
|
// TrkTrack *track = L2->GetTrkLevel2()->GetTrack(nt); |
5630 |
|
// printf("qui \n"); |
5631 |
|
PamTrack *ptrack = L2->GetTrack(nt); |
5632 |
|
TrkTrack *track = ptrack->GetTrkTrack(); |
5633 |
|
// printf("qua \n"); |
5634 |
Int_t npoint = 100; |
Int_t npoint = 100; |
5635 |
Float_t zin[100]; |
Float_t zin[100]; |
5636 |
Double_t xout[100]; |
Double_t xout[100]; |
5838 |
Int_t se = 5; |
Int_t se = 5; |
5839 |
if ( !l && m%2 == 0 ) se = 3; |
if ( !l && m%2 == 0 ) se = 3; |
5840 |
if ( !l && m%2 != 0 ) se = 2; |
if ( !l && m%2 != 0 ) se = 2; |
5841 |
if ( l && m%2 == 0 ) se = 1; |
if ( l && m%2 != 0 ) se = 1; |
5842 |
if ( l && m%2 != 0 ) se = 0; |
if ( l && m%2 == 0 ) se = 0; |
5843 |
// |
// |
5844 |
// determine what kind of event we are going to analyze |
// determine what kind of event we are going to analyze |
5845 |
// |
// |
5954 |
// |
// |
5955 |
// Define variables |
// Define variables |
5956 |
// |
// |
5957 |
Int_t etime = var.etime; |
UInt_t etime = var.etime; |
5958 |
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]; |
5959 |
Int_t badstrip = 0; |
Int_t badstrip = 0; |
5960 |
qtot = 0.; |
qtot = 0.; |
6026 |
if ( calib.ttime[s][b[s]+1] && calib.time[s][b[s]] ){ |
if ( calib.ttime[s][b[s]+1] && calib.time[s][b[s]] ){ |
6027 |
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 ){ |
6028 |
printf(" CALORIMETER: \n" ); |
printf(" CALORIMETER: \n" ); |
6029 |
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]); |
6030 |
printf(" END CALORIMETER. \n\n" ); |
printf(" END CALORIMETER. \n\n" ); |
6031 |
b[s]++; |
b[s]++; |
6032 |
CaloPede(s); |
CaloPede(s); |
6046 |
Int_t se = 5; |
Int_t se = 5; |
6047 |
if (l == 0 && m%2 == 0) se = 3; |
if (l == 0 && m%2 == 0) se = 3; |
6048 |
if (l == 0 && m%2 != 0) se = 2; |
if (l == 0 && m%2 != 0) se = 2; |
6049 |
if (l == 1 && m%2 == 0) se = 1; |
if (l == 1 && m%2 != 0) se = 1; |
6050 |
if (l == 1 && m%2 != 0) se = 0; |
if (l == 1 && m%2 == 0) se = 0; |
6051 |
// |
// |
6052 |
// determine what kind of event we are going to analyze |
// determine what kind of event we are going to analyze |
6053 |
// |
// |
6331 |
for (Int_t d = 0; d<48; d++){ |
for (Int_t d = 0; d<48; d++){ |
6332 |
if ( calib.ttime[s][d] != 0 ) calibex++; |
if ( calib.ttime[s][d] != 0 ) calibex++; |
6333 |
if ( calib.time[s][0] != 0 ){ |
if ( calib.time[s][0] != 0 ){ |
6334 |
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]); |
6335 |
if ( calib.time[s][d+1] != 0 ) { |
if ( calib.time[s][d+1] != 0 ) { |
6336 |
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]); |
6337 |
} else { |
} else { |
6338 |
if ( !stop ){ |
if ( !stop ){ |
6339 |
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]); |
6340 |
stop = 1; |
stop = 1; |
6341 |
}; |
}; |
6342 |
}; |
}; |
6343 |
} else { |
} else { |
6344 |
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]); |
6345 |
}; |
}; |
6346 |
}; |
}; |
6347 |
printf("\n"); |
printf("\n"); |
6406 |
calib.ttime[s][inter] = 0; |
calib.ttime[s][inter] = 0; |
6407 |
if ( ce->cstwerr[s] != 0 && ce->cperror[s] == 0 ) { |
if ( ce->cstwerr[s] != 0 && ce->cperror[s] == 0 ) { |
6408 |
//calib.ttime[s][inter] = cph->GetOrbitalTime(); |
//calib.ttime[s][inter] = cph->GetOrbitalTime(); |
6409 |
calib.ttime[s][inter] = cph->OrbitalTime; |
calib.ttime[s][inter] = (UInt_t)cph->OrbitalTime; |
6410 |
inter++; |
inter++; |
6411 |
} else { |
} else { |
6412 |
if ( ce->cstwerr[s] != 0 && ce->cperror[s] != 0 ) { |
if ( ce->cstwerr[s] != 0 && ce->cperror[s] != 0 ) { |
6460 |
tr->GetEntry(ci); |
tr->GetEntry(ci); |
6461 |
cph = ceh->GetPscuHeader(); |
cph = ceh->GetPscuHeader(); |
6462 |
//if ( atime == cph->GetOrbitalTime()){ |
//if ( atime == cph->GetOrbitalTime()){ |
6463 |
if ( atime == cph->OrbitalTime){ |
if ( atime == (UInt_t)cph->OrbitalTime){ |
6464 |
// calib.iev = ce->iev; |
// calib.iev = ce->iev; |
6465 |
if (ce->cstwerr[s] != 0 && ce->cperror[s] == 0 ) { |
if (ce->cstwerr[s] != 0 && ce->cperror[s] == 0 ) { |
6466 |
for ( Int_t d=0 ; d<11 ;d++ ){ |
for ( Int_t d=0 ; d<11 ;d++ ){ |