| 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]]; |
| 2658 |
// |
// |
| 2659 |
// |
// |
| 2660 |
Bool_t repeat = true; |
Bool_t repeat = true; |
| 2661 |
Int_t numtr = 1; |
// Int_t numtr = 1; |
| 2662 |
|
Int_t numtr = 0; |
| 2663 |
Int_t repuntil = 0; |
Int_t repuntil = 0; |
| 2664 |
// |
// |
| 2665 |
// |
// |
| 2666 |
var.tofraw = 0; |
var.tofraw = 0; |
| 2667 |
// |
// |
| 2668 |
repuntil = L2->ToFLevel2::ntrk(); |
// if ( level.file == 2 ) repuntil = L2->GetToFLevel2()->ntrk(); |
| 2669 |
// printf("repuntil = %i \n",repuntil); |
// printf("repuntil = %i \n",repuntil); |
| 2670 |
|
if ( level.file == 2 ) repuntil = L2->GetTrkLevel2()->GetNTracks(); |
| 2671 |
//repuntil = L2->GetNTracks(); |
//repuntil = L2->GetNTracks(); |
| 2672 |
// |
// |
| 2673 |
while ( repeat ){ |
while ( repeat ){ |
| 2677 |
// |
// |
| 2678 |
// |
// |
| 2679 |
ToFTrkVar *ptt = 0; |
ToFTrkVar *ptt = 0; |
| 2680 |
|
PamTrack *ptrack = 0; |
| 2681 |
|
Float_t adc[4][12]; |
| 2682 |
|
Float_t tdc[4][12]; |
| 2683 |
|
memset(adc,0,4*12*sizeof(Float_t)); |
| 2684 |
|
memset(tdc,0,4*12*sizeof(Float_t)); |
| 2685 |
// |
// |
| 2686 |
// |
// |
| 2687 |
if ( repuntil == 1 || var.tofraw ){ |
if ( repuntil == 0 || var.tofraw ){ |
| 2688 |
numtr = 0; |
numtr = 0; |
| 2689 |
ptt = L2->GetToFTrkVar(0); |
ptt = L2->GetToFLevel2()->GetToFTrkVar(0); |
| 2690 |
repeat = false; |
repeat = false; |
| 2691 |
} else { |
} else { |
| 2692 |
// |
// |
| 2693 |
// |
// |
| 2694 |
if ( numtr >= repuntil-1 ) repeat = false; |
if ( numtr >= repuntil-1 ) repeat = false; |
| 2695 |
// |
// |
| 2696 |
ptt = L2->GetToFTrkVar(numtr); |
// ptt = L2->GetToFLevel2()->GetToFTrkVar(numtr); |
| 2697 |
|
ptrack = L2->GetTrack(numtr); |
| 2698 |
|
ptt = ptrack->GetToFTrack(); |
| 2699 |
}; |
}; |
| 2700 |
// |
// |
| 2701 |
xp11[0] = 0.; |
xp11[0] = 0.; |
| 2709 |
// |
// |
| 2710 |
ii = 2; |
ii = 2; |
| 2711 |
// |
// |
| 2712 |
Float_t adc[4][12]; |
Int_t myseq = ptt->trkseqno + 1; |
| 2713 |
Float_t tdc[4][12]; |
L2->GetToFLevel2()->GetMatrix(myseq,adc,tdc); |
| 2714 |
L2->GetMatrix(numtr,adc,tdc); |
// |
| 2715 |
|
// printf(" qua \n"); |
| 2716 |
// |
// |
| 2717 |
for ( Int_t i = 0; i<8; i++ ) { |
for ( Int_t i = 0; i<8; i++ ) { |
| 2718 |
if ( adc[ch11a[i]][hb11a[i]] < 1000. ){ |
if ( adc[ch11a[i]][hb11a[i]] < 1000. ){ |
| 3355 |
// full infos from ac |
// full infos from ac |
| 3356 |
// |
// |
| 3357 |
if ( level.file == 2 ){ |
if ( level.file == 2 ){ |
| 3358 |
hitmapA = L2->hitmap[0]; |
hitmapA = L2->GetAcLevel2()->hitmap[0]; |
| 3359 |
hitmapB = L2->hitmap[1]; |
hitmapB = L2->GetAcLevel2()->hitmap[1]; |
| 3360 |
hitstatusA = L2->hitstatus[0]; |
hitstatusA = L2->GetAcLevel2()->hitstatus[0]; |
| 3361 |
hitstatusB = L2->hitstatus[1]; |
hitstatusB = L2->GetAcLevel2()->hitstatus[1]; |
| 3362 |
}; |
}; |
| 3363 |
// |
// |
| 3364 |
// |
// |
| 4232 |
pcasp4b->Draw("f"); |
pcasp4b->Draw("f"); |
| 4233 |
pcasp4b->Draw(); |
pcasp4b->Draw(); |
| 4234 |
}; |
}; |
| 4235 |
Float_t alfa = 1.2020334; |
// Float_t alfax = 1.2020334; |
| 4236 |
|
Float_t alfax = 1.22157778; |
| 4237 |
|
Float_t alfay = 1.27393111; |
| 4238 |
Float_t lcrd = 0.1815/2.; |
Float_t lcrd = 0.1815/2.; |
| 4239 |
Float_t wcrd = 0.008; |
Float_t wcrd = 0.008; |
| 4240 |
if ( true ){ |
if ( true ){ |
| 4445 |
// |
// |
| 4446 |
// Float_t cardcx = 0.143168*var.sfx; |
// Float_t cardcx = 0.143168*var.sfx; |
| 4447 |
//Float_t cardcy = 0.1475*var.sfy; |
//Float_t cardcy = 0.1475*var.sfy; |
| 4448 |
Float_t cardcx = 0.153168*var.sfx; |
// |
| 4449 |
Float_t cardcy = 0.1575*var.sfy; |
// Float_t cardcx = 0.153168*var.sfx; |
| 4450 |
Float_t acrdx[4] = {-lcrd*cos(alfa), lcrd*cos(alfa), -lcrd*cos(alfa)+wcrd*sin(alfa), -lcrd*cos(alfa)}; |
// |
| 4451 |
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; |
| 4452 |
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; |
| 4453 |
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; |
| 4454 |
|
Float_t acrdx[4] = {-lcrd*cos(alfax), lcrd*cos(alfax), -lcrd*cos(alfax)+wcrd*sin(alfax), -lcrd*cos(alfax)}; |
| 4455 |
|
Float_t acrdy[4] = {-lcrd*sin(alfax), lcrd*sin(alfax), -lcrd*sin(alfax)-wcrd*cos(alfax), -lcrd*sin(alfax)}; |
| 4456 |
|
Float_t bcrdx[4] = { lcrd*cos(alfax), lcrd*cos(alfax)+wcrd*sin(alfax), -lcrd*cos(alfax)+wcrd*sin(alfax), lcrd*cos(alfax)}; |
| 4457 |
|
Float_t bcrdy[4] = { lcrd*sin(alfax), lcrd*sin(alfax)-wcrd*cos(alfax), -lcrd*sin(alfax)-wcrd*cos(alfax), lcrd*sin(alfax)}; |
| 4458 |
|
|
| 4459 |
// |
// |
| 4460 |
// CARD3 X/ Y |
// CARD3 X/ Y |
| 4514 |
}; |
}; |
| 4515 |
|
|
| 4516 |
if ( true ){ |
if ( true ){ |
| 4517 |
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)}; |
| 4518 |
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)}; |
| 4519 |
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)}; |
| 4520 |
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)}; |
| 4521 |
// |
// |
| 4522 |
// CARD - Y-view |
// CARD - Y-view |
| 4523 |
// |
// |
| 4524 |
Float_t cardcx = 0.12*var.sfx; |
// Float_t cardcx = 0.12*var.sfx; |
| 4525 |
Float_t cardcy = 0.1475*var.sfy; |
Float_t cardcx = (0.16014*(1.-lcrd*cos(alfay)))*var.sfx; |
| 4526 |
|
// Float_t cardcy = 0.178818*var.sfy; |
| 4527 |
|
Float_t cardcy = (0.178818*(1.-lcrd*sin(alfay)))*var.sfy; |
| 4528 |
|
// Float_t cardcy = 0.1475*var.sfy; |
| 4529 |
// |
// |
| 4530 |
// CARD4 X Y/ |
// CARD4 X Y/ |
| 4531 |
// |
// |
| 4624 |
// |
// |
| 4625 |
if ( level.file == 2 ){ |
if ( level.file == 2 ){ |
| 4626 |
for ( Int_t j = 0; j<3; j++ ) { |
for ( Int_t j = 0; j<3; j++ ) { |
| 4627 |
if ( L2->S4adc != 32. ) ms4[j] = L2->S4calibrated; |
if ( L2->GetS4Level2()->S4adc != 32. ) ms4[j] = L2->GetS4Level2()->S4calibrated; |
| 4628 |
}; |
}; |
| 4629 |
}; |
}; |
| 4630 |
// |
// |
| 4709 |
}; |
}; |
| 4710 |
}; |
}; |
| 4711 |
if ( level.file == 2 ){ |
if ( level.file == 2 ){ |
| 4712 |
yUpperTrig = (Int_t)L2->trigPhysics; |
yUpperTrig = (Int_t)L2->GetNDLevel2()->trigPhysics; |
| 4713 |
yUpperBk = (Int_t)L2->upperBack; |
yUpperBk = (Int_t)L2->GetNDLevel2()->upperBack; |
| 4714 |
yBottomBk = (Int_t)L2->bottomBack; |
yBottomBk = (Int_t)L2->GetNDLevel2()->bottomBack; |
| 4715 |
}; |
}; |
| 4716 |
// |
// |
| 4717 |
var.trup = yUpperTrig; |
var.trup = yUpperTrig; |
| 5018 |
// |
// |
| 5019 |
// singlets X |
// singlets X |
| 5020 |
// |
// |
| 5021 |
for (Int_t sing = 0; sing < L2->nclsx(); sing++){ |
for (Int_t sing = 0; sing < L2->GetTrkLevel2()->nclsx(); sing++){ |
| 5022 |
TClonesArray &t = *(L2->SingletX); |
TClonesArray &t = *(L2->GetTrkLevel2()->SingletX); |
| 5023 |
TrkSinglet *singlet = (TrkSinglet*)t[sing]; |
TrkSinglet *singlet = (TrkSinglet*)t[sing]; |
| 5024 |
x = (singlet->coord[0]+singlet->coord[1])/2.; |
x = (singlet->coord[0]+singlet->coord[1])/2.; |
| 5025 |
// |
// |
| 5043 |
// |
// |
| 5044 |
// singlets Y |
// singlets Y |
| 5045 |
// |
// |
| 5046 |
for (Int_t sing = 0; sing < L2->nclsy(); sing++){ |
for (Int_t sing = 0; sing < L2->GetTrkLevel2()->nclsy(); sing++){ |
| 5047 |
TClonesArray &t = *(L2->SingletY); |
TClonesArray &t = *(L2->GetTrkLevel2()->SingletY); |
| 5048 |
TrkSinglet *singlet = (TrkSinglet*)t[sing]; |
TrkSinglet *singlet = (TrkSinglet*)t[sing]; |
| 5049 |
// |
// |
| 5050 |
Int_t planepad = (singlet->plane - 1)* 2; |
Int_t planepad = (singlet->plane - 1)* 2; |
| 5089 |
dcol = 2; |
dcol = 2; |
| 5090 |
}; |
}; |
| 5091 |
// |
// |
| 5092 |
if ( L2->GetNTracks() > 0 ){ |
if ( L2->GetTrkLevel2()->GetNTracks() > 0 ){ |
| 5093 |
for (Int_t nt = 0; nt < L2->GetNTracks(); nt++){ |
for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ |
| 5094 |
TrkTrack *track = L2->GetTrack(nt); |
PamTrack *ptrack= L2->GetTrack(nt); |
| 5095 |
|
TrkTrack *track = ptrack->GetTrkTrack(); |
| 5096 |
if ( nt == 0 ){ |
if ( nt == 0 ){ |
| 5097 |
var.rig = 0.; |
var.rig = 0.; |
| 5098 |
if ( track->al[4] != 0. ) var.rig = 1./track->al[4]; |
if ( track->al[4] != 0. ) var.rig = 1./track->al[4]; |
| 5188 |
// |
// |
| 5189 |
// first of all plot crosses relatives to tracks |
// first of all plot crosses relatives to tracks |
| 5190 |
// |
// |
| 5191 |
if ( L2->GetNTracks() > 0 ){ |
if ( L2->GetTrkLevel2()->GetNTracks() > 0 ){ |
| 5192 |
for (Int_t nt = 0; nt < L2->GetNTracks(); nt++){ |
// for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ |
| 5193 |
TrkTrack *track = L2->GetTrack(nt); |
// TrkTrack *track = L2->GetTrkLevel2()->GetTrack(nt); |
| 5194 |
|
for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ |
| 5195 |
|
PamTrack *ptrack= L2->GetTrack(nt); |
| 5196 |
|
TrkTrack *track = ptrack->GetTrkTrack(); |
| 5197 |
|
// |
| 5198 |
for (Int_t plane = 0; plane<6; plane++){ |
for (Int_t plane = 0; plane<6; plane++){ |
| 5199 |
// |
// |
| 5200 |
x = track->xm[plane]; |
x = track->xm[plane]; |
| 5240 |
// |
// |
| 5241 |
// try to plot crosses relative to singlets |
// try to plot crosses relative to singlets |
| 5242 |
// |
// |
| 5243 |
if ( L2->nclsx() > 0 && L2->nclsy() > 0 ){ |
if ( L2->GetTrkLevel2()->nclsx() > 0 && L2->GetTrkLevel2()->nclsy() > 0 ){ |
| 5244 |
for (Int_t plane = 1; plane<7; plane++){ |
for (Int_t plane = 1; plane<7; plane++){ |
| 5245 |
// |
// |
| 5246 |
// 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: |
| 5254 |
TArrayF *array2 = new TArrayF(5000); |
TArrayF *array2 = new TArrayF(5000); |
| 5255 |
TArrayF *sigarrax = new TArrayF(5000); |
TArrayF *sigarrax = new TArrayF(5000); |
| 5256 |
TArrayF *sigarray = new TArrayF(5000); |
TArrayF *sigarray = new TArrayF(5000); |
| 5257 |
for (Int_t sing = 0; sing < L2->nclsx(); sing++){ |
for (Int_t sing = 0; sing < L2->GetTrkLevel2()->nclsx(); sing++){ |
| 5258 |
TClonesArray &t = *(L2->SingletX); |
TClonesArray &t = *(L2->GetTrkLevel2()->SingletX); |
| 5259 |
TrkSinglet *singlet = (TrkSinglet*)t[sing]; |
TrkSinglet *singlet = (TrkSinglet*)t[sing]; |
| 5260 |
if ( singlet->plane == plane ){ |
if ( singlet->plane == plane ){ |
| 5261 |
arrax->AddAt(((singlet->coord[0]+singlet->coord[1])/2.),totsx); |
arrax->AddAt(((singlet->coord[0]+singlet->coord[1])/2.),totsx); |
| 5284 |
totsx++; |
totsx++; |
| 5285 |
}; |
}; |
| 5286 |
}; |
}; |
| 5287 |
for (Int_t sing = 0; sing < L2->nclsy(); sing++){ |
for (Int_t sing = 0; sing < L2->GetTrkLevel2()->nclsy(); sing++){ |
| 5288 |
TClonesArray &t = *(L2->SingletY); |
TClonesArray &t = *(L2->GetTrkLevel2()->SingletY); |
| 5289 |
TrkSinglet *singlet = (TrkSinglet*)t[sing]; |
TrkSinglet *singlet = (TrkSinglet*)t[sing]; |
| 5290 |
if ( singlet->plane == plane ){ |
if ( singlet->plane == plane ){ |
| 5291 |
array1->AddAt(singlet->coord[0],totsy); |
array1->AddAt(singlet->coord[0],totsy); |
| 5510 |
// |
// |
| 5511 |
// |
// |
| 5512 |
// |
// |
| 5513 |
|
if ( var.CALO && false ){ |
| 5514 |
|
if ( L2->GetCaloLevel2()->npcfit[0] > 0 && L2->GetCaloLevel2()->npcfit[1] > 0 ){ |
| 5515 |
|
Float_t calx[22]; |
| 5516 |
|
Float_t caly[22]; |
| 5517 |
|
Float_t calzx[22]; |
| 5518 |
|
Float_t calzy[22]; |
| 5519 |
|
Float_t zpiano[22]; |
| 5520 |
|
zpiano[0] = (CTZ+118.)*var.sfy/1000.; |
| 5521 |
|
for (Int_t plane = 1; plane < 22; plane++){ |
| 5522 |
|
if ( !(plane%2) ){ |
| 5523 |
|
zpiano[plane] = zpiano[plane-1] - 8.09*var.sfy/1000.; |
| 5524 |
|
}else { |
| 5525 |
|
zpiano[plane] = zpiano[plane-1] - 10.09*var.sfy/1000.; |
| 5526 |
|
}; |
| 5527 |
|
}; |
| 5528 |
|
for (Int_t plane = 0; plane < 22; plane++){ |
| 5529 |
|
calx[plane] = (L2->GetCaloLevel2()->cbar[plane][0]/100.)*var.sfx + var.xxvc;; |
| 5530 |
|
caly[plane] = (L2->GetCaloLevel2()->cbar[plane][1]/100.)*var.sfx + var.xyvc; |
| 5531 |
|
// calzx[plane] = zpiano[plane] -5.81*var.sfy/1000. + var.yxvc; |
| 5532 |
|
calzx[plane] = zpiano[plane] + var.yxvc; |
| 5533 |
|
calzy[plane] = zpiano[plane] + var.yyvc; |
| 5534 |
|
// printf(" calx %f caly %f calzx %f calzy %f \n",calx[plane],caly[plane],calzx[plane],calzy[plane]); |
| 5535 |
|
}; |
| 5536 |
|
// |
| 5537 |
|
// Calorimeter track |
| 5538 |
|
// |
| 5539 |
|
Int_t trcol = 30; |
| 5540 |
|
if ( var.bw ){ |
| 5541 |
|
trcol = 14; |
| 5542 |
|
} else { |
| 5543 |
|
trcol = 44; |
| 5544 |
|
}; |
| 5545 |
|
thefigure->cd(); |
| 5546 |
|
TPolyLine *trakx = new TPolyLine(22,calx,calzx); |
| 5547 |
|
trakx->SetLineColor(trcol); |
| 5548 |
|
if ( L2->GetCaloLevel2()->fitmode[0] == 1 ) trakx->SetLineStyle(3); |
| 5549 |
|
if ( L2->GetCaloLevel2()->fitmode[0] == 2 ) trakx->SetLineStyle(4); |
| 5550 |
|
trakx->SetLineWidth(2); |
| 5551 |
|
trakx->Draw(); |
| 5552 |
|
TPolyLine *traky = new TPolyLine(22,caly,calzy); |
| 5553 |
|
traky->SetLineColor(trcol); |
| 5554 |
|
if ( L2->GetCaloLevel2()->fitmode[1] == 1 ) traky->SetLineStyle(3); |
| 5555 |
|
if ( L2->GetCaloLevel2()->fitmode[1] == 2 ) traky->SetLineStyle(4); |
| 5556 |
|
traky->SetLineWidth(2); |
| 5557 |
|
traky->Draw(); |
| 5558 |
|
}; |
| 5559 |
|
if ( L2->GetCaloLevel2()->npcfit[2] > 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 |
|
// |
| 5574 |
|
// |
| 5575 |
|
CaloTrkVar *ctra = L2->GetCaloStoredTrack(-1); |
| 5576 |
|
// |
| 5577 |
|
for (Int_t plane = 0; plane < 22; plane++){ |
| 5578 |
|
calx[plane] = (ctra->tbar[plane][0]/100.)*var.sfx + var.xxvc;; |
| 5579 |
|
caly[plane] = (ctra->tbar[plane][1]/100.)*var.sfx + var.xyvc; |
| 5580 |
|
// calzx[plane] = zpiano[plane] -5.81*var.sfy/1000. + var.yxvc; |
| 5581 |
|
calzx[plane] = zpiano[plane] + var.yxvc; |
| 5582 |
|
calzy[plane] = zpiano[plane] + var.yyvc; |
| 5583 |
|
// printf(" calx %f caly %f calzx %f calzy %f \n",calx[plane],caly[plane],calzx[plane],calzy[plane]); |
| 5584 |
|
}; |
| 5585 |
|
// |
| 5586 |
|
// Calorimeter track |
| 5587 |
|
// |
| 5588 |
|
Int_t trcol = 30; |
| 5589 |
|
if ( var.bw ){ |
| 5590 |
|
trcol = 16; |
| 5591 |
|
} else { |
| 5592 |
|
trcol = 46; |
| 5593 |
|
}; |
| 5594 |
|
thefigure->cd(); |
| 5595 |
|
TPolyLine *trakx = new TPolyLine(22,calx,calzx); |
| 5596 |
|
trakx->SetLineColor(trcol); |
| 5597 |
|
trakx->SetLineStyle(3); |
| 5598 |
|
trakx->SetLineWidth(2); |
| 5599 |
|
trakx->Draw(); |
| 5600 |
|
TPolyLine *traky = new TPolyLine(22,caly,calzy); |
| 5601 |
|
traky->SetLineColor(trcol); |
| 5602 |
|
traky->SetLineStyle(3); |
| 5603 |
|
traky->SetLineWidth(2); |
| 5604 |
|
traky->Draw(); |
| 5605 |
|
}; |
| 5606 |
|
}; |
| 5607 |
|
// |
| 5608 |
if ( !var.TRK || level.file != 2 ) return; |
if ( !var.TRK || level.file != 2 ) return; |
| 5609 |
// |
// |
| 5610 |
if ( L2->GetNTracks() > 0 ){ |
if ( L2->GetTrkLevel2()->GetNTracks() > 0 ){ |
| 5611 |
for (Int_t nt = 0; nt < L2->GetNTracks(); nt++){ |
for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ |
| 5612 |
TrkTrack *track = L2->GetTrack(nt); |
|
| 5613 |
|
// TrkTrack *track = L2->GetTrkLevel2()->GetTrack(nt); |
| 5614 |
|
PamTrack *ptrack = L2->GetTrack(nt); |
| 5615 |
|
TrkTrack *track = ptrack->GetTrkTrack(); |
| 5616 |
Int_t npoint = 100; |
Int_t npoint = 100; |
| 5617 |
Float_t zin[100]; |
Float_t zin[100]; |
| 5618 |
Double_t xout[100]; |
Double_t xout[100]; |
| 5682 |
}; |
}; |
| 5683 |
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; |
| 5684 |
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; |
| 5685 |
|
// printf("tx[e] %f ty [e] %f tzx %f tzy %f \n",tx[e],ty[e],tzx[e],tzy[e]); |
| 5686 |
}; |
}; |
| 5687 |
// |
// |
| 5688 |
// From S1 to CALO |
// From S1 to CALO |
| 6232 |
// |
// |
| 6233 |
stringstream xvev; |
stringstream xvev; |
| 6234 |
stringstream yvev; |
stringstream yvev; |
| 6235 |
for (Int_t ii = 0; ii < L2->nstrip; ii++){ |
for (Int_t ii = 0; ii < L2->GetCaloLevel2()->nstrip; ii++){ |
| 6236 |
Int_t colo; |
Int_t colo; |
| 6237 |
Int_t l; |
Int_t l; |
| 6238 |
Int_t m; |
Int_t m; |
| 6239 |
Int_t n; |
Int_t n; |
| 6240 |
Float_t mip = L2->DecodeEstrip(ii,l,m,n); |
Float_t mip = L2->GetCaloLevel1()->DecodeEstrip(ii,l,m,n); |
| 6241 |
if ( var.bw ){ |
if ( var.bw ){ |
| 6242 |
colo = -1; |
colo = -1; |
| 6243 |
} else { |
} else { |
| 6271 |
}; |
}; |
| 6272 |
pd1->Update(); |
pd1->Update(); |
| 6273 |
pd2->Update(); |
pd2->Update(); |
| 6274 |
var.qtot=(int)L2->qtot; |
var.qtot=(int)L2->GetCaloLevel2()->qtot; |
| 6275 |
var.nstrip=(int)L2->nstrip; |
var.nstrip=(int)L2->GetCaloLevel2()->nstrip; |
| 6276 |
}; |
}; |
| 6277 |
} |
} |
| 6278 |
|
|