| 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 |
// |
// |
| 83 |
thefigure = &figure; |
thefigure = &figure; |
| 84 |
checkctrlword(); |
checkctrlword(); |
| 85 |
var.selex = false; |
var.selex = false; |
| 86 |
|
var.showall = false; |
| 87 |
|
|
| 88 |
|
var.showsi = false; |
| 89 |
|
var.shownd = false; |
| 90 |
|
var.shows4 = false; |
| 91 |
|
var.showorb = false; |
| 92 |
|
var.showtof = false; |
| 93 |
|
var.showtrg = false; |
| 94 |
|
var.showtrk = false; |
| 95 |
|
var.showcal = false; |
| 96 |
|
var.showrun = false; |
| 97 |
|
var.showac = false; |
| 98 |
|
} |
| 99 |
|
|
| 100 |
|
void FEVdetector::Reset(){ |
| 101 |
|
L2 = NULL; |
| 102 |
} |
} |
| 103 |
|
|
| 104 |
void FEVdetector::checkctrlword(){ |
void FEVdetector::checkctrlword(){ |
| 105 |
var.SHOWDEC = 0; |
var.SHOWDEC = 0; |
| 106 |
var.TOF = 0; |
var.TOF = 0; |
| 107 |
var.AC = 0; |
var.AC = 0; |
| 108 |
|
var.RUN = 1; |
| 109 |
var.TRK = 0; |
var.TRK = 0; |
| 110 |
|
var.ORB = 1; |
| 111 |
|
var.TRG = 1; |
| 112 |
var.CALO = 0; |
var.CALO = 0; |
| 113 |
|
var.CALOT = 0; |
| 114 |
var.S4 = 0; |
var.S4 = 0; |
| 115 |
var.ND = 0; |
var.ND = 0; |
| 116 |
var.INFOS = 0; |
var.INFOS = 0; |
| 145 |
}; |
}; |
| 146 |
} |
} |
| 147 |
|
|
| 148 |
|
void FEVdetector::SetDDEC(TString de){ |
| 149 |
|
ddec=de; |
| 150 |
|
}; |
| 151 |
|
|
| 152 |
void FEVdetector::GetWindow(){ |
void FEVdetector::GetWindow(){ |
| 153 |
otr->GetEntry(maxevent); |
// |
| 154 |
|
if ( level.file == 2 ){ |
| 155 |
|
// printf("0qui\n"); |
| 156 |
|
L2->GetEntry(minevent); |
| 157 |
|
} else { |
| 158 |
|
otr->GetEntry(minevent); |
| 159 |
|
} |
| 160 |
if ( level.file < 2 ){ |
if ( level.file < 2 ){ |
| 161 |
ph = eh->GetPscuHeader(); |
ph = eh->GetPscuHeader(); |
| 162 |
lastevno = (int)ph->Counter; |
firstevno = (int)ph->Counter; |
| 163 |
} else { |
} else { |
| 164 |
lastevno = oinfoL2->pkt_num; // to be changed as soon as we will have pkt_counter in the level2 file! |
if ( var.ORB ){ |
| 165 |
|
firstevno = L2->GetOrbitalInfo()->pkt_num; |
| 166 |
|
} else { |
| 167 |
|
firstevno = 0; |
| 168 |
|
}; |
| 169 |
}; |
}; |
| 170 |
otr->GetEntry(minevent); |
// |
| 171 |
|
if ( level.file == 2 ){ |
| 172 |
|
// printf("1qui\n"); |
| 173 |
|
L2->GetEntry(maxevent); |
| 174 |
|
} else { |
| 175 |
|
otr->GetEntry(maxevent); |
| 176 |
|
} |
| 177 |
|
// |
| 178 |
if ( level.file < 2 ){ |
if ( level.file < 2 ){ |
| 179 |
ph = eh->GetPscuHeader(); |
ph = eh->GetPscuHeader(); |
| 180 |
firstevno = (int)ph->Counter; |
lastevno = (int)ph->Counter; |
| 181 |
} else { |
} else { |
| 182 |
firstevno = oinfoL2->pkt_num; // to be changed as soon as we will have pkt_counter in the level2 file! |
if ( var.ORB ){ |
| 183 |
|
lastevno = L2->GetOrbitalInfo()->pkt_num; |
| 184 |
|
} else { |
| 185 |
|
lastevno = 0; |
| 186 |
|
}; |
| 187 |
}; |
}; |
| 188 |
|
// |
| 189 |
} |
} |
| 190 |
|
|
| 191 |
void FEVdetector::ClearVariables(){ |
void FEVdetector::ClearVariables(){ |
| 208 |
} |
} |
| 209 |
|
|
| 210 |
void FEVdetector::GetEntry(Int_t i){ |
void FEVdetector::GetEntry(Int_t i){ |
| 211 |
thisentry = i; |
thisentry = i; |
| 212 |
otr->GetEntry(i); |
if ( level.file == 2 ){ |
| 213 |
|
// L2->Clear(); |
| 214 |
|
// printf("qui\n"); |
| 215 |
|
L2->GetEntry(i); |
| 216 |
|
if ( var.showall ){ |
| 217 |
|
ShowInfo("RunInfo"); |
| 218 |
|
ShowInfo("SoftInfo"); |
| 219 |
|
ShowInfo("OrbitalInfo"); |
| 220 |
|
ShowInfo("TrigLevel2"); |
| 221 |
|
ShowInfo("ToFLevel2"); |
| 222 |
|
ShowInfo("TrkLevel2"); |
| 223 |
|
ShowInfo("AcLevel2"); |
| 224 |
|
ShowInfo("CaloLevel2"); |
| 225 |
|
ShowInfo("CaloLevel1"); |
| 226 |
|
ShowInfo("S4Level2"); |
| 227 |
|
ShowInfo("NDLevel2"); |
| 228 |
|
} else { |
| 229 |
|
if ( var.showrun ) ShowInfo("RunInfo"); |
| 230 |
|
if ( var.showsi ) ShowInfo("SoftInfo"); |
| 231 |
|
if ( var.showorb ) ShowInfo("OrbitalInfo"); |
| 232 |
|
if ( var.showtrg ) ShowInfo("TrigLevel2"); |
| 233 |
|
if ( var.showtof ) ShowInfo("ToFLevel2"); |
| 234 |
|
if ( var.showtrk ) ShowInfo("TrkLevel2"); |
| 235 |
|
if ( var.showac ) ShowInfo("AcLevel2"); |
| 236 |
|
if ( var.showcal ) ShowInfo("CaloLevel2"); |
| 237 |
|
if ( var.showcal ) ShowInfo("CaloLevel1"); |
| 238 |
|
if ( var.shows4 ) ShowInfo("S4Level2"); |
| 239 |
|
if ( var.shownd ) ShowInfo("NDLevel2"); |
| 240 |
|
}; |
| 241 |
|
} else { |
| 242 |
|
otr->GetEntry(i); |
| 243 |
|
if ( var.showall ){ |
| 244 |
|
ShowInfo("Pscu"); |
| 245 |
|
ShowInfo("Trigger"); |
| 246 |
|
ShowInfo("Tof"); |
| 247 |
|
ShowInfo("Tracker"); |
| 248 |
|
ShowInfo("Anticounter"); |
| 249 |
|
ShowInfo("Calorimeter"); |
| 250 |
|
ShowInfo("S4"); |
| 251 |
|
ShowInfo("Neutron"); |
| 252 |
|
} else { |
| 253 |
|
if ( var.showorb ) ShowInfo("Pscu"); |
| 254 |
|
if ( var.showtrg ) ShowInfo("Trigger"); |
| 255 |
|
if ( var.showtof ) ShowInfo("Tof"); |
| 256 |
|
if ( var.showtrk ) ShowInfo("Tracker"); |
| 257 |
|
if ( var.showac ) ShowInfo("Anticounter"); |
| 258 |
|
if ( var.showcal ) ShowInfo("Calorimeter"); |
| 259 |
|
if ( var.shows4 ) ShowInfo("S4"); |
| 260 |
|
if ( var.shownd ) ShowInfo("Neutron"); |
| 261 |
|
}; |
| 262 |
|
}; |
| 263 |
} |
} |
| 264 |
|
|
| 265 |
void FEVdetector::SetEntry(Int_t i){ |
void FEVdetector::SetEntry(Int_t i){ |
| 272 |
return((int)ph->Counter); |
return((int)ph->Counter); |
| 273 |
} else { |
} else { |
| 274 |
// 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! |
| 275 |
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! |
| 276 |
}; |
}; |
| 277 |
} |
} |
| 278 |
|
|
| 380 |
}; |
}; |
| 381 |
} |
} |
| 382 |
|
|
| 383 |
|
void FEVdetector::ShowInfo(TString detector){ |
| 384 |
|
// |
| 385 |
|
TBranch *b1 = 0; |
| 386 |
|
// TBranch *b3 = 0; |
| 387 |
|
TObjArray *branch_array = 0; |
| 388 |
|
// TObjArray *leaf_array = 0; |
| 389 |
|
// |
| 390 |
|
if ( !strcmp(detector.Data(),"RunInfo") || !strcmp(detector.Data(),"SoftInfo") ){ |
| 391 |
|
if ( L2->GetRunTree() ) b1 = L2->GetRunTree()->FindBranch(detector.Data()); |
| 392 |
|
} else { |
| 393 |
|
b1 = otr->FindBranch(detector.Data()); |
| 394 |
|
}; |
| 395 |
|
// |
| 396 |
|
if ( !b1 ) return; |
| 397 |
|
// |
| 398 |
|
Int_t dlen = 10; |
| 399 |
|
// |
| 400 |
|
char o[200000]; |
| 401 |
|
char zz[200000]; |
| 402 |
|
char col[13]; |
| 403 |
|
char col2[13]; |
| 404 |
|
// |
| 405 |
|
setcolor(col,RESET, GREEN, WHITE); |
| 406 |
|
sprintf(o,"%s======> EVENT:%i\n",col, thisentry); |
| 407 |
|
sprintf(zz,"======> EVENT:%i\n", thisentry); |
| 408 |
|
// |
| 409 |
|
setcolor(col,RESET, RED, WHITE); |
| 410 |
|
sprintf(o,"%s%sBranch %s\n",o,col,b1->GetName()); |
| 411 |
|
sprintf(zz,"%sBranch %s\n",zz,b1->GetName()); |
| 412 |
|
setcolor(col,RESET, BLACK, WHITE); |
| 413 |
|
sprintf(o,"%s%s",o,col); |
| 414 |
|
// |
| 415 |
|
branch_array = b1->GetListOfBranches(); |
| 416 |
|
// |
| 417 |
|
Int_t j = 0; |
| 418 |
|
// |
| 419 |
|
for(Int_t l=0;l<(branch_array->GetLast()+1);l++){ |
| 420 |
|
// |
| 421 |
|
TBranchElement *tb = (TBranchElement*)branch_array->At(l); |
| 422 |
|
Int_t type = tb->GetType(); |
| 423 |
|
Int_t atype = tb->GetStreamerType() - 20; |
| 424 |
|
Int_t len = (tb->GetInfo()->GetLengths())[tb->GetID()]; |
| 425 |
|
Int_t length = min(len,dlen); |
| 426 |
|
// |
| 427 |
|
// printf("Branches : type is %i type is %i tb getname %s slen %i slength %i\n",atype,type,tb->GetName(),len,length); |
| 428 |
|
switch (type){ |
| 429 |
|
case 0: |
| 430 |
|
// |
| 431 |
|
// IS A VARIABLE |
| 432 |
|
// |
| 433 |
|
// |
| 434 |
|
// NAME |
| 435 |
|
// |
| 436 |
|
setcolor(col,RESET, BLUE, WHITE); |
| 437 |
|
setcolor(col2,RESET, BLACK, WHITE); |
| 438 |
|
sprintf(o,"%s%s %-15s%s =",o,col,((TBranch*)branch_array->At(l))->GetName(),col2); |
| 439 |
|
sprintf(zz,"%s %-15s =",zz,((TBranch*)branch_array->At(l))->GetName()); |
| 440 |
|
// |
| 441 |
|
j = 0; |
| 442 |
|
// |
| 443 |
|
// VALUES |
| 444 |
|
// |
| 445 |
|
// |
| 446 |
|
// Integer |
| 447 |
|
// |
| 448 |
|
if ( atype == 3 || atype == -17 ){ |
| 449 |
|
while ( j < length ){ |
| 450 |
|
if ( j < length -1 ){ |
| 451 |
|
sprintf(o,"%s %i ,",o,(Int_t)tb->GetValue(j,0)); |
| 452 |
|
sprintf(zz,"%s %i ,",zz,(Int_t)tb->GetValue(j,0)); |
| 453 |
|
} else { |
| 454 |
|
sprintf(o,"%s %i",o,(Int_t)tb->GetValue(j,0)); |
| 455 |
|
sprintf(zz,"%s %i",zz,(Int_t)tb->GetValue(j,0)); |
| 456 |
|
}; |
| 457 |
|
j++; |
| 458 |
|
}; |
| 459 |
|
}; |
| 460 |
|
// |
| 461 |
|
// Unsigned integer |
| 462 |
|
// |
| 463 |
|
if ( atype == -7 || atype == 13 || atype == -9 || atype == -8 || atype == 12 ){ |
| 464 |
|
while ( j < length ){ |
| 465 |
|
if ( j < length -1 ){ |
| 466 |
|
sprintf(o,"%s %u ,",o,(UInt_t)tb->GetValue(j,0)); |
| 467 |
|
sprintf(zz,"%s %u ,",zz,(UInt_t)tb->GetValue(j,0)); |
| 468 |
|
} else { |
| 469 |
|
sprintf(o,"%s %u",o,(UInt_t)tb->GetValue(j,0)); |
| 470 |
|
sprintf(zz,"%s %u",zz,(UInt_t)tb->GetValue(j,0)); |
| 471 |
|
}; |
| 472 |
|
j++; |
| 473 |
|
}; |
| 474 |
|
}; |
| 475 |
|
// |
| 476 |
|
// Float |
| 477 |
|
// |
| 478 |
|
if ( atype == -15 || atype == 5 ){ |
| 479 |
|
while ( j < length ){ |
| 480 |
|
if ( j < length -1 ){ |
| 481 |
|
sprintf(o,"%s %f ,",o,tb->GetValue(j,0)); |
| 482 |
|
sprintf(zz,"%s %f ,",zz,tb->GetValue(j,0)); |
| 483 |
|
} else { |
| 484 |
|
sprintf(o,"%s %f",o,tb->GetValue(j,0)); |
| 485 |
|
sprintf(zz,"%s %f",zz,tb->GetValue(j,0)); |
| 486 |
|
}; |
| 487 |
|
j++; |
| 488 |
|
}; |
| 489 |
|
}; |
| 490 |
|
// |
| 491 |
|
// Strings |
| 492 |
|
// |
| 493 |
|
if ( atype == 45 ){ |
| 494 |
|
// TObjArray *cl = (TObjArray*)(tb->GetInfo()->GetOffsets())[tb->GetID()];//tb->GetValuePointer(); |
| 495 |
|
// TString *stringa = (TString*)(*cl)[0]; |
| 496 |
|
// TBranchElement *utb = (TBranchElement*)tb->GetBranchCount(); |
| 497 |
|
// TString** stringa = (TString*)(&tb->GetValuePointer()); |
| 498 |
|
//TStreamerElement *tste = (TStreamerElement*)tb->GetInfo()->GetCurrentElement(); |
| 499 |
|
|
| 500 |
|
// char *ladd; |
| 501 |
|
// ladd = tb->GetValuePointer() |
| 502 |
|
// TString *stringa = (TString*)((tste->GetOffset())); |
| 503 |
|
// TString& mstr = *stringa; |
| 504 |
|
// printf(" la mia stringa %s \n",mstr.Data()); |
| 505 |
|
// printf(" offset %i \n",(Int_t)utb->GetValue(0,0)); |
| 506 |
|
// int pointer = (tb->GetInfo()->GetOffsets())[tb->GetID()]; |
| 507 |
|
// TString *stringa = (TString*)(tb->GetInfo()->GetOffsets())[tb->GetID()]; |
| 508 |
|
// TString *stringa = (TString*)tb->GetAddress(); |
| 509 |
|
// printf(" address 0x%X \n",tb->GetAddress()); |
| 510 |
|
// printf(" pointer 0x%X \n",tb->GetValuePointer()); |
| 511 |
|
// printf(" object 0x%X \n",tb->GetObject()); |
| 512 |
|
// printf("stringa %s lung %i\n",stringa.Data(),stringa.Length()); |
| 513 |
|
// TLeaf *striglia = tb->FindLeaf(tb->GetName()); |
| 514 |
|
// if ( striglia ){ |
| 515 |
|
// char *pointer = (char *)striglia->GetValuePointer(); |
| 516 |
|
// TString *pr= (TString*)pointer; |
| 517 |
|
// printf("ciao %s \n",pr->Data()); |
| 518 |
|
// }; |
| 519 |
|
sprintf(o,"%s TString - not implemented yet -",o); |
| 520 |
|
sprintf(zz,"%s TString - not implemented yet -",zz); |
| 521 |
|
}; |
| 522 |
|
// |
| 523 |
|
// TArray |
| 524 |
|
// |
| 525 |
|
if ( atype == 42 ){ |
| 526 |
|
// |
| 527 |
|
// TObjArray *cl = (TObjArray*)tb->GetObject(); |
| 528 |
|
// // |
| 529 |
|
// TClass *myc = cl->IsA(); |
| 530 |
|
// // |
| 531 |
|
// printf("qui \n"); |
| 532 |
|
// // |
| 533 |
|
// // determine offset to fetch data |
| 534 |
|
// // |
| 535 |
|
// int thisoffset = 0; |
| 536 |
|
// TRealData *rd = myc->GetRealData(tb->GetName()); |
| 537 |
|
// if ( rd ){ |
| 538 |
|
// thisoffset = rd->GetThisOffset(); |
| 539 |
|
// }; |
| 540 |
|
// Int_t niente = 0; |
| 541 |
|
// TStreamerElement *tste = tb->GetInfo()->GetStreamerElement(rd->GetName(),niente); |
| 542 |
|
// printf(" typename %s \n",tste->GetTypeName()); |
| 543 |
|
// // |
| 544 |
|
// // TArrayI |
| 545 |
|
// // |
| 546 |
|
// if ( !strcmp(tste->GetTypeName(),"TArrayI") ){ |
| 547 |
|
// // |
| 548 |
|
// printf("qua \n"); |
| 549 |
|
// char *pointer = (char*)cl->At(0); |
| 550 |
|
// // char *pu = thisoffset + pointer; |
| 551 |
|
// int pu = (int)tste->GetTObjectOffset(); |
| 552 |
|
// TArrayI arr = (TArrayI)*pu; |
| 553 |
|
// // TArrayI arr = (TArrayI)(thisoffset); |
| 554 |
|
// //TArrayI *arr = (TArrayI*)pu; |
| 555 |
|
// //TArraI arr = (TArrayI) |
| 556 |
|
// Int_t jj=0; |
| 557 |
|
// j=0; |
| 558 |
|
// printf("quii \n"); |
| 559 |
|
// Int_t arlen = min(arr.GetSize(),dlen); |
| 560 |
|
// // |
| 561 |
|
// printf("que \n"); |
| 562 |
|
// setcolor(col,RESET, BLUE, WHITE); |
| 563 |
|
// setcolor(col2,RESET, BLACK, WHITE); |
| 564 |
|
// sprintf(o,"%s%s %s[%i]%s = ",o,col,tb->GetName(),arr.GetSize(),col2); |
| 565 |
|
// // |
| 566 |
|
// // while ( j < tb->GetNdata() ){ |
| 567 |
|
// // |
| 568 |
|
// printf("quo \n"); |
| 569 |
|
// // pointer = (char*)cl->UncheckedAt(j); |
| 570 |
|
// // pu = pointer + thisoffset; |
| 571 |
|
// // arr = (TArrayI*)(thisoffset); |
| 572 |
|
// // |
| 573 |
|
// while ( jj < arlen ){ |
| 574 |
|
// if ( jj < arlen-1 ){ |
| 575 |
|
// sprintf(o,"%s %i ,",o,arr.At(jj)); |
| 576 |
|
// } else { |
| 577 |
|
// sprintf(o,"%s %i",o,arr.At(jj)); |
| 578 |
|
// }; |
| 579 |
|
// jj++; |
| 580 |
|
// }; |
| 581 |
|
// // if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); |
| 582 |
|
// // j++; |
| 583 |
|
// // }; |
| 584 |
|
// }; |
| 585 |
|
// // |
| 586 |
|
// // TArrayF |
| 587 |
|
// // |
| 588 |
|
// if ( !strcmp(tste->GetTypeName(),"TArrayF") ){ |
| 589 |
|
// // |
| 590 |
|
// char *pointer = (char*)cl->UncheckedAt(0); |
| 591 |
|
// char *pu = pointer + thisoffset; |
| 592 |
|
// TArrayF *arr = (TArrayF*)(pu); |
| 593 |
|
// Int_t jj=0; |
| 594 |
|
// Int_t arlen = min(arr->GetSize(),dlen); |
| 595 |
|
// // |
| 596 |
|
// setcolor(col,RESET, BLUE, WHITE); |
| 597 |
|
// setcolor(col2,RESET, BLACK, WHITE); |
| 598 |
|
// sprintf(o,"%s%s %s[%i]%s = ",o,col,tb->GetName(),arr->GetSize(),col2); |
| 599 |
|
// // |
| 600 |
|
// while ( j < tb->GetNdata() ){ |
| 601 |
|
// // |
| 602 |
|
// pointer = (char*)cl->UncheckedAt(j); |
| 603 |
|
// pu = pointer + thisoffset; |
| 604 |
|
// arr = (TArrayF*)(pu); |
| 605 |
|
// // |
| 606 |
|
// while ( jj < arlen ){ |
| 607 |
|
// if ( jj < arlen-1 ){ |
| 608 |
|
// sprintf(o,"%s %f ,",o,arr->At(jj)); |
| 609 |
|
// } else { |
| 610 |
|
// sprintf(o,"%s %f",o,arr->At(jj)); |
| 611 |
|
// }; |
| 612 |
|
// jj++; |
| 613 |
|
// }; |
| 614 |
|
// if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); |
| 615 |
|
// j++; |
| 616 |
|
// }; |
| 617 |
|
// }; |
| 618 |
|
// sprintf(o,"%s\n",o); |
| 619 |
|
// |
| 620 |
|
sprintf(o,"%s TArray - not implemented yet -",o); |
| 621 |
|
sprintf(zz,"%s TArray - not implemented yet -",zz); |
| 622 |
|
// |
| 623 |
|
}; |
| 624 |
|
// |
| 625 |
|
sprintf(o,"%s\n",o); |
| 626 |
|
sprintf(zz,"%s\n",zz); |
| 627 |
|
break; |
| 628 |
|
case 3: |
| 629 |
|
// |
| 630 |
|
// IS A TCLONESARRAY |
| 631 |
|
// |
| 632 |
|
setcolor(col,RESET, BLUE, WHITE); |
| 633 |
|
setcolor(col2,RESET, BLACK, WHITE); |
| 634 |
|
sprintf(o,"%s%s %-15s%s = %d\n",o,col,tb->GetName(), col2, tb->GetNdata()); |
| 635 |
|
sprintf(zz,"%s %-15s = %d\n",zz,tb->GetName(), tb->GetNdata()); |
| 636 |
|
|
| 637 |
|
// |
| 638 |
|
if ( tb->GetNdata() ){ |
| 639 |
|
// |
| 640 |
|
TClonesArray *cl = (TClonesArray*)tb->GetObject(); |
| 641 |
|
// |
| 642 |
|
TClass *myc = cl->GetClass(); |
| 643 |
|
// |
| 644 |
|
TList *lme = myc->GetListOfDataMembers(); |
| 645 |
|
TIter next(lme); |
| 646 |
|
TBranchElement *tb2 = 0; |
| 647 |
|
// |
| 648 |
|
while ( (tb2 = (TBranchElement*)next()) ){ |
| 649 |
|
// |
| 650 |
|
const char *name = tb2->GetName(); |
| 651 |
|
TBranch *foglia = tb->FindBranch(name); |
| 652 |
|
if ( foglia ){ |
| 653 |
|
// |
| 654 |
|
TBranchElement *stb = (TBranchElement*)tb->FindBranch(name); |
| 655 |
|
Int_t stype = stb->GetType(); |
| 656 |
|
Int_t satype = stb->GetStreamerType() - 20; |
| 657 |
|
Int_t slen = (stb->GetInfo()->GetLengths())[stb->GetID()]; |
| 658 |
|
Int_t slength = min(slen,dlen); |
| 659 |
|
// printf("SubBranches : atype is %i type is %i tb getname %s slen %i slength %i\n",satype,stype,stb->GetName(),slen,slength); |
| 660 |
|
switch (stype){ |
| 661 |
|
case 31: |
| 662 |
|
// |
| 663 |
|
// IS A VARIABLE |
| 664 |
|
// |
| 665 |
|
// |
| 666 |
|
// NAME |
| 667 |
|
// |
| 668 |
|
j = 0; |
| 669 |
|
// |
| 670 |
|
// VALUES |
| 671 |
|
// |
| 672 |
|
if ( satype == 41 || satype == 44){ |
| 673 |
|
// |
| 674 |
|
// skip TRef |
| 675 |
|
// |
| 676 |
|
break; |
| 677 |
|
}; |
| 678 |
|
// |
| 679 |
|
// Integer |
| 680 |
|
// |
| 681 |
|
if ( satype == -17 || satype == -9 ){ |
| 682 |
|
// |
| 683 |
|
setcolor(col,RESET, BLUE, WHITE); |
| 684 |
|
setcolor(col2,RESET, BLACK, WHITE); |
| 685 |
|
sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2); |
| 686 |
|
sprintf(zz,"%s %-15s = ",zz,foglia->GetName()); |
| 687 |
|
while ( j < cl->GetEntriesFast() ){ |
| 688 |
|
if ( j < cl->GetEntriesFast() -1 ){ |
| 689 |
|
sprintf(o,"%s %i ,",o,(Int_t)stb->GetValue(j,slength)); |
| 690 |
|
sprintf(zz,"%s %i ,",zz,(Int_t)stb->GetValue(j,slength)); |
| 691 |
|
} else { |
| 692 |
|
sprintf(o,"%s %i",o,(Int_t)stb->GetValue(j,slength)); |
| 693 |
|
sprintf(zz,"%s %i",zz,(Int_t)stb->GetValue(j,slength)); |
| 694 |
|
}; |
| 695 |
|
j++; |
| 696 |
|
}; |
| 697 |
|
}; |
| 698 |
|
// |
| 699 |
|
// Float |
| 700 |
|
// |
| 701 |
|
if ( satype == -15 ){ |
| 702 |
|
// |
| 703 |
|
setcolor(col,RESET, BLUE, WHITE); |
| 704 |
|
setcolor(col2,RESET, BLACK, WHITE); |
| 705 |
|
sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2); |
| 706 |
|
sprintf(zz,"%s %-15s = ",zz,foglia->GetName()); |
| 707 |
|
while ( j < cl->GetEntriesFast() ){ |
| 708 |
|
if ( j < cl->GetEntriesFast() -1 ){ |
| 709 |
|
sprintf(o,"%s %f ,",o,stb->GetValue(j,slength)); |
| 710 |
|
sprintf(zz,"%s %f ,",zz,stb->GetValue(j,slength)); |
| 711 |
|
} else { |
| 712 |
|
sprintf(o,"%s %f",o,stb->GetValue(j,slength)); |
| 713 |
|
sprintf(zz,"%s %f",zz,stb->GetValue(j,slength)); |
| 714 |
|
}; |
| 715 |
|
j++; |
| 716 |
|
}; |
| 717 |
|
}; |
| 718 |
|
// |
| 719 |
|
// Array of float |
| 720 |
|
// |
| 721 |
|
if ( satype == 5 ){ |
| 722 |
|
// |
| 723 |
|
setcolor(col,RESET, BLUE, WHITE); |
| 724 |
|
setcolor(col2,RESET, BLACK, WHITE); |
| 725 |
|
sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2); |
| 726 |
|
sprintf(zz,"%s %-15s = ",zz,foglia->GetName()); |
| 727 |
|
Bool_t bold = true; |
| 728 |
|
while ( j < tb->GetNdata() ){ |
| 729 |
|
if ( bold ){ |
| 730 |
|
setcolor(col,RESET, BLACK, WHITE); |
| 731 |
|
sprintf(o,"%s%s",o,col); |
| 732 |
|
} else { |
| 733 |
|
setcolor(col,BOLD, BLACK, WHITE); |
| 734 |
|
sprintf(o,"%s%s",o,col); |
| 735 |
|
}; |
| 736 |
|
Int_t jj = 0; |
| 737 |
|
while ( jj < slength ){ |
| 738 |
|
if ( jj < slength-1 ){ |
| 739 |
|
sprintf(o,"%s %f ,",o,stb->GetValue(j,jj,true)); |
| 740 |
|
sprintf(zz,"%s %f ,",zz,stb->GetValue(j,jj,true)); |
| 741 |
|
} else { |
| 742 |
|
sprintf(o,"%s %f",o,stb->GetValue(j,jj,true)); |
| 743 |
|
sprintf(zz,"%s %f",zz,stb->GetValue(j,jj,true)); |
| 744 |
|
}; |
| 745 |
|
jj++; |
| 746 |
|
}; |
| 747 |
|
if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); |
| 748 |
|
if ( j < tb->GetNdata() -1 ) sprintf(zz,"%s ,",zz); |
| 749 |
|
if ( !bold ){ |
| 750 |
|
bold = true; |
| 751 |
|
} else { |
| 752 |
|
bold = false; |
| 753 |
|
}; |
| 754 |
|
j++; |
| 755 |
|
}; |
| 756 |
|
if ( bold ){ |
| 757 |
|
setcolor(col,RESET, BLACK, WHITE); |
| 758 |
|
sprintf(o,"%s%s",o,col); |
| 759 |
|
}; |
| 760 |
|
}; |
| 761 |
|
// |
| 762 |
|
// Array of integers |
| 763 |
|
// |
| 764 |
|
if ( satype == 3 ){ |
| 765 |
|
// |
| 766 |
|
setcolor(col,RESET, BLUE, WHITE); |
| 767 |
|
setcolor(col2,RESET, BLACK, WHITE); |
| 768 |
|
sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2); |
| 769 |
|
sprintf(zz,"%s %-15s = ",zz,foglia->GetName()); |
| 770 |
|
while ( j < tb->GetNdata() ){ |
| 771 |
|
Int_t jj = 0; |
| 772 |
|
while ( jj < slength ){ |
| 773 |
|
if ( jj < slength-1 ){ |
| 774 |
|
sprintf(o,"%s %i ,",o,(Int_t)stb->GetValue(j,jj,true)); |
| 775 |
|
sprintf(zz,"%s %i ,",zz,(Int_t)stb->GetValue(j,jj,true)); |
| 776 |
|
} else { |
| 777 |
|
sprintf(o,"%s %i",o,(Int_t)stb->GetValue(j,jj,true)); |
| 778 |
|
sprintf(zz,"%s %i",zz,(Int_t)stb->GetValue(j,jj,true)); |
| 779 |
|
}; |
| 780 |
|
jj++; |
| 781 |
|
}; |
| 782 |
|
if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); |
| 783 |
|
if ( j < tb->GetNdata() -1 ) sprintf(zz,"%s ,",zz); |
| 784 |
|
j++; |
| 785 |
|
}; |
| 786 |
|
}; |
| 787 |
|
|
| 788 |
|
// |
| 789 |
|
// TArray |
| 790 |
|
// |
| 791 |
|
if ( satype == 42 ){ |
| 792 |
|
// |
| 793 |
|
// determine offset to fetch data |
| 794 |
|
// |
| 795 |
|
int thisoffset = 0; |
| 796 |
|
TRealData *rd = myc->GetRealData(foglia->GetName()); |
| 797 |
|
if ( rd ){ |
| 798 |
|
thisoffset = rd->GetThisOffset(); |
| 799 |
|
}; |
| 800 |
|
Int_t niente = 0; |
| 801 |
|
TStreamerElement *tste = stb->GetInfo()->GetStreamerElement(rd->GetName(),niente); |
| 802 |
|
// |
| 803 |
|
// TArrayI |
| 804 |
|
// |
| 805 |
|
if ( !strcmp(tste->GetTypeName(),"TArrayI") ){ |
| 806 |
|
// |
| 807 |
|
char *pointer = (char*)cl->UncheckedAt(0); |
| 808 |
|
char *pu = pointer + thisoffset; |
| 809 |
|
TArrayI *arr = (TArrayI*)(pu); |
| 810 |
|
Int_t jj=0; |
| 811 |
|
Int_t arlen = min(arr->GetSize(),dlen); |
| 812 |
|
// |
| 813 |
|
setcolor(col,RESET, BLUE, WHITE); |
| 814 |
|
setcolor(col2,RESET, BLACK, WHITE); |
| 815 |
|
sprintf(o,"%s%s %s[%i]%s = ",o,col,foglia->GetName(),arr->GetSize(),col2); |
| 816 |
|
sprintf(zz,"%s %s[%i] = ",zz,foglia->GetName(),arr->GetSize()); |
| 817 |
|
// |
| 818 |
|
while ( j < tb->GetNdata() ){ |
| 819 |
|
// |
| 820 |
|
pointer = (char*)cl->UncheckedAt(j); |
| 821 |
|
pu = pointer + thisoffset; |
| 822 |
|
arr = (TArrayI*)(pu); |
| 823 |
|
// |
| 824 |
|
while ( jj < arlen ){ |
| 825 |
|
if ( jj < arlen-1 ){ |
| 826 |
|
sprintf(o,"%s %i ,",o,arr->At(jj)); |
| 827 |
|
sprintf(zz,"%s %i ,",zz,arr->At(jj)); |
| 828 |
|
} else { |
| 829 |
|
sprintf(o,"%s %i",o,arr->At(jj)); |
| 830 |
|
sprintf(zz,"%s %i",zz,arr->At(jj)); |
| 831 |
|
}; |
| 832 |
|
jj++; |
| 833 |
|
}; |
| 834 |
|
if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); |
| 835 |
|
if ( j < tb->GetNdata() -1 ) sprintf(zz,"%s ,",zz); |
| 836 |
|
j++; |
| 837 |
|
}; |
| 838 |
|
}; |
| 839 |
|
// |
| 840 |
|
// TArrayF |
| 841 |
|
// |
| 842 |
|
if ( !strcmp(tste->GetTypeName(),"TArrayF") ){ |
| 843 |
|
// |
| 844 |
|
char *pointer = (char*)cl->UncheckedAt(0); |
| 845 |
|
char *pu = pointer + thisoffset; |
| 846 |
|
TArrayF *arr = (TArrayF*)(pu); |
| 847 |
|
Int_t jj=0; |
| 848 |
|
Int_t arlen = min(arr->GetSize(),dlen); |
| 849 |
|
// |
| 850 |
|
setcolor(col,RESET, BLUE, WHITE); |
| 851 |
|
setcolor(col2,RESET, BLACK, WHITE); |
| 852 |
|
sprintf(o,"%s%s %s[%i]%s = ",o,col,foglia->GetName(),arr->GetSize(),col2); |
| 853 |
|
sprintf(zz,"%s %s[%i] = ",zz,foglia->GetName(),arr->GetSize()); |
| 854 |
|
// |
| 855 |
|
while ( j < tb->GetNdata() ){ |
| 856 |
|
// |
| 857 |
|
pointer = (char*)cl->UncheckedAt(j); |
| 858 |
|
pu = pointer + thisoffset; |
| 859 |
|
arr = (TArrayF*)(pu); |
| 860 |
|
// |
| 861 |
|
while ( jj < arlen ){ |
| 862 |
|
if ( jj < arlen-1 ){ |
| 863 |
|
sprintf(o,"%s %f ,",o,arr->At(jj)); |
| 864 |
|
sprintf(zz,"%s %f ,",zz,arr->At(jj)); |
| 865 |
|
} else { |
| 866 |
|
sprintf(o,"%s %f",o,arr->At(jj)); |
| 867 |
|
sprintf(zz,"%s %f",zz,arr->At(jj)); |
| 868 |
|
}; |
| 869 |
|
jj++; |
| 870 |
|
}; |
| 871 |
|
if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); |
| 872 |
|
if ( j < tb->GetNdata() -1 ) sprintf(zz,"%s ,",zz); |
| 873 |
|
j++; |
| 874 |
|
}; |
| 875 |
|
}; |
| 876 |
|
}; |
| 877 |
|
sprintf(o,"%s\n",o); |
| 878 |
|
sprintf(zz,"%s\n",zz); |
| 879 |
|
break; |
| 880 |
|
}; |
| 881 |
|
}; |
| 882 |
|
}; |
| 883 |
|
}; |
| 884 |
|
break; |
| 885 |
|
}; |
| 886 |
|
}; |
| 887 |
|
printf("%s\n",o); |
| 888 |
|
pamgui->DIALOG(4,zz); |
| 889 |
|
}; |
| 890 |
|
|
| 891 |
|
|
| 892 |
void FEVdetector::GetGeneralInfo(){ |
void FEVdetector::GetGeneralInfo(){ |
| 893 |
// |
// |
| 894 |
// Get Orbital Time information and header event number |
// Get Orbital Time information and header event number |
| 898 |
headcold = headc; |
headcold = headc; |
| 899 |
headc = ph->Counter; |
headc = ph->Counter; |
| 900 |
var.headc = (int)ph->Counter; |
var.headc = (int)ph->Counter; |
| 901 |
OBT = ph->OrbitalTime; |
OBT = (UInt_t)ph->OrbitalTime; |
| 902 |
DOBT = OBT - OOBT; |
DOBT = OBT - OOBT; |
| 903 |
OOBT = OBT; |
OOBT = OBT; |
| 904 |
if ( thisentry == minevent || DOBT < 0 || (headc-headcold-1)!=0 ) DOBT = 0; |
if ( thisentry == minevent || DOBT < 0 || (headc-headcold-1)!=0 ) DOBT = 0; |
| 934 |
trcs = (TString)trc.str().c_str(); |
trcs = (TString)trc.str().c_str(); |
| 935 |
} else { |
} else { |
| 936 |
headcold = headc; |
headcold = headc; |
| 937 |
headc = oinfoL2->pkt_num; // to be changed as soon as we will have obt in the level2 file! |
if ( var.RUN ){ |
| 938 |
OBT = oinfoL2->OBT; // to be changed as soon as we will have obt in the level2 file! |
var.idrun = L2->GetRunInfo()->ID; |
| 939 |
DOBT = OBT - OOBT; |
var.idroot = L2->GetRunInfo()->ID_ROOT_L0; |
| 940 |
OOBT = OBT; |
var.EVF = L2->GetRunInfo()->EV_FROM; |
| 941 |
if ( thisentry == minevent || DOBT < 0 || (headc-headcold-1)!=0 ) DOBT = 0; |
}; |
| 942 |
var.etime = OBT; |
if ( var.ORB ){ |
| 943 |
|
headc = L2->GetOrbitalInfo()->pkt_num; |
| 944 |
|
OBT = L2->GetOrbitalInfo()->OBT; |
| 945 |
|
DOBT = OBT - OOBT; |
| 946 |
|
OOBT = OBT; |
| 947 |
|
if ( thisentry == minevent || DOBT < 0 || (headc-headcold-1)!=0 ) DOBT = 0; |
| 948 |
|
var.etime = OBT; |
| 949 |
|
} else { |
| 950 |
|
var.etime = 0; |
| 951 |
|
}; |
| 952 |
// |
// |
| 953 |
// who gave the trigger? |
// who gave the trigger? |
| 954 |
// |
// |
| 955 |
calotrig = 0; |
Int_t trigconf = 0; |
| 956 |
if ( L2->patterntrig[0] ) calotrig = 1; |
if ( var.TRG ){ |
| 957 |
toftrig = 0; |
calotrig = 0; |
| 958 |
if ( L2->patterntrig[2] || L2->patterntrig[3] || L2->patterntrig[4] || L2->patterntrig[5] ) toftrig = 1; |
if ( L2->GetTrigLevel2()->patterntrig[0] ) calotrig = 1; |
| 959 |
s4pulser = 0; |
toftrig = 0; |
| 960 |
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; |
| 961 |
// |
s4pulser = 0; |
| 962 |
// 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; |
| 963 |
// S4 sometimes could not set the flag even if the trigger is given. This is a workaround to fix this "bug": |
// |
| 964 |
// |
// TOF and calorimeter when giving a trigger will always set this flag since the time window of the signal is greater than 100 ns. |
| 965 |
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": |
| 966 |
// |
// |
| 967 |
Int_t trigconf = L2->trigconf; |
if ( !calotrig && !toftrig ) s4pulser = 1; |
| 968 |
|
// |
| 969 |
|
trigconf = L2->GetTrigLevel2()->trigconf; |
| 970 |
|
} else { |
| 971 |
|
trigconf = 0; |
| 972 |
|
} |
| 973 |
stringstream trc; |
stringstream trc; |
| 974 |
trc.str(""); |
trc.str(""); |
| 975 |
if ( trigconf & (1<<0) ) trc << "TOF1"; |
if ( trigconf & (1<<0) ) trc << "TOF1"; |
| 1057 |
// |
// |
| 1058 |
if ( level.file == 2 ){ |
if ( level.file == 2 ){ |
| 1059 |
cintcom.str(""); |
cintcom.str(""); |
| 1060 |
cintcom << "PamLevel2 *L2 = (PamLevel2*)0x" << hex; |
cintcom << "PamLevel2 *L2 = (PamLevel2*)" << hex; //con const e l2 funziona |
| 1061 |
cintcom << L2; |
cintcom << L2; |
| 1062 |
gROOT->ProcessLine(cintcom.str().c_str()); |
gROOT->ProcessLine(cintcom.str().c_str()); |
| 1063 |
|
// printf(" comando: %s \n",cintcom.str().c_str()); |
| 1064 |
} else { |
} else { |
| 1065 |
cintcom.str(""); |
cintcom.str(""); |
| 1066 |
cintcom << "TTree *otr = (TTree*)0x" << hex; |
cintcom << "TTree *otr = (TTree*)" << hex; |
| 1067 |
cintcom << otr; |
cintcom << otr; |
| 1068 |
gROOT->ProcessLine(cintcom.str().c_str()); |
gROOT->ProcessLine(cintcom.str().c_str()); |
| 1069 |
// |
// |
| 1070 |
cintcom.str(""); |
cintcom.str(""); |
| 1071 |
cintcom << "struct Variables &var = (struct Variables &)0x" << hex; |
cintcom << "struct Variables &var = (struct Variables &)" << hex; |
| 1072 |
cintcom << &var; |
cintcom << &var; |
| 1073 |
gROOT->ProcessLine(cintcom.str().c_str()); |
gROOT->ProcessLine(cintcom.str().c_str()); |
| 1074 |
}; |
}; |
| 1079 |
// |
// |
| 1080 |
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);"); |
| 1081 |
// |
// |
| 1082 |
if ( level.file == 2 ) isOK = gApplication->ProcessLine("filter((PamLevel2 *)L2,2);"); |
// if ( level.file == 2 ) isOK = gApplication->ProcessLine("filter((PamLevel2 *)L2,2);"); |
| 1083 |
|
if ( level.file == 2 ) isOK = gApplication->ProcessLine("filter();"); |
| 1084 |
// |
// |
| 1085 |
// progress bar in text window |
// progress bar in text window |
| 1086 |
// |
// |
| 1093 |
// |
// |
| 1094 |
} |
} |
| 1095 |
|
|
| 1096 |
void FEVdetector::Load(TTree &mainotr, TFile &mainfile){ |
TChain* FEVdetector::Load(TString file){ |
| 1097 |
file = &mainfile; |
// |
| 1098 |
otr = &mainotr; |
// file = &mainfile; |
|
L2 = new PamLevel2(); |
|
| 1099 |
// |
// |
| 1100 |
if ( level.file == 2 ){ |
if ( level.file == 2 ){ |
|
// otr = L2->LoadPamTrees(file); |
|
|
otr = L2->GetPamTree(file); |
|
|
// ******************** |
|
|
// load magnetic field |
|
|
// ******************** |
|
|
const char *pam_calib = pathtocalibration(); |
|
| 1101 |
// |
// |
| 1102 |
stringstream magfie; |
// printf(" %s \n",ddec.Data()); |
| 1103 |
magfie.str(""); |
if ( !L2 ){ |
| 1104 |
// magfie << "/localdisk/mocchiut/test/calib/trk-param/field_param-0/"; |
L2 = new PamLevel2("",file.Data(),ddec.Data()); |
| 1105 |
magfie << pam_calib; |
otr = L2->GetPamTree(); |
| 1106 |
magfie << "/trk-param/field_param-0/"; |
// printf(" l2 constructor\n"); |
| 1107 |
|
// printf(" abst %u obt %u qtot %f \n",L2->GetOrbitalInfo()->absTime,L2->GetOrbitalInfo()->OBT,L2->GetCaloLevel2()->qtot); |
| 1108 |
|
} else { |
| 1109 |
|
// |
| 1110 |
|
// printf(" l2 already exist \n"); |
| 1111 |
|
otr = L2->GetPamTree(gSystem->DirName(file.Data()),file.Data(),ddec.Data()); |
| 1112 |
|
L2->GetRunTree(gSystem->DirName(file.Data()),file.Data()); |
| 1113 |
|
// |
| 1114 |
|
}; |
| 1115 |
|
// |
| 1116 |
|
// |
| 1117 |
|
if ( !otr ) return(0); |
| 1118 |
|
// |
| 1119 |
|
// otr->CanDeleteRefs(true); |
| 1120 |
|
// if ( runtree ) runtree->CanDeleteRefs(true); |
| 1121 |
// |
// |
|
L2->LoadField(magfie.str().c_str()); |
|
| 1122 |
} else { |
} else { |
| 1123 |
// |
// |
| 1124 |
// load calorimeter ADC2MIP conversion file |
// load calorimeter ADC2MIP conversion file |
| 1158 |
// |
// |
| 1159 |
}; |
}; |
| 1160 |
// |
// |
|
|
|
| 1161 |
// |
// |
| 1162 |
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(); |
|
| 1163 |
// |
// |
| 1164 |
if ( level.file == 0 || level.file == -1 ){ |
if ( level.file == 0 || level.file == -1 ){ |
| 1165 |
|
// |
| 1166 |
|
trigger = new pamela::trigger::TriggerEvent(); |
| 1167 |
|
eh = new pamela::EventHeader(); |
| 1168 |
|
ph = new pamela::PscuHeader(); |
| 1169 |
|
de = new pamela::calorimeter::CalorimeterEvent(); |
| 1170 |
|
trk = new pamela::tracker::TrackerEvent(); |
| 1171 |
|
ne = new pamela::neutron::NeutronEvent(); |
| 1172 |
|
ace = new pamela::anticounter::AnticounterEvent(); |
| 1173 |
|
s4 = new pamela::S4::S4Event(); |
| 1174 |
|
tof = new pamela::tof::TofEvent(); |
| 1175 |
|
// |
| 1176 |
|
otr = new TChain("Physics"); |
| 1177 |
|
otr->Add(file.Data(),-1); |
| 1178 |
otr->SetBranchAddress("Trigger", &trigger); |
otr->SetBranchAddress("Trigger", &trigger); |
| 1179 |
otr->SetBranchAddress("Header", &eh); |
otr->SetBranchAddress("Header", &eh); |
| 1180 |
}; |
}; |
|
if ( level.file == 2 ){ |
|
|
otr->AddFriend("OrbitalInfo", file); |
|
|
otr->SetBranchAddress("OrbitalInfo", &oinfoL2); |
|
|
runinfo->Read(0ULL); |
|
|
}; |
|
| 1181 |
// |
// |
| 1182 |
if ( var.TRK ) { |
if ( var.TRK ) { |
| 1183 |
if ( level.file == 0 || level.file == -1 ){ |
if ( level.file == 0 || level.file == -1 ){ |
| 1249 |
printf("Show the Time of Flight detector, LEVEL2 data \n"); |
printf("Show the Time of Flight detector, LEVEL2 data \n"); |
| 1250 |
}; |
}; |
| 1251 |
}; |
}; |
| 1252 |
|
// |
| 1253 |
|
if ( !otr ){ |
| 1254 |
|
return(0); |
| 1255 |
|
}; |
| 1256 |
|
// |
| 1257 |
|
return otr; |
| 1258 |
// |
// |
| 1259 |
} |
} |
| 1260 |
|
|
| 1330 |
text->DrawLatex(0.33,txthi,testo.str().c_str()); |
text->DrawLatex(0.33,txthi,testo.str().c_str()); |
| 1331 |
txthi -= 0.03; |
txthi -= 0.03; |
| 1332 |
testo2.str(""); |
testo2.str(""); |
| 1333 |
testo2 << "On Board Time: " << (int)OBT; |
testo2 << "On Board Time: " << (unsigned int)OBT; |
| 1334 |
if ( DOBT > 0 ) { |
if ( DOBT > 0 ) { |
| 1335 |
testo2 << " (delta: " << (int)DOBT; |
testo2 << " (delta: " << (unsigned int)DOBT; |
| 1336 |
testo2 << ")"; |
testo2 << ")"; |
| 1337 |
}; |
}; |
| 1338 |
testo2 << " [ms]"; |
testo2 << " [ms]"; |
| 1490 |
text->DrawLatex(var.xxvc+0.17*var.sfx,var.yxvc-0.08*var.sfy,"CAS1"); |
text->DrawLatex(var.xxvc+0.17*var.sfx,var.yxvc-0.08*var.sfy,"CAS1"); |
| 1491 |
text->DrawLatex(var.xyvc-0.192*var.sfx,var.yyvc-0.08*var.sfy,"CAS4"); |
text->DrawLatex(var.xyvc-0.192*var.sfx,var.yyvc-0.08*var.sfy,"CAS4"); |
| 1492 |
text->DrawLatex(var.xyvc+0.17*var.sfx,var.yyvc-0.08*var.sfy,"CAS3"); |
text->DrawLatex(var.xyvc+0.17*var.sfx,var.yyvc-0.08*var.sfy,"CAS3"); |
| 1493 |
text->DrawLatex(var.xxvc-0.192*var.sfx,var.yxvc+0.48*var.sfy,"CARD2"); |
text->DrawLatex(var.xxvc-0.222*var.sfx,var.yxvc+0.48*var.sfy,"CARD2"); |
| 1494 |
text->DrawLatex(var.xxvc+0.155*var.sfx,var.yxvc+0.48*var.sfy,"CARD3"); |
text->DrawLatex(var.xxvc+0.185*var.sfx,var.yxvc+0.48*var.sfy,"CARD3"); |
| 1495 |
text->DrawLatex(var.xyvc-0.170*var.sfx,var.yyvc+0.48*var.sfy,"CARD1"); |
text->DrawLatex(var.xyvc-0.190*var.sfx,var.yyvc+0.48*var.sfy,"CARD1"); |
| 1496 |
text->DrawLatex(var.xyvc+0.13*var.sfx,var.yyvc+0.48*var.sfy,"CARD4"); |
text->DrawLatex(var.xyvc+0.16*var.sfx,var.yyvc+0.48*var.sfy,"CARD4"); |
| 1497 |
text->DrawLatex(var.xxvc-0.192*var.sfx,var.yxvc+0.39*var.sfy,"CAT3"); |
text->DrawLatex(var.xxvc-0.192*var.sfx,var.yxvc+0.39*var.sfy,"CAT3"); |
| 1498 |
text->DrawLatex(var.xxvc+0.155*var.sfx,var.yxvc+0.39*var.sfy,"CAT4"); |
text->DrawLatex(var.xxvc+0.155*var.sfx,var.yxvc+0.39*var.sfy,"CAT4"); |
| 1499 |
text->DrawLatex(var.xyvc-0.170*var.sfx,var.yyvc+0.39*var.sfy,"CAT2"); |
text->DrawLatex(var.xyvc-0.170*var.sfx,var.yyvc+0.39*var.sfy,"CAT2"); |
| 1621 |
// |
// |
| 1622 |
// print infos on terminal |
// print infos on terminal |
| 1623 |
// |
// |
| 1624 |
|
// if ( !var.selex ){ |
| 1625 |
printf(" File: %s \n",var.thefilename.Data()); |
printf(" File: %s \n",var.thefilename.Data()); |
| 1626 |
if ( !s4pulser && !calotrig ){ |
if ( !s4pulser && !calotrig ){ |
| 1627 |
printf(" Pkt_num: %i - Progressive number: %i \n",(int)headc,thisentry+1); |
printf(" Pkt_num: %i - Progressive number: %i \n",(int)headc,thisentry+1); |
| 1632 |
if ( calotrig ){ |
if ( calotrig ){ |
| 1633 |
printf(" Pkt_num: %i - Progressive number: %i - CALO trigger -\n",(int)headc,thisentry+1); |
printf(" Pkt_num: %i - Progressive number: %i - CALO trigger -\n",(int)headc,thisentry+1); |
| 1634 |
}; |
}; |
| 1635 |
printf(" On Board Time: %i (delta %i) [ms]\n",OBT,DOBT); |
printf(" On Board Time: %u (delta %i) [ms]\n",OBT,DOBT); |
| 1636 |
const char *trc2 = trcs; |
const char *trc2 = trcs; |
| 1637 |
printf(" TRIGGER: %s \n",trc2); |
printf(" TRIGGER: %s \n",trc2); |
| 1638 |
printf(" AC: CARD hit = %i CAT hit = %i CAS hit = %i \n",var.hcard,var.hcat,var.hcas); |
printf(" AC: CARD hit = %i CAT hit = %i CAS hit = %i \n",var.hcard,var.hcat,var.hcas); |
| 1644 |
printf(" CALO: NSTRIP = %i QTOT = %i [MIP]\n",var.nstrip,var.qtot); |
printf(" CALO: NSTRIP = %i QTOT = %i [MIP]\n",var.nstrip,var.qtot); |
| 1645 |
printf(" S4: %.2f [MIP] TOF: beta = %.2f \n",var.s4sig,var.beta[4]); |
printf(" S4: %.2f [MIP] TOF: beta = %.2f \n",var.s4sig,var.beta[4]); |
| 1646 |
printf(" ND: Trigger: neutrons = %i - Background: upper = %i lower = %i \n",var.trup,var.bkup,var.bkbo); |
printf(" ND: Trigger: neutrons = %i - Background: upper = %i lower = %i \n",var.trup,var.bkup,var.bkbo); |
| 1647 |
|
// }; |
| 1648 |
// |
// |
| 1649 |
} |
} |
| 1650 |
|
|
| 1952 |
void FEVdetector::ShowTOF(){ |
void FEVdetector::ShowTOF(){ |
| 1953 |
// |
// |
| 1954 |
// |
// |
|
// |
|
| 1955 |
if ( !var.TOF ) return; |
if ( !var.TOF ) return; |
| 1956 |
// |
// |
| 1957 |
Int_t tt = 0; |
Int_t tt = 0; |
| 1958 |
|
Int_t rj = 0; |
| 1959 |
// |
// |
| 1960 |
// force level0, i.e. show patterntrig variable! |
// force level0, i.e. show patterntrig variable! |
| 1961 |
// |
// |
| 1985 |
Float_t mt31[2][3]; |
Float_t mt31[2][3]; |
| 1986 |
Float_t mt32[2][3]; |
Float_t mt32[2][3]; |
| 1987 |
// |
// |
| 1988 |
|
memset(mt11,0,2*8*sizeof(Float_t)); |
| 1989 |
|
memset(mt12,0,2*6*sizeof(Float_t)); |
| 1990 |
|
memset(mt21,0,2*2*sizeof(Float_t)); |
| 1991 |
|
memset(mt22,0,2*2*sizeof(Float_t)); |
| 1992 |
|
memset(mt31,0,2*3*sizeof(Float_t)); |
| 1993 |
|
memset(mt32,0,2*3*sizeof(Float_t)); |
| 1994 |
|
// |
| 1995 |
Int_t S3 = 0; |
Int_t S3 = 0; |
| 1996 |
Int_t S2 = 0; |
Int_t S2 = 0; |
| 1997 |
Int_t S12 = 0; |
Int_t S12 = 0; |
| 2156 |
Float_t s12p = 0.055; |
Float_t s12p = 0.055; |
| 2157 |
ocolo = 10; |
ocolo = 10; |
| 2158 |
TPolyLine *ftof12ya[6]; |
TPolyLine *ftof12ya[6]; |
| 2159 |
|
rj=6; |
| 2160 |
for ( Int_t j=0; j<6; j++){ |
for ( Int_t j=0; j<6; j++){ |
| 2161 |
|
rj--; |
| 2162 |
Float_t xc1[4]={ (s12p*j), s12p*(j), s12p*(j+1), (s12p*j)}; |
Float_t xc1[4]={ (s12p*j), s12p*(j), s12p*(j+1), (s12p*j)}; |
| 2163 |
Float_t yc1[4]={ -ws13, 0., 0., -ws13}; |
Float_t yc1[4]={ -ws13, 0., 0., -ws13}; |
| 2164 |
Float_t xc[4]; |
Float_t xc[4]; |
| 2174 |
} else { |
} else { |
| 2175 |
colo = 1; |
colo = 1; |
| 2176 |
}; |
}; |
| 2177 |
ColorMIP(ms12a[j],colo); |
ColorMIP(ms12a[rj],colo); |
| 2178 |
// |
// |
| 2179 |
if ( colo != 10 ) ocolo = colo; |
if ( colo != 10 ) ocolo = colo; |
| 2180 |
if ( mt12[0][j] == 4095. ) colo = noadc; |
if ( mt12[0][rj] == 4095. ) colo = noadc; |
| 2181 |
// |
// |
| 2182 |
ftof12ya[j]->SetFillColor(colo); |
ftof12ya[j]->SetFillColor(colo); |
| 2183 |
ftof12ya[j]->SetLineWidth(1); |
ftof12ya[j]->SetLineWidth(1); |
| 2187 |
// B |
// B |
| 2188 |
s12p = 0.055; |
s12p = 0.055; |
| 2189 |
TPolyLine *ftof12yb[6]; |
TPolyLine *ftof12yb[6]; |
| 2190 |
|
rj=6; |
| 2191 |
for ( Int_t j=0; j<6; j++){ |
for ( Int_t j=0; j<6; j++){ |
| 2192 |
|
rj--; |
| 2193 |
Float_t xc1[4]={ (s12p*j), s12p*(j+1), s12p*(j+1), (s12p*j)}; |
Float_t xc1[4]={ (s12p*j), s12p*(j+1), s12p*(j+1), (s12p*j)}; |
| 2194 |
Float_t yc1[4]={ -ws13, -ws13, 0., -ws13}; |
Float_t yc1[4]={ -ws13, -ws13, 0., -ws13}; |
| 2195 |
Float_t xc[4]; |
Float_t xc[4]; |
| 2205 |
} else { |
} else { |
| 2206 |
colo = 1; |
colo = 1; |
| 2207 |
}; |
}; |
| 2208 |
ColorMIP(ms12b[j],colo); |
ColorMIP(ms12b[rj],colo); |
| 2209 |
// |
// |
| 2210 |
if ( colo != 10 ) ocolo = colo; |
if ( colo != 10 ) ocolo = colo; |
| 2211 |
if ( mt12[1][j] == 4095. ) colo = noadc; |
if ( mt12[1][rj] == 4095. ) colo = noadc; |
| 2212 |
// |
// |
| 2213 |
ftof12yb[j]->SetFillColor(colo); |
ftof12yb[j]->SetFillColor(colo); |
| 2214 |
ftof12yb[j]->SetLineWidth(1); |
ftof12yb[j]->SetLineWidth(1); |
| 2242 |
Float_t s21p = 0.075; |
Float_t s21p = 0.075; |
| 2243 |
ocolo = 10; |
ocolo = 10; |
| 2244 |
TPolyLine *ftof21ya[2]; |
TPolyLine *ftof21ya[2]; |
| 2245 |
|
rj=2; |
| 2246 |
for ( Int_t j=0; j<2; j++){ |
for ( Int_t j=0; j<2; j++){ |
| 2247 |
|
rj--; |
| 2248 |
Float_t xc1[4]={ s21p*(j-1), s21p*(j-1), s21p*j, s21p*(j-1)}; |
Float_t xc1[4]={ s21p*(j-1), s21p*(j-1), s21p*j, s21p*(j-1)}; |
| 2249 |
Float_t yc1[4]={ 0., ws2, ws2, 0.}; |
Float_t yc1[4]={ 0., ws2, ws2, 0.}; |
| 2250 |
Float_t xc[4]; |
Float_t xc[4]; |
| 2260 |
} else { |
} else { |
| 2261 |
colo = 1; |
colo = 1; |
| 2262 |
}; |
}; |
| 2263 |
ColorMIP(ms21a[j],colo); |
ColorMIP(ms21a[rj],colo); |
| 2264 |
// |
// |
| 2265 |
if ( colo != 10 ) ocolo = colo; |
if ( colo != 10 ) ocolo = colo; |
| 2266 |
if ( mt21[0][j] == 4095. ) colo = noadc; |
if ( mt21[0][rj] == 4095. ) colo = noadc; |
| 2267 |
// |
// |
| 2268 |
ftof21ya[j]->SetFillColor(colo); |
ftof21ya[j]->SetFillColor(colo); |
| 2269 |
ftof21ya[j]->SetLineWidth(1); |
ftof21ya[j]->SetLineWidth(1); |
| 2273 |
// B |
// B |
| 2274 |
s21p = 0.075; |
s21p = 0.075; |
| 2275 |
TPolyLine *ftof21yb[2]; |
TPolyLine *ftof21yb[2]; |
| 2276 |
|
rj=2; |
| 2277 |
for ( Int_t j=0; j<2; j++){ |
for ( Int_t j=0; j<2; j++){ |
| 2278 |
|
rj--; |
| 2279 |
Float_t xc1[4]={ s21p*(j-1), s21p*j, s21p*j, s21p*(j-1)}; |
Float_t xc1[4]={ s21p*(j-1), s21p*j, s21p*j, s21p*(j-1)}; |
| 2280 |
Float_t yc1[4]={ 0., 0., ws2, 0.}; |
Float_t yc1[4]={ 0., 0., ws2, 0.}; |
| 2281 |
Float_t xc[4]; |
Float_t xc[4]; |
| 2291 |
} else { |
} else { |
| 2292 |
colo = 1; |
colo = 1; |
| 2293 |
}; |
}; |
| 2294 |
ColorMIP(ms21b[j],colo); |
ColorMIP(ms21b[rj],colo); |
| 2295 |
// |
// |
| 2296 |
if ( colo != 10 ) ocolo = colo; |
if ( colo != 10 ) ocolo = colo; |
| 2297 |
if ( mt21[1][j] == 4095. ) colo = noadc; |
if ( mt21[1][rj] == 4095. ) colo = noadc; |
| 2298 |
// |
// |
| 2299 |
ftof21yb[j]->SetFillColor(colo); |
ftof21yb[j]->SetFillColor(colo); |
| 2300 |
ftof21yb[j]->SetLineWidth(1); |
ftof21yb[j]->SetLineWidth(1); |
| 2409 |
Float_t s31p = 0.060; |
Float_t s31p = 0.060; |
| 2410 |
ocolo = 10; |
ocolo = 10; |
| 2411 |
TPolyLine *ftof31xa[3]; |
TPolyLine *ftof31xa[3]; |
| 2412 |
|
rj=3; |
| 2413 |
for ( Int_t j=0; j<3; j++){ |
for ( Int_t j=0; j<3; j++){ |
| 2414 |
|
rj--; |
| 2415 |
Float_t xc1[4]={ (s31p*j), (s31p*j), s31p*(j+1), (s31p*j)}; |
Float_t xc1[4]={ (s31p*j), (s31p*j), s31p*(j+1), (s31p*j)}; |
| 2416 |
Float_t yc1[4]={ 0., ws13, ws13, 0.}; |
Float_t yc1[4]={ 0., ws13, ws13, 0.}; |
| 2417 |
Float_t xc[4]; |
Float_t xc[4]; |
| 2427 |
} else { |
} else { |
| 2428 |
colo = 1; |
colo = 1; |
| 2429 |
}; |
}; |
| 2430 |
ColorMIP(ms31a[j],colo); |
ColorMIP(ms31a[rj],colo); |
| 2431 |
// |
// |
| 2432 |
if ( colo != 10 ) ocolo = colo; |
if ( colo != 10 ) ocolo = colo; |
| 2433 |
if ( mt31[0][j] == 4095. ) colo = noadc; |
if ( mt31[0][rj] == 4095. ) colo = noadc; |
| 2434 |
// |
// |
| 2435 |
ftof31xa[j]->SetFillColor(colo); |
ftof31xa[j]->SetFillColor(colo); |
| 2436 |
ftof31xa[j]->SetLineWidth(1); |
ftof31xa[j]->SetLineWidth(1); |
| 2440 |
// B |
// B |
| 2441 |
s31p = 0.060; |
s31p = 0.060; |
| 2442 |
TPolyLine *ftof31xb[3]; |
TPolyLine *ftof31xb[3]; |
| 2443 |
|
rj=3; |
| 2444 |
for ( Int_t j=0; j<3; j++){ |
for ( Int_t j=0; j<3; j++){ |
| 2445 |
|
rj--; |
| 2446 |
Float_t xc1[4]={ (s31p*j), s31p*(j+1), s31p*(j+1), (s31p*j)}; |
Float_t xc1[4]={ (s31p*j), s31p*(j+1), s31p*(j+1), (s31p*j)}; |
| 2447 |
Float_t yc1[4]={ 0., 0., ws13, 0.}; |
Float_t yc1[4]={ 0., 0., ws13, 0.}; |
| 2448 |
Float_t xc[4]; |
Float_t xc[4]; |
| 2458 |
} else { |
} else { |
| 2459 |
colo = 1; |
colo = 1; |
| 2460 |
}; |
}; |
| 2461 |
ColorMIP(ms31b[j],colo); |
ColorMIP(ms31b[rj],colo); |
| 2462 |
// |
// |
| 2463 |
if ( colo != 10 ) ocolo = colo; |
if ( colo != 10 ) ocolo = colo; |
| 2464 |
if ( mt31[1][j] == 4095. ) colo = noadc; |
if ( mt31[1][rj] == 4095. ) colo = noadc; |
| 2465 |
// |
// |
| 2466 |
ftof31xb[j]->SetFillColor(colo); |
ftof31xb[j]->SetFillColor(colo); |
| 2467 |
ftof31xb[j]->SetLineWidth(1); |
ftof31xb[j]->SetLineWidth(1); |
| 2493 |
Float_t s32p = 0.050; |
Float_t s32p = 0.050; |
| 2494 |
ocolo = 10; |
ocolo = 10; |
| 2495 |
TPolyLine *ftof32ya[3]; |
TPolyLine *ftof32ya[3]; |
| 2496 |
|
rj=3; |
| 2497 |
for ( Int_t j=0; j<3; j++){ |
for ( Int_t j=0; j<3; j++){ |
| 2498 |
|
rj--; |
| 2499 |
Float_t xc1[4]={ (s32p*j), (s32p*j), s32p*(j+1), (s32p*j)}; |
Float_t xc1[4]={ (s32p*j), (s32p*j), s32p*(j+1), (s32p*j)}; |
| 2500 |
Float_t yc1[4]={ -ws13, 0., 0., -ws13}; |
Float_t yc1[4]={ -ws13, 0., 0., -ws13}; |
| 2501 |
Float_t xc[4]; |
Float_t xc[4]; |
| 2511 |
} else { |
} else { |
| 2512 |
colo = 1; |
colo = 1; |
| 2513 |
}; |
}; |
| 2514 |
ColorMIP(ms32a[j],colo); |
ColorMIP(ms32a[rj],colo); |
| 2515 |
// |
// |
| 2516 |
if ( colo != 10 ) ocolo = colo; |
if ( colo != 10 ) ocolo = colo; |
| 2517 |
if ( mt32[0][j] == 4095. ) colo = noadc; |
if ( mt32[0][rj] == 4095. ) colo = noadc; |
| 2518 |
// |
// |
| 2519 |
ftof32ya[j]->SetFillColor(colo); |
ftof32ya[j]->SetFillColor(colo); |
| 2520 |
ftof32ya[j]->SetLineWidth(1); |
ftof32ya[j]->SetLineWidth(1); |
| 2523 |
}; |
}; |
| 2524 |
s32p = 0.050; |
s32p = 0.050; |
| 2525 |
TPolyLine *ftof32yb[3]; |
TPolyLine *ftof32yb[3]; |
| 2526 |
|
rj=3; |
| 2527 |
for ( Int_t j=0; j<3; j++){ |
for ( Int_t j=0; j<3; j++){ |
| 2528 |
|
rj--; |
| 2529 |
Float_t xc1[4]={ (s32p*j), s32p*(j+1), s32p*(j+1), (s32p*j)}; |
Float_t xc1[4]={ (s32p*j), s32p*(j+1), s32p*(j+1), (s32p*j)}; |
| 2530 |
Float_t yc1[4]={ -ws13, -ws13, 0., -ws13}; |
Float_t yc1[4]={ -ws13, -ws13, 0., -ws13}; |
| 2531 |
Float_t xc[4]; |
Float_t xc[4]; |
| 2541 |
} else { |
} else { |
| 2542 |
colo = 1; |
colo = 1; |
| 2543 |
}; |
}; |
| 2544 |
ColorMIP(ms32b[j],colo); |
ColorMIP(ms32b[rj],colo); |
| 2545 |
// |
// |
| 2546 |
if ( colo != 10 ) ocolo = colo; |
if ( colo != 10 ) ocolo = colo; |
| 2547 |
if ( mt32[1][j] == 4095. ) colo = noadc; |
if ( mt32[1][rj] == 4095. ) colo = noadc; |
| 2548 |
// |
// |
| 2549 |
ftof32yb[j]->SetFillColor(colo); |
ftof32yb[j]->SetFillColor(colo); |
| 2550 |
ftof32yb[j]->SetLineWidth(1); |
ftof32yb[j]->SetLineWidth(1); |
| 2681 |
ms11b[i] = 0.; |
ms11b[i] = 0.; |
| 2682 |
} else { |
} else { |
| 2683 |
ms11b[i] = 1.; |
ms11b[i] = 1.; |
| 2684 |
}; }; |
}; |
| 2685 |
|
}; |
| 2686 |
for ( Int_t i = 0; i<6; i++ ) { |
for ( Int_t i = 0; i<6; i++ ) { |
| 2687 |
mt12[0][i] = tof->tdc[ch12a[i]][hb12a[i]]; |
mt12[0][i] = tof->tdc[ch12a[i]][hb12a[i]]; |
| 2688 |
mt12[1][i] = tof->tdc[ch12b[i]][hb12b[i]]; |
mt12[1][i] = tof->tdc[ch12b[i]][hb12b[i]]; |
| 2775 |
// |
// |
| 2776 |
// |
// |
| 2777 |
Bool_t repeat = true; |
Bool_t repeat = true; |
| 2778 |
Int_t numtr = 1; |
// Int_t numtr = 1; |
| 2779 |
|
Int_t numtr = 0; |
| 2780 |
Int_t repuntil = 0; |
Int_t repuntil = 0; |
| 2781 |
|
Int_t repuntiltr = 0; |
| 2782 |
// |
// |
| 2783 |
// |
// |
| 2784 |
var.tofraw = 0; |
var.tofraw = 0; |
| 2785 |
// |
// |
| 2786 |
repuntil = L2->ToFLevel2::ntrk(); |
if ( level.file == 2 ) repuntil = L2->GetToFLevel2()->ntrk(); |
| 2787 |
// printf("repuntil = %i \n",repuntil); |
// printf("repuntil = %i \n",repuntil); |
| 2788 |
//repuntil = L2->GetNTracks(); |
if ( level.file == 2 ) repuntiltr = L2->GetTrkLevel2()->GetNTracks(); |
| 2789 |
|
// repuntiltr = L2->GetNTracks(); |
| 2790 |
// |
// |
| 2791 |
while ( repeat ){ |
while ( repeat ){ |
| 2792 |
// printf("B repuntil = %i \n",repuntil); |
// printf("B repuntil = %i \n",repuntil); |
| 2795 |
// |
// |
| 2796 |
// |
// |
| 2797 |
ToFTrkVar *ptt = 0; |
ToFTrkVar *ptt = 0; |
| 2798 |
|
PamTrack *ptrack = 0; |
| 2799 |
|
Float_t adc[4][12]; |
| 2800 |
|
Float_t tdc[4][12]; |
| 2801 |
|
memset(adc,0,4*12*sizeof(Float_t)); |
| 2802 |
|
memset(tdc,0,4*12*sizeof(Float_t)); |
| 2803 |
// |
// |
| 2804 |
// |
// |
| 2805 |
|
// if ( repuntil == 0 || var.tofraw ){ |
| 2806 |
if ( repuntil == 1 || var.tofraw ){ |
if ( repuntil == 1 || var.tofraw ){ |
| 2807 |
numtr = 0; |
numtr = 0; |
| 2808 |
ptt = L2->GetToFTrkVar(0); |
ptt = L2->GetToFLevel2()->GetToFTrkVar(0); |
| 2809 |
repeat = false; |
repeat = false; |
| 2810 |
} else { |
} else { |
| 2811 |
// |
// |
| 2812 |
// |
// |
| 2813 |
if ( numtr >= repuntil-1 ) repeat = false; |
if ( numtr >= (repuntiltr-1) ) repeat = false; |
| 2814 |
// |
// |
| 2815 |
ptt = L2->GetToFTrkVar(numtr); |
//printf(" numtr is %i \n",numtr); |
| 2816 |
|
// ptt = L2->GetToFLevel2()->GetToFTrkVar(numtr); |
| 2817 |
|
ptrack = L2->GetTrack(numtr); |
| 2818 |
|
ptt = ptrack->GetToFTrack(); |
| 2819 |
}; |
}; |
| 2820 |
// |
// |
| 2821 |
xp11[0] = 0.; |
xp11[0] = 0.; |
| 2829 |
// |
// |
| 2830 |
ii = 2; |
ii = 2; |
| 2831 |
// |
// |
| 2832 |
Float_t adc[4][12]; |
Int_t myseq = ptt->trkseqno + 1; |
|
Float_t tdc[4][12]; |
|
|
L2->GetMatrix(numtr,adc,tdc); |
|
|
|
|
| 2833 |
// |
// |
| 2834 |
for ( Int_t i = 0; i<8; i++ ) { |
L2->GetToFLevel2()->GetMatrix(myseq,adc,tdc); |
| 2835 |
if ( adc[ch11a[i]][hb11a[i]] < 1000. ){ |
// |
| 2836 |
ms11a[i] = adc[ch11a[i]][hb11a[i]]; |
// printf(" qua \n"); |
| 2837 |
}; |
// |
| 2838 |
if ( adc[ch11b[i]][hb11b[i]] < 1000. ){ |
// for ( Int_t i = 0; i<8; i++ ) { |
| 2839 |
ms11b[i] = adc[ch11b[i]][hb11b[i]]; |
// if ( adc[ch11a[i]][hb11a[i]] < 1000. ){ |
| 2840 |
}; |
// ms11a[i] = adc[ch11a[i]][hb11a[i]]; |
| 2841 |
// xp11[i] = 0.; |
// }; |
| 2842 |
}; |
// if ( adc[ch11b[i]][hb11b[i]] < 1000. ){ |
| 2843 |
|
// ms11b[i] = adc[ch11b[i]][hb11b[i]]; |
| 2844 |
|
// }; |
| 2845 |
|
// xp11[i] = 0.; |
| 2846 |
|
// }; |
| 2847 |
|
|
| 2848 |
Int_t nmtof = 0; |
Int_t nmtof = 0; |
| 2849 |
Float_t mtof = 0.; |
Float_t mtof = 0.; |
| 2960 |
if ( level.file == -1 ){ |
if ( level.file == -1 ){ |
| 2961 |
ColorMIP(ms11a[j]+ms11b[j],colo); |
ColorMIP(ms11a[j]+ms11b[j],colo); |
| 2962 |
} else { |
} else { |
| 2963 |
ColorTOFMIP(ms11a[j]+ms11b[j],colo); |
ColorTOFMIP((ms11a[j]+ms11b[j])/2.,colo); |
| 2964 |
}; |
}; |
| 2965 |
// |
// |
| 2966 |
if ( colo != 10 ) ocolo = colo; |
if ( colo != 10 ) ocolo = colo; |
| 2990 |
ftof11y->Draw(); |
ftof11y->Draw(); |
| 2991 |
TPolyLine *sftof11[8]; |
TPolyLine *sftof11[8]; |
| 2992 |
tt = 1; |
tt = 1; |
| 2993 |
if ( level.file == -1 ) tt = 8; |
rj=1; |
| 2994 |
|
if ( level.file == -1 ){ |
| 2995 |
|
tt = 8; |
| 2996 |
|
rj = 8; |
| 2997 |
|
}; |
| 2998 |
for ( Int_t j=0; j<tt; j++){ |
for ( Int_t j=0; j<tt; j++){ |
| 2999 |
if ( (mt11[0][j]<4095. || mt11[1][j]<4095.)){ |
rj--; |
| 3000 |
|
if ( (mt11[0][rj]<4095. || mt11[1][rj]<4095.)){ |
| 3001 |
if ( ocolo == 10 ) ocolo = noadc; |
if ( ocolo == 10 ) ocolo = noadc; |
| 3002 |
Float_t lowp = (xp11[j]-E11[j])/100.; |
Float_t lowp = -(xp11[rj]+E11[rj])/100.; |
| 3003 |
Float_t higp = (xp11[j]+E11[j])/100.; |
Float_t higp = -(xp11[rj]-E11[rj])/100.; |
| 3004 |
if ( lowp < -0.164 ) lowp = -0.164; |
if ( lowp < -0.164 ) lowp = -0.164; |
| 3005 |
if ( higp > 0.164 ) higp = 0.164; |
if ( higp > 0.164 ) higp = 0.164; |
| 3006 |
if ( lowp < higp && ( level.file == -1 || (level.file == 2 && xp11[j] != 0.))){ |
if ( lowp < higp && ( level.file == -1 || (level.file == 2 && xp11[rj] != 0.))){ |
| 3007 |
Float_t nxc1[5]={ lowp, higp, higp, lowp, lowp}; |
Float_t nxc1[5]={ lowp, higp, higp, lowp, lowp}; |
| 3008 |
Float_t nyc1[5]={ 0.0015, 0.0015, ws13-0.0015, ws13-0.0015, 0.0015}; |
Float_t nyc1[5]={ 0.0015, 0.0015, ws13-0.0015, ws13-0.0015, 0.0015}; |
| 3009 |
Float_t nxc[5]; |
Float_t nxc[5]; |
| 3028 |
Float_t s12p = 0.055; |
Float_t s12p = 0.055; |
| 3029 |
ocolo = 10; |
ocolo = 10; |
| 3030 |
TPolyLine *ftof12y[6]; |
TPolyLine *ftof12y[6]; |
| 3031 |
|
rj = 6; |
| 3032 |
for ( Int_t j=0; j<6; j++){ |
for ( Int_t j=0; j<6; j++){ |
| 3033 |
|
rj--; |
| 3034 |
Float_t nxc1[5]={ (s12p*j), (s12p*j), s12p*(j+1), s12p*(j+1), (s12p*j)}; |
Float_t nxc1[5]={ (s12p*j), (s12p*j), s12p*(j+1), s12p*(j+1), (s12p*j)}; |
| 3035 |
Float_t nyc1[5]={ -ws13, 0., 0., -ws13, -ws13}; |
Float_t nyc1[5]={ -ws13, 0., 0., -ws13, -ws13}; |
| 3036 |
Float_t nxc[5]; |
Float_t nxc[5]; |
| 3047 |
colo = 1; |
colo = 1; |
| 3048 |
}; |
}; |
| 3049 |
if ( level.file == -1 ){ |
if ( level.file == -1 ){ |
| 3050 |
ColorMIP(ms12a[j]+ms12b[j],colo); |
ColorMIP(ms12a[rj]+ms12b[rj],colo); |
| 3051 |
} else { |
} else { |
| 3052 |
ColorTOFMIP(ms12a[j]+ms12b[j],colo); |
ColorTOFMIP((ms12a[rj]+ms12b[rj])/2.,colo); |
| 3053 |
}; |
}; |
| 3054 |
// |
// |
| 3055 |
if ( colo != 10 ) ocolo = colo; |
if ( colo != 10 ) ocolo = colo; |
| 3116 |
Float_t s21p = 0.075; |
Float_t s21p = 0.075; |
| 3117 |
ocolo = 10; |
ocolo = 10; |
| 3118 |
TPolyLine *ftof21y[2]; |
TPolyLine *ftof21y[2]; |
| 3119 |
|
rj=2; |
| 3120 |
for ( Int_t j=0; j<2; j++){ |
for ( Int_t j=0; j<2; j++){ |
| 3121 |
|
rj--; |
| 3122 |
Float_t nxc1[5]={ s21p*(j-1), s21p*(j-1), s21p*j,s21p*j, s21p*(j-1)}; |
Float_t nxc1[5]={ s21p*(j-1), s21p*(j-1), s21p*j,s21p*j, s21p*(j-1)}; |
| 3123 |
Float_t nyc1[5]={ 0., ws2, ws2, 0., 0.}; |
Float_t nyc1[5]={ 0., ws2, ws2, 0., 0.}; |
| 3124 |
Float_t nxc[5]; |
Float_t nxc[5]; |
| 3135 |
colo = 1; |
colo = 1; |
| 3136 |
}; |
}; |
| 3137 |
if ( level.file == -1 ){ |
if ( level.file == -1 ){ |
| 3138 |
ColorMIP(ms21a[j]+ms21b[j],colo); |
ColorMIP(ms21a[rj]+ms21b[rj],colo); |
| 3139 |
} else { |
} else { |
| 3140 |
ColorTOFMIP(ms21a[j]+ms21b[j],colo); |
ColorTOFMIP((ms21a[rj]+ms21b[rj])/2.,colo); |
| 3141 |
}; |
}; |
| 3142 |
// |
// |
| 3143 |
if ( colo != 10 ) ocolo = colo; |
if ( colo != 10 ) ocolo = colo; |
| 3223 |
if ( level.file == -1 ){ |
if ( level.file == -1 ){ |
| 3224 |
ColorMIP(ms22a[j]+ms22b[j],colo); |
ColorMIP(ms22a[j]+ms22b[j],colo); |
| 3225 |
} else { |
} else { |
| 3226 |
ColorTOFMIP(ms22a[j]+ms22b[j],colo); |
ColorTOFMIP((ms22a[j]+ms22b[j])/2.,colo); |
| 3227 |
}; |
}; |
| 3228 |
// |
// |
| 3229 |
if ( colo != 10 ) ocolo = colo; |
if ( colo != 10 ) ocolo = colo; |
| 3254 |
ftof22y->Draw(); |
ftof22y->Draw(); |
| 3255 |
TPolyLine *sftof22[2]; |
TPolyLine *sftof22[2]; |
| 3256 |
tt = 1; |
tt = 1; |
| 3257 |
if ( level.file == -1 ) tt = 2; |
rj = 1; |
| 3258 |
|
if ( level.file == -1 ){ |
| 3259 |
|
tt = 2; |
| 3260 |
|
rj = 2; |
| 3261 |
|
}; |
| 3262 |
for (Int_t j=0; j<tt; j++){ |
for (Int_t j=0; j<tt; j++){ |
| 3263 |
|
rj--; |
| 3264 |
// for ( Int_t j=0; j<2; j++){ |
// for ( Int_t j=0; j<2; j++){ |
| 3265 |
if ( (mt22[0][j]<4095. || mt22[1][j]<4095.) ){ |
if ( (mt22[0][rj]<4095. || mt22[1][rj]<4095.) ){ |
| 3266 |
if ( ocolo == 10 ) ocolo = noadc; |
if ( ocolo == 10 ) ocolo = noadc; |
| 3267 |
Float_t lowp = (xp22[j]-E22[j])/100.; |
Float_t lowp = -(xp22[rj]+E22[rj])/100.; |
| 3268 |
Float_t higp = (xp22[j]+E22[j])/100.; |
Float_t higp = -(xp22[rj]-E22[rj])/100.; |
| 3269 |
if ( lowp < -0.074 ) lowp = -0.074; |
if ( lowp < -0.074 ) lowp = -0.074; |
| 3270 |
if ( higp > 0.074 ) higp = 0.074; |
if ( higp > 0.074 ) higp = 0.074; |
| 3271 |
if ( lowp < higp && ( level.file == -1 || (level.file == 2 && xp22[j] != 0.))){ |
if ( lowp < higp && ( level.file == -1 || (level.file == 2 && xp22[rj] != 0.))){ |
| 3272 |
Float_t nxc1[5]={ lowp, higp, higp, lowp, lowp}; |
Float_t nxc1[5]={ lowp, higp, higp, lowp, lowp}; |
| 3273 |
Float_t nyc1[5]={ -0.0015, -0.0015, -ws2+0.0015, -ws2+0.0015, -0.0015}; |
Float_t nyc1[5]={ -0.0015, -0.0015, -ws2+0.0015, -ws2+0.0015, -0.0015}; |
| 3274 |
Float_t nxc[5]; |
Float_t nxc[5]; |
| 3288 |
}; |
}; |
| 3289 |
}; |
}; |
| 3290 |
// |
// |
| 3291 |
|
//daquiinbasso |
| 3292 |
// |
// |
| 3293 |
// S31 X-view |
// S31 X-view |
| 3294 |
// |
// |
| 3314 |
if ( level.file == -1 ){ |
if ( level.file == -1 ){ |
| 3315 |
ColorMIP(ms31a[j]+ms31b[j],colo); |
ColorMIP(ms31a[j]+ms31b[j],colo); |
| 3316 |
} else { |
} else { |
| 3317 |
ColorTOFMIP(ms31a[j]+ms31b[j],colo); |
ColorTOFMIP((ms31a[j]+ms31b[j])/2.,colo); |
| 3318 |
}; |
}; |
| 3319 |
// |
// |
| 3320 |
if ( colo != 10 ) ocolo = colo; |
if ( colo != 10 ) ocolo = colo; |
| 3345 |
ftof31y->Draw(); |
ftof31y->Draw(); |
| 3346 |
TPolyLine *sftof31[3]; |
TPolyLine *sftof31[3]; |
| 3347 |
tt = 1; |
tt = 1; |
| 3348 |
if ( level.file == -1 ) tt = 3; |
rj = 1; |
| 3349 |
|
if ( level.file == -1 ){ |
| 3350 |
|
tt = 3; |
| 3351 |
|
rj = 3; |
| 3352 |
|
}; |
| 3353 |
for (Int_t j=0; j<tt; j++){ |
for (Int_t j=0; j<tt; j++){ |
| 3354 |
|
rj--; |
| 3355 |
// for ( Int_t j=0; j<3; j++){ |
// for ( Int_t j=0; j<3; j++){ |
| 3356 |
if ( (mt31[0][j]<4095. || mt31[1][j]<4095.)){ |
if ( (mt31[0][rj]<4095. || mt31[1][rj]<4095.)){ |
| 3357 |
if ( ocolo == 10 ) ocolo = noadc; |
if ( ocolo == 10 ) ocolo = noadc; |
| 3358 |
Float_t lowp = (xp31[j]-E31[j])/100.; |
Float_t lowp = -(xp31[rj]+E31[rj])/100.; |
| 3359 |
Float_t higp = (xp31[j]+E31[j])/100.; |
Float_t higp = -(xp31[rj]-E31[rj])/100.; |
| 3360 |
if ( lowp < -0.074 ) lowp = -0.074; |
if ( lowp < -0.074 ) lowp = -0.074; |
| 3361 |
if ( higp > 0.074 ) higp = 0.074; |
if ( higp > 0.074 ) higp = 0.074; |
| 3362 |
if ( lowp < higp && ( level.file == -1 || (level.file == 2 && xp31[j] != 0.))){ |
if ( lowp < higp && ( level.file == -1 || (level.file == 2 && xp31[rj] != 0.))){ |
| 3363 |
Float_t nxc1[5]={ lowp, higp, higp, lowp, lowp}; |
Float_t nxc1[5]={ lowp, higp, higp, lowp, lowp}; |
| 3364 |
Float_t nyc1[5]={ 0.0015, 0.0015, ws13-0.0015, ws13-0.0015, 0.0015}; |
Float_t nyc1[5]={ 0.0015, 0.0015, ws13-0.0015, ws13-0.0015, 0.0015}; |
| 3365 |
Float_t nxc[5]; |
Float_t nxc[5]; |
| 3386 |
Float_t s32p = 0.050; |
Float_t s32p = 0.050; |
| 3387 |
ocolo = 10; |
ocolo = 10; |
| 3388 |
TPolyLine *ftof32y[3]; |
TPolyLine *ftof32y[3]; |
| 3389 |
|
rj = 3; |
| 3390 |
for ( Int_t j=0; j<3; j++){ |
for ( Int_t j=0; j<3; j++){ |
| 3391 |
|
rj--; |
| 3392 |
Float_t nxc1[5]={ (s32p*j), (s32p*j), s32p*(j+1),s32p*(j+1), (s32p*j)}; |
Float_t nxc1[5]={ (s32p*j), (s32p*j), s32p*(j+1),s32p*(j+1), (s32p*j)}; |
| 3393 |
Float_t nyc1[5]={ -ws13, 0., 0., -ws13, -ws13}; |
Float_t nyc1[5]={ -ws13, 0., 0., -ws13, -ws13}; |
| 3394 |
Float_t nxc[5]; |
Float_t nxc[5]; |
| 3405 |
colo = 1; |
colo = 1; |
| 3406 |
}; |
}; |
| 3407 |
if ( level.file == -1 ){ |
if ( level.file == -1 ){ |
| 3408 |
ColorMIP(ms32a[j]+ms32b[j],colo); |
ColorMIP(ms32a[rj]+ms32b[rj],colo); |
| 3409 |
} else { |
} else { |
| 3410 |
ColorTOFMIP(ms32a[j]+ms32b[j],colo); |
ColorTOFMIP((ms32a[rj]+ms32b[rj])/2.,colo); |
| 3411 |
}; |
}; |
| 3412 |
// |
// |
| 3413 |
if ( colo != 10 ) ocolo = colo; |
if ( colo != 10 ) ocolo = colo; |
| 3497 |
// full infos from ac |
// full infos from ac |
| 3498 |
// |
// |
| 3499 |
if ( level.file == 2 ){ |
if ( level.file == 2 ){ |
| 3500 |
hitmapA = L2->hitmap[0]; |
hitmapA = L2->GetAcLevel2()->hitmap[0]; |
| 3501 |
hitmapB = L2->hitmap[1]; |
hitmapB = L2->GetAcLevel2()->hitmap[1]; |
| 3502 |
hitstatusA = L2->hitstatus[0]; |
hitstatusA = L2->GetAcLevel2()->hitstatus[0]; |
| 3503 |
hitstatusB = L2->hitstatus[1]; |
hitstatusB = L2->GetAcLevel2()->hitstatus[1]; |
| 3504 |
}; |
}; |
| 3505 |
// |
// |
| 3506 |
// |
// |
| 4374 |
pcasp4b->Draw("f"); |
pcasp4b->Draw("f"); |
| 4375 |
pcasp4b->Draw(); |
pcasp4b->Draw(); |
| 4376 |
}; |
}; |
| 4377 |
Float_t alfa = 1.2020334; |
// Float_t alfax = 1.2020334; |
| 4378 |
|
Float_t alfax = 1.22157778; |
| 4379 |
|
Float_t alfay = 1.27393111; |
| 4380 |
Float_t lcrd = 0.1815/2.; |
Float_t lcrd = 0.1815/2.; |
| 4381 |
Float_t wcrd = 0.008; |
Float_t wcrd = 0.008; |
| 4382 |
if ( true ){ |
if ( true ){ |
| 4587 |
// |
// |
| 4588 |
// Float_t cardcx = 0.143168*var.sfx; |
// Float_t cardcx = 0.143168*var.sfx; |
| 4589 |
//Float_t cardcy = 0.1475*var.sfy; |
//Float_t cardcy = 0.1475*var.sfy; |
| 4590 |
Float_t cardcx = 0.153168*var.sfx; |
// |
| 4591 |
Float_t cardcy = 0.1575*var.sfy; |
// Float_t cardcx = 0.153168*var.sfx; |
| 4592 |
Float_t acrdx[4] = {-lcrd*cos(alfa), lcrd*cos(alfa), -lcrd*cos(alfa)+wcrd*sin(alfa), -lcrd*cos(alfa)}; |
// |
| 4593 |
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; |
| 4594 |
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; |
| 4595 |
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; |
| 4596 |
|
Float_t acrdx[4] = {-lcrd*cos(alfax), lcrd*cos(alfax), -lcrd*cos(alfax)+wcrd*sin(alfax), -lcrd*cos(alfax)}; |
| 4597 |
|
Float_t acrdy[4] = {-lcrd*sin(alfax), lcrd*sin(alfax), -lcrd*sin(alfax)-wcrd*cos(alfax), -lcrd*sin(alfax)}; |
| 4598 |
|
Float_t bcrdx[4] = { lcrd*cos(alfax), lcrd*cos(alfax)+wcrd*sin(alfax), -lcrd*cos(alfax)+wcrd*sin(alfax), lcrd*cos(alfax)}; |
| 4599 |
|
Float_t bcrdy[4] = { lcrd*sin(alfax), lcrd*sin(alfax)-wcrd*cos(alfax), -lcrd*sin(alfax)-wcrd*cos(alfax), lcrd*sin(alfax)}; |
| 4600 |
|
|
| 4601 |
// |
// |
| 4602 |
// CARD3 X/ Y |
// CARD3 X/ Y |
| 4656 |
}; |
}; |
| 4657 |
|
|
| 4658 |
if ( true ){ |
if ( true ){ |
| 4659 |
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)}; |
| 4660 |
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)}; |
| 4661 |
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)}; |
| 4662 |
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)}; |
| 4663 |
// |
// |
| 4664 |
// CARD - Y-view |
// CARD - Y-view |
| 4665 |
// |
// |
| 4666 |
Float_t cardcx = 0.12*var.sfx; |
// Float_t cardcx = 0.12*var.sfx; |
| 4667 |
Float_t cardcy = 0.1475*var.sfy; |
Float_t cardcx = (0.16014*(1.-lcrd*cos(alfay)))*var.sfx; |
| 4668 |
|
// Float_t cardcy = 0.178818*var.sfy; |
| 4669 |
|
Float_t cardcy = (0.178818*(1.-lcrd*sin(alfay)))*var.sfy; |
| 4670 |
|
// Float_t cardcy = 0.1475*var.sfy; |
| 4671 |
// |
// |
| 4672 |
// CARD4 X Y/ |
// CARD4 X Y/ |
| 4673 |
// |
// |
| 4766 |
// |
// |
| 4767 |
if ( level.file == 2 ){ |
if ( level.file == 2 ){ |
| 4768 |
for ( Int_t j = 0; j<3; j++ ) { |
for ( Int_t j = 0; j<3; j++ ) { |
| 4769 |
if ( L2->S4adc != 32. ) ms4[j] = L2->S4calibrated; |
if ( L2->GetS4Level2()->S4adc != 32. ) ms4[j] = L2->GetS4Level2()->S4calibrated; |
| 4770 |
}; |
}; |
| 4771 |
}; |
}; |
| 4772 |
// |
// |
| 4851 |
}; |
}; |
| 4852 |
}; |
}; |
| 4853 |
if ( level.file == 2 ){ |
if ( level.file == 2 ){ |
| 4854 |
yUpperTrig = (Int_t)L2->trigPhysics; |
yUpperTrig = (Int_t)L2->GetNDLevel2()->trigPhysics; |
| 4855 |
yUpperBk = (Int_t)L2->upperBack; |
yUpperBk = (Int_t)L2->GetNDLevel2()->upperBack; |
| 4856 |
yBottomBk = (Int_t)L2->bottomBack; |
yBottomBk = (Int_t)L2->GetNDLevel2()->bottomBack; |
| 4857 |
}; |
}; |
| 4858 |
// |
// |
| 4859 |
var.trup = yUpperTrig; |
var.trup = yUpperTrig; |
| 5121 |
for (Int_t m = 0; m<3; m++){ |
for (Int_t m = 0; m<3; m++){ |
| 5122 |
if ( trk->signcluster[l][m] != 0. ){ |
if ( trk->signcluster[l][m] != 0. ){ |
| 5123 |
if ( planeno == 10 ) { |
if ( planeno == 10 ) { |
|
x = 1024 - trk->addrcluster[l][m]; |
|
|
} else { |
|
| 5124 |
x = trk->addrcluster[l][m]; |
x = trk->addrcluster[l][m]; |
| 5125 |
|
} else { |
| 5126 |
|
x = 1024 - trk->addrcluster[l][m]; |
| 5127 |
}; |
}; |
| 5128 |
linea = new TLine(14.+x,0.01,14.+x,0.3); |
linea = new TLine(14.+x,0.01,14.+x,0.3); |
| 5129 |
linea->SetLineWidth(2); |
linea->SetLineWidth(2); |
| 5160 |
// |
// |
| 5161 |
// singlets X |
// singlets X |
| 5162 |
// |
// |
| 5163 |
for (Int_t sing = 0; sing < L2->nclsx(); sing++){ |
for (Int_t sing = 0; sing < L2->GetTrkLevel2()->nclsx(); sing++){ |
| 5164 |
TClonesArray &t = *(L2->SingletX); |
TClonesArray &t = *(L2->GetTrkLevel2()->SingletX); |
| 5165 |
TrkSinglet *singlet = (TrkSinglet*)t[sing]; |
TrkSinglet *singlet = (TrkSinglet*)t[sing]; |
| 5166 |
x = (singlet->coord[0]+singlet->coord[1])/2.; |
x = (singlet->coord[0]+singlet->coord[1])/2.; |
| 5167 |
// |
// |
| 5185 |
// |
// |
| 5186 |
// singlets Y |
// singlets Y |
| 5187 |
// |
// |
| 5188 |
for (Int_t sing = 0; sing < L2->nclsy(); sing++){ |
for (Int_t sing = 0; sing < L2->GetTrkLevel2()->nclsy(); sing++){ |
| 5189 |
TClonesArray &t = *(L2->SingletY); |
TClonesArray &t = *(L2->GetTrkLevel2()->SingletY); |
| 5190 |
TrkSinglet *singlet = (TrkSinglet*)t[sing]; |
TrkSinglet *singlet = (TrkSinglet*)t[sing]; |
| 5191 |
// |
// |
| 5192 |
Int_t planepad = (singlet->plane - 1)* 2; |
Int_t planepad = (singlet->plane - 1)* 2; |
| 5193 |
trkpad[planepad]->cd(); |
trkpad[planepad]->cd(); |
| 5194 |
trkpad[planepad]->Range(-7.05,0.,7.05,8.); |
trkpad[planepad]->Range(-7.05,0.,7.05,8.); |
| 5195 |
for (Int_t img=0; img<2; img++){ |
for (Int_t img=0; img<2; img++){ |
| 5196 |
x = singlet->coord[img]; |
x = -singlet->coord[img]; |
| 5197 |
Float_t xsig = singlet->sgnl; |
Float_t xsig = singlet->sgnl; |
| 5198 |
if ( xsig > 8. ) xsig = 8.; |
if ( xsig > 8. ) xsig = 8.; |
| 5199 |
// |
// |
| 5231 |
dcol = 2; |
dcol = 2; |
| 5232 |
}; |
}; |
| 5233 |
// |
// |
| 5234 |
if ( L2->GetNTracks() > 0 ){ |
if ( L2->GetTrkLevel2()->GetNTracks() > 0 ){ |
| 5235 |
for (Int_t nt = 0; nt < L2->GetNTracks(); nt++){ |
for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ |
| 5236 |
TrkTrack *track = L2->GetTrack(nt); |
PamTrack *ptrack= L2->GetTrack(nt); |
| 5237 |
|
TrkTrack *track = ptrack->GetTrkTrack(); |
| 5238 |
if ( nt == 0 ){ |
if ( nt == 0 ){ |
| 5239 |
var.rig = 0.; |
var.rig = 0.; |
| 5240 |
if ( track->al[4] != 0. ) var.rig = 1./track->al[4]; |
if ( track->al[4] != 0. ) var.rig = 1./track->al[4]; |
| 5249 |
trkpad[planepad]->Range(-8.1,0.,8.1,8.); |
trkpad[planepad]->Range(-8.1,0.,8.1,8.); |
| 5250 |
// |
// |
| 5251 |
x = track->xm[plane]; |
x = track->xm[plane]; |
| 5252 |
Float_t xsig = track->dedx_x[plane]; |
Float_t xsig = fabs(track->dedx_x[plane]); |
| 5253 |
if ( track->xgood[plane] ){ |
if ( track->XGood(plane) ){ |
| 5254 |
//if ( x > -100 ){ |
//if ( x > -100 ){ |
| 5255 |
if ( xsig > 8. ) xsig = 8.; |
if ( xsig > 8. ) xsig = 8.; |
| 5256 |
if ( var.bw ){ |
if ( var.bw ){ |
| 5258 |
} else { |
} else { |
| 5259 |
sigcol2 = 1; |
sigcol2 = 1; |
| 5260 |
}; |
}; |
| 5261 |
ColorTRKMIP(track->dedx_x[plane],sigcol2,0); |
ColorTRKMIP(fabs(track->dedx_x[plane]),sigcol2,0); |
| 5262 |
linea = new TLine(x,0.01,x,xsig); |
linea = new TLine(x,0.01,x,xsig); |
| 5263 |
linea->SetLineWidth(2); |
linea->SetLineWidth(2); |
| 5264 |
linea->SetLineColor(sigcol2); |
linea->SetLineColor(sigcol2); |
| 5278 |
planepad = plane * 2; |
planepad = plane * 2; |
| 5279 |
trkpad[planepad]->cd(); |
trkpad[planepad]->cd(); |
| 5280 |
trkpad[planepad]->Range(-7.05,0.,7.05,8.); |
trkpad[planepad]->Range(-7.05,0.,7.05,8.); |
| 5281 |
x = track->ym[plane]; |
x = -track->ym[plane]; |
| 5282 |
xsig = track->dedx_y[plane]; |
xsig = fabs(track->dedx_y[plane]); |
| 5283 |
if ( track->ygood[plane] ){ |
if ( track->YGood(plane) ){ |
| 5284 |
// if ( x > -100 ){ |
// if ( x > -100 ){ |
| 5285 |
if ( xsig > 8. ) xsig = 8.; |
if ( xsig > 8. ) xsig = 8.; |
| 5286 |
if ( var.bw ){ |
if ( var.bw ){ |
| 5288 |
} else { |
} else { |
| 5289 |
sigcol2 = 1; |
sigcol2 = 1; |
| 5290 |
}; |
}; |
| 5291 |
ColorTRKMIP(track->dedx_y[plane],sigcol2,0); |
ColorTRKMIP(fabs(track->dedx_y[plane]),sigcol2,0); |
| 5292 |
linea = new TLine(x,0.01,x,xsig); |
linea = new TLine(x,0.01,x,xsig); |
| 5293 |
linea->SetLineWidth(2); |
linea->SetLineWidth(2); |
| 5294 |
linea->SetLineColor(sigcol2); |
linea->SetLineColor(sigcol2); |
| 5330 |
// |
// |
| 5331 |
// first of all plot crosses relatives to tracks |
// first of all plot crosses relatives to tracks |
| 5332 |
// |
// |
| 5333 |
if ( L2->GetNTracks() > 0 ){ |
if ( L2->GetTrkLevel2()->GetNTracks() > 0 ){ |
| 5334 |
for (Int_t nt = 0; nt < L2->GetNTracks(); nt++){ |
// for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ |
| 5335 |
TrkTrack *track = L2->GetTrack(nt); |
// TrkTrack *track = L2->GetTrkLevel2()->GetTrack(nt); |
| 5336 |
|
for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ |
| 5337 |
|
PamTrack *ptrack= L2->GetTrack(nt); |
| 5338 |
|
TrkTrack *track = ptrack->GetTrkTrack(); |
| 5339 |
|
// |
| 5340 |
for (Int_t plane = 0; plane<6; plane++){ |
for (Int_t plane = 0; plane<6; plane++){ |
| 5341 |
// |
// |
| 5342 |
x = track->xm[plane]; |
x = track->xm[plane]; |
| 5343 |
Float_t y = track->ym[plane]; |
Float_t y = -track->ym[plane]; |
| 5344 |
Float_t xsig = track->dedx_x[plane]; |
Float_t xsig = fabs(track->dedx_x[plane]); |
| 5345 |
Float_t ysig = track->dedx_y[plane]; |
Float_t ysig = fabs(track->dedx_y[plane]); |
| 5346 |
// if ( x > -100 && y > -100. ){ |
// if ( x > -100 && y > -100. ){ |
| 5347 |
if ( track->xgood[plane] && track->ygood[plane] ){ |
if ( track->XGood(plane) && track->YGood(plane) ){ |
| 5348 |
if ( var.bw ){ |
if ( var.bw ){ |
| 5349 |
sigcol1 = -1; |
sigcol1 = -1; |
| 5350 |
sigcol2 = -1; |
sigcol2 = -1; |
| 5382 |
// |
// |
| 5383 |
// try to plot crosses relative to singlets |
// try to plot crosses relative to singlets |
| 5384 |
// |
// |
| 5385 |
if ( L2->nclsx() > 0 && L2->nclsy() > 0 ){ |
if ( L2->GetTrkLevel2()->nclsx() > 0 && L2->GetTrkLevel2()->nclsy() > 0 ){ |
| 5386 |
for (Int_t plane = 1; plane<7; plane++){ |
for (Int_t plane = 1; plane<7; plane++){ |
| 5387 |
// |
// |
| 5388 |
// 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: |
| 5396 |
TArrayF *array2 = new TArrayF(5000); |
TArrayF *array2 = new TArrayF(5000); |
| 5397 |
TArrayF *sigarrax = new TArrayF(5000); |
TArrayF *sigarrax = new TArrayF(5000); |
| 5398 |
TArrayF *sigarray = new TArrayF(5000); |
TArrayF *sigarray = new TArrayF(5000); |
| 5399 |
for (Int_t sing = 0; sing < L2->nclsx(); sing++){ |
for (Int_t sing = 0; sing < L2->GetTrkLevel2()->nclsx(); sing++){ |
| 5400 |
TClonesArray &t = *(L2->SingletX); |
TClonesArray &t = *(L2->GetTrkLevel2()->SingletX); |
| 5401 |
TrkSinglet *singlet = (TrkSinglet*)t[sing]; |
TrkSinglet *singlet = (TrkSinglet*)t[sing]; |
| 5402 |
if ( singlet->plane == plane ){ |
if ( singlet->plane == plane ){ |
| 5403 |
arrax->AddAt(((singlet->coord[0]+singlet->coord[1])/2.),totsx); |
arrax->AddAt(((singlet->coord[0]+singlet->coord[1])/2.),totsx); |
| 5426 |
totsx++; |
totsx++; |
| 5427 |
}; |
}; |
| 5428 |
}; |
}; |
| 5429 |
for (Int_t sing = 0; sing < L2->nclsy(); sing++){ |
for (Int_t sing = 0; sing < L2->GetTrkLevel2()->nclsy(); sing++){ |
| 5430 |
TClonesArray &t = *(L2->SingletY); |
TClonesArray &t = *(L2->GetTrkLevel2()->SingletY); |
| 5431 |
TrkSinglet *singlet = (TrkSinglet*)t[sing]; |
TrkSinglet *singlet = (TrkSinglet*)t[sing]; |
| 5432 |
if ( singlet->plane == plane ){ |
if ( singlet->plane == plane ){ |
| 5433 |
array1->AddAt(singlet->coord[0],totsy); |
array1->AddAt(singlet->coord[0],totsy); |
| 5462 |
for (Int_t sing = 0; sing < min(totsx,totsy); sing++){ |
for (Int_t sing = 0; sing < min(totsx,totsy); sing++){ |
| 5463 |
// |
// |
| 5464 |
x = arrax->At(orderx->At(sing)); |
x = arrax->At(orderx->At(sing)); |
| 5465 |
Float_t y1 = array1->At(ordery->At(sing)); |
Float_t y1 = -array1->At(ordery->At(sing)); |
| 5466 |
Float_t y2 = array2->At(ordery->At(sing)); |
Float_t y2 = -array2->At(ordery->At(sing)); |
| 5467 |
Float_t xsig = sigarrax->At(orderx->At(sing)); |
Float_t xsig = sigarrax->At(orderx->At(sing)); |
| 5468 |
Float_t ysig = sigarray->At(ordery->At(sing)); |
Float_t ysig = sigarray->At(ordery->At(sing)); |
| 5469 |
if ( x > -100 && y1 > -100. ){ |
if ( x > -100 && y1 > -100. ){ |
| 5556 |
for (Int_t m = 0; m<3; m++){ |
for (Int_t m = 0; m<3; m++){ |
| 5557 |
if ( trk->signcluster[l][m] != 0. ){ |
if ( trk->signcluster[l][m] != 0. ){ |
| 5558 |
if ( planeno == 10 ) { |
if ( planeno == 10 ) { |
|
x = 1024 - trk->addrcluster[l][m]; |
|
|
} else { |
|
| 5559 |
x = trk->addrcluster[l][m]; |
x = trk->addrcluster[l][m]; |
| 5560 |
|
} else { |
| 5561 |
|
x = 1024 - trk->addrcluster[l][m]; |
| 5562 |
}; |
}; |
| 5563 |
x += 1024.; |
x += 1024.; |
| 5564 |
if ( trk->signcluster[l][m]> ysig ){ |
if ( trk->signcluster[l][m]> ysig ){ |
| 5565 |
ysig = trk->signcluster[l][m]; |
ysig = trk->signcluster[l][m]; |
| 5566 |
yh1[ncro] = x-1024.; |
yh1[ncro] = x - 1024.; |
| 5567 |
yh2[ncro] = x; |
yh2[ncro] = x; |
| 5568 |
}; |
}; |
| 5569 |
}; |
}; |
| 5591 |
for (Int_t m = 0; m<3; m++){ |
for (Int_t m = 0; m<3; m++){ |
| 5592 |
if ( trk->signcluster[e][m] != 0. ){ |
if ( trk->signcluster[e][m] != 0. ){ |
| 5593 |
if ( planeno == 10 ) { |
if ( planeno == 10 ) { |
|
x = 1024 - trk->addrcluster[e][m]; |
|
|
} else { |
|
| 5594 |
x = trk->addrcluster[e][m]; |
x = trk->addrcluster[e][m]; |
| 5595 |
|
} else { |
| 5596 |
|
x = 1024 - trk->addrcluster[e][m]; |
| 5597 |
}; |
}; |
| 5598 |
x += 1024.; |
x += 1024.; |
| 5599 |
if ( trk->signcluster[e][m]> ysig ){ |
if ( trk->signcluster[e][m]> ysig ){ |
| 5600 |
ysig = trk->signcluster[e][m]; |
ysig = trk->signcluster[e][m]; |
| 5601 |
yh1[ncro] = x-1024.; |
yh1[ncro] = x - 1024.; |
| 5602 |
yh2[ncro] = x; |
yh2[ncro] = x; |
| 5603 |
}; |
}; |
| 5604 |
}; |
}; |
| 5650 |
|
|
| 5651 |
void FEVdetector::ShowTrack(){ |
void FEVdetector::ShowTrack(){ |
| 5652 |
// |
// |
| 5653 |
|
if ( level.file != 2 ) return; |
| 5654 |
// |
// |
| 5655 |
// |
// |
|
if ( !var.TRK || level.file != 2 ) return; |
|
| 5656 |
// |
// |
| 5657 |
if ( L2->GetNTracks() > 0 ){ |
if ( var.CALO && var.CALOT ){ |
| 5658 |
for (Int_t nt = 0; nt < L2->GetNTracks(); nt++){ |
if ( L2->GetCaloLevel2()->npcfit[0] > 0 && L2->GetCaloLevel2()->npcfit[1] > 0 ){ |
| 5659 |
TrkTrack *track = L2->GetTrack(nt); |
Float_t calx[22]; |
| 5660 |
|
Float_t caly[22]; |
| 5661 |
|
Float_t calzx[22]; |
| 5662 |
|
Float_t calzy[22]; |
| 5663 |
|
Float_t zpiano[22]; |
| 5664 |
|
zpiano[0] = (CTZ+118.)*var.sfy/1000.; |
| 5665 |
|
for (Int_t plane = 1; plane < 22; plane++){ |
| 5666 |
|
if ( !(plane%2) ){ |
| 5667 |
|
zpiano[plane] = zpiano[plane-1] - 8.09*var.sfy/1000.; |
| 5668 |
|
}else { |
| 5669 |
|
zpiano[plane] = zpiano[plane-1] - 10.09*var.sfy/1000.; |
| 5670 |
|
}; |
| 5671 |
|
}; |
| 5672 |
|
for (Int_t plane = 0; plane < 22; plane++){ |
| 5673 |
|
calx[plane] = (L2->GetCaloLevel2()->cbar[plane][0]/100.)*var.sfx + var.xxvc;; |
| 5674 |
|
caly[plane] = (-L2->GetCaloLevel2()->cbar[plane][1]/100.)*var.sfx + var.xyvc; |
| 5675 |
|
// calzx[plane] = zpiano[plane] -5.81*var.sfy/1000. + var.yxvc; |
| 5676 |
|
calzx[plane] = zpiano[plane] + var.yxvc; |
| 5677 |
|
calzy[plane] = zpiano[plane] + var.yyvc; |
| 5678 |
|
// printf(" calx %f caly %f calzx %f calzy %f \n",calx[plane],caly[plane],calzx[plane],calzy[plane]); |
| 5679 |
|
}; |
| 5680 |
|
// |
| 5681 |
|
// Calorimeter track |
| 5682 |
|
// |
| 5683 |
|
Int_t trcol = 30; |
| 5684 |
|
if ( var.bw ){ |
| 5685 |
|
trcol = 14; |
| 5686 |
|
} else { |
| 5687 |
|
trcol = 44; |
| 5688 |
|
}; |
| 5689 |
|
thefigure->cd(); |
| 5690 |
|
TPolyLine *trakx = new TPolyLine(22,calx,calzx); |
| 5691 |
|
trakx->SetLineColor(trcol); |
| 5692 |
|
if ( L2->GetCaloLevel2()->fitmode[0] == 1 ) trakx->SetLineStyle(3); |
| 5693 |
|
if ( L2->GetCaloLevel2()->fitmode[0] == 2 ) trakx->SetLineStyle(4); |
| 5694 |
|
trakx->SetLineWidth(2); |
| 5695 |
|
trakx->Draw(); |
| 5696 |
|
TPolyLine *traky = new TPolyLine(22,caly,calzy); |
| 5697 |
|
traky->SetLineColor(trcol); |
| 5698 |
|
if ( L2->GetCaloLevel2()->fitmode[1] == 1 ) traky->SetLineStyle(3); |
| 5699 |
|
if ( L2->GetCaloLevel2()->fitmode[1] == 2 ) traky->SetLineStyle(4); |
| 5700 |
|
traky->SetLineWidth(2); |
| 5701 |
|
traky->Draw(); |
| 5702 |
|
}; |
| 5703 |
|
if ( L2->GetCaloLevel2()->npcfit[2] > 0 ){ |
| 5704 |
|
Float_t calx[22]; |
| 5705 |
|
Float_t caly[22]; |
| 5706 |
|
Float_t calzx[22]; |
| 5707 |
|
Float_t calzy[22]; |
| 5708 |
|
Float_t zpiano[22]; |
| 5709 |
|
zpiano[0] = (CTZ+118.)*var.sfy/1000.; |
| 5710 |
|
for (Int_t plane = 1; plane < 22; plane++){ |
| 5711 |
|
if ( !(plane%2) ){ |
| 5712 |
|
zpiano[plane] = zpiano[plane-1] - 8.09*var.sfy/1000.; |
| 5713 |
|
}else { |
| 5714 |
|
zpiano[plane] = zpiano[plane-1] - 10.09*var.sfy/1000.; |
| 5715 |
|
}; |
| 5716 |
|
}; |
| 5717 |
|
// |
| 5718 |
|
// |
| 5719 |
|
CaloTrkVar *ctra = L2->GetCaloStoredTrack(-1); |
| 5720 |
|
// |
| 5721 |
|
for (Int_t plane = 0; plane < 22; plane++){ |
| 5722 |
|
calx[plane] = (ctra->tbar[plane][0]/100.)*var.sfx + var.xxvc;; |
| 5723 |
|
caly[plane] = (-ctra->tbar[plane][1]/100.)*var.sfx + var.xyvc; |
| 5724 |
|
// calzx[plane] = zpiano[plane] -5.81*var.sfy/1000. + var.yxvc; |
| 5725 |
|
calzx[plane] = zpiano[plane] + var.yxvc; |
| 5726 |
|
calzy[plane] = zpiano[plane] + var.yyvc; |
| 5727 |
|
// printf(" calx %f caly %f calzx %f calzy %f \n",calx[plane],caly[plane],calzx[plane],calzy[plane]); |
| 5728 |
|
}; |
| 5729 |
|
// |
| 5730 |
|
// Calorimeter track |
| 5731 |
|
// |
| 5732 |
|
Int_t trcol = 30; |
| 5733 |
|
if ( var.bw ){ |
| 5734 |
|
trcol = 16; |
| 5735 |
|
} else { |
| 5736 |
|
trcol = 46; |
| 5737 |
|
}; |
| 5738 |
|
thefigure->cd(); |
| 5739 |
|
TPolyLine *trakx = new TPolyLine(22,calx,calzx); |
| 5740 |
|
trakx->SetLineColor(trcol); |
| 5741 |
|
trakx->SetLineStyle(3); |
| 5742 |
|
trakx->SetLineWidth(2); |
| 5743 |
|
trakx->Draw(); |
| 5744 |
|
TPolyLine *traky = new TPolyLine(22,caly,calzy); |
| 5745 |
|
traky->SetLineColor(trcol); |
| 5746 |
|
traky->SetLineStyle(3); |
| 5747 |
|
traky->SetLineWidth(2); |
| 5748 |
|
traky->Draw(); |
| 5749 |
|
}; |
| 5750 |
|
}; |
| 5751 |
|
// |
| 5752 |
|
if ( !var.TRK ) return; |
| 5753 |
|
// |
| 5754 |
|
if ( L2->GetTrkLevel2()->GetNTracks() > 0 ){ |
| 5755 |
|
for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ |
| 5756 |
|
|
| 5757 |
|
// TrkTrack *track = L2->GetTrkLevel2()->GetTrack(nt); |
| 5758 |
|
// printf("qui \n"); |
| 5759 |
|
PamTrack *ptrack = L2->GetTrack(nt); |
| 5760 |
|
TrkTrack *track = ptrack->GetTrkTrack(); |
| 5761 |
|
// printf("qua \n"); |
| 5762 |
Int_t npoint = 100; |
Int_t npoint = 100; |
| 5763 |
Float_t zin[100]; |
Float_t zin[100]; |
| 5764 |
Double_t xout[100]; |
Double_t xout[100]; |
| 5807 |
// |
// |
| 5808 |
Trajectory *tr = new Trajectory(npoint,zin); |
Trajectory *tr = new Trajectory(npoint,zin); |
| 5809 |
// |
// |
| 5810 |
ifail = track->DoTrack2(tr); |
// ifail = track->DoTrack2(tr); |
| 5811 |
|
ifail = track->DoTrack(tr); |
| 5812 |
// |
// |
| 5813 |
if ( !ifail ){ |
if ( !ifail ){ |
| 5814 |
for ( Int_t e = 0; e < npoint ; e++) { |
for ( Int_t e = 0; e < npoint ; e++) { |
| 5815 |
tx[e] = ((float)tr->x[e]/100.)*var.sfx + var.xxvc; |
tx[e] = ((float)tr->x[e]/100.)*var.sfx + var.xxvc; |
| 5816 |
ty[e] = ((float)tr->y[e]/100.)*var.sfx + var.xyvc; |
ty[e] = (-(float)tr->y[e]/100.)*var.sfx + var.xyvc; |
| 5817 |
if ( e < 50 ) { |
if ( e < 50 ) { |
| 5818 |
ptx1[e] = ((float)tr->y[e]/100.)*var.sfx + var.xcat; |
ptx1[e] = (-(float)tr->y[e]/100.)*var.sfx + var.xcat; |
| 5819 |
pty1[e] = ((float)tr->x[e]/100.)*var.sfy + var.ycat; |
pty1[e] = ((float)tr->x[e]/100.)*var.sfy + var.ycat; |
| 5820 |
} else { |
} else { |
| 5821 |
ptx2[e-50] = ((float)tr->y[e]/100.)*var.sfx + var.xcat; |
ptx2[e-50] = (-(float)tr->y[e]/100.)*var.sfx + var.xcat; |
| 5822 |
pty2[e-50] = ((float)tr->x[e]/100.)*var.sfy + var.ycat; |
pty2[e-50] = ((float)tr->x[e]/100.)*var.sfy + var.ycat; |
| 5823 |
}; |
}; |
| 5824 |
if ( e > 84 ) { |
if ( e > 84 ) { |
| 5825 |
tx1[e-85] = ((float)tr->x[e]/100.)*var.nds4 + var.xxvc; |
tx1[e-85] = ((float)tr->x[e]/100.)*var.nds4 + var.xxvc; |
| 5826 |
ty1[e-85] = ((float)tr->y[e]/100.)*var.nds4 + var.xyvc; |
ty1[e-85] = (-(float)tr->y[e]/100.)*var.nds4 + var.xyvc; |
| 5827 |
tzx1[e-85] = (0.112)*var.sfy+((float)zin[e]/100.)*var.sfy + var.yxvc; |
tzx1[e-85] = (0.112)*var.sfy+((float)zin[e]/100.)*var.sfy + var.yxvc; |
| 5828 |
tzy1[e-85] = (0.112)*var.sfy+((float)zin[e]/100.)*var.sfy + var.yyvc; |
tzy1[e-85] = (0.112)*var.sfy+((float)zin[e]/100.)*var.sfy + var.yyvc; |
| 5829 |
}; |
}; |
| 5830 |
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; |
| 5831 |
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; |
| 5832 |
|
// printf("tx[e] %f ty [e] %f tzx %f tzy %f \n",tx[e],ty[e],tzx[e],tzy[e]); |
| 5833 |
}; |
}; |
| 5834 |
// |
// |
| 5835 |
// From S1 to CALO |
// From S1 to CALO |
| 5967 |
Int_t se = 5; |
Int_t se = 5; |
| 5968 |
if ( !l && m%2 == 0 ) se = 3; |
if ( !l && m%2 == 0 ) se = 3; |
| 5969 |
if ( !l && m%2 != 0 ) se = 2; |
if ( !l && m%2 != 0 ) se = 2; |
| 5970 |
if ( l && m%2 == 0 ) se = 1; |
if ( l && m%2 != 0 ) se = 1; |
| 5971 |
if ( l && m%2 != 0 ) se = 0; |
if ( l && m%2 == 0 ) se = 0; |
| 5972 |
// |
// |
| 5973 |
// determine what kind of event we are going to analyze |
// determine what kind of event we are going to analyze |
| 5974 |
// |
// |
| 6063 |
Xview->Draw("box same"); |
Xview->Draw("box same"); |
| 6064 |
}; |
}; |
| 6065 |
if ( l == 1 ) { |
if ( l == 1 ) { |
| 6066 |
Yview->Fill(n,21-m,1.); |
Yview->Fill(95-n,21-m,1.); |
| 6067 |
pd2->cd(); |
pd2->cd(); |
| 6068 |
Yview->Draw("box same"); |
Yview->Draw("box same"); |
| 6069 |
}; |
}; |
| 6083 |
// |
// |
| 6084 |
// Define variables |
// Define variables |
| 6085 |
// |
// |
| 6086 |
Int_t etime = var.etime; |
UInt_t etime = var.etime; |
| 6087 |
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]; |
| 6088 |
Int_t badstrip = 0; |
Int_t badstrip = 0; |
| 6089 |
qtot = 0.; |
qtot = 0.; |
| 6155 |
if ( calib.ttime[s][b[s]+1] && calib.time[s][b[s]] ){ |
if ( calib.ttime[s][b[s]+1] && calib.time[s][b[s]] ){ |
| 6156 |
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 ){ |
| 6157 |
printf(" CALORIMETER: \n" ); |
printf(" CALORIMETER: \n" ); |
| 6158 |
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]); |
| 6159 |
printf(" END CALORIMETER. \n\n" ); |
printf(" END CALORIMETER. \n\n" ); |
| 6160 |
b[s]++; |
b[s]++; |
| 6161 |
CaloPede(s); |
CaloPede(s); |
| 6175 |
Int_t se = 5; |
Int_t se = 5; |
| 6176 |
if (l == 0 && m%2 == 0) se = 3; |
if (l == 0 && m%2 == 0) se = 3; |
| 6177 |
if (l == 0 && m%2 != 0) se = 2; |
if (l == 0 && m%2 != 0) se = 2; |
| 6178 |
if (l == 1 && m%2 == 0) se = 1; |
if (l == 1 && m%2 != 0) se = 1; |
| 6179 |
if (l == 1 && m%2 != 0) se = 0; |
if (l == 1 && m%2 == 0) se = 0; |
| 6180 |
// |
// |
| 6181 |
// determine what kind of event we are going to analyze |
// determine what kind of event we are going to analyze |
| 6182 |
// |
// |
| 6292 |
Xview->Draw("box same"); |
Xview->Draw("box same"); |
| 6293 |
}; |
}; |
| 6294 |
if ( l == 1 ) { |
if ( l == 1 ) { |
| 6295 |
Yview->Fill(n,21-m,1.); |
Yview->Fill(96-n,21-m,1.); |
| 6296 |
pd2->cd(); |
pd2->cd(); |
| 6297 |
Yview->Draw("box same"); |
Yview->Draw("box same"); |
| 6298 |
}; |
}; |
| 6379 |
// |
// |
| 6380 |
stringstream xvev; |
stringstream xvev; |
| 6381 |
stringstream yvev; |
stringstream yvev; |
| 6382 |
for (Int_t ii = 0; ii < L2->nstrip; ii++){ |
for (Int_t ii = 0; ii < L2->GetCaloLevel2()->nstrip; ii++){ |
| 6383 |
Int_t colo; |
Int_t colo; |
| 6384 |
Int_t l; |
Int_t l; |
| 6385 |
Int_t m; |
Int_t m; |
| 6386 |
Int_t n; |
Int_t n; |
| 6387 |
Float_t mip = L2->DecodeEstrip(ii,l,m,n); |
Bool_t satura = false; |
| 6388 |
|
Float_t mip = L2->GetCaloLevel1()->DecodeEstrip(ii,l,m,n,satura); |
| 6389 |
if ( var.bw ){ |
if ( var.bw ){ |
| 6390 |
colo = -1; |
colo = -1; |
| 6391 |
} else { |
} else { |
| 6392 |
colo = 1; |
colo = 1; |
| 6393 |
}; |
}; |
| 6394 |
ColorMIP(mip,colo); |
ColorMIP(mip,colo); |
| 6395 |
if ( l == 0 ) { |
if ( l == 0 ) { |
| 6396 |
xvev.str(""); |
xvev.str(""); |
| 6399 |
xvev << " " << l; |
xvev << " " << l; |
| 6400 |
gDirectory->Delete(xvev.str().c_str()); |
gDirectory->Delete(xvev.str().c_str()); |
| 6401 |
TH2F *Xview = new TH2F(xvev.str().c_str(),"",96,-0.5,95.5,22,-0.5,21.5); |
TH2F *Xview = new TH2F(xvev.str().c_str(),"",96,-0.5,95.5,22,-0.5,21.5); |
| 6402 |
Xview->SetFillColor(colo); |
if ( satura ){ |
| 6403 |
|
Xview->SetFillColor(kBlack); |
| 6404 |
|
} else { |
| 6405 |
|
Xview->SetFillColor(colo); |
| 6406 |
|
}; |
| 6407 |
Xview->Fill(n,21-m,1.); |
Xview->Fill(n,21-m,1.); |
| 6408 |
pd1->cd(); |
pd1->cd(); |
| 6409 |
Xview->Draw("box same"); |
Xview->Draw("box same"); |
| 6415 |
yvev << " " << l; |
yvev << " " << l; |
| 6416 |
gDirectory->Delete(yvev.str().c_str()); |
gDirectory->Delete(yvev.str().c_str()); |
| 6417 |
TH2F *Yview = new TH2F(yvev.str().c_str(),"",96,-0.5,95.5,22,-0.5,21.5); |
TH2F *Yview = new TH2F(yvev.str().c_str(),"",96,-0.5,95.5,22,-0.5,21.5); |
| 6418 |
Yview->SetFillColor(colo); |
if ( satura ){ |
| 6419 |
Yview->Fill(n,21-m,1.); |
Yview->SetFillColor(kBlack); |
| 6420 |
|
} else { |
| 6421 |
|
Yview->SetFillColor(colo); |
| 6422 |
|
}; |
| 6423 |
|
Yview->Fill(96-n,21-m,1.); |
| 6424 |
pd2->cd(); |
pd2->cd(); |
| 6425 |
Yview->Draw("box same"); |
Yview->Draw("box same"); |
| 6426 |
}; |
}; |
| 6427 |
}; |
}; |
| 6428 |
pd1->Update(); |
pd1->Update(); |
| 6429 |
pd2->Update(); |
pd2->Update(); |
| 6430 |
var.qtot=(int)L2->qtot; |
var.qtot=(int)L2->GetCaloLevel2()->qtot; |
| 6431 |
var.nstrip=(int)L2->nstrip; |
var.nstrip=(int)L2->GetCaloLevel2()->nstrip; |
| 6432 |
}; |
}; |
| 6433 |
} |
} |
| 6434 |
|
|
| 6469 |
for (Int_t d = 0; d<48; d++){ |
for (Int_t d = 0; d<48; d++){ |
| 6470 |
if ( calib.ttime[s][d] != 0 ) calibex++; |
if ( calib.ttime[s][d] != 0 ) calibex++; |
| 6471 |
if ( calib.time[s][0] != 0 ){ |
if ( calib.time[s][0] != 0 ){ |
| 6472 |
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]); |
| 6473 |
if ( calib.time[s][d+1] != 0 ) { |
if ( calib.time[s][d+1] != 0 ) { |
| 6474 |
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]); |
| 6475 |
} else { |
} else { |
| 6476 |
if ( !stop ){ |
if ( !stop ){ |
| 6477 |
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]); |
| 6478 |
stop = 1; |
stop = 1; |
| 6479 |
}; |
}; |
| 6480 |
}; |
}; |
| 6481 |
} else { |
} else { |
| 6482 |
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]); |
| 6483 |
}; |
}; |
| 6484 |
}; |
}; |
| 6485 |
printf("\n"); |
printf("\n"); |
| 6544 |
calib.ttime[s][inter] = 0; |
calib.ttime[s][inter] = 0; |
| 6545 |
if ( ce->cstwerr[s] != 0 && ce->cperror[s] == 0 ) { |
if ( ce->cstwerr[s] != 0 && ce->cperror[s] == 0 ) { |
| 6546 |
//calib.ttime[s][inter] = cph->GetOrbitalTime(); |
//calib.ttime[s][inter] = cph->GetOrbitalTime(); |
| 6547 |
calib.ttime[s][inter] = cph->OrbitalTime; |
calib.ttime[s][inter] = (UInt_t)cph->OrbitalTime; |
| 6548 |
inter++; |
inter++; |
| 6549 |
} else { |
} else { |
| 6550 |
if ( ce->cstwerr[s] != 0 && ce->cperror[s] != 0 ) { |
if ( ce->cstwerr[s] != 0 && ce->cperror[s] != 0 ) { |
| 6598 |
tr->GetEntry(ci); |
tr->GetEntry(ci); |
| 6599 |
cph = ceh->GetPscuHeader(); |
cph = ceh->GetPscuHeader(); |
| 6600 |
//if ( atime == cph->GetOrbitalTime()){ |
//if ( atime == cph->GetOrbitalTime()){ |
| 6601 |
if ( atime == cph->OrbitalTime){ |
if ( atime == (UInt_t)cph->OrbitalTime){ |
| 6602 |
// calib.iev = ce->iev; |
// calib.iev = ce->iev; |
| 6603 |
if (ce->cstwerr[s] != 0 && ce->cperror[s] == 0 ) { |
if (ce->cstwerr[s] != 0 && ce->cperror[s] == 0 ) { |
| 6604 |
for ( Int_t d=0 ; d<11 ;d++ ){ |
for ( Int_t d=0 ; d<11 ;d++ ){ |