| 46 | #include <TEllipse.h> | #include <TEllipse.h> | 
| 47 | #include <TArrow.h> | #include <TArrow.h> | 
| 48 | #include <TStyle.h> | #include <TStyle.h> | 
| 49 |  | #include <TStreamerElement.h> | 
| 50 |  | #include <TRealData.h> | 
| 51 | // | // | 
| 52 | #include <PamelaRun.h> | #include <PamelaRun.h> | 
| 53 | #include <physics/calorimeter/CalorimeterEvent.h> | #include <physics/calorimeter/CalorimeterEvent.h> | 
| 69 | #include <FEVdetector.h> | #include <FEVdetector.h> | 
| 70 | #include <FEventViewer.h> | #include <FEventViewer.h> | 
| 71 | #include <feventvstruct.h> | #include <feventvstruct.h> | 
| 72 |  | #include <color.h> | 
| 73 | // | // | 
| 74 | extern Bool_t existfile(TString); | extern Bool_t existfile(TString); | 
| 75 | // | // | 
| 83 | thefigure = &figure; | thefigure = &figure; | 
| 84 | checkctrlword(); | checkctrlword(); | 
| 85 | var.selex = false; | var.selex = false; | 
| 86 |  | var.showall = false; | 
| 87 |  |  | 
| 88 |  | var.showsi = false; | 
| 89 |  | var.shownd = false; | 
| 90 |  | var.shows4 = false; | 
| 91 |  | var.showorb = false; | 
| 92 |  | var.showtof = false; | 
| 93 |  | var.showtrg = false; | 
| 94 |  | var.showtrk = false; | 
| 95 |  | var.showcal = false; | 
| 96 |  | var.showrun = false; | 
| 97 |  | var.showac = false; | 
| 98 |  | } | 
| 99 |  |  | 
| 100 |  | void FEVdetector::Reset(){ | 
| 101 |  | L2 = NULL; | 
| 102 | } | } | 
| 103 |  |  | 
| 104 | void FEVdetector::checkctrlword(){ | void FEVdetector::checkctrlword(){ | 
| 107 | var.AC = 0; | var.AC = 0; | 
| 108 | var.RUN = 1; | var.RUN = 1; | 
| 109 | var.TRK = 0; | var.TRK = 0; | 
| 110 |  | var.ORB = 1; | 
| 111 |  | var.TRG = 1; | 
| 112 | var.CALO = 0; | var.CALO = 0; | 
| 113 |  | var.CALOT = 0; | 
| 114 | var.S4 = 0; | var.S4 = 0; | 
| 115 | var.ND = 0; | var.ND = 0; | 
| 116 | var.INFOS = 0; | var.INFOS = 0; | 
| 150 | }; | }; | 
| 151 |  |  | 
| 152 | void FEVdetector::GetWindow(){ | void FEVdetector::GetWindow(){ | 
| 153 | otr->GetEntry(maxevent); | // | 
| 154 |  | if ( level.file == 2 ){ | 
| 155 |  | //    printf("0qui\n"); | 
| 156 |  | L2->GetEntry(minevent); | 
| 157 |  | } else { | 
| 158 |  | otr->GetEntry(minevent); | 
| 159 |  | } | 
| 160 | if ( level.file < 2 ){ | if ( level.file < 2 ){ | 
| 161 | ph = eh->GetPscuHeader(); | ph = eh->GetPscuHeader(); | 
| 162 | lastevno = (int)ph->Counter; | firstevno = (int)ph->Counter; | 
| 163 | } else { | } else { | 
| 164 | lastevno = L2->GetOrbitalInfo()->pkt_num; // to be changed as soon as we will have pkt_counter in the level2 file! | if ( var.ORB ){ | 
| 165 |  | firstevno = L2->GetOrbitalInfo()->pkt_num; | 
| 166 |  | } else { | 
| 167 |  | firstevno = 0; | 
| 168 |  | }; | 
| 169 | }; | }; | 
| 170 | otr->GetEntry(minevent); | // | 
| 171 |  | if ( level.file == 2 ){ | 
| 172 |  | //    printf("1qui\n"); | 
| 173 |  | L2->GetEntry(maxevent); | 
| 174 |  | } else { | 
| 175 |  | otr->GetEntry(maxevent); | 
| 176 |  | } | 
| 177 |  | // | 
| 178 | if ( level.file < 2 ){ | if ( level.file < 2 ){ | 
| 179 | ph = eh->GetPscuHeader(); | ph = eh->GetPscuHeader(); | 
| 180 | firstevno = (int)ph->Counter; | lastevno = (int)ph->Counter; | 
| 181 | } else { | } else { | 
| 182 | firstevno = L2->GetOrbitalInfo()->pkt_num; // to be changed as soon as we will have pkt_counter in the level2 file! | if ( var.ORB ){ | 
| 183 |  | lastevno = L2->GetOrbitalInfo()->pkt_num; | 
| 184 |  | } else { | 
| 185 |  | lastevno = 0; | 
| 186 |  | }; | 
| 187 | }; | }; | 
| 188 |  | // | 
| 189 | } | } | 
| 190 |  |  | 
| 191 | void FEVdetector::ClearVariables(){ | void FEVdetector::ClearVariables(){ | 
| 208 | } | } | 
| 209 |  |  | 
| 210 | void FEVdetector::GetEntry(Int_t i){ | void FEVdetector::GetEntry(Int_t i){ | 
| 211 | thisentry = i; | thisentry = i; | 
| 212 | otr->GetEntry(i); | if ( level.file == 2 ){ | 
| 213 | //  PrintData(otr,-1LL,44); | //    L2->Clear(); | 
| 214 |  | //    printf("qui\n"); | 
| 215 |  | L2->GetEntry(i); | 
| 216 |  | if ( var.showall ){ | 
| 217 |  | ShowInfo("RunInfo"); | 
| 218 |  | ShowInfo("SoftInfo"); | 
| 219 |  | ShowInfo("OrbitalInfo"); | 
| 220 |  | ShowInfo("TrigLevel2"); | 
| 221 |  | ShowInfo("ToFLevel2"); | 
| 222 |  | ShowInfo("TrkLevel2"); | 
| 223 |  | ShowInfo("AcLevel2"); | 
| 224 |  | ShowInfo("CaloLevel2"); | 
| 225 |  | ShowInfo("CaloLevel1"); | 
| 226 |  | ShowInfo("S4Level2"); | 
| 227 |  | ShowInfo("NDLevel2"); | 
| 228 |  | } else { | 
| 229 |  | if ( var.showrun ) ShowInfo("RunInfo"); | 
| 230 |  | if ( var.showsi ) ShowInfo("SoftInfo"); | 
| 231 |  | if ( var.showorb ) ShowInfo("OrbitalInfo"); | 
| 232 |  | if ( var.showtrg ) ShowInfo("TrigLevel2"); | 
| 233 |  | if ( var.showtof ) ShowInfo("ToFLevel2"); | 
| 234 |  | if ( var.showtrk ) ShowInfo("TrkLevel2"); | 
| 235 |  | if ( var.showac ) ShowInfo("AcLevel2"); | 
| 236 |  | if ( var.showcal ) ShowInfo("CaloLevel2"); | 
| 237 |  | if ( var.showcal ) ShowInfo("CaloLevel1"); | 
| 238 |  | if ( var.shows4 ) ShowInfo("S4Level2"); | 
| 239 |  | if ( var.shownd ) ShowInfo("NDLevel2"); | 
| 240 |  | }; | 
| 241 |  | } else { | 
| 242 |  | otr->GetEntry(i); | 
| 243 |  | if ( var.showall ){ | 
| 244 |  | ShowInfo("Pscu"); | 
| 245 |  | ShowInfo("Trigger"); | 
| 246 |  | ShowInfo("Tof"); | 
| 247 |  | ShowInfo("Tracker"); | 
| 248 |  | ShowInfo("Anticounter"); | 
| 249 |  | ShowInfo("Calorimeter"); | 
| 250 |  | ShowInfo("S4"); | 
| 251 |  | ShowInfo("Neutron"); | 
| 252 |  | } else { | 
| 253 |  | if ( var.showorb ) ShowInfo("Pscu"); | 
| 254 |  | if ( var.showtrg ) ShowInfo("Trigger"); | 
| 255 |  | if ( var.showtof ) ShowInfo("Tof"); | 
| 256 |  | if ( var.showtrk ) ShowInfo("Tracker"); | 
| 257 |  | if ( var.showac ) ShowInfo("Anticounter"); | 
| 258 |  | if ( var.showcal ) ShowInfo("Calorimeter"); | 
| 259 |  | if ( var.shows4 ) ShowInfo("S4"); | 
| 260 |  | if ( var.shownd ) ShowInfo("Neutron"); | 
| 261 |  | }; | 
| 262 |  | }; | 
| 263 | } | } | 
| 264 |  |  | 
| 265 | void FEVdetector::SetEntry(Int_t i){ | void FEVdetector::SetEntry(Int_t i){ | 
| 380 | }; | }; | 
| 381 | } | } | 
| 382 |  |  | 
| 383 | void FEVdetector::PrintLeaves(TTree *otr, Int_t i, TBranchElement *tb, Int_t lenmax){ | void FEVdetector::ShowInfo(TString detector){ | 
| 384 | // -- Prints values of leaves. | // | 
| 385 |  | TBranch *b1 = 0; | 
| 386 | //  tb->ValidateAddress(); | //  TBranch *b3 = 0; | 
| 387 | printf("son qua \n"); | TObjArray *branch_array = 0; | 
| 388 |  | //  TObjArray *leaf_array = 0; | 
| 389 |  | // | 
| 390 |  | if ( !strcmp(detector.Data(),"RunInfo") || !strcmp(detector.Data(),"SoftInfo") ){ | 
| 391 |  | if ( L2->GetRunTree() ) b1 = L2->GetRunTree()->FindBranch(detector.Data()); | 
| 392 |  | } else { | 
| 393 |  | b1 = otr->FindBranch(detector.Data()); | 
| 394 |  | }; | 
| 395 |  | // | 
| 396 |  | if ( !b1 ) return; | 
| 397 |  | // | 
| 398 |  | Int_t dlen = 10; | 
| 399 |  | // | 
| 400 |  | char o[200000]; | 
| 401 |  | char col[13]; | 
| 402 |  | char col2[13]; | 
| 403 |  | // | 
| 404 |  | setcolor(col,RESET, GREEN, WHITE); | 
| 405 |  | sprintf(o,"%s======> EVENT:%i\n",col, thisentry); | 
| 406 |  | // | 
| 407 |  | setcolor(col,RESET, RED, WHITE); | 
| 408 |  | sprintf(o,"%s%sBranch %s\n",o,col,b1->GetName()); | 
| 409 |  | setcolor(col,RESET, BLACK, WHITE); | 
| 410 |  | sprintf(o,"%s%s",o,col); | 
| 411 |  | // | 
| 412 |  | branch_array = b1->GetListOfBranches(); | 
| 413 |  | // | 
| 414 |  | Int_t j = 0; | 
| 415 |  | // | 
| 416 |  | for(Int_t l=0;l<(branch_array->GetLast()+1);l++){ | 
| 417 |  | // | 
| 418 |  | TBranchElement *tb = (TBranchElement*)branch_array->At(l); | 
| 419 |  | Int_t type = tb->GetType(); | 
| 420 |  | Int_t atype = tb->GetStreamerType() - 20; | 
| 421 |  | Int_t len = (tb->GetInfo()->GetLengths())[tb->GetID()]; | 
| 422 |  | Int_t length = min(len,dlen); | 
| 423 |  | // | 
| 424 |  | //        printf("Branches : type is %i type is %i tb getname %s  slen %i slength %i\n",atype,type,tb->GetName(),len,length); | 
| 425 |  | switch (type){ | 
| 426 |  | case 0: | 
| 427 |  | // | 
| 428 |  | // IS A VARIABLE | 
| 429 |  | // | 
| 430 |  | // | 
| 431 |  | // NAME | 
| 432 |  | // | 
| 433 |  | setcolor(col,RESET, BLUE, WHITE); | 
| 434 |  | setcolor(col2,RESET, BLACK, WHITE); | 
| 435 |  | sprintf(o,"%s%s %-15s%s =",o,col,((TBranch*)branch_array->At(l))->GetName(),col2); | 
| 436 |  | // | 
| 437 |  | j = 0; | 
| 438 |  | // | 
| 439 |  | // VALUES | 
| 440 |  | // | 
| 441 |  | // | 
| 442 |  | // Integer | 
| 443 |  | // | 
| 444 |  | if ( atype == 3 || atype == -17 ){ | 
| 445 |  | while ( j < length ){ | 
| 446 |  | if ( j < length -1 ){ | 
| 447 |  | sprintf(o,"%s %i ,",o,(Int_t)tb->GetValue(j,0)); | 
| 448 |  | } else { | 
| 449 |  | sprintf(o,"%s %i",o,(Int_t)tb->GetValue(j,0)); | 
| 450 |  | }; | 
| 451 |  | j++; | 
| 452 |  | }; | 
| 453 |  | }; | 
| 454 |  | // | 
| 455 |  | // Unsigned integer | 
| 456 |  | // | 
| 457 |  | if ( atype == -7 || atype == 13 || atype == -9 || atype == -8 || atype == 12 ){ | 
| 458 |  | while ( j < length ){ | 
| 459 |  | if ( j < length -1 ){ | 
| 460 |  | sprintf(o,"%s %u ,",o,(UInt_t)tb->GetValue(j,0)); | 
| 461 |  | } else { | 
| 462 |  | sprintf(o,"%s %u",o,(UInt_t)tb->GetValue(j,0)); | 
| 463 |  | }; | 
| 464 |  | j++; | 
| 465 |  | }; | 
| 466 |  | }; | 
| 467 |  | // | 
| 468 |  | // Float | 
| 469 |  | // | 
| 470 |  | if ( atype == -15 || atype == 5 ){ | 
| 471 |  | while ( j < length ){ | 
| 472 |  | if ( j < length -1 ){ | 
| 473 |  | sprintf(o,"%s %f ,",o,tb->GetValue(j,0)); | 
| 474 |  | } else { | 
| 475 |  | sprintf(o,"%s %f",o,tb->GetValue(j,0)); | 
| 476 |  | }; | 
| 477 |  | j++; | 
| 478 |  | }; | 
| 479 |  | }; | 
| 480 |  | // | 
| 481 |  | // Strings | 
| 482 |  | // | 
| 483 |  | if ( atype == 45 ){ | 
| 484 |  | //      TObjArray *cl = (TObjArray*)(tb->GetInfo()->GetOffsets())[tb->GetID()];//tb->GetValuePointer(); | 
| 485 |  | //      TString *stringa = (TString*)(*cl)[0]; | 
| 486 |  | //      TBranchElement *utb = (TBranchElement*)tb->GetBranchCount(); | 
| 487 |  | //      TString** stringa = (TString*)(&tb->GetValuePointer()); | 
| 488 |  | //TStreamerElement *tste = (TStreamerElement*)tb->GetInfo()->GetCurrentElement(); | 
| 489 |  |  | 
| 490 |  | //      char *ladd; | 
| 491 |  | //      ladd = tb->GetValuePointer() | 
| 492 |  | //      TString *stringa = (TString*)((tste->GetOffset())); | 
| 493 |  | //      TString& mstr = *stringa; | 
| 494 |  | //      printf(" la mia stringa %s \n",mstr.Data()); | 
| 495 |  | //      printf(" offset %i \n",(Int_t)utb->GetValue(0,0)); | 
| 496 |  | //      int pointer = (tb->GetInfo()->GetOffsets())[tb->GetID()]; | 
| 497 |  | //      TString *stringa = (TString*)(tb->GetInfo()->GetOffsets())[tb->GetID()]; | 
| 498 |  | //      TString *stringa = (TString*)tb->GetAddress(); | 
| 499 |  | //      printf(" address 0x%X \n",tb->GetAddress()); | 
| 500 |  | //      printf(" pointer 0x%X \n",tb->GetValuePointer()); | 
| 501 |  | //      printf(" object  0x%X \n",tb->GetObject()); | 
| 502 |  | //      printf("stringa %s lung %i\n",stringa.Data(),stringa.Length()); | 
| 503 |  | //      TLeaf *striglia = tb->FindLeaf(tb->GetName()); | 
| 504 |  | //      if ( striglia ){ | 
| 505 |  | //        char *pointer = (char *)striglia->GetValuePointer(); | 
| 506 |  | //        TString *pr= (TString*)pointer; | 
| 507 |  | //        printf("ciao %s \n",pr->Data()); | 
| 508 |  | //      }; | 
| 509 |  | sprintf(o,"%s TString - not implemented yet -",o); | 
| 510 |  | }; | 
| 511 |  | // | 
| 512 |  | // TArray | 
| 513 |  | // | 
| 514 |  | if ( atype == 42 ){ | 
| 515 |  | // | 
| 516 |  | //      TObjArray *cl = (TObjArray*)tb->GetObject(); | 
| 517 |  | //      // | 
| 518 |  | //      TClass *myc = cl->IsA(); | 
| 519 |  | //      // | 
| 520 |  | //      printf("qui \n"); | 
| 521 |  | //      // | 
| 522 |  | //      // determine offset to fetch data | 
| 523 |  | //      // | 
| 524 |  | //      int thisoffset = 0; | 
| 525 |  | //      TRealData *rd = myc->GetRealData(tb->GetName()); | 
| 526 |  | //      if ( rd ){ | 
| 527 |  | //        thisoffset = rd->GetThisOffset(); | 
| 528 |  | //      }; | 
| 529 |  | //      Int_t niente = 0; | 
| 530 |  | //      TStreamerElement *tste = tb->GetInfo()->GetStreamerElement(rd->GetName(),niente); | 
| 531 |  | //      printf(" typename %s \n",tste->GetTypeName()); | 
| 532 |  | //      // | 
| 533 |  | //      // TArrayI | 
| 534 |  | //      // | 
| 535 |  | //      if ( !strcmp(tste->GetTypeName(),"TArrayI") ){ | 
| 536 |  | //        // | 
| 537 |  | //        printf("qua \n"); | 
| 538 |  | //        char *pointer = (char*)cl->At(0); | 
| 539 |  | //        //      char *pu = thisoffset + pointer; | 
| 540 |  | //        int pu = (int)tste->GetTObjectOffset(); | 
| 541 |  | //        TArrayI arr = (TArrayI)*pu; | 
| 542 |  | //        //      TArrayI arr = (TArrayI)(thisoffset); | 
| 543 |  | //        //TArrayI *arr = (TArrayI*)pu; | 
| 544 |  | //        //TArraI arr = (TArrayI) | 
| 545 |  | //        Int_t jj=0; | 
| 546 |  | //        j=0; | 
| 547 |  | //        printf("quii \n"); | 
| 548 |  | //        Int_t arlen = min(arr.GetSize(),dlen); | 
| 549 |  | //        // | 
| 550 |  | //        printf("que \n"); | 
| 551 |  | //        setcolor(col,RESET, BLUE, WHITE); | 
| 552 |  | //        setcolor(col2,RESET, BLACK, WHITE); | 
| 553 |  | //        sprintf(o,"%s%s %s[%i]%s = ",o,col,tb->GetName(),arr.GetSize(),col2); | 
| 554 |  | //        // | 
| 555 |  | //        //      while ( j < tb->GetNdata() ){ | 
| 556 |  | //        // | 
| 557 |  | //        printf("quo \n"); | 
| 558 |  | //        //        pointer = (char*)cl->UncheckedAt(j); | 
| 559 |  | //        //        pu = pointer + thisoffset; | 
| 560 |  | //        //        arr = (TArrayI*)(thisoffset); | 
| 561 |  | //        // | 
| 562 |  | //        while ( jj < arlen ){ | 
| 563 |  | //          if ( jj < arlen-1 ){ | 
| 564 |  | //            sprintf(o,"%s %i ,",o,arr.At(jj)); | 
| 565 |  | //          } else { | 
| 566 |  | //            sprintf(o,"%s %i",o,arr.At(jj)); | 
| 567 |  | //          }; | 
| 568 |  | //          jj++; | 
| 569 |  | //        }; | 
| 570 |  | //          //      if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); | 
| 571 |  | //          //      j++; | 
| 572 |  | //          //    }; | 
| 573 |  | //      }; | 
| 574 |  | //      // | 
| 575 |  | //      // TArrayF | 
| 576 |  | //      // | 
| 577 |  | //      if ( !strcmp(tste->GetTypeName(),"TArrayF") ){ | 
| 578 |  | //        // | 
| 579 |  | //        char *pointer = (char*)cl->UncheckedAt(0); | 
| 580 |  | //        char *pu = pointer + thisoffset; | 
| 581 |  | //        TArrayF *arr = (TArrayF*)(pu); | 
| 582 |  | //        Int_t jj=0; | 
| 583 |  | //        Int_t arlen = min(arr->GetSize(),dlen); | 
| 584 |  | //        // | 
| 585 |  | //        setcolor(col,RESET, BLUE, WHITE); | 
| 586 |  | //        setcolor(col2,RESET, BLACK, WHITE); | 
| 587 |  | //        sprintf(o,"%s%s %s[%i]%s = ",o,col,tb->GetName(),arr->GetSize(),col2); | 
| 588 |  | //        // | 
| 589 |  | //        while ( j < tb->GetNdata() ){ | 
| 590 |  | //          // | 
| 591 |  | //          pointer = (char*)cl->UncheckedAt(j); | 
| 592 |  | //          pu = pointer + thisoffset; | 
| 593 |  | //          arr = (TArrayF*)(pu); | 
| 594 |  | //          // | 
| 595 |  | //          while ( jj < arlen ){ | 
| 596 |  | //            if ( jj < arlen-1 ){ | 
| 597 |  | //              sprintf(o,"%s %f ,",o,arr->At(jj)); | 
| 598 |  | //            } else { | 
| 599 |  | //              sprintf(o,"%s %f",o,arr->At(jj)); | 
| 600 |  | //            }; | 
| 601 |  | //            jj++; | 
| 602 |  | //          }; | 
| 603 |  | //          if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); | 
| 604 |  | //          j++; | 
| 605 |  | //        }; | 
| 606 |  | //      }; | 
| 607 |  | //      sprintf(o,"%s\n",o); | 
| 608 |  | // | 
| 609 |  | sprintf(o,"%s TArray - not implemented yet -",o); | 
| 610 |  | // | 
| 611 |  | }; | 
| 612 |  | // | 
| 613 |  | sprintf(o,"%s\n",o); | 
| 614 |  | break; | 
| 615 |  | case 3: | 
| 616 |  | // | 
| 617 |  | // IS A TCLONESARRAY | 
| 618 |  | // | 
| 619 |  | setcolor(col,RESET, BLUE, WHITE); | 
| 620 |  | setcolor(col2,RESET, BLACK, WHITE); | 
| 621 |  | sprintf(o,"%s%s %-15s%s = %d\n",o,col,tb->GetName(), col2, tb->GetNdata()); | 
| 622 |  |  | 
| 623 | //  if (otr->GetMakeClass()) { | // | 
| 624 | if (!tb->GetAddress()) { | if ( tb->GetNdata() ){ | 
| 625 | printf("esco \n"); | // | 
| 626 | return; | TClonesArray *cl = (TClonesArray*)tb->GetObject(); | 
| 627 | } | // | 
| 628 | if (tb->GetType() == 3 || tb->GetType() == 4) { | TClass *myc = cl->GetClass(); | 
| 629 | // TClonesArray or STL container top-level branch. | // | 
| 630 | printf("3 o 4 %-15s = %d\n", tb->GetName(), tb->GetNdata()); | TList *lme = myc->GetListOfDataMembers(); | 
| 631 | return; | TIter next(lme); | 
| 632 | } else if (tb->GetType() == 31 || tb->GetType() == 41) { | TBranchElement *tb2 = 0; | 
| 633 | printf(" 31 o 41 \n"); | // | 
| 634 | // TClonesArray or STL container sub-branch. | while ( (tb2 = (TBranchElement*)next()) ){ | 
| 635 | Int_t n = TMath::Min(10, tb->GetNdata()); | // | 
| 636 | Int_t atype = tb->GetStreamerType() + 20; | const char *name = tb2->GetName(); | 
| 637 | if (tb->GetStreamerType() == 1) { | TBranch *foglia = tb->FindBranch(name); | 
| 638 | // TVirtualStreamerInfo::kOffsetL + TVirtualStreamerInfo::kChar is | if ( foglia ){ | 
| 639 | // printed as a string and could print weird characters. | // | 
| 640 | // So we print an unsigned char instead (not perfect, but better). | TBranchElement *stb = (TBranchElement*)tb->FindBranch(name); | 
| 641 | atype = 20 + 11 ; | Int_t stype = stb->GetType(); | 
| 642 | } | Int_t satype = stb->GetStreamerType() - 20; | 
| 643 | if (atype > 54) { | Int_t slen = (stb->GetInfo()->GetLengths())[stb->GetID()]; | 
| 644 | // FIXME: More logic required here (like in ReadLeaves) | Int_t slength = min(slen,dlen); | 
| 645 | 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); | 
| 646 | return; | switch (stype){ | 
| 647 | } | case 31: | 
| 648 | if (tb->GetStreamerType() > 20) { | // | 
| 649 | atype -= 20; | // IS A VARIABLE | 
| 650 | TObjArray *prova= otr->GetListOfLeaves(); | // | 
| 651 | //      TObjArray* leaf2 = (TObjArray*) prova->UncheckedAt(i); | // | 
| 652 | //TLeaf* leaf = (TLeaf*)(otr->GetLeaf(tb->GetName())); | // NAME | 
| 653 | //      TLeafElement* leaf = (TLeafElement*)((TLeaf*)(otr->GetListOfLeaves()->UncheckedAt(i))->GetBranch()->UncheckedAt(0)); | // | 
| 654 | TLeafElement* leaf = (TLeafElement*)(prova->UncheckedAt(0)); | j = 0; | 
| 655 | n = n * leaf->GetLenStatic(); | // | 
| 656 | } | // VALUES | 
| 657 | if (tb->GetInfo()) { | // | 
| 658 | //      n = 16; | if ( satype == 41 || satype == 44){ | 
| 659 | tb->GetInfo()->PrintValue(tb->GetName(), tb->GetAddress(), atype, n, lenmax); | // | 
| 660 | //tb->GetObject()->GetInfo()->PrintValue(tb->GetName(), tb->GetObject(), atype, n, lenmax); | // skip TRef | 
| 661 | } | // | 
| 662 | return; | break; | 
| 663 | } else if (tb->GetType() <= 2) { | }; | 
| 664 | printf(" <=2 \n"); | // | 
| 665 | // Branch in split mode. | // Integer | 
| 666 | // FIXME: This should probably be < 60 instead. | // | 
| 667 | if ((tb->GetStreamerType() > 40) && (tb->GetStreamerType() < 55)) { | if ( satype == -17 || satype == -9 ){ | 
| 668 | Int_t atype = tb->GetStreamerType() - 20; | // | 
| 669 | TBranchElement* counterElement = (TBranchElement*) tb->GetBranchCount(); | setcolor(col,RESET, BLUE, WHITE); | 
| 670 | Int_t n = (Int_t) counterElement->GetValue(0, 0); | setcolor(col2,RESET, BLACK, WHITE); | 
| 671 | if (tb->GetInfo()) { | sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2); | 
| 672 | tb->GetInfo()->PrintValue(tb->GetName(), tb->GetAddress(), atype, n, lenmax); | while ( j < cl->GetEntriesFast() ){ | 
| 673 | } | if ( j < cl->GetEntriesFast() -1 ){ | 
| 674 | } else { | sprintf(o,"%s %i ,",o,(Int_t)stb->GetValue(j,slength)); | 
| 675 | //      if (tb->GetInfo()) { | } else { | 
| 676 | //        tb->GetInfo()->PrintValue(tb->GetName(), tb->GetObject(), tb->GetID(), -1, lenmax); | sprintf(o,"%s %i",o,(Int_t)stb->GetValue(j,slength)); | 
| 677 | //             } | }; | 
| 678 | //          } | j++; | 
| 679 | return; | }; | 
| 680 | } | }; | 
| 681 | } else if (tb->GetType() == 3) { | // | 
| 682 | printf("3 %-15s = %d\n", tb->GetName(), tb->GetNdata()); | // Float | 
| 683 | } else if (tb->GetType() == 31) { | // | 
| 684 | printf("31 %-15s = %d\n", tb->GetName(), tb->GetNdata()); | if ( satype == -15 ){ | 
| 685 | //     TClonesArray* clones = (TClonesArray*) tb->GetObject(); | // | 
| 686 | //     if (tb->GetInfo()) { | setcolor(col,RESET, BLUE, WHITE); | 
| 687 | //       tb->GetInfo()->PrintValueClones(tb->GetName(), clones, tb->GetID(), tb->GetOffset(), lenmax); | setcolor(col2,RESET, BLACK, WHITE); | 
| 688 | //       } | sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2); | 
| 689 | } else if (tb->GetType() == 41) { | while ( j < cl->GetEntriesFast() ){ | 
| 690 | printf("41 %-15s = %d\n", tb->GetName(), tb->GetNdata()); | if ( j < cl->GetEntriesFast() -1 ){ | 
| 691 | //       TVirtualCollectionProxy::TPushPop helper(((TBranchElement*) this)->GetCollectionProxy(), fObject); | sprintf(o,"%s %f ,",o,stb->GetValue(j,slength)); | 
| 692 | //       if (GetInfo()) { | } else { | 
| 693 | //          GetInfo()->PrintValueSTL(GetName(), ((TBranchElement*) this)->GetCollectionProxy(), fID, fOffset, lenmax); | sprintf(o,"%s %f",o,stb->GetValue(j,slength)); | 
| 694 | //       } | }; | 
| 695 | } else { | j++; | 
| 696 | printf("else %-15s = %d\n", tb->GetName(), tb->GetNdata()); | }; | 
| 697 | //       if (GetInfo()) { | }; | 
| 698 | //          GetInfo()->PrintValue(GetName(), fObject, fID, -1, lenmax); | // | 
| 699 | //       } | // Array of float | 
| 700 | } | // | 
| 701 |  | if ( satype == 5 ){ | 
| 702 |  | // | 
| 703 |  | setcolor(col,RESET, BLUE, WHITE); | 
| 704 |  | setcolor(col2,RESET, BLACK, WHITE); | 
| 705 |  | sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2); | 
| 706 |  | Bool_t bold = true; | 
| 707 |  | while ( j < tb->GetNdata() ){ | 
| 708 |  | if ( bold ){ | 
| 709 |  | setcolor(col,RESET, BLACK, WHITE); | 
| 710 |  | sprintf(o,"%s%s",o,col); | 
| 711 |  | } else { | 
| 712 |  | setcolor(col,BOLD, BLACK, WHITE); | 
| 713 |  | sprintf(o,"%s%s",o,col); | 
| 714 |  | }; | 
| 715 |  | Int_t jj = 0; | 
| 716 |  | while ( jj < slength ){ | 
| 717 |  | if ( jj < slength-1 ){ | 
| 718 |  | sprintf(o,"%s %f ,",o,stb->GetValue(j,jj,true)); | 
| 719 |  | } else { | 
| 720 |  | sprintf(o,"%s %f",o,stb->GetValue(j,jj,true)); | 
| 721 |  | }; | 
| 722 |  | jj++; | 
| 723 |  | }; | 
| 724 |  | if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); | 
| 725 |  | if ( !bold ){ | 
| 726 |  | bold = true; | 
| 727 |  | } else { | 
| 728 |  | bold = false; | 
| 729 |  | }; | 
| 730 |  | j++; | 
| 731 |  | }; | 
| 732 |  | if ( bold ){ | 
| 733 |  | setcolor(col,RESET, BLACK, WHITE); | 
| 734 |  | sprintf(o,"%s%s",o,col); | 
| 735 |  | }; | 
| 736 |  | }; | 
| 737 |  | // | 
| 738 |  | // Array of integers | 
| 739 |  | // | 
| 740 |  | if ( satype == 3 ){ | 
| 741 |  | // | 
| 742 |  | setcolor(col,RESET, BLUE, WHITE); | 
| 743 |  | setcolor(col2,RESET, BLACK, WHITE); | 
| 744 |  | sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2); | 
| 745 |  | while ( j < tb->GetNdata() ){ | 
| 746 |  | Int_t jj = 0; | 
| 747 |  | while ( jj < slength ){ | 
| 748 |  | if ( jj < slength-1 ){ | 
| 749 |  | sprintf(o,"%s %i ,",o,(Int_t)stb->GetValue(j,jj,true)); | 
| 750 |  | } else { | 
| 751 |  | sprintf(o,"%s %i",o,(Int_t)stb->GetValue(j,jj,true)); | 
| 752 |  | }; | 
| 753 |  | jj++; | 
| 754 |  | }; | 
| 755 |  | if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); | 
| 756 |  | j++; | 
| 757 |  | }; | 
| 758 |  | }; | 
| 759 |  |  | 
| 760 | //  }; | // | 
| 761 | printf("esco qui\n"); | // TArray | 
| 762 |  | // | 
| 763 |  | if ( satype == 42 ){ | 
| 764 |  | // | 
| 765 |  | // determine offset to fetch data | 
| 766 |  | // | 
| 767 |  | int thisoffset = 0; | 
| 768 |  | TRealData *rd = myc->GetRealData(foglia->GetName()); | 
| 769 |  | if ( rd ){ | 
| 770 |  | thisoffset = rd->GetThisOffset(); | 
| 771 |  | }; | 
| 772 |  | Int_t niente = 0; | 
| 773 |  | TStreamerElement *tste = stb->GetInfo()->GetStreamerElement(rd->GetName(),niente); | 
| 774 |  | // | 
| 775 |  | // TArrayI | 
| 776 |  | // | 
| 777 |  | if ( !strcmp(tste->GetTypeName(),"TArrayI") ){ | 
| 778 |  | // | 
| 779 |  | char *pointer = (char*)cl->UncheckedAt(0); | 
| 780 |  | char *pu = pointer + thisoffset; | 
| 781 |  | TArrayI *arr = (TArrayI*)(pu); | 
| 782 |  | Int_t jj=0; | 
| 783 |  | Int_t arlen = min(arr->GetSize(),dlen); | 
| 784 |  | // | 
| 785 |  | setcolor(col,RESET, BLUE, WHITE); | 
| 786 |  | setcolor(col2,RESET, BLACK, WHITE); | 
| 787 |  | sprintf(o,"%s%s %s[%i]%s = ",o,col,foglia->GetName(),arr->GetSize(),col2); | 
| 788 |  | // | 
| 789 |  | while ( j < tb->GetNdata() ){ | 
| 790 |  | // | 
| 791 |  | pointer = (char*)cl->UncheckedAt(j); | 
| 792 |  | pu = pointer + thisoffset; | 
| 793 |  | arr = (TArrayI*)(pu); | 
| 794 |  | // | 
| 795 |  | while ( jj < arlen ){ | 
| 796 |  | if ( jj < arlen-1 ){ | 
| 797 |  | sprintf(o,"%s %i ,",o,arr->At(jj)); | 
| 798 |  | } else { | 
| 799 |  | sprintf(o,"%s %i",o,arr->At(jj)); | 
| 800 |  | }; | 
| 801 |  | jj++; | 
| 802 |  | }; | 
| 803 |  | if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); | 
| 804 |  | j++; | 
| 805 |  | }; | 
| 806 |  | }; | 
| 807 |  | // | 
| 808 |  | // TArrayF | 
| 809 |  | // | 
| 810 |  | if ( !strcmp(tste->GetTypeName(),"TArrayF") ){ | 
| 811 |  | // | 
| 812 |  | char *pointer = (char*)cl->UncheckedAt(0); | 
| 813 |  | char *pu = pointer + thisoffset; | 
| 814 |  | TArrayF *arr = (TArrayF*)(pu); | 
| 815 |  | Int_t jj=0; | 
| 816 |  | Int_t arlen = min(arr->GetSize(),dlen); | 
| 817 |  | // | 
| 818 |  | setcolor(col,RESET, BLUE, WHITE); | 
| 819 |  | setcolor(col2,RESET, BLACK, WHITE); | 
| 820 |  | sprintf(o,"%s%s %s[%i]%s = ",o,col,foglia->GetName(),arr->GetSize(),col2); | 
| 821 |  | // | 
| 822 |  | while ( j < tb->GetNdata() ){ | 
| 823 |  | // | 
| 824 |  | pointer = (char*)cl->UncheckedAt(j); | 
| 825 |  | pu = pointer + thisoffset; | 
| 826 |  | arr = (TArrayF*)(pu); | 
| 827 |  | // | 
| 828 |  | while ( jj < arlen ){ | 
| 829 |  | if ( jj < arlen-1 ){ | 
| 830 |  | sprintf(o,"%s %f ,",o,arr->At(jj)); | 
| 831 |  | } else { | 
| 832 |  | sprintf(o,"%s %f",o,arr->At(jj)); | 
| 833 |  | }; | 
| 834 |  | jj++; | 
| 835 |  | }; | 
| 836 |  | if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); | 
| 837 |  | j++; | 
| 838 |  | }; | 
| 839 |  | }; | 
| 840 |  | }; | 
| 841 |  | sprintf(o,"%s\n",o); | 
| 842 |  | break; | 
| 843 |  | }; | 
| 844 |  | }; | 
| 845 |  | }; | 
| 846 |  | }; | 
| 847 |  | break; | 
| 848 |  | }; | 
| 849 |  | }; | 
| 850 |  | //  pamgui->DIALOG(0,o); | 
| 851 |  | printf("%s\n",o); | 
| 852 | }; | }; | 
| 853 |  |  | 
|  | 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                  "); |  | 
|  | } |  | 
|  | } |  | 
|  | } |  | 
|  | }; |  | 
| 854 |  |  | 
| 855 | void FEVdetector::GetGeneralInfo(){ | void FEVdetector::GetGeneralInfo(){ | 
| 856 | // | // | 
| 861 | headcold = headc; | headcold = headc; | 
| 862 | headc = ph->Counter; | headc = ph->Counter; | 
| 863 | var.headc = (int)ph->Counter; | var.headc = (int)ph->Counter; | 
| 864 | OBT = ph->OrbitalTime; | OBT = (UInt_t)ph->OrbitalTime; | 
| 865 | DOBT = OBT - OOBT; | DOBT = OBT - OOBT; | 
| 866 | OOBT = OBT; | OOBT = OBT; | 
| 867 | if ( thisentry == minevent || DOBT < 0 || (headc-headcold-1)!=0 ) DOBT = 0; | if ( thisentry == minevent || DOBT < 0 || (headc-headcold-1)!=0 ) DOBT = 0; | 
| 897 | trcs = (TString)trc.str().c_str(); | trcs = (TString)trc.str().c_str(); | 
| 898 | } else { | } else { | 
| 899 | headcold = headc; | headcold = headc; | 
| 900 | headc = L2->GetOrbitalInfo()->pkt_num; // to be changed as soon as we will have obt in the level2 file! | if ( var.RUN ){ | 
| 901 | OBT = L2->GetOrbitalInfo()->OBT; // to be changed as soon as we will have obt in the level2 file! | var.idrun = L2->GetRunInfo()->ID; | 
| 902 | DOBT = OBT - OOBT; | var.idroot = L2->GetRunInfo()->ID_ROOT_L0; | 
| 903 | OOBT = OBT; | var.EVF = L2->GetRunInfo()->EV_FROM; | 
| 904 | if ( thisentry == minevent || DOBT < 0 || (headc-headcold-1)!=0 ) DOBT = 0; | }; | 
| 905 | var.etime = OBT; | if ( var.ORB ){ | 
| 906 |  | headc = L2->GetOrbitalInfo()->pkt_num; | 
| 907 |  | OBT = L2->GetOrbitalInfo()->OBT; | 
| 908 |  | DOBT = OBT - OOBT; | 
| 909 |  | OOBT = OBT; | 
| 910 |  | if ( thisentry == minevent || DOBT < 0 || (headc-headcold-1)!=0 ) DOBT = 0; | 
| 911 |  | var.etime = OBT; | 
| 912 |  | } else { | 
| 913 |  | var.etime = 0; | 
| 914 |  | }; | 
| 915 | // | // | 
| 916 | // who gave the trigger? | // who gave the trigger? | 
| 917 | // | // | 
| 918 | calotrig = 0; | Int_t trigconf = 0; | 
| 919 | if ( L2->GetTrigLevel2()->patterntrig[0] ) calotrig = 1; | if ( var.TRG ){ | 
| 920 | toftrig = 0; | calotrig = 0; | 
| 921 | 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; | 
| 922 | s4pulser = 0; | toftrig = 0; | 
| 923 | 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; | 
| 924 | // | s4pulser = 0; | 
| 925 | // 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; | 
| 926 | // S4 sometimes could not set the flag even if the trigger is given. This is a workaround to fix this "bug": | // | 
| 927 | // | // TOF and calorimeter when giving a trigger will always set this flag since the time window of the signal is greater than 100 ns. | 
| 928 | 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": | 
| 929 | // | // | 
| 930 | Int_t trigconf = L2->GetTrigLevel2()->trigconf; | if ( !calotrig && !toftrig ) s4pulser = 1; | 
| 931 |  | // | 
| 932 |  | trigconf = L2->GetTrigLevel2()->trigconf; | 
| 933 |  | } else { | 
| 934 |  | trigconf = 0; | 
| 935 |  | } | 
| 936 | stringstream trc; | stringstream trc; | 
| 937 | trc.str(""); | trc.str(""); | 
| 938 | if ( trigconf & (1<<0) ) trc << "TOF1"; | if ( trigconf & (1<<0) ) trc << "TOF1"; | 
| 1020 | // | // | 
| 1021 | if ( level.file == 2 ){ | if ( level.file == 2 ){ | 
| 1022 | cintcom.str(""); | cintcom.str(""); | 
| 1023 | cintcom << "PamLevel2 *L2 = (PamLevel2*)0x" << hex; | cintcom << "PamLevel2 *L2 = (PamLevel2*)" << hex; //con const e l2 funziona | 
| 1024 | cintcom << L2; | cintcom << L2; | 
| 1025 | gROOT->ProcessLine(cintcom.str().c_str()); | gROOT->ProcessLine(cintcom.str().c_str()); | 
| 1026 |  | //      printf(" comando: %s \n",cintcom.str().c_str()); | 
| 1027 | } else { | } else { | 
| 1028 | cintcom.str(""); | cintcom.str(""); | 
| 1029 | cintcom << "TTree *otr = (TTree*)0x" << hex; | cintcom << "TTree *otr = (TTree*)" << hex; | 
| 1030 | cintcom << otr; | cintcom << otr; | 
| 1031 | gROOT->ProcessLine(cintcom.str().c_str()); | gROOT->ProcessLine(cintcom.str().c_str()); | 
| 1032 | // | // | 
| 1033 | cintcom.str(""); | cintcom.str(""); | 
| 1034 | cintcom << "struct Variables &var = (struct Variables &)0x" << hex; | cintcom << "struct Variables &var = (struct Variables &)" << hex; | 
| 1035 | cintcom << &var; | cintcom << &var; | 
| 1036 | gROOT->ProcessLine(cintcom.str().c_str()); | gROOT->ProcessLine(cintcom.str().c_str()); | 
| 1037 | }; | }; | 
| 1042 | // | // | 
| 1043 | 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);"); | 
| 1044 | // | // | 
| 1045 | if ( level.file ==  2 ) isOK = gApplication->ProcessLine("filter((PamLevel2 *)L2,2);"); | //      if ( level.file ==  2 ) isOK = gApplication->ProcessLine("filter((PamLevel2 *)L2,2);"); | 
| 1046 |  | if ( level.file ==  2 ) isOK = gApplication->ProcessLine("filter();"); | 
| 1047 | // | // | 
| 1048 | // progress bar in text window | // progress bar in text window | 
| 1049 | // | // | 
| 1056 | // | // | 
| 1057 | } | } | 
| 1058 |  |  | 
| 1059 | Int_t FEVdetector::Load(TTree &mainotr, TFile &mainfile){ | TChain* FEVdetector::Load(TString file){ | 
| 1060 | file = &mainfile; | // | 
| 1061 | otr = &mainotr; | //  file = &mainfile; | 
|  | L2 = new PamLevel2(); |  | 
| 1062 | // | // | 
| 1063 | if ( level.file == 2 ){ | if ( level.file == 2 ){ | 
| 1064 | //    otr = L2->LoadPamTrees(file); | // | 
| 1065 | //    printf(" %s \n",ddec.Data()); | printf(" %s \n",ddec.Data()); | 
| 1066 | otr = L2->GetPamTree(file,ddec.Data()); | if ( !L2 ){ | 
| 1067 |  | L2 = new PamLevel2("",file.Data(),ddec.Data()); | 
| 1068 |  | otr = L2->GetPamTree(); | 
| 1069 |  | printf(" l2 constructor\n"); | 
| 1070 |  | //      printf(" abst %u obt %u qtot %f \n",L2->GetOrbitalInfo()->absTime,L2->GetOrbitalInfo()->OBT,L2->GetCaloLevel2()->qtot); | 
| 1071 |  | } else { | 
| 1072 |  | // | 
| 1073 |  | printf(" l2 already exist \n"); | 
| 1074 |  | otr = L2->GetPamTree(gSystem->DirName(file.Data()),file.Data(),ddec.Data()); | 
| 1075 |  | L2->GetRunTree(gSystem->DirName(file.Data()),file.Data()); | 
| 1076 |  | // | 
| 1077 |  | }; | 
| 1078 |  | // | 
| 1079 | // | // | 
| 1080 | if ( !otr ) return(0); | if ( !otr ) return(0); | 
|  | // ******************** |  | 
|  | // load magnetic field |  | 
|  | // ******************** |  | 
|  | const char *pam_calib = pathtocalibration(); |  | 
| 1081 | // | // | 
| 1082 | stringstream magfie; | //    otr->CanDeleteRefs(true); | 
| 1083 | 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/"; |  | 
| 1084 | // | // | 
|  | L2->GetTrkLevel2()->LoadField(magfie.str().c_str()); |  | 
| 1085 | } else { | } else { | 
| 1086 | // | // | 
| 1087 | // load calorimeter ADC2MIP conversion file | // load calorimeter ADC2MIP conversion file | 
| 1122 | }; | }; | 
| 1123 | // | // | 
| 1124 | // | // | 
| 1125 | 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(); |  | 
| 1126 | // | // | 
| 1127 | if ( level.file == 0 || level.file == -1 ){ | if ( level.file == 0 || level.file == -1 ){ | 
| 1128 |  | // | 
| 1129 |  | trigger = new pamela::trigger::TriggerEvent(); | 
| 1130 |  | eh = new pamela::EventHeader(); | 
| 1131 |  | ph = new pamela::PscuHeader(); | 
| 1132 |  | de = new pamela::calorimeter::CalorimeterEvent(); | 
| 1133 |  | trk = new pamela::tracker::TrackerEvent(); | 
| 1134 |  | ne = new pamela::neutron::NeutronEvent(); | 
| 1135 |  | ace = new pamela::anticounter::AnticounterEvent(); | 
| 1136 |  | s4 = new pamela::S4::S4Event(); | 
| 1137 |  | tof = new pamela::tof::TofEvent(); | 
| 1138 |  | // | 
| 1139 |  | otr = new TChain("Physics"); | 
| 1140 |  | otr->Add(file.Data(),-1); | 
| 1141 | otr->SetBranchAddress("Trigger", &trigger); | otr->SetBranchAddress("Trigger", &trigger); | 
| 1142 | otr->SetBranchAddress("Header", &eh); | otr->SetBranchAddress("Header", &eh); | 
| 1143 | }; | }; | 
|  | if ( level.file == 2 && var.RUN){ |  | 
|  | //    otr->AddFriend("OrbitalInfo", file); |  | 
|  | //    otr->SetBranchAddress("OrbitalInfo", &oinfoL2); |  | 
|  | runinfo->Read(0ULL); |  | 
|  | }; |  | 
| 1144 | // | // | 
| 1145 | if ( var.TRK ) { | if ( var.TRK ) { | 
| 1146 | if ( level.file == 0 || level.file == -1 ){ | if ( level.file == 0 || level.file == -1 ){ | 
| 1213 | }; | }; | 
| 1214 | }; | }; | 
| 1215 | // | // | 
| 1216 | return(1); | if ( !otr ){ | 
| 1217 |  | return(0); | 
| 1218 |  | }; | 
| 1219 |  | // | 
| 1220 |  | return otr; | 
| 1221 | // | // | 
| 1222 | } | } | 
| 1223 |  |  | 
| 1293 | text->DrawLatex(0.33,txthi,testo.str().c_str()); | text->DrawLatex(0.33,txthi,testo.str().c_str()); | 
| 1294 | txthi -= 0.03; | txthi -= 0.03; | 
| 1295 | testo2.str(""); | testo2.str(""); | 
| 1296 | testo2 << "On Board Time: " << (int)OBT; | testo2 << "On Board Time: " << (unsigned int)OBT; | 
| 1297 | if ( DOBT > 0 ) { | if ( DOBT > 0 ) { | 
| 1298 | testo2 << " (delta: " << (int)DOBT; | testo2 << " (delta: " << (unsigned int)DOBT; | 
| 1299 | testo2 << ")"; | testo2 << ")"; | 
| 1300 | }; | }; | 
| 1301 | testo2 << " [ms]"; | testo2 << " [ms]"; | 
| 1453 | 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"); | 
| 1454 | 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"); | 
| 1455 | 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"); | 
| 1456 | 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"); | 
| 1457 | 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"); | 
| 1458 | 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"); | 
| 1459 | 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"); | 
| 1460 | 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"); | 
| 1461 | 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"); | 
| 1462 | 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"); | 
| 1584 | // | // | 
| 1585 | // print infos on terminal | // print infos on terminal | 
| 1586 | // | // | 
| 1587 |  | //  if ( !var.selex ){ | 
| 1588 | printf(" File: %s \n",var.thefilename.Data()); | printf(" File: %s \n",var.thefilename.Data()); | 
| 1589 | if ( !s4pulser && !calotrig ){ | if ( !s4pulser && !calotrig ){ | 
| 1590 | printf(" Pkt_num: %i  - Progressive number: %i \n",(int)headc,thisentry+1); | printf(" Pkt_num: %i  - Progressive number: %i \n",(int)headc,thisentry+1); | 
| 1595 | if ( calotrig ){ | if ( calotrig ){ | 
| 1596 | 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); | 
| 1597 | }; | }; | 
| 1598 | printf(" On Board Time: %i (delta %i) [ms]\n",OBT,DOBT); | printf(" On Board Time: %u (delta %i) [ms]\n",OBT,DOBT); | 
| 1599 | const char *trc2 = trcs; | const char *trc2 = trcs; | 
| 1600 | printf(" TRIGGER: %s \n",trc2); | printf(" TRIGGER: %s \n",trc2); | 
| 1601 | 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); | 
| 1607 | printf(" CALO: NSTRIP = %i  QTOT = %i [MIP]\n",var.nstrip,var.qtot); | printf(" CALO: NSTRIP = %i  QTOT = %i [MIP]\n",var.nstrip,var.qtot); | 
| 1608 | 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]); | 
| 1609 | 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); | 
| 1610 |  | //  }; | 
| 1611 | // | // | 
| 1612 | } | } | 
| 1613 |  |  | 
| 1915 | void FEVdetector::ShowTOF(){ | void FEVdetector::ShowTOF(){ | 
| 1916 | // | // | 
| 1917 | // | // | 
|  | // |  | 
| 1918 | if ( !var.TOF ) return; | if ( !var.TOF ) return; | 
| 1919 | // | // | 
| 1920 | Int_t tt = 0; | Int_t tt = 0; | 
| 1921 |  | Int_t rj = 0; | 
| 1922 | // | // | 
| 1923 | // force level0, i.e. show patterntrig variable! | // force level0, i.e. show patterntrig variable! | 
| 1924 | // | // | 
| 2112 | Float_t s12p = 0.055; | Float_t s12p = 0.055; | 
| 2113 | ocolo = 10; | ocolo = 10; | 
| 2114 | TPolyLine *ftof12ya[6]; | TPolyLine *ftof12ya[6]; | 
| 2115 |  | rj=6; | 
| 2116 | for ( Int_t j=0; j<6; j++){ | for ( Int_t j=0; j<6; j++){ | 
| 2117 |  | rj--; | 
| 2118 | 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)}; | 
| 2119 | Float_t yc1[4]={      -ws13,     0.,  0., -ws13}; | Float_t yc1[4]={      -ws13,     0.,  0., -ws13}; | 
| 2120 | Float_t xc[4]; | Float_t xc[4]; | 
| 2130 | } else { | } else { | 
| 2131 | colo = 1; | colo = 1; | 
| 2132 | }; | }; | 
| 2133 | ColorMIP(ms12a[j],colo); | ColorMIP(ms12a[rj],colo); | 
| 2134 | // | // | 
| 2135 | if ( colo != 10 ) ocolo = colo; | if ( colo != 10 ) ocolo = colo; | 
| 2136 | if ( mt12[0][j] == 4095. ) colo = noadc; | if ( mt12[0][rj] == 4095. ) colo = noadc; | 
| 2137 | // | // | 
| 2138 | ftof12ya[j]->SetFillColor(colo); | ftof12ya[j]->SetFillColor(colo); | 
| 2139 | ftof12ya[j]->SetLineWidth(1); | ftof12ya[j]->SetLineWidth(1); | 
| 2143 | // B | // B | 
| 2144 | s12p = 0.055; | s12p = 0.055; | 
| 2145 | TPolyLine *ftof12yb[6]; | TPolyLine *ftof12yb[6]; | 
| 2146 |  | rj=6; | 
| 2147 | for ( Int_t j=0; j<6; j++){ | for ( Int_t j=0; j<6; j++){ | 
| 2148 |  | rj--; | 
| 2149 | 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)}; | 
| 2150 | Float_t yc1[4]={ -ws13,     -ws13,    0., -ws13}; | Float_t yc1[4]={ -ws13,     -ws13,    0., -ws13}; | 
| 2151 | Float_t xc[4]; | Float_t xc[4]; | 
| 2161 | } else { | } else { | 
| 2162 | colo = 1; | colo = 1; | 
| 2163 | }; | }; | 
| 2164 | ColorMIP(ms12b[j],colo); | ColorMIP(ms12b[rj],colo); | 
| 2165 | // | // | 
| 2166 | if ( colo != 10 ) ocolo = colo; | if ( colo != 10 ) ocolo = colo; | 
| 2167 | if ( mt12[1][j] == 4095. ) colo = noadc; | if ( mt12[1][rj] == 4095. ) colo = noadc; | 
| 2168 | // | // | 
| 2169 | ftof12yb[j]->SetFillColor(colo); | ftof12yb[j]->SetFillColor(colo); | 
| 2170 | ftof12yb[j]->SetLineWidth(1); | ftof12yb[j]->SetLineWidth(1); | 
| 2198 | Float_t s21p = 0.075; | Float_t s21p = 0.075; | 
| 2199 | ocolo = 10; | ocolo = 10; | 
| 2200 | TPolyLine *ftof21ya[2]; | TPolyLine *ftof21ya[2]; | 
| 2201 |  | rj=2; | 
| 2202 | for ( Int_t j=0; j<2; j++){ | for ( Int_t j=0; j<2; j++){ | 
| 2203 |  | rj--; | 
| 2204 | 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)}; | 
| 2205 | Float_t yc1[4]={ 0.,                ws2,     ws2,    0.}; | Float_t yc1[4]={ 0.,                ws2,     ws2,    0.}; | 
| 2206 | Float_t xc[4]; | Float_t xc[4]; | 
| 2216 | } else { | } else { | 
| 2217 | colo = 1; | colo = 1; | 
| 2218 | }; | }; | 
| 2219 | ColorMIP(ms21a[j],colo); | ColorMIP(ms21a[rj],colo); | 
| 2220 | // | // | 
| 2221 | if ( colo != 10 ) ocolo = colo; | if ( colo != 10 ) ocolo = colo; | 
| 2222 | if ( mt21[0][j] == 4095. ) colo = noadc; | if ( mt21[0][rj] == 4095. ) colo = noadc; | 
| 2223 | // | // | 
| 2224 | ftof21ya[j]->SetFillColor(colo); | ftof21ya[j]->SetFillColor(colo); | 
| 2225 | ftof21ya[j]->SetLineWidth(1); | ftof21ya[j]->SetLineWidth(1); | 
| 2229 | // B | // B | 
| 2230 | s21p = 0.075; | s21p = 0.075; | 
| 2231 | TPolyLine *ftof21yb[2]; | TPolyLine *ftof21yb[2]; | 
| 2232 |  | rj=2; | 
| 2233 | for ( Int_t j=0; j<2; j++){ | for ( Int_t j=0; j<2; j++){ | 
| 2234 |  | rj--; | 
| 2235 | 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)}; | 
| 2236 | Float_t yc1[4]={ 0.,         0.,                ws2,         0.}; | Float_t yc1[4]={ 0.,         0.,                ws2,         0.}; | 
| 2237 | Float_t xc[4]; | Float_t xc[4]; | 
| 2247 | } else { | } else { | 
| 2248 | colo = 1; | colo = 1; | 
| 2249 | }; | }; | 
| 2250 | ColorMIP(ms21b[j],colo); | ColorMIP(ms21b[rj],colo); | 
| 2251 | // | // | 
| 2252 | if ( colo != 10 ) ocolo = colo; | if ( colo != 10 ) ocolo = colo; | 
| 2253 | if ( mt21[1][j] == 4095. ) colo = noadc; | if ( mt21[1][rj] == 4095. ) colo = noadc; | 
| 2254 | // | // | 
| 2255 | ftof21yb[j]->SetFillColor(colo); | ftof21yb[j]->SetFillColor(colo); | 
| 2256 | ftof21yb[j]->SetLineWidth(1); | ftof21yb[j]->SetLineWidth(1); | 
| 2365 | Float_t s31p = 0.060; | Float_t s31p = 0.060; | 
| 2366 | ocolo = 10; | ocolo = 10; | 
| 2367 | TPolyLine *ftof31xa[3]; | TPolyLine *ftof31xa[3]; | 
| 2368 |  | rj=3; | 
| 2369 | for ( Int_t j=0; j<3; j++){ | for ( Int_t j=0; j<3; j++){ | 
| 2370 |  | rj--; | 
| 2371 | 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)}; | 
| 2372 | Float_t yc1[4]={ 0.,                       ws13,     ws13,    0.}; | Float_t yc1[4]={ 0.,                       ws13,     ws13,    0.}; | 
| 2373 | Float_t xc[4]; | Float_t xc[4]; | 
| 2383 | } else { | } else { | 
| 2384 | colo = 1; | colo = 1; | 
| 2385 | }; | }; | 
| 2386 | ColorMIP(ms31a[j],colo); | ColorMIP(ms31a[rj],colo); | 
| 2387 | // | // | 
| 2388 | if ( colo != 10 ) ocolo = colo; | if ( colo != 10 ) ocolo = colo; | 
| 2389 | if ( mt31[0][j] == 4095. ) colo = noadc; | if ( mt31[0][rj] == 4095. ) colo = noadc; | 
| 2390 | // | // | 
| 2391 | ftof31xa[j]->SetFillColor(colo); | ftof31xa[j]->SetFillColor(colo); | 
| 2392 | ftof31xa[j]->SetLineWidth(1); | ftof31xa[j]->SetLineWidth(1); | 
| 2396 | // B | // B | 
| 2397 | s31p = 0.060; | s31p = 0.060; | 
| 2398 | TPolyLine *ftof31xb[3]; | TPolyLine *ftof31xb[3]; | 
| 2399 |  | rj=3; | 
| 2400 | for ( Int_t j=0; j<3; j++){ | for ( Int_t j=0; j<3; j++){ | 
| 2401 |  | rj--; | 
| 2402 | 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)}; | 
| 2403 | Float_t yc1[4]={ 0.,                        0.,     ws13,    0.}; | Float_t yc1[4]={ 0.,                        0.,     ws13,    0.}; | 
| 2404 | Float_t xc[4]; | Float_t xc[4]; | 
| 2414 | } else { | } else { | 
| 2415 | colo = 1; | colo = 1; | 
| 2416 | }; | }; | 
| 2417 | ColorMIP(ms31b[j],colo); | ColorMIP(ms31b[rj],colo); | 
| 2418 | // | // | 
| 2419 | if ( colo != 10 ) ocolo = colo; | if ( colo != 10 ) ocolo = colo; | 
| 2420 | if ( mt31[1][j] == 4095. ) colo = noadc; | if ( mt31[1][rj] == 4095. ) colo = noadc; | 
| 2421 | // | // | 
| 2422 | ftof31xb[j]->SetFillColor(colo); | ftof31xb[j]->SetFillColor(colo); | 
| 2423 | ftof31xb[j]->SetLineWidth(1); | ftof31xb[j]->SetLineWidth(1); | 
| 2449 | Float_t s32p = 0.050; | Float_t s32p = 0.050; | 
| 2450 | ocolo = 10; | ocolo = 10; | 
| 2451 | TPolyLine *ftof32ya[3]; | TPolyLine *ftof32ya[3]; | 
| 2452 |  | rj=3; | 
| 2453 | for ( Int_t j=0; j<3; j++){ | for ( Int_t j=0; j<3; j++){ | 
| 2454 |  | rj--; | 
| 2455 | 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)}; | 
| 2456 | Float_t yc1[4]={     -ws13,     0.,    0., -ws13}; | Float_t yc1[4]={     -ws13,     0.,    0., -ws13}; | 
| 2457 | Float_t xc[4]; | Float_t xc[4]; | 
| 2467 | } else { | } else { | 
| 2468 | colo = 1; | colo = 1; | 
| 2469 | }; | }; | 
| 2470 | ColorMIP(ms32a[j],colo); | ColorMIP(ms32a[rj],colo); | 
| 2471 | // | // | 
| 2472 | if ( colo != 10 ) ocolo = colo; | if ( colo != 10 ) ocolo = colo; | 
| 2473 | if ( mt32[0][j] == 4095. ) colo = noadc; | if ( mt32[0][rj] == 4095. ) colo = noadc; | 
| 2474 | // | // | 
| 2475 | ftof32ya[j]->SetFillColor(colo); | ftof32ya[j]->SetFillColor(colo); | 
| 2476 | ftof32ya[j]->SetLineWidth(1); | ftof32ya[j]->SetLineWidth(1); | 
| 2479 | }; | }; | 
| 2480 | s32p = 0.050; | s32p = 0.050; | 
| 2481 | TPolyLine *ftof32yb[3]; | TPolyLine *ftof32yb[3]; | 
| 2482 |  | rj=3; | 
| 2483 | for ( Int_t j=0; j<3; j++){ | for ( Int_t j=0; j<3; j++){ | 
| 2484 |  | rj--; | 
| 2485 | 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)}; | 
| 2486 | Float_t yc1[4]={ -ws13,   -ws13,    0., -ws13}; | Float_t yc1[4]={ -ws13,   -ws13,    0., -ws13}; | 
| 2487 | Float_t xc[4]; | Float_t xc[4]; | 
| 2497 | } else { | } else { | 
| 2498 | colo = 1; | colo = 1; | 
| 2499 | }; | }; | 
| 2500 | ColorMIP(ms32b[j],colo); | ColorMIP(ms32b[rj],colo); | 
| 2501 | // | // | 
| 2502 | if ( colo != 10 ) ocolo = colo; | if ( colo != 10 ) ocolo = colo; | 
| 2503 | if ( mt32[1][j] == 4095. ) colo = noadc; | if ( mt32[1][rj] == 4095. ) colo = noadc; | 
| 2504 | // | // | 
| 2505 | ftof32yb[j]->SetFillColor(colo); | ftof32yb[j]->SetFillColor(colo); | 
| 2506 | ftof32yb[j]->SetLineWidth(1); | ftof32yb[j]->SetLineWidth(1); | 
| 2732 | // | // | 
| 2733 | Bool_t repeat = true; | Bool_t repeat = true; | 
| 2734 | Int_t numtr = 1; | Int_t numtr = 1; | 
| 2735 |  | //  Int_t numtr = 0; | 
| 2736 | Int_t repuntil = 0; | Int_t repuntil = 0; | 
| 2737 | // | // | 
| 2738 | // | // | 
| 2740 | // | // | 
| 2741 | if ( level.file == 2 ) repuntil = L2->GetToFLevel2()->ntrk(); | if ( level.file == 2 ) repuntil = L2->GetToFLevel2()->ntrk(); | 
| 2742 | //  printf("repuntil = %i \n",repuntil); | //  printf("repuntil = %i \n",repuntil); | 
| 2743 |  | //if ( level.file == 2 ) repuntil = L2->GetTrkLevel2()->GetNTracks(); | 
| 2744 | //repuntil = L2->GetNTracks(); | //repuntil = L2->GetNTracks(); | 
| 2745 | // | // | 
| 2746 | while ( repeat ){ | while ( repeat ){ | 
| 2750 | // | // | 
| 2751 | // | // | 
| 2752 | ToFTrkVar *ptt = 0; | ToFTrkVar *ptt = 0; | 
| 2753 |  | //      PamTrack *ptrack = 0; | 
| 2754 |  | Float_t adc[4][12]; | 
| 2755 |  | Float_t tdc[4][12]; | 
| 2756 |  | memset(adc,0,4*12*sizeof(Float_t)); | 
| 2757 |  | memset(tdc,0,4*12*sizeof(Float_t)); | 
| 2758 | // | // | 
| 2759 | // | // | 
| 2760 |  | //      if ( repuntil == 0 || var.tofraw ){ | 
| 2761 | if ( repuntil == 1 || var.tofraw ){ | if ( repuntil == 1 || var.tofraw ){ | 
| 2762 | numtr = 0; | numtr = 0; | 
| 2763 | ptt = L2->GetToFLevel2()->GetToFTrkVar(0); | ptt = L2->GetToFLevel2()->GetToFTrkVar(0); | 
| 2767 | // | // | 
| 2768 | if ( numtr >= repuntil-1 ) repeat = false; | if ( numtr >= repuntil-1 ) repeat = false; | 
| 2769 | // | // | 
| 2770 | ptt = L2->GetToFLevel2()->GetToFTrkVar(numtr); | //      printf(" numtr is %i \n",numtr); | 
| 2771 |  | ptt = L2->GetToFLevel2()->GetToFTrkVar(numtr); | 
| 2772 |  | //ptrack = L2->GetTrack(numtr); | 
| 2773 |  | //ptt = ptrack->GetToFTrack(); | 
| 2774 | }; | }; | 
| 2775 | // | // | 
| 2776 | xp11[0] = 0.; | xp11[0] = 0.; | 
| 2784 | // | // | 
| 2785 | ii = 2; | ii = 2; | 
| 2786 | // | // | 
| 2787 | Float_t adc[4][12]; | Int_t myseq = ptt->trkseqno + 1; | 
| 2788 | Float_t tdc[4][12]; | L2->GetToFLevel2()->GetMatrix(myseq,adc,tdc); | 
| 2789 | L2->GetToFLevel2()->GetMatrix(numtr,adc,tdc); | // | 
| 2790 |  | //      printf(" qua \n"); | 
| 2791 | // | // | 
| 2792 | for ( Int_t i = 0; i<8; i++ ) { | for ( Int_t i = 0; i<8; i++ ) { | 
| 2793 | if ( adc[ch11a[i]][hb11a[i]] < 1000. ){ | if ( adc[ch11a[i]][hb11a[i]] < 1000. ){ | 
| 2944 | ftof11y->Draw(); | ftof11y->Draw(); | 
| 2945 | TPolyLine *sftof11[8]; | TPolyLine *sftof11[8]; | 
| 2946 | tt = 1; | tt = 1; | 
| 2947 | if ( level.file == -1 ) tt = 8; | rj=1; | 
| 2948 |  | if ( level.file == -1 ){ | 
| 2949 |  | tt = 8; | 
| 2950 |  | rj = 8; | 
| 2951 |  | }; | 
| 2952 | for ( Int_t j=0; j<tt; j++){ | for ( Int_t j=0; j<tt; j++){ | 
| 2953 | if ( (mt11[0][j]<4095. || mt11[1][j]<4095.)){ | rj--; | 
| 2954 |  | if ( (mt11[0][rj]<4095. || mt11[1][rj]<4095.)){ | 
| 2955 | if ( ocolo == 10 ) ocolo = noadc; | if ( ocolo == 10 ) ocolo = noadc; | 
| 2956 | Float_t lowp = (xp11[j]-E11[j])/100.; | Float_t lowp = -(xp11[rj]+E11[rj])/100.; | 
| 2957 | Float_t higp = (xp11[j]+E11[j])/100.; | Float_t higp = -(xp11[rj]-E11[rj])/100.; | 
| 2958 | if ( lowp < -0.164 ) lowp = -0.164; | if ( lowp < -0.164 ) lowp = -0.164; | 
| 2959 | if ( higp > 0.164 ) higp = 0.164; | if ( higp > 0.164 ) higp = 0.164; | 
| 2960 | if ( lowp < higp && ( level.file == -1 || (level.file == 2 && xp11[j] != 0.))){ | if ( lowp < higp && ( level.file == -1 || (level.file == 2 && xp11[rj] != 0.))){ | 
| 2961 | Float_t nxc1[5]={ lowp, higp, higp, lowp, lowp}; | Float_t nxc1[5]={ lowp, higp, higp, lowp, lowp}; | 
| 2962 | 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}; | 
| 2963 | Float_t nxc[5]; | Float_t nxc[5]; | 
| 2982 | Float_t s12p = 0.055; | Float_t s12p = 0.055; | 
| 2983 | ocolo = 10; | ocolo = 10; | 
| 2984 | TPolyLine *ftof12y[6]; | TPolyLine *ftof12y[6]; | 
| 2985 |  | rj = 6; | 
| 2986 | for ( Int_t j=0; j<6; j++){ | for ( Int_t j=0; j<6; j++){ | 
| 2987 |  | rj--; | 
| 2988 | 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)}; | 
| 2989 | Float_t nyc1[5]={      -ws13,     0.,  0., -ws13, -ws13}; | Float_t nyc1[5]={      -ws13,     0.,  0., -ws13, -ws13}; | 
| 2990 | Float_t nxc[5]; | Float_t nxc[5]; | 
| 3001 | colo = 1; | colo = 1; | 
| 3002 | }; | }; | 
| 3003 | if ( level.file == -1 ){ | if ( level.file == -1 ){ | 
| 3004 | ColorMIP(ms12a[j]+ms12b[j],colo); | ColorMIP(ms12a[rj]+ms12b[rj],colo); | 
| 3005 | } else { | } else { | 
| 3006 | ColorTOFMIP(ms12a[j]+ms12b[j],colo); | ColorTOFMIP(ms12a[rj]+ms12b[rj],colo); | 
| 3007 | }; | }; | 
| 3008 | // | // | 
| 3009 | if ( colo != 10 ) ocolo = colo; | if ( colo != 10 ) ocolo = colo; | 
| 3070 | Float_t s21p = 0.075; | Float_t s21p = 0.075; | 
| 3071 | ocolo = 10; | ocolo = 10; | 
| 3072 | TPolyLine *ftof21y[2]; | TPolyLine *ftof21y[2]; | 
| 3073 |  | rj=2; | 
| 3074 | for ( Int_t j=0; j<2; j++){ | for ( Int_t j=0; j<2; j++){ | 
| 3075 |  | rj--; | 
| 3076 | 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)}; | 
| 3077 | Float_t nyc1[5]={ 0.,                ws2,     ws2,  0.,  0.}; | Float_t nyc1[5]={ 0.,                ws2,     ws2,  0.,  0.}; | 
| 3078 | Float_t nxc[5]; | Float_t nxc[5]; | 
| 3089 | colo = 1; | colo = 1; | 
| 3090 | }; | }; | 
| 3091 | if ( level.file == -1 ){ | if ( level.file == -1 ){ | 
| 3092 | ColorMIP(ms21a[j]+ms21b[j],colo); | ColorMIP(ms21a[rj]+ms21b[rj],colo); | 
| 3093 | } else { | } else { | 
| 3094 | ColorTOFMIP(ms21a[j]+ms21b[j],colo); | ColorTOFMIP(ms21a[rj]+ms21b[rj],colo); | 
| 3095 | }; | }; | 
| 3096 | // | // | 
| 3097 | if ( colo != 10 ) ocolo = colo; | if ( colo != 10 ) ocolo = colo; | 
| 3208 | ftof22y->Draw(); | ftof22y->Draw(); | 
| 3209 | TPolyLine *sftof22[2]; | TPolyLine *sftof22[2]; | 
| 3210 | tt = 1; | tt = 1; | 
| 3211 | if ( level.file == -1 ) tt = 2; | rj = 1; | 
| 3212 |  | if ( level.file == -1 ){ | 
| 3213 |  | tt = 2; | 
| 3214 |  | rj = 2; | 
| 3215 |  | }; | 
| 3216 | for (Int_t j=0; j<tt; j++){ | for (Int_t j=0; j<tt; j++){ | 
| 3217 |  | rj--; | 
| 3218 | //    for ( Int_t j=0; j<2; j++){ | //    for ( Int_t j=0; j<2; j++){ | 
| 3219 | if ( (mt22[0][j]<4095. || mt22[1][j]<4095.) ){ | if ( (mt22[0][rj]<4095. || mt22[1][rj]<4095.) ){ | 
| 3220 | if ( ocolo == 10 ) ocolo = noadc; | if ( ocolo == 10 ) ocolo = noadc; | 
| 3221 | Float_t lowp = (xp22[j]-E22[j])/100.; | Float_t lowp = -(xp22[rj]+E22[rj])/100.; | 
| 3222 | Float_t higp = (xp22[j]+E22[j])/100.; | Float_t higp = -(xp22[rj]-E22[rj])/100.; | 
| 3223 | if ( lowp < -0.074 ) lowp = -0.074; | if ( lowp < -0.074 ) lowp = -0.074; | 
| 3224 | if ( higp > 0.074 ) higp = 0.074; | if ( higp > 0.074 ) higp = 0.074; | 
| 3225 | if ( lowp < higp && ( level.file == -1 || (level.file == 2 && xp22[j] != 0.))){ | if ( lowp < higp && ( level.file == -1 || (level.file == 2 && xp22[rj] != 0.))){ | 
| 3226 | Float_t nxc1[5]={ lowp, higp, higp, lowp, lowp}; | Float_t nxc1[5]={ lowp, higp, higp, lowp, lowp}; | 
| 3227 | 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}; | 
| 3228 | Float_t nxc[5]; | Float_t nxc[5]; | 
| 3242 | }; | }; | 
| 3243 | }; | }; | 
| 3244 | // | // | 
| 3245 |  | //daquiinbasso | 
| 3246 | // | // | 
| 3247 | // S31  X-view | // S31  X-view | 
| 3248 | // | // | 
| 3299 | ftof31y->Draw(); | ftof31y->Draw(); | 
| 3300 | TPolyLine *sftof31[3]; | TPolyLine *sftof31[3]; | 
| 3301 | tt = 1; | tt = 1; | 
| 3302 | if ( level.file == -1 ) tt = 3; | rj = 1; | 
| 3303 |  | if ( level.file == -1 ){ | 
| 3304 |  | tt = 3; | 
| 3305 |  | rj = 3; | 
| 3306 |  | }; | 
| 3307 | for (Int_t j=0; j<tt; j++){ | for (Int_t j=0; j<tt; j++){ | 
| 3308 |  | rj--; | 
| 3309 | //    for ( Int_t j=0; j<3; j++){ | //    for ( Int_t j=0; j<3; j++){ | 
| 3310 | if ( (mt31[0][j]<4095. || mt31[1][j]<4095.)){ | if ( (mt31[0][rj]<4095. || mt31[1][rj]<4095.)){ | 
| 3311 | if ( ocolo == 10 ) ocolo = noadc; | if ( ocolo == 10 ) ocolo = noadc; | 
| 3312 | Float_t lowp = (xp31[j]-E31[j])/100.; | Float_t lowp = -(xp31[rj]+E31[rj])/100.; | 
| 3313 | Float_t higp = (xp31[j]+E31[j])/100.; | Float_t higp = -(xp31[rj]-E31[rj])/100.; | 
| 3314 | if ( lowp < -0.074 ) lowp = -0.074; | if ( lowp < -0.074 ) lowp = -0.074; | 
| 3315 | if ( higp > 0.074 ) higp = 0.074; | if ( higp > 0.074 ) higp = 0.074; | 
| 3316 | if ( lowp < higp && ( level.file == -1 || (level.file == 2 && xp31[j] != 0.))){ | if ( lowp < higp && ( level.file == -1 || (level.file == 2 && xp31[rj] != 0.))){ | 
| 3317 | Float_t nxc1[5]={ lowp, higp, higp, lowp, lowp}; | Float_t nxc1[5]={ lowp, higp, higp, lowp, lowp}; | 
| 3318 | 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}; | 
| 3319 | Float_t nxc[5]; | Float_t nxc[5]; | 
| 3340 | Float_t s32p = 0.050; | Float_t s32p = 0.050; | 
| 3341 | ocolo = 10; | ocolo = 10; | 
| 3342 | TPolyLine *ftof32y[3]; | TPolyLine *ftof32y[3]; | 
| 3343 |  | rj = 3; | 
| 3344 | for ( Int_t j=0; j<3; j++){ | for ( Int_t j=0; j<3; j++){ | 
| 3345 |  | rj--; | 
| 3346 | 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)}; | 
| 3347 | Float_t nyc1[5]={     -ws13,     0.,    0., -ws13, -ws13}; | Float_t nyc1[5]={     -ws13,     0.,    0., -ws13, -ws13}; | 
| 3348 | Float_t nxc[5]; | Float_t nxc[5]; | 
| 3359 | colo = 1; | colo = 1; | 
| 3360 | }; | }; | 
| 3361 | if ( level.file == -1 ){ | if ( level.file == -1 ){ | 
| 3362 | ColorMIP(ms32a[j]+ms32b[j],colo); | ColorMIP(ms32a[rj]+ms32b[rj],colo); | 
| 3363 | } else { | } else { | 
| 3364 | ColorTOFMIP(ms32a[j]+ms32b[j],colo); | ColorTOFMIP(ms32a[rj]+ms32b[rj],colo); | 
| 3365 | }; | }; | 
| 3366 | // | // | 
| 3367 | if ( colo != 10 ) ocolo = colo; | if ( colo != 10 ) ocolo = colo; | 
| 4328 | pcasp4b->Draw("f"); | pcasp4b->Draw("f"); | 
| 4329 | pcasp4b->Draw(); | pcasp4b->Draw(); | 
| 4330 | }; | }; | 
| 4331 | Float_t alfa = 1.2020334; | //  Float_t alfax = 1.2020334; | 
| 4332 |  | Float_t alfax = 1.22157778; | 
| 4333 |  | Float_t alfay = 1.27393111; | 
| 4334 | Float_t lcrd = 0.1815/2.; | Float_t lcrd = 0.1815/2.; | 
| 4335 | Float_t wcrd = 0.008; | Float_t wcrd = 0.008; | 
| 4336 | if ( true ){ | if ( true ){ | 
| 4541 | // | // | 
| 4542 | //    Float_t cardcx = 0.143168*var.sfx; | //    Float_t cardcx = 0.143168*var.sfx; | 
| 4543 | //Float_t cardcy = 0.1475*var.sfy; | //Float_t cardcy = 0.1475*var.sfy; | 
| 4544 | Float_t cardcx = 0.153168*var.sfx; | // | 
| 4545 | Float_t cardcy = 0.1575*var.sfy; | //    Float_t cardcx = 0.153168*var.sfx; | 
| 4546 | Float_t acrdx[4] = {-lcrd*cos(alfa), lcrd*cos(alfa), -lcrd*cos(alfa)+wcrd*sin(alfa), -lcrd*cos(alfa)}; | // | 
| 4547 | 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; | 
| 4548 | 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; | 
| 4549 | 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; | 
| 4550 |  | Float_t acrdx[4] = {-lcrd*cos(alfax), lcrd*cos(alfax), -lcrd*cos(alfax)+wcrd*sin(alfax), -lcrd*cos(alfax)}; | 
| 4551 |  | Float_t acrdy[4] = {-lcrd*sin(alfax), lcrd*sin(alfax), -lcrd*sin(alfax)-wcrd*cos(alfax), -lcrd*sin(alfax)}; | 
| 4552 |  | Float_t bcrdx[4] = { lcrd*cos(alfax), lcrd*cos(alfax)+wcrd*sin(alfax), -lcrd*cos(alfax)+wcrd*sin(alfax), lcrd*cos(alfax)}; | 
| 4553 |  | Float_t bcrdy[4] = { lcrd*sin(alfax), lcrd*sin(alfax)-wcrd*cos(alfax), -lcrd*sin(alfax)-wcrd*cos(alfax), lcrd*sin(alfax)}; | 
| 4554 |  |  | 
| 4555 | // | // | 
| 4556 | // CARD3  X/  Y | // CARD3  X/  Y | 
| 4610 | }; | }; | 
| 4611 |  |  | 
| 4612 | if ( true ){ | if ( true ){ | 
| 4613 | 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)}; | 
| 4614 | 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)}; | 
| 4615 | 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)}; | 
| 4616 | 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)}; | 
| 4617 | // | // | 
| 4618 | // CARD - Y-view | // CARD - Y-view | 
| 4619 | // | // | 
| 4620 | Float_t cardcx = 0.12*var.sfx; | //    Float_t cardcx = 0.12*var.sfx; | 
| 4621 | Float_t cardcy = 0.1475*var.sfy; | Float_t cardcx = (0.16014*(1.-lcrd*cos(alfay)))*var.sfx; | 
| 4622 |  | //    Float_t cardcy = 0.178818*var.sfy; | 
| 4623 |  | Float_t cardcy = (0.178818*(1.-lcrd*sin(alfay)))*var.sfy; | 
| 4624 |  | //    Float_t cardcy = 0.1475*var.sfy; | 
| 4625 | // | // | 
| 4626 | // CARD4  X  Y/ | // CARD4  X  Y/ | 
| 4627 | // | // | 
| 5075 | for (Int_t m = 0; m<3; m++){ | for (Int_t m = 0; m<3; m++){ | 
| 5076 | if ( trk->signcluster[l][m] != 0. ){ | if ( trk->signcluster[l][m] != 0. ){ | 
| 5077 | if ( planeno == 10 ) { | if ( planeno == 10 ) { | 
|  | x = 1024 - trk->addrcluster[l][m]; |  | 
|  | } else { |  | 
| 5078 | x = trk->addrcluster[l][m]; | x = trk->addrcluster[l][m]; | 
| 5079 |  | } else { | 
| 5080 |  | x = 1024 - trk->addrcluster[l][m]; | 
| 5081 | }; | }; | 
| 5082 | linea = new TLine(14.+x,0.01,14.+x,0.3); | linea = new TLine(14.+x,0.01,14.+x,0.3); | 
| 5083 | linea->SetLineWidth(2); | linea->SetLineWidth(2); | 
| 5147 | trkpad[planepad]->cd(); | trkpad[planepad]->cd(); | 
| 5148 | trkpad[planepad]->Range(-7.05,0.,7.05,8.); | trkpad[planepad]->Range(-7.05,0.,7.05,8.); | 
| 5149 | for (Int_t img=0; img<2; img++){ | for (Int_t img=0; img<2; img++){ | 
| 5150 | x = singlet->coord[img]; | x = -singlet->coord[img]; | 
| 5151 | Float_t xsig = singlet->sgnl; | Float_t xsig = singlet->sgnl; | 
| 5152 | if ( xsig > 8. ) xsig = 8.; | if ( xsig > 8. ) xsig = 8.; | 
| 5153 | // | // | 
| 5204 | // | // | 
| 5205 | x = track->xm[plane]; | x = track->xm[plane]; | 
| 5206 | Float_t xsig = track->dedx_x[plane]; | Float_t xsig = track->dedx_x[plane]; | 
| 5207 | if ( track->xgood[plane] ){ | if ( track->XGood(plane) ){ | 
| 5208 | //if ( x > -100 ){ | //if ( x > -100 ){ | 
| 5209 | if ( xsig > 8. ) xsig = 8.; | if ( xsig > 8. ) xsig = 8.; | 
| 5210 | if ( var.bw ){ | if ( var.bw ){ | 
| 5232 | planepad = plane * 2; | planepad = plane * 2; | 
| 5233 | trkpad[planepad]->cd(); | trkpad[planepad]->cd(); | 
| 5234 | trkpad[planepad]->Range(-7.05,0.,7.05,8.); | trkpad[planepad]->Range(-7.05,0.,7.05,8.); | 
| 5235 | x = track->ym[plane]; | x = -track->ym[plane]; | 
| 5236 | xsig = track->dedx_y[plane]; | xsig = track->dedx_y[plane]; | 
| 5237 | if ( track->ygood[plane] ){ | if ( track->YGood(plane) ){ | 
| 5238 | //            if ( x > -100 ){ | //            if ( x > -100 ){ | 
| 5239 | if ( xsig > 8. ) xsig = 8.; | if ( xsig > 8. ) xsig = 8.; | 
| 5240 | if ( var.bw ){ | if ( var.bw ){ | 
| 5285 | // first of all plot crosses relatives to tracks | // first of all plot crosses relatives to tracks | 
| 5286 | // | // | 
| 5287 | if ( L2->GetTrkLevel2()->GetNTracks() > 0 ){ | if ( L2->GetTrkLevel2()->GetNTracks() > 0 ){ | 
| 5288 |  | //      for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ | 
| 5289 |  | //        TrkTrack *track = L2->GetTrkLevel2()->GetTrack(nt); | 
| 5290 | for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ | for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ | 
| 5291 | TrkTrack *track = L2->GetTrkLevel2()->GetTrack(nt); | PamTrack *ptrack= L2->GetTrack(nt); | 
| 5292 |  | TrkTrack *track = ptrack->GetTrkTrack(); | 
| 5293 |  | // | 
| 5294 | for (Int_t plane = 0; plane<6; plane++){ | for (Int_t plane = 0; plane<6; plane++){ | 
| 5295 | // | // | 
| 5296 | x = track->xm[plane]; | x = track->xm[plane]; | 
| 5297 | Float_t y = track->ym[plane]; | Float_t y = -track->ym[plane]; | 
| 5298 | Float_t xsig = track->dedx_x[plane]; | Float_t xsig = track->dedx_x[plane]; | 
| 5299 | Float_t ysig = track->dedx_y[plane]; | Float_t ysig = track->dedx_y[plane]; | 
| 5300 | //    if ( x > -100 && y > -100. ){ | //    if ( x > -100 && y > -100. ){ | 
| 5301 | if ( track->xgood[plane] && track->ygood[plane] ){ | if ( track->XGood(plane) && track->YGood(plane) ){ | 
| 5302 | if ( var.bw ){ | if ( var.bw ){ | 
| 5303 | sigcol1 = -1; | sigcol1 = -1; | 
| 5304 | sigcol2 = -1; | sigcol2 = -1; | 
| 5416 | for (Int_t sing = 0; sing < min(totsx,totsy); sing++){ | for (Int_t sing = 0; sing < min(totsx,totsy); sing++){ | 
| 5417 | // | // | 
| 5418 | x = arrax->At(orderx->At(sing)); | x = arrax->At(orderx->At(sing)); | 
| 5419 | Float_t y1 = array1->At(ordery->At(sing)); | Float_t y1 = -array1->At(ordery->At(sing)); | 
| 5420 | Float_t y2 = array2->At(ordery->At(sing)); | Float_t y2 = -array2->At(ordery->At(sing)); | 
| 5421 | Float_t xsig = sigarrax->At(orderx->At(sing)); | Float_t xsig = sigarrax->At(orderx->At(sing)); | 
| 5422 | Float_t ysig = sigarray->At(ordery->At(sing)); | Float_t ysig = sigarray->At(ordery->At(sing)); | 
| 5423 | if ( x > -100 && y1 > -100. ){ | if ( x > -100 && y1 > -100. ){ | 
| 5510 | for (Int_t m = 0; m<3; m++){ | for (Int_t m = 0; m<3; m++){ | 
| 5511 | if ( trk->signcluster[l][m] != 0. ){ | if ( trk->signcluster[l][m] != 0. ){ | 
| 5512 | if ( planeno == 10 ) { | if ( planeno == 10 ) { | 
|  | x = 1024 - trk->addrcluster[l][m]; |  | 
|  | } else { |  | 
| 5513 | x = trk->addrcluster[l][m]; | x = trk->addrcluster[l][m]; | 
| 5514 |  | } else { | 
| 5515 |  | x = 1024 - trk->addrcluster[l][m]; | 
| 5516 | }; | }; | 
| 5517 | x += 1024.; | x += 1024.; | 
| 5518 | if ( trk->signcluster[l][m]> ysig  ){ | if ( trk->signcluster[l][m]> ysig  ){ | 
| 5519 | ysig = trk->signcluster[l][m]; | ysig = trk->signcluster[l][m]; | 
| 5520 | yh1[ncro] = x-1024.; | yh1[ncro] = x - 1024.; | 
| 5521 | yh2[ncro] = x; | yh2[ncro] = x; | 
| 5522 | }; | }; | 
| 5523 | }; | }; | 
| 5545 | for (Int_t m = 0; m<3; m++){ | for (Int_t m = 0; m<3; m++){ | 
| 5546 | if ( trk->signcluster[e][m] != 0. ){ | if ( trk->signcluster[e][m] != 0. ){ | 
| 5547 | if ( planeno == 10 ) { | if ( planeno == 10 ) { | 
|  | x = 1024 - trk->addrcluster[e][m]; |  | 
|  | } else { |  | 
| 5548 | x = trk->addrcluster[e][m]; | x = trk->addrcluster[e][m]; | 
| 5549 |  | } else { | 
| 5550 |  | x = 1024 - trk->addrcluster[e][m]; | 
| 5551 | }; | }; | 
| 5552 | x += 1024.; | x += 1024.; | 
| 5553 | if ( trk->signcluster[e][m]> ysig  ){ | if ( trk->signcluster[e][m]> ysig  ){ | 
| 5554 | ysig = trk->signcluster[e][m]; | ysig = trk->signcluster[e][m]; | 
| 5555 | yh1[ncro] = x-1024.; | yh1[ncro] = x - 1024.; | 
| 5556 | yh2[ncro] = x; | yh2[ncro] = x; | 
| 5557 | }; | }; | 
| 5558 | }; | }; | 
| 5604 |  |  | 
| 5605 | void FEVdetector::ShowTrack(){ | void FEVdetector::ShowTrack(){ | 
| 5606 | // | // | 
| 5607 |  | if ( level.file != 2 ) return; | 
| 5608 | // | // | 
| 5609 | // | // | 
| 5610 | if ( var.CALO && false ){ | // | 
| 5611 |  | if ( var.CALO && var.CALOT ){ | 
| 5612 | if ( L2->GetCaloLevel2()->npcfit[0] > 0 && L2->GetCaloLevel2()->npcfit[1] > 0 ){ | if ( L2->GetCaloLevel2()->npcfit[0] > 0 && L2->GetCaloLevel2()->npcfit[1] > 0 ){ | 
| 5613 | Float_t calx[22]; | Float_t calx[22]; | 
| 5614 | Float_t caly[22]; | Float_t caly[22]; | 
| 5625 | }; | }; | 
| 5626 | for (Int_t plane = 0; plane < 22; plane++){ | for (Int_t plane = 0; plane < 22; plane++){ | 
| 5627 | calx[plane] = (L2->GetCaloLevel2()->cbar[plane][0]/100.)*var.sfx + var.xxvc;; | calx[plane] = (L2->GetCaloLevel2()->cbar[plane][0]/100.)*var.sfx + var.xxvc;; | 
| 5628 | caly[plane] = (L2->GetCaloLevel2()->cbar[plane][1]/100.)*var.sfx + var.xyvc; | caly[plane] = (-L2->GetCaloLevel2()->cbar[plane][1]/100.)*var.sfx + var.xyvc; | 
| 5629 | //      calzx[plane] = zpiano[plane] -5.81*var.sfy/1000. + var.yxvc; | //      calzx[plane] = zpiano[plane] -5.81*var.sfy/1000. + var.yxvc; | 
| 5630 | calzx[plane] = zpiano[plane] + var.yxvc; | calzx[plane] = zpiano[plane] + var.yxvc; | 
| 5631 | calzy[plane] = zpiano[plane] + var.yyvc; | calzy[plane] = zpiano[plane] + var.yyvc; | 
| 5674 | // | // | 
| 5675 | for (Int_t plane = 0; plane < 22; plane++){ | for (Int_t plane = 0; plane < 22; plane++){ | 
| 5676 | calx[plane] = (ctra->tbar[plane][0]/100.)*var.sfx + var.xxvc;; | calx[plane] = (ctra->tbar[plane][0]/100.)*var.sfx + var.xxvc;; | 
| 5677 | caly[plane] = (ctra->tbar[plane][1]/100.)*var.sfx + var.xyvc; | caly[plane] = (-ctra->tbar[plane][1]/100.)*var.sfx + var.xyvc; | 
| 5678 | //      calzx[plane] = zpiano[plane] -5.81*var.sfy/1000. + var.yxvc; | //      calzx[plane] = zpiano[plane] -5.81*var.sfy/1000. + var.yxvc; | 
| 5679 | calzx[plane] = zpiano[plane] + var.yxvc; | calzx[plane] = zpiano[plane] + var.yxvc; | 
| 5680 | calzy[plane] = zpiano[plane] + var.yyvc; | calzy[plane] = zpiano[plane] + var.yyvc; | 
| 5703 | }; | }; | 
| 5704 | }; | }; | 
| 5705 | // | // | 
| 5706 | if ( !var.TRK || level.file != 2 ) return; | if ( !var.TRK ) return; | 
| 5707 | // | // | 
| 5708 | if ( L2->GetTrkLevel2()->GetNTracks() > 0 ){ | if ( L2->GetTrkLevel2()->GetNTracks() > 0 ){ | 
| 5709 | for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ | for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ | 
| 5710 |  |  | 
| 5711 | //      TrkTrack *track = L2->GetTrkLevel2()->GetTrack(nt); | //      TrkTrack *track = L2->GetTrkLevel2()->GetTrack(nt); | 
| 5712 |  | //      printf("qui \n"); | 
| 5713 | PamTrack *ptrack = L2->GetTrack(nt); | PamTrack *ptrack = L2->GetTrack(nt); | 
| 5714 | TrkTrack *track = ptrack->GetTrkTrack(); | TrkTrack *track = ptrack->GetTrkTrack(); | 
| 5715 |  | //      printf("qua \n"); | 
| 5716 | Int_t npoint = 100; | Int_t npoint = 100; | 
| 5717 | Float_t zin[100]; | Float_t zin[100]; | 
| 5718 | Double_t xout[100]; | Double_t xout[100]; | 
| 5761 | // | // | 
| 5762 | Trajectory *tr = new Trajectory(npoint,zin); | Trajectory *tr = new Trajectory(npoint,zin); | 
| 5763 | // | // | 
| 5764 | ifail = track->DoTrack2(tr); | //      ifail = track->DoTrack2(tr); | 
| 5765 |  | ifail = track->DoTrack(tr); | 
| 5766 | // | // | 
| 5767 | if ( !ifail ){ | if ( !ifail ){ | 
| 5768 | for ( Int_t e = 0; e < npoint ; e++) { | for ( Int_t e = 0; e < npoint ; e++) { | 
| 5769 | tx[e] = ((float)tr->x[e]/100.)*var.sfx + var.xxvc; | tx[e] = ((float)tr->x[e]/100.)*var.sfx + var.xxvc; | 
| 5770 | ty[e] = ((float)tr->y[e]/100.)*var.sfx + var.xyvc; | ty[e] = (-(float)tr->y[e]/100.)*var.sfx + var.xyvc; | 
| 5771 | if ( e < 50 ) { | if ( e < 50 ) { | 
| 5772 | ptx1[e] = ((float)tr->y[e]/100.)*var.sfx + var.xcat; | ptx1[e] = (-(float)tr->y[e]/100.)*var.sfx + var.xcat; | 
| 5773 | pty1[e] = ((float)tr->x[e]/100.)*var.sfy + var.ycat; | pty1[e] = ((float)tr->x[e]/100.)*var.sfy + var.ycat; | 
| 5774 | } else { | } else { | 
| 5775 | ptx2[e-50] = ((float)tr->y[e]/100.)*var.sfx + var.xcat; | ptx2[e-50] = (-(float)tr->y[e]/100.)*var.sfx + var.xcat; | 
| 5776 | pty2[e-50] = ((float)tr->x[e]/100.)*var.sfy + var.ycat; | pty2[e-50] = ((float)tr->x[e]/100.)*var.sfy + var.ycat; | 
| 5777 | }; | }; | 
| 5778 | if ( e > 84 ) { | if ( e > 84 ) { | 
| 5779 | tx1[e-85] = ((float)tr->x[e]/100.)*var.nds4 + var.xxvc; | tx1[e-85] = ((float)tr->x[e]/100.)*var.nds4 + var.xxvc; | 
| 5780 | ty1[e-85] = ((float)tr->y[e]/100.)*var.nds4 + var.xyvc; | ty1[e-85] = (-(float)tr->y[e]/100.)*var.nds4 + var.xyvc; | 
| 5781 | 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; | 
| 5782 | 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; | 
| 5783 | }; | }; | 
| 5921 | Int_t se = 5; | Int_t se = 5; | 
| 5922 | if ( !l && m%2 == 0 ) se = 3; | if ( !l && m%2 == 0 ) se = 3; | 
| 5923 | if ( !l && m%2 != 0 ) se = 2; | if ( !l && m%2 != 0 ) se = 2; | 
| 5924 | if (  l && m%2 == 0 ) se = 1; | if (  l && m%2 != 0 ) se = 1; | 
| 5925 | if (  l && m%2 != 0 ) se = 0; | if (  l && m%2 == 0 ) se = 0; | 
| 5926 | // | // | 
| 5927 | // determine what kind of event we are going to analyze | // determine what kind of event we are going to analyze | 
| 5928 | // | // | 
| 6017 | Xview->Draw("box same"); | Xview->Draw("box same"); | 
| 6018 | }; | }; | 
| 6019 | if ( l == 1 ) { | if ( l == 1 ) { | 
| 6020 | Yview->Fill(n,21-m,1.); | Yview->Fill(95-n,21-m,1.); | 
| 6021 | pd2->cd(); | pd2->cd(); | 
| 6022 | Yview->Draw("box same"); | Yview->Draw("box same"); | 
| 6023 | }; | }; | 
| 6037 | // | // | 
| 6038 | // Define variables | // Define variables | 
| 6039 | // | // | 
| 6040 | Int_t etime = var.etime; | UInt_t etime = var.etime; | 
| 6041 | 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]; | 
| 6042 | Int_t badstrip = 0; | Int_t badstrip = 0; | 
| 6043 | qtot = 0.; | qtot = 0.; | 
| 6109 | if ( calib.ttime[s][b[s]+1] && calib.time[s][b[s]] ){ | if ( calib.ttime[s][b[s]+1] && calib.time[s][b[s]] ){ | 
| 6110 | 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 ){ | 
| 6111 | printf(" CALORIMETER: \n" ); | printf(" CALORIMETER: \n" ); | 
| 6112 | 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]); | 
| 6113 | printf(" END CALORIMETER. \n\n" ); | printf(" END CALORIMETER. \n\n" ); | 
| 6114 | b[s]++; | b[s]++; | 
| 6115 | CaloPede(s); | CaloPede(s); | 
| 6129 | Int_t se = 5; | Int_t se = 5; | 
| 6130 | if (l == 0 && m%2 == 0) se = 3; | if (l == 0 && m%2 == 0) se = 3; | 
| 6131 | if (l == 0 && m%2 != 0) se = 2; | if (l == 0 && m%2 != 0) se = 2; | 
| 6132 | if (l == 1 && m%2 == 0) se = 1; | if (l == 1 && m%2 != 0) se = 1; | 
| 6133 | if (l == 1 && m%2 != 0) se = 0; | if (l == 1 && m%2 == 0) se = 0; | 
| 6134 | // | // | 
| 6135 | // determine what kind of event we are going to analyze | // determine what kind of event we are going to analyze | 
| 6136 | // | // | 
| 6246 | Xview->Draw("box same"); | Xview->Draw("box same"); | 
| 6247 | }; | }; | 
| 6248 | if ( l == 1 ) { | if ( l == 1 ) { | 
| 6249 | Yview->Fill(n,21-m,1.); | Yview->Fill(96-n,21-m,1.); | 
| 6250 | pd2->cd(); | pd2->cd(); | 
| 6251 | Yview->Draw("box same"); | Yview->Draw("box same"); | 
| 6252 | }; | }; | 
| 6338 | Int_t l; | Int_t l; | 
| 6339 | Int_t m; | Int_t m; | 
| 6340 | Int_t n; | Int_t n; | 
| 6341 | Float_t mip = L2->GetCaloLevel1()->DecodeEstrip(ii,l,m,n); | Bool_t satura = false; | 
| 6342 |  | Float_t mip = L2->GetCaloLevel1()->DecodeEstrip(ii,l,m,n,satura); | 
| 6343 | if ( var.bw ){ | if ( var.bw ){ | 
| 6344 | colo = -1; | colo = -1; | 
| 6345 | } else { | } else { | 
| 6346 | colo = 1; | colo = 1; | 
| 6347 | }; | }; | 
| 6348 | ColorMIP(mip,colo); | ColorMIP(mip,colo); | 
| 6349 | if ( l == 0 ) { | if ( l == 0 ) { | 
| 6350 | xvev.str(""); | xvev.str(""); | 
| 6353 | xvev << " " << l; | xvev << " " << l; | 
| 6354 | gDirectory->Delete(xvev.str().c_str()); | gDirectory->Delete(xvev.str().c_str()); | 
| 6355 | 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); | 
| 6356 | Xview->SetFillColor(colo); | if ( satura ){ | 
| 6357 |  | Xview->SetFillColor(kBlack); | 
| 6358 |  | } else { | 
| 6359 |  | Xview->SetFillColor(colo); | 
| 6360 |  | }; | 
| 6361 | Xview->Fill(n,21-m,1.); | Xview->Fill(n,21-m,1.); | 
| 6362 | pd1->cd(); | pd1->cd(); | 
| 6363 | Xview->Draw("box same"); | Xview->Draw("box same"); | 
| 6369 | yvev << " " << l; | yvev << " " << l; | 
| 6370 | gDirectory->Delete(yvev.str().c_str()); | gDirectory->Delete(yvev.str().c_str()); | 
| 6371 | 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); | 
| 6372 | Yview->SetFillColor(colo); | if ( satura ){ | 
| 6373 | Yview->Fill(n,21-m,1.); | Yview->SetFillColor(kBlack); | 
| 6374 |  | } else { | 
| 6375 |  | Yview->SetFillColor(colo); | 
| 6376 |  | }; | 
| 6377 |  | Yview->Fill(96-n,21-m,1.); | 
| 6378 | pd2->cd(); | pd2->cd(); | 
| 6379 | Yview->Draw("box same"); | Yview->Draw("box same"); | 
| 6380 | }; | }; | 
| 6423 | for (Int_t d = 0; d<48; d++){ | for (Int_t d = 0; d<48; d++){ | 
| 6424 | if ( calib.ttime[s][d] != 0 ) calibex++; | if ( calib.ttime[s][d] != 0 ) calibex++; | 
| 6425 | if ( calib.time[s][0] != 0 ){ | if ( calib.time[s][0] != 0 ){ | 
| 6426 | 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]); | 
| 6427 | if ( calib.time[s][d+1] != 0 ) { | if ( calib.time[s][d+1] != 0 ) { | 
| 6428 | 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]); | 
| 6429 | } else { | } else { | 
| 6430 | if ( !stop ){ | if ( !stop ){ | 
| 6431 | 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]); | 
| 6432 | stop = 1; | stop = 1; | 
| 6433 | }; | }; | 
| 6434 | }; | }; | 
| 6435 | } else { | } else { | 
| 6436 | 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]); | 
| 6437 | }; | }; | 
| 6438 | }; | }; | 
| 6439 | printf("\n"); | printf("\n"); | 
| 6498 | calib.ttime[s][inter] = 0; | calib.ttime[s][inter] = 0; | 
| 6499 | if ( ce->cstwerr[s] != 0 && ce->cperror[s] == 0 ) { | if ( ce->cstwerr[s] != 0 && ce->cperror[s] == 0 ) { | 
| 6500 | //calib.ttime[s][inter] = cph->GetOrbitalTime(); | //calib.ttime[s][inter] = cph->GetOrbitalTime(); | 
| 6501 | calib.ttime[s][inter] = cph->OrbitalTime; | calib.ttime[s][inter] = (UInt_t)cph->OrbitalTime; | 
| 6502 | inter++; | inter++; | 
| 6503 | } else { | } else { | 
| 6504 | if ( ce->cstwerr[s] != 0 && ce->cperror[s] != 0 ) { | if ( ce->cstwerr[s] != 0 && ce->cperror[s] != 0 ) { | 
| 6552 | tr->GetEntry(ci); | tr->GetEntry(ci); | 
| 6553 | cph = ceh->GetPscuHeader(); | cph = ceh->GetPscuHeader(); | 
| 6554 | //if ( atime == cph->GetOrbitalTime()){ | //if ( atime == cph->GetOrbitalTime()){ | 
| 6555 | if ( atime == cph->OrbitalTime){ | if ( atime == (UInt_t)cph->OrbitalTime){ | 
| 6556 | //      calib.iev = ce->iev; | //      calib.iev = ce->iev; | 
| 6557 | if (ce->cstwerr[s] != 0 && ce->cperror[s] == 0 ) { | if (ce->cstwerr[s] != 0 && ce->cperror[s] == 0 ) { | 
| 6558 | for ( Int_t d=0 ; d<11 ;d++  ){ | for ( Int_t d=0 ; d<11 ;d++  ){ |