| 46 |
#include <TEllipse.h> |
#include <TEllipse.h> |
| 47 |
#include <TArrow.h> |
#include <TArrow.h> |
| 48 |
#include <TStyle.h> |
#include <TStyle.h> |
| 49 |
|
#include <TStreamerElement.h> |
| 50 |
|
#include <TRealData.h> |
| 51 |
// |
// |
| 52 |
#include <PamelaRun.h> |
#include <PamelaRun.h> |
| 53 |
#include <physics/calorimeter/CalorimeterEvent.h> |
#include <physics/calorimeter/CalorimeterEvent.h> |
| 69 |
#include <FEVdetector.h> |
#include <FEVdetector.h> |
| 70 |
#include <FEventViewer.h> |
#include <FEventViewer.h> |
| 71 |
#include <feventvstruct.h> |
#include <feventvstruct.h> |
| 72 |
|
#include <color.h> |
| 73 |
// |
// |
| 74 |
extern Bool_t existfile(TString); |
extern Bool_t existfile(TString); |
| 75 |
// |
// |
| 89 |
var.SHOWDEC = 0; |
var.SHOWDEC = 0; |
| 90 |
var.TOF = 0; |
var.TOF = 0; |
| 91 |
var.AC = 0; |
var.AC = 0; |
| 92 |
|
var.RUN = 1; |
| 93 |
var.TRK = 0; |
var.TRK = 0; |
| 94 |
|
var.ORB = 1; |
| 95 |
|
var.TRG = 0; |
| 96 |
var.CALO = 0; |
var.CALO = 0; |
| 97 |
|
var.CALOT = 0; |
| 98 |
var.S4 = 0; |
var.S4 = 0; |
| 99 |
var.ND = 0; |
var.ND = 0; |
| 100 |
var.INFOS = 0; |
var.INFOS = 0; |
| 129 |
}; |
}; |
| 130 |
} |
} |
| 131 |
|
|
| 132 |
|
void FEVdetector::SetDDEC(TString de){ |
| 133 |
|
ddec=de; |
| 134 |
|
}; |
| 135 |
|
|
| 136 |
void FEVdetector::GetWindow(){ |
void FEVdetector::GetWindow(){ |
| 137 |
otr->GetEntry(maxevent); |
printf(" ah \n"); |
| 138 |
|
// |
| 139 |
|
if ( level.file == 2 ){ |
| 140 |
|
L2->GetEntry(maxevent); |
| 141 |
|
} else { |
| 142 |
|
otr->GetEntry(maxevent); |
| 143 |
|
} |
| 144 |
|
// |
| 145 |
if ( level.file < 2 ){ |
if ( level.file < 2 ){ |
| 146 |
ph = eh->GetPscuHeader(); |
ph = eh->GetPscuHeader(); |
| 147 |
lastevno = (int)ph->Counter; |
lastevno = (int)ph->Counter; |
| 148 |
} else { |
} else { |
| 149 |
lastevno = L2->GetOrbitalInfo()->pkt_num; // to be changed as soon as we will have pkt_counter in the level2 file! |
if ( var.ORB ){ |
| 150 |
|
lastevno = L2->GetOrbitalInfo()->pkt_num; |
| 151 |
|
} else { |
| 152 |
|
lastevno = 0; |
| 153 |
|
}; |
| 154 |
}; |
}; |
| 155 |
otr->GetEntry(minevent); |
printf(" mmh minev %u \n",minevent); |
| 156 |
|
if ( level.file == 2 ){ |
| 157 |
|
L2->GetEntry(minevent); |
| 158 |
|
} else { |
| 159 |
|
otr->GetEntry(minevent); |
| 160 |
|
} |
| 161 |
if ( level.file < 2 ){ |
if ( level.file < 2 ){ |
| 162 |
ph = eh->GetPscuHeader(); |
ph = eh->GetPscuHeader(); |
| 163 |
firstevno = (int)ph->Counter; |
firstevno = (int)ph->Counter; |
| 164 |
} else { |
} else { |
| 165 |
firstevno = L2->GetOrbitalInfo()->pkt_num; // to be changed as soon as we will have pkt_counter in the level2 file! |
if ( var.ORB ){ |
| 166 |
|
firstevno = L2->GetOrbitalInfo()->pkt_num; |
| 167 |
|
} else { |
| 168 |
|
firstevno = 0; |
| 169 |
|
}; |
| 170 |
}; |
}; |
| 171 |
|
printf(" aaah \n"); |
| 172 |
} |
} |
| 173 |
|
|
| 174 |
void FEVdetector::ClearVariables(){ |
void FEVdetector::ClearVariables(){ |
| 191 |
} |
} |
| 192 |
|
|
| 193 |
void FEVdetector::GetEntry(Int_t i){ |
void FEVdetector::GetEntry(Int_t i){ |
| 194 |
thisentry = i; |
thisentry = i; |
| 195 |
otr->GetEntry(i); |
if ( level.file == 2 ){ |
| 196 |
|
printf("qui \n"); |
| 197 |
|
L2->GetEntry(i); |
| 198 |
|
printf("qua \n"); |
| 199 |
|
ShowInfo("RunInfo"); |
| 200 |
|
ShowInfo("SoftInfo"); |
| 201 |
|
ShowInfo("OrbitalInfo"); |
| 202 |
|
ShowInfo("TrigLevel2"); |
| 203 |
|
ShowInfo("ToFLevel2"); |
| 204 |
|
ShowInfo("TrkLevel2"); |
| 205 |
|
ShowInfo("AcLevel2"); |
| 206 |
|
ShowInfo("CaloLevel2"); |
| 207 |
|
ShowInfo("CaloLevel1"); |
| 208 |
|
ShowInfo("S4Level2"); |
| 209 |
|
ShowInfo("NDLevel2"); |
| 210 |
|
} else { |
| 211 |
|
otr->GetEntry(i); |
| 212 |
|
ShowInfo("Pscu"); |
| 213 |
|
ShowInfo("Trigger"); |
| 214 |
|
ShowInfo("Tof"); |
| 215 |
|
ShowInfo("Tracker"); |
| 216 |
|
ShowInfo("Anticounter"); |
| 217 |
|
ShowInfo("Calorimeter"); |
| 218 |
|
ShowInfo("Neutron"); |
| 219 |
|
ShowInfo("S4"); |
| 220 |
|
}; |
| 221 |
} |
} |
| 222 |
|
|
| 223 |
void FEVdetector::SetEntry(Int_t i){ |
void FEVdetector::SetEntry(Int_t i){ |
| 338 |
}; |
}; |
| 339 |
} |
} |
| 340 |
|
|
| 341 |
|
void FEVdetector::ShowInfo(TString detector){ |
| 342 |
|
// |
| 343 |
|
TBranch *b1 = 0; |
| 344 |
|
// TBranch *b3 = 0; |
| 345 |
|
TObjArray *branch_array = 0; |
| 346 |
|
// TObjArray *leaf_array = 0; |
| 347 |
|
// |
| 348 |
|
if ( !strcmp(detector.Data(),"RunInfo") || !strcmp(detector.Data(),"SoftInfo") ){ |
| 349 |
|
if ( runtree ) b1 = runtree->FindBranch(detector.Data()); |
| 350 |
|
} else { |
| 351 |
|
b1 = otr->FindBranch(detector.Data()); |
| 352 |
|
}; |
| 353 |
|
// |
| 354 |
|
if ( !b1 ) return; |
| 355 |
|
// |
| 356 |
|
Int_t dlen = 10; |
| 357 |
|
// |
| 358 |
|
char o[200000]; |
| 359 |
|
char col[13]; |
| 360 |
|
char col2[13]; |
| 361 |
|
// |
| 362 |
|
setcolor(col,RESET, GREEN, WHITE); |
| 363 |
|
sprintf(o,"%s======> EVENT:%i\n",col, thisentry); |
| 364 |
|
// |
| 365 |
|
setcolor(col,RESET, RED, WHITE); |
| 366 |
|
sprintf(o,"%s%sBranch %s\n",o,col,b1->GetName()); |
| 367 |
|
setcolor(col,RESET, BLACK, WHITE); |
| 368 |
|
sprintf(o,"%s%s",o,col); |
| 369 |
|
// |
| 370 |
|
branch_array = b1->GetListOfBranches(); |
| 371 |
|
// |
| 372 |
|
Int_t j = 0; |
| 373 |
|
// |
| 374 |
|
for(Int_t l=0;l<(branch_array->GetLast()+1);l++){ |
| 375 |
|
// |
| 376 |
|
TBranchElement *tb = (TBranchElement*)branch_array->At(l); |
| 377 |
|
Int_t type = tb->GetType(); |
| 378 |
|
Int_t atype = tb->GetStreamerType() - 20; |
| 379 |
|
Int_t len = (tb->GetInfo()->GetLengths())[tb->GetID()]; |
| 380 |
|
Int_t length = min(len,dlen); |
| 381 |
|
// |
| 382 |
|
// printf("Branches : type is %i type is %i tb getname %s slen %i slength %i\n",atype,type,tb->GetName(),len,length); |
| 383 |
|
switch (type){ |
| 384 |
|
case 0: |
| 385 |
|
// |
| 386 |
|
// IS A VARIABLE |
| 387 |
|
// |
| 388 |
|
// |
| 389 |
|
// NAME |
| 390 |
|
// |
| 391 |
|
setcolor(col,RESET, BLUE, WHITE); |
| 392 |
|
setcolor(col2,RESET, BLACK, WHITE); |
| 393 |
|
sprintf(o,"%s%s %-15s%s =",o,col,((TBranch*)branch_array->At(l))->GetName(),col2); |
| 394 |
|
// |
| 395 |
|
j = 0; |
| 396 |
|
// |
| 397 |
|
// VALUES |
| 398 |
|
// |
| 399 |
|
// |
| 400 |
|
// Integer |
| 401 |
|
// |
| 402 |
|
if ( atype == 3 || atype == -17 ){ |
| 403 |
|
while ( j < length ){ |
| 404 |
|
if ( j < length -1 ){ |
| 405 |
|
sprintf(o,"%s %i ,",o,(Int_t)tb->GetValue(j,0)); |
| 406 |
|
} else { |
| 407 |
|
sprintf(o,"%s %i",o,(Int_t)tb->GetValue(j,0)); |
| 408 |
|
}; |
| 409 |
|
j++; |
| 410 |
|
}; |
| 411 |
|
}; |
| 412 |
|
// |
| 413 |
|
// Unsigned integer |
| 414 |
|
// |
| 415 |
|
if ( atype == -7 || atype == 13 || atype == -9 || atype == -8 || atype == 12 ){ |
| 416 |
|
while ( j < length ){ |
| 417 |
|
if ( j < length -1 ){ |
| 418 |
|
sprintf(o,"%s %u ,",o,(UInt_t)tb->GetValue(j,0)); |
| 419 |
|
} else { |
| 420 |
|
sprintf(o,"%s %u",o,(UInt_t)tb->GetValue(j,0)); |
| 421 |
|
}; |
| 422 |
|
j++; |
| 423 |
|
}; |
| 424 |
|
}; |
| 425 |
|
// |
| 426 |
|
// Float |
| 427 |
|
// |
| 428 |
|
if ( atype == -15 || atype == 5 ){ |
| 429 |
|
while ( j < length ){ |
| 430 |
|
if ( j < length -1 ){ |
| 431 |
|
sprintf(o,"%s %f ,",o,tb->GetValue(j,0)); |
| 432 |
|
} else { |
| 433 |
|
sprintf(o,"%s %f",o,tb->GetValue(j,0)); |
| 434 |
|
}; |
| 435 |
|
j++; |
| 436 |
|
}; |
| 437 |
|
}; |
| 438 |
|
// |
| 439 |
|
// Strings |
| 440 |
|
// |
| 441 |
|
if ( atype == 45 ){ |
| 442 |
|
// TObjArray *cl = (TObjArray*)(tb->GetInfo()->GetOffsets())[tb->GetID()];//tb->GetValuePointer(); |
| 443 |
|
// TString *stringa = (TString*)(*cl)[0]; |
| 444 |
|
// TBranchElement *utb = (TBranchElement*)tb->GetBranchCount(); |
| 445 |
|
// TString** stringa = (TString*)(&tb->GetValuePointer()); |
| 446 |
|
//TStreamerElement *tste = (TStreamerElement*)tb->GetInfo()->GetCurrentElement(); |
| 447 |
|
|
| 448 |
|
// char *ladd; |
| 449 |
|
// ladd = tb->GetValuePointer() |
| 450 |
|
// TString *stringa = (TString*)((tste->GetOffset())); |
| 451 |
|
// TString& mstr = *stringa; |
| 452 |
|
// printf(" la mia stringa %s \n",mstr.Data()); |
| 453 |
|
// printf(" offset %i \n",(Int_t)utb->GetValue(0,0)); |
| 454 |
|
// int pointer = (tb->GetInfo()->GetOffsets())[tb->GetID()]; |
| 455 |
|
// TString *stringa = (TString*)(tb->GetInfo()->GetOffsets())[tb->GetID()]; |
| 456 |
|
// TString *stringa = (TString*)tb->GetAddress(); |
| 457 |
|
// printf(" address 0x%X \n",tb->GetAddress()); |
| 458 |
|
// printf(" pointer 0x%X \n",tb->GetValuePointer()); |
| 459 |
|
// printf(" object 0x%X \n",tb->GetObject()); |
| 460 |
|
// printf("stringa %s lung %i\n",stringa.Data(),stringa.Length()); |
| 461 |
|
// TLeaf *striglia = tb->FindLeaf(tb->GetName()); |
| 462 |
|
// if ( striglia ){ |
| 463 |
|
// char *pointer = (char *)striglia->GetValuePointer(); |
| 464 |
|
// TString *pr= (TString*)pointer; |
| 465 |
|
// printf("ciao %s \n",pr->Data()); |
| 466 |
|
// }; |
| 467 |
|
sprintf(o,"%s TString - not implemented yet -",o); |
| 468 |
|
}; |
| 469 |
|
// |
| 470 |
|
// TArray |
| 471 |
|
// |
| 472 |
|
if ( atype == 42 ){ |
| 473 |
|
// |
| 474 |
|
// TObjArray *cl = (TObjArray*)tb->GetObject(); |
| 475 |
|
// // |
| 476 |
|
// TClass *myc = cl->IsA(); |
| 477 |
|
// // |
| 478 |
|
// printf("qui \n"); |
| 479 |
|
// // |
| 480 |
|
// // determine offset to fetch data |
| 481 |
|
// // |
| 482 |
|
// int thisoffset = 0; |
| 483 |
|
// TRealData *rd = myc->GetRealData(tb->GetName()); |
| 484 |
|
// if ( rd ){ |
| 485 |
|
// thisoffset = rd->GetThisOffset(); |
| 486 |
|
// }; |
| 487 |
|
// Int_t niente = 0; |
| 488 |
|
// TStreamerElement *tste = tb->GetInfo()->GetStreamerElement(rd->GetName(),niente); |
| 489 |
|
// printf(" typename %s \n",tste->GetTypeName()); |
| 490 |
|
// // |
| 491 |
|
// // TArrayI |
| 492 |
|
// // |
| 493 |
|
// if ( !strcmp(tste->GetTypeName(),"TArrayI") ){ |
| 494 |
|
// // |
| 495 |
|
// printf("qua \n"); |
| 496 |
|
// char *pointer = (char*)cl->At(0); |
| 497 |
|
// // char *pu = thisoffset + pointer; |
| 498 |
|
// int pu = (int)tste->GetTObjectOffset(); |
| 499 |
|
// TArrayI arr = (TArrayI)*pu; |
| 500 |
|
// // TArrayI arr = (TArrayI)(thisoffset); |
| 501 |
|
// //TArrayI *arr = (TArrayI*)pu; |
| 502 |
|
// //TArraI arr = (TArrayI) |
| 503 |
|
// Int_t jj=0; |
| 504 |
|
// j=0; |
| 505 |
|
// printf("quii \n"); |
| 506 |
|
// Int_t arlen = min(arr.GetSize(),dlen); |
| 507 |
|
// // |
| 508 |
|
// printf("que \n"); |
| 509 |
|
// setcolor(col,RESET, BLUE, WHITE); |
| 510 |
|
// setcolor(col2,RESET, BLACK, WHITE); |
| 511 |
|
// sprintf(o,"%s%s %s[%i]%s = ",o,col,tb->GetName(),arr.GetSize(),col2); |
| 512 |
|
// // |
| 513 |
|
// // while ( j < tb->GetNdata() ){ |
| 514 |
|
// // |
| 515 |
|
// printf("quo \n"); |
| 516 |
|
// // pointer = (char*)cl->UncheckedAt(j); |
| 517 |
|
// // pu = pointer + thisoffset; |
| 518 |
|
// // arr = (TArrayI*)(thisoffset); |
| 519 |
|
// // |
| 520 |
|
// while ( jj < arlen ){ |
| 521 |
|
// if ( jj < arlen-1 ){ |
| 522 |
|
// sprintf(o,"%s %i ,",o,arr.At(jj)); |
| 523 |
|
// } else { |
| 524 |
|
// sprintf(o,"%s %i",o,arr.At(jj)); |
| 525 |
|
// }; |
| 526 |
|
// jj++; |
| 527 |
|
// }; |
| 528 |
|
// // if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); |
| 529 |
|
// // j++; |
| 530 |
|
// // }; |
| 531 |
|
// }; |
| 532 |
|
// // |
| 533 |
|
// // TArrayF |
| 534 |
|
// // |
| 535 |
|
// if ( !strcmp(tste->GetTypeName(),"TArrayF") ){ |
| 536 |
|
// // |
| 537 |
|
// char *pointer = (char*)cl->UncheckedAt(0); |
| 538 |
|
// char *pu = pointer + thisoffset; |
| 539 |
|
// TArrayF *arr = (TArrayF*)(pu); |
| 540 |
|
// Int_t jj=0; |
| 541 |
|
// Int_t arlen = min(arr->GetSize(),dlen); |
| 542 |
|
// // |
| 543 |
|
// setcolor(col,RESET, BLUE, WHITE); |
| 544 |
|
// setcolor(col2,RESET, BLACK, WHITE); |
| 545 |
|
// sprintf(o,"%s%s %s[%i]%s = ",o,col,tb->GetName(),arr->GetSize(),col2); |
| 546 |
|
// // |
| 547 |
|
// while ( j < tb->GetNdata() ){ |
| 548 |
|
// // |
| 549 |
|
// pointer = (char*)cl->UncheckedAt(j); |
| 550 |
|
// pu = pointer + thisoffset; |
| 551 |
|
// arr = (TArrayF*)(pu); |
| 552 |
|
// // |
| 553 |
|
// while ( jj < arlen ){ |
| 554 |
|
// if ( jj < arlen-1 ){ |
| 555 |
|
// sprintf(o,"%s %f ,",o,arr->At(jj)); |
| 556 |
|
// } else { |
| 557 |
|
// sprintf(o,"%s %f",o,arr->At(jj)); |
| 558 |
|
// }; |
| 559 |
|
// jj++; |
| 560 |
|
// }; |
| 561 |
|
// if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); |
| 562 |
|
// j++; |
| 563 |
|
// }; |
| 564 |
|
// }; |
| 565 |
|
// sprintf(o,"%s\n",o); |
| 566 |
|
// |
| 567 |
|
sprintf(o,"%s TArray - not implemented yet -",o); |
| 568 |
|
// |
| 569 |
|
}; |
| 570 |
|
// |
| 571 |
|
sprintf(o,"%s\n",o); |
| 572 |
|
break; |
| 573 |
|
case 3: |
| 574 |
|
// |
| 575 |
|
// IS A TCLONESARRAY |
| 576 |
|
// |
| 577 |
|
setcolor(col,RESET, BLUE, WHITE); |
| 578 |
|
setcolor(col2,RESET, BLACK, WHITE); |
| 579 |
|
sprintf(o,"%s%s %-15s%s = %d\n",o,col,tb->GetName(), col2, tb->GetNdata()); |
| 580 |
|
|
| 581 |
|
// |
| 582 |
|
if ( tb->GetNdata() ){ |
| 583 |
|
// |
| 584 |
|
TClonesArray *cl = (TClonesArray*)tb->GetObject(); |
| 585 |
|
// |
| 586 |
|
TClass *myc = cl->GetClass(); |
| 587 |
|
// |
| 588 |
|
TList *lme = myc->GetListOfDataMembers(); |
| 589 |
|
TIter next(lme); |
| 590 |
|
TBranchElement *tb2 = 0; |
| 591 |
|
// |
| 592 |
|
while ( (tb2 = (TBranchElement*)next()) ){ |
| 593 |
|
// |
| 594 |
|
const char *name = tb2->GetName(); |
| 595 |
|
TBranch *foglia = tb->FindBranch(name); |
| 596 |
|
if ( foglia ){ |
| 597 |
|
// |
| 598 |
|
TBranchElement *stb = (TBranchElement*)tb->FindBranch(name); |
| 599 |
|
Int_t stype = stb->GetType(); |
| 600 |
|
Int_t satype = stb->GetStreamerType() - 20; |
| 601 |
|
Int_t slen = (stb->GetInfo()->GetLengths())[stb->GetID()]; |
| 602 |
|
Int_t slength = min(slen,dlen); |
| 603 |
|
// printf("SubBranches : atype is %i type is %i tb getname %s slen %i slength %i\n",satype,stype,stb->GetName(),slen,slength); |
| 604 |
|
switch (stype){ |
| 605 |
|
case 31: |
| 606 |
|
// |
| 607 |
|
// IS A VARIABLE |
| 608 |
|
// |
| 609 |
|
// |
| 610 |
|
// NAME |
| 611 |
|
// |
| 612 |
|
j = 0; |
| 613 |
|
// |
| 614 |
|
// VALUES |
| 615 |
|
// |
| 616 |
|
if ( satype == 41 || satype == 44){ |
| 617 |
|
// |
| 618 |
|
// skip TRef |
| 619 |
|
// |
| 620 |
|
break; |
| 621 |
|
}; |
| 622 |
|
// |
| 623 |
|
// Integer |
| 624 |
|
// |
| 625 |
|
if ( satype == -17 || satype == -9 ){ |
| 626 |
|
// |
| 627 |
|
setcolor(col,RESET, BLUE, WHITE); |
| 628 |
|
setcolor(col2,RESET, BLACK, WHITE); |
| 629 |
|
sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2); |
| 630 |
|
while ( j < cl->GetEntriesFast() ){ |
| 631 |
|
if ( j < cl->GetEntriesFast() -1 ){ |
| 632 |
|
sprintf(o,"%s %i ,",o,(Int_t)stb->GetValue(j,slength)); |
| 633 |
|
} else { |
| 634 |
|
sprintf(o,"%s %i",o,(Int_t)stb->GetValue(j,slength)); |
| 635 |
|
}; |
| 636 |
|
j++; |
| 637 |
|
}; |
| 638 |
|
}; |
| 639 |
|
// |
| 640 |
|
// Float |
| 641 |
|
// |
| 642 |
|
if ( satype == -15 ){ |
| 643 |
|
// |
| 644 |
|
setcolor(col,RESET, BLUE, WHITE); |
| 645 |
|
setcolor(col2,RESET, BLACK, WHITE); |
| 646 |
|
sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2); |
| 647 |
|
while ( j < cl->GetEntriesFast() ){ |
| 648 |
|
if ( j < cl->GetEntriesFast() -1 ){ |
| 649 |
|
sprintf(o,"%s %f ,",o,stb->GetValue(j,slength)); |
| 650 |
|
} else { |
| 651 |
|
sprintf(o,"%s %f",o,stb->GetValue(j,slength)); |
| 652 |
|
}; |
| 653 |
|
j++; |
| 654 |
|
}; |
| 655 |
|
}; |
| 656 |
|
// |
| 657 |
|
// Array of float |
| 658 |
|
// |
| 659 |
|
if ( satype == 5 ){ |
| 660 |
|
// |
| 661 |
|
setcolor(col,RESET, BLUE, WHITE); |
| 662 |
|
setcolor(col2,RESET, BLACK, WHITE); |
| 663 |
|
sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2); |
| 664 |
|
Bool_t bold = true; |
| 665 |
|
while ( j < tb->GetNdata() ){ |
| 666 |
|
if ( bold ){ |
| 667 |
|
setcolor(col,RESET, BLACK, WHITE); |
| 668 |
|
sprintf(o,"%s%s",o,col); |
| 669 |
|
} else { |
| 670 |
|
setcolor(col,BOLD, BLACK, WHITE); |
| 671 |
|
sprintf(o,"%s%s",o,col); |
| 672 |
|
}; |
| 673 |
|
Int_t jj = 0; |
| 674 |
|
while ( jj < slength ){ |
| 675 |
|
if ( jj < slength-1 ){ |
| 676 |
|
sprintf(o,"%s %f ,",o,stb->GetValue(j,jj,true)); |
| 677 |
|
} else { |
| 678 |
|
sprintf(o,"%s %f",o,stb->GetValue(j,jj,true)); |
| 679 |
|
}; |
| 680 |
|
jj++; |
| 681 |
|
}; |
| 682 |
|
if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); |
| 683 |
|
if ( !bold ){ |
| 684 |
|
bold = true; |
| 685 |
|
} else { |
| 686 |
|
bold = false; |
| 687 |
|
}; |
| 688 |
|
j++; |
| 689 |
|
}; |
| 690 |
|
if ( bold ){ |
| 691 |
|
setcolor(col,RESET, BLACK, WHITE); |
| 692 |
|
sprintf(o,"%s%s",o,col); |
| 693 |
|
}; |
| 694 |
|
}; |
| 695 |
|
// |
| 696 |
|
// Array of integers |
| 697 |
|
// |
| 698 |
|
if ( satype == 3 ){ |
| 699 |
|
// |
| 700 |
|
setcolor(col,RESET, BLUE, WHITE); |
| 701 |
|
setcolor(col2,RESET, BLACK, WHITE); |
| 702 |
|
sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2); |
| 703 |
|
while ( j < tb->GetNdata() ){ |
| 704 |
|
Int_t jj = 0; |
| 705 |
|
while ( jj < slength ){ |
| 706 |
|
if ( jj < slength-1 ){ |
| 707 |
|
sprintf(o,"%s %i ,",o,(Int_t)stb->GetValue(j,jj,true)); |
| 708 |
|
} else { |
| 709 |
|
sprintf(o,"%s %i",o,(Int_t)stb->GetValue(j,jj,true)); |
| 710 |
|
}; |
| 711 |
|
jj++; |
| 712 |
|
}; |
| 713 |
|
if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); |
| 714 |
|
j++; |
| 715 |
|
}; |
| 716 |
|
}; |
| 717 |
|
|
| 718 |
|
// |
| 719 |
|
// TArray |
| 720 |
|
// |
| 721 |
|
if ( satype == 42 ){ |
| 722 |
|
// |
| 723 |
|
// determine offset to fetch data |
| 724 |
|
// |
| 725 |
|
int thisoffset = 0; |
| 726 |
|
TRealData *rd = myc->GetRealData(foglia->GetName()); |
| 727 |
|
if ( rd ){ |
| 728 |
|
thisoffset = rd->GetThisOffset(); |
| 729 |
|
}; |
| 730 |
|
Int_t niente = 0; |
| 731 |
|
TStreamerElement *tste = stb->GetInfo()->GetStreamerElement(rd->GetName(),niente); |
| 732 |
|
// |
| 733 |
|
// TArrayI |
| 734 |
|
// |
| 735 |
|
if ( !strcmp(tste->GetTypeName(),"TArrayI") ){ |
| 736 |
|
// |
| 737 |
|
char *pointer = (char*)cl->UncheckedAt(0); |
| 738 |
|
char *pu = pointer + thisoffset; |
| 739 |
|
TArrayI *arr = (TArrayI*)(pu); |
| 740 |
|
Int_t jj=0; |
| 741 |
|
Int_t arlen = min(arr->GetSize(),dlen); |
| 742 |
|
// |
| 743 |
|
setcolor(col,RESET, BLUE, WHITE); |
| 744 |
|
setcolor(col2,RESET, BLACK, WHITE); |
| 745 |
|
sprintf(o,"%s%s %s[%i]%s = ",o,col,foglia->GetName(),arr->GetSize(),col2); |
| 746 |
|
// |
| 747 |
|
while ( j < tb->GetNdata() ){ |
| 748 |
|
// |
| 749 |
|
pointer = (char*)cl->UncheckedAt(j); |
| 750 |
|
pu = pointer + thisoffset; |
| 751 |
|
arr = (TArrayI*)(pu); |
| 752 |
|
// |
| 753 |
|
while ( jj < arlen ){ |
| 754 |
|
if ( jj < arlen-1 ){ |
| 755 |
|
sprintf(o,"%s %i ,",o,arr->At(jj)); |
| 756 |
|
} else { |
| 757 |
|
sprintf(o,"%s %i",o,arr->At(jj)); |
| 758 |
|
}; |
| 759 |
|
jj++; |
| 760 |
|
}; |
| 761 |
|
if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); |
| 762 |
|
j++; |
| 763 |
|
}; |
| 764 |
|
}; |
| 765 |
|
// |
| 766 |
|
// TArrayF |
| 767 |
|
// |
| 768 |
|
if ( !strcmp(tste->GetTypeName(),"TArrayF") ){ |
| 769 |
|
// |
| 770 |
|
char *pointer = (char*)cl->UncheckedAt(0); |
| 771 |
|
char *pu = pointer + thisoffset; |
| 772 |
|
TArrayF *arr = (TArrayF*)(pu); |
| 773 |
|
Int_t jj=0; |
| 774 |
|
Int_t arlen = min(arr->GetSize(),dlen); |
| 775 |
|
// |
| 776 |
|
setcolor(col,RESET, BLUE, WHITE); |
| 777 |
|
setcolor(col2,RESET, BLACK, WHITE); |
| 778 |
|
sprintf(o,"%s%s %s[%i]%s = ",o,col,foglia->GetName(),arr->GetSize(),col2); |
| 779 |
|
// |
| 780 |
|
while ( j < tb->GetNdata() ){ |
| 781 |
|
// |
| 782 |
|
pointer = (char*)cl->UncheckedAt(j); |
| 783 |
|
pu = pointer + thisoffset; |
| 784 |
|
arr = (TArrayF*)(pu); |
| 785 |
|
// |
| 786 |
|
while ( jj < arlen ){ |
| 787 |
|
if ( jj < arlen-1 ){ |
| 788 |
|
sprintf(o,"%s %f ,",o,arr->At(jj)); |
| 789 |
|
} else { |
| 790 |
|
sprintf(o,"%s %f",o,arr->At(jj)); |
| 791 |
|
}; |
| 792 |
|
jj++; |
| 793 |
|
}; |
| 794 |
|
if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); |
| 795 |
|
j++; |
| 796 |
|
}; |
| 797 |
|
}; |
| 798 |
|
}; |
| 799 |
|
sprintf(o,"%s\n",o); |
| 800 |
|
break; |
| 801 |
|
}; |
| 802 |
|
}; |
| 803 |
|
}; |
| 804 |
|
}; |
| 805 |
|
break; |
| 806 |
|
}; |
| 807 |
|
}; |
| 808 |
|
// pamgui->DIALOG(0,o); |
| 809 |
|
printf("%s\n",o); |
| 810 |
|
}; |
| 811 |
|
|
| 812 |
|
|
| 813 |
void FEVdetector::GetGeneralInfo(){ |
void FEVdetector::GetGeneralInfo(){ |
| 814 |
// |
// |
| 815 |
// Get Orbital Time information and header event number |
// Get Orbital Time information and header event number |
| 819 |
headcold = headc; |
headcold = headc; |
| 820 |
headc = ph->Counter; |
headc = ph->Counter; |
| 821 |
var.headc = (int)ph->Counter; |
var.headc = (int)ph->Counter; |
| 822 |
OBT = ph->OrbitalTime; |
OBT = (UInt_t)ph->OrbitalTime; |
| 823 |
DOBT = OBT - OOBT; |
DOBT = OBT - OOBT; |
| 824 |
OOBT = OBT; |
OOBT = OBT; |
| 825 |
if ( thisentry == minevent || DOBT < 0 || (headc-headcold-1)!=0 ) DOBT = 0; |
if ( thisentry == minevent || DOBT < 0 || (headc-headcold-1)!=0 ) DOBT = 0; |
| 855 |
trcs = (TString)trc.str().c_str(); |
trcs = (TString)trc.str().c_str(); |
| 856 |
} else { |
} else { |
| 857 |
headcold = headc; |
headcold = headc; |
| 858 |
headc = L2->GetOrbitalInfo()->pkt_num; // to be changed as soon as we will have obt in the level2 file! |
if ( var.ORB ){ |
| 859 |
OBT = L2->GetOrbitalInfo()->OBT; // to be changed as soon as we will have obt in the level2 file! |
headc = L2->GetOrbitalInfo()->pkt_num; |
| 860 |
DOBT = OBT - OOBT; |
OBT = L2->GetOrbitalInfo()->OBT; |
| 861 |
OOBT = OBT; |
DOBT = OBT - OOBT; |
| 862 |
if ( thisentry == minevent || DOBT < 0 || (headc-headcold-1)!=0 ) DOBT = 0; |
OOBT = OBT; |
| 863 |
var.etime = OBT; |
if ( thisentry == minevent || DOBT < 0 || (headc-headcold-1)!=0 ) DOBT = 0; |
| 864 |
|
var.etime = OBT; |
| 865 |
|
} else { |
| 866 |
|
var.etime = 0; |
| 867 |
|
}; |
| 868 |
// |
// |
| 869 |
// who gave the trigger? |
// who gave the trigger? |
| 870 |
// |
// |
| 871 |
calotrig = 0; |
Int_t trigconf = 0; |
| 872 |
if ( L2->GetTrigLevel2()->patterntrig[0] ) calotrig = 1; |
if ( var.TRG ){ |
| 873 |
toftrig = 0; |
calotrig = 0; |
| 874 |
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; |
| 875 |
s4pulser = 0; |
toftrig = 0; |
| 876 |
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; |
| 877 |
// |
s4pulser = 0; |
| 878 |
// TOF and calorimeter when giving a trigger will always set this flag since the time window of the signal is greater than 100 ns. |
if ( L2->GetTrigLevel2()->patterntrig[1] & (1<<0) ) s4pulser = 1; |
| 879 |
// S4 sometimes could not set the flag even if the trigger is given. This is a workaround to fix this "bug": |
// |
| 880 |
// |
// TOF and calorimeter when giving a trigger will always set this flag since the time window of the signal is greater than 100 ns. |
| 881 |
if ( !calotrig && !toftrig ) s4pulser = 1; |
// S4 sometimes could not set the flag even if the trigger is given. This is a workaround to fix this "bug": |
| 882 |
// |
// |
| 883 |
Int_t trigconf = L2->GetTrigLevel2()->trigconf; |
if ( !calotrig && !toftrig ) s4pulser = 1; |
| 884 |
|
// |
| 885 |
|
trigconf = L2->GetTrigLevel2()->trigconf; |
| 886 |
|
} else { |
| 887 |
|
trigconf = 0; |
| 888 |
|
} |
| 889 |
stringstream trc; |
stringstream trc; |
| 890 |
trc.str(""); |
trc.str(""); |
| 891 |
if ( trigconf & (1<<0) ) trc << "TOF1"; |
if ( trigconf & (1<<0) ) trc << "TOF1"; |
| 994 |
// |
// |
| 995 |
if ( level.file == -1 ) isOK = gApplication->ProcessLine("filter((TTree *)otr,-1,(Variables &)var);"); |
if ( level.file == -1 ) isOK = gApplication->ProcessLine("filter((TTree *)otr,-1,(Variables &)var);"); |
| 996 |
// |
// |
| 997 |
if ( level.file == 2 ) isOK = gApplication->ProcessLine("filter((PamLevel2 *)L2,2);"); |
// if ( level.file == 2 ) isOK = gApplication->ProcessLine("filter((PamLevel2 *)L2,2);"); |
| 998 |
|
if ( level.file == 2 ) isOK = gApplication->ProcessLine("filter();"); |
| 999 |
// |
// |
| 1000 |
// progress bar in text window |
// progress bar in text window |
| 1001 |
// |
// |
| 1008 |
// |
// |
| 1009 |
} |
} |
| 1010 |
|
|
| 1011 |
void FEVdetector::Load(TTree &mainotr, TFile &mainfile){ |
TChain* FEVdetector::Load(TFile &mainfile){ |
| 1012 |
|
// |
| 1013 |
file = &mainfile; |
file = &mainfile; |
| 1014 |
otr = &mainotr; |
// |
| 1015 |
L2 = new PamLevel2(); |
if ( !L2 ) L2 = new PamLevel2(); |
| 1016 |
// |
// |
| 1017 |
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(); |
|
| 1018 |
// |
// |
| 1019 |
stringstream magfie; |
printf(" %s \n",ddec.Data()); |
| 1020 |
magfie.str(""); |
otr = L2->GetPamTree(gSystem->DirName(file->GetName()),file->GetName(),ddec.Data()); |
| 1021 |
// magfie << "/localdisk/mocchiut/test/calib/trk-param/field_param-0/"; |
runtree = L2->GetRunTree(gSystem->DirName(file->GetName()),file->GetName()); |
| 1022 |
magfie << pam_calib; |
// |
| 1023 |
magfie << "/trk-param/field_param-0/"; |
if ( !otr ) return(0); |
| 1024 |
|
// |
| 1025 |
|
otr->CanDeleteRefs(true); |
| 1026 |
|
if ( runtree ) runtree->CanDeleteRefs(true); |
| 1027 |
// |
// |
|
L2->GetTrkLevel2()->LoadField(magfie.str().c_str()); |
|
| 1028 |
} else { |
} else { |
| 1029 |
// |
// |
| 1030 |
// load calorimeter ADC2MIP conversion file |
// load calorimeter ADC2MIP conversion file |
| 1064 |
// |
// |
| 1065 |
}; |
}; |
| 1066 |
// |
// |
|
|
|
| 1067 |
// |
// |
| 1068 |
trigger = new pamela::trigger::TriggerEvent(); |
// Load level0 file if the case |
|
eh = new pamela::EventHeader(); |
|
|
ph = new pamela::PscuHeader(); |
|
|
// oinfoL2 = new OrbitalInfo(); |
|
|
runinfo = new ItoRunInfo(file); |
|
|
// |
|
|
de = new pamela::calorimeter::CalorimeterEvent(); |
|
|
trk = new pamela::tracker::TrackerEvent(); |
|
|
ne = new pamela::neutron::NeutronEvent(); |
|
|
ace = new pamela::anticounter::AnticounterEvent(); |
|
|
s4 = new pamela::S4::S4Event(); |
|
|
tof = new pamela::tof::TofEvent(); |
|
| 1069 |
// |
// |
| 1070 |
if ( level.file == 0 || level.file == -1 ){ |
if ( level.file == 0 || level.file == -1 ){ |
| 1071 |
|
// |
| 1072 |
|
trigger = new pamela::trigger::TriggerEvent(); |
| 1073 |
|
eh = new pamela::EventHeader(); |
| 1074 |
|
ph = new pamela::PscuHeader(); |
| 1075 |
|
de = new pamela::calorimeter::CalorimeterEvent(); |
| 1076 |
|
trk = new pamela::tracker::TrackerEvent(); |
| 1077 |
|
ne = new pamela::neutron::NeutronEvent(); |
| 1078 |
|
ace = new pamela::anticounter::AnticounterEvent(); |
| 1079 |
|
s4 = new pamela::S4::S4Event(); |
| 1080 |
|
tof = new pamela::tof::TofEvent(); |
| 1081 |
|
// |
| 1082 |
|
otr = new TChain("Physics"); |
| 1083 |
|
otr->Add(file->GetName(),-1); |
| 1084 |
otr->SetBranchAddress("Trigger", &trigger); |
otr->SetBranchAddress("Trigger", &trigger); |
| 1085 |
otr->SetBranchAddress("Header", &eh); |
otr->SetBranchAddress("Header", &eh); |
| 1086 |
}; |
}; |
|
if ( level.file == 2 ){ |
|
|
// otr->AddFriend("OrbitalInfo", file); |
|
|
// otr->SetBranchAddress("OrbitalInfo", &oinfoL2); |
|
|
runinfo->Read(0ULL); |
|
|
}; |
|
| 1087 |
// |
// |
| 1088 |
if ( var.TRK ) { |
if ( var.TRK ) { |
| 1089 |
if ( level.file == 0 || level.file == -1 ){ |
if ( level.file == 0 || level.file == -1 ){ |
| 1155 |
printf("Show the Time of Flight detector, LEVEL2 data \n"); |
printf("Show the Time of Flight detector, LEVEL2 data \n"); |
| 1156 |
}; |
}; |
| 1157 |
}; |
}; |
| 1158 |
|
// |
| 1159 |
|
if ( !otr ){ |
| 1160 |
|
return(0); |
| 1161 |
|
}; |
| 1162 |
|
// |
| 1163 |
|
return otr; |
| 1164 |
// |
// |
| 1165 |
} |
} |
| 1166 |
|
|
| 1236 |
text->DrawLatex(0.33,txthi,testo.str().c_str()); |
text->DrawLatex(0.33,txthi,testo.str().c_str()); |
| 1237 |
txthi -= 0.03; |
txthi -= 0.03; |
| 1238 |
testo2.str(""); |
testo2.str(""); |
| 1239 |
testo2 << "On Board Time: " << (int)OBT; |
testo2 << "On Board Time: " << (unsigned int)OBT; |
| 1240 |
if ( DOBT > 0 ) { |
if ( DOBT > 0 ) { |
| 1241 |
testo2 << " (delta: " << (int)DOBT; |
testo2 << " (delta: " << (unsigned int)DOBT; |
| 1242 |
testo2 << ")"; |
testo2 << ")"; |
| 1243 |
}; |
}; |
| 1244 |
testo2 << " [ms]"; |
testo2 << " [ms]"; |
| 1856 |
void FEVdetector::ShowTOF(){ |
void FEVdetector::ShowTOF(){ |
| 1857 |
// |
// |
| 1858 |
// |
// |
|
// |
|
| 1859 |
if ( !var.TOF ) return; |
if ( !var.TOF ) return; |
| 1860 |
// |
// |
| 1861 |
Int_t tt = 0; |
Int_t tt = 0; |
| 2656 |
// |
// |
| 2657 |
Bool_t repeat = true; |
Bool_t repeat = true; |
| 2658 |
Int_t numtr = 1; |
Int_t numtr = 1; |
| 2659 |
|
// Int_t numtr = 0; |
| 2660 |
Int_t repuntil = 0; |
Int_t repuntil = 0; |
| 2661 |
// |
// |
| 2662 |
// |
// |
| 2664 |
// |
// |
| 2665 |
if ( level.file == 2 ) repuntil = L2->GetToFLevel2()->ntrk(); |
if ( level.file == 2 ) repuntil = L2->GetToFLevel2()->ntrk(); |
| 2666 |
// printf("repuntil = %i \n",repuntil); |
// printf("repuntil = %i \n",repuntil); |
| 2667 |
|
//if ( level.file == 2 ) repuntil = L2->GetTrkLevel2()->GetNTracks(); |
| 2668 |
//repuntil = L2->GetNTracks(); |
//repuntil = L2->GetNTracks(); |
| 2669 |
// |
// |
| 2670 |
while ( repeat ){ |
while ( repeat ){ |
| 2674 |
// |
// |
| 2675 |
// |
// |
| 2676 |
ToFTrkVar *ptt = 0; |
ToFTrkVar *ptt = 0; |
| 2677 |
|
// PamTrack *ptrack = 0; |
| 2678 |
|
Float_t adc[4][12]; |
| 2679 |
|
Float_t tdc[4][12]; |
| 2680 |
|
memset(adc,0,4*12*sizeof(Float_t)); |
| 2681 |
|
memset(tdc,0,4*12*sizeof(Float_t)); |
| 2682 |
// |
// |
| 2683 |
// |
// |
| 2684 |
|
// if ( repuntil == 0 || var.tofraw ){ |
| 2685 |
if ( repuntil == 1 || var.tofraw ){ |
if ( repuntil == 1 || var.tofraw ){ |
| 2686 |
numtr = 0; |
numtr = 0; |
| 2687 |
ptt = L2->GetToFLevel2()->GetToFTrkVar(0); |
ptt = L2->GetToFLevel2()->GetToFTrkVar(0); |
| 2691 |
// |
// |
| 2692 |
if ( numtr >= repuntil-1 ) repeat = false; |
if ( numtr >= repuntil-1 ) repeat = false; |
| 2693 |
// |
// |
| 2694 |
ptt = L2->GetToFLevel2()->GetToFTrkVar(numtr); |
// printf(" numtr is %i \n",numtr); |
| 2695 |
|
ptt = L2->GetToFLevel2()->GetToFTrkVar(numtr); |
| 2696 |
|
//ptrack = L2->GetTrack(numtr); |
| 2697 |
|
//ptt = ptrack->GetToFTrack(); |
| 2698 |
}; |
}; |
| 2699 |
// |
// |
| 2700 |
xp11[0] = 0.; |
xp11[0] = 0.; |
| 2708 |
// |
// |
| 2709 |
ii = 2; |
ii = 2; |
| 2710 |
// |
// |
| 2711 |
Float_t adc[4][12]; |
Int_t myseq = ptt->trkseqno + 1; |
| 2712 |
Float_t tdc[4][12]; |
L2->GetToFLevel2()->GetMatrix(myseq,adc,tdc); |
| 2713 |
L2->GetToFLevel2()->GetMatrix(numtr,adc,tdc); |
// |
| 2714 |
|
// printf(" qua \n"); |
| 2715 |
// |
// |
| 2716 |
for ( Int_t i = 0; i<8; i++ ) { |
for ( Int_t i = 0; i<8; i++ ) { |
| 2717 |
if ( adc[ch11a[i]][hb11a[i]] < 1000. ){ |
if ( adc[ch11a[i]][hb11a[i]] < 1000. ){ |
| 4231 |
pcasp4b->Draw("f"); |
pcasp4b->Draw("f"); |
| 4232 |
pcasp4b->Draw(); |
pcasp4b->Draw(); |
| 4233 |
}; |
}; |
| 4234 |
Float_t alfa = 1.2020334; |
// Float_t alfax = 1.2020334; |
| 4235 |
|
Float_t alfax = 1.22157778; |
| 4236 |
|
Float_t alfay = 1.27393111; |
| 4237 |
Float_t lcrd = 0.1815/2.; |
Float_t lcrd = 0.1815/2.; |
| 4238 |
Float_t wcrd = 0.008; |
Float_t wcrd = 0.008; |
| 4239 |
if ( true ){ |
if ( true ){ |
| 4444 |
// |
// |
| 4445 |
// Float_t cardcx = 0.143168*var.sfx; |
// Float_t cardcx = 0.143168*var.sfx; |
| 4446 |
//Float_t cardcy = 0.1475*var.sfy; |
//Float_t cardcy = 0.1475*var.sfy; |
| 4447 |
Float_t cardcx = 0.153168*var.sfx; |
// |
| 4448 |
Float_t cardcy = 0.1575*var.sfy; |
// Float_t cardcx = 0.153168*var.sfx; |
| 4449 |
Float_t acrdx[4] = {-lcrd*cos(alfa), lcrd*cos(alfa), -lcrd*cos(alfa)+wcrd*sin(alfa), -lcrd*cos(alfa)}; |
// |
| 4450 |
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; |
| 4451 |
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; |
| 4452 |
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; |
| 4453 |
|
Float_t acrdx[4] = {-lcrd*cos(alfax), lcrd*cos(alfax), -lcrd*cos(alfax)+wcrd*sin(alfax), -lcrd*cos(alfax)}; |
| 4454 |
|
Float_t acrdy[4] = {-lcrd*sin(alfax), lcrd*sin(alfax), -lcrd*sin(alfax)-wcrd*cos(alfax), -lcrd*sin(alfax)}; |
| 4455 |
|
Float_t bcrdx[4] = { lcrd*cos(alfax), lcrd*cos(alfax)+wcrd*sin(alfax), -lcrd*cos(alfax)+wcrd*sin(alfax), lcrd*cos(alfax)}; |
| 4456 |
|
Float_t bcrdy[4] = { lcrd*sin(alfax), lcrd*sin(alfax)-wcrd*cos(alfax), -lcrd*sin(alfax)-wcrd*cos(alfax), lcrd*sin(alfax)}; |
| 4457 |
|
|
| 4458 |
// |
// |
| 4459 |
// CARD3 X/ Y |
// CARD3 X/ Y |
| 4513 |
}; |
}; |
| 4514 |
|
|
| 4515 |
if ( true ){ |
if ( true ){ |
| 4516 |
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)}; |
| 4517 |
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)}; |
| 4518 |
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)}; |
| 4519 |
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)}; |
| 4520 |
// |
// |
| 4521 |
// CARD - Y-view |
// CARD - Y-view |
| 4522 |
// |
// |
| 4523 |
Float_t cardcx = 0.12*var.sfx; |
// Float_t cardcx = 0.12*var.sfx; |
| 4524 |
Float_t cardcy = 0.1475*var.sfy; |
Float_t cardcx = (0.16014*(1.-lcrd*cos(alfay)))*var.sfx; |
| 4525 |
|
// Float_t cardcy = 0.178818*var.sfy; |
| 4526 |
|
Float_t cardcy = (0.178818*(1.-lcrd*sin(alfay)))*var.sfy; |
| 4527 |
|
// Float_t cardcy = 0.1475*var.sfy; |
| 4528 |
// |
// |
| 4529 |
// CARD4 X Y/ |
// CARD4 X Y/ |
| 4530 |
// |
// |
| 5090 |
// |
// |
| 5091 |
if ( L2->GetTrkLevel2()->GetNTracks() > 0 ){ |
if ( L2->GetTrkLevel2()->GetNTracks() > 0 ){ |
| 5092 |
for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ |
for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ |
| 5093 |
TrkTrack *track = L2->GetTrkLevel2()->GetTrack(nt); |
PamTrack *ptrack= L2->GetTrack(nt); |
| 5094 |
|
TrkTrack *track = ptrack->GetTrkTrack(); |
| 5095 |
if ( nt == 0 ){ |
if ( nt == 0 ){ |
| 5096 |
var.rig = 0.; |
var.rig = 0.; |
| 5097 |
if ( track->al[4] != 0. ) var.rig = 1./track->al[4]; |
if ( track->al[4] != 0. ) var.rig = 1./track->al[4]; |
| 5188 |
// first of all plot crosses relatives to tracks |
// first of all plot crosses relatives to tracks |
| 5189 |
// |
// |
| 5190 |
if ( L2->GetTrkLevel2()->GetNTracks() > 0 ){ |
if ( L2->GetTrkLevel2()->GetNTracks() > 0 ){ |
| 5191 |
|
// for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ |
| 5192 |
|
// TrkTrack *track = L2->GetTrkLevel2()->GetTrack(nt); |
| 5193 |
for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ |
for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ |
| 5194 |
TrkTrack *track = L2->GetTrkLevel2()->GetTrack(nt); |
PamTrack *ptrack= L2->GetTrack(nt); |
| 5195 |
|
TrkTrack *track = ptrack->GetTrkTrack(); |
| 5196 |
|
// |
| 5197 |
for (Int_t plane = 0; plane<6; plane++){ |
for (Int_t plane = 0; plane<6; plane++){ |
| 5198 |
// |
// |
| 5199 |
x = track->xm[plane]; |
x = track->xm[plane]; |
| 5509 |
// |
// |
| 5510 |
// |
// |
| 5511 |
// |
// |
| 5512 |
if ( var.CALO && false ){ |
if ( var.CALO && var.CALOT ){ |
| 5513 |
if ( L2->GetCaloLevel2()->npcfit[0] > 0 && L2->GetCaloLevel2()->npcfit[1] > 0 ){ |
if ( L2->GetCaloLevel2()->npcfit[0] > 0 && L2->GetCaloLevel2()->npcfit[1] > 0 ){ |
| 5514 |
Float_t calx[22]; |
Float_t calx[22]; |
| 5515 |
Float_t caly[22]; |
Float_t caly[22]; |
| 5608 |
// |
// |
| 5609 |
if ( L2->GetTrkLevel2()->GetNTracks() > 0 ){ |
if ( L2->GetTrkLevel2()->GetNTracks() > 0 ){ |
| 5610 |
for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ |
for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ |
| 5611 |
TrkTrack *track = L2->GetTrkLevel2()->GetTrack(nt); |
|
| 5612 |
|
// TrkTrack *track = L2->GetTrkLevel2()->GetTrack(nt); |
| 5613 |
|
PamTrack *ptrack = L2->GetTrack(nt); |
| 5614 |
|
TrkTrack *track = ptrack->GetTrkTrack(); |
| 5615 |
Int_t npoint = 100; |
Int_t npoint = 100; |
| 5616 |
Float_t zin[100]; |
Float_t zin[100]; |
| 5617 |
Double_t xout[100]; |
Double_t xout[100]; |
| 5935 |
// |
// |
| 5936 |
// Define variables |
// Define variables |
| 5937 |
// |
// |
| 5938 |
Int_t etime = var.etime; |
UInt_t etime = var.etime; |
| 5939 |
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]; |
| 5940 |
Int_t badstrip = 0; |
Int_t badstrip = 0; |
| 5941 |
qtot = 0.; |
qtot = 0.; |
| 6007 |
if ( calib.ttime[s][b[s]+1] && calib.time[s][b[s]] ){ |
if ( calib.ttime[s][b[s]+1] && calib.time[s][b[s]] ){ |
| 6008 |
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 ){ |
| 6009 |
printf(" CALORIMETER: \n" ); |
printf(" CALORIMETER: \n" ); |
| 6010 |
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]); |
| 6011 |
printf(" END CALORIMETER. \n\n" ); |
printf(" END CALORIMETER. \n\n" ); |
| 6012 |
b[s]++; |
b[s]++; |
| 6013 |
CaloPede(s); |
CaloPede(s); |
| 6312 |
for (Int_t d = 0; d<48; d++){ |
for (Int_t d = 0; d<48; d++){ |
| 6313 |
if ( calib.ttime[s][d] != 0 ) calibex++; |
if ( calib.ttime[s][d] != 0 ) calibex++; |
| 6314 |
if ( calib.time[s][0] != 0 ){ |
if ( calib.time[s][0] != 0 ){ |
| 6315 |
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]); |
| 6316 |
if ( calib.time[s][d+1] != 0 ) { |
if ( calib.time[s][d+1] != 0 ) { |
| 6317 |
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]); |
| 6318 |
} else { |
} else { |
| 6319 |
if ( !stop ){ |
if ( !stop ){ |
| 6320 |
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]); |
| 6321 |
stop = 1; |
stop = 1; |
| 6322 |
}; |
}; |
| 6323 |
}; |
}; |
| 6324 |
} else { |
} else { |
| 6325 |
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]); |
| 6326 |
}; |
}; |
| 6327 |
}; |
}; |
| 6328 |
printf("\n"); |
printf("\n"); |
| 6387 |
calib.ttime[s][inter] = 0; |
calib.ttime[s][inter] = 0; |
| 6388 |
if ( ce->cstwerr[s] != 0 && ce->cperror[s] == 0 ) { |
if ( ce->cstwerr[s] != 0 && ce->cperror[s] == 0 ) { |
| 6389 |
//calib.ttime[s][inter] = cph->GetOrbitalTime(); |
//calib.ttime[s][inter] = cph->GetOrbitalTime(); |
| 6390 |
calib.ttime[s][inter] = cph->OrbitalTime; |
calib.ttime[s][inter] = (UInt_t)cph->OrbitalTime; |
| 6391 |
inter++; |
inter++; |
| 6392 |
} else { |
} else { |
| 6393 |
if ( ce->cstwerr[s] != 0 && ce->cperror[s] != 0 ) { |
if ( ce->cstwerr[s] != 0 && ce->cperror[s] != 0 ) { |
| 6441 |
tr->GetEntry(ci); |
tr->GetEntry(ci); |
| 6442 |
cph = ceh->GetPscuHeader(); |
cph = ceh->GetPscuHeader(); |
| 6443 |
//if ( atime == cph->GetOrbitalTime()){ |
//if ( atime == cph->GetOrbitalTime()){ |
| 6444 |
if ( atime == cph->OrbitalTime){ |
if ( atime == (UInt_t)cph->OrbitalTime){ |
| 6445 |
// calib.iev = ce->iev; |
// calib.iev = ce->iev; |
| 6446 |
if (ce->cstwerr[s] != 0 && ce->cperror[s] == 0 ) { |
if (ce->cstwerr[s] != 0 && ce->cperror[s] == 0 ) { |
| 6447 |
for ( Int_t d=0 ; d<11 ;d++ ){ |
for ( Int_t d=0 ; d<11 ;d++ ){ |