| 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.S4 = 0; |
var.S4 = 0; |
| 98 |
var.ND = 0; |
var.ND = 0; |
| 128 |
}; |
}; |
| 129 |
} |
} |
| 130 |
|
|
| 131 |
|
void FEVdetector::SetDDEC(TString de){ |
| 132 |
|
ddec=de; |
| 133 |
|
}; |
| 134 |
|
|
| 135 |
void FEVdetector::GetWindow(){ |
void FEVdetector::GetWindow(){ |
| 136 |
otr->GetEntry(maxevent); |
otr->GetEntry(maxevent); |
| 137 |
|
// |
| 138 |
if ( level.file < 2 ){ |
if ( level.file < 2 ){ |
| 139 |
ph = eh->GetPscuHeader(); |
ph = eh->GetPscuHeader(); |
| 140 |
lastevno = (int)ph->Counter; |
lastevno = (int)ph->Counter; |
| 141 |
} else { |
} else { |
| 142 |
lastevno = L2->GetOrbitalInfo()->pkt_num; // to be changed as soon as we will have pkt_counter in the level2 file! |
if ( var.ORB ){ |
| 143 |
|
lastevno = L2->GetOrbitalInfo()->pkt_num; |
| 144 |
|
} else { |
| 145 |
|
lastevno = 0; |
| 146 |
|
}; |
| 147 |
}; |
}; |
| 148 |
otr->GetEntry(minevent); |
otr->GetEntry(minevent); |
| 149 |
if ( level.file < 2 ){ |
if ( level.file < 2 ){ |
| 150 |
ph = eh->GetPscuHeader(); |
ph = eh->GetPscuHeader(); |
| 151 |
firstevno = (int)ph->Counter; |
firstevno = (int)ph->Counter; |
| 152 |
} else { |
} else { |
| 153 |
firstevno = L2->GetOrbitalInfo()->pkt_num; // to be changed as soon as we will have pkt_counter in the level2 file! |
if ( var.ORB ){ |
| 154 |
|
firstevno = L2->GetOrbitalInfo()->pkt_num; |
| 155 |
|
} else { |
| 156 |
|
firstevno = 0; |
| 157 |
|
}; |
| 158 |
}; |
}; |
| 159 |
} |
} |
| 160 |
|
|
| 178 |
} |
} |
| 179 |
|
|
| 180 |
void FEVdetector::GetEntry(Int_t i){ |
void FEVdetector::GetEntry(Int_t i){ |
| 181 |
thisentry = i; |
thisentry = i; |
| 182 |
otr->GetEntry(i); |
if ( level.file == 2 ){ |
| 183 |
|
L2->GetEntry(i); |
| 184 |
|
ShowInfo("RunInfo"); |
| 185 |
|
ShowInfo("SoftInfo"); |
| 186 |
|
ShowInfo("TrigLevel2"); |
| 187 |
|
ShowInfo("OrbitalInfo"); |
| 188 |
|
ShowInfo("ToFLevel2"); |
| 189 |
|
ShowInfo("TrkLevel2"); |
| 190 |
|
ShowInfo("AcLevel2"); |
| 191 |
|
ShowInfo("CaloLevel2"); |
| 192 |
|
ShowInfo("CaloLevel1"); |
| 193 |
|
ShowInfo("S4Level2"); |
| 194 |
|
ShowInfo("NDLevel2"); |
| 195 |
|
} else { |
| 196 |
|
otr->GetEntry(i); |
| 197 |
|
}; |
| 198 |
} |
} |
| 199 |
|
|
| 200 |
void FEVdetector::SetEntry(Int_t i){ |
void FEVdetector::SetEntry(Int_t i){ |
| 315 |
}; |
}; |
| 316 |
} |
} |
| 317 |
|
|
| 318 |
|
void FEVdetector::ShowInfo(TString detector){ |
| 319 |
|
// |
| 320 |
|
TBranch *b1 = 0; |
| 321 |
|
// TBranch *b3 = 0; |
| 322 |
|
TObjArray *branch_array = 0; |
| 323 |
|
// TObjArray *leaf_array = 0; |
| 324 |
|
// |
| 325 |
|
if ( !strcmp(detector.Data(),"RunInfo") || !strcmp(detector.Data(),"SoftInfo") ){ |
| 326 |
|
if ( runtree ) b1 = runtree->FindBranch(detector.Data()); |
| 327 |
|
} else { |
| 328 |
|
b1 = otr->FindBranch(detector.Data()); |
| 329 |
|
}; |
| 330 |
|
// |
| 331 |
|
if ( !b1 ) return; |
| 332 |
|
// |
| 333 |
|
Int_t dlen = 10; |
| 334 |
|
// |
| 335 |
|
char o[200000]; |
| 336 |
|
char col[13]; |
| 337 |
|
char col2[13]; |
| 338 |
|
// |
| 339 |
|
setcolor(col,RESET, GREEN, WHITE); |
| 340 |
|
sprintf(o,"%s======> EVENT:%i\n",col, thisentry); |
| 341 |
|
// |
| 342 |
|
setcolor(col,RESET, RED, WHITE); |
| 343 |
|
sprintf(o,"%s%sBranch %s\n",o,col,b1->GetName()); |
| 344 |
|
setcolor(col,RESET, BLACK, WHITE); |
| 345 |
|
sprintf(o,"%s%s",o,col); |
| 346 |
|
// |
| 347 |
|
branch_array = b1->GetListOfBranches(); |
| 348 |
|
// |
| 349 |
|
Int_t j = 0; |
| 350 |
|
// |
| 351 |
|
for(Int_t l=0;l<(branch_array->GetLast()+1);l++){ |
| 352 |
|
// |
| 353 |
|
TBranchElement *tb = (TBranchElement*)branch_array->At(l); |
| 354 |
|
Int_t type = tb->GetType(); |
| 355 |
|
Int_t atype = tb->GetStreamerType() - 20; |
| 356 |
|
Int_t len = (tb->GetInfo()->GetLengths())[tb->GetID()]; |
| 357 |
|
Int_t length = min(len,dlen); |
| 358 |
|
// |
| 359 |
|
// printf("Branches : type is %i type is %i tb getname %s slen %i slength %i\n",atype,type,tb->GetName(),len,length); |
| 360 |
|
switch (type){ |
| 361 |
|
case 0: |
| 362 |
|
// |
| 363 |
|
// IS A VARIABLE |
| 364 |
|
// |
| 365 |
|
// |
| 366 |
|
// NAME |
| 367 |
|
// |
| 368 |
|
setcolor(col,RESET, BLUE, WHITE); |
| 369 |
|
setcolor(col2,RESET, BLACK, WHITE); |
| 370 |
|
sprintf(o,"%s%s %-15s%s =",o,col,((TBranch*)branch_array->At(l))->GetName(),col2); |
| 371 |
|
// |
| 372 |
|
j = 0; |
| 373 |
|
// |
| 374 |
|
// VALUES |
| 375 |
|
// |
| 376 |
|
// |
| 377 |
|
// Integer |
| 378 |
|
// |
| 379 |
|
if ( atype == 3 || atype == -17 ){ |
| 380 |
|
while ( j < length ){ |
| 381 |
|
if ( j < length -1 ){ |
| 382 |
|
sprintf(o,"%s %i ,",o,(Int_t)tb->GetValue(j,0)); |
| 383 |
|
} else { |
| 384 |
|
sprintf(o,"%s %i",o,(Int_t)tb->GetValue(j,0)); |
| 385 |
|
}; |
| 386 |
|
j++; |
| 387 |
|
}; |
| 388 |
|
}; |
| 389 |
|
// |
| 390 |
|
// Unsigned integer |
| 391 |
|
// |
| 392 |
|
if ( atype == -7 || atype == 13 ){ |
| 393 |
|
while ( j < length ){ |
| 394 |
|
if ( j < length -1 ){ |
| 395 |
|
sprintf(o,"%s %i ,",o,(UInt_t)tb->GetValue(j,0)); |
| 396 |
|
} else { |
| 397 |
|
sprintf(o,"%s %i",o,(UInt_t)tb->GetValue(j,0)); |
| 398 |
|
}; |
| 399 |
|
j++; |
| 400 |
|
}; |
| 401 |
|
}; |
| 402 |
|
// |
| 403 |
|
// Float |
| 404 |
|
// |
| 405 |
|
if ( atype == -15 || atype == 5 ){ |
| 406 |
|
while ( j < length ){ |
| 407 |
|
if ( j < length -1 ){ |
| 408 |
|
sprintf(o,"%s %f ,",o,tb->GetValue(j,0)); |
| 409 |
|
} else { |
| 410 |
|
sprintf(o,"%s %f",o,tb->GetValue(j,0)); |
| 411 |
|
}; |
| 412 |
|
j++; |
| 413 |
|
}; |
| 414 |
|
}; |
| 415 |
|
// |
| 416 |
|
// Strings |
| 417 |
|
// |
| 418 |
|
if ( atype == 45 ){ |
| 419 |
|
// TString *stringa = (TString*)(tb->GetValuePointer()); |
| 420 |
|
// int pointer = (tb->GetInfo()->GetOffsets())[tb->GetID()]; |
| 421 |
|
// TString *stringa = (TString*)(tb->GetInfo()->GetOffsets())[tb->GetID()]; |
| 422 |
|
// TString *stringa = (TString*)tb->GetAddress(); |
| 423 |
|
// printf(" address 0x%X \n",tb->GetAddress()); |
| 424 |
|
// printf(" pointer 0x%X \n",tb->GetValuePointer()); |
| 425 |
|
// printf(" object 0x%X \n",tb->GetObject()); |
| 426 |
|
// printf("stringa %s lung %i\n",stringa->Data(),stringa->Length()); |
| 427 |
|
// TLeaf *striglia = tb->FindLeaf(tb->GetName()); |
| 428 |
|
// if ( striglia ){ |
| 429 |
|
// char *pointer = (char *)striglia->GetValuePointer(); |
| 430 |
|
// TString *pr= (TString*)pointer; |
| 431 |
|
// printf("ciao %s \n",pr->Data()); |
| 432 |
|
// }; |
| 433 |
|
sprintf(o,"%s TString ",o); |
| 434 |
|
}; |
| 435 |
|
// |
| 436 |
|
// TArray |
| 437 |
|
// |
| 438 |
|
if ( atype == 42 ){ |
| 439 |
|
// |
| 440 |
|
// TObjArray *cl = (TObjArray*)tb->GetObject(); |
| 441 |
|
// // |
| 442 |
|
// TClass *myc = cl->IsA(); |
| 443 |
|
// // |
| 444 |
|
// printf("qui \n"); |
| 445 |
|
// // |
| 446 |
|
// // determine offset to fetch data |
| 447 |
|
// // |
| 448 |
|
// int thisoffset = 0; |
| 449 |
|
// TRealData *rd = myc->GetRealData(tb->GetName()); |
| 450 |
|
// if ( rd ){ |
| 451 |
|
// thisoffset = rd->GetThisOffset(); |
| 452 |
|
// }; |
| 453 |
|
// Int_t niente = 0; |
| 454 |
|
// TStreamerElement *tste = tb->GetInfo()->GetStreamerElement(rd->GetName(),niente); |
| 455 |
|
// printf(" typename %s \n",tste->GetTypeName()); |
| 456 |
|
// // |
| 457 |
|
// // TArrayI |
| 458 |
|
// // |
| 459 |
|
// if ( !strcmp(tste->GetTypeName(),"TArrayI") ){ |
| 460 |
|
// // |
| 461 |
|
// printf("qua \n"); |
| 462 |
|
// char *pointer = (char*)cl->At(0); |
| 463 |
|
// // char *pu = thisoffset + pointer; |
| 464 |
|
// int pu = (int)tste->GetTObjectOffset(); |
| 465 |
|
// TArrayI arr = (TArrayI)*pu; |
| 466 |
|
// // TArrayI arr = (TArrayI)(thisoffset); |
| 467 |
|
// //TArrayI *arr = (TArrayI*)pu; |
| 468 |
|
// //TArraI arr = (TArrayI) |
| 469 |
|
// Int_t jj=0; |
| 470 |
|
// j=0; |
| 471 |
|
// printf("quii \n"); |
| 472 |
|
// Int_t arlen = min(arr.GetSize(),dlen); |
| 473 |
|
// // |
| 474 |
|
// printf("que \n"); |
| 475 |
|
// setcolor(col,RESET, BLUE, WHITE); |
| 476 |
|
// setcolor(col2,RESET, BLACK, WHITE); |
| 477 |
|
// sprintf(o,"%s%s %s[%i]%s = ",o,col,tb->GetName(),arr.GetSize(),col2); |
| 478 |
|
// // |
| 479 |
|
// // while ( j < tb->GetNdata() ){ |
| 480 |
|
// // |
| 481 |
|
// printf("quo \n"); |
| 482 |
|
// // pointer = (char*)cl->UncheckedAt(j); |
| 483 |
|
// // pu = pointer + thisoffset; |
| 484 |
|
// // arr = (TArrayI*)(thisoffset); |
| 485 |
|
// // |
| 486 |
|
// while ( jj < arlen ){ |
| 487 |
|
// if ( jj < arlen-1 ){ |
| 488 |
|
// sprintf(o,"%s %i ,",o,arr.At(jj)); |
| 489 |
|
// } else { |
| 490 |
|
// sprintf(o,"%s %i",o,arr.At(jj)); |
| 491 |
|
// }; |
| 492 |
|
// jj++; |
| 493 |
|
// }; |
| 494 |
|
// // if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); |
| 495 |
|
// // j++; |
| 496 |
|
// // }; |
| 497 |
|
// }; |
| 498 |
|
// // |
| 499 |
|
// // TArrayF |
| 500 |
|
// // |
| 501 |
|
// if ( !strcmp(tste->GetTypeName(),"TArrayF") ){ |
| 502 |
|
// // |
| 503 |
|
// char *pointer = (char*)cl->UncheckedAt(0); |
| 504 |
|
// char *pu = pointer + thisoffset; |
| 505 |
|
// TArrayF *arr = (TArrayF*)(pu); |
| 506 |
|
// Int_t jj=0; |
| 507 |
|
// Int_t arlen = min(arr->GetSize(),dlen); |
| 508 |
|
// // |
| 509 |
|
// setcolor(col,RESET, BLUE, WHITE); |
| 510 |
|
// setcolor(col2,RESET, BLACK, WHITE); |
| 511 |
|
// sprintf(o,"%s%s %s[%i]%s = ",o,col,tb->GetName(),arr->GetSize(),col2); |
| 512 |
|
// // |
| 513 |
|
// while ( j < tb->GetNdata() ){ |
| 514 |
|
// // |
| 515 |
|
// pointer = (char*)cl->UncheckedAt(j); |
| 516 |
|
// pu = pointer + thisoffset; |
| 517 |
|
// arr = (TArrayF*)(pu); |
| 518 |
|
// // |
| 519 |
|
// while ( jj < arlen ){ |
| 520 |
|
// if ( jj < arlen-1 ){ |
| 521 |
|
// sprintf(o,"%s %f ,",o,arr->At(jj)); |
| 522 |
|
// } else { |
| 523 |
|
// sprintf(o,"%s %f",o,arr->At(jj)); |
| 524 |
|
// }; |
| 525 |
|
// jj++; |
| 526 |
|
// }; |
| 527 |
|
// if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); |
| 528 |
|
// j++; |
| 529 |
|
// }; |
| 530 |
|
// }; |
| 531 |
|
// sprintf(o,"%s\n",o); |
| 532 |
|
// |
| 533 |
|
sprintf(o,"%s TArray ",o); |
| 534 |
|
// |
| 535 |
|
}; |
| 536 |
|
// |
| 537 |
|
sprintf(o,"%s\n",o); |
| 538 |
|
break; |
| 539 |
|
case 3: |
| 540 |
|
// |
| 541 |
|
// IS A TCLONESARRAY |
| 542 |
|
// |
| 543 |
|
setcolor(col,RESET, BLUE, WHITE); |
| 544 |
|
setcolor(col2,RESET, BLACK, WHITE); |
| 545 |
|
sprintf(o,"%s%s %-15s%s = %d\n",o,col,tb->GetName(), col2, tb->GetNdata()); |
| 546 |
|
|
| 547 |
|
// |
| 548 |
|
if ( tb->GetNdata() ){ |
| 549 |
|
// |
| 550 |
|
TClonesArray *cl = (TClonesArray*)tb->GetObject(); |
| 551 |
|
// |
| 552 |
|
TClass *myc = cl->GetClass(); |
| 553 |
|
// |
| 554 |
|
TList *lme = myc->GetListOfDataMembers(); |
| 555 |
|
TIter next(lme); |
| 556 |
|
TBranchElement *tb2 = 0; |
| 557 |
|
// |
| 558 |
|
while ( (tb2 = (TBranchElement*)next()) ){ |
| 559 |
|
// |
| 560 |
|
const char *name = tb2->GetName(); |
| 561 |
|
TBranch *foglia = tb->FindBranch(name); |
| 562 |
|
if ( foglia ){ |
| 563 |
|
// |
| 564 |
|
TBranchElement *stb = (TBranchElement*)tb->FindBranch(name); |
| 565 |
|
Int_t stype = stb->GetType(); |
| 566 |
|
Int_t satype = stb->GetStreamerType() - 20; |
| 567 |
|
Int_t slen = (stb->GetInfo()->GetLengths())[stb->GetID()]; |
| 568 |
|
Int_t slength = min(slen,dlen); |
| 569 |
|
// printf("SubBranches : atype is %i type is %i tb getname %s slen %i slength %i\n",satype,stype,stb->GetName(),slen,slength); |
| 570 |
|
switch (stype){ |
| 571 |
|
case 31: |
| 572 |
|
// |
| 573 |
|
// IS A VARIABLE |
| 574 |
|
// |
| 575 |
|
// |
| 576 |
|
// NAME |
| 577 |
|
// |
| 578 |
|
j = 0; |
| 579 |
|
// |
| 580 |
|
// VALUES |
| 581 |
|
// |
| 582 |
|
if ( satype == 41 || satype == 44){ |
| 583 |
|
// |
| 584 |
|
// skip TRef |
| 585 |
|
// |
| 586 |
|
break; |
| 587 |
|
}; |
| 588 |
|
// |
| 589 |
|
// Integer |
| 590 |
|
// |
| 591 |
|
if ( satype == -17 ){ |
| 592 |
|
// |
| 593 |
|
setcolor(col,RESET, BLUE, WHITE); |
| 594 |
|
setcolor(col2,RESET, BLACK, WHITE); |
| 595 |
|
sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2); |
| 596 |
|
while ( j < cl->GetEntriesFast() ){ |
| 597 |
|
if ( j < cl->GetEntriesFast() -1 ){ |
| 598 |
|
sprintf(o,"%s %i ,",o,(Int_t)stb->GetValue(j,slength)); |
| 599 |
|
} else { |
| 600 |
|
sprintf(o,"%s %i",o,(Int_t)stb->GetValue(j,slength)); |
| 601 |
|
}; |
| 602 |
|
j++; |
| 603 |
|
}; |
| 604 |
|
}; |
| 605 |
|
// |
| 606 |
|
// Float |
| 607 |
|
// |
| 608 |
|
if ( satype == -15 ){ |
| 609 |
|
// |
| 610 |
|
setcolor(col,RESET, BLUE, WHITE); |
| 611 |
|
setcolor(col2,RESET, BLACK, WHITE); |
| 612 |
|
sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2); |
| 613 |
|
while ( j < cl->GetEntriesFast() ){ |
| 614 |
|
if ( j < cl->GetEntriesFast() -1 ){ |
| 615 |
|
sprintf(o,"%s %f ,",o,stb->GetValue(j,slength)); |
| 616 |
|
} else { |
| 617 |
|
sprintf(o,"%s %f",o,stb->GetValue(j,slength)); |
| 618 |
|
}; |
| 619 |
|
j++; |
| 620 |
|
}; |
| 621 |
|
}; |
| 622 |
|
// |
| 623 |
|
// Array of float |
| 624 |
|
// |
| 625 |
|
if ( satype == 5 ){ |
| 626 |
|
// |
| 627 |
|
setcolor(col,RESET, BLUE, WHITE); |
| 628 |
|
setcolor(col2,RESET, BLACK, WHITE); |
| 629 |
|
sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2); |
| 630 |
|
Bool_t bold = true; |
| 631 |
|
while ( j < tb->GetNdata() ){ |
| 632 |
|
if ( bold ){ |
| 633 |
|
setcolor(col,RESET, BLACK, WHITE); |
| 634 |
|
sprintf(o,"%s%s",o,col); |
| 635 |
|
} else { |
| 636 |
|
setcolor(col,BOLD, BLACK, WHITE); |
| 637 |
|
sprintf(o,"%s%s",o,col); |
| 638 |
|
}; |
| 639 |
|
Int_t jj = 0; |
| 640 |
|
while ( jj < slength ){ |
| 641 |
|
if ( jj < slength-1 ){ |
| 642 |
|
sprintf(o,"%s %f ,",o,stb->GetValue(j,jj,true)); |
| 643 |
|
} else { |
| 644 |
|
sprintf(o,"%s %f",o,stb->GetValue(j,jj,true)); |
| 645 |
|
}; |
| 646 |
|
jj++; |
| 647 |
|
}; |
| 648 |
|
if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); |
| 649 |
|
if ( !bold ){ |
| 650 |
|
bold = true; |
| 651 |
|
} else { |
| 652 |
|
bold = false; |
| 653 |
|
}; |
| 654 |
|
j++; |
| 655 |
|
}; |
| 656 |
|
if ( bold ){ |
| 657 |
|
setcolor(col,RESET, BLACK, WHITE); |
| 658 |
|
sprintf(o,"%s%s",o,col); |
| 659 |
|
}; |
| 660 |
|
}; |
| 661 |
|
// |
| 662 |
|
// Array of integers |
| 663 |
|
// |
| 664 |
|
if ( satype == 3 ){ |
| 665 |
|
// |
| 666 |
|
setcolor(col,RESET, BLUE, WHITE); |
| 667 |
|
setcolor(col2,RESET, BLACK, WHITE); |
| 668 |
|
sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2); |
| 669 |
|
while ( j < tb->GetNdata() ){ |
| 670 |
|
Int_t jj = 0; |
| 671 |
|
while ( jj < slength ){ |
| 672 |
|
if ( jj < slength-1 ){ |
| 673 |
|
sprintf(o,"%s %i ,",o,(Int_t)stb->GetValue(j,jj,true)); |
| 674 |
|
} else { |
| 675 |
|
sprintf(o,"%s %i",o,(Int_t)stb->GetValue(j,jj,true)); |
| 676 |
|
}; |
| 677 |
|
jj++; |
| 678 |
|
}; |
| 679 |
|
if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); |
| 680 |
|
j++; |
| 681 |
|
}; |
| 682 |
|
}; |
| 683 |
|
|
| 684 |
|
// |
| 685 |
|
// TArray |
| 686 |
|
// |
| 687 |
|
if ( satype == 42 ){ |
| 688 |
|
// |
| 689 |
|
// determine offset to fetch data |
| 690 |
|
// |
| 691 |
|
int thisoffset = 0; |
| 692 |
|
TRealData *rd = myc->GetRealData(foglia->GetName()); |
| 693 |
|
if ( rd ){ |
| 694 |
|
thisoffset = rd->GetThisOffset(); |
| 695 |
|
}; |
| 696 |
|
Int_t niente = 0; |
| 697 |
|
TStreamerElement *tste = stb->GetInfo()->GetStreamerElement(rd->GetName(),niente); |
| 698 |
|
// |
| 699 |
|
// TArrayI |
| 700 |
|
// |
| 701 |
|
if ( !strcmp(tste->GetTypeName(),"TArrayI") ){ |
| 702 |
|
// |
| 703 |
|
char *pointer = (char*)cl->UncheckedAt(0); |
| 704 |
|
char *pu = pointer + thisoffset; |
| 705 |
|
TArrayI *arr = (TArrayI*)(pu); |
| 706 |
|
Int_t jj=0; |
| 707 |
|
Int_t arlen = min(arr->GetSize(),dlen); |
| 708 |
|
// |
| 709 |
|
setcolor(col,RESET, BLUE, WHITE); |
| 710 |
|
setcolor(col2,RESET, BLACK, WHITE); |
| 711 |
|
sprintf(o,"%s%s %s[%i]%s = ",o,col,foglia->GetName(),arr->GetSize(),col2); |
| 712 |
|
// |
| 713 |
|
while ( j < tb->GetNdata() ){ |
| 714 |
|
// |
| 715 |
|
pointer = (char*)cl->UncheckedAt(j); |
| 716 |
|
pu = pointer + thisoffset; |
| 717 |
|
arr = (TArrayI*)(pu); |
| 718 |
|
// |
| 719 |
|
while ( jj < arlen ){ |
| 720 |
|
if ( jj < arlen-1 ){ |
| 721 |
|
sprintf(o,"%s %i ,",o,arr->At(jj)); |
| 722 |
|
} else { |
| 723 |
|
sprintf(o,"%s %i",o,arr->At(jj)); |
| 724 |
|
}; |
| 725 |
|
jj++; |
| 726 |
|
}; |
| 727 |
|
if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); |
| 728 |
|
j++; |
| 729 |
|
}; |
| 730 |
|
}; |
| 731 |
|
// |
| 732 |
|
// TArrayF |
| 733 |
|
// |
| 734 |
|
if ( !strcmp(tste->GetTypeName(),"TArrayF") ){ |
| 735 |
|
// |
| 736 |
|
char *pointer = (char*)cl->UncheckedAt(0); |
| 737 |
|
char *pu = pointer + thisoffset; |
| 738 |
|
TArrayF *arr = (TArrayF*)(pu); |
| 739 |
|
Int_t jj=0; |
| 740 |
|
Int_t arlen = min(arr->GetSize(),dlen); |
| 741 |
|
// |
| 742 |
|
setcolor(col,RESET, BLUE, WHITE); |
| 743 |
|
setcolor(col2,RESET, BLACK, WHITE); |
| 744 |
|
sprintf(o,"%s%s %s[%i]%s = ",o,col,foglia->GetName(),arr->GetSize(),col2); |
| 745 |
|
// |
| 746 |
|
while ( j < tb->GetNdata() ){ |
| 747 |
|
// |
| 748 |
|
pointer = (char*)cl->UncheckedAt(j); |
| 749 |
|
pu = pointer + thisoffset; |
| 750 |
|
arr = (TArrayF*)(pu); |
| 751 |
|
// |
| 752 |
|
while ( jj < arlen ){ |
| 753 |
|
if ( jj < arlen-1 ){ |
| 754 |
|
sprintf(o,"%s %f ,",o,arr->At(jj)); |
| 755 |
|
} else { |
| 756 |
|
sprintf(o,"%s %f",o,arr->At(jj)); |
| 757 |
|
}; |
| 758 |
|
jj++; |
| 759 |
|
}; |
| 760 |
|
if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); |
| 761 |
|
j++; |
| 762 |
|
}; |
| 763 |
|
}; |
| 764 |
|
}; |
| 765 |
|
sprintf(o,"%s\n",o); |
| 766 |
|
break; |
| 767 |
|
}; |
| 768 |
|
}; |
| 769 |
|
}; |
| 770 |
|
}; |
| 771 |
|
break; |
| 772 |
|
}; |
| 773 |
|
}; |
| 774 |
|
// pamgui->DIALOG(0,o); |
| 775 |
|
printf("%s\n",o); |
| 776 |
|
}; |
| 777 |
|
|
| 778 |
|
|
| 779 |
void FEVdetector::GetGeneralInfo(){ |
void FEVdetector::GetGeneralInfo(){ |
| 780 |
// |
// |
| 781 |
// Get Orbital Time information and header event number |
// Get Orbital Time information and header event number |
| 785 |
headcold = headc; |
headcold = headc; |
| 786 |
headc = ph->Counter; |
headc = ph->Counter; |
| 787 |
var.headc = (int)ph->Counter; |
var.headc = (int)ph->Counter; |
| 788 |
OBT = ph->OrbitalTime; |
OBT = (UInt_t)ph->OrbitalTime; |
| 789 |
DOBT = OBT - OOBT; |
DOBT = OBT - OOBT; |
| 790 |
OOBT = OBT; |
OOBT = OBT; |
| 791 |
if ( thisentry == minevent || DOBT < 0 || (headc-headcold-1)!=0 ) DOBT = 0; |
if ( thisentry == minevent || DOBT < 0 || (headc-headcold-1)!=0 ) DOBT = 0; |
| 821 |
trcs = (TString)trc.str().c_str(); |
trcs = (TString)trc.str().c_str(); |
| 822 |
} else { |
} else { |
| 823 |
headcold = headc; |
headcold = headc; |
| 824 |
headc = L2->GetOrbitalInfo()->pkt_num; // to be changed as soon as we will have obt in the level2 file! |
if ( var.ORB ){ |
| 825 |
OBT = L2->GetOrbitalInfo()->OBT; // to be changed as soon as we will have obt in the level2 file! |
headc = L2->GetOrbitalInfo()->pkt_num; |
| 826 |
DOBT = OBT - OOBT; |
OBT = L2->GetOrbitalInfo()->OBT; |
| 827 |
OOBT = OBT; |
DOBT = OBT - OOBT; |
| 828 |
if ( thisentry == minevent || DOBT < 0 || (headc-headcold-1)!=0 ) DOBT = 0; |
OOBT = OBT; |
| 829 |
var.etime = OBT; |
if ( thisentry == minevent || DOBT < 0 || (headc-headcold-1)!=0 ) DOBT = 0; |
| 830 |
|
var.etime = OBT; |
| 831 |
|
} else { |
| 832 |
|
var.etime = 0; |
| 833 |
|
}; |
| 834 |
// |
// |
| 835 |
// who gave the trigger? |
// who gave the trigger? |
| 836 |
// |
// |
| 837 |
calotrig = 0; |
Int_t trigconf = 0; |
| 838 |
if ( L2->GetTrigLevel2()->patterntrig[0] ) calotrig = 1; |
if ( var.TRG ){ |
| 839 |
toftrig = 0; |
calotrig = 0; |
| 840 |
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; |
| 841 |
s4pulser = 0; |
toftrig = 0; |
| 842 |
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; |
| 843 |
// |
s4pulser = 0; |
| 844 |
// 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; |
| 845 |
// S4 sometimes could not set the flag even if the trigger is given. This is a workaround to fix this "bug": |
// |
| 846 |
// |
// TOF and calorimeter when giving a trigger will always set this flag since the time window of the signal is greater than 100 ns. |
| 847 |
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": |
| 848 |
// |
// |
| 849 |
Int_t trigconf = L2->GetTrigLevel2()->trigconf; |
if ( !calotrig && !toftrig ) s4pulser = 1; |
| 850 |
|
// |
| 851 |
|
trigconf = L2->GetTrigLevel2()->trigconf; |
| 852 |
|
} else { |
| 853 |
|
trigconf = 0; |
| 854 |
|
} |
| 855 |
stringstream trc; |
stringstream trc; |
| 856 |
trc.str(""); |
trc.str(""); |
| 857 |
if ( trigconf & (1<<0) ) trc << "TOF1"; |
if ( trigconf & (1<<0) ) trc << "TOF1"; |
| 960 |
// |
// |
| 961 |
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);"); |
| 962 |
// |
// |
| 963 |
if ( level.file == 2 ) isOK = gApplication->ProcessLine("filter((PamLevel2 *)L2,2);"); |
// if ( level.file == 2 ) isOK = gApplication->ProcessLine("filter((PamLevel2 *)L2,2);"); |
| 964 |
|
if ( level.file == 2 ) isOK = gApplication->ProcessLine("filter();"); |
| 965 |
// |
// |
| 966 |
// progress bar in text window |
// progress bar in text window |
| 967 |
// |
// |
| 974 |
// |
// |
| 975 |
} |
} |
| 976 |
|
|
| 977 |
void FEVdetector::Load(TTree &mainotr, TFile &mainfile){ |
TChain* FEVdetector::Load(TFile &mainfile){ |
| 978 |
|
// |
| 979 |
file = &mainfile; |
file = &mainfile; |
| 980 |
otr = &mainotr; |
// |
| 981 |
L2 = new PamLevel2(); |
L2 = new PamLevel2(); |
| 982 |
// |
// |
| 983 |
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(); |
|
| 984 |
// |
// |
| 985 |
stringstream magfie; |
printf(" %s \n",ddec.Data()); |
| 986 |
magfie.str(""); |
otr = L2->GetPamTree(gSystem->DirName(file->GetName()),file->GetName(),ddec.Data()); |
| 987 |
// magfie << "/localdisk/mocchiut/test/calib/trk-param/field_param-0/"; |
runtree = L2->GetRunTree(gSystem->DirName(file->GetName()),file->GetName()); |
| 988 |
magfie << pam_calib; |
// |
| 989 |
magfie << "/trk-param/field_param-0/"; |
if ( !otr ) return(0); |
| 990 |
// |
// |
|
L2->GetTrkLevel2()->LoadField(magfie.str().c_str()); |
|
| 991 |
} else { |
} else { |
| 992 |
// |
// |
| 993 |
// load calorimeter ADC2MIP conversion file |
// load calorimeter ADC2MIP conversion file |
| 1027 |
// |
// |
| 1028 |
}; |
}; |
| 1029 |
// |
// |
|
|
|
| 1030 |
// |
// |
| 1031 |
trigger = new pamela::trigger::TriggerEvent(); |
trigger = new pamela::trigger::TriggerEvent(); |
| 1032 |
eh = new pamela::EventHeader(); |
eh = new pamela::EventHeader(); |
| 1033 |
ph = new pamela::PscuHeader(); |
ph = new pamela::PscuHeader(); |
| 1034 |
// oinfoL2 = new OrbitalInfo(); |
// runinfo = new ItoRunInfo(file); |
|
runinfo = new ItoRunInfo(file); |
|
| 1035 |
// |
// |
| 1036 |
de = new pamela::calorimeter::CalorimeterEvent(); |
de = new pamela::calorimeter::CalorimeterEvent(); |
| 1037 |
trk = new pamela::tracker::TrackerEvent(); |
trk = new pamela::tracker::TrackerEvent(); |
| 1040 |
s4 = new pamela::S4::S4Event(); |
s4 = new pamela::S4::S4Event(); |
| 1041 |
tof = new pamela::tof::TofEvent(); |
tof = new pamela::tof::TofEvent(); |
| 1042 |
// |
// |
| 1043 |
|
// Load level0 file if the case |
| 1044 |
|
// |
| 1045 |
if ( level.file == 0 || level.file == -1 ){ |
if ( level.file == 0 || level.file == -1 ){ |
| 1046 |
|
otr = new TChain("Physics"); |
| 1047 |
|
otr->Add(file->GetName(),-1); |
| 1048 |
otr->SetBranchAddress("Trigger", &trigger); |
otr->SetBranchAddress("Trigger", &trigger); |
| 1049 |
otr->SetBranchAddress("Header", &eh); |
otr->SetBranchAddress("Header", &eh); |
| 1050 |
}; |
}; |
|
if ( level.file == 2 ){ |
|
|
// otr->AddFriend("OrbitalInfo", file); |
|
|
// otr->SetBranchAddress("OrbitalInfo", &oinfoL2); |
|
|
runinfo->Read(0ULL); |
|
|
}; |
|
| 1051 |
// |
// |
| 1052 |
if ( var.TRK ) { |
if ( var.TRK ) { |
| 1053 |
if ( level.file == 0 || level.file == -1 ){ |
if ( level.file == 0 || level.file == -1 ){ |
| 1119 |
printf("Show the Time of Flight detector, LEVEL2 data \n"); |
printf("Show the Time of Flight detector, LEVEL2 data \n"); |
| 1120 |
}; |
}; |
| 1121 |
}; |
}; |
| 1122 |
|
// |
| 1123 |
|
if ( !otr ){ |
| 1124 |
|
return(0); |
| 1125 |
|
}; |
| 1126 |
|
// |
| 1127 |
|
return otr; |
| 1128 |
// |
// |
| 1129 |
} |
} |
| 1130 |
|
|
| 1200 |
text->DrawLatex(0.33,txthi,testo.str().c_str()); |
text->DrawLatex(0.33,txthi,testo.str().c_str()); |
| 1201 |
txthi -= 0.03; |
txthi -= 0.03; |
| 1202 |
testo2.str(""); |
testo2.str(""); |
| 1203 |
testo2 << "On Board Time: " << (int)OBT; |
testo2 << "On Board Time: " << (unsigned int)OBT; |
| 1204 |
if ( DOBT > 0 ) { |
if ( DOBT > 0 ) { |
| 1205 |
testo2 << " (delta: " << (int)DOBT; |
testo2 << " (delta: " << (unsigned int)DOBT; |
| 1206 |
testo2 << ")"; |
testo2 << ")"; |
| 1207 |
}; |
}; |
| 1208 |
testo2 << " [ms]"; |
testo2 << " [ms]"; |
| 2621 |
// |
// |
| 2622 |
Bool_t repeat = true; |
Bool_t repeat = true; |
| 2623 |
Int_t numtr = 1; |
Int_t numtr = 1; |
| 2624 |
|
// Int_t numtr = 0; |
| 2625 |
Int_t repuntil = 0; |
Int_t repuntil = 0; |
| 2626 |
// |
// |
| 2627 |
// |
// |
| 2629 |
// |
// |
| 2630 |
if ( level.file == 2 ) repuntil = L2->GetToFLevel2()->ntrk(); |
if ( level.file == 2 ) repuntil = L2->GetToFLevel2()->ntrk(); |
| 2631 |
// printf("repuntil = %i \n",repuntil); |
// printf("repuntil = %i \n",repuntil); |
| 2632 |
|
//if ( level.file == 2 ) repuntil = L2->GetTrkLevel2()->GetNTracks(); |
| 2633 |
//repuntil = L2->GetNTracks(); |
//repuntil = L2->GetNTracks(); |
| 2634 |
// |
// |
| 2635 |
while ( repeat ){ |
while ( repeat ){ |
| 2639 |
// |
// |
| 2640 |
// |
// |
| 2641 |
ToFTrkVar *ptt = 0; |
ToFTrkVar *ptt = 0; |
| 2642 |
|
// PamTrack *ptrack = 0; |
| 2643 |
|
Float_t adc[4][12]; |
| 2644 |
|
Float_t tdc[4][12]; |
| 2645 |
|
memset(adc,0,4*12*sizeof(Float_t)); |
| 2646 |
|
memset(tdc,0,4*12*sizeof(Float_t)); |
| 2647 |
// |
// |
| 2648 |
// |
// |
| 2649 |
|
// if ( repuntil == 0 || var.tofraw ){ |
| 2650 |
if ( repuntil == 1 || var.tofraw ){ |
if ( repuntil == 1 || var.tofraw ){ |
| 2651 |
numtr = 0; |
numtr = 0; |
| 2652 |
ptt = L2->GetToFLevel2()->GetToFTrkVar(0); |
ptt = L2->GetToFLevel2()->GetToFTrkVar(0); |
| 2657 |
if ( numtr >= repuntil-1 ) repeat = false; |
if ( numtr >= repuntil-1 ) repeat = false; |
| 2658 |
// |
// |
| 2659 |
ptt = L2->GetToFLevel2()->GetToFTrkVar(numtr); |
ptt = L2->GetToFLevel2()->GetToFTrkVar(numtr); |
| 2660 |
|
//ptrack = L2->GetTrack(numtr); |
| 2661 |
|
//ptt = ptrack->GetToFTrack(); |
| 2662 |
}; |
}; |
| 2663 |
// |
// |
| 2664 |
xp11[0] = 0.; |
xp11[0] = 0.; |
| 2672 |
// |
// |
| 2673 |
ii = 2; |
ii = 2; |
| 2674 |
// |
// |
| 2675 |
Float_t adc[4][12]; |
Int_t myseq = ptt->trkseqno + 1; |
| 2676 |
Float_t tdc[4][12]; |
L2->GetToFLevel2()->GetMatrix(myseq,adc,tdc); |
| 2677 |
L2->GetToFLevel2()->GetMatrix(numtr,adc,tdc); |
// |
| 2678 |
|
// printf(" qua \n"); |
| 2679 |
// |
// |
| 2680 |
for ( Int_t i = 0; i<8; i++ ) { |
for ( Int_t i = 0; i<8; i++ ) { |
| 2681 |
if ( adc[ch11a[i]][hb11a[i]] < 1000. ){ |
if ( adc[ch11a[i]][hb11a[i]] < 1000. ){ |
| 4195 |
pcasp4b->Draw("f"); |
pcasp4b->Draw("f"); |
| 4196 |
pcasp4b->Draw(); |
pcasp4b->Draw(); |
| 4197 |
}; |
}; |
| 4198 |
Float_t alfa = 1.2020334; |
// Float_t alfax = 1.2020334; |
| 4199 |
|
Float_t alfax = 1.22157778; |
| 4200 |
|
Float_t alfay = 1.27393111; |
| 4201 |
Float_t lcrd = 0.1815/2.; |
Float_t lcrd = 0.1815/2.; |
| 4202 |
Float_t wcrd = 0.008; |
Float_t wcrd = 0.008; |
| 4203 |
if ( true ){ |
if ( true ){ |
| 4408 |
// |
// |
| 4409 |
// Float_t cardcx = 0.143168*var.sfx; |
// Float_t cardcx = 0.143168*var.sfx; |
| 4410 |
//Float_t cardcy = 0.1475*var.sfy; |
//Float_t cardcy = 0.1475*var.sfy; |
| 4411 |
Float_t cardcx = 0.153168*var.sfx; |
// |
| 4412 |
Float_t cardcy = 0.1575*var.sfy; |
// Float_t cardcx = 0.153168*var.sfx; |
| 4413 |
Float_t acrdx[4] = {-lcrd*cos(alfa), lcrd*cos(alfa), -lcrd*cos(alfa)+wcrd*sin(alfa), -lcrd*cos(alfa)}; |
// |
| 4414 |
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; |
| 4415 |
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; |
| 4416 |
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; |
| 4417 |
|
Float_t acrdx[4] = {-lcrd*cos(alfax), lcrd*cos(alfax), -lcrd*cos(alfax)+wcrd*sin(alfax), -lcrd*cos(alfax)}; |
| 4418 |
|
Float_t acrdy[4] = {-lcrd*sin(alfax), lcrd*sin(alfax), -lcrd*sin(alfax)-wcrd*cos(alfax), -lcrd*sin(alfax)}; |
| 4419 |
|
Float_t bcrdx[4] = { lcrd*cos(alfax), lcrd*cos(alfax)+wcrd*sin(alfax), -lcrd*cos(alfax)+wcrd*sin(alfax), lcrd*cos(alfax)}; |
| 4420 |
|
Float_t bcrdy[4] = { lcrd*sin(alfax), lcrd*sin(alfax)-wcrd*cos(alfax), -lcrd*sin(alfax)-wcrd*cos(alfax), lcrd*sin(alfax)}; |
| 4421 |
|
|
| 4422 |
// |
// |
| 4423 |
// CARD3 X/ Y |
// CARD3 X/ Y |
| 4477 |
}; |
}; |
| 4478 |
|
|
| 4479 |
if ( true ){ |
if ( true ){ |
| 4480 |
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)}; |
| 4481 |
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)}; |
| 4482 |
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)}; |
| 4483 |
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)}; |
| 4484 |
// |
// |
| 4485 |
// CARD - Y-view |
// CARD - Y-view |
| 4486 |
// |
// |
| 4487 |
Float_t cardcx = 0.12*var.sfx; |
// Float_t cardcx = 0.12*var.sfx; |
| 4488 |
Float_t cardcy = 0.1475*var.sfy; |
Float_t cardcx = (0.16014*(1.-lcrd*cos(alfay)))*var.sfx; |
| 4489 |
|
// Float_t cardcy = 0.178818*var.sfy; |
| 4490 |
|
Float_t cardcy = (0.178818*(1.-lcrd*sin(alfay)))*var.sfy; |
| 4491 |
|
// Float_t cardcy = 0.1475*var.sfy; |
| 4492 |
// |
// |
| 4493 |
// CARD4 X Y/ |
// CARD4 X Y/ |
| 4494 |
// |
// |
| 5054 |
// |
// |
| 5055 |
if ( L2->GetTrkLevel2()->GetNTracks() > 0 ){ |
if ( L2->GetTrkLevel2()->GetNTracks() > 0 ){ |
| 5056 |
for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ |
for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ |
| 5057 |
TrkTrack *track = L2->GetTrkLevel2()->GetTrack(nt); |
PamTrack *ptrack= L2->GetTrack(nt); |
| 5058 |
|
TrkTrack *track = ptrack->GetTrkTrack(); |
| 5059 |
if ( nt == 0 ){ |
if ( nt == 0 ){ |
| 5060 |
var.rig = 0.; |
var.rig = 0.; |
| 5061 |
if ( track->al[4] != 0. ) var.rig = 1./track->al[4]; |
if ( track->al[4] != 0. ) var.rig = 1./track->al[4]; |
| 5152 |
// first of all plot crosses relatives to tracks |
// first of all plot crosses relatives to tracks |
| 5153 |
// |
// |
| 5154 |
if ( L2->GetTrkLevel2()->GetNTracks() > 0 ){ |
if ( L2->GetTrkLevel2()->GetNTracks() > 0 ){ |
| 5155 |
|
// for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ |
| 5156 |
|
// TrkTrack *track = L2->GetTrkLevel2()->GetTrack(nt); |
| 5157 |
for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ |
for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ |
| 5158 |
TrkTrack *track = L2->GetTrkLevel2()->GetTrack(nt); |
PamTrack *ptrack= L2->GetTrack(nt); |
| 5159 |
|
TrkTrack *track = ptrack->GetTrkTrack(); |
| 5160 |
|
// |
| 5161 |
for (Int_t plane = 0; plane<6; plane++){ |
for (Int_t plane = 0; plane<6; plane++){ |
| 5162 |
// |
// |
| 5163 |
x = track->xm[plane]; |
x = track->xm[plane]; |
| 5572 |
// |
// |
| 5573 |
if ( L2->GetTrkLevel2()->GetNTracks() > 0 ){ |
if ( L2->GetTrkLevel2()->GetNTracks() > 0 ){ |
| 5574 |
for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ |
for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ |
| 5575 |
TrkTrack *track = L2->GetTrkLevel2()->GetTrack(nt); |
|
| 5576 |
|
// TrkTrack *track = L2->GetTrkLevel2()->GetTrack(nt); |
| 5577 |
|
PamTrack *ptrack = L2->GetTrack(nt); |
| 5578 |
|
TrkTrack *track = ptrack->GetTrkTrack(); |
| 5579 |
Int_t npoint = 100; |
Int_t npoint = 100; |
| 5580 |
Float_t zin[100]; |
Float_t zin[100]; |
| 5581 |
Double_t xout[100]; |
Double_t xout[100]; |
| 5899 |
// |
// |
| 5900 |
// Define variables |
// Define variables |
| 5901 |
// |
// |
| 5902 |
Int_t etime = var.etime; |
UInt_t etime = var.etime; |
| 5903 |
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]; |
| 5904 |
Int_t badstrip = 0; |
Int_t badstrip = 0; |
| 5905 |
qtot = 0.; |
qtot = 0.; |
| 5971 |
if ( calib.ttime[s][b[s]+1] && calib.time[s][b[s]] ){ |
if ( calib.ttime[s][b[s]+1] && calib.time[s][b[s]] ){ |
| 5972 |
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 ){ |
| 5973 |
printf(" CALORIMETER: \n" ); |
printf(" CALORIMETER: \n" ); |
| 5974 |
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]); |
| 5975 |
printf(" END CALORIMETER. \n\n" ); |
printf(" END CALORIMETER. \n\n" ); |
| 5976 |
b[s]++; |
b[s]++; |
| 5977 |
CaloPede(s); |
CaloPede(s); |
| 6276 |
for (Int_t d = 0; d<48; d++){ |
for (Int_t d = 0; d<48; d++){ |
| 6277 |
if ( calib.ttime[s][d] != 0 ) calibex++; |
if ( calib.ttime[s][d] != 0 ) calibex++; |
| 6278 |
if ( calib.time[s][0] != 0 ){ |
if ( calib.time[s][0] != 0 ){ |
| 6279 |
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]); |
| 6280 |
if ( calib.time[s][d+1] != 0 ) { |
if ( calib.time[s][d+1] != 0 ) { |
| 6281 |
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]); |
| 6282 |
} else { |
} else { |
| 6283 |
if ( !stop ){ |
if ( !stop ){ |
| 6284 |
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]); |
| 6285 |
stop = 1; |
stop = 1; |
| 6286 |
}; |
}; |
| 6287 |
}; |
}; |
| 6288 |
} else { |
} else { |
| 6289 |
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]); |
| 6290 |
}; |
}; |
| 6291 |
}; |
}; |
| 6292 |
printf("\n"); |
printf("\n"); |
| 6351 |
calib.ttime[s][inter] = 0; |
calib.ttime[s][inter] = 0; |
| 6352 |
if ( ce->cstwerr[s] != 0 && ce->cperror[s] == 0 ) { |
if ( ce->cstwerr[s] != 0 && ce->cperror[s] == 0 ) { |
| 6353 |
//calib.ttime[s][inter] = cph->GetOrbitalTime(); |
//calib.ttime[s][inter] = cph->GetOrbitalTime(); |
| 6354 |
calib.ttime[s][inter] = cph->OrbitalTime; |
calib.ttime[s][inter] = (UInt_t)cph->OrbitalTime; |
| 6355 |
inter++; |
inter++; |
| 6356 |
} else { |
} else { |
| 6357 |
if ( ce->cstwerr[s] != 0 && ce->cperror[s] != 0 ) { |
if ( ce->cstwerr[s] != 0 && ce->cperror[s] != 0 ) { |
| 6405 |
tr->GetEntry(ci); |
tr->GetEntry(ci); |
| 6406 |
cph = ceh->GetPscuHeader(); |
cph = ceh->GetPscuHeader(); |
| 6407 |
//if ( atime == cph->GetOrbitalTime()){ |
//if ( atime == cph->GetOrbitalTime()){ |
| 6408 |
if ( atime == cph->OrbitalTime){ |
if ( atime == (UInt_t)cph->OrbitalTime){ |
| 6409 |
// calib.iev = ce->iev; |
// calib.iev = ce->iev; |
| 6410 |
if (ce->cstwerr[s] != 0 && ce->cperror[s] == 0 ) { |
if (ce->cstwerr[s] != 0 && ce->cperror[s] == 0 ) { |
| 6411 |
for ( Int_t d=0 ; d<11 ;d++ ){ |
for ( Int_t d=0 ; d<11 ;d++ ){ |