| 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 |
|
extern Bool_t NODB; |
| 76 |
// |
// |
| 77 |
|
|
| 78 |
using namespace std; |
using namespace std; |
| 84 |
thefigure = &figure; |
thefigure = &figure; |
| 85 |
checkctrlword(); |
checkctrlword(); |
| 86 |
var.selex = false; |
var.selex = false; |
| 87 |
|
var.showall = false; |
| 88 |
|
|
| 89 |
|
var.showsi = false; |
| 90 |
|
var.shownd = false; |
| 91 |
|
var.shows4 = false; |
| 92 |
|
var.showorb = false; |
| 93 |
|
var.showtof = false; |
| 94 |
|
var.showtrg = false; |
| 95 |
|
var.showtrk = false; |
| 96 |
|
var.showcal = false; |
| 97 |
|
var.showrun = false; |
| 98 |
|
var.showac = false; |
| 99 |
|
} |
| 100 |
|
|
| 101 |
|
void FEVdetector::Reset(){ |
| 102 |
|
L2 = NULL; |
| 103 |
} |
} |
| 104 |
|
|
| 105 |
void FEVdetector::checkctrlword(){ |
void FEVdetector::checkctrlword(){ |
| 108 |
var.AC = 0; |
var.AC = 0; |
| 109 |
var.RUN = 1; |
var.RUN = 1; |
| 110 |
var.TRK = 0; |
var.TRK = 0; |
| 111 |
|
var.ORB = 1; |
| 112 |
|
var.TRG = 1; |
| 113 |
var.CALO = 0; |
var.CALO = 0; |
| 114 |
|
var.CALOT = 0; |
| 115 |
var.S4 = 0; |
var.S4 = 0; |
| 116 |
var.ND = 0; |
var.ND = 0; |
| 117 |
var.INFOS = 0; |
var.INFOS = 0; |
| 151 |
}; |
}; |
| 152 |
|
|
| 153 |
void FEVdetector::GetWindow(){ |
void FEVdetector::GetWindow(){ |
| 154 |
otr->GetEntry(maxevent); |
// |
| 155 |
|
if ( level.file == 2 ){ |
| 156 |
|
// printf("0qui\n"); |
| 157 |
|
L2->GetEntry(minevent); |
| 158 |
|
} else { |
| 159 |
|
otr->GetEntry(minevent); |
| 160 |
|
} |
| 161 |
if ( level.file < 2 ){ |
if ( level.file < 2 ){ |
| 162 |
ph = eh->GetPscuHeader(); |
ph = eh->GetPscuHeader(); |
| 163 |
lastevno = (int)ph->Counter; |
firstevno = (int)ph->Counter; |
| 164 |
} else { |
} else { |
| 165 |
lastevno = L2->GetOrbitalInfo()->pkt_num; // to be changed as soon as we will have pkt_counter in the level2 file! |
if ( var.ORB ){ |
| 166 |
|
firstevno = L2->GetOrbitalInfo()->pkt_num; |
| 167 |
|
} else { |
| 168 |
|
firstevno = 0; |
| 169 |
|
}; |
| 170 |
}; |
}; |
| 171 |
otr->GetEntry(minevent); |
// |
| 172 |
|
if ( level.file == 2 ){ |
| 173 |
|
// printf("1qui\n"); |
| 174 |
|
L2->GetEntry(maxevent); |
| 175 |
|
} else { |
| 176 |
|
otr->GetEntry(maxevent); |
| 177 |
|
} |
| 178 |
|
// |
| 179 |
if ( level.file < 2 ){ |
if ( level.file < 2 ){ |
| 180 |
ph = eh->GetPscuHeader(); |
ph = eh->GetPscuHeader(); |
| 181 |
firstevno = (int)ph->Counter; |
lastevno = (int)ph->Counter; |
| 182 |
} else { |
} else { |
| 183 |
firstevno = L2->GetOrbitalInfo()->pkt_num; // to be changed as soon as we will have pkt_counter in the level2 file! |
if ( var.ORB ){ |
| 184 |
|
lastevno = L2->GetOrbitalInfo()->pkt_num; |
| 185 |
|
} else { |
| 186 |
|
lastevno = 0; |
| 187 |
|
}; |
| 188 |
}; |
}; |
| 189 |
|
// |
| 190 |
} |
} |
| 191 |
|
|
| 192 |
void FEVdetector::ClearVariables(){ |
void FEVdetector::ClearVariables(){ |
| 209 |
} |
} |
| 210 |
|
|
| 211 |
void FEVdetector::GetEntry(Int_t i){ |
void FEVdetector::GetEntry(Int_t i){ |
| 212 |
thisentry = i; |
thisentry = i; |
| 213 |
otr->GetEntry(i); |
if ( level.file == 2 ){ |
| 214 |
// PrintData(otr,-1LL,44); |
// L2->Clear(); |
| 215 |
|
// printf("qui\n"); |
| 216 |
|
L2->GetEntry(i); |
| 217 |
|
if ( var.showall ){ |
| 218 |
|
ShowInfo("RunInfo"); |
| 219 |
|
ShowInfo("SoftInfo"); |
| 220 |
|
ShowInfo("OrbitalInfo"); |
| 221 |
|
ShowInfo("TrigLevel2"); |
| 222 |
|
ShowInfo("ToFLevel2"); |
| 223 |
|
ShowInfo("TrkLevel2"); |
| 224 |
|
ShowInfo("AcLevel2"); |
| 225 |
|
ShowInfo("CaloLevel2"); |
| 226 |
|
ShowInfo("CaloLevel1"); |
| 227 |
|
ShowInfo("S4Level2"); |
| 228 |
|
ShowInfo("NDLevel2"); |
| 229 |
|
} else { |
| 230 |
|
if ( var.showrun ) ShowInfo("RunInfo"); |
| 231 |
|
if ( var.showsi ) ShowInfo("SoftInfo"); |
| 232 |
|
if ( var.showorb ) ShowInfo("OrbitalInfo"); |
| 233 |
|
if ( var.showtrg ) ShowInfo("TrigLevel2"); |
| 234 |
|
if ( var.showtof ) ShowInfo("ToFLevel2"); |
| 235 |
|
if ( var.showtrk ) ShowInfo("TrkLevel2"); |
| 236 |
|
if ( var.showac ) ShowInfo("AcLevel2"); |
| 237 |
|
if ( var.showcal ) ShowInfo("CaloLevel2"); |
| 238 |
|
if ( var.showcal ) ShowInfo("CaloLevel1"); |
| 239 |
|
if ( var.shows4 ) ShowInfo("S4Level2"); |
| 240 |
|
if ( var.shownd ) ShowInfo("NDLevel2"); |
| 241 |
|
}; |
| 242 |
|
} else { |
| 243 |
|
otr->GetEntry(i); |
| 244 |
|
if ( var.showall ){ |
| 245 |
|
ShowInfo("Pscu"); |
| 246 |
|
ShowInfo("Trigger"); |
| 247 |
|
ShowInfo("Tof"); |
| 248 |
|
ShowInfo("Tracker"); |
| 249 |
|
ShowInfo("Anticounter"); |
| 250 |
|
ShowInfo("Calorimeter"); |
| 251 |
|
ShowInfo("S4"); |
| 252 |
|
ShowInfo("Neutron"); |
| 253 |
|
} else { |
| 254 |
|
if ( var.showorb ) ShowInfo("Pscu"); |
| 255 |
|
if ( var.showtrg ) ShowInfo("Trigger"); |
| 256 |
|
if ( var.showtof ) ShowInfo("Tof"); |
| 257 |
|
if ( var.showtrk ) ShowInfo("Tracker"); |
| 258 |
|
if ( var.showac ) ShowInfo("Anticounter"); |
| 259 |
|
if ( var.showcal ) ShowInfo("Calorimeter"); |
| 260 |
|
if ( var.shows4 ) ShowInfo("S4"); |
| 261 |
|
if ( var.shownd ) ShowInfo("Neutron"); |
| 262 |
|
}; |
| 263 |
|
}; |
| 264 |
} |
} |
| 265 |
|
|
| 266 |
void FEVdetector::SetEntry(Int_t i){ |
void FEVdetector::SetEntry(Int_t i){ |
| 381 |
}; |
}; |
| 382 |
} |
} |
| 383 |
|
|
| 384 |
void FEVdetector::PrintLeaves(TTree *otr, Int_t i, TBranchElement *tb, Int_t lenmax){ |
void FEVdetector::ShowInfo(TString detector){ |
| 385 |
// -- Prints values of leaves. |
// |
| 386 |
|
TBranch *b1 = 0; |
| 387 |
// tb->ValidateAddress(); |
// TBranch *b3 = 0; |
| 388 |
printf("son qua \n"); |
TObjArray *branch_array = 0; |
| 389 |
|
// TObjArray *leaf_array = 0; |
| 390 |
|
// |
| 391 |
|
if ( !strcmp(detector.Data(),"RunInfo") || !strcmp(detector.Data(),"SoftInfo") ){ |
| 392 |
|
if ( L2->GetRunTree() ) b1 = L2->GetRunTree()->FindBranch(detector.Data()); |
| 393 |
|
} else { |
| 394 |
|
b1 = otr->FindBranch(detector.Data()); |
| 395 |
|
}; |
| 396 |
|
// |
| 397 |
|
if ( !b1 ) return; |
| 398 |
|
// |
| 399 |
|
Int_t dlen = 10; |
| 400 |
|
// |
| 401 |
|
char o[200000]; |
| 402 |
|
char zz[200000]; |
| 403 |
|
char col[13]; |
| 404 |
|
char col2[13]; |
| 405 |
|
// |
| 406 |
|
setcolor(col,RESET, GREEN, WHITE); |
| 407 |
|
sprintf(o,"%s======> EVENT:%i\n",col, thisentry); |
| 408 |
|
sprintf(zz,"======> EVENT:%i\n", thisentry); |
| 409 |
|
// |
| 410 |
|
setcolor(col,RESET, RED, WHITE); |
| 411 |
|
sprintf(o,"%s%sBranch %s\n",o,col,b1->GetName()); |
| 412 |
|
sprintf(zz,"%sBranch %s\n",zz,b1->GetName()); |
| 413 |
|
setcolor(col,RESET, BLACK, WHITE); |
| 414 |
|
sprintf(o,"%s%s",o,col); |
| 415 |
|
// |
| 416 |
|
branch_array = b1->GetListOfBranches(); |
| 417 |
|
// |
| 418 |
|
Int_t j = 0; |
| 419 |
|
// |
| 420 |
|
for(Int_t l=0;l<(branch_array->GetLast()+1);l++){ |
| 421 |
|
// |
| 422 |
|
TBranchElement *tb = (TBranchElement*)branch_array->At(l); |
| 423 |
|
Int_t type = tb->GetType(); |
| 424 |
|
Int_t atype = tb->GetStreamerType() - 20; |
| 425 |
|
Int_t len = (tb->GetInfo()->GetLengths())[tb->GetID()]; |
| 426 |
|
Int_t length = min(len,dlen); |
| 427 |
|
// |
| 428 |
|
// printf("Branches : type is %i type is %i tb getname %s slen %i slength %i\n",atype,type,tb->GetName(),len,length); |
| 429 |
|
switch (type){ |
| 430 |
|
case 0: |
| 431 |
|
// |
| 432 |
|
// IS A VARIABLE |
| 433 |
|
// |
| 434 |
|
// |
| 435 |
|
// NAME |
| 436 |
|
// |
| 437 |
|
setcolor(col,RESET, BLUE, WHITE); |
| 438 |
|
setcolor(col2,RESET, BLACK, WHITE); |
| 439 |
|
sprintf(o,"%s%s %-15s%s =",o,col,((TBranch*)branch_array->At(l))->GetName(),col2); |
| 440 |
|
sprintf(zz,"%s %-15s =",zz,((TBranch*)branch_array->At(l))->GetName()); |
| 441 |
|
// |
| 442 |
|
j = 0; |
| 443 |
|
// |
| 444 |
|
// VALUES |
| 445 |
|
// |
| 446 |
|
// |
| 447 |
|
// Integer |
| 448 |
|
// |
| 449 |
|
if ( atype == 3 || atype == -17 ){ |
| 450 |
|
while ( j < length ){ |
| 451 |
|
if ( j < length -1 ){ |
| 452 |
|
sprintf(o,"%s %i ,",o,(Int_t)tb->GetValue(j,0)); |
| 453 |
|
sprintf(zz,"%s %i ,",zz,(Int_t)tb->GetValue(j,0)); |
| 454 |
|
} else { |
| 455 |
|
sprintf(o,"%s %i",o,(Int_t)tb->GetValue(j,0)); |
| 456 |
|
sprintf(zz,"%s %i",zz,(Int_t)tb->GetValue(j,0)); |
| 457 |
|
}; |
| 458 |
|
j++; |
| 459 |
|
}; |
| 460 |
|
}; |
| 461 |
|
// |
| 462 |
|
// Unsigned integer |
| 463 |
|
// |
| 464 |
|
if ( atype == -7 || atype == 13 || atype == -9 || atype == -8 || atype == 12 ){ |
| 465 |
|
while ( j < length ){ |
| 466 |
|
if ( j < length -1 ){ |
| 467 |
|
sprintf(o,"%s %u ,",o,(UInt_t)tb->GetValue(j,0)); |
| 468 |
|
sprintf(zz,"%s %u ,",zz,(UInt_t)tb->GetValue(j,0)); |
| 469 |
|
} else { |
| 470 |
|
sprintf(o,"%s %u",o,(UInt_t)tb->GetValue(j,0)); |
| 471 |
|
sprintf(zz,"%s %u",zz,(UInt_t)tb->GetValue(j,0)); |
| 472 |
|
}; |
| 473 |
|
j++; |
| 474 |
|
}; |
| 475 |
|
}; |
| 476 |
|
// |
| 477 |
|
// Float |
| 478 |
|
// |
| 479 |
|
if ( atype == -15 || atype == 5 ){ |
| 480 |
|
while ( j < length ){ |
| 481 |
|
if ( j < length -1 ){ |
| 482 |
|
sprintf(o,"%s %f ,",o,tb->GetValue(j,0)); |
| 483 |
|
sprintf(zz,"%s %f ,",zz,tb->GetValue(j,0)); |
| 484 |
|
} else { |
| 485 |
|
sprintf(o,"%s %f",o,tb->GetValue(j,0)); |
| 486 |
|
sprintf(zz,"%s %f",zz,tb->GetValue(j,0)); |
| 487 |
|
}; |
| 488 |
|
j++; |
| 489 |
|
}; |
| 490 |
|
}; |
| 491 |
|
// |
| 492 |
|
// Strings |
| 493 |
|
// |
| 494 |
|
if ( atype == 45 ){ |
| 495 |
|
// TObjArray *cl = (TObjArray*)(tb->GetInfo()->GetOffsets())[tb->GetID()];//tb->GetValuePointer(); |
| 496 |
|
// TString *stringa = (TString*)(*cl)[0]; |
| 497 |
|
// TBranchElement *utb = (TBranchElement*)tb->GetBranchCount(); |
| 498 |
|
// TString** stringa = (TString*)(&tb->GetValuePointer()); |
| 499 |
|
//TStreamerElement *tste = (TStreamerElement*)tb->GetInfo()->GetCurrentElement(); |
| 500 |
|
|
| 501 |
|
// char *ladd; |
| 502 |
|
// ladd = tb->GetValuePointer() |
| 503 |
|
// TString *stringa = (TString*)((tste->GetOffset())); |
| 504 |
|
// TString& mstr = *stringa; |
| 505 |
|
// printf(" la mia stringa %s \n",mstr.Data()); |
| 506 |
|
// printf(" offset %i \n",(Int_t)utb->GetValue(0,0)); |
| 507 |
|
// int pointer = (tb->GetInfo()->GetOffsets())[tb->GetID()]; |
| 508 |
|
// TString *stringa = (TString*)(tb->GetInfo()->GetOffsets())[tb->GetID()]; |
| 509 |
|
// TString *stringa = (TString*)tb->GetAddress(); |
| 510 |
|
// printf(" address 0x%X \n",tb->GetAddress()); |
| 511 |
|
// printf(" pointer 0x%X \n",tb->GetValuePointer()); |
| 512 |
|
// printf(" object 0x%X \n",tb->GetObject()); |
| 513 |
|
// printf("stringa %s lung %i\n",stringa.Data(),stringa.Length()); |
| 514 |
|
// TLeaf *striglia = tb->FindLeaf(tb->GetName()); |
| 515 |
|
// if ( striglia ){ |
| 516 |
|
// char *pointer = (char *)striglia->GetValuePointer(); |
| 517 |
|
// TString *pr= (TString*)pointer; |
| 518 |
|
// printf("ciao %s \n",pr->Data()); |
| 519 |
|
// }; |
| 520 |
|
sprintf(o,"%s TString - not implemented yet -",o); |
| 521 |
|
sprintf(zz,"%s TString - not implemented yet -",zz); |
| 522 |
|
}; |
| 523 |
|
// |
| 524 |
|
// TArray |
| 525 |
|
// |
| 526 |
|
if ( atype == 42 ){ |
| 527 |
|
// |
| 528 |
|
// TObjArray *cl = (TObjArray*)tb->GetObject(); |
| 529 |
|
// // |
| 530 |
|
// TClass *myc = cl->IsA(); |
| 531 |
|
// // |
| 532 |
|
// printf("qui \n"); |
| 533 |
|
// // |
| 534 |
|
// // determine offset to fetch data |
| 535 |
|
// // |
| 536 |
|
// int thisoffset = 0; |
| 537 |
|
// TRealData *rd = myc->GetRealData(tb->GetName()); |
| 538 |
|
// if ( rd ){ |
| 539 |
|
// thisoffset = rd->GetThisOffset(); |
| 540 |
|
// }; |
| 541 |
|
// Int_t niente = 0; |
| 542 |
|
// TStreamerElement *tste = tb->GetInfo()->GetStreamerElement(rd->GetName(),niente); |
| 543 |
|
// printf(" typename %s \n",tste->GetTypeName()); |
| 544 |
|
// // |
| 545 |
|
// // TArrayI |
| 546 |
|
// // |
| 547 |
|
// if ( !strcmp(tste->GetTypeName(),"TArrayI") ){ |
| 548 |
|
// // |
| 549 |
|
// printf("qua \n"); |
| 550 |
|
// char *pointer = (char*)cl->At(0); |
| 551 |
|
// // char *pu = thisoffset + pointer; |
| 552 |
|
// int pu = (int)tste->GetTObjectOffset(); |
| 553 |
|
// TArrayI arr = (TArrayI)*pu; |
| 554 |
|
// // TArrayI arr = (TArrayI)(thisoffset); |
| 555 |
|
// //TArrayI *arr = (TArrayI*)pu; |
| 556 |
|
// //TArraI arr = (TArrayI) |
| 557 |
|
// Int_t jj=0; |
| 558 |
|
// j=0; |
| 559 |
|
// printf("quii \n"); |
| 560 |
|
// Int_t arlen = min(arr.GetSize(),dlen); |
| 561 |
|
// // |
| 562 |
|
// printf("que \n"); |
| 563 |
|
// setcolor(col,RESET, BLUE, WHITE); |
| 564 |
|
// setcolor(col2,RESET, BLACK, WHITE); |
| 565 |
|
// sprintf(o,"%s%s %s[%i]%s = ",o,col,tb->GetName(),arr.GetSize(),col2); |
| 566 |
|
// // |
| 567 |
|
// // while ( j < tb->GetNdata() ){ |
| 568 |
|
// // |
| 569 |
|
// printf("quo \n"); |
| 570 |
|
// // pointer = (char*)cl->UncheckedAt(j); |
| 571 |
|
// // pu = pointer + thisoffset; |
| 572 |
|
// // arr = (TArrayI*)(thisoffset); |
| 573 |
|
// // |
| 574 |
|
// while ( jj < arlen ){ |
| 575 |
|
// if ( jj < arlen-1 ){ |
| 576 |
|
// sprintf(o,"%s %i ,",o,arr.At(jj)); |
| 577 |
|
// } else { |
| 578 |
|
// sprintf(o,"%s %i",o,arr.At(jj)); |
| 579 |
|
// }; |
| 580 |
|
// jj++; |
| 581 |
|
// }; |
| 582 |
|
// // if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); |
| 583 |
|
// // j++; |
| 584 |
|
// // }; |
| 585 |
|
// }; |
| 586 |
|
// // |
| 587 |
|
// // TArrayF |
| 588 |
|
// // |
| 589 |
|
// if ( !strcmp(tste->GetTypeName(),"TArrayF") ){ |
| 590 |
|
// // |
| 591 |
|
// char *pointer = (char*)cl->UncheckedAt(0); |
| 592 |
|
// char *pu = pointer + thisoffset; |
| 593 |
|
// TArrayF *arr = (TArrayF*)(pu); |
| 594 |
|
// Int_t jj=0; |
| 595 |
|
// Int_t arlen = min(arr->GetSize(),dlen); |
| 596 |
|
// // |
| 597 |
|
// setcolor(col,RESET, BLUE, WHITE); |
| 598 |
|
// setcolor(col2,RESET, BLACK, WHITE); |
| 599 |
|
// sprintf(o,"%s%s %s[%i]%s = ",o,col,tb->GetName(),arr->GetSize(),col2); |
| 600 |
|
// // |
| 601 |
|
// while ( j < tb->GetNdata() ){ |
| 602 |
|
// // |
| 603 |
|
// pointer = (char*)cl->UncheckedAt(j); |
| 604 |
|
// pu = pointer + thisoffset; |
| 605 |
|
// arr = (TArrayF*)(pu); |
| 606 |
|
// // |
| 607 |
|
// while ( jj < arlen ){ |
| 608 |
|
// if ( jj < arlen-1 ){ |
| 609 |
|
// sprintf(o,"%s %f ,",o,arr->At(jj)); |
| 610 |
|
// } else { |
| 611 |
|
// sprintf(o,"%s %f",o,arr->At(jj)); |
| 612 |
|
// }; |
| 613 |
|
// jj++; |
| 614 |
|
// }; |
| 615 |
|
// if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); |
| 616 |
|
// j++; |
| 617 |
|
// }; |
| 618 |
|
// }; |
| 619 |
|
// sprintf(o,"%s\n",o); |
| 620 |
|
// |
| 621 |
|
sprintf(o,"%s TArray - not implemented yet -",o); |
| 622 |
|
sprintf(zz,"%s TArray - not implemented yet -",zz); |
| 623 |
|
// |
| 624 |
|
}; |
| 625 |
|
// |
| 626 |
|
sprintf(o,"%s\n",o); |
| 627 |
|
sprintf(zz,"%s\n",zz); |
| 628 |
|
break; |
| 629 |
|
case 3: |
| 630 |
|
// |
| 631 |
|
// IS A TCLONESARRAY |
| 632 |
|
// |
| 633 |
|
setcolor(col,RESET, BLUE, WHITE); |
| 634 |
|
setcolor(col2,RESET, BLACK, WHITE); |
| 635 |
|
sprintf(o,"%s%s %-15s%s = %d\n",o,col,tb->GetName(), col2, tb->GetNdata()); |
| 636 |
|
sprintf(zz,"%s %-15s = %d\n",zz,tb->GetName(), tb->GetNdata()); |
| 637 |
|
|
| 638 |
// if (otr->GetMakeClass()) { |
// |
| 639 |
if (!tb->GetAddress()) { |
if ( tb->GetNdata() ){ |
| 640 |
printf("esco \n"); |
// |
| 641 |
return; |
TClonesArray *cl = (TClonesArray*)tb->GetObject(); |
| 642 |
} |
// |
| 643 |
if (tb->GetType() == 3 || tb->GetType() == 4) { |
TClass *myc = cl->GetClass(); |
| 644 |
// TClonesArray or STL container top-level branch. |
// |
| 645 |
printf("3 o 4 %-15s = %d\n", tb->GetName(), tb->GetNdata()); |
TList *lme = myc->GetListOfDataMembers(); |
| 646 |
return; |
TIter next(lme); |
| 647 |
} else if (tb->GetType() == 31 || tb->GetType() == 41) { |
TBranchElement *tb2 = 0; |
| 648 |
printf(" 31 o 41 \n"); |
// |
| 649 |
// TClonesArray or STL container sub-branch. |
while ( (tb2 = (TBranchElement*)next()) ){ |
| 650 |
Int_t n = TMath::Min(10, tb->GetNdata()); |
// |
| 651 |
Int_t atype = tb->GetStreamerType() + 20; |
const char *name = tb2->GetName(); |
| 652 |
if (tb->GetStreamerType() == 1) { |
TBranch *foglia = tb->FindBranch(name); |
| 653 |
// TVirtualStreamerInfo::kOffsetL + TVirtualStreamerInfo::kChar is |
if ( foglia ){ |
| 654 |
// printed as a string and could print weird characters. |
// |
| 655 |
// So we print an unsigned char instead (not perfect, but better). |
TBranchElement *stb = (TBranchElement*)tb->FindBranch(name); |
| 656 |
atype = 20 + 11 ; |
Int_t stype = stb->GetType(); |
| 657 |
} |
Int_t satype = stb->GetStreamerType() - 20; |
| 658 |
if (atype > 54) { |
Int_t slen = (stb->GetInfo()->GetLengths())[stb->GetID()]; |
| 659 |
// FIXME: More logic required here (like in ReadLeaves) |
Int_t slength = min(slen,dlen); |
| 660 |
printf(">54 %-15s = %d\n", tb->GetName(), tb->GetNdata()); |
// printf("SubBranches : atype is %i type is %i tb getname %s slen %i slength %i\n",satype,stype,stb->GetName(),slen,slength); |
| 661 |
return; |
switch (stype){ |
| 662 |
} |
case 31: |
| 663 |
if (tb->GetStreamerType() > 20) { |
// |
| 664 |
atype -= 20; |
// IS A VARIABLE |
| 665 |
TObjArray *prova= otr->GetListOfLeaves(); |
// |
| 666 |
// TObjArray* leaf2 = (TObjArray*) prova->UncheckedAt(i); |
// |
| 667 |
//TLeaf* leaf = (TLeaf*)(otr->GetLeaf(tb->GetName())); |
// NAME |
| 668 |
// TLeafElement* leaf = (TLeafElement*)((TLeaf*)(otr->GetListOfLeaves()->UncheckedAt(i))->GetBranch()->UncheckedAt(0)); |
// |
| 669 |
TLeafElement* leaf = (TLeafElement*)(prova->UncheckedAt(0)); |
j = 0; |
| 670 |
n = n * leaf->GetLenStatic(); |
// |
| 671 |
} |
// VALUES |
| 672 |
if (tb->GetInfo()) { |
// |
| 673 |
// n = 16; |
if ( satype == 41 || satype == 44){ |
| 674 |
tb->GetInfo()->PrintValue(tb->GetName(), tb->GetAddress(), atype, n, lenmax); |
// |
| 675 |
//tb->GetObject()->GetInfo()->PrintValue(tb->GetName(), tb->GetObject(), atype, n, lenmax); |
// skip TRef |
| 676 |
} |
// |
| 677 |
return; |
break; |
| 678 |
} else if (tb->GetType() <= 2) { |
}; |
| 679 |
printf(" <=2 \n"); |
// |
| 680 |
// Branch in split mode. |
// Integer |
| 681 |
// FIXME: This should probably be < 60 instead. |
// |
| 682 |
if ((tb->GetStreamerType() > 40) && (tb->GetStreamerType() < 55)) { |
if ( satype == -17 || satype == -9 ){ |
| 683 |
Int_t atype = tb->GetStreamerType() - 20; |
// |
| 684 |
TBranchElement* counterElement = (TBranchElement*) tb->GetBranchCount(); |
setcolor(col,RESET, BLUE, WHITE); |
| 685 |
Int_t n = (Int_t) counterElement->GetValue(0, 0); |
setcolor(col2,RESET, BLACK, WHITE); |
| 686 |
if (tb->GetInfo()) { |
sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2); |
| 687 |
tb->GetInfo()->PrintValue(tb->GetName(), tb->GetAddress(), atype, n, lenmax); |
sprintf(zz,"%s %-15s = ",zz,foglia->GetName()); |
| 688 |
} |
while ( j < cl->GetEntriesFast() ){ |
| 689 |
} else { |
if ( j < cl->GetEntriesFast() -1 ){ |
| 690 |
// if (tb->GetInfo()) { |
sprintf(o,"%s %i ,",o,(Int_t)stb->GetValue(j,slength)); |
| 691 |
// tb->GetInfo()->PrintValue(tb->GetName(), tb->GetObject(), tb->GetID(), -1, lenmax); |
sprintf(zz,"%s %i ,",zz,(Int_t)stb->GetValue(j,slength)); |
| 692 |
// } |
} else { |
| 693 |
// } |
sprintf(o,"%s %i",o,(Int_t)stb->GetValue(j,slength)); |
| 694 |
return; |
sprintf(zz,"%s %i",zz,(Int_t)stb->GetValue(j,slength)); |
| 695 |
} |
}; |
| 696 |
} else if (tb->GetType() == 3) { |
j++; |
| 697 |
printf("3 %-15s = %d\n", tb->GetName(), tb->GetNdata()); |
}; |
| 698 |
} else if (tb->GetType() == 31) { |
}; |
| 699 |
printf("31 %-15s = %d\n", tb->GetName(), tb->GetNdata()); |
// |
| 700 |
// TClonesArray* clones = (TClonesArray*) tb->GetObject(); |
// Float |
| 701 |
// if (tb->GetInfo()) { |
// |
| 702 |
// tb->GetInfo()->PrintValueClones(tb->GetName(), clones, tb->GetID(), tb->GetOffset(), lenmax); |
if ( satype == -15 ){ |
| 703 |
// } |
// |
| 704 |
} else if (tb->GetType() == 41) { |
setcolor(col,RESET, BLUE, WHITE); |
| 705 |
printf("41 %-15s = %d\n", tb->GetName(), tb->GetNdata()); |
setcolor(col2,RESET, BLACK, WHITE); |
| 706 |
// TVirtualCollectionProxy::TPushPop helper(((TBranchElement*) this)->GetCollectionProxy(), fObject); |
sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2); |
| 707 |
// if (GetInfo()) { |
sprintf(zz,"%s %-15s = ",zz,foglia->GetName()); |
| 708 |
// GetInfo()->PrintValueSTL(GetName(), ((TBranchElement*) this)->GetCollectionProxy(), fID, fOffset, lenmax); |
while ( j < cl->GetEntriesFast() ){ |
| 709 |
// } |
if ( j < cl->GetEntriesFast() -1 ){ |
| 710 |
} else { |
sprintf(o,"%s %f ,",o,stb->GetValue(j,slength)); |
| 711 |
printf("else %-15s = %d\n", tb->GetName(), tb->GetNdata()); |
sprintf(zz,"%s %f ,",zz,stb->GetValue(j,slength)); |
| 712 |
// if (GetInfo()) { |
} else { |
| 713 |
// GetInfo()->PrintValue(GetName(), fObject, fID, -1, lenmax); |
sprintf(o,"%s %f",o,stb->GetValue(j,slength)); |
| 714 |
// } |
sprintf(zz,"%s %f",zz,stb->GetValue(j,slength)); |
| 715 |
} |
}; |
| 716 |
|
j++; |
| 717 |
|
}; |
| 718 |
|
}; |
| 719 |
|
// |
| 720 |
|
// Array of float |
| 721 |
|
// |
| 722 |
|
if ( satype == 5 ){ |
| 723 |
|
// |
| 724 |
|
setcolor(col,RESET, BLUE, WHITE); |
| 725 |
|
setcolor(col2,RESET, BLACK, WHITE); |
| 726 |
|
sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2); |
| 727 |
|
sprintf(zz,"%s %-15s = ",zz,foglia->GetName()); |
| 728 |
|
Bool_t bold = true; |
| 729 |
|
while ( j < tb->GetNdata() ){ |
| 730 |
|
if ( bold ){ |
| 731 |
|
setcolor(col,RESET, BLACK, WHITE); |
| 732 |
|
sprintf(o,"%s%s",o,col); |
| 733 |
|
} else { |
| 734 |
|
setcolor(col,BOLD, BLACK, WHITE); |
| 735 |
|
sprintf(o,"%s%s",o,col); |
| 736 |
|
}; |
| 737 |
|
Int_t jj = 0; |
| 738 |
|
while ( jj < slength ){ |
| 739 |
|
if ( jj < slength-1 ){ |
| 740 |
|
sprintf(o,"%s %f ,",o,stb->GetValue(j,jj,true)); |
| 741 |
|
sprintf(zz,"%s %f ,",zz,stb->GetValue(j,jj,true)); |
| 742 |
|
} else { |
| 743 |
|
sprintf(o,"%s %f",o,stb->GetValue(j,jj,true)); |
| 744 |
|
sprintf(zz,"%s %f",zz,stb->GetValue(j,jj,true)); |
| 745 |
|
}; |
| 746 |
|
jj++; |
| 747 |
|
}; |
| 748 |
|
if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); |
| 749 |
|
if ( j < tb->GetNdata() -1 ) sprintf(zz,"%s ,",zz); |
| 750 |
|
if ( !bold ){ |
| 751 |
|
bold = true; |
| 752 |
|
} else { |
| 753 |
|
bold = false; |
| 754 |
|
}; |
| 755 |
|
j++; |
| 756 |
|
}; |
| 757 |
|
if ( bold ){ |
| 758 |
|
setcolor(col,RESET, BLACK, WHITE); |
| 759 |
|
sprintf(o,"%s%s",o,col); |
| 760 |
|
}; |
| 761 |
|
}; |
| 762 |
|
// |
| 763 |
|
// Array of integers |
| 764 |
|
// |
| 765 |
|
if ( satype == 3 ){ |
| 766 |
|
// |
| 767 |
|
setcolor(col,RESET, BLUE, WHITE); |
| 768 |
|
setcolor(col2,RESET, BLACK, WHITE); |
| 769 |
|
sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2); |
| 770 |
|
sprintf(zz,"%s %-15s = ",zz,foglia->GetName()); |
| 771 |
|
while ( j < tb->GetNdata() ){ |
| 772 |
|
Int_t jj = 0; |
| 773 |
|
while ( jj < slength ){ |
| 774 |
|
if ( jj < slength-1 ){ |
| 775 |
|
sprintf(o,"%s %i ,",o,(Int_t)stb->GetValue(j,jj,true)); |
| 776 |
|
sprintf(zz,"%s %i ,",zz,(Int_t)stb->GetValue(j,jj,true)); |
| 777 |
|
} else { |
| 778 |
|
sprintf(o,"%s %i",o,(Int_t)stb->GetValue(j,jj,true)); |
| 779 |
|
sprintf(zz,"%s %i",zz,(Int_t)stb->GetValue(j,jj,true)); |
| 780 |
|
}; |
| 781 |
|
jj++; |
| 782 |
|
}; |
| 783 |
|
if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); |
| 784 |
|
if ( j < tb->GetNdata() -1 ) sprintf(zz,"%s ,",zz); |
| 785 |
|
j++; |
| 786 |
|
}; |
| 787 |
|
}; |
| 788 |
|
|
| 789 |
// }; |
// |
| 790 |
printf("esco qui\n"); |
// TArray |
| 791 |
|
// |
| 792 |
|
if ( satype == 42 ){ |
| 793 |
|
// |
| 794 |
|
// determine offset to fetch data |
| 795 |
|
// |
| 796 |
|
int thisoffset = 0; |
| 797 |
|
TRealData *rd = myc->GetRealData(foglia->GetName()); |
| 798 |
|
if ( rd ){ |
| 799 |
|
thisoffset = rd->GetThisOffset(); |
| 800 |
|
}; |
| 801 |
|
Int_t niente = 0; |
| 802 |
|
TStreamerElement *tste = stb->GetInfo()->GetStreamerElement(rd->GetName(),niente); |
| 803 |
|
// |
| 804 |
|
// TArrayI |
| 805 |
|
// |
| 806 |
|
if ( !strcmp(tste->GetTypeName(),"TArrayI") ){ |
| 807 |
|
// |
| 808 |
|
char *pointer = (char*)cl->UncheckedAt(0); |
| 809 |
|
char *pu = pointer + thisoffset; |
| 810 |
|
TArrayI *arr = (TArrayI*)(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 |
|
sprintf(zz,"%s %s[%i] = ",zz,foglia->GetName(),arr->GetSize()); |
| 818 |
|
// |
| 819 |
|
while ( j < tb->GetNdata() ){ |
| 820 |
|
// |
| 821 |
|
pointer = (char*)cl->UncheckedAt(j); |
| 822 |
|
pu = pointer + thisoffset; |
| 823 |
|
arr = (TArrayI*)(pu); |
| 824 |
|
// |
| 825 |
|
while ( jj < arlen ){ |
| 826 |
|
if ( jj < arlen-1 ){ |
| 827 |
|
sprintf(o,"%s %i ,",o,arr->At(jj)); |
| 828 |
|
sprintf(zz,"%s %i ,",zz,arr->At(jj)); |
| 829 |
|
} else { |
| 830 |
|
sprintf(o,"%s %i",o,arr->At(jj)); |
| 831 |
|
sprintf(zz,"%s %i",zz,arr->At(jj)); |
| 832 |
|
}; |
| 833 |
|
jj++; |
| 834 |
|
}; |
| 835 |
|
if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); |
| 836 |
|
if ( j < tb->GetNdata() -1 ) sprintf(zz,"%s ,",zz); |
| 837 |
|
j++; |
| 838 |
|
}; |
| 839 |
|
}; |
| 840 |
|
// |
| 841 |
|
// TArrayF |
| 842 |
|
// |
| 843 |
|
if ( !strcmp(tste->GetTypeName(),"TArrayF") ){ |
| 844 |
|
// |
| 845 |
|
char *pointer = (char*)cl->UncheckedAt(0); |
| 846 |
|
char *pu = pointer + thisoffset; |
| 847 |
|
TArrayF *arr = (TArrayF*)(pu); |
| 848 |
|
Int_t jj=0; |
| 849 |
|
Int_t arlen = min(arr->GetSize(),dlen); |
| 850 |
|
// |
| 851 |
|
setcolor(col,RESET, BLUE, WHITE); |
| 852 |
|
setcolor(col2,RESET, BLACK, WHITE); |
| 853 |
|
sprintf(o,"%s%s %s[%i]%s = ",o,col,foglia->GetName(),arr->GetSize(),col2); |
| 854 |
|
sprintf(zz,"%s %s[%i] = ",zz,foglia->GetName(),arr->GetSize()); |
| 855 |
|
// |
| 856 |
|
while ( j < tb->GetNdata() ){ |
| 857 |
|
// |
| 858 |
|
pointer = (char*)cl->UncheckedAt(j); |
| 859 |
|
pu = pointer + thisoffset; |
| 860 |
|
arr = (TArrayF*)(pu); |
| 861 |
|
// |
| 862 |
|
while ( jj < arlen ){ |
| 863 |
|
if ( jj < arlen-1 ){ |
| 864 |
|
sprintf(o,"%s %f ,",o,arr->At(jj)); |
| 865 |
|
sprintf(zz,"%s %f ,",zz,arr->At(jj)); |
| 866 |
|
} else { |
| 867 |
|
sprintf(o,"%s %f",o,arr->At(jj)); |
| 868 |
|
sprintf(zz,"%s %f",zz,arr->At(jj)); |
| 869 |
|
}; |
| 870 |
|
jj++; |
| 871 |
|
}; |
| 872 |
|
if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); |
| 873 |
|
if ( j < tb->GetNdata() -1 ) sprintf(zz,"%s ,",zz); |
| 874 |
|
j++; |
| 875 |
|
}; |
| 876 |
|
}; |
| 877 |
|
}; |
| 878 |
|
sprintf(o,"%s\n",o); |
| 879 |
|
sprintf(zz,"%s\n",zz); |
| 880 |
|
break; |
| 881 |
|
}; |
| 882 |
|
}; |
| 883 |
|
}; |
| 884 |
|
}; |
| 885 |
|
break; |
| 886 |
|
}; |
| 887 |
|
}; |
| 888 |
|
printf("%s\n",o); |
| 889 |
|
pamgui->DIALOG(4,zz); |
| 890 |
}; |
}; |
| 891 |
|
|
|
void FEVdetector::PrintData(TTree *tree, Long64_t entry=-1LL,Int_t lenmax=44){ |
|
|
// -- Print values of all active leaves for entry. |
|
|
// |
|
|
// if entry==-1, print current entry (default) |
|
|
// if a leaf is an array, a maximum of lenmax elements is printed. |
|
|
// |
|
|
if (entry != -1) { |
|
|
tree->GetEntry(entry); |
|
|
} |
|
|
// printf("======> EVENT:%lld\n", thisentry); |
|
|
printf("======> EVENT:%i\n", thisentry); |
|
|
TObjArray* leaves = tree->GetListOfLeaves(); // |
|
|
Int_t nleaves = leaves->GetEntriesFast(); |
|
|
Int_t ltype; |
|
|
for (Int_t i = 0; i < nleaves; i++) { |
|
|
TLeaf* leaf = (TLeaf*) leaves->UncheckedAt(i); |
|
|
TBranch* branch = leaf->GetBranch(); |
|
|
// if (branch->TestBit(kDoNotProcess)) { |
|
|
// continue; |
|
|
// } |
|
|
Int_t len = leaf->GetLen(); |
|
|
if (len <= 0) { |
|
|
continue; |
|
|
} |
|
|
len = TMath::Min(len, lenmax); |
|
|
if (leaf->IsA() == TLeafElement::Class()) { |
|
|
// Double_t value = leaf->GetValue(lenmax); |
|
|
//printf(" ioqui %f \n",value); |
|
|
// ((TBranchElement*)leaf->GetBranch())->PrintValue(i); |
|
|
this->PrintLeaves(otr,i,((TBranchElement*)leaf->GetBranch()), lenmax); |
|
|
//leaf->PrintValue(lenmax); |
|
|
continue; |
|
|
} |
|
|
if (branch->GetListOfBranches()->GetEntriesFast() > 0) { |
|
|
continue; |
|
|
} |
|
|
ltype = 10; |
|
|
if (leaf->IsA() == TLeafF::Class()) { |
|
|
ltype = 5; |
|
|
} |
|
|
if (leaf->IsA() == TLeafD::Class()) { |
|
|
ltype = 5; |
|
|
} |
|
|
if (leaf->IsA() == TLeafC::Class()) { |
|
|
len = 1; |
|
|
ltype = 5; |
|
|
}; |
|
|
printf(" %-15s = ", leaf->GetName()); |
|
|
for (Int_t l = 0; l < len; l++) { |
|
|
Double_t value = leaf->GetValue(l); |
|
|
printf(" ioqui %f \n",value); |
|
|
// leaf->PrintValue(l); |
|
|
if (l == (len - 1)) { |
|
|
printf("\n"); |
|
|
continue; |
|
|
} |
|
|
printf(", "); |
|
|
if ((l % ltype) == 0) { |
|
|
printf("\n "); |
|
|
} |
|
|
} |
|
|
} |
|
|
}; |
|
| 892 |
|
|
| 893 |
void FEVdetector::GetGeneralInfo(){ |
void FEVdetector::GetGeneralInfo(){ |
| 894 |
// |
// |
| 899 |
headcold = headc; |
headcold = headc; |
| 900 |
headc = ph->Counter; |
headc = ph->Counter; |
| 901 |
var.headc = (int)ph->Counter; |
var.headc = (int)ph->Counter; |
| 902 |
OBT = ph->OrbitalTime; |
OBT = (UInt_t)ph->OrbitalTime; |
| 903 |
DOBT = OBT - OOBT; |
DOBT = OBT - OOBT; |
| 904 |
OOBT = OBT; |
OOBT = OBT; |
| 905 |
if ( thisentry == minevent || DOBT < 0 || (headc-headcold-1)!=0 ) DOBT = 0; |
if ( thisentry == minevent || DOBT < 0 || (headc-headcold-1)!=0 ) DOBT = 0; |
| 935 |
trcs = (TString)trc.str().c_str(); |
trcs = (TString)trc.str().c_str(); |
| 936 |
} else { |
} else { |
| 937 |
headcold = headc; |
headcold = headc; |
| 938 |
headc = L2->GetOrbitalInfo()->pkt_num; // to be changed as soon as we will have obt in the level2 file! |
if ( var.RUN ){ |
| 939 |
OBT = L2->GetOrbitalInfo()->OBT; // to be changed as soon as we will have obt in the level2 file! |
var.idrun = L2->GetRunInfo()->ID; |
| 940 |
DOBT = OBT - OOBT; |
var.idroot = L2->GetRunInfo()->ID_ROOT_L0; |
| 941 |
OOBT = OBT; |
var.EVF = L2->GetRunInfo()->EV_FROM; |
| 942 |
if ( thisentry == minevent || DOBT < 0 || (headc-headcold-1)!=0 ) DOBT = 0; |
}; |
| 943 |
var.etime = OBT; |
if ( var.ORB ){ |
| 944 |
|
headc = L2->GetOrbitalInfo()->pkt_num; |
| 945 |
|
OBT = L2->GetOrbitalInfo()->OBT; |
| 946 |
|
DOBT = OBT - OOBT; |
| 947 |
|
OOBT = OBT; |
| 948 |
|
if ( thisentry == minevent || DOBT < 0 || (headc-headcold-1)!=0 ) DOBT = 0; |
| 949 |
|
var.etime = OBT; |
| 950 |
|
} else { |
| 951 |
|
var.etime = 0; |
| 952 |
|
}; |
| 953 |
// |
// |
| 954 |
// who gave the trigger? |
// who gave the trigger? |
| 955 |
// |
// |
| 956 |
calotrig = 0; |
Int_t trigconf = 0; |
| 957 |
if ( L2->GetTrigLevel2()->patterntrig[0] ) calotrig = 1; |
if ( var.TRG ){ |
| 958 |
toftrig = 0; |
calotrig = 0; |
| 959 |
if ( L2->GetTrigLevel2()->patterntrig[2] || L2->GetTrigLevel2()->patterntrig[3] || L2->GetTrigLevel2()->patterntrig[4] || L2->GetTrigLevel2()->patterntrig[5] ) toftrig = 1; |
if ( L2->GetTrigLevel2()->patterntrig[0] ) calotrig = 1; |
| 960 |
s4pulser = 0; |
toftrig = 0; |
| 961 |
if ( L2->GetTrigLevel2()->patterntrig[1] & (1<<0) ) s4pulser = 1; |
if ( L2->GetTrigLevel2()->patterntrig[2] || L2->GetTrigLevel2()->patterntrig[3] || L2->GetTrigLevel2()->patterntrig[4] || L2->GetTrigLevel2()->patterntrig[5] ) toftrig = 1; |
| 962 |
// |
s4pulser = 0; |
| 963 |
// 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; |
| 964 |
// S4 sometimes could not set the flag even if the trigger is given. This is a workaround to fix this "bug": |
// |
| 965 |
// |
// TOF and calorimeter when giving a trigger will always set this flag since the time window of the signal is greater than 100 ns. |
| 966 |
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": |
| 967 |
// |
// |
| 968 |
Int_t trigconf = L2->GetTrigLevel2()->trigconf; |
if ( !calotrig && !toftrig ) s4pulser = 1; |
| 969 |
|
// |
| 970 |
|
trigconf = L2->GetTrigLevel2()->trigconf; |
| 971 |
|
} else { |
| 972 |
|
trigconf = 0; |
| 973 |
|
} |
| 974 |
stringstream trc; |
stringstream trc; |
| 975 |
trc.str(""); |
trc.str(""); |
| 976 |
if ( trigconf & (1<<0) ) trc << "TOF1"; |
if ( trigconf & (1<<0) ) trc << "TOF1"; |
| 1058 |
// |
// |
| 1059 |
if ( level.file == 2 ){ |
if ( level.file == 2 ){ |
| 1060 |
cintcom.str(""); |
cintcom.str(""); |
| 1061 |
cintcom << "PamLevel2 *L2 = (PamLevel2*)0x" << hex; |
cintcom << "PamLevel2 *L2 = (PamLevel2*)" << hex; //con const e l2 funziona |
| 1062 |
cintcom << L2; |
cintcom << L2; |
| 1063 |
gROOT->ProcessLine(cintcom.str().c_str()); |
gROOT->ProcessLine(cintcom.str().c_str()); |
| 1064 |
|
// printf(" comando: %s \n",cintcom.str().c_str()); |
| 1065 |
} else { |
} else { |
| 1066 |
cintcom.str(""); |
cintcom.str(""); |
| 1067 |
cintcom << "TTree *otr = (TTree*)0x" << hex; |
cintcom << "TTree *otr = (TTree*)" << hex; |
| 1068 |
cintcom << otr; |
cintcom << otr; |
| 1069 |
gROOT->ProcessLine(cintcom.str().c_str()); |
gROOT->ProcessLine(cintcom.str().c_str()); |
| 1070 |
// |
// |
| 1071 |
cintcom.str(""); |
cintcom.str(""); |
| 1072 |
cintcom << "struct Variables &var = (struct Variables &)0x" << hex; |
cintcom << "struct Variables &var = (struct Variables &)" << hex; |
| 1073 |
cintcom << &var; |
cintcom << &var; |
| 1074 |
gROOT->ProcessLine(cintcom.str().c_str()); |
gROOT->ProcessLine(cintcom.str().c_str()); |
| 1075 |
}; |
}; |
| 1080 |
// |
// |
| 1081 |
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);"); |
| 1082 |
// |
// |
| 1083 |
if ( level.file == 2 ) isOK = gApplication->ProcessLine("filter((PamLevel2 *)L2,2);"); |
// if ( level.file == 2 ) isOK = gApplication->ProcessLine("filter((PamLevel2 *)L2,2);"); |
| 1084 |
|
if ( level.file == 2 ) isOK = gApplication->ProcessLine("filter();"); |
| 1085 |
// |
// |
| 1086 |
// progress bar in text window |
// progress bar in text window |
| 1087 |
// |
// |
| 1094 |
// |
// |
| 1095 |
} |
} |
| 1096 |
|
|
| 1097 |
Int_t FEVdetector::Load(TTree &mainotr, TFile &mainfile){ |
TChain* FEVdetector::Load(TString file){ |
| 1098 |
file = &mainfile; |
// |
| 1099 |
otr = &mainotr; |
// file = &mainfile; |
|
L2 = new PamLevel2(); |
|
| 1100 |
// |
// |
| 1101 |
if ( level.file == 2 ){ |
if ( level.file == 2 ){ |
| 1102 |
// otr = L2->LoadPamTrees(file); |
// |
| 1103 |
// printf(" %s \n",ddec.Data()); |
// printf(" %s \n",ddec.Data()); |
| 1104 |
otr = L2->GetPamTree(file,ddec.Data()); |
if ( !L2 ){ |
| 1105 |
|
L2 = new PamLevel2("",file.Data(),ddec.Data()); |
| 1106 |
|
if ( NODB ) L2->NoDBconnections(); |
| 1107 |
|
otr = L2->GetPamTree(); |
| 1108 |
|
// printf(" l2 constructor\n"); |
| 1109 |
|
// printf(" abst %u obt %u qtot %f \n",L2->GetOrbitalInfo()->absTime,L2->GetOrbitalInfo()->OBT,L2->GetCaloLevel2()->qtot); |
| 1110 |
|
} else { |
| 1111 |
|
// |
| 1112 |
|
// printf(" l2 already exist \n"); |
| 1113 |
|
otr = L2->GetPamTree(gSystem->DirName(file.Data()),file.Data(),ddec.Data()); |
| 1114 |
|
L2->GetRunTree(gSystem->DirName(file.Data()),file.Data()); |
| 1115 |
|
// |
| 1116 |
|
}; |
| 1117 |
|
// |
| 1118 |
// |
// |
| 1119 |
if ( !otr ) return(0); |
if ( !otr ) return(0); |
|
// ******************** |
|
|
// load magnetic field |
|
|
// ******************** |
|
|
const char *pam_calib = pathtocalibration(); |
|
| 1120 |
// |
// |
| 1121 |
stringstream magfie; |
// otr->CanDeleteRefs(true); |
| 1122 |
magfie.str(""); |
// if ( runtree ) runtree->CanDeleteRefs(true); |
|
// magfie << "/localdisk/mocchiut/test/calib/trk-param/field_param-0/"; |
|
|
magfie << pam_calib; |
|
|
magfie << "/trk-param/field_param-0/"; |
|
| 1123 |
// |
// |
|
L2->GetTrkLevel2()->LoadField(magfie.str().c_str()); |
|
| 1124 |
} else { |
} else { |
| 1125 |
// |
// |
| 1126 |
// load calorimeter ADC2MIP conversion file |
// load calorimeter ADC2MIP conversion file |
| 1161 |
}; |
}; |
| 1162 |
// |
// |
| 1163 |
// |
// |
| 1164 |
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(); |
|
| 1165 |
// |
// |
| 1166 |
if ( level.file == 0 || level.file == -1 ){ |
if ( level.file == 0 || level.file == -1 ){ |
| 1167 |
|
// |
| 1168 |
|
trigger = new pamela::trigger::TriggerEvent(); |
| 1169 |
|
eh = new pamela::EventHeader(); |
| 1170 |
|
ph = new pamela::PscuHeader(); |
| 1171 |
|
de = new pamela::calorimeter::CalorimeterEvent(); |
| 1172 |
|
trk = new pamela::tracker::TrackerEvent(); |
| 1173 |
|
ne = new pamela::neutron::NeutronEvent(); |
| 1174 |
|
ace = new pamela::anticounter::AnticounterEvent(); |
| 1175 |
|
s4 = new pamela::S4::S4Event(); |
| 1176 |
|
tof = new pamela::tof::TofEvent(); |
| 1177 |
|
// |
| 1178 |
|
otr = new TChain("Physics"); |
| 1179 |
|
otr->Add(file.Data(),-1); |
| 1180 |
otr->SetBranchAddress("Trigger", &trigger); |
otr->SetBranchAddress("Trigger", &trigger); |
| 1181 |
otr->SetBranchAddress("Header", &eh); |
otr->SetBranchAddress("Header", &eh); |
| 1182 |
}; |
}; |
|
if ( level.file == 2 && var.RUN){ |
|
|
// otr->AddFriend("OrbitalInfo", file); |
|
|
// otr->SetBranchAddress("OrbitalInfo", &oinfoL2); |
|
|
runinfo->Read(0ULL); |
|
|
}; |
|
| 1183 |
// |
// |
| 1184 |
if ( var.TRK ) { |
if ( var.TRK ) { |
| 1185 |
if ( level.file == 0 || level.file == -1 ){ |
if ( level.file == 0 || level.file == -1 ){ |
| 1252 |
}; |
}; |
| 1253 |
}; |
}; |
| 1254 |
// |
// |
| 1255 |
return(1); |
if ( !otr ){ |
| 1256 |
|
return(0); |
| 1257 |
|
}; |
| 1258 |
|
// |
| 1259 |
|
return otr; |
| 1260 |
// |
// |
| 1261 |
} |
} |
| 1262 |
|
|
| 1332 |
text->DrawLatex(0.33,txthi,testo.str().c_str()); |
text->DrawLatex(0.33,txthi,testo.str().c_str()); |
| 1333 |
txthi -= 0.03; |
txthi -= 0.03; |
| 1334 |
testo2.str(""); |
testo2.str(""); |
| 1335 |
testo2 << "On Board Time: " << (int)OBT; |
testo2 << "On Board Time: " << (unsigned int)OBT; |
| 1336 |
if ( DOBT > 0 ) { |
if ( DOBT > 0 ) { |
| 1337 |
testo2 << " (delta: " << (int)DOBT; |
testo2 << " (delta: " << (unsigned int)DOBT; |
| 1338 |
testo2 << ")"; |
testo2 << ")"; |
| 1339 |
}; |
}; |
| 1340 |
testo2 << " [ms]"; |
testo2 << " [ms]"; |
| 1492 |
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"); |
| 1493 |
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"); |
| 1494 |
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"); |
| 1495 |
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"); |
| 1496 |
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"); |
| 1497 |
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"); |
| 1498 |
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"); |
| 1499 |
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"); |
| 1500 |
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"); |
| 1501 |
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"); |
| 1623 |
// |
// |
| 1624 |
// print infos on terminal |
// print infos on terminal |
| 1625 |
// |
// |
| 1626 |
|
// if ( !var.selex ){ |
| 1627 |
printf(" File: %s \n",var.thefilename.Data()); |
printf(" File: %s \n",var.thefilename.Data()); |
| 1628 |
if ( !s4pulser && !calotrig ){ |
if ( !s4pulser && !calotrig ){ |
| 1629 |
printf(" Pkt_num: %i - Progressive number: %i \n",(int)headc,thisentry+1); |
printf(" Pkt_num: %i - Progressive number: %i \n",(int)headc,thisentry+1); |
| 1634 |
if ( calotrig ){ |
if ( calotrig ){ |
| 1635 |
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); |
| 1636 |
}; |
}; |
| 1637 |
printf(" On Board Time: %i (delta %i) [ms]\n",OBT,DOBT); |
printf(" On Board Time: %u (delta %i) [ms]\n",OBT,DOBT); |
| 1638 |
const char *trc2 = trcs; |
const char *trc2 = trcs; |
| 1639 |
printf(" TRIGGER: %s \n",trc2); |
printf(" TRIGGER: %s \n",trc2); |
| 1640 |
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); |
| 1646 |
printf(" CALO: NSTRIP = %i QTOT = %i [MIP]\n",var.nstrip,var.qtot); |
printf(" CALO: NSTRIP = %i QTOT = %i [MIP]\n",var.nstrip,var.qtot); |
| 1647 |
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]); |
| 1648 |
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); |
| 1649 |
|
// }; |
| 1650 |
// |
// |
| 1651 |
} |
} |
| 1652 |
|
|
| 1954 |
void FEVdetector::ShowTOF(){ |
void FEVdetector::ShowTOF(){ |
| 1955 |
// |
// |
| 1956 |
// |
// |
|
// |
|
| 1957 |
if ( !var.TOF ) return; |
if ( !var.TOF ) return; |
| 1958 |
// |
// |
| 1959 |
Int_t tt = 0; |
Int_t tt = 0; |
| 1960 |
|
Int_t rj = 0; |
| 1961 |
// |
// |
| 1962 |
// force level0, i.e. show patterntrig variable! |
// force level0, i.e. show patterntrig variable! |
| 1963 |
// |
// |
| 1987 |
Float_t mt31[2][3]; |
Float_t mt31[2][3]; |
| 1988 |
Float_t mt32[2][3]; |
Float_t mt32[2][3]; |
| 1989 |
// |
// |
| 1990 |
|
memset(mt11,0,2*8*sizeof(Float_t)); |
| 1991 |
|
memset(mt12,0,2*6*sizeof(Float_t)); |
| 1992 |
|
memset(mt21,0,2*2*sizeof(Float_t)); |
| 1993 |
|
memset(mt22,0,2*2*sizeof(Float_t)); |
| 1994 |
|
memset(mt31,0,2*3*sizeof(Float_t)); |
| 1995 |
|
memset(mt32,0,2*3*sizeof(Float_t)); |
| 1996 |
|
// |
| 1997 |
Int_t S3 = 0; |
Int_t S3 = 0; |
| 1998 |
Int_t S2 = 0; |
Int_t S2 = 0; |
| 1999 |
Int_t S12 = 0; |
Int_t S12 = 0; |
| 2158 |
Float_t s12p = 0.055; |
Float_t s12p = 0.055; |
| 2159 |
ocolo = 10; |
ocolo = 10; |
| 2160 |
TPolyLine *ftof12ya[6]; |
TPolyLine *ftof12ya[6]; |
| 2161 |
|
rj=6; |
| 2162 |
for ( Int_t j=0; j<6; j++){ |
for ( Int_t j=0; j<6; j++){ |
| 2163 |
|
rj--; |
| 2164 |
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)}; |
| 2165 |
Float_t yc1[4]={ -ws13, 0., 0., -ws13}; |
Float_t yc1[4]={ -ws13, 0., 0., -ws13}; |
| 2166 |
Float_t xc[4]; |
Float_t xc[4]; |
| 2176 |
} else { |
} else { |
| 2177 |
colo = 1; |
colo = 1; |
| 2178 |
}; |
}; |
| 2179 |
ColorMIP(ms12a[j],colo); |
ColorMIP(ms12a[rj],colo); |
| 2180 |
// |
// |
| 2181 |
if ( colo != 10 ) ocolo = colo; |
if ( colo != 10 ) ocolo = colo; |
| 2182 |
if ( mt12[0][j] == 4095. ) colo = noadc; |
if ( mt12[0][rj] == 4095. ) colo = noadc; |
| 2183 |
// |
// |
| 2184 |
ftof12ya[j]->SetFillColor(colo); |
ftof12ya[j]->SetFillColor(colo); |
| 2185 |
ftof12ya[j]->SetLineWidth(1); |
ftof12ya[j]->SetLineWidth(1); |
| 2189 |
// B |
// B |
| 2190 |
s12p = 0.055; |
s12p = 0.055; |
| 2191 |
TPolyLine *ftof12yb[6]; |
TPolyLine *ftof12yb[6]; |
| 2192 |
|
rj=6; |
| 2193 |
for ( Int_t j=0; j<6; j++){ |
for ( Int_t j=0; j<6; j++){ |
| 2194 |
|
rj--; |
| 2195 |
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)}; |
| 2196 |
Float_t yc1[4]={ -ws13, -ws13, 0., -ws13}; |
Float_t yc1[4]={ -ws13, -ws13, 0., -ws13}; |
| 2197 |
Float_t xc[4]; |
Float_t xc[4]; |
| 2207 |
} else { |
} else { |
| 2208 |
colo = 1; |
colo = 1; |
| 2209 |
}; |
}; |
| 2210 |
ColorMIP(ms12b[j],colo); |
ColorMIP(ms12b[rj],colo); |
| 2211 |
// |
// |
| 2212 |
if ( colo != 10 ) ocolo = colo; |
if ( colo != 10 ) ocolo = colo; |
| 2213 |
if ( mt12[1][j] == 4095. ) colo = noadc; |
if ( mt12[1][rj] == 4095. ) colo = noadc; |
| 2214 |
// |
// |
| 2215 |
ftof12yb[j]->SetFillColor(colo); |
ftof12yb[j]->SetFillColor(colo); |
| 2216 |
ftof12yb[j]->SetLineWidth(1); |
ftof12yb[j]->SetLineWidth(1); |
| 2244 |
Float_t s21p = 0.075; |
Float_t s21p = 0.075; |
| 2245 |
ocolo = 10; |
ocolo = 10; |
| 2246 |
TPolyLine *ftof21ya[2]; |
TPolyLine *ftof21ya[2]; |
| 2247 |
|
rj=2; |
| 2248 |
for ( Int_t j=0; j<2; j++){ |
for ( Int_t j=0; j<2; j++){ |
| 2249 |
|
rj--; |
| 2250 |
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)}; |
| 2251 |
Float_t yc1[4]={ 0., ws2, ws2, 0.}; |
Float_t yc1[4]={ 0., ws2, ws2, 0.}; |
| 2252 |
Float_t xc[4]; |
Float_t xc[4]; |
| 2262 |
} else { |
} else { |
| 2263 |
colo = 1; |
colo = 1; |
| 2264 |
}; |
}; |
| 2265 |
ColorMIP(ms21a[j],colo); |
ColorMIP(ms21a[rj],colo); |
| 2266 |
// |
// |
| 2267 |
if ( colo != 10 ) ocolo = colo; |
if ( colo != 10 ) ocolo = colo; |
| 2268 |
if ( mt21[0][j] == 4095. ) colo = noadc; |
if ( mt21[0][rj] == 4095. ) colo = noadc; |
| 2269 |
// |
// |
| 2270 |
ftof21ya[j]->SetFillColor(colo); |
ftof21ya[j]->SetFillColor(colo); |
| 2271 |
ftof21ya[j]->SetLineWidth(1); |
ftof21ya[j]->SetLineWidth(1); |
| 2275 |
// B |
// B |
| 2276 |
s21p = 0.075; |
s21p = 0.075; |
| 2277 |
TPolyLine *ftof21yb[2]; |
TPolyLine *ftof21yb[2]; |
| 2278 |
|
rj=2; |
| 2279 |
for ( Int_t j=0; j<2; j++){ |
for ( Int_t j=0; j<2; j++){ |
| 2280 |
|
rj--; |
| 2281 |
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)}; |
| 2282 |
Float_t yc1[4]={ 0., 0., ws2, 0.}; |
Float_t yc1[4]={ 0., 0., ws2, 0.}; |
| 2283 |
Float_t xc[4]; |
Float_t xc[4]; |
| 2293 |
} else { |
} else { |
| 2294 |
colo = 1; |
colo = 1; |
| 2295 |
}; |
}; |
| 2296 |
ColorMIP(ms21b[j],colo); |
ColorMIP(ms21b[rj],colo); |
| 2297 |
// |
// |
| 2298 |
if ( colo != 10 ) ocolo = colo; |
if ( colo != 10 ) ocolo = colo; |
| 2299 |
if ( mt21[1][j] == 4095. ) colo = noadc; |
if ( mt21[1][rj] == 4095. ) colo = noadc; |
| 2300 |
// |
// |
| 2301 |
ftof21yb[j]->SetFillColor(colo); |
ftof21yb[j]->SetFillColor(colo); |
| 2302 |
ftof21yb[j]->SetLineWidth(1); |
ftof21yb[j]->SetLineWidth(1); |
| 2411 |
Float_t s31p = 0.060; |
Float_t s31p = 0.060; |
| 2412 |
ocolo = 10; |
ocolo = 10; |
| 2413 |
TPolyLine *ftof31xa[3]; |
TPolyLine *ftof31xa[3]; |
| 2414 |
|
rj=3; |
| 2415 |
for ( Int_t j=0; j<3; j++){ |
for ( Int_t j=0; j<3; j++){ |
| 2416 |
|
rj--; |
| 2417 |
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)}; |
| 2418 |
Float_t yc1[4]={ 0., ws13, ws13, 0.}; |
Float_t yc1[4]={ 0., ws13, ws13, 0.}; |
| 2419 |
Float_t xc[4]; |
Float_t xc[4]; |
| 2429 |
} else { |
} else { |
| 2430 |
colo = 1; |
colo = 1; |
| 2431 |
}; |
}; |
| 2432 |
ColorMIP(ms31a[j],colo); |
ColorMIP(ms31a[rj],colo); |
| 2433 |
// |
// |
| 2434 |
if ( colo != 10 ) ocolo = colo; |
if ( colo != 10 ) ocolo = colo; |
| 2435 |
if ( mt31[0][j] == 4095. ) colo = noadc; |
if ( mt31[0][rj] == 4095. ) colo = noadc; |
| 2436 |
// |
// |
| 2437 |
ftof31xa[j]->SetFillColor(colo); |
ftof31xa[j]->SetFillColor(colo); |
| 2438 |
ftof31xa[j]->SetLineWidth(1); |
ftof31xa[j]->SetLineWidth(1); |
| 2442 |
// B |
// B |
| 2443 |
s31p = 0.060; |
s31p = 0.060; |
| 2444 |
TPolyLine *ftof31xb[3]; |
TPolyLine *ftof31xb[3]; |
| 2445 |
|
rj=3; |
| 2446 |
for ( Int_t j=0; j<3; j++){ |
for ( Int_t j=0; j<3; j++){ |
| 2447 |
|
rj--; |
| 2448 |
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)}; |
| 2449 |
Float_t yc1[4]={ 0., 0., ws13, 0.}; |
Float_t yc1[4]={ 0., 0., ws13, 0.}; |
| 2450 |
Float_t xc[4]; |
Float_t xc[4]; |
| 2460 |
} else { |
} else { |
| 2461 |
colo = 1; |
colo = 1; |
| 2462 |
}; |
}; |
| 2463 |
ColorMIP(ms31b[j],colo); |
ColorMIP(ms31b[rj],colo); |
| 2464 |
// |
// |
| 2465 |
if ( colo != 10 ) ocolo = colo; |
if ( colo != 10 ) ocolo = colo; |
| 2466 |
if ( mt31[1][j] == 4095. ) colo = noadc; |
if ( mt31[1][rj] == 4095. ) colo = noadc; |
| 2467 |
// |
// |
| 2468 |
ftof31xb[j]->SetFillColor(colo); |
ftof31xb[j]->SetFillColor(colo); |
| 2469 |
ftof31xb[j]->SetLineWidth(1); |
ftof31xb[j]->SetLineWidth(1); |
| 2495 |
Float_t s32p = 0.050; |
Float_t s32p = 0.050; |
| 2496 |
ocolo = 10; |
ocolo = 10; |
| 2497 |
TPolyLine *ftof32ya[3]; |
TPolyLine *ftof32ya[3]; |
| 2498 |
|
rj=3; |
| 2499 |
for ( Int_t j=0; j<3; j++){ |
for ( Int_t j=0; j<3; j++){ |
| 2500 |
|
rj--; |
| 2501 |
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)}; |
| 2502 |
Float_t yc1[4]={ -ws13, 0., 0., -ws13}; |
Float_t yc1[4]={ -ws13, 0., 0., -ws13}; |
| 2503 |
Float_t xc[4]; |
Float_t xc[4]; |
| 2513 |
} else { |
} else { |
| 2514 |
colo = 1; |
colo = 1; |
| 2515 |
}; |
}; |
| 2516 |
ColorMIP(ms32a[j],colo); |
ColorMIP(ms32a[rj],colo); |
| 2517 |
// |
// |
| 2518 |
if ( colo != 10 ) ocolo = colo; |
if ( colo != 10 ) ocolo = colo; |
| 2519 |
if ( mt32[0][j] == 4095. ) colo = noadc; |
if ( mt32[0][rj] == 4095. ) colo = noadc; |
| 2520 |
// |
// |
| 2521 |
ftof32ya[j]->SetFillColor(colo); |
ftof32ya[j]->SetFillColor(colo); |
| 2522 |
ftof32ya[j]->SetLineWidth(1); |
ftof32ya[j]->SetLineWidth(1); |
| 2525 |
}; |
}; |
| 2526 |
s32p = 0.050; |
s32p = 0.050; |
| 2527 |
TPolyLine *ftof32yb[3]; |
TPolyLine *ftof32yb[3]; |
| 2528 |
|
rj=3; |
| 2529 |
for ( Int_t j=0; j<3; j++){ |
for ( Int_t j=0; j<3; j++){ |
| 2530 |
|
rj--; |
| 2531 |
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)}; |
| 2532 |
Float_t yc1[4]={ -ws13, -ws13, 0., -ws13}; |
Float_t yc1[4]={ -ws13, -ws13, 0., -ws13}; |
| 2533 |
Float_t xc[4]; |
Float_t xc[4]; |
| 2543 |
} else { |
} else { |
| 2544 |
colo = 1; |
colo = 1; |
| 2545 |
}; |
}; |
| 2546 |
ColorMIP(ms32b[j],colo); |
ColorMIP(ms32b[rj],colo); |
| 2547 |
// |
// |
| 2548 |
if ( colo != 10 ) ocolo = colo; |
if ( colo != 10 ) ocolo = colo; |
| 2549 |
if ( mt32[1][j] == 4095. ) colo = noadc; |
if ( mt32[1][rj] == 4095. ) colo = noadc; |
| 2550 |
// |
// |
| 2551 |
ftof32yb[j]->SetFillColor(colo); |
ftof32yb[j]->SetFillColor(colo); |
| 2552 |
ftof32yb[j]->SetLineWidth(1); |
ftof32yb[j]->SetLineWidth(1); |
| 2777 |
// |
// |
| 2778 |
// |
// |
| 2779 |
Bool_t repeat = true; |
Bool_t repeat = true; |
| 2780 |
Int_t numtr = 1; |
// Int_t numtr = 1; |
| 2781 |
|
Int_t numtr = 0; |
| 2782 |
Int_t repuntil = 0; |
Int_t repuntil = 0; |
| 2783 |
|
Int_t repuntiltr = 0; |
| 2784 |
// |
// |
| 2785 |
// |
// |
| 2786 |
var.tofraw = 0; |
var.tofraw = 0; |
| 2787 |
// |
// |
| 2788 |
if ( level.file == 2 ) repuntil = L2->GetToFLevel2()->ntrk(); |
if ( level.file == 2 ) repuntil = L2->GetToFLevel2()->ntrk(); |
| 2789 |
// printf("repuntil = %i \n",repuntil); |
// printf("repuntil = %i \n",repuntil); |
| 2790 |
//repuntil = L2->GetNTracks(); |
if ( level.file == 2 ) repuntiltr = L2->GetTrkLevel2()->GetNTracks(); |
| 2791 |
|
// repuntiltr = L2->GetNTracks(); |
| 2792 |
// |
// |
| 2793 |
while ( repeat ){ |
while ( repeat ){ |
| 2794 |
// printf("B repuntil = %i \n",repuntil); |
// printf("B repuntil = %i \n",repuntil); |
| 2797 |
// |
// |
| 2798 |
// |
// |
| 2799 |
ToFTrkVar *ptt = 0; |
ToFTrkVar *ptt = 0; |
| 2800 |
|
PamTrack *ptrack = 0; |
| 2801 |
|
Float_t adc[4][12]; |
| 2802 |
|
Float_t tdc[4][12]; |
| 2803 |
|
memset(adc,0,4*12*sizeof(Float_t)); |
| 2804 |
|
memset(tdc,0,4*12*sizeof(Float_t)); |
| 2805 |
// |
// |
| 2806 |
// |
// |
| 2807 |
|
// if ( repuntil == 0 || var.tofraw ){ |
| 2808 |
if ( repuntil == 1 || var.tofraw ){ |
if ( repuntil == 1 || var.tofraw ){ |
| 2809 |
numtr = 0; |
numtr = 0; |
| 2810 |
ptt = L2->GetToFLevel2()->GetToFTrkVar(0); |
ptt = L2->GetToFLevel2()->GetToFTrkVar(0); |
| 2812 |
} else { |
} else { |
| 2813 |
// |
// |
| 2814 |
// |
// |
| 2815 |
if ( numtr >= repuntil-1 ) repeat = false; |
if ( numtr >= (repuntiltr-1) ) repeat = false; |
| 2816 |
// |
// |
| 2817 |
ptt = L2->GetToFLevel2()->GetToFTrkVar(numtr); |
//printf(" numtr is %i \n",numtr); |
| 2818 |
|
// ptt = L2->GetToFLevel2()->GetToFTrkVar(numtr); |
| 2819 |
|
ptrack = L2->GetTrack(numtr); |
| 2820 |
|
ptt = ptrack->GetToFTrack(); |
| 2821 |
}; |
}; |
| 2822 |
// |
// |
| 2823 |
xp11[0] = 0.; |
xp11[0] = 0.; |
| 2831 |
// |
// |
| 2832 |
ii = 2; |
ii = 2; |
| 2833 |
// |
// |
| 2834 |
Float_t adc[4][12]; |
Int_t myseq = ptt->trkseqno + 1; |
|
Float_t tdc[4][12]; |
|
|
L2->GetToFLevel2()->GetMatrix(numtr,adc,tdc); |
|
|
|
|
| 2835 |
// |
// |
| 2836 |
for ( Int_t i = 0; i<8; i++ ) { |
L2->GetToFLevel2()->GetMatrix(myseq,adc,tdc); |
| 2837 |
if ( adc[ch11a[i]][hb11a[i]] < 1000. ){ |
// |
| 2838 |
ms11a[i] = adc[ch11a[i]][hb11a[i]]; |
// printf(" qua \n"); |
| 2839 |
}; |
// |
| 2840 |
if ( adc[ch11b[i]][hb11b[i]] < 1000. ){ |
// for ( Int_t i = 0; i<8; i++ ) { |
| 2841 |
ms11b[i] = adc[ch11b[i]][hb11b[i]]; |
// if ( adc[ch11a[i]][hb11a[i]] < 1000. ){ |
| 2842 |
}; |
// ms11a[i] = adc[ch11a[i]][hb11a[i]]; |
| 2843 |
// xp11[i] = 0.; |
// }; |
| 2844 |
}; |
// if ( adc[ch11b[i]][hb11b[i]] < 1000. ){ |
| 2845 |
|
// ms11b[i] = adc[ch11b[i]][hb11b[i]]; |
| 2846 |
|
// }; |
| 2847 |
|
// xp11[i] = 0.; |
| 2848 |
|
// }; |
| 2849 |
|
|
| 2850 |
Int_t nmtof = 0; |
Int_t nmtof = 0; |
| 2851 |
Float_t mtof = 0.; |
Float_t mtof = 0.; |
| 2962 |
if ( level.file == -1 ){ |
if ( level.file == -1 ){ |
| 2963 |
ColorMIP(ms11a[j]+ms11b[j],colo); |
ColorMIP(ms11a[j]+ms11b[j],colo); |
| 2964 |
} else { |
} else { |
| 2965 |
ColorTOFMIP(ms11a[j]+ms11b[j],colo); |
ColorTOFMIP((ms11a[j]+ms11b[j])/2.,colo); |
| 2966 |
}; |
}; |
| 2967 |
// |
// |
| 2968 |
if ( colo != 10 ) ocolo = colo; |
if ( colo != 10 ) ocolo = colo; |
| 2992 |
ftof11y->Draw(); |
ftof11y->Draw(); |
| 2993 |
TPolyLine *sftof11[8]; |
TPolyLine *sftof11[8]; |
| 2994 |
tt = 1; |
tt = 1; |
| 2995 |
if ( level.file == -1 ) tt = 8; |
rj=1; |
| 2996 |
|
if ( level.file == -1 ){ |
| 2997 |
|
tt = 8; |
| 2998 |
|
rj = 8; |
| 2999 |
|
}; |
| 3000 |
for ( Int_t j=0; j<tt; j++){ |
for ( Int_t j=0; j<tt; j++){ |
| 3001 |
if ( (mt11[0][j]<4095. || mt11[1][j]<4095.)){ |
rj--; |
| 3002 |
|
if ( (mt11[0][rj]<4095. || mt11[1][rj]<4095.)){ |
| 3003 |
if ( ocolo == 10 ) ocolo = noadc; |
if ( ocolo == 10 ) ocolo = noadc; |
| 3004 |
Float_t lowp = (xp11[j]-E11[j])/100.; |
Float_t lowp = -(xp11[rj]+E11[rj])/100.; |
| 3005 |
Float_t higp = (xp11[j]+E11[j])/100.; |
Float_t higp = -(xp11[rj]-E11[rj])/100.; |
| 3006 |
if ( lowp < -0.164 ) lowp = -0.164; |
if ( lowp < -0.164 ) lowp = -0.164; |
| 3007 |
if ( higp > 0.164 ) higp = 0.164; |
if ( higp > 0.164 ) higp = 0.164; |
| 3008 |
if ( lowp < higp && ( level.file == -1 || (level.file == 2 && xp11[j] != 0.))){ |
if ( lowp < higp && ( level.file == -1 || (level.file == 2 && xp11[rj] != 0.))){ |
| 3009 |
Float_t nxc1[5]={ lowp, higp, higp, lowp, lowp}; |
Float_t nxc1[5]={ lowp, higp, higp, lowp, lowp}; |
| 3010 |
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}; |
| 3011 |
Float_t nxc[5]; |
Float_t nxc[5]; |
| 3030 |
Float_t s12p = 0.055; |
Float_t s12p = 0.055; |
| 3031 |
ocolo = 10; |
ocolo = 10; |
| 3032 |
TPolyLine *ftof12y[6]; |
TPolyLine *ftof12y[6]; |
| 3033 |
|
rj = 6; |
| 3034 |
for ( Int_t j=0; j<6; j++){ |
for ( Int_t j=0; j<6; j++){ |
| 3035 |
|
rj--; |
| 3036 |
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)}; |
| 3037 |
Float_t nyc1[5]={ -ws13, 0., 0., -ws13, -ws13}; |
Float_t nyc1[5]={ -ws13, 0., 0., -ws13, -ws13}; |
| 3038 |
Float_t nxc[5]; |
Float_t nxc[5]; |
| 3049 |
colo = 1; |
colo = 1; |
| 3050 |
}; |
}; |
| 3051 |
if ( level.file == -1 ){ |
if ( level.file == -1 ){ |
| 3052 |
ColorMIP(ms12a[j]+ms12b[j],colo); |
ColorMIP(ms12a[rj]+ms12b[rj],colo); |
| 3053 |
} else { |
} else { |
| 3054 |
ColorTOFMIP(ms12a[j]+ms12b[j],colo); |
ColorTOFMIP((ms12a[rj]+ms12b[rj])/2.,colo); |
| 3055 |
}; |
}; |
| 3056 |
// |
// |
| 3057 |
if ( colo != 10 ) ocolo = colo; |
if ( colo != 10 ) ocolo = colo; |
| 3118 |
Float_t s21p = 0.075; |
Float_t s21p = 0.075; |
| 3119 |
ocolo = 10; |
ocolo = 10; |
| 3120 |
TPolyLine *ftof21y[2]; |
TPolyLine *ftof21y[2]; |
| 3121 |
|
rj=2; |
| 3122 |
for ( Int_t j=0; j<2; j++){ |
for ( Int_t j=0; j<2; j++){ |
| 3123 |
|
rj--; |
| 3124 |
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)}; |
| 3125 |
Float_t nyc1[5]={ 0., ws2, ws2, 0., 0.}; |
Float_t nyc1[5]={ 0., ws2, ws2, 0., 0.}; |
| 3126 |
Float_t nxc[5]; |
Float_t nxc[5]; |
| 3137 |
colo = 1; |
colo = 1; |
| 3138 |
}; |
}; |
| 3139 |
if ( level.file == -1 ){ |
if ( level.file == -1 ){ |
| 3140 |
ColorMIP(ms21a[j]+ms21b[j],colo); |
ColorMIP(ms21a[rj]+ms21b[rj],colo); |
| 3141 |
} else { |
} else { |
| 3142 |
ColorTOFMIP(ms21a[j]+ms21b[j],colo); |
ColorTOFMIP((ms21a[rj]+ms21b[rj])/2.,colo); |
| 3143 |
}; |
}; |
| 3144 |
// |
// |
| 3145 |
if ( colo != 10 ) ocolo = colo; |
if ( colo != 10 ) ocolo = colo; |
| 3225 |
if ( level.file == -1 ){ |
if ( level.file == -1 ){ |
| 3226 |
ColorMIP(ms22a[j]+ms22b[j],colo); |
ColorMIP(ms22a[j]+ms22b[j],colo); |
| 3227 |
} else { |
} else { |
| 3228 |
ColorTOFMIP(ms22a[j]+ms22b[j],colo); |
ColorTOFMIP((ms22a[j]+ms22b[j])/2.,colo); |
| 3229 |
}; |
}; |
| 3230 |
// |
// |
| 3231 |
if ( colo != 10 ) ocolo = colo; |
if ( colo != 10 ) ocolo = colo; |
| 3256 |
ftof22y->Draw(); |
ftof22y->Draw(); |
| 3257 |
TPolyLine *sftof22[2]; |
TPolyLine *sftof22[2]; |
| 3258 |
tt = 1; |
tt = 1; |
| 3259 |
if ( level.file == -1 ) tt = 2; |
rj = 1; |
| 3260 |
|
if ( level.file == -1 ){ |
| 3261 |
|
tt = 2; |
| 3262 |
|
rj = 2; |
| 3263 |
|
}; |
| 3264 |
for (Int_t j=0; j<tt; j++){ |
for (Int_t j=0; j<tt; j++){ |
| 3265 |
|
rj--; |
| 3266 |
// for ( Int_t j=0; j<2; j++){ |
// for ( Int_t j=0; j<2; j++){ |
| 3267 |
if ( (mt22[0][j]<4095. || mt22[1][j]<4095.) ){ |
if ( (mt22[0][rj]<4095. || mt22[1][rj]<4095.) ){ |
| 3268 |
if ( ocolo == 10 ) ocolo = noadc; |
if ( ocolo == 10 ) ocolo = noadc; |
| 3269 |
Float_t lowp = (xp22[j]-E22[j])/100.; |
Float_t lowp = -(xp22[rj]+E22[rj])/100.; |
| 3270 |
Float_t higp = (xp22[j]+E22[j])/100.; |
Float_t higp = -(xp22[rj]-E22[rj])/100.; |
| 3271 |
if ( lowp < -0.074 ) lowp = -0.074; |
if ( lowp < -0.074 ) lowp = -0.074; |
| 3272 |
if ( higp > 0.074 ) higp = 0.074; |
if ( higp > 0.074 ) higp = 0.074; |
| 3273 |
if ( lowp < higp && ( level.file == -1 || (level.file == 2 && xp22[j] != 0.))){ |
if ( lowp < higp && ( level.file == -1 || (level.file == 2 && xp22[rj] != 0.))){ |
| 3274 |
Float_t nxc1[5]={ lowp, higp, higp, lowp, lowp}; |
Float_t nxc1[5]={ lowp, higp, higp, lowp, lowp}; |
| 3275 |
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}; |
| 3276 |
Float_t nxc[5]; |
Float_t nxc[5]; |
| 3290 |
}; |
}; |
| 3291 |
}; |
}; |
| 3292 |
// |
// |
| 3293 |
|
//daquiinbasso |
| 3294 |
// |
// |
| 3295 |
// S31 X-view |
// S31 X-view |
| 3296 |
// |
// |
| 3316 |
if ( level.file == -1 ){ |
if ( level.file == -1 ){ |
| 3317 |
ColorMIP(ms31a[j]+ms31b[j],colo); |
ColorMIP(ms31a[j]+ms31b[j],colo); |
| 3318 |
} else { |
} else { |
| 3319 |
ColorTOFMIP(ms31a[j]+ms31b[j],colo); |
ColorTOFMIP((ms31a[j]+ms31b[j])/2.,colo); |
| 3320 |
}; |
}; |
| 3321 |
// |
// |
| 3322 |
if ( colo != 10 ) ocolo = colo; |
if ( colo != 10 ) ocolo = colo; |
| 3347 |
ftof31y->Draw(); |
ftof31y->Draw(); |
| 3348 |
TPolyLine *sftof31[3]; |
TPolyLine *sftof31[3]; |
| 3349 |
tt = 1; |
tt = 1; |
| 3350 |
if ( level.file == -1 ) tt = 3; |
rj = 1; |
| 3351 |
|
if ( level.file == -1 ){ |
| 3352 |
|
tt = 3; |
| 3353 |
|
rj = 3; |
| 3354 |
|
}; |
| 3355 |
for (Int_t j=0; j<tt; j++){ |
for (Int_t j=0; j<tt; j++){ |
| 3356 |
|
rj--; |
| 3357 |
// for ( Int_t j=0; j<3; j++){ |
// for ( Int_t j=0; j<3; j++){ |
| 3358 |
if ( (mt31[0][j]<4095. || mt31[1][j]<4095.)){ |
if ( (mt31[0][rj]<4095. || mt31[1][rj]<4095.)){ |
| 3359 |
if ( ocolo == 10 ) ocolo = noadc; |
if ( ocolo == 10 ) ocolo = noadc; |
| 3360 |
Float_t lowp = (xp31[j]-E31[j])/100.; |
Float_t lowp = -(xp31[rj]+E31[rj])/100.; |
| 3361 |
Float_t higp = (xp31[j]+E31[j])/100.; |
Float_t higp = -(xp31[rj]-E31[rj])/100.; |
| 3362 |
if ( lowp < -0.074 ) lowp = -0.074; |
if ( lowp < -0.074 ) lowp = -0.074; |
| 3363 |
if ( higp > 0.074 ) higp = 0.074; |
if ( higp > 0.074 ) higp = 0.074; |
| 3364 |
if ( lowp < higp && ( level.file == -1 || (level.file == 2 && xp31[j] != 0.))){ |
if ( lowp < higp && ( level.file == -1 || (level.file == 2 && xp31[rj] != 0.))){ |
| 3365 |
Float_t nxc1[5]={ lowp, higp, higp, lowp, lowp}; |
Float_t nxc1[5]={ lowp, higp, higp, lowp, lowp}; |
| 3366 |
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}; |
| 3367 |
Float_t nxc[5]; |
Float_t nxc[5]; |
| 3388 |
Float_t s32p = 0.050; |
Float_t s32p = 0.050; |
| 3389 |
ocolo = 10; |
ocolo = 10; |
| 3390 |
TPolyLine *ftof32y[3]; |
TPolyLine *ftof32y[3]; |
| 3391 |
|
rj = 3; |
| 3392 |
for ( Int_t j=0; j<3; j++){ |
for ( Int_t j=0; j<3; j++){ |
| 3393 |
|
rj--; |
| 3394 |
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)}; |
| 3395 |
Float_t nyc1[5]={ -ws13, 0., 0., -ws13, -ws13}; |
Float_t nyc1[5]={ -ws13, 0., 0., -ws13, -ws13}; |
| 3396 |
Float_t nxc[5]; |
Float_t nxc[5]; |
| 3407 |
colo = 1; |
colo = 1; |
| 3408 |
}; |
}; |
| 3409 |
if ( level.file == -1 ){ |
if ( level.file == -1 ){ |
| 3410 |
ColorMIP(ms32a[j]+ms32b[j],colo); |
ColorMIP(ms32a[rj]+ms32b[rj],colo); |
| 3411 |
} else { |
} else { |
| 3412 |
ColorTOFMIP(ms32a[j]+ms32b[j],colo); |
ColorTOFMIP((ms32a[rj]+ms32b[rj])/2.,colo); |
| 3413 |
}; |
}; |
| 3414 |
// |
// |
| 3415 |
if ( colo != 10 ) ocolo = colo; |
if ( colo != 10 ) ocolo = colo; |
| 4376 |
pcasp4b->Draw("f"); |
pcasp4b->Draw("f"); |
| 4377 |
pcasp4b->Draw(); |
pcasp4b->Draw(); |
| 4378 |
}; |
}; |
| 4379 |
Float_t alfa = 1.2020334; |
// Float_t alfax = 1.2020334; |
| 4380 |
|
Float_t alfax = 1.22157778; |
| 4381 |
|
Float_t alfay = 1.27393111; |
| 4382 |
Float_t lcrd = 0.1815/2.; |
Float_t lcrd = 0.1815/2.; |
| 4383 |
Float_t wcrd = 0.008; |
Float_t wcrd = 0.008; |
| 4384 |
if ( true ){ |
if ( true ){ |
| 4589 |
// |
// |
| 4590 |
// Float_t cardcx = 0.143168*var.sfx; |
// Float_t cardcx = 0.143168*var.sfx; |
| 4591 |
//Float_t cardcy = 0.1475*var.sfy; |
//Float_t cardcy = 0.1475*var.sfy; |
| 4592 |
Float_t cardcx = 0.153168*var.sfx; |
// |
| 4593 |
Float_t cardcy = 0.1575*var.sfy; |
// Float_t cardcx = 0.153168*var.sfx; |
| 4594 |
Float_t acrdx[4] = {-lcrd*cos(alfa), lcrd*cos(alfa), -lcrd*cos(alfa)+wcrd*sin(alfa), -lcrd*cos(alfa)}; |
// |
| 4595 |
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; |
| 4596 |
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; |
| 4597 |
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; |
| 4598 |
|
Float_t acrdx[4] = {-lcrd*cos(alfax), lcrd*cos(alfax), -lcrd*cos(alfax)+wcrd*sin(alfax), -lcrd*cos(alfax)}; |
| 4599 |
|
Float_t acrdy[4] = {-lcrd*sin(alfax), lcrd*sin(alfax), -lcrd*sin(alfax)-wcrd*cos(alfax), -lcrd*sin(alfax)}; |
| 4600 |
|
Float_t bcrdx[4] = { lcrd*cos(alfax), lcrd*cos(alfax)+wcrd*sin(alfax), -lcrd*cos(alfax)+wcrd*sin(alfax), lcrd*cos(alfax)}; |
| 4601 |
|
Float_t bcrdy[4] = { lcrd*sin(alfax), lcrd*sin(alfax)-wcrd*cos(alfax), -lcrd*sin(alfax)-wcrd*cos(alfax), lcrd*sin(alfax)}; |
| 4602 |
|
|
| 4603 |
// |
// |
| 4604 |
// CARD3 X/ Y |
// CARD3 X/ Y |
| 4658 |
}; |
}; |
| 4659 |
|
|
| 4660 |
if ( true ){ |
if ( true ){ |
| 4661 |
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)}; |
| 4662 |
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)}; |
| 4663 |
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)}; |
| 4664 |
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)}; |
| 4665 |
// |
// |
| 4666 |
// CARD - Y-view |
// CARD - Y-view |
| 4667 |
// |
// |
| 4668 |
Float_t cardcx = 0.12*var.sfx; |
// Float_t cardcx = 0.12*var.sfx; |
| 4669 |
Float_t cardcy = 0.1475*var.sfy; |
Float_t cardcx = (0.16014*(1.-lcrd*cos(alfay)))*var.sfx; |
| 4670 |
|
// Float_t cardcy = 0.178818*var.sfy; |
| 4671 |
|
Float_t cardcy = (0.178818*(1.-lcrd*sin(alfay)))*var.sfy; |
| 4672 |
|
// Float_t cardcy = 0.1475*var.sfy; |
| 4673 |
// |
// |
| 4674 |
// CARD4 X Y/ |
// CARD4 X Y/ |
| 4675 |
// |
// |
| 5123 |
for (Int_t m = 0; m<3; m++){ |
for (Int_t m = 0; m<3; m++){ |
| 5124 |
if ( trk->signcluster[l][m] != 0. ){ |
if ( trk->signcluster[l][m] != 0. ){ |
| 5125 |
if ( planeno == 10 ) { |
if ( planeno == 10 ) { |
|
x = 1024 - trk->addrcluster[l][m]; |
|
|
} else { |
|
| 5126 |
x = trk->addrcluster[l][m]; |
x = trk->addrcluster[l][m]; |
| 5127 |
|
} else { |
| 5128 |
|
x = 1024 - trk->addrcluster[l][m]; |
| 5129 |
}; |
}; |
| 5130 |
linea = new TLine(14.+x,0.01,14.+x,0.3); |
linea = new TLine(14.+x,0.01,14.+x,0.3); |
| 5131 |
linea->SetLineWidth(2); |
linea->SetLineWidth(2); |
| 5195 |
trkpad[planepad]->cd(); |
trkpad[planepad]->cd(); |
| 5196 |
trkpad[planepad]->Range(-7.05,0.,7.05,8.); |
trkpad[planepad]->Range(-7.05,0.,7.05,8.); |
| 5197 |
for (Int_t img=0; img<2; img++){ |
for (Int_t img=0; img<2; img++){ |
| 5198 |
x = singlet->coord[img]; |
x = -singlet->coord[img]; |
| 5199 |
Float_t xsig = singlet->sgnl; |
Float_t xsig = singlet->sgnl; |
| 5200 |
if ( xsig > 8. ) xsig = 8.; |
if ( xsig > 8. ) xsig = 8.; |
| 5201 |
// |
// |
| 5251 |
trkpad[planepad]->Range(-8.1,0.,8.1,8.); |
trkpad[planepad]->Range(-8.1,0.,8.1,8.); |
| 5252 |
// |
// |
| 5253 |
x = track->xm[plane]; |
x = track->xm[plane]; |
| 5254 |
Float_t xsig = track->dedx_x[plane]; |
Float_t xsig = fabs(track->dedx_x[plane]); |
| 5255 |
if ( track->xgood[plane] ){ |
if ( track->XGood(plane) ){ |
| 5256 |
//if ( x > -100 ){ |
//if ( x > -100 ){ |
| 5257 |
if ( xsig > 8. ) xsig = 8.; |
if ( xsig > 8. ) xsig = 8.; |
| 5258 |
if ( var.bw ){ |
if ( var.bw ){ |
| 5260 |
} else { |
} else { |
| 5261 |
sigcol2 = 1; |
sigcol2 = 1; |
| 5262 |
}; |
}; |
| 5263 |
ColorTRKMIP(track->dedx_x[plane],sigcol2,0); |
ColorTRKMIP(fabs(track->dedx_x[plane]),sigcol2,0); |
| 5264 |
linea = new TLine(x,0.01,x,xsig); |
linea = new TLine(x,0.01,x,xsig); |
| 5265 |
linea->SetLineWidth(2); |
linea->SetLineWidth(2); |
| 5266 |
linea->SetLineColor(sigcol2); |
linea->SetLineColor(sigcol2); |
| 5280 |
planepad = plane * 2; |
planepad = plane * 2; |
| 5281 |
trkpad[planepad]->cd(); |
trkpad[planepad]->cd(); |
| 5282 |
trkpad[planepad]->Range(-7.05,0.,7.05,8.); |
trkpad[planepad]->Range(-7.05,0.,7.05,8.); |
| 5283 |
x = track->ym[plane]; |
x = -track->ym[plane]; |
| 5284 |
xsig = track->dedx_y[plane]; |
xsig = fabs(track->dedx_y[plane]); |
| 5285 |
if ( track->ygood[plane] ){ |
if ( track->YGood(plane) ){ |
| 5286 |
// if ( x > -100 ){ |
// if ( x > -100 ){ |
| 5287 |
if ( xsig > 8. ) xsig = 8.; |
if ( xsig > 8. ) xsig = 8.; |
| 5288 |
if ( var.bw ){ |
if ( var.bw ){ |
| 5290 |
} else { |
} else { |
| 5291 |
sigcol2 = 1; |
sigcol2 = 1; |
| 5292 |
}; |
}; |
| 5293 |
ColorTRKMIP(track->dedx_y[plane],sigcol2,0); |
ColorTRKMIP(fabs(track->dedx_y[plane]),sigcol2,0); |
| 5294 |
linea = new TLine(x,0.01,x,xsig); |
linea = new TLine(x,0.01,x,xsig); |
| 5295 |
linea->SetLineWidth(2); |
linea->SetLineWidth(2); |
| 5296 |
linea->SetLineColor(sigcol2); |
linea->SetLineColor(sigcol2); |
| 5333 |
// first of all plot crosses relatives to tracks |
// first of all plot crosses relatives to tracks |
| 5334 |
// |
// |
| 5335 |
if ( L2->GetTrkLevel2()->GetNTracks() > 0 ){ |
if ( L2->GetTrkLevel2()->GetNTracks() > 0 ){ |
| 5336 |
|
// for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ |
| 5337 |
|
// TrkTrack *track = L2->GetTrkLevel2()->GetTrack(nt); |
| 5338 |
for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ |
for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ |
| 5339 |
TrkTrack *track = L2->GetTrkLevel2()->GetTrack(nt); |
PamTrack *ptrack= L2->GetTrack(nt); |
| 5340 |
|
TrkTrack *track = ptrack->GetTrkTrack(); |
| 5341 |
|
// |
| 5342 |
for (Int_t plane = 0; plane<6; plane++){ |
for (Int_t plane = 0; plane<6; plane++){ |
| 5343 |
// |
// |
| 5344 |
x = track->xm[plane]; |
x = track->xm[plane]; |
| 5345 |
Float_t y = track->ym[plane]; |
Float_t y = -track->ym[plane]; |
| 5346 |
Float_t xsig = track->dedx_x[plane]; |
Float_t xsig = fabs(track->dedx_x[plane]); |
| 5347 |
Float_t ysig = track->dedx_y[plane]; |
Float_t ysig = fabs(track->dedx_y[plane]); |
| 5348 |
// if ( x > -100 && y > -100. ){ |
// if ( x > -100 && y > -100. ){ |
| 5349 |
if ( track->xgood[plane] && track->ygood[plane] ){ |
if ( track->XGood(plane) && track->YGood(plane) ){ |
| 5350 |
if ( var.bw ){ |
if ( var.bw ){ |
| 5351 |
sigcol1 = -1; |
sigcol1 = -1; |
| 5352 |
sigcol2 = -1; |
sigcol2 = -1; |
| 5464 |
for (Int_t sing = 0; sing < min(totsx,totsy); sing++){ |
for (Int_t sing = 0; sing < min(totsx,totsy); sing++){ |
| 5465 |
// |
// |
| 5466 |
x = arrax->At(orderx->At(sing)); |
x = arrax->At(orderx->At(sing)); |
| 5467 |
Float_t y1 = array1->At(ordery->At(sing)); |
Float_t y1 = -array1->At(ordery->At(sing)); |
| 5468 |
Float_t y2 = array2->At(ordery->At(sing)); |
Float_t y2 = -array2->At(ordery->At(sing)); |
| 5469 |
Float_t xsig = sigarrax->At(orderx->At(sing)); |
Float_t xsig = sigarrax->At(orderx->At(sing)); |
| 5470 |
Float_t ysig = sigarray->At(ordery->At(sing)); |
Float_t ysig = sigarray->At(ordery->At(sing)); |
| 5471 |
if ( x > -100 && y1 > -100. ){ |
if ( x > -100 && y1 > -100. ){ |
| 5558 |
for (Int_t m = 0; m<3; m++){ |
for (Int_t m = 0; m<3; m++){ |
| 5559 |
if ( trk->signcluster[l][m] != 0. ){ |
if ( trk->signcluster[l][m] != 0. ){ |
| 5560 |
if ( planeno == 10 ) { |
if ( planeno == 10 ) { |
|
x = 1024 - trk->addrcluster[l][m]; |
|
|
} else { |
|
| 5561 |
x = trk->addrcluster[l][m]; |
x = trk->addrcluster[l][m]; |
| 5562 |
|
} else { |
| 5563 |
|
x = 1024 - trk->addrcluster[l][m]; |
| 5564 |
}; |
}; |
| 5565 |
x += 1024.; |
x += 1024.; |
| 5566 |
if ( trk->signcluster[l][m]> ysig ){ |
if ( trk->signcluster[l][m]> ysig ){ |
| 5567 |
ysig = trk->signcluster[l][m]; |
ysig = trk->signcluster[l][m]; |
| 5568 |
yh1[ncro] = x-1024.; |
yh1[ncro] = x - 1024.; |
| 5569 |
yh2[ncro] = x; |
yh2[ncro] = x; |
| 5570 |
}; |
}; |
| 5571 |
}; |
}; |
| 5593 |
for (Int_t m = 0; m<3; m++){ |
for (Int_t m = 0; m<3; m++){ |
| 5594 |
if ( trk->signcluster[e][m] != 0. ){ |
if ( trk->signcluster[e][m] != 0. ){ |
| 5595 |
if ( planeno == 10 ) { |
if ( planeno == 10 ) { |
|
x = 1024 - trk->addrcluster[e][m]; |
|
|
} else { |
|
| 5596 |
x = trk->addrcluster[e][m]; |
x = trk->addrcluster[e][m]; |
| 5597 |
|
} else { |
| 5598 |
|
x = 1024 - trk->addrcluster[e][m]; |
| 5599 |
}; |
}; |
| 5600 |
x += 1024.; |
x += 1024.; |
| 5601 |
if ( trk->signcluster[e][m]> ysig ){ |
if ( trk->signcluster[e][m]> ysig ){ |
| 5602 |
ysig = trk->signcluster[e][m]; |
ysig = trk->signcluster[e][m]; |
| 5603 |
yh1[ncro] = x-1024.; |
yh1[ncro] = x - 1024.; |
| 5604 |
yh2[ncro] = x; |
yh2[ncro] = x; |
| 5605 |
}; |
}; |
| 5606 |
}; |
}; |
| 5652 |
|
|
| 5653 |
void FEVdetector::ShowTrack(){ |
void FEVdetector::ShowTrack(){ |
| 5654 |
// |
// |
| 5655 |
|
if ( level.file != 2 ) return; |
| 5656 |
// |
// |
| 5657 |
// |
// |
| 5658 |
if ( var.CALO && false ){ |
// |
| 5659 |
|
if ( var.CALO && var.CALOT ){ |
| 5660 |
if ( L2->GetCaloLevel2()->npcfit[0] > 0 && L2->GetCaloLevel2()->npcfit[1] > 0 ){ |
if ( L2->GetCaloLevel2()->npcfit[0] > 0 && L2->GetCaloLevel2()->npcfit[1] > 0 ){ |
| 5661 |
Float_t calx[22]; |
Float_t calx[22]; |
| 5662 |
Float_t caly[22]; |
Float_t caly[22]; |
| 5673 |
}; |
}; |
| 5674 |
for (Int_t plane = 0; plane < 22; plane++){ |
for (Int_t plane = 0; plane < 22; plane++){ |
| 5675 |
calx[plane] = (L2->GetCaloLevel2()->cbar[plane][0]/100.)*var.sfx + var.xxvc;; |
calx[plane] = (L2->GetCaloLevel2()->cbar[plane][0]/100.)*var.sfx + var.xxvc;; |
| 5676 |
caly[plane] = (L2->GetCaloLevel2()->cbar[plane][1]/100.)*var.sfx + var.xyvc; |
caly[plane] = (-L2->GetCaloLevel2()->cbar[plane][1]/100.)*var.sfx + var.xyvc; |
| 5677 |
// calzx[plane] = zpiano[plane] -5.81*var.sfy/1000. + var.yxvc; |
// calzx[plane] = zpiano[plane] -5.81*var.sfy/1000. + var.yxvc; |
| 5678 |
calzx[plane] = zpiano[plane] + var.yxvc; |
calzx[plane] = zpiano[plane] + var.yxvc; |
| 5679 |
calzy[plane] = zpiano[plane] + var.yyvc; |
calzy[plane] = zpiano[plane] + var.yyvc; |
| 5722 |
// |
// |
| 5723 |
for (Int_t plane = 0; plane < 22; plane++){ |
for (Int_t plane = 0; plane < 22; plane++){ |
| 5724 |
calx[plane] = (ctra->tbar[plane][0]/100.)*var.sfx + var.xxvc;; |
calx[plane] = (ctra->tbar[plane][0]/100.)*var.sfx + var.xxvc;; |
| 5725 |
caly[plane] = (ctra->tbar[plane][1]/100.)*var.sfx + var.xyvc; |
caly[plane] = (-ctra->tbar[plane][1]/100.)*var.sfx + var.xyvc; |
| 5726 |
// calzx[plane] = zpiano[plane] -5.81*var.sfy/1000. + var.yxvc; |
// calzx[plane] = zpiano[plane] -5.81*var.sfy/1000. + var.yxvc; |
| 5727 |
calzx[plane] = zpiano[plane] + var.yxvc; |
calzx[plane] = zpiano[plane] + var.yxvc; |
| 5728 |
calzy[plane] = zpiano[plane] + var.yyvc; |
calzy[plane] = zpiano[plane] + var.yyvc; |
| 5751 |
}; |
}; |
| 5752 |
}; |
}; |
| 5753 |
// |
// |
| 5754 |
if ( !var.TRK || level.file != 2 ) return; |
if ( !var.TRK ) return; |
| 5755 |
// |
// |
| 5756 |
if ( L2->GetTrkLevel2()->GetNTracks() > 0 ){ |
if ( L2->GetTrkLevel2()->GetNTracks() > 0 ){ |
| 5757 |
for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ |
for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ |
| 5758 |
|
|
| 5759 |
// TrkTrack *track = L2->GetTrkLevel2()->GetTrack(nt); |
// TrkTrack *track = L2->GetTrkLevel2()->GetTrack(nt); |
| 5760 |
|
// printf("qui \n"); |
| 5761 |
PamTrack *ptrack = L2->GetTrack(nt); |
PamTrack *ptrack = L2->GetTrack(nt); |
| 5762 |
TrkTrack *track = ptrack->GetTrkTrack(); |
TrkTrack *track = ptrack->GetTrkTrack(); |
| 5763 |
|
// printf("qua \n"); |
| 5764 |
Int_t npoint = 100; |
Int_t npoint = 100; |
| 5765 |
Float_t zin[100]; |
Float_t zin[100]; |
| 5766 |
Double_t xout[100]; |
Double_t xout[100]; |
| 5809 |
// |
// |
| 5810 |
Trajectory *tr = new Trajectory(npoint,zin); |
Trajectory *tr = new Trajectory(npoint,zin); |
| 5811 |
// |
// |
| 5812 |
ifail = track->DoTrack2(tr); |
// ifail = track->DoTrack2(tr); |
| 5813 |
|
ifail = track->DoTrack(tr); |
| 5814 |
// |
// |
| 5815 |
if ( !ifail ){ |
if ( !ifail ){ |
| 5816 |
for ( Int_t e = 0; e < npoint ; e++) { |
for ( Int_t e = 0; e < npoint ; e++) { |
| 5817 |
tx[e] = ((float)tr->x[e]/100.)*var.sfx + var.xxvc; |
tx[e] = ((float)tr->x[e]/100.)*var.sfx + var.xxvc; |
| 5818 |
ty[e] = ((float)tr->y[e]/100.)*var.sfx + var.xyvc; |
ty[e] = (-(float)tr->y[e]/100.)*var.sfx + var.xyvc; |
| 5819 |
if ( e < 50 ) { |
if ( e < 50 ) { |
| 5820 |
ptx1[e] = ((float)tr->y[e]/100.)*var.sfx + var.xcat; |
ptx1[e] = (-(float)tr->y[e]/100.)*var.sfx + var.xcat; |
| 5821 |
pty1[e] = ((float)tr->x[e]/100.)*var.sfy + var.ycat; |
pty1[e] = ((float)tr->x[e]/100.)*var.sfy + var.ycat; |
| 5822 |
} else { |
} else { |
| 5823 |
ptx2[e-50] = ((float)tr->y[e]/100.)*var.sfx + var.xcat; |
ptx2[e-50] = (-(float)tr->y[e]/100.)*var.sfx + var.xcat; |
| 5824 |
pty2[e-50] = ((float)tr->x[e]/100.)*var.sfy + var.ycat; |
pty2[e-50] = ((float)tr->x[e]/100.)*var.sfy + var.ycat; |
| 5825 |
}; |
}; |
| 5826 |
if ( e > 84 ) { |
if ( e > 84 ) { |
| 5827 |
tx1[e-85] = ((float)tr->x[e]/100.)*var.nds4 + var.xxvc; |
tx1[e-85] = ((float)tr->x[e]/100.)*var.nds4 + var.xxvc; |
| 5828 |
ty1[e-85] = ((float)tr->y[e]/100.)*var.nds4 + var.xyvc; |
ty1[e-85] = (-(float)tr->y[e]/100.)*var.nds4 + var.xyvc; |
| 5829 |
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; |
| 5830 |
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; |
| 5831 |
}; |
}; |
| 5969 |
Int_t se = 5; |
Int_t se = 5; |
| 5970 |
if ( !l && m%2 == 0 ) se = 3; |
if ( !l && m%2 == 0 ) se = 3; |
| 5971 |
if ( !l && m%2 != 0 ) se = 2; |
if ( !l && m%2 != 0 ) se = 2; |
| 5972 |
if ( l && m%2 == 0 ) se = 1; |
if ( l && m%2 != 0 ) se = 1; |
| 5973 |
if ( l && m%2 != 0 ) se = 0; |
if ( l && m%2 == 0 ) se = 0; |
| 5974 |
// |
// |
| 5975 |
// determine what kind of event we are going to analyze |
// determine what kind of event we are going to analyze |
| 5976 |
// |
// |
| 6065 |
Xview->Draw("box same"); |
Xview->Draw("box same"); |
| 6066 |
}; |
}; |
| 6067 |
if ( l == 1 ) { |
if ( l == 1 ) { |
| 6068 |
Yview->Fill(n,21-m,1.); |
Yview->Fill(95-n,21-m,1.); |
| 6069 |
pd2->cd(); |
pd2->cd(); |
| 6070 |
Yview->Draw("box same"); |
Yview->Draw("box same"); |
| 6071 |
}; |
}; |
| 6085 |
// |
// |
| 6086 |
// Define variables |
// Define variables |
| 6087 |
// |
// |
| 6088 |
Int_t etime = var.etime; |
UInt_t etime = var.etime; |
| 6089 |
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]; |
| 6090 |
Int_t badstrip = 0; |
Int_t badstrip = 0; |
| 6091 |
qtot = 0.; |
qtot = 0.; |
| 6157 |
if ( calib.ttime[s][b[s]+1] && calib.time[s][b[s]] ){ |
if ( calib.ttime[s][b[s]+1] && calib.time[s][b[s]] ){ |
| 6158 |
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 ){ |
| 6159 |
printf(" CALORIMETER: \n" ); |
printf(" CALORIMETER: \n" ); |
| 6160 |
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]); |
| 6161 |
printf(" END CALORIMETER. \n\n" ); |
printf(" END CALORIMETER. \n\n" ); |
| 6162 |
b[s]++; |
b[s]++; |
| 6163 |
CaloPede(s); |
CaloPede(s); |
| 6177 |
Int_t se = 5; |
Int_t se = 5; |
| 6178 |
if (l == 0 && m%2 == 0) se = 3; |
if (l == 0 && m%2 == 0) se = 3; |
| 6179 |
if (l == 0 && m%2 != 0) se = 2; |
if (l == 0 && m%2 != 0) se = 2; |
| 6180 |
if (l == 1 && m%2 == 0) se = 1; |
if (l == 1 && m%2 != 0) se = 1; |
| 6181 |
if (l == 1 && m%2 != 0) se = 0; |
if (l == 1 && m%2 == 0) se = 0; |
| 6182 |
// |
// |
| 6183 |
// determine what kind of event we are going to analyze |
// determine what kind of event we are going to analyze |
| 6184 |
// |
// |
| 6294 |
Xview->Draw("box same"); |
Xview->Draw("box same"); |
| 6295 |
}; |
}; |
| 6296 |
if ( l == 1 ) { |
if ( l == 1 ) { |
| 6297 |
Yview->Fill(n,21-m,1.); |
Yview->Fill(96-n,21-m,1.); |
| 6298 |
pd2->cd(); |
pd2->cd(); |
| 6299 |
Yview->Draw("box same"); |
Yview->Draw("box same"); |
| 6300 |
}; |
}; |
| 6381 |
// |
// |
| 6382 |
stringstream xvev; |
stringstream xvev; |
| 6383 |
stringstream yvev; |
stringstream yvev; |
| 6384 |
for (Int_t ii = 0; ii < L2->GetCaloLevel2()->nstrip; ii++){ |
// for (Int_t ii = 0; ii < L2->GetCaloLevel2()->nstrip; ii++){ |
| 6385 |
|
for (Int_t ii = 0; ii < L2->GetCaloLevel1()->istrip; ii++){ |
| 6386 |
Int_t colo; |
Int_t colo; |
| 6387 |
Int_t l; |
Int_t l; |
| 6388 |
Int_t m; |
Int_t m; |
| 6389 |
Int_t n; |
Int_t n; |
| 6390 |
Float_t mip = L2->GetCaloLevel1()->DecodeEstrip(ii,l,m,n); |
Bool_t satura = false; |
| 6391 |
|
Float_t mip = L2->GetCaloLevel1()->DecodeEstrip(ii,l,m,n,satura); |
| 6392 |
if ( var.bw ){ |
if ( var.bw ){ |
| 6393 |
colo = -1; |
colo = -1; |
| 6394 |
} else { |
} else { |
| 6395 |
colo = 1; |
colo = 1; |
| 6396 |
}; |
}; |
| 6397 |
ColorMIP(mip,colo); |
ColorMIP(mip,colo); |
| 6398 |
if ( l == 0 ) { |
if ( l == 0 ) { |
| 6399 |
xvev.str(""); |
xvev.str(""); |
| 6402 |
xvev << " " << l; |
xvev << " " << l; |
| 6403 |
gDirectory->Delete(xvev.str().c_str()); |
gDirectory->Delete(xvev.str().c_str()); |
| 6404 |
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); |
| 6405 |
Xview->SetFillColor(colo); |
if ( satura ){ |
| 6406 |
|
Xview->SetFillColor(kBlack); |
| 6407 |
|
} else { |
| 6408 |
|
Xview->SetFillColor(colo); |
| 6409 |
|
}; |
| 6410 |
Xview->Fill(n,21-m,1.); |
Xview->Fill(n,21-m,1.); |
| 6411 |
pd1->cd(); |
pd1->cd(); |
| 6412 |
Xview->Draw("box same"); |
Xview->Draw("box same"); |
| 6418 |
yvev << " " << l; |
yvev << " " << l; |
| 6419 |
gDirectory->Delete(yvev.str().c_str()); |
gDirectory->Delete(yvev.str().c_str()); |
| 6420 |
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); |
| 6421 |
Yview->SetFillColor(colo); |
if ( satura ){ |
| 6422 |
Yview->Fill(n,21-m,1.); |
Yview->SetFillColor(kBlack); |
| 6423 |
|
} else { |
| 6424 |
|
Yview->SetFillColor(colo); |
| 6425 |
|
}; |
| 6426 |
|
Yview->Fill(96-n,21-m,1.); |
| 6427 |
pd2->cd(); |
pd2->cd(); |
| 6428 |
Yview->Draw("box same"); |
Yview->Draw("box same"); |
| 6429 |
}; |
}; |
| 6472 |
for (Int_t d = 0; d<48; d++){ |
for (Int_t d = 0; d<48; d++){ |
| 6473 |
if ( calib.ttime[s][d] != 0 ) calibex++; |
if ( calib.ttime[s][d] != 0 ) calibex++; |
| 6474 |
if ( calib.time[s][0] != 0 ){ |
if ( calib.time[s][0] != 0 ){ |
| 6475 |
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]); |
| 6476 |
if ( calib.time[s][d+1] != 0 ) { |
if ( calib.time[s][d+1] != 0 ) { |
| 6477 |
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]); |
| 6478 |
} else { |
} else { |
| 6479 |
if ( !stop ){ |
if ( !stop ){ |
| 6480 |
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]); |
| 6481 |
stop = 1; |
stop = 1; |
| 6482 |
}; |
}; |
| 6483 |
}; |
}; |
| 6484 |
} else { |
} else { |
| 6485 |
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]); |
| 6486 |
}; |
}; |
| 6487 |
}; |
}; |
| 6488 |
printf("\n"); |
printf("\n"); |
| 6547 |
calib.ttime[s][inter] = 0; |
calib.ttime[s][inter] = 0; |
| 6548 |
if ( ce->cstwerr[s] != 0 && ce->cperror[s] == 0 ) { |
if ( ce->cstwerr[s] != 0 && ce->cperror[s] == 0 ) { |
| 6549 |
//calib.ttime[s][inter] = cph->GetOrbitalTime(); |
//calib.ttime[s][inter] = cph->GetOrbitalTime(); |
| 6550 |
calib.ttime[s][inter] = cph->OrbitalTime; |
calib.ttime[s][inter] = (UInt_t)cph->OrbitalTime; |
| 6551 |
inter++; |
inter++; |
| 6552 |
} else { |
} else { |
| 6553 |
if ( ce->cstwerr[s] != 0 && ce->cperror[s] != 0 ) { |
if ( ce->cstwerr[s] != 0 && ce->cperror[s] != 0 ) { |
| 6601 |
tr->GetEntry(ci); |
tr->GetEntry(ci); |
| 6602 |
cph = ceh->GetPscuHeader(); |
cph = ceh->GetPscuHeader(); |
| 6603 |
//if ( atime == cph->GetOrbitalTime()){ |
//if ( atime == cph->GetOrbitalTime()){ |
| 6604 |
if ( atime == cph->OrbitalTime){ |
if ( atime == (UInt_t)cph->OrbitalTime){ |
| 6605 |
// calib.iev = ce->iev; |
// calib.iev = ce->iev; |
| 6606 |
if (ce->cstwerr[s] != 0 && ce->cperror[s] == 0 ) { |
if (ce->cstwerr[s] != 0 && ce->cperror[s] == 0 ) { |
| 6607 |
for ( Int_t d=0 ; d<11 ;d++ ){ |
for ( Int_t d=0 ; d<11 ;d++ ){ |