| 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::checkctrlword(){ |
void FEVdetector::checkctrlword(){ |
| 101 |
var.SHOWDEC = 0; |
var.SHOWDEC = 0; |
| 102 |
var.TOF = 0; |
var.TOF = 0; |
| 103 |
var.AC = 0; |
var.AC = 0; |
| 104 |
|
var.RUN = 1; |
| 105 |
var.TRK = 0; |
var.TRK = 0; |
| 106 |
|
var.ORB = 1; |
| 107 |
|
var.TRG = 1; |
| 108 |
var.CALO = 0; |
var.CALO = 0; |
| 109 |
|
var.CALOT = 0; |
| 110 |
var.S4 = 0; |
var.S4 = 0; |
| 111 |
var.ND = 0; |
var.ND = 0; |
| 112 |
var.INFOS = 0; |
var.INFOS = 0; |
| 141 |
}; |
}; |
| 142 |
} |
} |
| 143 |
|
|
| 144 |
|
void FEVdetector::SetDDEC(TString de){ |
| 145 |
|
ddec=de; |
| 146 |
|
}; |
| 147 |
|
|
| 148 |
void FEVdetector::GetWindow(){ |
void FEVdetector::GetWindow(){ |
| 149 |
otr->GetEntry(maxevent); |
// |
| 150 |
|
if ( level.file == 2 ){ |
| 151 |
|
// printf("0qui\n"); |
| 152 |
|
L2->GetEntry(minevent); |
| 153 |
|
} else { |
| 154 |
|
otr->GetEntry(minevent); |
| 155 |
|
} |
| 156 |
if ( level.file < 2 ){ |
if ( level.file < 2 ){ |
| 157 |
ph = eh->GetPscuHeader(); |
ph = eh->GetPscuHeader(); |
| 158 |
lastevno = (int)ph->Counter; |
firstevno = (int)ph->Counter; |
| 159 |
} else { |
} else { |
| 160 |
lastevno = oinfoL2->pkt_num; // to be changed as soon as we will have pkt_counter in the level2 file! |
if ( var.ORB ){ |
| 161 |
|
firstevno = L2->GetOrbitalInfo()->pkt_num; |
| 162 |
|
} else { |
| 163 |
|
firstevno = 0; |
| 164 |
|
}; |
| 165 |
}; |
}; |
| 166 |
otr->GetEntry(minevent); |
// |
| 167 |
|
if ( level.file == 2 ){ |
| 168 |
|
// printf("1qui\n"); |
| 169 |
|
L2->GetEntry(maxevent); |
| 170 |
|
} else { |
| 171 |
|
otr->GetEntry(maxevent); |
| 172 |
|
} |
| 173 |
|
// |
| 174 |
if ( level.file < 2 ){ |
if ( level.file < 2 ){ |
| 175 |
ph = eh->GetPscuHeader(); |
ph = eh->GetPscuHeader(); |
| 176 |
firstevno = (int)ph->Counter; |
lastevno = (int)ph->Counter; |
| 177 |
} else { |
} else { |
| 178 |
firstevno = oinfoL2->pkt_num; // to be changed as soon as we will have pkt_counter in the level2 file! |
if ( var.ORB ){ |
| 179 |
|
lastevno = L2->GetOrbitalInfo()->pkt_num; |
| 180 |
|
} else { |
| 181 |
|
lastevno = 0; |
| 182 |
|
}; |
| 183 |
}; |
}; |
| 184 |
|
// |
| 185 |
} |
} |
| 186 |
|
|
| 187 |
void FEVdetector::ClearVariables(){ |
void FEVdetector::ClearVariables(){ |
| 204 |
} |
} |
| 205 |
|
|
| 206 |
void FEVdetector::GetEntry(Int_t i){ |
void FEVdetector::GetEntry(Int_t i){ |
| 207 |
thisentry = i; |
thisentry = i; |
| 208 |
otr->GetEntry(i); |
if ( level.file == 2 ){ |
| 209 |
|
L2->Clear(); |
| 210 |
|
// printf("qui\n"); |
| 211 |
|
L2->GetEntry(i); |
| 212 |
|
if ( var.showall ){ |
| 213 |
|
ShowInfo("RunInfo"); |
| 214 |
|
ShowInfo("SoftInfo"); |
| 215 |
|
ShowInfo("OrbitalInfo"); |
| 216 |
|
ShowInfo("TrigLevel2"); |
| 217 |
|
ShowInfo("ToFLevel2"); |
| 218 |
|
ShowInfo("TrkLevel2"); |
| 219 |
|
ShowInfo("AcLevel2"); |
| 220 |
|
ShowInfo("CaloLevel2"); |
| 221 |
|
ShowInfo("CaloLevel1"); |
| 222 |
|
ShowInfo("S4Level2"); |
| 223 |
|
ShowInfo("NDLevel2"); |
| 224 |
|
} else { |
| 225 |
|
if ( var.showrun ) ShowInfo("RunInfo"); |
| 226 |
|
if ( var.showsi ) ShowInfo("SoftInfo"); |
| 227 |
|
if ( var.showorb ) ShowInfo("OrbitalInfo"); |
| 228 |
|
if ( var.showtrg ) ShowInfo("TrigLevel2"); |
| 229 |
|
if ( var.showtof ) ShowInfo("ToFLevel2"); |
| 230 |
|
if ( var.showtrk ) ShowInfo("TrkLevel2"); |
| 231 |
|
if ( var.showac ) ShowInfo("AcLevel2"); |
| 232 |
|
if ( var.showcal ) ShowInfo("CaloLevel2"); |
| 233 |
|
if ( var.showcal ) ShowInfo("CaloLevel1"); |
| 234 |
|
if ( var.shows4 ) ShowInfo("S4Level2"); |
| 235 |
|
if ( var.shownd ) ShowInfo("NDLevel2"); |
| 236 |
|
}; |
| 237 |
|
} else { |
| 238 |
|
otr->GetEntry(i); |
| 239 |
|
if ( var.showall ){ |
| 240 |
|
ShowInfo("Pscu"); |
| 241 |
|
ShowInfo("Trigger"); |
| 242 |
|
ShowInfo("Tof"); |
| 243 |
|
ShowInfo("Tracker"); |
| 244 |
|
ShowInfo("Anticounter"); |
| 245 |
|
ShowInfo("Calorimeter"); |
| 246 |
|
ShowInfo("S4"); |
| 247 |
|
ShowInfo("Neutron"); |
| 248 |
|
} else { |
| 249 |
|
if ( var.showorb ) ShowInfo("Pscu"); |
| 250 |
|
if ( var.showtrg ) ShowInfo("Trigger"); |
| 251 |
|
if ( var.showtof ) ShowInfo("Tof"); |
| 252 |
|
if ( var.showtrk ) ShowInfo("Tracker"); |
| 253 |
|
if ( var.showac ) ShowInfo("Anticounter"); |
| 254 |
|
if ( var.showcal ) ShowInfo("Calorimeter"); |
| 255 |
|
if ( var.shows4 ) ShowInfo("S4"); |
| 256 |
|
if ( var.shownd ) ShowInfo("Neutron"); |
| 257 |
|
}; |
| 258 |
|
}; |
| 259 |
} |
} |
| 260 |
|
|
| 261 |
void FEVdetector::SetEntry(Int_t i){ |
void FEVdetector::SetEntry(Int_t i){ |
| 268 |
return((int)ph->Counter); |
return((int)ph->Counter); |
| 269 |
} else { |
} else { |
| 270 |
// 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! |
| 271 |
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! |
| 272 |
}; |
}; |
| 273 |
} |
} |
| 274 |
|
|
| 376 |
}; |
}; |
| 377 |
} |
} |
| 378 |
|
|
| 379 |
|
void FEVdetector::ShowInfo(TString detector){ |
| 380 |
|
// |
| 381 |
|
TBranch *b1 = 0; |
| 382 |
|
// TBranch *b3 = 0; |
| 383 |
|
TObjArray *branch_array = 0; |
| 384 |
|
// TObjArray *leaf_array = 0; |
| 385 |
|
// |
| 386 |
|
if ( !strcmp(detector.Data(),"RunInfo") || !strcmp(detector.Data(),"SoftInfo") ){ |
| 387 |
|
if ( L2->GetRunTree() ) b1 = L2->GetRunTree()->FindBranch(detector.Data()); |
| 388 |
|
} else { |
| 389 |
|
b1 = otr->FindBranch(detector.Data()); |
| 390 |
|
}; |
| 391 |
|
// |
| 392 |
|
if ( !b1 ) return; |
| 393 |
|
// |
| 394 |
|
Int_t dlen = 10; |
| 395 |
|
// |
| 396 |
|
char o[200000]; |
| 397 |
|
char col[13]; |
| 398 |
|
char col2[13]; |
| 399 |
|
// |
| 400 |
|
setcolor(col,RESET, GREEN, WHITE); |
| 401 |
|
sprintf(o,"%s======> EVENT:%i\n",col, thisentry); |
| 402 |
|
// |
| 403 |
|
setcolor(col,RESET, RED, WHITE); |
| 404 |
|
sprintf(o,"%s%sBranch %s\n",o,col,b1->GetName()); |
| 405 |
|
setcolor(col,RESET, BLACK, WHITE); |
| 406 |
|
sprintf(o,"%s%s",o,col); |
| 407 |
|
// |
| 408 |
|
branch_array = b1->GetListOfBranches(); |
| 409 |
|
// |
| 410 |
|
Int_t j = 0; |
| 411 |
|
// |
| 412 |
|
for(Int_t l=0;l<(branch_array->GetLast()+1);l++){ |
| 413 |
|
// |
| 414 |
|
TBranchElement *tb = (TBranchElement*)branch_array->At(l); |
| 415 |
|
Int_t type = tb->GetType(); |
| 416 |
|
Int_t atype = tb->GetStreamerType() - 20; |
| 417 |
|
Int_t len = (tb->GetInfo()->GetLengths())[tb->GetID()]; |
| 418 |
|
Int_t length = min(len,dlen); |
| 419 |
|
// |
| 420 |
|
// printf("Branches : type is %i type is %i tb getname %s slen %i slength %i\n",atype,type,tb->GetName(),len,length); |
| 421 |
|
switch (type){ |
| 422 |
|
case 0: |
| 423 |
|
// |
| 424 |
|
// IS A VARIABLE |
| 425 |
|
// |
| 426 |
|
// |
| 427 |
|
// NAME |
| 428 |
|
// |
| 429 |
|
setcolor(col,RESET, BLUE, WHITE); |
| 430 |
|
setcolor(col2,RESET, BLACK, WHITE); |
| 431 |
|
sprintf(o,"%s%s %-15s%s =",o,col,((TBranch*)branch_array->At(l))->GetName(),col2); |
| 432 |
|
// |
| 433 |
|
j = 0; |
| 434 |
|
// |
| 435 |
|
// VALUES |
| 436 |
|
// |
| 437 |
|
// |
| 438 |
|
// Integer |
| 439 |
|
// |
| 440 |
|
if ( atype == 3 || atype == -17 ){ |
| 441 |
|
while ( j < length ){ |
| 442 |
|
if ( j < length -1 ){ |
| 443 |
|
sprintf(o,"%s %i ,",o,(Int_t)tb->GetValue(j,0)); |
| 444 |
|
} else { |
| 445 |
|
sprintf(o,"%s %i",o,(Int_t)tb->GetValue(j,0)); |
| 446 |
|
}; |
| 447 |
|
j++; |
| 448 |
|
}; |
| 449 |
|
}; |
| 450 |
|
// |
| 451 |
|
// Unsigned integer |
| 452 |
|
// |
| 453 |
|
if ( atype == -7 || atype == 13 || atype == -9 || atype == -8 || atype == 12 ){ |
| 454 |
|
while ( j < length ){ |
| 455 |
|
if ( j < length -1 ){ |
| 456 |
|
sprintf(o,"%s %u ,",o,(UInt_t)tb->GetValue(j,0)); |
| 457 |
|
} else { |
| 458 |
|
sprintf(o,"%s %u",o,(UInt_t)tb->GetValue(j,0)); |
| 459 |
|
}; |
| 460 |
|
j++; |
| 461 |
|
}; |
| 462 |
|
}; |
| 463 |
|
// |
| 464 |
|
// Float |
| 465 |
|
// |
| 466 |
|
if ( atype == -15 || atype == 5 ){ |
| 467 |
|
while ( j < length ){ |
| 468 |
|
if ( j < length -1 ){ |
| 469 |
|
sprintf(o,"%s %f ,",o,tb->GetValue(j,0)); |
| 470 |
|
} else { |
| 471 |
|
sprintf(o,"%s %f",o,tb->GetValue(j,0)); |
| 472 |
|
}; |
| 473 |
|
j++; |
| 474 |
|
}; |
| 475 |
|
}; |
| 476 |
|
// |
| 477 |
|
// Strings |
| 478 |
|
// |
| 479 |
|
if ( atype == 45 ){ |
| 480 |
|
// TObjArray *cl = (TObjArray*)(tb->GetInfo()->GetOffsets())[tb->GetID()];//tb->GetValuePointer(); |
| 481 |
|
// TString *stringa = (TString*)(*cl)[0]; |
| 482 |
|
// TBranchElement *utb = (TBranchElement*)tb->GetBranchCount(); |
| 483 |
|
// TString** stringa = (TString*)(&tb->GetValuePointer()); |
| 484 |
|
//TStreamerElement *tste = (TStreamerElement*)tb->GetInfo()->GetCurrentElement(); |
| 485 |
|
|
| 486 |
|
// char *ladd; |
| 487 |
|
// ladd = tb->GetValuePointer() |
| 488 |
|
// TString *stringa = (TString*)((tste->GetOffset())); |
| 489 |
|
// TString& mstr = *stringa; |
| 490 |
|
// printf(" la mia stringa %s \n",mstr.Data()); |
| 491 |
|
// printf(" offset %i \n",(Int_t)utb->GetValue(0,0)); |
| 492 |
|
// int pointer = (tb->GetInfo()->GetOffsets())[tb->GetID()]; |
| 493 |
|
// TString *stringa = (TString*)(tb->GetInfo()->GetOffsets())[tb->GetID()]; |
| 494 |
|
// TString *stringa = (TString*)tb->GetAddress(); |
| 495 |
|
// printf(" address 0x%X \n",tb->GetAddress()); |
| 496 |
|
// printf(" pointer 0x%X \n",tb->GetValuePointer()); |
| 497 |
|
// printf(" object 0x%X \n",tb->GetObject()); |
| 498 |
|
// printf("stringa %s lung %i\n",stringa.Data(),stringa.Length()); |
| 499 |
|
// TLeaf *striglia = tb->FindLeaf(tb->GetName()); |
| 500 |
|
// if ( striglia ){ |
| 501 |
|
// char *pointer = (char *)striglia->GetValuePointer(); |
| 502 |
|
// TString *pr= (TString*)pointer; |
| 503 |
|
// printf("ciao %s \n",pr->Data()); |
| 504 |
|
// }; |
| 505 |
|
sprintf(o,"%s TString - not implemented yet -",o); |
| 506 |
|
}; |
| 507 |
|
// |
| 508 |
|
// TArray |
| 509 |
|
// |
| 510 |
|
if ( atype == 42 ){ |
| 511 |
|
// |
| 512 |
|
// TObjArray *cl = (TObjArray*)tb->GetObject(); |
| 513 |
|
// // |
| 514 |
|
// TClass *myc = cl->IsA(); |
| 515 |
|
// // |
| 516 |
|
// printf("qui \n"); |
| 517 |
|
// // |
| 518 |
|
// // determine offset to fetch data |
| 519 |
|
// // |
| 520 |
|
// int thisoffset = 0; |
| 521 |
|
// TRealData *rd = myc->GetRealData(tb->GetName()); |
| 522 |
|
// if ( rd ){ |
| 523 |
|
// thisoffset = rd->GetThisOffset(); |
| 524 |
|
// }; |
| 525 |
|
// Int_t niente = 0; |
| 526 |
|
// TStreamerElement *tste = tb->GetInfo()->GetStreamerElement(rd->GetName(),niente); |
| 527 |
|
// printf(" typename %s \n",tste->GetTypeName()); |
| 528 |
|
// // |
| 529 |
|
// // TArrayI |
| 530 |
|
// // |
| 531 |
|
// if ( !strcmp(tste->GetTypeName(),"TArrayI") ){ |
| 532 |
|
// // |
| 533 |
|
// printf("qua \n"); |
| 534 |
|
// char *pointer = (char*)cl->At(0); |
| 535 |
|
// // char *pu = thisoffset + pointer; |
| 536 |
|
// int pu = (int)tste->GetTObjectOffset(); |
| 537 |
|
// TArrayI arr = (TArrayI)*pu; |
| 538 |
|
// // TArrayI arr = (TArrayI)(thisoffset); |
| 539 |
|
// //TArrayI *arr = (TArrayI*)pu; |
| 540 |
|
// //TArraI arr = (TArrayI) |
| 541 |
|
// Int_t jj=0; |
| 542 |
|
// j=0; |
| 543 |
|
// printf("quii \n"); |
| 544 |
|
// Int_t arlen = min(arr.GetSize(),dlen); |
| 545 |
|
// // |
| 546 |
|
// printf("que \n"); |
| 547 |
|
// setcolor(col,RESET, BLUE, WHITE); |
| 548 |
|
// setcolor(col2,RESET, BLACK, WHITE); |
| 549 |
|
// sprintf(o,"%s%s %s[%i]%s = ",o,col,tb->GetName(),arr.GetSize(),col2); |
| 550 |
|
// // |
| 551 |
|
// // while ( j < tb->GetNdata() ){ |
| 552 |
|
// // |
| 553 |
|
// printf("quo \n"); |
| 554 |
|
// // pointer = (char*)cl->UncheckedAt(j); |
| 555 |
|
// // pu = pointer + thisoffset; |
| 556 |
|
// // arr = (TArrayI*)(thisoffset); |
| 557 |
|
// // |
| 558 |
|
// while ( jj < arlen ){ |
| 559 |
|
// if ( jj < arlen-1 ){ |
| 560 |
|
// sprintf(o,"%s %i ,",o,arr.At(jj)); |
| 561 |
|
// } else { |
| 562 |
|
// sprintf(o,"%s %i",o,arr.At(jj)); |
| 563 |
|
// }; |
| 564 |
|
// jj++; |
| 565 |
|
// }; |
| 566 |
|
// // if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); |
| 567 |
|
// // j++; |
| 568 |
|
// // }; |
| 569 |
|
// }; |
| 570 |
|
// // |
| 571 |
|
// // TArrayF |
| 572 |
|
// // |
| 573 |
|
// if ( !strcmp(tste->GetTypeName(),"TArrayF") ){ |
| 574 |
|
// // |
| 575 |
|
// char *pointer = (char*)cl->UncheckedAt(0); |
| 576 |
|
// char *pu = pointer + thisoffset; |
| 577 |
|
// TArrayF *arr = (TArrayF*)(pu); |
| 578 |
|
// Int_t jj=0; |
| 579 |
|
// Int_t arlen = min(arr->GetSize(),dlen); |
| 580 |
|
// // |
| 581 |
|
// setcolor(col,RESET, BLUE, WHITE); |
| 582 |
|
// setcolor(col2,RESET, BLACK, WHITE); |
| 583 |
|
// sprintf(o,"%s%s %s[%i]%s = ",o,col,tb->GetName(),arr->GetSize(),col2); |
| 584 |
|
// // |
| 585 |
|
// while ( j < tb->GetNdata() ){ |
| 586 |
|
// // |
| 587 |
|
// pointer = (char*)cl->UncheckedAt(j); |
| 588 |
|
// pu = pointer + thisoffset; |
| 589 |
|
// arr = (TArrayF*)(pu); |
| 590 |
|
// // |
| 591 |
|
// while ( jj < arlen ){ |
| 592 |
|
// if ( jj < arlen-1 ){ |
| 593 |
|
// sprintf(o,"%s %f ,",o,arr->At(jj)); |
| 594 |
|
// } else { |
| 595 |
|
// sprintf(o,"%s %f",o,arr->At(jj)); |
| 596 |
|
// }; |
| 597 |
|
// jj++; |
| 598 |
|
// }; |
| 599 |
|
// if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); |
| 600 |
|
// j++; |
| 601 |
|
// }; |
| 602 |
|
// }; |
| 603 |
|
// sprintf(o,"%s\n",o); |
| 604 |
|
// |
| 605 |
|
sprintf(o,"%s TArray - not implemented yet -",o); |
| 606 |
|
// |
| 607 |
|
}; |
| 608 |
|
// |
| 609 |
|
sprintf(o,"%s\n",o); |
| 610 |
|
break; |
| 611 |
|
case 3: |
| 612 |
|
// |
| 613 |
|
// IS A TCLONESARRAY |
| 614 |
|
// |
| 615 |
|
setcolor(col,RESET, BLUE, WHITE); |
| 616 |
|
setcolor(col2,RESET, BLACK, WHITE); |
| 617 |
|
sprintf(o,"%s%s %-15s%s = %d\n",o,col,tb->GetName(), col2, tb->GetNdata()); |
| 618 |
|
|
| 619 |
|
// |
| 620 |
|
if ( tb->GetNdata() ){ |
| 621 |
|
// |
| 622 |
|
TClonesArray *cl = (TClonesArray*)tb->GetObject(); |
| 623 |
|
// |
| 624 |
|
TClass *myc = cl->GetClass(); |
| 625 |
|
// |
| 626 |
|
TList *lme = myc->GetListOfDataMembers(); |
| 627 |
|
TIter next(lme); |
| 628 |
|
TBranchElement *tb2 = 0; |
| 629 |
|
// |
| 630 |
|
while ( (tb2 = (TBranchElement*)next()) ){ |
| 631 |
|
// |
| 632 |
|
const char *name = tb2->GetName(); |
| 633 |
|
TBranch *foglia = tb->FindBranch(name); |
| 634 |
|
if ( foglia ){ |
| 635 |
|
// |
| 636 |
|
TBranchElement *stb = (TBranchElement*)tb->FindBranch(name); |
| 637 |
|
Int_t stype = stb->GetType(); |
| 638 |
|
Int_t satype = stb->GetStreamerType() - 20; |
| 639 |
|
Int_t slen = (stb->GetInfo()->GetLengths())[stb->GetID()]; |
| 640 |
|
Int_t slength = min(slen,dlen); |
| 641 |
|
// printf("SubBranches : atype is %i type is %i tb getname %s slen %i slength %i\n",satype,stype,stb->GetName(),slen,slength); |
| 642 |
|
switch (stype){ |
| 643 |
|
case 31: |
| 644 |
|
// |
| 645 |
|
// IS A VARIABLE |
| 646 |
|
// |
| 647 |
|
// |
| 648 |
|
// NAME |
| 649 |
|
// |
| 650 |
|
j = 0; |
| 651 |
|
// |
| 652 |
|
// VALUES |
| 653 |
|
// |
| 654 |
|
if ( satype == 41 || satype == 44){ |
| 655 |
|
// |
| 656 |
|
// skip TRef |
| 657 |
|
// |
| 658 |
|
break; |
| 659 |
|
}; |
| 660 |
|
// |
| 661 |
|
// Integer |
| 662 |
|
// |
| 663 |
|
if ( satype == -17 || satype == -9 ){ |
| 664 |
|
// |
| 665 |
|
setcolor(col,RESET, BLUE, WHITE); |
| 666 |
|
setcolor(col2,RESET, BLACK, WHITE); |
| 667 |
|
sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2); |
| 668 |
|
while ( j < cl->GetEntriesFast() ){ |
| 669 |
|
if ( j < cl->GetEntriesFast() -1 ){ |
| 670 |
|
sprintf(o,"%s %i ,",o,(Int_t)stb->GetValue(j,slength)); |
| 671 |
|
} else { |
| 672 |
|
sprintf(o,"%s %i",o,(Int_t)stb->GetValue(j,slength)); |
| 673 |
|
}; |
| 674 |
|
j++; |
| 675 |
|
}; |
| 676 |
|
}; |
| 677 |
|
// |
| 678 |
|
// Float |
| 679 |
|
// |
| 680 |
|
if ( satype == -15 ){ |
| 681 |
|
// |
| 682 |
|
setcolor(col,RESET, BLUE, WHITE); |
| 683 |
|
setcolor(col2,RESET, BLACK, WHITE); |
| 684 |
|
sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2); |
| 685 |
|
while ( j < cl->GetEntriesFast() ){ |
| 686 |
|
if ( j < cl->GetEntriesFast() -1 ){ |
| 687 |
|
sprintf(o,"%s %f ,",o,stb->GetValue(j,slength)); |
| 688 |
|
} else { |
| 689 |
|
sprintf(o,"%s %f",o,stb->GetValue(j,slength)); |
| 690 |
|
}; |
| 691 |
|
j++; |
| 692 |
|
}; |
| 693 |
|
}; |
| 694 |
|
// |
| 695 |
|
// Array of float |
| 696 |
|
// |
| 697 |
|
if ( satype == 5 ){ |
| 698 |
|
// |
| 699 |
|
setcolor(col,RESET, BLUE, WHITE); |
| 700 |
|
setcolor(col2,RESET, BLACK, WHITE); |
| 701 |
|
sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2); |
| 702 |
|
Bool_t bold = true; |
| 703 |
|
while ( j < tb->GetNdata() ){ |
| 704 |
|
if ( bold ){ |
| 705 |
|
setcolor(col,RESET, BLACK, WHITE); |
| 706 |
|
sprintf(o,"%s%s",o,col); |
| 707 |
|
} else { |
| 708 |
|
setcolor(col,BOLD, BLACK, WHITE); |
| 709 |
|
sprintf(o,"%s%s",o,col); |
| 710 |
|
}; |
| 711 |
|
Int_t jj = 0; |
| 712 |
|
while ( jj < slength ){ |
| 713 |
|
if ( jj < slength-1 ){ |
| 714 |
|
sprintf(o,"%s %f ,",o,stb->GetValue(j,jj,true)); |
| 715 |
|
} else { |
| 716 |
|
sprintf(o,"%s %f",o,stb->GetValue(j,jj,true)); |
| 717 |
|
}; |
| 718 |
|
jj++; |
| 719 |
|
}; |
| 720 |
|
if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); |
| 721 |
|
if ( !bold ){ |
| 722 |
|
bold = true; |
| 723 |
|
} else { |
| 724 |
|
bold = false; |
| 725 |
|
}; |
| 726 |
|
j++; |
| 727 |
|
}; |
| 728 |
|
if ( bold ){ |
| 729 |
|
setcolor(col,RESET, BLACK, WHITE); |
| 730 |
|
sprintf(o,"%s%s",o,col); |
| 731 |
|
}; |
| 732 |
|
}; |
| 733 |
|
// |
| 734 |
|
// Array of integers |
| 735 |
|
// |
| 736 |
|
if ( satype == 3 ){ |
| 737 |
|
// |
| 738 |
|
setcolor(col,RESET, BLUE, WHITE); |
| 739 |
|
setcolor(col2,RESET, BLACK, WHITE); |
| 740 |
|
sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2); |
| 741 |
|
while ( j < tb->GetNdata() ){ |
| 742 |
|
Int_t jj = 0; |
| 743 |
|
while ( jj < slength ){ |
| 744 |
|
if ( jj < slength-1 ){ |
| 745 |
|
sprintf(o,"%s %i ,",o,(Int_t)stb->GetValue(j,jj,true)); |
| 746 |
|
} else { |
| 747 |
|
sprintf(o,"%s %i",o,(Int_t)stb->GetValue(j,jj,true)); |
| 748 |
|
}; |
| 749 |
|
jj++; |
| 750 |
|
}; |
| 751 |
|
if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); |
| 752 |
|
j++; |
| 753 |
|
}; |
| 754 |
|
}; |
| 755 |
|
|
| 756 |
|
// |
| 757 |
|
// TArray |
| 758 |
|
// |
| 759 |
|
if ( satype == 42 ){ |
| 760 |
|
// |
| 761 |
|
// determine offset to fetch data |
| 762 |
|
// |
| 763 |
|
int thisoffset = 0; |
| 764 |
|
TRealData *rd = myc->GetRealData(foglia->GetName()); |
| 765 |
|
if ( rd ){ |
| 766 |
|
thisoffset = rd->GetThisOffset(); |
| 767 |
|
}; |
| 768 |
|
Int_t niente = 0; |
| 769 |
|
TStreamerElement *tste = stb->GetInfo()->GetStreamerElement(rd->GetName(),niente); |
| 770 |
|
// |
| 771 |
|
// TArrayI |
| 772 |
|
// |
| 773 |
|
if ( !strcmp(tste->GetTypeName(),"TArrayI") ){ |
| 774 |
|
// |
| 775 |
|
char *pointer = (char*)cl->UncheckedAt(0); |
| 776 |
|
char *pu = pointer + thisoffset; |
| 777 |
|
TArrayI *arr = (TArrayI*)(pu); |
| 778 |
|
Int_t jj=0; |
| 779 |
|
Int_t arlen = min(arr->GetSize(),dlen); |
| 780 |
|
// |
| 781 |
|
setcolor(col,RESET, BLUE, WHITE); |
| 782 |
|
setcolor(col2,RESET, BLACK, WHITE); |
| 783 |
|
sprintf(o,"%s%s %s[%i]%s = ",o,col,foglia->GetName(),arr->GetSize(),col2); |
| 784 |
|
// |
| 785 |
|
while ( j < tb->GetNdata() ){ |
| 786 |
|
// |
| 787 |
|
pointer = (char*)cl->UncheckedAt(j); |
| 788 |
|
pu = pointer + thisoffset; |
| 789 |
|
arr = (TArrayI*)(pu); |
| 790 |
|
// |
| 791 |
|
while ( jj < arlen ){ |
| 792 |
|
if ( jj < arlen-1 ){ |
| 793 |
|
sprintf(o,"%s %i ,",o,arr->At(jj)); |
| 794 |
|
} else { |
| 795 |
|
sprintf(o,"%s %i",o,arr->At(jj)); |
| 796 |
|
}; |
| 797 |
|
jj++; |
| 798 |
|
}; |
| 799 |
|
if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); |
| 800 |
|
j++; |
| 801 |
|
}; |
| 802 |
|
}; |
| 803 |
|
// |
| 804 |
|
// TArrayF |
| 805 |
|
// |
| 806 |
|
if ( !strcmp(tste->GetTypeName(),"TArrayF") ){ |
| 807 |
|
// |
| 808 |
|
char *pointer = (char*)cl->UncheckedAt(0); |
| 809 |
|
char *pu = pointer + thisoffset; |
| 810 |
|
TArrayF *arr = (TArrayF*)(pu); |
| 811 |
|
Int_t jj=0; |
| 812 |
|
Int_t arlen = min(arr->GetSize(),dlen); |
| 813 |
|
// |
| 814 |
|
setcolor(col,RESET, BLUE, WHITE); |
| 815 |
|
setcolor(col2,RESET, BLACK, WHITE); |
| 816 |
|
sprintf(o,"%s%s %s[%i]%s = ",o,col,foglia->GetName(),arr->GetSize(),col2); |
| 817 |
|
// |
| 818 |
|
while ( j < tb->GetNdata() ){ |
| 819 |
|
// |
| 820 |
|
pointer = (char*)cl->UncheckedAt(j); |
| 821 |
|
pu = pointer + thisoffset; |
| 822 |
|
arr = (TArrayF*)(pu); |
| 823 |
|
// |
| 824 |
|
while ( jj < arlen ){ |
| 825 |
|
if ( jj < arlen-1 ){ |
| 826 |
|
sprintf(o,"%s %f ,",o,arr->At(jj)); |
| 827 |
|
} else { |
| 828 |
|
sprintf(o,"%s %f",o,arr->At(jj)); |
| 829 |
|
}; |
| 830 |
|
jj++; |
| 831 |
|
}; |
| 832 |
|
if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); |
| 833 |
|
j++; |
| 834 |
|
}; |
| 835 |
|
}; |
| 836 |
|
}; |
| 837 |
|
sprintf(o,"%s\n",o); |
| 838 |
|
break; |
| 839 |
|
}; |
| 840 |
|
}; |
| 841 |
|
}; |
| 842 |
|
}; |
| 843 |
|
break; |
| 844 |
|
}; |
| 845 |
|
}; |
| 846 |
|
// pamgui->DIALOG(0,o); |
| 847 |
|
printf("%s\n",o); |
| 848 |
|
}; |
| 849 |
|
|
| 850 |
|
|
| 851 |
void FEVdetector::GetGeneralInfo(){ |
void FEVdetector::GetGeneralInfo(){ |
| 852 |
// |
// |
| 853 |
// Get Orbital Time information and header event number |
// Get Orbital Time information and header event number |
| 857 |
headcold = headc; |
headcold = headc; |
| 858 |
headc = ph->Counter; |
headc = ph->Counter; |
| 859 |
var.headc = (int)ph->Counter; |
var.headc = (int)ph->Counter; |
| 860 |
OBT = ph->OrbitalTime; |
OBT = (UInt_t)ph->OrbitalTime; |
| 861 |
DOBT = OBT - OOBT; |
DOBT = OBT - OOBT; |
| 862 |
OOBT = OBT; |
OOBT = OBT; |
| 863 |
if ( thisentry == minevent || DOBT < 0 || (headc-headcold-1)!=0 ) DOBT = 0; |
if ( thisentry == minevent || DOBT < 0 || (headc-headcold-1)!=0 ) DOBT = 0; |
| 893 |
trcs = (TString)trc.str().c_str(); |
trcs = (TString)trc.str().c_str(); |
| 894 |
} else { |
} else { |
| 895 |
headcold = headc; |
headcold = headc; |
| 896 |
headc = oinfoL2->pkt_num; // to be changed as soon as we will have obt in the level2 file! |
if ( var.RUN ){ |
| 897 |
OBT = oinfoL2->OBT; // to be changed as soon as we will have obt in the level2 file! |
var.idrun = L2->GetRunInfo()->ID; |
| 898 |
DOBT = OBT - OOBT; |
var.idroot = L2->GetRunInfo()->ID_ROOT_L0; |
| 899 |
OOBT = OBT; |
var.EVF = L2->GetRunInfo()->EV_FROM; |
| 900 |
if ( thisentry == minevent || DOBT < 0 || (headc-headcold-1)!=0 ) DOBT = 0; |
}; |
| 901 |
var.etime = OBT; |
if ( var.ORB ){ |
| 902 |
|
headc = L2->GetOrbitalInfo()->pkt_num; |
| 903 |
|
OBT = L2->GetOrbitalInfo()->OBT; |
| 904 |
|
DOBT = OBT - OOBT; |
| 905 |
|
OOBT = OBT; |
| 906 |
|
if ( thisentry == minevent || DOBT < 0 || (headc-headcold-1)!=0 ) DOBT = 0; |
| 907 |
|
var.etime = OBT; |
| 908 |
|
} else { |
| 909 |
|
var.etime = 0; |
| 910 |
|
}; |
| 911 |
// |
// |
| 912 |
// who gave the trigger? |
// who gave the trigger? |
| 913 |
// |
// |
| 914 |
calotrig = 0; |
Int_t trigconf = 0; |
| 915 |
if ( L2->patterntrig[0] ) calotrig = 1; |
if ( var.TRG ){ |
| 916 |
toftrig = 0; |
calotrig = 0; |
| 917 |
if ( L2->patterntrig[2] || L2->patterntrig[3] || L2->patterntrig[4] || L2->patterntrig[5] ) toftrig = 1; |
if ( L2->GetTrigLevel2()->patterntrig[0] ) calotrig = 1; |
| 918 |
s4pulser = 0; |
toftrig = 0; |
| 919 |
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; |
| 920 |
// |
s4pulser = 0; |
| 921 |
// 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; |
| 922 |
// S4 sometimes could not set the flag even if the trigger is given. This is a workaround to fix this "bug": |
// |
| 923 |
// |
// TOF and calorimeter when giving a trigger will always set this flag since the time window of the signal is greater than 100 ns. |
| 924 |
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": |
| 925 |
// |
// |
| 926 |
Int_t trigconf = L2->trigconf; |
if ( !calotrig && !toftrig ) s4pulser = 1; |
| 927 |
|
// |
| 928 |
|
trigconf = L2->GetTrigLevel2()->trigconf; |
| 929 |
|
} else { |
| 930 |
|
trigconf = 0; |
| 931 |
|
} |
| 932 |
stringstream trc; |
stringstream trc; |
| 933 |
trc.str(""); |
trc.str(""); |
| 934 |
if ( trigconf & (1<<0) ) trc << "TOF1"; |
if ( trigconf & (1<<0) ) trc << "TOF1"; |
| 1016 |
// |
// |
| 1017 |
if ( level.file == 2 ){ |
if ( level.file == 2 ){ |
| 1018 |
cintcom.str(""); |
cintcom.str(""); |
| 1019 |
cintcom << "PamLevel2 *L2 = (PamLevel2*)0x" << hex; |
cintcom << "PamLevel2 *L2 = (PamLevel2*)" << hex; //con const e l2 funziona |
| 1020 |
cintcom << L2; |
cintcom << L2; |
| 1021 |
gROOT->ProcessLine(cintcom.str().c_str()); |
gROOT->ProcessLine(cintcom.str().c_str()); |
| 1022 |
|
// printf(" comando: %s \n",cintcom.str().c_str()); |
| 1023 |
} else { |
} else { |
| 1024 |
cintcom.str(""); |
cintcom.str(""); |
| 1025 |
cintcom << "TTree *otr = (TTree*)0x" << hex; |
cintcom << "TTree *otr = (TTree*)" << hex; |
| 1026 |
cintcom << otr; |
cintcom << otr; |
| 1027 |
gROOT->ProcessLine(cintcom.str().c_str()); |
gROOT->ProcessLine(cintcom.str().c_str()); |
| 1028 |
// |
// |
| 1029 |
cintcom.str(""); |
cintcom.str(""); |
| 1030 |
cintcom << "struct Variables &var = (struct Variables &)0x" << hex; |
cintcom << "struct Variables &var = (struct Variables &)" << hex; |
| 1031 |
cintcom << &var; |
cintcom << &var; |
| 1032 |
gROOT->ProcessLine(cintcom.str().c_str()); |
gROOT->ProcessLine(cintcom.str().c_str()); |
| 1033 |
}; |
}; |
| 1038 |
// |
// |
| 1039 |
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);"); |
| 1040 |
// |
// |
| 1041 |
if ( level.file == 2 ) isOK = gApplication->ProcessLine("filter((PamLevel2 *)L2,2);"); |
// if ( level.file == 2 ) isOK = gApplication->ProcessLine("filter((PamLevel2 *)L2,2);"); |
| 1042 |
|
if ( level.file == 2 ) isOK = gApplication->ProcessLine("filter();"); |
| 1043 |
// |
// |
| 1044 |
// progress bar in text window |
// progress bar in text window |
| 1045 |
// |
// |
| 1052 |
// |
// |
| 1053 |
} |
} |
| 1054 |
|
|
| 1055 |
void FEVdetector::Load(TTree &mainotr, TFile &mainfile){ |
TChain* FEVdetector::Load(TString file){ |
| 1056 |
file = &mainfile; |
// |
| 1057 |
otr = &mainotr; |
// file = &mainfile; |
|
L2 = new PamLevel2(); |
|
| 1058 |
// |
// |
| 1059 |
if ( level.file == 2 ){ |
if ( level.file == 2 ){ |
|
otr = L2->LoadPamTrees(file); |
|
|
// ******************** |
|
|
// load magnetic field |
|
|
// ******************** |
|
|
const char *pam_calib = pathtocalibration(); |
|
| 1060 |
// |
// |
| 1061 |
stringstream magfie; |
printf(" %s \n",ddec.Data()); |
| 1062 |
magfie.str(""); |
if ( !L2 ){ |
| 1063 |
magfie << pam_calib; |
L2 = new PamLevel2("",file.Data(),ddec.Data()); |
| 1064 |
magfie << "/trk-param/field_param-0/"; |
otr = L2->GetPamTree(); |
| 1065 |
|
printf(" l2 constructor\n"); |
| 1066 |
|
// printf(" abst %u obt %u qtot %f \n",L2->GetOrbitalInfo()->absTime,L2->GetOrbitalInfo()->OBT,L2->GetCaloLevel2()->qtot); |
| 1067 |
|
} else { |
| 1068 |
|
// |
| 1069 |
|
printf(" l2 already exist \n"); |
| 1070 |
|
otr = L2->GetPamTree(gSystem->DirName(file.Data()),file.Data(),ddec.Data()); |
| 1071 |
|
L2->GetRunTree(gSystem->DirName(file.Data()),file.Data()); |
| 1072 |
|
// |
| 1073 |
|
}; |
| 1074 |
|
// |
| 1075 |
|
// |
| 1076 |
|
if ( !otr ) return(0); |
| 1077 |
|
// |
| 1078 |
|
// otr->CanDeleteRefs(true); |
| 1079 |
|
// if ( runtree ) runtree->CanDeleteRefs(true); |
| 1080 |
// |
// |
|
L2->LoadField(magfie.str().c_str()); |
|
| 1081 |
} else { |
} else { |
| 1082 |
// |
// |
| 1083 |
// load calorimeter ADC2MIP conversion file |
// load calorimeter ADC2MIP conversion file |
| 1117 |
// |
// |
| 1118 |
}; |
}; |
| 1119 |
// |
// |
|
|
|
| 1120 |
// |
// |
| 1121 |
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(); |
|
| 1122 |
// |
// |
| 1123 |
if ( level.file == 0 || level.file == -1 ){ |
if ( level.file == 0 || level.file == -1 ){ |
| 1124 |
|
// |
| 1125 |
|
trigger = new pamela::trigger::TriggerEvent(); |
| 1126 |
|
eh = new pamela::EventHeader(); |
| 1127 |
|
ph = new pamela::PscuHeader(); |
| 1128 |
|
de = new pamela::calorimeter::CalorimeterEvent(); |
| 1129 |
|
trk = new pamela::tracker::TrackerEvent(); |
| 1130 |
|
ne = new pamela::neutron::NeutronEvent(); |
| 1131 |
|
ace = new pamela::anticounter::AnticounterEvent(); |
| 1132 |
|
s4 = new pamela::S4::S4Event(); |
| 1133 |
|
tof = new pamela::tof::TofEvent(); |
| 1134 |
|
// |
| 1135 |
|
otr = new TChain("Physics"); |
| 1136 |
|
otr->Add(file.Data(),-1); |
| 1137 |
otr->SetBranchAddress("Trigger", &trigger); |
otr->SetBranchAddress("Trigger", &trigger); |
| 1138 |
otr->SetBranchAddress("Header", &eh); |
otr->SetBranchAddress("Header", &eh); |
| 1139 |
}; |
}; |
|
if ( level.file == 2 ){ |
|
|
otr->AddFriend("OrbitalInfo", file); |
|
|
otr->SetBranchAddress("OrbitalInfo", &oinfoL2); |
|
|
runinfo->Read(0ULL); |
|
|
}; |
|
| 1140 |
// |
// |
| 1141 |
if ( var.TRK ) { |
if ( var.TRK ) { |
| 1142 |
if ( level.file == 0 || level.file == -1 ){ |
if ( level.file == 0 || level.file == -1 ){ |
| 1208 |
printf("Show the Time of Flight detector, LEVEL2 data \n"); |
printf("Show the Time of Flight detector, LEVEL2 data \n"); |
| 1209 |
}; |
}; |
| 1210 |
}; |
}; |
| 1211 |
|
// |
| 1212 |
|
if ( !otr ){ |
| 1213 |
|
return(0); |
| 1214 |
|
}; |
| 1215 |
|
// |
| 1216 |
|
return otr; |
| 1217 |
// |
// |
| 1218 |
} |
} |
| 1219 |
|
|
| 1289 |
text->DrawLatex(0.33,txthi,testo.str().c_str()); |
text->DrawLatex(0.33,txthi,testo.str().c_str()); |
| 1290 |
txthi -= 0.03; |
txthi -= 0.03; |
| 1291 |
testo2.str(""); |
testo2.str(""); |
| 1292 |
testo2 << "On Board Time: " << (int)OBT; |
testo2 << "On Board Time: " << (unsigned int)OBT; |
| 1293 |
if ( DOBT > 0 ) { |
if ( DOBT > 0 ) { |
| 1294 |
testo2 << " (delta: " << (int)DOBT; |
testo2 << " (delta: " << (unsigned int)DOBT; |
| 1295 |
testo2 << ")"; |
testo2 << ")"; |
| 1296 |
}; |
}; |
| 1297 |
testo2 << " [ms]"; |
testo2 << " [ms]"; |
| 1449 |
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"); |
| 1450 |
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"); |
| 1451 |
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"); |
| 1452 |
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"); |
| 1453 |
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"); |
| 1454 |
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"); |
| 1455 |
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"); |
| 1456 |
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"); |
| 1457 |
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"); |
| 1458 |
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"); |
| 1580 |
// |
// |
| 1581 |
// print infos on terminal |
// print infos on terminal |
| 1582 |
// |
// |
| 1583 |
|
// if ( !var.selex ){ |
| 1584 |
printf(" File: %s \n",var.thefilename.Data()); |
printf(" File: %s \n",var.thefilename.Data()); |
| 1585 |
if ( !s4pulser && !calotrig ){ |
if ( !s4pulser && !calotrig ){ |
| 1586 |
printf(" Pkt_num: %i - Progressive number: %i \n",(int)headc,thisentry+1); |
printf(" Pkt_num: %i - Progressive number: %i \n",(int)headc,thisentry+1); |
| 1591 |
if ( calotrig ){ |
if ( calotrig ){ |
| 1592 |
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); |
| 1593 |
}; |
}; |
| 1594 |
printf(" On Board Time: %i (delta %i) [ms]\n",OBT,DOBT); |
printf(" On Board Time: %u (delta %i) [ms]\n",OBT,DOBT); |
| 1595 |
const char *trc2 = trcs; |
const char *trc2 = trcs; |
| 1596 |
printf(" TRIGGER: %s \n",trc2); |
printf(" TRIGGER: %s \n",trc2); |
| 1597 |
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); |
| 1603 |
printf(" CALO: NSTRIP = %i QTOT = %i [MIP]\n",var.nstrip,var.qtot); |
printf(" CALO: NSTRIP = %i QTOT = %i [MIP]\n",var.nstrip,var.qtot); |
| 1604 |
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]); |
| 1605 |
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); |
| 1606 |
|
// }; |
| 1607 |
// |
// |
| 1608 |
} |
} |
| 1609 |
|
|
| 1911 |
void FEVdetector::ShowTOF(){ |
void FEVdetector::ShowTOF(){ |
| 1912 |
// |
// |
| 1913 |
// |
// |
|
// |
|
| 1914 |
if ( !var.TOF ) return; |
if ( !var.TOF ) return; |
| 1915 |
// |
// |
| 1916 |
Int_t tt = 0; |
Int_t tt = 0; |
| 1917 |
|
Int_t rj = 0; |
| 1918 |
// |
// |
| 1919 |
// force level0, i.e. show patterntrig variable! |
// force level0, i.e. show patterntrig variable! |
| 1920 |
// |
// |
| 2108 |
Float_t s12p = 0.055; |
Float_t s12p = 0.055; |
| 2109 |
ocolo = 10; |
ocolo = 10; |
| 2110 |
TPolyLine *ftof12ya[6]; |
TPolyLine *ftof12ya[6]; |
| 2111 |
|
rj=6; |
| 2112 |
for ( Int_t j=0; j<6; j++){ |
for ( Int_t j=0; j<6; j++){ |
| 2113 |
|
rj--; |
| 2114 |
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)}; |
| 2115 |
Float_t yc1[4]={ -ws13, 0., 0., -ws13}; |
Float_t yc1[4]={ -ws13, 0., 0., -ws13}; |
| 2116 |
Float_t xc[4]; |
Float_t xc[4]; |
| 2126 |
} else { |
} else { |
| 2127 |
colo = 1; |
colo = 1; |
| 2128 |
}; |
}; |
| 2129 |
ColorMIP(ms12a[j],colo); |
ColorMIP(ms12a[rj],colo); |
| 2130 |
// |
// |
| 2131 |
if ( colo != 10 ) ocolo = colo; |
if ( colo != 10 ) ocolo = colo; |
| 2132 |
if ( mt12[0][j] == 4095. ) colo = noadc; |
if ( mt12[0][rj] == 4095. ) colo = noadc; |
| 2133 |
// |
// |
| 2134 |
ftof12ya[j]->SetFillColor(colo); |
ftof12ya[j]->SetFillColor(colo); |
| 2135 |
ftof12ya[j]->SetLineWidth(1); |
ftof12ya[j]->SetLineWidth(1); |
| 2139 |
// B |
// B |
| 2140 |
s12p = 0.055; |
s12p = 0.055; |
| 2141 |
TPolyLine *ftof12yb[6]; |
TPolyLine *ftof12yb[6]; |
| 2142 |
|
rj=6; |
| 2143 |
for ( Int_t j=0; j<6; j++){ |
for ( Int_t j=0; j<6; j++){ |
| 2144 |
|
rj--; |
| 2145 |
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)}; |
| 2146 |
Float_t yc1[4]={ -ws13, -ws13, 0., -ws13}; |
Float_t yc1[4]={ -ws13, -ws13, 0., -ws13}; |
| 2147 |
Float_t xc[4]; |
Float_t xc[4]; |
| 2157 |
} else { |
} else { |
| 2158 |
colo = 1; |
colo = 1; |
| 2159 |
}; |
}; |
| 2160 |
ColorMIP(ms12b[j],colo); |
ColorMIP(ms12b[rj],colo); |
| 2161 |
// |
// |
| 2162 |
if ( colo != 10 ) ocolo = colo; |
if ( colo != 10 ) ocolo = colo; |
| 2163 |
if ( mt12[1][j] == 4095. ) colo = noadc; |
if ( mt12[1][rj] == 4095. ) colo = noadc; |
| 2164 |
// |
// |
| 2165 |
ftof12yb[j]->SetFillColor(colo); |
ftof12yb[j]->SetFillColor(colo); |
| 2166 |
ftof12yb[j]->SetLineWidth(1); |
ftof12yb[j]->SetLineWidth(1); |
| 2194 |
Float_t s21p = 0.075; |
Float_t s21p = 0.075; |
| 2195 |
ocolo = 10; |
ocolo = 10; |
| 2196 |
TPolyLine *ftof21ya[2]; |
TPolyLine *ftof21ya[2]; |
| 2197 |
|
rj=2; |
| 2198 |
for ( Int_t j=0; j<2; j++){ |
for ( Int_t j=0; j<2; j++){ |
| 2199 |
|
rj--; |
| 2200 |
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)}; |
| 2201 |
Float_t yc1[4]={ 0., ws2, ws2, 0.}; |
Float_t yc1[4]={ 0., ws2, ws2, 0.}; |
| 2202 |
Float_t xc[4]; |
Float_t xc[4]; |
| 2212 |
} else { |
} else { |
| 2213 |
colo = 1; |
colo = 1; |
| 2214 |
}; |
}; |
| 2215 |
ColorMIP(ms21a[j],colo); |
ColorMIP(ms21a[rj],colo); |
| 2216 |
// |
// |
| 2217 |
if ( colo != 10 ) ocolo = colo; |
if ( colo != 10 ) ocolo = colo; |
| 2218 |
if ( mt21[0][j] == 4095. ) colo = noadc; |
if ( mt21[0][rj] == 4095. ) colo = noadc; |
| 2219 |
// |
// |
| 2220 |
ftof21ya[j]->SetFillColor(colo); |
ftof21ya[j]->SetFillColor(colo); |
| 2221 |
ftof21ya[j]->SetLineWidth(1); |
ftof21ya[j]->SetLineWidth(1); |
| 2225 |
// B |
// B |
| 2226 |
s21p = 0.075; |
s21p = 0.075; |
| 2227 |
TPolyLine *ftof21yb[2]; |
TPolyLine *ftof21yb[2]; |
| 2228 |
|
rj=2; |
| 2229 |
for ( Int_t j=0; j<2; j++){ |
for ( Int_t j=0; j<2; j++){ |
| 2230 |
|
rj--; |
| 2231 |
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)}; |
| 2232 |
Float_t yc1[4]={ 0., 0., ws2, 0.}; |
Float_t yc1[4]={ 0., 0., ws2, 0.}; |
| 2233 |
Float_t xc[4]; |
Float_t xc[4]; |
| 2243 |
} else { |
} else { |
| 2244 |
colo = 1; |
colo = 1; |
| 2245 |
}; |
}; |
| 2246 |
ColorMIP(ms21b[j],colo); |
ColorMIP(ms21b[rj],colo); |
| 2247 |
// |
// |
| 2248 |
if ( colo != 10 ) ocolo = colo; |
if ( colo != 10 ) ocolo = colo; |
| 2249 |
if ( mt21[1][j] == 4095. ) colo = noadc; |
if ( mt21[1][rj] == 4095. ) colo = noadc; |
| 2250 |
// |
// |
| 2251 |
ftof21yb[j]->SetFillColor(colo); |
ftof21yb[j]->SetFillColor(colo); |
| 2252 |
ftof21yb[j]->SetLineWidth(1); |
ftof21yb[j]->SetLineWidth(1); |
| 2361 |
Float_t s31p = 0.060; |
Float_t s31p = 0.060; |
| 2362 |
ocolo = 10; |
ocolo = 10; |
| 2363 |
TPolyLine *ftof31xa[3]; |
TPolyLine *ftof31xa[3]; |
| 2364 |
|
rj=3; |
| 2365 |
for ( Int_t j=0; j<3; j++){ |
for ( Int_t j=0; j<3; j++){ |
| 2366 |
|
rj--; |
| 2367 |
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)}; |
| 2368 |
Float_t yc1[4]={ 0., ws13, ws13, 0.}; |
Float_t yc1[4]={ 0., ws13, ws13, 0.}; |
| 2369 |
Float_t xc[4]; |
Float_t xc[4]; |
| 2379 |
} else { |
} else { |
| 2380 |
colo = 1; |
colo = 1; |
| 2381 |
}; |
}; |
| 2382 |
ColorMIP(ms31a[j],colo); |
ColorMIP(ms31a[rj],colo); |
| 2383 |
// |
// |
| 2384 |
if ( colo != 10 ) ocolo = colo; |
if ( colo != 10 ) ocolo = colo; |
| 2385 |
if ( mt31[0][j] == 4095. ) colo = noadc; |
if ( mt31[0][rj] == 4095. ) colo = noadc; |
| 2386 |
// |
// |
| 2387 |
ftof31xa[j]->SetFillColor(colo); |
ftof31xa[j]->SetFillColor(colo); |
| 2388 |
ftof31xa[j]->SetLineWidth(1); |
ftof31xa[j]->SetLineWidth(1); |
| 2392 |
// B |
// B |
| 2393 |
s31p = 0.060; |
s31p = 0.060; |
| 2394 |
TPolyLine *ftof31xb[3]; |
TPolyLine *ftof31xb[3]; |
| 2395 |
|
rj=3; |
| 2396 |
for ( Int_t j=0; j<3; j++){ |
for ( Int_t j=0; j<3; j++){ |
| 2397 |
|
rj--; |
| 2398 |
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)}; |
| 2399 |
Float_t yc1[4]={ 0., 0., ws13, 0.}; |
Float_t yc1[4]={ 0., 0., ws13, 0.}; |
| 2400 |
Float_t xc[4]; |
Float_t xc[4]; |
| 2410 |
} else { |
} else { |
| 2411 |
colo = 1; |
colo = 1; |
| 2412 |
}; |
}; |
| 2413 |
ColorMIP(ms31b[j],colo); |
ColorMIP(ms31b[rj],colo); |
| 2414 |
// |
// |
| 2415 |
if ( colo != 10 ) ocolo = colo; |
if ( colo != 10 ) ocolo = colo; |
| 2416 |
if ( mt31[1][j] == 4095. ) colo = noadc; |
if ( mt31[1][rj] == 4095. ) colo = noadc; |
| 2417 |
// |
// |
| 2418 |
ftof31xb[j]->SetFillColor(colo); |
ftof31xb[j]->SetFillColor(colo); |
| 2419 |
ftof31xb[j]->SetLineWidth(1); |
ftof31xb[j]->SetLineWidth(1); |
| 2445 |
Float_t s32p = 0.050; |
Float_t s32p = 0.050; |
| 2446 |
ocolo = 10; |
ocolo = 10; |
| 2447 |
TPolyLine *ftof32ya[3]; |
TPolyLine *ftof32ya[3]; |
| 2448 |
|
rj=3; |
| 2449 |
for ( Int_t j=0; j<3; j++){ |
for ( Int_t j=0; j<3; j++){ |
| 2450 |
|
rj--; |
| 2451 |
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)}; |
| 2452 |
Float_t yc1[4]={ -ws13, 0., 0., -ws13}; |
Float_t yc1[4]={ -ws13, 0., 0., -ws13}; |
| 2453 |
Float_t xc[4]; |
Float_t xc[4]; |
| 2463 |
} else { |
} else { |
| 2464 |
colo = 1; |
colo = 1; |
| 2465 |
}; |
}; |
| 2466 |
ColorMIP(ms32a[j],colo); |
ColorMIP(ms32a[rj],colo); |
| 2467 |
// |
// |
| 2468 |
if ( colo != 10 ) ocolo = colo; |
if ( colo != 10 ) ocolo = colo; |
| 2469 |
if ( mt32[0][j] == 4095. ) colo = noadc; |
if ( mt32[0][rj] == 4095. ) colo = noadc; |
| 2470 |
// |
// |
| 2471 |
ftof32ya[j]->SetFillColor(colo); |
ftof32ya[j]->SetFillColor(colo); |
| 2472 |
ftof32ya[j]->SetLineWidth(1); |
ftof32ya[j]->SetLineWidth(1); |
| 2475 |
}; |
}; |
| 2476 |
s32p = 0.050; |
s32p = 0.050; |
| 2477 |
TPolyLine *ftof32yb[3]; |
TPolyLine *ftof32yb[3]; |
| 2478 |
|
rj=3; |
| 2479 |
for ( Int_t j=0; j<3; j++){ |
for ( Int_t j=0; j<3; j++){ |
| 2480 |
|
rj--; |
| 2481 |
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)}; |
| 2482 |
Float_t yc1[4]={ -ws13, -ws13, 0., -ws13}; |
Float_t yc1[4]={ -ws13, -ws13, 0., -ws13}; |
| 2483 |
Float_t xc[4]; |
Float_t xc[4]; |
| 2493 |
} else { |
} else { |
| 2494 |
colo = 1; |
colo = 1; |
| 2495 |
}; |
}; |
| 2496 |
ColorMIP(ms32b[j],colo); |
ColorMIP(ms32b[rj],colo); |
| 2497 |
// |
// |
| 2498 |
if ( colo != 10 ) ocolo = colo; |
if ( colo != 10 ) ocolo = colo; |
| 2499 |
if ( mt32[1][j] == 4095. ) colo = noadc; |
if ( mt32[1][rj] == 4095. ) colo = noadc; |
| 2500 |
// |
// |
| 2501 |
ftof32yb[j]->SetFillColor(colo); |
ftof32yb[j]->SetFillColor(colo); |
| 2502 |
ftof32yb[j]->SetLineWidth(1); |
ftof32yb[j]->SetLineWidth(1); |
| 2633 |
ms11b[i] = 0.; |
ms11b[i] = 0.; |
| 2634 |
} else { |
} else { |
| 2635 |
ms11b[i] = 1.; |
ms11b[i] = 1.; |
| 2636 |
}; }; |
}; |
| 2637 |
|
}; |
| 2638 |
for ( Int_t i = 0; i<6; i++ ) { |
for ( Int_t i = 0; i<6; i++ ) { |
| 2639 |
mt12[0][i] = tof->tdc[ch12a[i]][hb12a[i]]; |
mt12[0][i] = tof->tdc[ch12a[i]][hb12a[i]]; |
| 2640 |
mt12[1][i] = tof->tdc[ch12b[i]][hb12b[i]]; |
mt12[1][i] = tof->tdc[ch12b[i]][hb12b[i]]; |
| 2728 |
// |
// |
| 2729 |
Bool_t repeat = true; |
Bool_t repeat = true; |
| 2730 |
Int_t numtr = 1; |
Int_t numtr = 1; |
| 2731 |
|
// Int_t numtr = 0; |
| 2732 |
Int_t repuntil = 0; |
Int_t repuntil = 0; |
| 2733 |
// |
// |
| 2734 |
// |
// |
| 2735 |
var.tofraw = 0; |
var.tofraw = 0; |
| 2736 |
// |
// |
| 2737 |
repuntil = L2->ToFLevel2::ntrk(); |
if ( level.file == 2 ) repuntil = L2->GetToFLevel2()->ntrk(); |
| 2738 |
// printf("repuntil = %i \n",repuntil); |
// printf("repuntil = %i \n",repuntil); |
| 2739 |
|
//if ( level.file == 2 ) repuntil = L2->GetTrkLevel2()->GetNTracks(); |
| 2740 |
//repuntil = L2->GetNTracks(); |
//repuntil = L2->GetNTracks(); |
| 2741 |
// |
// |
| 2742 |
while ( repeat ){ |
while ( repeat ){ |
| 2746 |
// |
// |
| 2747 |
// |
// |
| 2748 |
ToFTrkVar *ptt = 0; |
ToFTrkVar *ptt = 0; |
| 2749 |
|
// PamTrack *ptrack = 0; |
| 2750 |
|
Float_t adc[4][12]; |
| 2751 |
|
Float_t tdc[4][12]; |
| 2752 |
|
memset(adc,0,4*12*sizeof(Float_t)); |
| 2753 |
|
memset(tdc,0,4*12*sizeof(Float_t)); |
| 2754 |
// |
// |
| 2755 |
// |
// |
| 2756 |
|
// if ( repuntil == 0 || var.tofraw ){ |
| 2757 |
if ( repuntil == 1 || var.tofraw ){ |
if ( repuntil == 1 || var.tofraw ){ |
| 2758 |
numtr = 0; |
numtr = 0; |
| 2759 |
ptt = L2->GetToFTrkVar(0); |
ptt = L2->GetToFLevel2()->GetToFTrkVar(0); |
| 2760 |
repeat = false; |
repeat = false; |
| 2761 |
} else { |
} else { |
| 2762 |
// |
// |
| 2763 |
// |
// |
| 2764 |
if ( numtr >= repuntil-1 ) repeat = false; |
if ( numtr >= repuntil-1 ) repeat = false; |
| 2765 |
// |
// |
| 2766 |
ptt = L2->GetToFTrkVar(numtr); |
// printf(" numtr is %i \n",numtr); |
| 2767 |
|
ptt = L2->GetToFLevel2()->GetToFTrkVar(numtr); |
| 2768 |
|
//ptrack = L2->GetTrack(numtr); |
| 2769 |
|
//ptt = ptrack->GetToFTrack(); |
| 2770 |
}; |
}; |
| 2771 |
// |
// |
| 2772 |
xp11[0] = 0.; |
xp11[0] = 0.; |
| 2780 |
// |
// |
| 2781 |
ii = 2; |
ii = 2; |
| 2782 |
// |
// |
| 2783 |
Float_t adc[4][12]; |
Int_t myseq = ptt->trkseqno + 1; |
| 2784 |
Float_t tdc[4][12]; |
L2->GetToFLevel2()->GetMatrix(myseq,adc,tdc); |
| 2785 |
L2->GetMatrix(numtr,adc,tdc); |
// |
| 2786 |
|
// printf(" qua \n"); |
| 2787 |
// |
// |
| 2788 |
for ( Int_t i = 0; i<8; i++ ) { |
for ( Int_t i = 0; i<8; i++ ) { |
| 2789 |
if ( adc[ch11a[i]][hb11a[i]] < 1000. ){ |
if ( adc[ch11a[i]][hb11a[i]] < 1000. ){ |
| 2940 |
ftof11y->Draw(); |
ftof11y->Draw(); |
| 2941 |
TPolyLine *sftof11[8]; |
TPolyLine *sftof11[8]; |
| 2942 |
tt = 1; |
tt = 1; |
| 2943 |
if ( level.file == -1 ) tt = 8; |
rj=1; |
| 2944 |
|
if ( level.file == -1 ){ |
| 2945 |
|
tt = 8; |
| 2946 |
|
rj = 8; |
| 2947 |
|
}; |
| 2948 |
for ( Int_t j=0; j<tt; j++){ |
for ( Int_t j=0; j<tt; j++){ |
| 2949 |
if ( (mt11[0][j]<4095. || mt11[1][j]<4095.)){ |
rj--; |
| 2950 |
|
if ( (mt11[0][rj]<4095. || mt11[1][rj]<4095.)){ |
| 2951 |
if ( ocolo == 10 ) ocolo = noadc; |
if ( ocolo == 10 ) ocolo = noadc; |
| 2952 |
Float_t lowp = (xp11[j]-E11[j])/100.; |
Float_t lowp = -(xp11[rj]+E11[rj])/100.; |
| 2953 |
Float_t higp = (xp11[j]+E11[j])/100.; |
Float_t higp = -(xp11[rj]-E11[rj])/100.; |
| 2954 |
if ( lowp < -0.164 ) lowp = -0.164; |
if ( lowp < -0.164 ) lowp = -0.164; |
| 2955 |
if ( higp > 0.164 ) higp = 0.164; |
if ( higp > 0.164 ) higp = 0.164; |
| 2956 |
if ( lowp < higp && ( level.file == -1 || (level.file == 2 && xp11[j] != 0.))){ |
if ( lowp < higp && ( level.file == -1 || (level.file == 2 && xp11[rj] != 0.))){ |
| 2957 |
Float_t nxc1[5]={ lowp, higp, higp, lowp, lowp}; |
Float_t nxc1[5]={ lowp, higp, higp, lowp, lowp}; |
| 2958 |
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}; |
| 2959 |
Float_t nxc[5]; |
Float_t nxc[5]; |
| 2978 |
Float_t s12p = 0.055; |
Float_t s12p = 0.055; |
| 2979 |
ocolo = 10; |
ocolo = 10; |
| 2980 |
TPolyLine *ftof12y[6]; |
TPolyLine *ftof12y[6]; |
| 2981 |
|
rj = 6; |
| 2982 |
for ( Int_t j=0; j<6; j++){ |
for ( Int_t j=0; j<6; j++){ |
| 2983 |
|
rj--; |
| 2984 |
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)}; |
| 2985 |
Float_t nyc1[5]={ -ws13, 0., 0., -ws13, -ws13}; |
Float_t nyc1[5]={ -ws13, 0., 0., -ws13, -ws13}; |
| 2986 |
Float_t nxc[5]; |
Float_t nxc[5]; |
| 2997 |
colo = 1; |
colo = 1; |
| 2998 |
}; |
}; |
| 2999 |
if ( level.file == -1 ){ |
if ( level.file == -1 ){ |
| 3000 |
ColorMIP(ms12a[j]+ms12b[j],colo); |
ColorMIP(ms12a[rj]+ms12b[rj],colo); |
| 3001 |
} else { |
} else { |
| 3002 |
ColorTOFMIP(ms12a[j]+ms12b[j],colo); |
ColorTOFMIP(ms12a[rj]+ms12b[rj],colo); |
| 3003 |
}; |
}; |
| 3004 |
// |
// |
| 3005 |
if ( colo != 10 ) ocolo = colo; |
if ( colo != 10 ) ocolo = colo; |
| 3066 |
Float_t s21p = 0.075; |
Float_t s21p = 0.075; |
| 3067 |
ocolo = 10; |
ocolo = 10; |
| 3068 |
TPolyLine *ftof21y[2]; |
TPolyLine *ftof21y[2]; |
| 3069 |
|
rj=2; |
| 3070 |
for ( Int_t j=0; j<2; j++){ |
for ( Int_t j=0; j<2; j++){ |
| 3071 |
|
rj--; |
| 3072 |
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)}; |
| 3073 |
Float_t nyc1[5]={ 0., ws2, ws2, 0., 0.}; |
Float_t nyc1[5]={ 0., ws2, ws2, 0., 0.}; |
| 3074 |
Float_t nxc[5]; |
Float_t nxc[5]; |
| 3085 |
colo = 1; |
colo = 1; |
| 3086 |
}; |
}; |
| 3087 |
if ( level.file == -1 ){ |
if ( level.file == -1 ){ |
| 3088 |
ColorMIP(ms21a[j]+ms21b[j],colo); |
ColorMIP(ms21a[rj]+ms21b[rj],colo); |
| 3089 |
} else { |
} else { |
| 3090 |
ColorTOFMIP(ms21a[j]+ms21b[j],colo); |
ColorTOFMIP(ms21a[rj]+ms21b[rj],colo); |
| 3091 |
}; |
}; |
| 3092 |
// |
// |
| 3093 |
if ( colo != 10 ) ocolo = colo; |
if ( colo != 10 ) ocolo = colo; |
| 3204 |
ftof22y->Draw(); |
ftof22y->Draw(); |
| 3205 |
TPolyLine *sftof22[2]; |
TPolyLine *sftof22[2]; |
| 3206 |
tt = 1; |
tt = 1; |
| 3207 |
if ( level.file == -1 ) tt = 2; |
rj = 1; |
| 3208 |
|
if ( level.file == -1 ){ |
| 3209 |
|
tt = 2; |
| 3210 |
|
rj = 2; |
| 3211 |
|
}; |
| 3212 |
for (Int_t j=0; j<tt; j++){ |
for (Int_t j=0; j<tt; j++){ |
| 3213 |
|
rj--; |
| 3214 |
// for ( Int_t j=0; j<2; j++){ |
// for ( Int_t j=0; j<2; j++){ |
| 3215 |
if ( (mt22[0][j]<4095. || mt22[1][j]<4095.) ){ |
if ( (mt22[0][rj]<4095. || mt22[1][rj]<4095.) ){ |
| 3216 |
if ( ocolo == 10 ) ocolo = noadc; |
if ( ocolo == 10 ) ocolo = noadc; |
| 3217 |
Float_t lowp = (xp22[j]-E22[j])/100.; |
Float_t lowp = -(xp22[rj]+E22[rj])/100.; |
| 3218 |
Float_t higp = (xp22[j]+E22[j])/100.; |
Float_t higp = -(xp22[rj]-E22[rj])/100.; |
| 3219 |
if ( lowp < -0.074 ) lowp = -0.074; |
if ( lowp < -0.074 ) lowp = -0.074; |
| 3220 |
if ( higp > 0.074 ) higp = 0.074; |
if ( higp > 0.074 ) higp = 0.074; |
| 3221 |
if ( lowp < higp && ( level.file == -1 || (level.file == 2 && xp22[j] != 0.))){ |
if ( lowp < higp && ( level.file == -1 || (level.file == 2 && xp22[rj] != 0.))){ |
| 3222 |
Float_t nxc1[5]={ lowp, higp, higp, lowp, lowp}; |
Float_t nxc1[5]={ lowp, higp, higp, lowp, lowp}; |
| 3223 |
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}; |
| 3224 |
Float_t nxc[5]; |
Float_t nxc[5]; |
| 3238 |
}; |
}; |
| 3239 |
}; |
}; |
| 3240 |
// |
// |
| 3241 |
|
//daquiinbasso |
| 3242 |
// |
// |
| 3243 |
// S31 X-view |
// S31 X-view |
| 3244 |
// |
// |
| 3295 |
ftof31y->Draw(); |
ftof31y->Draw(); |
| 3296 |
TPolyLine *sftof31[3]; |
TPolyLine *sftof31[3]; |
| 3297 |
tt = 1; |
tt = 1; |
| 3298 |
if ( level.file == -1 ) tt = 3; |
rj = 1; |
| 3299 |
|
if ( level.file == -1 ){ |
| 3300 |
|
tt = 3; |
| 3301 |
|
rj = 3; |
| 3302 |
|
}; |
| 3303 |
for (Int_t j=0; j<tt; j++){ |
for (Int_t j=0; j<tt; j++){ |
| 3304 |
|
rj--; |
| 3305 |
// for ( Int_t j=0; j<3; j++){ |
// for ( Int_t j=0; j<3; j++){ |
| 3306 |
if ( (mt31[0][j]<4095. || mt31[1][j]<4095.)){ |
if ( (mt31[0][rj]<4095. || mt31[1][rj]<4095.)){ |
| 3307 |
if ( ocolo == 10 ) ocolo = noadc; |
if ( ocolo == 10 ) ocolo = noadc; |
| 3308 |
Float_t lowp = (xp31[j]-E31[j])/100.; |
Float_t lowp = -(xp31[rj]+E31[rj])/100.; |
| 3309 |
Float_t higp = (xp31[j]+E31[j])/100.; |
Float_t higp = -(xp31[rj]-E31[rj])/100.; |
| 3310 |
if ( lowp < -0.074 ) lowp = -0.074; |
if ( lowp < -0.074 ) lowp = -0.074; |
| 3311 |
if ( higp > 0.074 ) higp = 0.074; |
if ( higp > 0.074 ) higp = 0.074; |
| 3312 |
if ( lowp < higp && ( level.file == -1 || (level.file == 2 && xp31[j] != 0.))){ |
if ( lowp < higp && ( level.file == -1 || (level.file == 2 && xp31[rj] != 0.))){ |
| 3313 |
Float_t nxc1[5]={ lowp, higp, higp, lowp, lowp}; |
Float_t nxc1[5]={ lowp, higp, higp, lowp, lowp}; |
| 3314 |
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}; |
| 3315 |
Float_t nxc[5]; |
Float_t nxc[5]; |
| 3336 |
Float_t s32p = 0.050; |
Float_t s32p = 0.050; |
| 3337 |
ocolo = 10; |
ocolo = 10; |
| 3338 |
TPolyLine *ftof32y[3]; |
TPolyLine *ftof32y[3]; |
| 3339 |
|
rj = 3; |
| 3340 |
for ( Int_t j=0; j<3; j++){ |
for ( Int_t j=0; j<3; j++){ |
| 3341 |
|
rj--; |
| 3342 |
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)}; |
| 3343 |
Float_t nyc1[5]={ -ws13, 0., 0., -ws13, -ws13}; |
Float_t nyc1[5]={ -ws13, 0., 0., -ws13, -ws13}; |
| 3344 |
Float_t nxc[5]; |
Float_t nxc[5]; |
| 3355 |
colo = 1; |
colo = 1; |
| 3356 |
}; |
}; |
| 3357 |
if ( level.file == -1 ){ |
if ( level.file == -1 ){ |
| 3358 |
ColorMIP(ms32a[j]+ms32b[j],colo); |
ColorMIP(ms32a[rj]+ms32b[rj],colo); |
| 3359 |
} else { |
} else { |
| 3360 |
ColorTOFMIP(ms32a[j]+ms32b[j],colo); |
ColorTOFMIP(ms32a[rj]+ms32b[rj],colo); |
| 3361 |
}; |
}; |
| 3362 |
// |
// |
| 3363 |
if ( colo != 10 ) ocolo = colo; |
if ( colo != 10 ) ocolo = colo; |
| 3447 |
// full infos from ac |
// full infos from ac |
| 3448 |
// |
// |
| 3449 |
if ( level.file == 2 ){ |
if ( level.file == 2 ){ |
| 3450 |
hitmapA = L2->hitmap[0]; |
hitmapA = L2->GetAcLevel2()->hitmap[0]; |
| 3451 |
hitmapB = L2->hitmap[1]; |
hitmapB = L2->GetAcLevel2()->hitmap[1]; |
| 3452 |
hitstatusA = L2->hitstatus[0]; |
hitstatusA = L2->GetAcLevel2()->hitstatus[0]; |
| 3453 |
hitstatusB = L2->hitstatus[1]; |
hitstatusB = L2->GetAcLevel2()->hitstatus[1]; |
| 3454 |
}; |
}; |
| 3455 |
// |
// |
| 3456 |
// |
// |
| 4324 |
pcasp4b->Draw("f"); |
pcasp4b->Draw("f"); |
| 4325 |
pcasp4b->Draw(); |
pcasp4b->Draw(); |
| 4326 |
}; |
}; |
| 4327 |
Float_t alfa = 1.2020334; |
// Float_t alfax = 1.2020334; |
| 4328 |
|
Float_t alfax = 1.22157778; |
| 4329 |
|
Float_t alfay = 1.27393111; |
| 4330 |
Float_t lcrd = 0.1815/2.; |
Float_t lcrd = 0.1815/2.; |
| 4331 |
Float_t wcrd = 0.008; |
Float_t wcrd = 0.008; |
| 4332 |
if ( true ){ |
if ( true ){ |
| 4537 |
// |
// |
| 4538 |
// Float_t cardcx = 0.143168*var.sfx; |
// Float_t cardcx = 0.143168*var.sfx; |
| 4539 |
//Float_t cardcy = 0.1475*var.sfy; |
//Float_t cardcy = 0.1475*var.sfy; |
| 4540 |
Float_t cardcx = 0.153168*var.sfx; |
// |
| 4541 |
Float_t cardcy = 0.1575*var.sfy; |
// Float_t cardcx = 0.153168*var.sfx; |
| 4542 |
Float_t acrdx[4] = {-lcrd*cos(alfa), lcrd*cos(alfa), -lcrd*cos(alfa)+wcrd*sin(alfa), -lcrd*cos(alfa)}; |
// |
| 4543 |
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; |
| 4544 |
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; |
| 4545 |
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; |
| 4546 |
|
Float_t acrdx[4] = {-lcrd*cos(alfax), lcrd*cos(alfax), -lcrd*cos(alfax)+wcrd*sin(alfax), -lcrd*cos(alfax)}; |
| 4547 |
|
Float_t acrdy[4] = {-lcrd*sin(alfax), lcrd*sin(alfax), -lcrd*sin(alfax)-wcrd*cos(alfax), -lcrd*sin(alfax)}; |
| 4548 |
|
Float_t bcrdx[4] = { lcrd*cos(alfax), lcrd*cos(alfax)+wcrd*sin(alfax), -lcrd*cos(alfax)+wcrd*sin(alfax), lcrd*cos(alfax)}; |
| 4549 |
|
Float_t bcrdy[4] = { lcrd*sin(alfax), lcrd*sin(alfax)-wcrd*cos(alfax), -lcrd*sin(alfax)-wcrd*cos(alfax), lcrd*sin(alfax)}; |
| 4550 |
|
|
| 4551 |
// |
// |
| 4552 |
// CARD3 X/ Y |
// CARD3 X/ Y |
| 4606 |
}; |
}; |
| 4607 |
|
|
| 4608 |
if ( true ){ |
if ( true ){ |
| 4609 |
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)}; |
| 4610 |
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)}; |
| 4611 |
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)}; |
| 4612 |
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)}; |
| 4613 |
// |
// |
| 4614 |
// CARD - Y-view |
// CARD - Y-view |
| 4615 |
// |
// |
| 4616 |
Float_t cardcx = 0.12*var.sfx; |
// Float_t cardcx = 0.12*var.sfx; |
| 4617 |
Float_t cardcy = 0.1475*var.sfy; |
Float_t cardcx = (0.16014*(1.-lcrd*cos(alfay)))*var.sfx; |
| 4618 |
|
// Float_t cardcy = 0.178818*var.sfy; |
| 4619 |
|
Float_t cardcy = (0.178818*(1.-lcrd*sin(alfay)))*var.sfy; |
| 4620 |
|
// Float_t cardcy = 0.1475*var.sfy; |
| 4621 |
// |
// |
| 4622 |
// CARD4 X Y/ |
// CARD4 X Y/ |
| 4623 |
// |
// |
| 4716 |
// |
// |
| 4717 |
if ( level.file == 2 ){ |
if ( level.file == 2 ){ |
| 4718 |
for ( Int_t j = 0; j<3; j++ ) { |
for ( Int_t j = 0; j<3; j++ ) { |
| 4719 |
if ( L2->S4adc != 32. ) ms4[j] = L2->S4calibrated; |
if ( L2->GetS4Level2()->S4adc != 32. ) ms4[j] = L2->GetS4Level2()->S4calibrated; |
| 4720 |
}; |
}; |
| 4721 |
}; |
}; |
| 4722 |
// |
// |
| 4801 |
}; |
}; |
| 4802 |
}; |
}; |
| 4803 |
if ( level.file == 2 ){ |
if ( level.file == 2 ){ |
| 4804 |
yUpperTrig = (Int_t)L2->trigPhysics; |
yUpperTrig = (Int_t)L2->GetNDLevel2()->trigPhysics; |
| 4805 |
yUpperBk = (Int_t)L2->upperBack; |
yUpperBk = (Int_t)L2->GetNDLevel2()->upperBack; |
| 4806 |
yBottomBk = (Int_t)L2->bottomBack; |
yBottomBk = (Int_t)L2->GetNDLevel2()->bottomBack; |
| 4807 |
}; |
}; |
| 4808 |
// |
// |
| 4809 |
var.trup = yUpperTrig; |
var.trup = yUpperTrig; |
| 5071 |
for (Int_t m = 0; m<3; m++){ |
for (Int_t m = 0; m<3; m++){ |
| 5072 |
if ( trk->signcluster[l][m] != 0. ){ |
if ( trk->signcluster[l][m] != 0. ){ |
| 5073 |
if ( planeno == 10 ) { |
if ( planeno == 10 ) { |
|
x = 1024 - trk->addrcluster[l][m]; |
|
|
} else { |
|
| 5074 |
x = trk->addrcluster[l][m]; |
x = trk->addrcluster[l][m]; |
| 5075 |
|
} else { |
| 5076 |
|
x = 1024 - trk->addrcluster[l][m]; |
| 5077 |
}; |
}; |
| 5078 |
linea = new TLine(14.+x,0.01,14.+x,0.3); |
linea = new TLine(14.+x,0.01,14.+x,0.3); |
| 5079 |
linea->SetLineWidth(2); |
linea->SetLineWidth(2); |
| 5110 |
// |
// |
| 5111 |
// singlets X |
// singlets X |
| 5112 |
// |
// |
| 5113 |
for (Int_t sing = 0; sing < L2->nclsx(); sing++){ |
for (Int_t sing = 0; sing < L2->GetTrkLevel2()->nclsx(); sing++){ |
| 5114 |
TClonesArray &t = *(L2->SingletX); |
TClonesArray &t = *(L2->GetTrkLevel2()->SingletX); |
| 5115 |
TrkSinglet *singlet = (TrkSinglet*)t[sing]; |
TrkSinglet *singlet = (TrkSinglet*)t[sing]; |
| 5116 |
x = (singlet->coord[0]+singlet->coord[1])/2.; |
x = (singlet->coord[0]+singlet->coord[1])/2.; |
| 5117 |
// |
// |
| 5135 |
// |
// |
| 5136 |
// singlets Y |
// singlets Y |
| 5137 |
// |
// |
| 5138 |
for (Int_t sing = 0; sing < L2->nclsy(); sing++){ |
for (Int_t sing = 0; sing < L2->GetTrkLevel2()->nclsy(); sing++){ |
| 5139 |
TClonesArray &t = *(L2->SingletY); |
TClonesArray &t = *(L2->GetTrkLevel2()->SingletY); |
| 5140 |
TrkSinglet *singlet = (TrkSinglet*)t[sing]; |
TrkSinglet *singlet = (TrkSinglet*)t[sing]; |
| 5141 |
// |
// |
| 5142 |
Int_t planepad = (singlet->plane - 1)* 2; |
Int_t planepad = (singlet->plane - 1)* 2; |
| 5143 |
trkpad[planepad]->cd(); |
trkpad[planepad]->cd(); |
| 5144 |
trkpad[planepad]->Range(-7.05,0.,7.05,8.); |
trkpad[planepad]->Range(-7.05,0.,7.05,8.); |
| 5145 |
for (Int_t img=0; img<2; img++){ |
for (Int_t img=0; img<2; img++){ |
| 5146 |
x = singlet->coord[img]; |
x = -singlet->coord[img]; |
| 5147 |
Float_t xsig = singlet->sgnl; |
Float_t xsig = singlet->sgnl; |
| 5148 |
if ( xsig > 8. ) xsig = 8.; |
if ( xsig > 8. ) xsig = 8.; |
| 5149 |
// |
// |
| 5181 |
dcol = 2; |
dcol = 2; |
| 5182 |
}; |
}; |
| 5183 |
// |
// |
| 5184 |
if ( L2->GetNTracks() > 0 ){ |
if ( L2->GetTrkLevel2()->GetNTracks() > 0 ){ |
| 5185 |
for (Int_t nt = 0; nt < L2->GetNTracks(); nt++){ |
for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ |
| 5186 |
TrkTrack *track = L2->GetTrack(nt); |
PamTrack *ptrack= L2->GetTrack(nt); |
| 5187 |
|
TrkTrack *track = ptrack->GetTrkTrack(); |
| 5188 |
if ( nt == 0 ){ |
if ( nt == 0 ){ |
| 5189 |
var.rig = 0.; |
var.rig = 0.; |
| 5190 |
if ( track->al[4] != 0. ) var.rig = 1./track->al[4]; |
if ( track->al[4] != 0. ) var.rig = 1./track->al[4]; |
| 5200 |
// |
// |
| 5201 |
x = track->xm[plane]; |
x = track->xm[plane]; |
| 5202 |
Float_t xsig = track->dedx_x[plane]; |
Float_t xsig = track->dedx_x[plane]; |
| 5203 |
if ( track->xgood[plane] ){ |
if ( track->XGood(plane) ){ |
| 5204 |
//if ( x > -100 ){ |
//if ( x > -100 ){ |
| 5205 |
if ( xsig > 8. ) xsig = 8.; |
if ( xsig > 8. ) xsig = 8.; |
| 5206 |
if ( var.bw ){ |
if ( var.bw ){ |
| 5228 |
planepad = plane * 2; |
planepad = plane * 2; |
| 5229 |
trkpad[planepad]->cd(); |
trkpad[planepad]->cd(); |
| 5230 |
trkpad[planepad]->Range(-7.05,0.,7.05,8.); |
trkpad[planepad]->Range(-7.05,0.,7.05,8.); |
| 5231 |
x = track->ym[plane]; |
x = -track->ym[plane]; |
| 5232 |
xsig = track->dedx_y[plane]; |
xsig = track->dedx_y[plane]; |
| 5233 |
if ( track->ygood[plane] ){ |
if ( track->YGood(plane) ){ |
| 5234 |
// if ( x > -100 ){ |
// if ( x > -100 ){ |
| 5235 |
if ( xsig > 8. ) xsig = 8.; |
if ( xsig > 8. ) xsig = 8.; |
| 5236 |
if ( var.bw ){ |
if ( var.bw ){ |
| 5280 |
// |
// |
| 5281 |
// first of all plot crosses relatives to tracks |
// first of all plot crosses relatives to tracks |
| 5282 |
// |
// |
| 5283 |
if ( L2->GetNTracks() > 0 ){ |
if ( L2->GetTrkLevel2()->GetNTracks() > 0 ){ |
| 5284 |
for (Int_t nt = 0; nt < L2->GetNTracks(); nt++){ |
// for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ |
| 5285 |
TrkTrack *track = L2->GetTrack(nt); |
// TrkTrack *track = L2->GetTrkLevel2()->GetTrack(nt); |
| 5286 |
|
for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ |
| 5287 |
|
PamTrack *ptrack= L2->GetTrack(nt); |
| 5288 |
|
TrkTrack *track = ptrack->GetTrkTrack(); |
| 5289 |
|
// |
| 5290 |
for (Int_t plane = 0; plane<6; plane++){ |
for (Int_t plane = 0; plane<6; plane++){ |
| 5291 |
// |
// |
| 5292 |
x = track->xm[plane]; |
x = track->xm[plane]; |
| 5293 |
Float_t y = track->ym[plane]; |
Float_t y = -track->ym[plane]; |
| 5294 |
Float_t xsig = track->dedx_x[plane]; |
Float_t xsig = track->dedx_x[plane]; |
| 5295 |
Float_t ysig = track->dedx_y[plane]; |
Float_t ysig = track->dedx_y[plane]; |
| 5296 |
// if ( x > -100 && y > -100. ){ |
// if ( x > -100 && y > -100. ){ |
| 5297 |
if ( track->xgood[plane] && track->ygood[plane] ){ |
if ( track->XGood(plane) && track->YGood(plane) ){ |
| 5298 |
if ( var.bw ){ |
if ( var.bw ){ |
| 5299 |
sigcol1 = -1; |
sigcol1 = -1; |
| 5300 |
sigcol2 = -1; |
sigcol2 = -1; |
| 5332 |
// |
// |
| 5333 |
// try to plot crosses relative to singlets |
// try to plot crosses relative to singlets |
| 5334 |
// |
// |
| 5335 |
if ( L2->nclsx() > 0 && L2->nclsy() > 0 ){ |
if ( L2->GetTrkLevel2()->nclsx() > 0 && L2->GetTrkLevel2()->nclsy() > 0 ){ |
| 5336 |
for (Int_t plane = 1; plane<7; plane++){ |
for (Int_t plane = 1; plane<7; plane++){ |
| 5337 |
// |
// |
| 5338 |
// 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: |
| 5346 |
TArrayF *array2 = new TArrayF(5000); |
TArrayF *array2 = new TArrayF(5000); |
| 5347 |
TArrayF *sigarrax = new TArrayF(5000); |
TArrayF *sigarrax = new TArrayF(5000); |
| 5348 |
TArrayF *sigarray = new TArrayF(5000); |
TArrayF *sigarray = new TArrayF(5000); |
| 5349 |
for (Int_t sing = 0; sing < L2->nclsx(); sing++){ |
for (Int_t sing = 0; sing < L2->GetTrkLevel2()->nclsx(); sing++){ |
| 5350 |
TClonesArray &t = *(L2->SingletX); |
TClonesArray &t = *(L2->GetTrkLevel2()->SingletX); |
| 5351 |
TrkSinglet *singlet = (TrkSinglet*)t[sing]; |
TrkSinglet *singlet = (TrkSinglet*)t[sing]; |
| 5352 |
if ( singlet->plane == plane ){ |
if ( singlet->plane == plane ){ |
| 5353 |
arrax->AddAt(((singlet->coord[0]+singlet->coord[1])/2.),totsx); |
arrax->AddAt(((singlet->coord[0]+singlet->coord[1])/2.),totsx); |
| 5376 |
totsx++; |
totsx++; |
| 5377 |
}; |
}; |
| 5378 |
}; |
}; |
| 5379 |
for (Int_t sing = 0; sing < L2->nclsy(); sing++){ |
for (Int_t sing = 0; sing < L2->GetTrkLevel2()->nclsy(); sing++){ |
| 5380 |
TClonesArray &t = *(L2->SingletY); |
TClonesArray &t = *(L2->GetTrkLevel2()->SingletY); |
| 5381 |
TrkSinglet *singlet = (TrkSinglet*)t[sing]; |
TrkSinglet *singlet = (TrkSinglet*)t[sing]; |
| 5382 |
if ( singlet->plane == plane ){ |
if ( singlet->plane == plane ){ |
| 5383 |
array1->AddAt(singlet->coord[0],totsy); |
array1->AddAt(singlet->coord[0],totsy); |
| 5412 |
for (Int_t sing = 0; sing < min(totsx,totsy); sing++){ |
for (Int_t sing = 0; sing < min(totsx,totsy); sing++){ |
| 5413 |
// |
// |
| 5414 |
x = arrax->At(orderx->At(sing)); |
x = arrax->At(orderx->At(sing)); |
| 5415 |
Float_t y1 = array1->At(ordery->At(sing)); |
Float_t y1 = -array1->At(ordery->At(sing)); |
| 5416 |
Float_t y2 = array2->At(ordery->At(sing)); |
Float_t y2 = -array2->At(ordery->At(sing)); |
| 5417 |
Float_t xsig = sigarrax->At(orderx->At(sing)); |
Float_t xsig = sigarrax->At(orderx->At(sing)); |
| 5418 |
Float_t ysig = sigarray->At(ordery->At(sing)); |
Float_t ysig = sigarray->At(ordery->At(sing)); |
| 5419 |
if ( x > -100 && y1 > -100. ){ |
if ( x > -100 && y1 > -100. ){ |
| 5506 |
for (Int_t m = 0; m<3; m++){ |
for (Int_t m = 0; m<3; m++){ |
| 5507 |
if ( trk->signcluster[l][m] != 0. ){ |
if ( trk->signcluster[l][m] != 0. ){ |
| 5508 |
if ( planeno == 10 ) { |
if ( planeno == 10 ) { |
|
x = 1024 - trk->addrcluster[l][m]; |
|
|
} else { |
|
| 5509 |
x = trk->addrcluster[l][m]; |
x = trk->addrcluster[l][m]; |
| 5510 |
|
} else { |
| 5511 |
|
x = 1024 - trk->addrcluster[l][m]; |
| 5512 |
}; |
}; |
| 5513 |
x += 1024.; |
x += 1024.; |
| 5514 |
if ( trk->signcluster[l][m]> ysig ){ |
if ( trk->signcluster[l][m]> ysig ){ |
| 5515 |
ysig = trk->signcluster[l][m]; |
ysig = trk->signcluster[l][m]; |
| 5516 |
yh1[ncro] = x-1024.; |
yh1[ncro] = x - 1024.; |
| 5517 |
yh2[ncro] = x; |
yh2[ncro] = x; |
| 5518 |
}; |
}; |
| 5519 |
}; |
}; |
| 5541 |
for (Int_t m = 0; m<3; m++){ |
for (Int_t m = 0; m<3; m++){ |
| 5542 |
if ( trk->signcluster[e][m] != 0. ){ |
if ( trk->signcluster[e][m] != 0. ){ |
| 5543 |
if ( planeno == 10 ) { |
if ( planeno == 10 ) { |
|
x = 1024 - trk->addrcluster[e][m]; |
|
|
} else { |
|
| 5544 |
x = trk->addrcluster[e][m]; |
x = trk->addrcluster[e][m]; |
| 5545 |
|
} else { |
| 5546 |
|
x = 1024 - trk->addrcluster[e][m]; |
| 5547 |
}; |
}; |
| 5548 |
x += 1024.; |
x += 1024.; |
| 5549 |
if ( trk->signcluster[e][m]> ysig ){ |
if ( trk->signcluster[e][m]> ysig ){ |
| 5550 |
ysig = trk->signcluster[e][m]; |
ysig = trk->signcluster[e][m]; |
| 5551 |
yh1[ncro] = x-1024.; |
yh1[ncro] = x - 1024.; |
| 5552 |
yh2[ncro] = x; |
yh2[ncro] = x; |
| 5553 |
}; |
}; |
| 5554 |
}; |
}; |
| 5600 |
|
|
| 5601 |
void FEVdetector::ShowTrack(){ |
void FEVdetector::ShowTrack(){ |
| 5602 |
// |
// |
| 5603 |
|
if ( level.file != 2 ) return; |
| 5604 |
// |
// |
| 5605 |
// |
// |
|
if ( !var.TRK || level.file != 2 ) return; |
|
| 5606 |
// |
// |
| 5607 |
if ( L2->GetNTracks() > 0 ){ |
if ( var.CALO && var.CALOT ){ |
| 5608 |
for (Int_t nt = 0; nt < L2->GetNTracks(); nt++){ |
if ( L2->GetCaloLevel2()->npcfit[0] > 0 && L2->GetCaloLevel2()->npcfit[1] > 0 ){ |
| 5609 |
TrkTrack *track = L2->GetTrack(nt); |
Float_t calx[22]; |
| 5610 |
|
Float_t caly[22]; |
| 5611 |
|
Float_t calzx[22]; |
| 5612 |
|
Float_t calzy[22]; |
| 5613 |
|
Float_t zpiano[22]; |
| 5614 |
|
zpiano[0] = (CTZ+118.)*var.sfy/1000.; |
| 5615 |
|
for (Int_t plane = 1; plane < 22; plane++){ |
| 5616 |
|
if ( !(plane%2) ){ |
| 5617 |
|
zpiano[plane] = zpiano[plane-1] - 8.09*var.sfy/1000.; |
| 5618 |
|
}else { |
| 5619 |
|
zpiano[plane] = zpiano[plane-1] - 10.09*var.sfy/1000.; |
| 5620 |
|
}; |
| 5621 |
|
}; |
| 5622 |
|
for (Int_t plane = 0; plane < 22; plane++){ |
| 5623 |
|
calx[plane] = (L2->GetCaloLevel2()->cbar[plane][0]/100.)*var.sfx + var.xxvc;; |
| 5624 |
|
caly[plane] = (-L2->GetCaloLevel2()->cbar[plane][1]/100.)*var.sfx + var.xyvc; |
| 5625 |
|
// calzx[plane] = zpiano[plane] -5.81*var.sfy/1000. + var.yxvc; |
| 5626 |
|
calzx[plane] = zpiano[plane] + var.yxvc; |
| 5627 |
|
calzy[plane] = zpiano[plane] + var.yyvc; |
| 5628 |
|
// printf(" calx %f caly %f calzx %f calzy %f \n",calx[plane],caly[plane],calzx[plane],calzy[plane]); |
| 5629 |
|
}; |
| 5630 |
|
// |
| 5631 |
|
// Calorimeter track |
| 5632 |
|
// |
| 5633 |
|
Int_t trcol = 30; |
| 5634 |
|
if ( var.bw ){ |
| 5635 |
|
trcol = 14; |
| 5636 |
|
} else { |
| 5637 |
|
trcol = 44; |
| 5638 |
|
}; |
| 5639 |
|
thefigure->cd(); |
| 5640 |
|
TPolyLine *trakx = new TPolyLine(22,calx,calzx); |
| 5641 |
|
trakx->SetLineColor(trcol); |
| 5642 |
|
if ( L2->GetCaloLevel2()->fitmode[0] == 1 ) trakx->SetLineStyle(3); |
| 5643 |
|
if ( L2->GetCaloLevel2()->fitmode[0] == 2 ) trakx->SetLineStyle(4); |
| 5644 |
|
trakx->SetLineWidth(2); |
| 5645 |
|
trakx->Draw(); |
| 5646 |
|
TPolyLine *traky = new TPolyLine(22,caly,calzy); |
| 5647 |
|
traky->SetLineColor(trcol); |
| 5648 |
|
if ( L2->GetCaloLevel2()->fitmode[1] == 1 ) traky->SetLineStyle(3); |
| 5649 |
|
if ( L2->GetCaloLevel2()->fitmode[1] == 2 ) traky->SetLineStyle(4); |
| 5650 |
|
traky->SetLineWidth(2); |
| 5651 |
|
traky->Draw(); |
| 5652 |
|
}; |
| 5653 |
|
if ( L2->GetCaloLevel2()->npcfit[2] > 0 ){ |
| 5654 |
|
Float_t calx[22]; |
| 5655 |
|
Float_t caly[22]; |
| 5656 |
|
Float_t calzx[22]; |
| 5657 |
|
Float_t calzy[22]; |
| 5658 |
|
Float_t zpiano[22]; |
| 5659 |
|
zpiano[0] = (CTZ+118.)*var.sfy/1000.; |
| 5660 |
|
for (Int_t plane = 1; plane < 22; plane++){ |
| 5661 |
|
if ( !(plane%2) ){ |
| 5662 |
|
zpiano[plane] = zpiano[plane-1] - 8.09*var.sfy/1000.; |
| 5663 |
|
}else { |
| 5664 |
|
zpiano[plane] = zpiano[plane-1] - 10.09*var.sfy/1000.; |
| 5665 |
|
}; |
| 5666 |
|
}; |
| 5667 |
|
// |
| 5668 |
|
// |
| 5669 |
|
CaloTrkVar *ctra = L2->GetCaloStoredTrack(-1); |
| 5670 |
|
// |
| 5671 |
|
for (Int_t plane = 0; plane < 22; plane++){ |
| 5672 |
|
calx[plane] = (ctra->tbar[plane][0]/100.)*var.sfx + var.xxvc;; |
| 5673 |
|
caly[plane] = (-ctra->tbar[plane][1]/100.)*var.sfx + var.xyvc; |
| 5674 |
|
// calzx[plane] = zpiano[plane] -5.81*var.sfy/1000. + var.yxvc; |
| 5675 |
|
calzx[plane] = zpiano[plane] + var.yxvc; |
| 5676 |
|
calzy[plane] = zpiano[plane] + var.yyvc; |
| 5677 |
|
// printf(" calx %f caly %f calzx %f calzy %f \n",calx[plane],caly[plane],calzx[plane],calzy[plane]); |
| 5678 |
|
}; |
| 5679 |
|
// |
| 5680 |
|
// Calorimeter track |
| 5681 |
|
// |
| 5682 |
|
Int_t trcol = 30; |
| 5683 |
|
if ( var.bw ){ |
| 5684 |
|
trcol = 16; |
| 5685 |
|
} else { |
| 5686 |
|
trcol = 46; |
| 5687 |
|
}; |
| 5688 |
|
thefigure->cd(); |
| 5689 |
|
TPolyLine *trakx = new TPolyLine(22,calx,calzx); |
| 5690 |
|
trakx->SetLineColor(trcol); |
| 5691 |
|
trakx->SetLineStyle(3); |
| 5692 |
|
trakx->SetLineWidth(2); |
| 5693 |
|
trakx->Draw(); |
| 5694 |
|
TPolyLine *traky = new TPolyLine(22,caly,calzy); |
| 5695 |
|
traky->SetLineColor(trcol); |
| 5696 |
|
traky->SetLineStyle(3); |
| 5697 |
|
traky->SetLineWidth(2); |
| 5698 |
|
traky->Draw(); |
| 5699 |
|
}; |
| 5700 |
|
}; |
| 5701 |
|
// |
| 5702 |
|
if ( !var.TRK ) return; |
| 5703 |
|
// |
| 5704 |
|
if ( L2->GetTrkLevel2()->GetNTracks() > 0 ){ |
| 5705 |
|
for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ |
| 5706 |
|
|
| 5707 |
|
// TrkTrack *track = L2->GetTrkLevel2()->GetTrack(nt); |
| 5708 |
|
// printf("qui \n"); |
| 5709 |
|
PamTrack *ptrack = L2->GetTrack(nt); |
| 5710 |
|
TrkTrack *track = ptrack->GetTrkTrack(); |
| 5711 |
|
// printf("qua \n"); |
| 5712 |
Int_t npoint = 100; |
Int_t npoint = 100; |
| 5713 |
Float_t zin[100]; |
Float_t zin[100]; |
| 5714 |
Double_t xout[100]; |
Double_t xout[100]; |
| 5762 |
if ( !ifail ){ |
if ( !ifail ){ |
| 5763 |
for ( Int_t e = 0; e < npoint ; e++) { |
for ( Int_t e = 0; e < npoint ; e++) { |
| 5764 |
tx[e] = ((float)tr->x[e]/100.)*var.sfx + var.xxvc; |
tx[e] = ((float)tr->x[e]/100.)*var.sfx + var.xxvc; |
| 5765 |
ty[e] = ((float)tr->y[e]/100.)*var.sfx + var.xyvc; |
ty[e] = (-(float)tr->y[e]/100.)*var.sfx + var.xyvc; |
| 5766 |
if ( e < 50 ) { |
if ( e < 50 ) { |
| 5767 |
ptx1[e] = ((float)tr->y[e]/100.)*var.sfx + var.xcat; |
ptx1[e] = (-(float)tr->y[e]/100.)*var.sfx + var.xcat; |
| 5768 |
pty1[e] = ((float)tr->x[e]/100.)*var.sfy + var.ycat; |
pty1[e] = ((float)tr->x[e]/100.)*var.sfy + var.ycat; |
| 5769 |
} else { |
} else { |
| 5770 |
ptx2[e-50] = ((float)tr->y[e]/100.)*var.sfx + var.xcat; |
ptx2[e-50] = (-(float)tr->y[e]/100.)*var.sfx + var.xcat; |
| 5771 |
pty2[e-50] = ((float)tr->x[e]/100.)*var.sfy + var.ycat; |
pty2[e-50] = ((float)tr->x[e]/100.)*var.sfy + var.ycat; |
| 5772 |
}; |
}; |
| 5773 |
if ( e > 84 ) { |
if ( e > 84 ) { |
| 5774 |
tx1[e-85] = ((float)tr->x[e]/100.)*var.nds4 + var.xxvc; |
tx1[e-85] = ((float)tr->x[e]/100.)*var.nds4 + var.xxvc; |
| 5775 |
ty1[e-85] = ((float)tr->y[e]/100.)*var.nds4 + var.xyvc; |
ty1[e-85] = (-(float)tr->y[e]/100.)*var.nds4 + var.xyvc; |
| 5776 |
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; |
| 5777 |
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; |
| 5778 |
}; |
}; |
| 5779 |
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; |
| 5780 |
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; |
| 5781 |
|
// printf("tx[e] %f ty [e] %f tzx %f tzy %f \n",tx[e],ty[e],tzx[e],tzy[e]); |
| 5782 |
}; |
}; |
| 5783 |
// |
// |
| 5784 |
// From S1 to CALO |
// From S1 to CALO |
| 5916 |
Int_t se = 5; |
Int_t se = 5; |
| 5917 |
if ( !l && m%2 == 0 ) se = 3; |
if ( !l && m%2 == 0 ) se = 3; |
| 5918 |
if ( !l && m%2 != 0 ) se = 2; |
if ( !l && m%2 != 0 ) se = 2; |
| 5919 |
if ( l && m%2 == 0 ) se = 1; |
if ( l && m%2 != 0 ) se = 1; |
| 5920 |
if ( l && m%2 != 0 ) se = 0; |
if ( l && m%2 == 0 ) se = 0; |
| 5921 |
// |
// |
| 5922 |
// determine what kind of event we are going to analyze |
// determine what kind of event we are going to analyze |
| 5923 |
// |
// |
| 6012 |
Xview->Draw("box same"); |
Xview->Draw("box same"); |
| 6013 |
}; |
}; |
| 6014 |
if ( l == 1 ) { |
if ( l == 1 ) { |
| 6015 |
Yview->Fill(n,21-m,1.); |
Yview->Fill(95-n,21-m,1.); |
| 6016 |
pd2->cd(); |
pd2->cd(); |
| 6017 |
Yview->Draw("box same"); |
Yview->Draw("box same"); |
| 6018 |
}; |
}; |
| 6032 |
// |
// |
| 6033 |
// Define variables |
// Define variables |
| 6034 |
// |
// |
| 6035 |
Int_t etime = var.etime; |
UInt_t etime = var.etime; |
| 6036 |
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]; |
| 6037 |
Int_t badstrip = 0; |
Int_t badstrip = 0; |
| 6038 |
qtot = 0.; |
qtot = 0.; |
| 6104 |
if ( calib.ttime[s][b[s]+1] && calib.time[s][b[s]] ){ |
if ( calib.ttime[s][b[s]+1] && calib.time[s][b[s]] ){ |
| 6105 |
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 ){ |
| 6106 |
printf(" CALORIMETER: \n" ); |
printf(" CALORIMETER: \n" ); |
| 6107 |
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]); |
| 6108 |
printf(" END CALORIMETER. \n\n" ); |
printf(" END CALORIMETER. \n\n" ); |
| 6109 |
b[s]++; |
b[s]++; |
| 6110 |
CaloPede(s); |
CaloPede(s); |
| 6124 |
Int_t se = 5; |
Int_t se = 5; |
| 6125 |
if (l == 0 && m%2 == 0) se = 3; |
if (l == 0 && m%2 == 0) se = 3; |
| 6126 |
if (l == 0 && m%2 != 0) se = 2; |
if (l == 0 && m%2 != 0) se = 2; |
| 6127 |
if (l == 1 && m%2 == 0) se = 1; |
if (l == 1 && m%2 != 0) se = 1; |
| 6128 |
if (l == 1 && m%2 != 0) se = 0; |
if (l == 1 && m%2 == 0) se = 0; |
| 6129 |
// |
// |
| 6130 |
// determine what kind of event we are going to analyze |
// determine what kind of event we are going to analyze |
| 6131 |
// |
// |
| 6241 |
Xview->Draw("box same"); |
Xview->Draw("box same"); |
| 6242 |
}; |
}; |
| 6243 |
if ( l == 1 ) { |
if ( l == 1 ) { |
| 6244 |
Yview->Fill(n,21-m,1.); |
Yview->Fill(96-n,21-m,1.); |
| 6245 |
pd2->cd(); |
pd2->cd(); |
| 6246 |
Yview->Draw("box same"); |
Yview->Draw("box same"); |
| 6247 |
}; |
}; |
| 6328 |
// |
// |
| 6329 |
stringstream xvev; |
stringstream xvev; |
| 6330 |
stringstream yvev; |
stringstream yvev; |
| 6331 |
for (Int_t ii = 0; ii < L2->nstrip; ii++){ |
for (Int_t ii = 0; ii < L2->GetCaloLevel2()->nstrip; ii++){ |
| 6332 |
Int_t colo; |
Int_t colo; |
| 6333 |
Int_t l; |
Int_t l; |
| 6334 |
Int_t m; |
Int_t m; |
| 6335 |
Int_t n; |
Int_t n; |
| 6336 |
Float_t mip = L2->DecodeEstrip(ii,l,m,n); |
Bool_t satura = false; |
| 6337 |
|
Float_t mip = L2->GetCaloLevel1()->DecodeEstrip(ii,l,m,n,satura); |
| 6338 |
if ( var.bw ){ |
if ( var.bw ){ |
| 6339 |
colo = -1; |
colo = -1; |
| 6340 |
} else { |
} else { |
| 6341 |
colo = 1; |
colo = 1; |
| 6342 |
}; |
}; |
| 6343 |
ColorMIP(mip,colo); |
ColorMIP(mip,colo); |
| 6344 |
if ( l == 0 ) { |
if ( l == 0 ) { |
| 6345 |
xvev.str(""); |
xvev.str(""); |
| 6348 |
xvev << " " << l; |
xvev << " " << l; |
| 6349 |
gDirectory->Delete(xvev.str().c_str()); |
gDirectory->Delete(xvev.str().c_str()); |
| 6350 |
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); |
| 6351 |
Xview->SetFillColor(colo); |
if ( satura ){ |
| 6352 |
|
Xview->SetFillColor(kBlack); |
| 6353 |
|
} else { |
| 6354 |
|
Xview->SetFillColor(colo); |
| 6355 |
|
}; |
| 6356 |
Xview->Fill(n,21-m,1.); |
Xview->Fill(n,21-m,1.); |
| 6357 |
pd1->cd(); |
pd1->cd(); |
| 6358 |
Xview->Draw("box same"); |
Xview->Draw("box same"); |
| 6364 |
yvev << " " << l; |
yvev << " " << l; |
| 6365 |
gDirectory->Delete(yvev.str().c_str()); |
gDirectory->Delete(yvev.str().c_str()); |
| 6366 |
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); |
| 6367 |
Yview->SetFillColor(colo); |
if ( satura ){ |
| 6368 |
Yview->Fill(n,21-m,1.); |
Yview->SetFillColor(kBlack); |
| 6369 |
|
} else { |
| 6370 |
|
Yview->SetFillColor(colo); |
| 6371 |
|
}; |
| 6372 |
|
Yview->Fill(96-n,21-m,1.); |
| 6373 |
pd2->cd(); |
pd2->cd(); |
| 6374 |
Yview->Draw("box same"); |
Yview->Draw("box same"); |
| 6375 |
}; |
}; |
| 6376 |
}; |
}; |
| 6377 |
pd1->Update(); |
pd1->Update(); |
| 6378 |
pd2->Update(); |
pd2->Update(); |
| 6379 |
var.qtot=(int)L2->qtot; |
var.qtot=(int)L2->GetCaloLevel2()->qtot; |
| 6380 |
var.nstrip=(int)L2->nstrip; |
var.nstrip=(int)L2->GetCaloLevel2()->nstrip; |
| 6381 |
}; |
}; |
| 6382 |
} |
} |
| 6383 |
|
|
| 6418 |
for (Int_t d = 0; d<48; d++){ |
for (Int_t d = 0; d<48; d++){ |
| 6419 |
if ( calib.ttime[s][d] != 0 ) calibex++; |
if ( calib.ttime[s][d] != 0 ) calibex++; |
| 6420 |
if ( calib.time[s][0] != 0 ){ |
if ( calib.time[s][0] != 0 ){ |
| 6421 |
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]); |
| 6422 |
if ( calib.time[s][d+1] != 0 ) { |
if ( calib.time[s][d+1] != 0 ) { |
| 6423 |
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]); |
| 6424 |
} else { |
} else { |
| 6425 |
if ( !stop ){ |
if ( !stop ){ |
| 6426 |
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]); |
| 6427 |
stop = 1; |
stop = 1; |
| 6428 |
}; |
}; |
| 6429 |
}; |
}; |
| 6430 |
} else { |
} else { |
| 6431 |
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]); |
| 6432 |
}; |
}; |
| 6433 |
}; |
}; |
| 6434 |
printf("\n"); |
printf("\n"); |
| 6493 |
calib.ttime[s][inter] = 0; |
calib.ttime[s][inter] = 0; |
| 6494 |
if ( ce->cstwerr[s] != 0 && ce->cperror[s] == 0 ) { |
if ( ce->cstwerr[s] != 0 && ce->cperror[s] == 0 ) { |
| 6495 |
//calib.ttime[s][inter] = cph->GetOrbitalTime(); |
//calib.ttime[s][inter] = cph->GetOrbitalTime(); |
| 6496 |
calib.ttime[s][inter] = cph->OrbitalTime; |
calib.ttime[s][inter] = (UInt_t)cph->OrbitalTime; |
| 6497 |
inter++; |
inter++; |
| 6498 |
} else { |
} else { |
| 6499 |
if ( ce->cstwerr[s] != 0 && ce->cperror[s] != 0 ) { |
if ( ce->cstwerr[s] != 0 && ce->cperror[s] != 0 ) { |
| 6547 |
tr->GetEntry(ci); |
tr->GetEntry(ci); |
| 6548 |
cph = ceh->GetPscuHeader(); |
cph = ceh->GetPscuHeader(); |
| 6549 |
//if ( atime == cph->GetOrbitalTime()){ |
//if ( atime == cph->GetOrbitalTime()){ |
| 6550 |
if ( atime == cph->OrbitalTime){ |
if ( atime == (UInt_t)cph->OrbitalTime){ |
| 6551 |
// calib.iev = ce->iev; |
// calib.iev = ce->iev; |
| 6552 |
if (ce->cstwerr[s] != 0 && ce->cperror[s] == 0 ) { |
if (ce->cstwerr[s] != 0 && ce->cperror[s] == 0 ) { |
| 6553 |
for ( Int_t d=0 ; d<11 ;d++ ){ |
for ( Int_t d=0 ; d<11 ;d++ ){ |