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> |
88 |
var.SHOWDEC = 0; |
var.SHOWDEC = 0; |
89 |
var.TOF = 0; |
var.TOF = 0; |
90 |
var.AC = 0; |
var.AC = 0; |
91 |
|
var.RUN = 1; |
92 |
var.TRK = 0; |
var.TRK = 0; |
93 |
|
var.ORB = 0; |
94 |
|
var.TRG = 0; |
95 |
var.CALO = 0; |
var.CALO = 0; |
96 |
var.S4 = 0; |
var.S4 = 0; |
97 |
var.ND = 0; |
var.ND = 0; |
127 |
}; |
}; |
128 |
} |
} |
129 |
|
|
130 |
|
void FEVdetector::SetDDEC(TString de){ |
131 |
|
ddec=de; |
132 |
|
}; |
133 |
|
|
134 |
void FEVdetector::GetWindow(){ |
void FEVdetector::GetWindow(){ |
135 |
otr->GetEntry(maxevent); |
otr->GetEntry(maxevent); |
136 |
|
// |
137 |
if ( level.file < 2 ){ |
if ( level.file < 2 ){ |
138 |
ph = eh->GetPscuHeader(); |
ph = eh->GetPscuHeader(); |
139 |
lastevno = (int)ph->Counter; |
lastevno = (int)ph->Counter; |
140 |
} else { |
} else { |
141 |
lastevno = oinfoL2->pkt_num; // to be changed as soon as we will have pkt_counter in the level2 file! |
if ( var.ORB ){ |
142 |
|
lastevno = L2->GetOrbitalInfo()->pkt_num; |
143 |
|
} else { |
144 |
|
lastevno = 0; |
145 |
|
}; |
146 |
}; |
}; |
147 |
otr->GetEntry(minevent); |
otr->GetEntry(minevent); |
148 |
if ( level.file < 2 ){ |
if ( level.file < 2 ){ |
149 |
ph = eh->GetPscuHeader(); |
ph = eh->GetPscuHeader(); |
150 |
firstevno = (int)ph->Counter; |
firstevno = (int)ph->Counter; |
151 |
} else { |
} else { |
152 |
firstevno = oinfoL2->pkt_num; // to be changed as soon as we will have pkt_counter in the level2 file! |
if ( var.ORB ){ |
153 |
|
firstevno = L2->GetOrbitalInfo()->pkt_num; |
154 |
|
} else { |
155 |
|
firstevno = 0; |
156 |
|
}; |
157 |
}; |
}; |
158 |
} |
} |
159 |
|
|
179 |
void FEVdetector::GetEntry(Int_t i){ |
void FEVdetector::GetEntry(Int_t i){ |
180 |
thisentry = i; |
thisentry = i; |
181 |
otr->GetEntry(i); |
otr->GetEntry(i); |
182 |
|
// if ( level.file == 2 ){ |
183 |
|
// ShowInfo("TrkLevel2"); |
184 |
|
// ShowInfo("ToFLevel2"); |
185 |
|
// ShowInfo("CaloLevel2"); |
186 |
|
// }; |
187 |
|
// PrintData(otr,-1LL,44); |
188 |
} |
} |
189 |
|
|
190 |
void FEVdetector::SetEntry(Int_t i){ |
void FEVdetector::SetEntry(Int_t i){ |
197 |
return((int)ph->Counter); |
return((int)ph->Counter); |
198 |
} else { |
} else { |
199 |
// 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! |
200 |
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! |
201 |
}; |
}; |
202 |
} |
} |
203 |
|
|
305 |
}; |
}; |
306 |
} |
} |
307 |
|
|
308 |
|
void FEVdetector::PrintLeaves(TTree *otr, Int_t i, TBranchElement *tb, Int_t lenmax){ |
309 |
|
// -- Prints values of leaves. |
310 |
|
|
311 |
|
// tb->ValidateAddress(); |
312 |
|
printf("son qua \n"); |
313 |
|
|
314 |
|
// if (otr->GetMakeClass()) { |
315 |
|
if (!tb->GetAddress()) { |
316 |
|
printf("esco \n"); |
317 |
|
return; |
318 |
|
} |
319 |
|
if (tb->GetType() == 3 || tb->GetType() == 4) { |
320 |
|
// TClonesArray or STL container top-level branch. |
321 |
|
printf("3 o 4 %-15s = %d\n", tb->GetName(), tb->GetNdata()); |
322 |
|
return; |
323 |
|
} else if (tb->GetType() == 31 || tb->GetType() == 41) { |
324 |
|
printf(" 31 o 41 \n"); |
325 |
|
// TClonesArray or STL container sub-branch. |
326 |
|
Int_t n = TMath::Min(10, tb->GetNdata()); |
327 |
|
Int_t atype = tb->GetStreamerType() + 20; |
328 |
|
if (tb->GetStreamerType() == 1) { |
329 |
|
// TVirtualStreamerInfo::kOffsetL + TVirtualStreamerInfo::kChar is |
330 |
|
// printed as a string and could print weird characters. |
331 |
|
// So we print an unsigned char instead (not perfect, but better). |
332 |
|
atype = 20 + 11 ; |
333 |
|
} |
334 |
|
if (atype > 54) { |
335 |
|
// FIXME: More logic required here (like in ReadLeaves) |
336 |
|
printf(">54 %-15s = %d\n", tb->GetName(), tb->GetNdata()); |
337 |
|
return; |
338 |
|
} |
339 |
|
if (tb->GetStreamerType() > 20) { |
340 |
|
atype -= 20; |
341 |
|
// TObjArray *prova= otr->GetListOfLeaves(); |
342 |
|
// // TObjArray* leaf2 = (TObjArray*) prova->UncheckedAt(i); |
343 |
|
// //TLeaf* leaf = (TLeaf*)(otr->GetLeaf(tb->GetName())); |
344 |
|
// // TLeafElement* leaf = (TLeafElement*)((TLeaf*)(otr->GetListOfLeaves()->UncheckedAt(i))->GetBranch()->UncheckedAt(0)); |
345 |
|
// TLeafElement* leaf = (TLeafElement*)(prova->UncheckedAt(0)); |
346 |
|
// n = n * leaf->GetLenStatic(); |
347 |
|
} |
348 |
|
if (tb->GetInfo()) { |
349 |
|
// n = 16; |
350 |
|
// tb->GetInfo()->PrintValue(tb->GetName(), tb->GetAddress(), atype, n, lenmax); |
351 |
|
//tb->GetObject()->GetInfo()->PrintValue(tb->GetName(), tb->GetObject(), atype, n, lenmax); |
352 |
|
} |
353 |
|
return; |
354 |
|
} else if (tb->GetType() <= 2) { |
355 |
|
printf(" <=2 \n"); |
356 |
|
// Branch in split mode. |
357 |
|
// FIXME: This should probably be < 60 instead. |
358 |
|
if ((tb->GetStreamerType() > 40) && (tb->GetStreamerType() < 55)) { |
359 |
|
Int_t atype = tb->GetStreamerType() - 20; |
360 |
|
TBranchElement* counterElement = (TBranchElement*) tb->GetBranchCount(); |
361 |
|
Int_t n = (Int_t) counterElement->GetValue(0, 0); |
362 |
|
if (tb->GetInfo()) { |
363 |
|
tb->GetInfo()->PrintValue(tb->GetName(), tb->GetAddress(), atype, n, lenmax); |
364 |
|
} |
365 |
|
} else { |
366 |
|
// if (tb->GetInfo()) { |
367 |
|
// tb->GetInfo()->PrintValue(tb->GetName(), tb->GetObject(), tb->GetID(), -1, lenmax); |
368 |
|
// } |
369 |
|
// } |
370 |
|
return; |
371 |
|
} |
372 |
|
} else if (tb->GetType() == 3) { |
373 |
|
printf("3 %-15s = %d\n", tb->GetName(), tb->GetNdata()); |
374 |
|
} else if (tb->GetType() == 31) { |
375 |
|
printf("31 %-15s = %d\n", tb->GetName(), tb->GetNdata()); |
376 |
|
// TClonesArray* clones = (TClonesArray*) tb->GetObject(); |
377 |
|
// if (tb->GetInfo()) { |
378 |
|
// tb->GetInfo()->PrintValueClones(tb->GetName(), clones, tb->GetID(), tb->GetOffset(), lenmax); |
379 |
|
// } |
380 |
|
} else if (tb->GetType() == 41) { |
381 |
|
printf("41 %-15s = %d\n", tb->GetName(), tb->GetNdata()); |
382 |
|
// TVirtualCollectionProxy::TPushPop helper(((TBranchElement*) this)->GetCollectionProxy(), fObject); |
383 |
|
// if (GetInfo()) { |
384 |
|
// GetInfo()->PrintValueSTL(GetName(), ((TBranchElement*) this)->GetCollectionProxy(), fID, fOffset, lenmax); |
385 |
|
// } |
386 |
|
} else { |
387 |
|
printf("else %-15s = %d\n", tb->GetName(), tb->GetNdata()); |
388 |
|
// if (GetInfo()) { |
389 |
|
// GetInfo()->PrintValue(GetName(), fObject, fID, -1, lenmax); |
390 |
|
// } |
391 |
|
} |
392 |
|
|
393 |
|
// }; |
394 |
|
printf("esco qui\n"); |
395 |
|
}; |
396 |
|
|
397 |
|
|
398 |
|
void FEVdetector::ShowInfo(TString detector){ |
399 |
|
// |
400 |
|
TBranch *b1 = 0; |
401 |
|
TBranch *b3 = 0; |
402 |
|
TObjArray *branch_array = 0; |
403 |
|
TObjArray *leaf_array = 0; |
404 |
|
// |
405 |
|
b1 = otr->FindBranch(detector.Data()); |
406 |
|
Int_t dlen = 44; |
407 |
|
// |
408 |
|
printf("======> EVENT:%i\n", thisentry); |
409 |
|
// |
410 |
|
printf("Branch %s\n",b1->GetName()); |
411 |
|
branch_array = b1->GetListOfBranches(); |
412 |
|
// |
413 |
|
Int_t j = 0; |
414 |
|
// |
415 |
|
for(Int_t l=0;l<(branch_array->GetLast()+1);l++){ |
416 |
|
// |
417 |
|
TBranchElement *tb = (TBranchElement*)branch_array->At(l); |
418 |
|
Int_t type = tb->GetType(); |
419 |
|
Int_t atype = tb->GetStreamerType() - 20; |
420 |
|
Int_t len = (tb->GetInfo()->GetLengths())[tb->GetID()]; |
421 |
|
Int_t length = min(len,dlen); |
422 |
|
// printf("SubBranches : %s type is %i tb getname %s\n",((TBranch*)branch_array->At(l))->GetName(),type,tb->GetName()); |
423 |
|
switch (type){ |
424 |
|
case 0: |
425 |
|
// |
426 |
|
// IS A VARIABLE |
427 |
|
// |
428 |
|
// |
429 |
|
// NAME |
430 |
|
// |
431 |
|
// printf(" ATYPE IS %i \n",atype); |
432 |
|
printf(" %-15s =",((TBranch*)branch_array->At(l))->GetName()); |
433 |
|
j = 0; |
434 |
|
// |
435 |
|
// VALUES |
436 |
|
// |
437 |
|
if ( atype == 3 || atype == -17 ){ |
438 |
|
while ( j < length ){ |
439 |
|
if ( j < length -1 ){ |
440 |
|
printf(" %llu ,",(ULong64_t)tb->GetValue(j,0)); |
441 |
|
} else { |
442 |
|
printf(" %llu",(ULong64_t)tb->GetValue(j,0)); |
443 |
|
}; |
444 |
|
j++; |
445 |
|
}; |
446 |
|
} else { |
447 |
|
while ( j < length ){ |
448 |
|
if ( j < length -1 ){ |
449 |
|
printf(" %f ,",tb->GetValue(j,0)); |
450 |
|
} else { |
451 |
|
printf(" %f",tb->GetValue(j,0)); |
452 |
|
}; |
453 |
|
j++; |
454 |
|
}; |
455 |
|
}; |
456 |
|
printf("\n"); |
457 |
|
break; |
458 |
|
case 3: |
459 |
|
// |
460 |
|
// IS A TCLONESARRAY |
461 |
|
// |
462 |
|
printf(" %-15s = %d\n", tb->GetName(), tb->GetNdata()); |
463 |
|
// |
464 |
|
if ( tb->GetNdata() ){ |
465 |
|
|
466 |
|
printf(" auiauiaui\n"); |
467 |
|
TClonesArray *cl = (TClonesArray*)tb->GetObject(); |
468 |
|
// |
469 |
|
printf(" name %s\n",cl->GetName()); |
470 |
|
// |
471 |
|
TClass *myc = cl->GetClass(); |
472 |
|
// |
473 |
|
TList *lme = myc->GetListOfDataMembers(); |
474 |
|
TIter next(lme); |
475 |
|
Int_t ls=0; |
476 |
|
TBranchElement *tb2 = 0; |
477 |
|
printf("la classe %s contiene:\n",myc->GetName()); |
478 |
|
while ( (tb2 = (TBranchElement*)next()) ){ |
479 |
|
// |
480 |
|
printf(" Memeber %i is %s \n",ls,tb2->GetName()); |
481 |
|
|
482 |
|
Int_t thisoffset = 0; |
483 |
|
TRealData *rd = myc->GetRealData(tb2->GetName()); |
484 |
|
if ( rd ){ |
485 |
|
printf(" rd name %s offset %i \n",rd->GetName(),rd->GetThisOffset()); |
486 |
|
thisoffset = rd->GetThisOffset(); |
487 |
|
}; |
488 |
|
|
489 |
|
ls++; |
490 |
|
|
491 |
|
// }; |
492 |
|
|
493 |
|
for (Int_t ll=0; ll<cl->GetEntriesFast();ll++){ |
494 |
|
// |
495 |
|
printf(" Entry %i 0x%X\n",ll,cl->At(ll)); |
496 |
|
|
497 |
|
// tb->GetInfo()->PrintValue(rd->GetName(), (char*)cl->At(ll)+thisoffset, 0, ls, 44); |
498 |
|
|
499 |
|
// printf(" value1 = %i \n",&((*cl->At(ll))<<thisoffset))); |
500 |
|
|
501 |
|
// char *point = 0; |
502 |
|
|
503 |
|
// myc->BuildRealData(point); |
504 |
|
|
505 |
|
// point = (char*)cl->At(ll); |
506 |
|
|
507 |
|
|
508 |
|
|
509 |
|
|
510 |
|
|
511 |
|
// printf(" uncheck 0x%X \n",cl->UncheckedAt(ll)); |
512 |
|
|
513 |
|
|
514 |
|
|
515 |
|
// TLeafElement* leaf = (TLeafElement*)(cl->UncheckedAt(ll)); |
516 |
|
// Int_t n = n * leaf->GetLenStatic(); |
517 |
|
// Int_t n = leaf->GetLenStatic(); |
518 |
|
//printf(" len static is %i name %s\n",n,leaf->GetName()); |
519 |
|
// TLeaf *foglia = tb2->FindLeaf(tb2->GetName()); |
520 |
|
|
521 |
|
// printf(" foglia lunga %i 0x%X \n",foglia->GetLen(),foglia); |
522 |
|
|
523 |
|
// |
524 |
|
// char *pointer = (char*)cl->UnchekedAt(ll); |
525 |
|
// char *ladd = pointer + offset; |
526 |
|
// Int_t *count = (Int_t*)(pointer+((tb2->GetMethods())[ls])); |
527 |
|
|
528 |
|
|
529 |
|
|
530 |
|
// printf(" lunghezza del clone secondo getentriesfast %i \n",cl->GetEntriesFast()); |
531 |
|
// tb->GetInfo()->PrintValueClones(tb->GetName(), cl, tb->GetID(), tb->GetOffset(), length); |
532 |
|
// tb->GetInfo()->PrintValueClones(tb2->GetName(),cl,ls,tb->GetOffset(),44); |
533 |
|
// TStreamerElement *aElement = (TStreamerElement *)tb2->GetElement()// Int_t type2 = tb2->GetType(); |
534 |
|
// Int_t atype2 = tb2->GetStreamerType() - 20; |
535 |
|
// printf(" subsubsubleaves : %s type is %i \n",tb2->GetName(),type2); |
536 |
|
// Int_t len2 = (tb2->GetInfo()->GetLengths())[tb2->GetID()]; |
537 |
|
// Int_t length2 = min(len2,dlen); |
538 |
|
// switch (type2){ |
539 |
|
// case 0: |
540 |
|
// // |
541 |
|
// // IS A VARIABLE |
542 |
|
// // |
543 |
|
// // |
544 |
|
// // NAME |
545 |
|
// // |
546 |
|
// printf(" ATYPE IS %i \n",atype2); |
547 |
|
// printf(" %-15s =",tb2->GetName()); |
548 |
|
// j = 0; |
549 |
|
// // |
550 |
|
// // VALUES |
551 |
|
// // |
552 |
|
// if ( atype2 == 3 || atype2 == -17 ){ |
553 |
|
// while ( j < length2 ){ |
554 |
|
// if ( j < length2 -1 ){ |
555 |
|
// printf(" %llu ,",(ULong64_t)tb2->GetValue(j,0)); |
556 |
|
// } else { |
557 |
|
// printf(" %llu",(ULong64_t)tb2->GetValue(j,0)); |
558 |
|
// }; |
559 |
|
// j++; |
560 |
|
// }; |
561 |
|
// } else { |
562 |
|
// while ( j < length2 ){ |
563 |
|
// if ( j < length2 -1 ){ |
564 |
|
// printf(" %f ,",tb2->GetValue(j,0)); |
565 |
|
// } else { |
566 |
|
// printf(" %f",tb2->GetValue(j,0)); |
567 |
|
// }; |
568 |
|
// j++; |
569 |
|
// }; |
570 |
|
// }; |
571 |
|
// printf("\n"); |
572 |
|
// break; |
573 |
|
// }; |
574 |
|
}; |
575 |
|
|
576 |
|
}; |
577 |
|
}; |
578 |
|
|
579 |
|
|
580 |
|
|
581 |
|
|
582 |
|
// TBranchElement *p=(TBranchElement*)cl->At(ll); |
583 |
|
// Int_t plen = (p->GetInfo()->GetLengths())[p->GetID()]; |
584 |
|
// Int_t plen = -1; |
585 |
|
// printf("SubBranches : %s plen is %i \n",p->GetName(),plen); |
586 |
|
|
587 |
|
|
588 |
|
|
589 |
|
|
590 |
|
// TLeafElement* leaf = (TLeafElement*)(p->UncheckedAt(0)); |
591 |
|
// printf("xoxoxo leaf : %s plen is %i \n",leaf->GetName(),leaf->GetLen()); |
592 |
|
|
593 |
|
// Int_t n = tb->GetNdata(); |
594 |
|
// n = n * leaf->GetLenStatic(); |
595 |
|
// if (tb->GetInfo()) { |
596 |
|
// n = 16; |
597 |
|
// tb->GetInfo()->PrintValue(tb->GetName(), tb->GetAddress(), atype, n, 44); |
598 |
|
//tb->GetObject()->GetInfo()->PrintValue(tb->GetName(), tb->GetObject(), atype, n, lenmax); |
599 |
|
// } |
600 |
|
|
601 |
|
// TClonesArray* clones = (TClonesArray*) cl->At(ll); |
602 |
|
// if ( tb->GetInfo() ) { |
603 |
|
// tb->GetInfo()->PrintValueClones(tb->GetName(), cl, tb->GetID(), tb->GetOffset(), 44); |
604 |
|
// }; |
605 |
|
|
606 |
|
// b3 = (TBranch*)cl->At(l); |
607 |
|
// leaf_array = b3->GetListOfLeaves(); |
608 |
|
// for(Int_t l=0;l<(leaf_array->GetLast());l++){ |
609 |
|
// printf("Leaf : %s\n",((TLeaf*)leaf_array->At(l))->GetName()); |
610 |
|
|
611 |
|
|
612 |
|
// // TBranch *bcl = (TBranch*)leaf_array->At(l); |
613 |
|
// //bcl = b1->GetListOfLeaves(); |
614 |
|
// //for(Int_t l=0;l<(leaf_array->GetLast()+1);l++){ |
615 |
|
// // printf(" value: %f \n",otr->GetLeaf(((TLeaf*)leaf_array->At(l))->GetName())->GetValue(0)); |
616 |
|
// // printf(" value: %f \n",otr->GetLeaf(((TLeaf*)(branch_array->At(l))->GetName()))->GetValue(0)); |
617 |
|
// //}; |
618 |
|
// }; |
619 |
|
|
620 |
|
|
621 |
|
|
622 |
|
|
623 |
|
|
624 |
|
|
625 |
|
// // Int_t n = TMath::Min(10, tb->GetNdata()); |
626 |
|
// Int_t n = tb->GetNdata(); |
627 |
|
// Int_t atype2 = tb->GetStreamerType() + 20; |
628 |
|
|
629 |
|
// if (tb->GetStreamerType() == 1) { |
630 |
|
// // TVirtualStreamerInfo::kOffsetL + TVirtualStreamerInfo::kChar is |
631 |
|
// // printed as a string and could print weird characters. |
632 |
|
// // So we print an unsigned char instead (not perfect, but better). |
633 |
|
// atype2 = 20 + 11 ; |
634 |
|
// printf("qui\n"); |
635 |
|
// } |
636 |
|
// if (atype2 > 54) { |
637 |
|
// // FIXME: More logic required here (like in ReadLeaves) |
638 |
|
// printf(">54 %-15s = %d\n", tb->GetName(), tb->GetNdata()); |
639 |
|
|
640 |
|
// } else { |
641 |
|
// if (tb->GetStreamerType() > 20) { |
642 |
|
// atype2 -= 20; |
643 |
|
// // TObjArray *prova= otr->GetListOfLeaves(); |
644 |
|
// // TObjArray* leaf2 = (TObjArray*) prova->UncheckedAt(i); |
645 |
|
// //TLeaf* leaf = (TLeaf*)(otr->GetLeaf(tb->GetName())); |
646 |
|
// // TLeafElement* leaf = (TLeafElement*)((TLeaf*)(otr->GetListOfLeaves()->UncheckedAt(i))->GetBranch()->UncheckedAt(0)); |
647 |
|
// TLeafElement* leaf = (TLeafElement*)(cl->UncheckedAt(0)); |
648 |
|
// n = n * leaf->GetLenStatic(); |
649 |
|
// } |
650 |
|
// if (tb->GetInfo()) { |
651 |
|
// // n = 16; |
652 |
|
// tb->GetInfo()->PrintValue(tb->GetName(), tb->GetAddress(), atype2, n, 44); |
653 |
|
// //tb->GetObject()->GetInfo()->PrintValue(tb->GetName(), tb->GetObject(), atype, n, lenmax); |
654 |
|
// } |
655 |
|
// }; |
656 |
|
|
657 |
|
|
658 |
|
|
659 |
|
|
660 |
|
|
661 |
|
|
662 |
|
|
663 |
|
// //cl->First(); |
664 |
|
|
665 |
|
// b3 = (TBranch*)c1->First(); |
666 |
|
// leaf_array = cl->GetListOfLeaves(); |
667 |
|
// for(Int_t l=0;l<(leaf_array->GetLast()+1);l++){ |
668 |
|
// printf("Leaf : %s\n",((TLeaf*)leaf_array->At(l))->GetName()); |
669 |
|
// }; |
670 |
|
// // for (Int_t ln=0; ln<cl->GetEntriesFast() ;ln++){ |
671 |
|
// // |
672 |
|
|
673 |
|
// // |
674 |
|
// // }; |
675 |
|
|
676 |
|
// TBranchElement *tb2 = (TBranchElement*)cl->UncheckedAt(ln); |
677 |
|
// Int_t type2 = tb2->GetType(); |
678 |
|
// Int_t atype2 = tb2->GetStreamerType() - 20; |
679 |
|
// Int_t len2 = (tb2->GetInfo()->GetLengths())[tb2->GetID()]; |
680 |
|
// Int_t length2 = min(len2,dlen); |
681 |
|
// printf("SubSubBranches : %s type is %i \n",tb2->GetName(),type2); |
682 |
|
|
683 |
|
// switch (type2){ |
684 |
|
// case 0: |
685 |
|
// // |
686 |
|
// // IS A VARIABLE |
687 |
|
// // |
688 |
|
// // |
689 |
|
// // NAME |
690 |
|
// // |
691 |
|
// printf(" ATYPE IS %i \n",atype2); |
692 |
|
// printf(" %-15s =",tb2->GetName()); |
693 |
|
// j = 0; |
694 |
|
// // |
695 |
|
// // VALUES |
696 |
|
// // |
697 |
|
// if ( atype2 == 3 || atype2 == -17 ){ |
698 |
|
// while ( j < length2 ){ |
699 |
|
// if ( j < length2 -1 ){ |
700 |
|
// printf(" %llu ,",(ULong64_t)tb2->GetValue(j,0)); |
701 |
|
// } else { |
702 |
|
// printf(" %llu",(ULong64_t)tb2->GetValue(j,0)); |
703 |
|
// }; |
704 |
|
// j++; |
705 |
|
// }; |
706 |
|
// } else { |
707 |
|
// while ( j < length2 ){ |
708 |
|
// if ( j < length2 -1 ){ |
709 |
|
// printf(" %f ,",tb2->GetValue(j,0)); |
710 |
|
// } else { |
711 |
|
// printf(" %f",tb2->GetValue(j,0)); |
712 |
|
// }; |
713 |
|
// j++; |
714 |
|
// }; |
715 |
|
// }; |
716 |
|
// printf("\n"); |
717 |
|
// break; |
718 |
|
// }; |
719 |
|
// //printf(" Element %i name %s\n",ln,cl->GetName()); |
720 |
|
// }; |
721 |
|
|
722 |
|
// TBranchElement *tb = (TBranchElement*)branch_array->At(l); |
723 |
|
// Int_t type = tb->GetType(); |
724 |
|
// printf("SubBranches : %s type is %i tb getname %s\n",((TBranch*)branch_array->At(l))->GetName(),type,tb->GetName()); |
725 |
|
// switch (type){ |
726 |
|
// case 0: |
727 |
|
// // |
728 |
|
// // IS A VARIABLE |
729 |
|
// // |
730 |
|
// Int_t atype = tb->GetStreamerType() - 20; |
731 |
|
// Int_t len = (tb->GetInfo()->GetLengths())[tb->GetID()]; |
732 |
|
// Int_t length = min(len,dlen); |
733 |
|
// // |
734 |
|
// // NAME |
735 |
|
// // |
736 |
|
// printf(" ATYPE IS %i \n",atype); |
737 |
|
// printf(" %-15s =",((TBranch*)branch_array->At(l))->GetName()); |
738 |
|
// j = 0; |
739 |
|
// // |
740 |
|
// // VALUES |
741 |
|
// // |
742 |
|
// if ( atype == 3 || atype == -17 ){ |
743 |
|
// while ( j < length ){ |
744 |
|
// if ( j < length -1 ){ |
745 |
|
// printf(" %llu ,",(ULong64_t)tb->GetValue(j,0)); |
746 |
|
// } else { |
747 |
|
// printf(" %llu",(ULong64_t)tb->GetValue(j,0)); |
748 |
|
// }; |
749 |
|
// j++; |
750 |
|
// }; |
751 |
|
// } else { |
752 |
|
// while ( j < length ){ |
753 |
|
// if ( j < length -1 ){ |
754 |
|
// printf(" %f ,",tb->GetValue(j,0)); |
755 |
|
// } else { |
756 |
|
// printf(" %f",tb->GetValue(j,0)); |
757 |
|
// }; |
758 |
|
// j++; |
759 |
|
// }; |
760 |
|
// }; |
761 |
|
// printf("\n"); |
762 |
|
|
763 |
|
|
764 |
|
break; |
765 |
|
}; |
766 |
|
// b3 = (TBranch*)branch_array->At(l); |
767 |
|
// leaf_array = b1->GetListOfLeaves(); |
768 |
|
// for(Int_t l=0;l<(leaf_array->GetLast()+1);l++){ |
769 |
|
// printf("Leaf : %s\n",((TLeaf*)leaf_array->At(l))->GetName()); |
770 |
|
// printf(" value: %f \n",otr->GetLeaf(((TLeaf*)leaf_array->At(l))->GetName())->GetValue(0)); |
771 |
|
// printf(" value: %f \n",otr->GetLeaf(((TLeaf*)(branch_array->At(l))->GetName()))->GetValue(0)); |
772 |
|
// }; |
773 |
|
// }; |
774 |
|
|
775 |
|
}; |
776 |
|
|
777 |
|
}; |
778 |
|
|
779 |
|
|
780 |
|
|
781 |
|
|
782 |
|
|
783 |
|
|
784 |
|
|
785 |
|
|
786 |
|
|
787 |
|
|
788 |
|
|
789 |
|
|
790 |
|
|
791 |
|
|
792 |
|
|
793 |
|
|
794 |
|
|
795 |
|
|
796 |
|
|
797 |
|
|
798 |
|
|
799 |
|
|
800 |
|
|
801 |
|
|
802 |
|
|
803 |
|
|
804 |
|
|
805 |
void FEVdetector::GetGeneralInfo(){ |
void FEVdetector::GetGeneralInfo(){ |
806 |
// |
// |
807 |
// Get Orbital Time information and header event number |
// Get Orbital Time information and header event number |
847 |
trcs = (TString)trc.str().c_str(); |
trcs = (TString)trc.str().c_str(); |
848 |
} else { |
} else { |
849 |
headcold = headc; |
headcold = headc; |
850 |
headc = oinfoL2->pkt_num; // to be changed as soon as we will have obt in the level2 file! |
if ( var.ORB ){ |
851 |
OBT = oinfoL2->OBT; // to be changed as soon as we will have obt in the level2 file! |
headc = L2->GetOrbitalInfo()->pkt_num; |
852 |
DOBT = OBT - OOBT; |
OBT = L2->GetOrbitalInfo()->OBT; |
853 |
OOBT = OBT; |
DOBT = OBT - OOBT; |
854 |
if ( thisentry == minevent || DOBT < 0 || (headc-headcold-1)!=0 ) DOBT = 0; |
OOBT = OBT; |
855 |
var.etime = OBT; |
if ( thisentry == minevent || DOBT < 0 || (headc-headcold-1)!=0 ) DOBT = 0; |
856 |
|
var.etime = OBT; |
857 |
|
} else { |
858 |
|
var.etime = 0; |
859 |
|
}; |
860 |
// |
// |
861 |
// who gave the trigger? |
// who gave the trigger? |
862 |
// |
// |
863 |
calotrig = 0; |
Int_t trigconf = 0; |
864 |
if ( L2->patterntrig[0] ) calotrig = 1; |
if ( var.TRG ){ |
865 |
toftrig = 0; |
calotrig = 0; |
866 |
if ( L2->patterntrig[2] || L2->patterntrig[3] || L2->patterntrig[4] || L2->patterntrig[5] ) toftrig = 1; |
if ( L2->GetTrigLevel2()->patterntrig[0] ) calotrig = 1; |
867 |
s4pulser = 0; |
toftrig = 0; |
868 |
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; |
869 |
// |
s4pulser = 0; |
870 |
// 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; |
871 |
// S4 sometimes could not set the flag even if the trigger is given. This is a workaround to fix this "bug": |
// |
872 |
// |
// TOF and calorimeter when giving a trigger will always set this flag since the time window of the signal is greater than 100 ns. |
873 |
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": |
874 |
// |
// |
875 |
Int_t trigconf = L2->trigconf; |
if ( !calotrig && !toftrig ) s4pulser = 1; |
876 |
|
// |
877 |
|
trigconf = L2->GetTrigLevel2()->trigconf; |
878 |
|
} else { |
879 |
|
trigconf = 0; |
880 |
|
} |
881 |
stringstream trc; |
stringstream trc; |
882 |
trc.str(""); |
trc.str(""); |
883 |
if ( trigconf & (1<<0) ) trc << "TOF1"; |
if ( trigconf & (1<<0) ) trc << "TOF1"; |
986 |
// |
// |
987 |
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);"); |
988 |
// |
// |
989 |
if ( level.file == 2 ) isOK = gApplication->ProcessLine("filter((PamLevel2 *)L2,2);"); |
// if ( level.file == 2 ) isOK = gApplication->ProcessLine("filter((PamLevel2 *)L2,2);"); |
990 |
|
if ( level.file == 2 ) isOK = gApplication->ProcessLine("filter();"); |
991 |
// |
// |
992 |
// progress bar in text window |
// progress bar in text window |
993 |
// |
// |
1000 |
// |
// |
1001 |
} |
} |
1002 |
|
|
1003 |
void FEVdetector::Load(TTree &mainotr, TFile &mainfile){ |
Int_t FEVdetector::Load(TTree &mainotr, TFile &mainfile){ |
1004 |
|
//Int_t FEVdetector::Load(TChain &mainotr, TFile &mainfile){ |
1005 |
file = &mainfile; |
file = &mainfile; |
1006 |
otr = &mainotr; |
otr = &mainotr; |
1007 |
L2 = new PamLevel2(); |
L2 = new PamLevel2(); |
1008 |
// |
// |
1009 |
if ( level.file == 2 ){ |
if ( level.file == 2 ){ |
1010 |
otr = L2->LoadPamTrees(file); |
// otr = L2->LoadPamTrees(file); |
1011 |
|
printf(" %s \n",ddec.Data()); |
1012 |
|
// otr->Refresh(); |
1013 |
|
// otr->Clear(); |
1014 |
|
// otr = new TTree(); |
1015 |
|
otr = L2->GetPamTree(file,ddec.Data()); |
1016 |
|
// |
1017 |
|
if ( !otr ) return(0); |
1018 |
// ******************** |
// ******************** |
1019 |
// load magnetic field |
// load magnetic field |
1020 |
// ******************** |
// ******************** |
1021 |
const char *pam_calib = pathtocalibration(); |
// const char *pam_calib = pathtocalibration(); |
1022 |
// |
// |
1023 |
stringstream magfie; |
// stringstream magfie; |
1024 |
magfie.str(""); |
// magfie.str(""); |
1025 |
magfie << pam_calib; |
// magfie << "/localdisk/mocchiut/test/calib/trk-param/field_param-0/"; |
1026 |
magfie << "/trk-param/field_param-0/"; |
// magfie << pam_calib; |
1027 |
|
//magfie << "/trk-param/field_param-0/"; |
1028 |
// |
// |
1029 |
L2->LoadField(magfie.str().c_str()); |
//L2->GetTrkLevel2()->LoadField(magfie.str().c_str()); |
1030 |
} else { |
} else { |
1031 |
// |
// |
1032 |
// load calorimeter ADC2MIP conversion file |
// load calorimeter ADC2MIP conversion file |
1066 |
// |
// |
1067 |
}; |
}; |
1068 |
// |
// |
|
|
|
1069 |
// |
// |
1070 |
trigger = new pamela::trigger::TriggerEvent(); |
trigger = new pamela::trigger::TriggerEvent(); |
1071 |
eh = new pamela::EventHeader(); |
eh = new pamela::EventHeader(); |
1072 |
ph = new pamela::PscuHeader(); |
ph = new pamela::PscuHeader(); |
1073 |
oinfoL2 = new OrbitalInfo(); |
// oinfoL2 = new OrbitalInfo(); |
1074 |
runinfo = new ItoRunInfo(file); |
runinfo = new ItoRunInfo(file); |
1075 |
// |
// |
1076 |
de = new pamela::calorimeter::CalorimeterEvent(); |
de = new pamela::calorimeter::CalorimeterEvent(); |
1084 |
otr->SetBranchAddress("Trigger", &trigger); |
otr->SetBranchAddress("Trigger", &trigger); |
1085 |
otr->SetBranchAddress("Header", &eh); |
otr->SetBranchAddress("Header", &eh); |
1086 |
}; |
}; |
1087 |
if ( level.file == 2 ){ |
if ( level.file == 2 && var.RUN){ |
1088 |
otr->AddFriend("OrbitalInfo", file); |
// otr->AddFriend("OrbitalInfo", file); |
1089 |
otr->SetBranchAddress("OrbitalInfo", &oinfoL2); |
// otr->SetBranchAddress("OrbitalInfo", &oinfoL2); |
1090 |
runinfo->Read(0ULL); |
runinfo->Read(0ULL); |
1091 |
}; |
}; |
1092 |
// |
// |
1160 |
printf("Show the Time of Flight detector, LEVEL2 data \n"); |
printf("Show the Time of Flight detector, LEVEL2 data \n"); |
1161 |
}; |
}; |
1162 |
}; |
}; |
1163 |
|
// |
1164 |
|
// printf("qua\n"); |
1165 |
|
return(1); |
1166 |
// |
// |
1167 |
} |
} |
1168 |
|
|
2564 |
ms11b[i] = 0.; |
ms11b[i] = 0.; |
2565 |
} else { |
} else { |
2566 |
ms11b[i] = 1.; |
ms11b[i] = 1.; |
2567 |
}; }; |
}; |
2568 |
|
}; |
2569 |
for ( Int_t i = 0; i<6; i++ ) { |
for ( Int_t i = 0; i<6; i++ ) { |
2570 |
mt12[0][i] = tof->tdc[ch12a[i]][hb12a[i]]; |
mt12[0][i] = tof->tdc[ch12a[i]][hb12a[i]]; |
2571 |
mt12[1][i] = tof->tdc[ch12b[i]][hb12b[i]]; |
mt12[1][i] = tof->tdc[ch12b[i]][hb12b[i]]; |
2664 |
// |
// |
2665 |
var.tofraw = 0; |
var.tofraw = 0; |
2666 |
// |
// |
2667 |
repuntil = L2->ToFLevel2::ntrk(); |
if ( level.file == 2 ) repuntil = L2->GetToFLevel2()->ntrk(); |
2668 |
// printf("repuntil = %i \n",repuntil); |
// printf("repuntil = %i \n",repuntil); |
2669 |
//repuntil = L2->GetNTracks(); |
//repuntil = L2->GetNTracks(); |
2670 |
// |
// |
2679 |
// |
// |
2680 |
if ( repuntil == 1 || var.tofraw ){ |
if ( repuntil == 1 || var.tofraw ){ |
2681 |
numtr = 0; |
numtr = 0; |
2682 |
ptt = L2->GetToFTrkVar(0); |
ptt = L2->GetToFLevel2()->GetToFTrkVar(0); |
2683 |
repeat = false; |
repeat = false; |
2684 |
} else { |
} else { |
2685 |
// |
// |
2686 |
// |
// |
2687 |
if ( numtr >= repuntil-1 ) repeat = false; |
if ( numtr >= repuntil-1 ) repeat = false; |
2688 |
// |
// |
2689 |
ptt = L2->GetToFTrkVar(numtr); |
ptt = L2->GetToFLevel2()->GetToFTrkVar(numtr); |
2690 |
}; |
}; |
2691 |
// |
// |
2692 |
xp11[0] = 0.; |
xp11[0] = 0.; |
2702 |
// |
// |
2703 |
Float_t adc[4][12]; |
Float_t adc[4][12]; |
2704 |
Float_t tdc[4][12]; |
Float_t tdc[4][12]; |
2705 |
L2->GetMatrix(numtr,adc,tdc); |
L2->GetToFLevel2()->GetMatrix(numtr,adc,tdc); |
2706 |
|
|
2707 |
// |
// |
2708 |
for ( Int_t i = 0; i<8; i++ ) { |
for ( Int_t i = 0; i<8; i++ ) { |
3346 |
// full infos from ac |
// full infos from ac |
3347 |
// |
// |
3348 |
if ( level.file == 2 ){ |
if ( level.file == 2 ){ |
3349 |
hitmapA = L2->hitmap[0]; |
hitmapA = L2->GetAcLevel2()->hitmap[0]; |
3350 |
hitmapB = L2->hitmap[1]; |
hitmapB = L2->GetAcLevel2()->hitmap[1]; |
3351 |
hitstatusA = L2->hitstatus[0]; |
hitstatusA = L2->GetAcLevel2()->hitstatus[0]; |
3352 |
hitstatusB = L2->hitstatus[1]; |
hitstatusB = L2->GetAcLevel2()->hitstatus[1]; |
3353 |
}; |
}; |
3354 |
// |
// |
3355 |
// |
// |
4223 |
pcasp4b->Draw("f"); |
pcasp4b->Draw("f"); |
4224 |
pcasp4b->Draw(); |
pcasp4b->Draw(); |
4225 |
}; |
}; |
4226 |
Float_t alfa = 1.2020334; |
// Float_t alfax = 1.2020334; |
4227 |
|
Float_t alfax = 1.22157778; |
4228 |
|
Float_t alfay = 1.27393111; |
4229 |
Float_t lcrd = 0.1815/2.; |
Float_t lcrd = 0.1815/2.; |
4230 |
Float_t wcrd = 0.008; |
Float_t wcrd = 0.008; |
4231 |
if ( true ){ |
if ( true ){ |
4436 |
// |
// |
4437 |
// Float_t cardcx = 0.143168*var.sfx; |
// Float_t cardcx = 0.143168*var.sfx; |
4438 |
//Float_t cardcy = 0.1475*var.sfy; |
//Float_t cardcy = 0.1475*var.sfy; |
4439 |
Float_t cardcx = 0.153168*var.sfx; |
// |
4440 |
Float_t cardcy = 0.1575*var.sfy; |
// Float_t cardcx = 0.153168*var.sfx; |
4441 |
Float_t acrdx[4] = {-lcrd*cos(alfa), lcrd*cos(alfa), -lcrd*cos(alfa)+wcrd*sin(alfa), -lcrd*cos(alfa)}; |
// |
4442 |
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; |
4443 |
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; |
4444 |
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; |
4445 |
|
Float_t acrdx[4] = {-lcrd*cos(alfax), lcrd*cos(alfax), -lcrd*cos(alfax)+wcrd*sin(alfax), -lcrd*cos(alfax)}; |
4446 |
|
Float_t acrdy[4] = {-lcrd*sin(alfax), lcrd*sin(alfax), -lcrd*sin(alfax)-wcrd*cos(alfax), -lcrd*sin(alfax)}; |
4447 |
|
Float_t bcrdx[4] = { lcrd*cos(alfax), lcrd*cos(alfax)+wcrd*sin(alfax), -lcrd*cos(alfax)+wcrd*sin(alfax), lcrd*cos(alfax)}; |
4448 |
|
Float_t bcrdy[4] = { lcrd*sin(alfax), lcrd*sin(alfax)-wcrd*cos(alfax), -lcrd*sin(alfax)-wcrd*cos(alfax), lcrd*sin(alfax)}; |
4449 |
|
|
4450 |
// |
// |
4451 |
// CARD3 X/ Y |
// CARD3 X/ Y |
4505 |
}; |
}; |
4506 |
|
|
4507 |
if ( true ){ |
if ( true ){ |
4508 |
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)}; |
4509 |
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)}; |
4510 |
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)}; |
4511 |
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)}; |
4512 |
// |
// |
4513 |
// CARD - Y-view |
// CARD - Y-view |
4514 |
// |
// |
4515 |
Float_t cardcx = 0.12*var.sfx; |
// Float_t cardcx = 0.12*var.sfx; |
4516 |
Float_t cardcy = 0.1475*var.sfy; |
Float_t cardcx = (0.16014*(1.-lcrd*cos(alfay)))*var.sfx; |
4517 |
|
// Float_t cardcy = 0.178818*var.sfy; |
4518 |
|
Float_t cardcy = (0.178818*(1.-lcrd*sin(alfay)))*var.sfy; |
4519 |
|
// Float_t cardcy = 0.1475*var.sfy; |
4520 |
// |
// |
4521 |
// CARD4 X Y/ |
// CARD4 X Y/ |
4522 |
// |
// |
4615 |
// |
// |
4616 |
if ( level.file == 2 ){ |
if ( level.file == 2 ){ |
4617 |
for ( Int_t j = 0; j<3; j++ ) { |
for ( Int_t j = 0; j<3; j++ ) { |
4618 |
if ( L2->S4adc != 32. ) ms4[j] = L2->S4calibrated; |
if ( L2->GetS4Level2()->S4adc != 32. ) ms4[j] = L2->GetS4Level2()->S4calibrated; |
4619 |
}; |
}; |
4620 |
}; |
}; |
4621 |
// |
// |
4700 |
}; |
}; |
4701 |
}; |
}; |
4702 |
if ( level.file == 2 ){ |
if ( level.file == 2 ){ |
4703 |
yUpperTrig = (Int_t)L2->trigPhysics; |
yUpperTrig = (Int_t)L2->GetNDLevel2()->trigPhysics; |
4704 |
yUpperBk = (Int_t)L2->upperBack; |
yUpperBk = (Int_t)L2->GetNDLevel2()->upperBack; |
4705 |
yBottomBk = (Int_t)L2->bottomBack; |
yBottomBk = (Int_t)L2->GetNDLevel2()->bottomBack; |
4706 |
}; |
}; |
4707 |
// |
// |
4708 |
var.trup = yUpperTrig; |
var.trup = yUpperTrig; |
5009 |
// |
// |
5010 |
// singlets X |
// singlets X |
5011 |
// |
// |
5012 |
for (Int_t sing = 0; sing < L2->nclsx(); sing++){ |
for (Int_t sing = 0; sing < L2->GetTrkLevel2()->nclsx(); sing++){ |
5013 |
TClonesArray &t = *(L2->SingletX); |
TClonesArray &t = *(L2->GetTrkLevel2()->SingletX); |
5014 |
TrkSinglet *singlet = (TrkSinglet*)t[sing]; |
TrkSinglet *singlet = (TrkSinglet*)t[sing]; |
5015 |
x = (singlet->coord[0]+singlet->coord[1])/2.; |
x = (singlet->coord[0]+singlet->coord[1])/2.; |
5016 |
// |
// |
5034 |
// |
// |
5035 |
// singlets Y |
// singlets Y |
5036 |
// |
// |
5037 |
for (Int_t sing = 0; sing < L2->nclsy(); sing++){ |
for (Int_t sing = 0; sing < L2->GetTrkLevel2()->nclsy(); sing++){ |
5038 |
TClonesArray &t = *(L2->SingletY); |
TClonesArray &t = *(L2->GetTrkLevel2()->SingletY); |
5039 |
TrkSinglet *singlet = (TrkSinglet*)t[sing]; |
TrkSinglet *singlet = (TrkSinglet*)t[sing]; |
5040 |
// |
// |
5041 |
Int_t planepad = (singlet->plane - 1)* 2; |
Int_t planepad = (singlet->plane - 1)* 2; |
5080 |
dcol = 2; |
dcol = 2; |
5081 |
}; |
}; |
5082 |
// |
// |
5083 |
if ( L2->GetNTracks() > 0 ){ |
if ( L2->GetTrkLevel2()->GetNTracks() > 0 ){ |
5084 |
for (Int_t nt = 0; nt < L2->GetNTracks(); nt++){ |
for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ |
5085 |
TrkTrack *track = L2->GetTrack(nt); |
PamTrack *ptrack= L2->GetTrack(nt); |
5086 |
|
TrkTrack *track = ptrack->GetTrkTrack(); |
5087 |
if ( nt == 0 ){ |
if ( nt == 0 ){ |
5088 |
var.rig = 0.; |
var.rig = 0.; |
5089 |
if ( track->al[4] != 0. ) var.rig = 1./track->al[4]; |
if ( track->al[4] != 0. ) var.rig = 1./track->al[4]; |
5179 |
// |
// |
5180 |
// first of all plot crosses relatives to tracks |
// first of all plot crosses relatives to tracks |
5181 |
// |
// |
5182 |
if ( L2->GetNTracks() > 0 ){ |
if ( L2->GetTrkLevel2()->GetNTracks() > 0 ){ |
5183 |
for (Int_t nt = 0; nt < L2->GetNTracks(); nt++){ |
for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ |
5184 |
TrkTrack *track = L2->GetTrack(nt); |
TrkTrack *track = L2->GetTrkLevel2()->GetTrack(nt); |
5185 |
for (Int_t plane = 0; plane<6; plane++){ |
for (Int_t plane = 0; plane<6; plane++){ |
5186 |
// |
// |
5187 |
x = track->xm[plane]; |
x = track->xm[plane]; |
5227 |
// |
// |
5228 |
// try to plot crosses relative to singlets |
// try to plot crosses relative to singlets |
5229 |
// |
// |
5230 |
if ( L2->nclsx() > 0 && L2->nclsy() > 0 ){ |
if ( L2->GetTrkLevel2()->nclsx() > 0 && L2->GetTrkLevel2()->nclsy() > 0 ){ |
5231 |
for (Int_t plane = 1; plane<7; plane++){ |
for (Int_t plane = 1; plane<7; plane++){ |
5232 |
// |
// |
5233 |
// 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: |
5241 |
TArrayF *array2 = new TArrayF(5000); |
TArrayF *array2 = new TArrayF(5000); |
5242 |
TArrayF *sigarrax = new TArrayF(5000); |
TArrayF *sigarrax = new TArrayF(5000); |
5243 |
TArrayF *sigarray = new TArrayF(5000); |
TArrayF *sigarray = new TArrayF(5000); |
5244 |
for (Int_t sing = 0; sing < L2->nclsx(); sing++){ |
for (Int_t sing = 0; sing < L2->GetTrkLevel2()->nclsx(); sing++){ |
5245 |
TClonesArray &t = *(L2->SingletX); |
TClonesArray &t = *(L2->GetTrkLevel2()->SingletX); |
5246 |
TrkSinglet *singlet = (TrkSinglet*)t[sing]; |
TrkSinglet *singlet = (TrkSinglet*)t[sing]; |
5247 |
if ( singlet->plane == plane ){ |
if ( singlet->plane == plane ){ |
5248 |
arrax->AddAt(((singlet->coord[0]+singlet->coord[1])/2.),totsx); |
arrax->AddAt(((singlet->coord[0]+singlet->coord[1])/2.),totsx); |
5271 |
totsx++; |
totsx++; |
5272 |
}; |
}; |
5273 |
}; |
}; |
5274 |
for (Int_t sing = 0; sing < L2->nclsy(); sing++){ |
for (Int_t sing = 0; sing < L2->GetTrkLevel2()->nclsy(); sing++){ |
5275 |
TClonesArray &t = *(L2->SingletY); |
TClonesArray &t = *(L2->GetTrkLevel2()->SingletY); |
5276 |
TrkSinglet *singlet = (TrkSinglet*)t[sing]; |
TrkSinglet *singlet = (TrkSinglet*)t[sing]; |
5277 |
if ( singlet->plane == plane ){ |
if ( singlet->plane == plane ){ |
5278 |
array1->AddAt(singlet->coord[0],totsy); |
array1->AddAt(singlet->coord[0],totsy); |
5497 |
// |
// |
5498 |
// |
// |
5499 |
// |
// |
5500 |
|
if ( var.CALO && false ){ |
5501 |
|
if ( L2->GetCaloLevel2()->npcfit[0] > 0 && L2->GetCaloLevel2()->npcfit[1] > 0 ){ |
5502 |
|
Float_t calx[22]; |
5503 |
|
Float_t caly[22]; |
5504 |
|
Float_t calzx[22]; |
5505 |
|
Float_t calzy[22]; |
5506 |
|
Float_t zpiano[22]; |
5507 |
|
zpiano[0] = (CTZ+118.)*var.sfy/1000.; |
5508 |
|
for (Int_t plane = 1; plane < 22; plane++){ |
5509 |
|
if ( !(plane%2) ){ |
5510 |
|
zpiano[plane] = zpiano[plane-1] - 8.09*var.sfy/1000.; |
5511 |
|
}else { |
5512 |
|
zpiano[plane] = zpiano[plane-1] - 10.09*var.sfy/1000.; |
5513 |
|
}; |
5514 |
|
}; |
5515 |
|
for (Int_t plane = 0; plane < 22; plane++){ |
5516 |
|
calx[plane] = (L2->GetCaloLevel2()->cbar[plane][0]/100.)*var.sfx + var.xxvc;; |
5517 |
|
caly[plane] = (L2->GetCaloLevel2()->cbar[plane][1]/100.)*var.sfx + var.xyvc; |
5518 |
|
// calzx[plane] = zpiano[plane] -5.81*var.sfy/1000. + var.yxvc; |
5519 |
|
calzx[plane] = zpiano[plane] + var.yxvc; |
5520 |
|
calzy[plane] = zpiano[plane] + var.yyvc; |
5521 |
|
// printf(" calx %f caly %f calzx %f calzy %f \n",calx[plane],caly[plane],calzx[plane],calzy[plane]); |
5522 |
|
}; |
5523 |
|
// |
5524 |
|
// Calorimeter track |
5525 |
|
// |
5526 |
|
Int_t trcol = 30; |
5527 |
|
if ( var.bw ){ |
5528 |
|
trcol = 14; |
5529 |
|
} else { |
5530 |
|
trcol = 44; |
5531 |
|
}; |
5532 |
|
thefigure->cd(); |
5533 |
|
TPolyLine *trakx = new TPolyLine(22,calx,calzx); |
5534 |
|
trakx->SetLineColor(trcol); |
5535 |
|
if ( L2->GetCaloLevel2()->fitmode[0] == 1 ) trakx->SetLineStyle(3); |
5536 |
|
if ( L2->GetCaloLevel2()->fitmode[0] == 2 ) trakx->SetLineStyle(4); |
5537 |
|
trakx->SetLineWidth(2); |
5538 |
|
trakx->Draw(); |
5539 |
|
TPolyLine *traky = new TPolyLine(22,caly,calzy); |
5540 |
|
traky->SetLineColor(trcol); |
5541 |
|
if ( L2->GetCaloLevel2()->fitmode[1] == 1 ) traky->SetLineStyle(3); |
5542 |
|
if ( L2->GetCaloLevel2()->fitmode[1] == 2 ) traky->SetLineStyle(4); |
5543 |
|
traky->SetLineWidth(2); |
5544 |
|
traky->Draw(); |
5545 |
|
}; |
5546 |
|
if ( L2->GetCaloLevel2()->npcfit[2] > 0 ){ |
5547 |
|
Float_t calx[22]; |
5548 |
|
Float_t caly[22]; |
5549 |
|
Float_t calzx[22]; |
5550 |
|
Float_t calzy[22]; |
5551 |
|
Float_t zpiano[22]; |
5552 |
|
zpiano[0] = (CTZ+118.)*var.sfy/1000.; |
5553 |
|
for (Int_t plane = 1; plane < 22; plane++){ |
5554 |
|
if ( !(plane%2) ){ |
5555 |
|
zpiano[plane] = zpiano[plane-1] - 8.09*var.sfy/1000.; |
5556 |
|
}else { |
5557 |
|
zpiano[plane] = zpiano[plane-1] - 10.09*var.sfy/1000.; |
5558 |
|
}; |
5559 |
|
}; |
5560 |
|
// |
5561 |
|
// |
5562 |
|
CaloTrkVar *ctra = L2->GetCaloStoredTrack(-1); |
5563 |
|
// |
5564 |
|
for (Int_t plane = 0; plane < 22; plane++){ |
5565 |
|
calx[plane] = (ctra->tbar[plane][0]/100.)*var.sfx + var.xxvc;; |
5566 |
|
caly[plane] = (ctra->tbar[plane][1]/100.)*var.sfx + var.xyvc; |
5567 |
|
// calzx[plane] = zpiano[plane] -5.81*var.sfy/1000. + var.yxvc; |
5568 |
|
calzx[plane] = zpiano[plane] + var.yxvc; |
5569 |
|
calzy[plane] = zpiano[plane] + var.yyvc; |
5570 |
|
// printf(" calx %f caly %f calzx %f calzy %f \n",calx[plane],caly[plane],calzx[plane],calzy[plane]); |
5571 |
|
}; |
5572 |
|
// |
5573 |
|
// Calorimeter track |
5574 |
|
// |
5575 |
|
Int_t trcol = 30; |
5576 |
|
if ( var.bw ){ |
5577 |
|
trcol = 16; |
5578 |
|
} else { |
5579 |
|
trcol = 46; |
5580 |
|
}; |
5581 |
|
thefigure->cd(); |
5582 |
|
TPolyLine *trakx = new TPolyLine(22,calx,calzx); |
5583 |
|
trakx->SetLineColor(trcol); |
5584 |
|
trakx->SetLineStyle(3); |
5585 |
|
trakx->SetLineWidth(2); |
5586 |
|
trakx->Draw(); |
5587 |
|
TPolyLine *traky = new TPolyLine(22,caly,calzy); |
5588 |
|
traky->SetLineColor(trcol); |
5589 |
|
traky->SetLineStyle(3); |
5590 |
|
traky->SetLineWidth(2); |
5591 |
|
traky->Draw(); |
5592 |
|
}; |
5593 |
|
}; |
5594 |
|
// |
5595 |
if ( !var.TRK || level.file != 2 ) return; |
if ( !var.TRK || level.file != 2 ) return; |
5596 |
// |
// |
5597 |
if ( L2->GetNTracks() > 0 ){ |
if ( L2->GetTrkLevel2()->GetNTracks() > 0 ){ |
5598 |
for (Int_t nt = 0; nt < L2->GetNTracks(); nt++){ |
for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ |
5599 |
TrkTrack *track = L2->GetTrack(nt); |
|
5600 |
|
// TrkTrack *track = L2->GetTrkLevel2()->GetTrack(nt); |
5601 |
|
PamTrack *ptrack = L2->GetTrack(nt); |
5602 |
|
TrkTrack *track = ptrack->GetTrkTrack(); |
5603 |
Int_t npoint = 100; |
Int_t npoint = 100; |
5604 |
Float_t zin[100]; |
Float_t zin[100]; |
5605 |
Double_t xout[100]; |
Double_t xout[100]; |
5669 |
}; |
}; |
5670 |
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; |
5671 |
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; |
5672 |
|
// printf("tx[e] %f ty [e] %f tzx %f tzy %f \n",tx[e],ty[e],tzx[e],tzy[e]); |
5673 |
}; |
}; |
5674 |
// |
// |
5675 |
// From S1 to CALO |
// From S1 to CALO |
6219 |
// |
// |
6220 |
stringstream xvev; |
stringstream xvev; |
6221 |
stringstream yvev; |
stringstream yvev; |
6222 |
for (Int_t ii = 0; ii < L2->nstrip; ii++){ |
for (Int_t ii = 0; ii < L2->GetCaloLevel2()->nstrip; ii++){ |
6223 |
Int_t colo; |
Int_t colo; |
6224 |
Int_t l; |
Int_t l; |
6225 |
Int_t m; |
Int_t m; |
6226 |
Int_t n; |
Int_t n; |
6227 |
Float_t mip = L2->DecodeEstrip(ii,l,m,n); |
Float_t mip = L2->GetCaloLevel1()->DecodeEstrip(ii,l,m,n); |
6228 |
if ( var.bw ){ |
if ( var.bw ){ |
6229 |
colo = -1; |
colo = -1; |
6230 |
} else { |
} else { |
6258 |
}; |
}; |
6259 |
pd1->Update(); |
pd1->Update(); |
6260 |
pd2->Update(); |
pd2->Update(); |
6261 |
var.qtot=(int)L2->qtot; |
var.qtot=(int)L2->GetCaloLevel2()->qtot; |
6262 |
var.nstrip=(int)L2->nstrip; |
var.nstrip=(int)L2->GetCaloLevel2()->nstrip; |
6263 |
}; |
}; |
6264 |
} |
} |
6265 |
|
|