| 46 | #include <TEllipse.h> | #include <TEllipse.h> | 
| 47 | #include <TArrow.h> | #include <TArrow.h> | 
| 48 | #include <TStyle.h> | #include <TStyle.h> | 
| 49 |  | #include <TStreamerElement.h> | 
| 50 |  | #include <TRealData.h> | 
| 51 | // | // | 
| 52 | #include <PamelaRun.h> | #include <PamelaRun.h> | 
| 53 | #include <physics/calorimeter/CalorimeterEvent.h> | #include <physics/calorimeter/CalorimeterEvent.h> | 
| 69 | #include <FEVdetector.h> | #include <FEVdetector.h> | 
| 70 | #include <FEventViewer.h> | #include <FEventViewer.h> | 
| 71 | #include <feventvstruct.h> | #include <feventvstruct.h> | 
| 72 |  | #include <color.h> | 
| 73 | // | // | 
| 74 | extern Bool_t existfile(TString); | extern Bool_t existfile(TString); | 
| 75 | // | // | 
| 89 | var.SHOWDEC = 0; | var.SHOWDEC = 0; | 
| 90 | var.TOF = 0; | var.TOF = 0; | 
| 91 | var.AC = 0; | var.AC = 0; | 
| 92 |  | var.RUN = 1; | 
| 93 | var.TRK = 0; | var.TRK = 0; | 
| 94 |  | var.ORB = 1; | 
| 95 |  | var.TRG = 0; | 
| 96 | var.CALO = 0; | var.CALO = 0; | 
| 97 |  | var.CALOT = 0; | 
| 98 | var.S4 = 0; | var.S4 = 0; | 
| 99 | var.ND = 0; | var.ND = 0; | 
| 100 | var.INFOS = 0; | var.INFOS = 0; | 
| 129 | }; | }; | 
| 130 | } | } | 
| 131 |  |  | 
| 132 |  | void FEVdetector::SetDDEC(TString de){ | 
| 133 |  | ddec=de; | 
| 134 |  | }; | 
| 135 |  |  | 
| 136 | void FEVdetector::GetWindow(){ | void FEVdetector::GetWindow(){ | 
| 137 | otr->GetEntry(maxevent); | // | 
| 138 |  | if ( level.file == 2 ){ | 
| 139 |  | L2->GetEntry(minevent); | 
| 140 |  | } else { | 
| 141 |  | otr->GetEntry(minevent); | 
| 142 |  | } | 
| 143 | if ( level.file < 2 ){ | if ( level.file < 2 ){ | 
| 144 | ph = eh->GetPscuHeader(); | ph = eh->GetPscuHeader(); | 
| 145 | lastevno = (int)ph->Counter; | firstevno = (int)ph->Counter; | 
| 146 | } else { | } else { | 
| 147 | lastevno = oinfoL2->pkt_num; // to be changed as soon as we will have pkt_counter in the level2 file! | if ( var.ORB ){ | 
| 148 |  | firstevno = L2->GetOrbitalInfo()->pkt_num; | 
| 149 |  | } else { | 
| 150 |  | firstevno = 0; | 
| 151 |  | }; | 
| 152 | }; | }; | 
| 153 | otr->GetEntry(minevent); | // | 
| 154 |  | if ( level.file == 2 ){ | 
| 155 |  | L2->GetEntry(maxevent); | 
| 156 |  | } else { | 
| 157 |  | otr->GetEntry(maxevent); | 
| 158 |  | } | 
| 159 |  | // | 
| 160 | if ( level.file < 2 ){ | if ( level.file < 2 ){ | 
| 161 | ph = eh->GetPscuHeader(); | ph = eh->GetPscuHeader(); | 
| 162 | firstevno = (int)ph->Counter; | lastevno = (int)ph->Counter; | 
| 163 | } else { | } else { | 
| 164 | firstevno = oinfoL2->pkt_num; // to be changed as soon as we will have pkt_counter in the level2 file! | if ( var.ORB ){ | 
| 165 |  | lastevno = L2->GetOrbitalInfo()->pkt_num; | 
| 166 |  | } else { | 
| 167 |  | lastevno = 0; | 
| 168 |  | }; | 
| 169 | }; | }; | 
| 170 |  | // | 
| 171 | } | } | 
| 172 |  |  | 
| 173 | void FEVdetector::ClearVariables(){ | void FEVdetector::ClearVariables(){ | 
| 190 | } | } | 
| 191 |  |  | 
| 192 | void FEVdetector::GetEntry(Int_t i){ | void FEVdetector::GetEntry(Int_t i){ | 
| 193 | thisentry = i; | thisentry = i; | 
| 194 | otr->GetEntry(i); | if ( level.file == 2 ){ | 
| 195 |  | L2->Clear(); | 
| 196 |  | L2->GetEntry(i); | 
| 197 |  | ShowInfo("RunInfo"); | 
| 198 |  | ShowInfo("SoftInfo"); | 
| 199 |  | ShowInfo("OrbitalInfo"); | 
| 200 |  | ShowInfo("TrigLevel2"); | 
| 201 |  | ShowInfo("ToFLevel2"); | 
| 202 |  | ShowInfo("TrkLevel2"); | 
| 203 |  | ShowInfo("AcLevel2"); | 
| 204 |  | ShowInfo("CaloLevel2"); | 
| 205 |  | ShowInfo("CaloLevel1"); | 
| 206 |  | ShowInfo("S4Level2"); | 
| 207 |  | ShowInfo("NDLevel2"); | 
| 208 |  | } else { | 
| 209 |  | otr->GetEntry(i); | 
| 210 |  | ShowInfo("Pscu"); | 
| 211 |  | ShowInfo("Trigger"); | 
| 212 |  | ShowInfo("Tof"); | 
| 213 |  | ShowInfo("Tracker"); | 
| 214 |  | ShowInfo("Anticounter"); | 
| 215 |  | ShowInfo("Calorimeter"); | 
| 216 |  | ShowInfo("Neutron"); | 
| 217 |  | ShowInfo("S4"); | 
| 218 |  | }; | 
| 219 | } | } | 
| 220 |  |  | 
| 221 | void FEVdetector::SetEntry(Int_t i){ | void FEVdetector::SetEntry(Int_t i){ | 
| 228 | return((int)ph->Counter); | return((int)ph->Counter); | 
| 229 | } else { | } else { | 
| 230 | //    return(thisentry); // to be changed as soon as we will have pkt_counter in the level2 file! | //    return(thisentry); // to be changed as soon as we will have pkt_counter in the level2 file! | 
| 231 | return((int)oinfoL2->pkt_num); // to be changed as soon as we will have pkt_counter in the level2 file! | return((int)L2->GetOrbitalInfo()->pkt_num); // to be changed as soon as we will have pkt_counter in the level2 file! | 
| 232 | }; | }; | 
| 233 | } | } | 
| 234 |  |  | 
| 336 | }; | }; | 
| 337 | } | } | 
| 338 |  |  | 
| 339 |  | void FEVdetector::ShowInfo(TString detector){ | 
| 340 |  | // | 
| 341 |  | TBranch *b1 = 0; | 
| 342 |  | //  TBranch *b3 = 0; | 
| 343 |  | TObjArray *branch_array = 0; | 
| 344 |  | //  TObjArray *leaf_array = 0; | 
| 345 |  | // | 
| 346 |  | if ( !strcmp(detector.Data(),"RunInfo") || !strcmp(detector.Data(),"SoftInfo") ){ | 
| 347 |  | if ( L2->GetRunTree() ) b1 = L2->GetRunTree()->FindBranch(detector.Data()); | 
| 348 |  | } else { | 
| 349 |  | b1 = otr->FindBranch(detector.Data()); | 
| 350 |  | }; | 
| 351 |  | // | 
| 352 |  | if ( !b1 ) return; | 
| 353 |  | // | 
| 354 |  | Int_t dlen = 10; | 
| 355 |  | // | 
| 356 |  | char o[200000]; | 
| 357 |  | char col[13]; | 
| 358 |  | char col2[13]; | 
| 359 |  | // | 
| 360 |  | setcolor(col,RESET, GREEN, WHITE); | 
| 361 |  | sprintf(o,"%s======> EVENT:%i\n",col, thisentry); | 
| 362 |  | // | 
| 363 |  | setcolor(col,RESET, RED, WHITE); | 
| 364 |  | sprintf(o,"%s%sBranch %s\n",o,col,b1->GetName()); | 
| 365 |  | setcolor(col,RESET, BLACK, WHITE); | 
| 366 |  | sprintf(o,"%s%s",o,col); | 
| 367 |  | // | 
| 368 |  | branch_array = b1->GetListOfBranches(); | 
| 369 |  | // | 
| 370 |  | Int_t j = 0; | 
| 371 |  | // | 
| 372 |  | for(Int_t l=0;l<(branch_array->GetLast()+1);l++){ | 
| 373 |  | // | 
| 374 |  | TBranchElement *tb = (TBranchElement*)branch_array->At(l); | 
| 375 |  | Int_t type = tb->GetType(); | 
| 376 |  | Int_t atype = tb->GetStreamerType() - 20; | 
| 377 |  | Int_t len = (tb->GetInfo()->GetLengths())[tb->GetID()]; | 
| 378 |  | Int_t length = min(len,dlen); | 
| 379 |  | // | 
| 380 |  | //        printf("Branches : type is %i type is %i tb getname %s  slen %i slength %i\n",atype,type,tb->GetName(),len,length); | 
| 381 |  | switch (type){ | 
| 382 |  | case 0: | 
| 383 |  | // | 
| 384 |  | // IS A VARIABLE | 
| 385 |  | // | 
| 386 |  | // | 
| 387 |  | // NAME | 
| 388 |  | // | 
| 389 |  | setcolor(col,RESET, BLUE, WHITE); | 
| 390 |  | setcolor(col2,RESET, BLACK, WHITE); | 
| 391 |  | sprintf(o,"%s%s %-15s%s =",o,col,((TBranch*)branch_array->At(l))->GetName(),col2); | 
| 392 |  | // | 
| 393 |  | j = 0; | 
| 394 |  | // | 
| 395 |  | // VALUES | 
| 396 |  | // | 
| 397 |  | // | 
| 398 |  | // Integer | 
| 399 |  | // | 
| 400 |  | if ( atype == 3 || atype == -17 ){ | 
| 401 |  | while ( j < length ){ | 
| 402 |  | if ( j < length -1 ){ | 
| 403 |  | sprintf(o,"%s %i ,",o,(Int_t)tb->GetValue(j,0)); | 
| 404 |  | } else { | 
| 405 |  | sprintf(o,"%s %i",o,(Int_t)tb->GetValue(j,0)); | 
| 406 |  | }; | 
| 407 |  | j++; | 
| 408 |  | }; | 
| 409 |  | }; | 
| 410 |  | // | 
| 411 |  | // Unsigned integer | 
| 412 |  | // | 
| 413 |  | if ( atype == -7 || atype == 13 || atype == -9 || atype == -8 || atype == 12 ){ | 
| 414 |  | while ( j < length ){ | 
| 415 |  | if ( j < length -1 ){ | 
| 416 |  | sprintf(o,"%s %u ,",o,(UInt_t)tb->GetValue(j,0)); | 
| 417 |  | } else { | 
| 418 |  | sprintf(o,"%s %u",o,(UInt_t)tb->GetValue(j,0)); | 
| 419 |  | }; | 
| 420 |  | j++; | 
| 421 |  | }; | 
| 422 |  | }; | 
| 423 |  | // | 
| 424 |  | // Float | 
| 425 |  | // | 
| 426 |  | if ( atype == -15 || atype == 5 ){ | 
| 427 |  | while ( j < length ){ | 
| 428 |  | if ( j < length -1 ){ | 
| 429 |  | sprintf(o,"%s %f ,",o,tb->GetValue(j,0)); | 
| 430 |  | } else { | 
| 431 |  | sprintf(o,"%s %f",o,tb->GetValue(j,0)); | 
| 432 |  | }; | 
| 433 |  | j++; | 
| 434 |  | }; | 
| 435 |  | }; | 
| 436 |  | // | 
| 437 |  | // Strings | 
| 438 |  | // | 
| 439 |  | if ( atype == 45 ){ | 
| 440 |  | //      TObjArray *cl = (TObjArray*)(tb->GetInfo()->GetOffsets())[tb->GetID()];//tb->GetValuePointer(); | 
| 441 |  | //      TString *stringa = (TString*)(*cl)[0]; | 
| 442 |  | //      TBranchElement *utb = (TBranchElement*)tb->GetBranchCount(); | 
| 443 |  | //      TString** stringa = (TString*)(&tb->GetValuePointer()); | 
| 444 |  | //TStreamerElement *tste = (TStreamerElement*)tb->GetInfo()->GetCurrentElement(); | 
| 445 |  |  | 
| 446 |  | //      char *ladd; | 
| 447 |  | //      ladd = tb->GetValuePointer() | 
| 448 |  | //      TString *stringa = (TString*)((tste->GetOffset())); | 
| 449 |  | //      TString& mstr = *stringa; | 
| 450 |  | //      printf(" la mia stringa %s \n",mstr.Data()); | 
| 451 |  | //      printf(" offset %i \n",(Int_t)utb->GetValue(0,0)); | 
| 452 |  | //      int pointer = (tb->GetInfo()->GetOffsets())[tb->GetID()]; | 
| 453 |  | //      TString *stringa = (TString*)(tb->GetInfo()->GetOffsets())[tb->GetID()]; | 
| 454 |  | //      TString *stringa = (TString*)tb->GetAddress(); | 
| 455 |  | //      printf(" address 0x%X \n",tb->GetAddress()); | 
| 456 |  | //      printf(" pointer 0x%X \n",tb->GetValuePointer()); | 
| 457 |  | //      printf(" object  0x%X \n",tb->GetObject()); | 
| 458 |  | //      printf("stringa %s lung %i\n",stringa.Data(),stringa.Length()); | 
| 459 |  | //      TLeaf *striglia = tb->FindLeaf(tb->GetName()); | 
| 460 |  | //      if ( striglia ){ | 
| 461 |  | //        char *pointer = (char *)striglia->GetValuePointer(); | 
| 462 |  | //        TString *pr= (TString*)pointer; | 
| 463 |  | //        printf("ciao %s \n",pr->Data()); | 
| 464 |  | //      }; | 
| 465 |  | sprintf(o,"%s TString - not implemented yet -",o); | 
| 466 |  | }; | 
| 467 |  | // | 
| 468 |  | // TArray | 
| 469 |  | // | 
| 470 |  | if ( atype == 42 ){ | 
| 471 |  | // | 
| 472 |  | //      TObjArray *cl = (TObjArray*)tb->GetObject(); | 
| 473 |  | //      // | 
| 474 |  | //      TClass *myc = cl->IsA(); | 
| 475 |  | //      // | 
| 476 |  | //      printf("qui \n"); | 
| 477 |  | //      // | 
| 478 |  | //      // determine offset to fetch data | 
| 479 |  | //      // | 
| 480 |  | //      int thisoffset = 0; | 
| 481 |  | //      TRealData *rd = myc->GetRealData(tb->GetName()); | 
| 482 |  | //      if ( rd ){ | 
| 483 |  | //        thisoffset = rd->GetThisOffset(); | 
| 484 |  | //      }; | 
| 485 |  | //      Int_t niente = 0; | 
| 486 |  | //      TStreamerElement *tste = tb->GetInfo()->GetStreamerElement(rd->GetName(),niente); | 
| 487 |  | //      printf(" typename %s \n",tste->GetTypeName()); | 
| 488 |  | //      // | 
| 489 |  | //      // TArrayI | 
| 490 |  | //      // | 
| 491 |  | //      if ( !strcmp(tste->GetTypeName(),"TArrayI") ){ | 
| 492 |  | //        // | 
| 493 |  | //        printf("qua \n"); | 
| 494 |  | //        char *pointer = (char*)cl->At(0); | 
| 495 |  | //        //      char *pu = thisoffset + pointer; | 
| 496 |  | //        int pu = (int)tste->GetTObjectOffset(); | 
| 497 |  | //        TArrayI arr = (TArrayI)*pu; | 
| 498 |  | //        //      TArrayI arr = (TArrayI)(thisoffset); | 
| 499 |  | //        //TArrayI *arr = (TArrayI*)pu; | 
| 500 |  | //        //TArraI arr = (TArrayI) | 
| 501 |  | //        Int_t jj=0; | 
| 502 |  | //        j=0; | 
| 503 |  | //        printf("quii \n"); | 
| 504 |  | //        Int_t arlen = min(arr.GetSize(),dlen); | 
| 505 |  | //        // | 
| 506 |  | //        printf("que \n"); | 
| 507 |  | //        setcolor(col,RESET, BLUE, WHITE); | 
| 508 |  | //        setcolor(col2,RESET, BLACK, WHITE); | 
| 509 |  | //        sprintf(o,"%s%s %s[%i]%s = ",o,col,tb->GetName(),arr.GetSize(),col2); | 
| 510 |  | //        // | 
| 511 |  | //        //      while ( j < tb->GetNdata() ){ | 
| 512 |  | //        // | 
| 513 |  | //        printf("quo \n"); | 
| 514 |  | //        //        pointer = (char*)cl->UncheckedAt(j); | 
| 515 |  | //        //        pu = pointer + thisoffset; | 
| 516 |  | //        //        arr = (TArrayI*)(thisoffset); | 
| 517 |  | //        // | 
| 518 |  | //        while ( jj < arlen ){ | 
| 519 |  | //          if ( jj < arlen-1 ){ | 
| 520 |  | //            sprintf(o,"%s %i ,",o,arr.At(jj)); | 
| 521 |  | //          } else { | 
| 522 |  | //            sprintf(o,"%s %i",o,arr.At(jj)); | 
| 523 |  | //          }; | 
| 524 |  | //          jj++; | 
| 525 |  | //        }; | 
| 526 |  | //          //      if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); | 
| 527 |  | //          //      j++; | 
| 528 |  | //          //    }; | 
| 529 |  | //      }; | 
| 530 |  | //      // | 
| 531 |  | //      // TArrayF | 
| 532 |  | //      // | 
| 533 |  | //      if ( !strcmp(tste->GetTypeName(),"TArrayF") ){ | 
| 534 |  | //        // | 
| 535 |  | //        char *pointer = (char*)cl->UncheckedAt(0); | 
| 536 |  | //        char *pu = pointer + thisoffset; | 
| 537 |  | //        TArrayF *arr = (TArrayF*)(pu); | 
| 538 |  | //        Int_t jj=0; | 
| 539 |  | //        Int_t arlen = min(arr->GetSize(),dlen); | 
| 540 |  | //        // | 
| 541 |  | //        setcolor(col,RESET, BLUE, WHITE); | 
| 542 |  | //        setcolor(col2,RESET, BLACK, WHITE); | 
| 543 |  | //        sprintf(o,"%s%s %s[%i]%s = ",o,col,tb->GetName(),arr->GetSize(),col2); | 
| 544 |  | //        // | 
| 545 |  | //        while ( j < tb->GetNdata() ){ | 
| 546 |  | //          // | 
| 547 |  | //          pointer = (char*)cl->UncheckedAt(j); | 
| 548 |  | //          pu = pointer + thisoffset; | 
| 549 |  | //          arr = (TArrayF*)(pu); | 
| 550 |  | //          // | 
| 551 |  | //          while ( jj < arlen ){ | 
| 552 |  | //            if ( jj < arlen-1 ){ | 
| 553 |  | //              sprintf(o,"%s %f ,",o,arr->At(jj)); | 
| 554 |  | //            } else { | 
| 555 |  | //              sprintf(o,"%s %f",o,arr->At(jj)); | 
| 556 |  | //            }; | 
| 557 |  | //            jj++; | 
| 558 |  | //          }; | 
| 559 |  | //          if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); | 
| 560 |  | //          j++; | 
| 561 |  | //        }; | 
| 562 |  | //      }; | 
| 563 |  | //      sprintf(o,"%s\n",o); | 
| 564 |  | // | 
| 565 |  | sprintf(o,"%s TArray - not implemented yet -",o); | 
| 566 |  | // | 
| 567 |  | }; | 
| 568 |  | // | 
| 569 |  | sprintf(o,"%s\n",o); | 
| 570 |  | break; | 
| 571 |  | case 3: | 
| 572 |  | // | 
| 573 |  | // IS A TCLONESARRAY | 
| 574 |  | // | 
| 575 |  | setcolor(col,RESET, BLUE, WHITE); | 
| 576 |  | setcolor(col2,RESET, BLACK, WHITE); | 
| 577 |  | sprintf(o,"%s%s %-15s%s = %d\n",o,col,tb->GetName(), col2, tb->GetNdata()); | 
| 578 |  |  | 
| 579 |  | // | 
| 580 |  | if ( tb->GetNdata() ){ | 
| 581 |  | // | 
| 582 |  | TClonesArray *cl = (TClonesArray*)tb->GetObject(); | 
| 583 |  | // | 
| 584 |  | TClass *myc = cl->GetClass(); | 
| 585 |  | // | 
| 586 |  | TList *lme = myc->GetListOfDataMembers(); | 
| 587 |  | TIter next(lme); | 
| 588 |  | TBranchElement *tb2 = 0; | 
| 589 |  | // | 
| 590 |  | while ( (tb2 = (TBranchElement*)next()) ){ | 
| 591 |  | // | 
| 592 |  | const char *name = tb2->GetName(); | 
| 593 |  | TBranch *foglia = tb->FindBranch(name); | 
| 594 |  | if ( foglia ){ | 
| 595 |  | // | 
| 596 |  | TBranchElement *stb = (TBranchElement*)tb->FindBranch(name); | 
| 597 |  | Int_t stype = stb->GetType(); | 
| 598 |  | Int_t satype = stb->GetStreamerType() - 20; | 
| 599 |  | Int_t slen = (stb->GetInfo()->GetLengths())[stb->GetID()]; | 
| 600 |  | Int_t slength = min(slen,dlen); | 
| 601 |  | //      printf("SubBranches : atype is %i type is %i tb getname %s  slen %i slength %i\n",satype,stype,stb->GetName(),slen,slength); | 
| 602 |  | switch (stype){ | 
| 603 |  | case 31: | 
| 604 |  | // | 
| 605 |  | // IS A VARIABLE | 
| 606 |  | // | 
| 607 |  | // | 
| 608 |  | // NAME | 
| 609 |  | // | 
| 610 |  | j = 0; | 
| 611 |  | // | 
| 612 |  | // VALUES | 
| 613 |  | // | 
| 614 |  | if ( satype == 41 || satype == 44){ | 
| 615 |  | // | 
| 616 |  | // skip TRef | 
| 617 |  | // | 
| 618 |  | break; | 
| 619 |  | }; | 
| 620 |  | // | 
| 621 |  | // Integer | 
| 622 |  | // | 
| 623 |  | if ( satype == -17 || satype == -9 ){ | 
| 624 |  | // | 
| 625 |  | setcolor(col,RESET, BLUE, WHITE); | 
| 626 |  | setcolor(col2,RESET, BLACK, WHITE); | 
| 627 |  | sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2); | 
| 628 |  | while ( j < cl->GetEntriesFast() ){ | 
| 629 |  | if ( j < cl->GetEntriesFast() -1 ){ | 
| 630 |  | sprintf(o,"%s %i ,",o,(Int_t)stb->GetValue(j,slength)); | 
| 631 |  | } else { | 
| 632 |  | sprintf(o,"%s %i",o,(Int_t)stb->GetValue(j,slength)); | 
| 633 |  | }; | 
| 634 |  | j++; | 
| 635 |  | }; | 
| 636 |  | }; | 
| 637 |  | // | 
| 638 |  | // Float | 
| 639 |  | // | 
| 640 |  | if ( satype == -15 ){ | 
| 641 |  | // | 
| 642 |  | setcolor(col,RESET, BLUE, WHITE); | 
| 643 |  | setcolor(col2,RESET, BLACK, WHITE); | 
| 644 |  | sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2); | 
| 645 |  | while ( j < cl->GetEntriesFast() ){ | 
| 646 |  | if ( j < cl->GetEntriesFast() -1 ){ | 
| 647 |  | sprintf(o,"%s %f ,",o,stb->GetValue(j,slength)); | 
| 648 |  | } else { | 
| 649 |  | sprintf(o,"%s %f",o,stb->GetValue(j,slength)); | 
| 650 |  | }; | 
| 651 |  | j++; | 
| 652 |  | }; | 
| 653 |  | }; | 
| 654 |  | // | 
| 655 |  | // Array of float | 
| 656 |  | // | 
| 657 |  | if ( satype == 5 ){ | 
| 658 |  | // | 
| 659 |  | setcolor(col,RESET, BLUE, WHITE); | 
| 660 |  | setcolor(col2,RESET, BLACK, WHITE); | 
| 661 |  | sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2); | 
| 662 |  | Bool_t bold = true; | 
| 663 |  | while ( j < tb->GetNdata() ){ | 
| 664 |  | if ( bold ){ | 
| 665 |  | setcolor(col,RESET, BLACK, WHITE); | 
| 666 |  | sprintf(o,"%s%s",o,col); | 
| 667 |  | } else { | 
| 668 |  | setcolor(col,BOLD, BLACK, WHITE); | 
| 669 |  | sprintf(o,"%s%s",o,col); | 
| 670 |  | }; | 
| 671 |  | Int_t jj = 0; | 
| 672 |  | while ( jj < slength ){ | 
| 673 |  | if ( jj < slength-1 ){ | 
| 674 |  | sprintf(o,"%s %f ,",o,stb->GetValue(j,jj,true)); | 
| 675 |  | } else { | 
| 676 |  | sprintf(o,"%s %f",o,stb->GetValue(j,jj,true)); | 
| 677 |  | }; | 
| 678 |  | jj++; | 
| 679 |  | }; | 
| 680 |  | if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); | 
| 681 |  | if ( !bold ){ | 
| 682 |  | bold = true; | 
| 683 |  | } else { | 
| 684 |  | bold = false; | 
| 685 |  | }; | 
| 686 |  | j++; | 
| 687 |  | }; | 
| 688 |  | if ( bold ){ | 
| 689 |  | setcolor(col,RESET, BLACK, WHITE); | 
| 690 |  | sprintf(o,"%s%s",o,col); | 
| 691 |  | }; | 
| 692 |  | }; | 
| 693 |  | // | 
| 694 |  | // Array of integers | 
| 695 |  | // | 
| 696 |  | if ( satype == 3 ){ | 
| 697 |  | // | 
| 698 |  | setcolor(col,RESET, BLUE, WHITE); | 
| 699 |  | setcolor(col2,RESET, BLACK, WHITE); | 
| 700 |  | sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2); | 
| 701 |  | while ( j < tb->GetNdata() ){ | 
| 702 |  | Int_t jj = 0; | 
| 703 |  | while ( jj < slength ){ | 
| 704 |  | if ( jj < slength-1 ){ | 
| 705 |  | sprintf(o,"%s %i ,",o,(Int_t)stb->GetValue(j,jj,true)); | 
| 706 |  | } else { | 
| 707 |  | sprintf(o,"%s %i",o,(Int_t)stb->GetValue(j,jj,true)); | 
| 708 |  | }; | 
| 709 |  | jj++; | 
| 710 |  | }; | 
| 711 |  | if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); | 
| 712 |  | j++; | 
| 713 |  | }; | 
| 714 |  | }; | 
| 715 |  |  | 
| 716 |  | // | 
| 717 |  | // TArray | 
| 718 |  | // | 
| 719 |  | if ( satype == 42 ){ | 
| 720 |  | // | 
| 721 |  | // determine offset to fetch data | 
| 722 |  | // | 
| 723 |  | int thisoffset = 0; | 
| 724 |  | TRealData *rd = myc->GetRealData(foglia->GetName()); | 
| 725 |  | if ( rd ){ | 
| 726 |  | thisoffset = rd->GetThisOffset(); | 
| 727 |  | }; | 
| 728 |  | Int_t niente = 0; | 
| 729 |  | TStreamerElement *tste = stb->GetInfo()->GetStreamerElement(rd->GetName(),niente); | 
| 730 |  | // | 
| 731 |  | // TArrayI | 
| 732 |  | // | 
| 733 |  | if ( !strcmp(tste->GetTypeName(),"TArrayI") ){ | 
| 734 |  | // | 
| 735 |  | char *pointer = (char*)cl->UncheckedAt(0); | 
| 736 |  | char *pu = pointer + thisoffset; | 
| 737 |  | TArrayI *arr = (TArrayI*)(pu); | 
| 738 |  | Int_t jj=0; | 
| 739 |  | Int_t arlen = min(arr->GetSize(),dlen); | 
| 740 |  | // | 
| 741 |  | setcolor(col,RESET, BLUE, WHITE); | 
| 742 |  | setcolor(col2,RESET, BLACK, WHITE); | 
| 743 |  | sprintf(o,"%s%s %s[%i]%s = ",o,col,foglia->GetName(),arr->GetSize(),col2); | 
| 744 |  | // | 
| 745 |  | while ( j < tb->GetNdata() ){ | 
| 746 |  | // | 
| 747 |  | pointer = (char*)cl->UncheckedAt(j); | 
| 748 |  | pu = pointer + thisoffset; | 
| 749 |  | arr = (TArrayI*)(pu); | 
| 750 |  | // | 
| 751 |  | while ( jj < arlen ){ | 
| 752 |  | if ( jj < arlen-1 ){ | 
| 753 |  | sprintf(o,"%s %i ,",o,arr->At(jj)); | 
| 754 |  | } else { | 
| 755 |  | sprintf(o,"%s %i",o,arr->At(jj)); | 
| 756 |  | }; | 
| 757 |  | jj++; | 
| 758 |  | }; | 
| 759 |  | if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); | 
| 760 |  | j++; | 
| 761 |  | }; | 
| 762 |  | }; | 
| 763 |  | // | 
| 764 |  | // TArrayF | 
| 765 |  | // | 
| 766 |  | if ( !strcmp(tste->GetTypeName(),"TArrayF") ){ | 
| 767 |  | // | 
| 768 |  | char *pointer = (char*)cl->UncheckedAt(0); | 
| 769 |  | char *pu = pointer + thisoffset; | 
| 770 |  | TArrayF *arr = (TArrayF*)(pu); | 
| 771 |  | Int_t jj=0; | 
| 772 |  | Int_t arlen = min(arr->GetSize(),dlen); | 
| 773 |  | // | 
| 774 |  | setcolor(col,RESET, BLUE, WHITE); | 
| 775 |  | setcolor(col2,RESET, BLACK, WHITE); | 
| 776 |  | sprintf(o,"%s%s %s[%i]%s = ",o,col,foglia->GetName(),arr->GetSize(),col2); | 
| 777 |  | // | 
| 778 |  | while ( j < tb->GetNdata() ){ | 
| 779 |  | // | 
| 780 |  | pointer = (char*)cl->UncheckedAt(j); | 
| 781 |  | pu = pointer + thisoffset; | 
| 782 |  | arr = (TArrayF*)(pu); | 
| 783 |  | // | 
| 784 |  | while ( jj < arlen ){ | 
| 785 |  | if ( jj < arlen-1 ){ | 
| 786 |  | sprintf(o,"%s %f ,",o,arr->At(jj)); | 
| 787 |  | } else { | 
| 788 |  | sprintf(o,"%s %f",o,arr->At(jj)); | 
| 789 |  | }; | 
| 790 |  | jj++; | 
| 791 |  | }; | 
| 792 |  | if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); | 
| 793 |  | j++; | 
| 794 |  | }; | 
| 795 |  | }; | 
| 796 |  | }; | 
| 797 |  | sprintf(o,"%s\n",o); | 
| 798 |  | break; | 
| 799 |  | }; | 
| 800 |  | }; | 
| 801 |  | }; | 
| 802 |  | }; | 
| 803 |  | break; | 
| 804 |  | }; | 
| 805 |  | }; | 
| 806 |  | //  pamgui->DIALOG(0,o); | 
| 807 |  | printf("%s\n",o); | 
| 808 |  | }; | 
| 809 |  |  | 
| 810 |  |  | 
| 811 | void FEVdetector::GetGeneralInfo(){ | void FEVdetector::GetGeneralInfo(){ | 
| 812 | // | // | 
| 813 | // Get Orbital Time information and header event number | // Get Orbital Time information and header event number | 
| 817 | headcold = headc; | headcold = headc; | 
| 818 | headc = ph->Counter; | headc = ph->Counter; | 
| 819 | var.headc = (int)ph->Counter; | var.headc = (int)ph->Counter; | 
| 820 | OBT = ph->OrbitalTime; | OBT = (UInt_t)ph->OrbitalTime; | 
| 821 | DOBT = OBT - OOBT; | DOBT = OBT - OOBT; | 
| 822 | OOBT = OBT; | OOBT = OBT; | 
| 823 | if ( thisentry == minevent || DOBT < 0 || (headc-headcold-1)!=0 ) DOBT = 0; | if ( thisentry == minevent || DOBT < 0 || (headc-headcold-1)!=0 ) DOBT = 0; | 
| 853 | trcs = (TString)trc.str().c_str(); | trcs = (TString)trc.str().c_str(); | 
| 854 | } else { | } else { | 
| 855 | headcold = headc; | headcold = headc; | 
| 856 | headc = oinfoL2->pkt_num; // to be changed as soon as we will have obt in the level2 file! | if ( var.RUN ){ | 
| 857 | OBT = oinfoL2->OBT; // to be changed as soon as we will have obt in the level2 file! | var.idrun = L2->GetRunInfo()->ID; | 
| 858 | DOBT = OBT - OOBT; | var.idroot = L2->GetRunInfo()->ID_ROOT_L0; | 
| 859 | OOBT = OBT; | var.EVF = L2->GetRunInfo()->EV_FROM; | 
| 860 | if ( thisentry == minevent || DOBT < 0 || (headc-headcold-1)!=0 ) DOBT = 0; | }; | 
| 861 | var.etime = OBT; | if ( var.ORB ){ | 
| 862 |  | headc = L2->GetOrbitalInfo()->pkt_num; | 
| 863 |  | OBT = L2->GetOrbitalInfo()->OBT; | 
| 864 |  | DOBT = OBT - OOBT; | 
| 865 |  | OOBT = OBT; | 
| 866 |  | if ( thisentry == minevent || DOBT < 0 || (headc-headcold-1)!=0 ) DOBT = 0; | 
| 867 |  | var.etime = OBT; | 
| 868 |  | } else { | 
| 869 |  | var.etime = 0; | 
| 870 |  | }; | 
| 871 | // | // | 
| 872 | // who gave the trigger? | // who gave the trigger? | 
| 873 | // | // | 
| 874 | calotrig = 0; | Int_t trigconf = 0; | 
| 875 | if ( L2->patterntrig[0] ) calotrig = 1; | if ( var.TRG ){ | 
| 876 | toftrig = 0; | calotrig = 0; | 
| 877 | if ( L2->patterntrig[2] || L2->patterntrig[3] || L2->patterntrig[4] || L2->patterntrig[5] ) toftrig = 1; | if ( L2->GetTrigLevel2()->patterntrig[0] ) calotrig = 1; | 
| 878 | s4pulser = 0; | toftrig = 0; | 
| 879 | if ( L2->patterntrig[1] & (1<<0) ) s4pulser = 1; | if ( L2->GetTrigLevel2()->patterntrig[2] || L2->GetTrigLevel2()->patterntrig[3] || L2->GetTrigLevel2()->patterntrig[4] || L2->GetTrigLevel2()->patterntrig[5] ) toftrig = 1; | 
| 880 | // | s4pulser = 0; | 
| 881 | // 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; | 
| 882 | // S4 sometimes could not set the flag even if the trigger is given. This is a workaround to fix this "bug": | // | 
| 883 | // | // TOF and calorimeter when giving a trigger will always set this flag since the time window of the signal is greater than 100 ns. | 
| 884 | 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": | 
| 885 | // | // | 
| 886 | Int_t trigconf = L2->trigconf; | if ( !calotrig && !toftrig ) s4pulser = 1; | 
| 887 |  | // | 
| 888 |  | trigconf = L2->GetTrigLevel2()->trigconf; | 
| 889 |  | } else { | 
| 890 |  | trigconf = 0; | 
| 891 |  | } | 
| 892 | stringstream trc; | stringstream trc; | 
| 893 | trc.str(""); | trc.str(""); | 
| 894 | if ( trigconf & (1<<0) ) trc << "TOF1"; | if ( trigconf & (1<<0) ) trc << "TOF1"; | 
| 997 | // | // | 
| 998 | 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);"); | 
| 999 | // | // | 
| 1000 | if ( level.file ==  2 ) isOK = gApplication->ProcessLine("filter((PamLevel2 *)L2,2);"); | //      if ( level.file ==  2 ) isOK = gApplication->ProcessLine("filter((PamLevel2 *)L2,2);"); | 
| 1001 |  | if ( level.file ==  2 ) isOK = gApplication->ProcessLine("filter();"); | 
| 1002 | // | // | 
| 1003 | // progress bar in text window | // progress bar in text window | 
| 1004 | // | // | 
| 1011 | // | // | 
| 1012 | } | } | 
| 1013 |  |  | 
| 1014 | void FEVdetector::Load(TTree &mainotr, TFile &mainfile){ | TChain* FEVdetector::Load(TFile &mainfile){ | 
| 1015 |  | // | 
| 1016 | file = &mainfile; | file = &mainfile; | 
|  | otr = &mainotr; |  | 
|  | L2 = new PamLevel2(); |  | 
| 1017 | // | // | 
| 1018 | if ( level.file == 2 ){ | if ( level.file == 2 ){ | 
|  | otr = L2->LoadPamTrees(file); |  | 
|  | // ******************** |  | 
|  | // load magnetic field |  | 
|  | // ******************** |  | 
|  | const char *pam_calib = pathtocalibration(); |  | 
| 1019 | // | // | 
| 1020 | stringstream magfie; | printf(" %s \n",ddec.Data()); | 
| 1021 | magfie.str(""); | if ( !L2 ){ | 
| 1022 | magfie << pam_calib; | L2 = new PamLevel2("",file->GetName(),ddec.Data()); | 
| 1023 | magfie << "/trk-param/field_param-0/"; | otr = L2->GetPamTree(); | 
| 1024 |  | } else { | 
| 1025 |  | // | 
| 1026 |  | otr = L2->GetPamTree(gSystem->DirName(file->GetName()),file->GetName(),ddec.Data()); | 
| 1027 |  | L2->GetRunTree(gSystem->DirName(file->GetName()),file->GetName()); | 
| 1028 |  | // | 
| 1029 |  | }; | 
| 1030 |  | // | 
| 1031 |  | // | 
| 1032 |  | if ( !otr ) return(0); | 
| 1033 |  | // | 
| 1034 |  | //    otr->CanDeleteRefs(true); | 
| 1035 |  | //    if ( runtree ) runtree->CanDeleteRefs(true); | 
| 1036 | // | // | 
|  | L2->LoadField(magfie.str().c_str()); |  | 
| 1037 | } else { | } else { | 
| 1038 | // | // | 
| 1039 | // load calorimeter ADC2MIP conversion file | // load calorimeter ADC2MIP conversion file | 
| 1073 | // | // | 
| 1074 | }; | }; | 
| 1075 | // | // | 
|  |  |  | 
| 1076 | // | // | 
| 1077 | 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(); |  | 
| 1078 | // | // | 
| 1079 | if ( level.file == 0 || level.file == -1 ){ | if ( level.file == 0 || level.file == -1 ){ | 
| 1080 |  | // | 
| 1081 |  | trigger = new pamela::trigger::TriggerEvent(); | 
| 1082 |  | eh = new pamela::EventHeader(); | 
| 1083 |  | ph = new pamela::PscuHeader(); | 
| 1084 |  | de = new pamela::calorimeter::CalorimeterEvent(); | 
| 1085 |  | trk = new pamela::tracker::TrackerEvent(); | 
| 1086 |  | ne = new pamela::neutron::NeutronEvent(); | 
| 1087 |  | ace = new pamela::anticounter::AnticounterEvent(); | 
| 1088 |  | s4 = new pamela::S4::S4Event(); | 
| 1089 |  | tof = new pamela::tof::TofEvent(); | 
| 1090 |  | // | 
| 1091 |  | otr = new TChain("Physics"); | 
| 1092 |  | otr->Add(file->GetName(),-1); | 
| 1093 | otr->SetBranchAddress("Trigger", &trigger); | otr->SetBranchAddress("Trigger", &trigger); | 
| 1094 | otr->SetBranchAddress("Header", &eh); | otr->SetBranchAddress("Header", &eh); | 
| 1095 | }; | }; | 
|  | if ( level.file == 2 ){ |  | 
|  | otr->AddFriend("OrbitalInfo", file); |  | 
|  | otr->SetBranchAddress("OrbitalInfo", &oinfoL2); |  | 
|  | runinfo->Read(0ULL); |  | 
|  | }; |  | 
| 1096 | // | // | 
| 1097 | if ( var.TRK ) { | if ( var.TRK ) { | 
| 1098 | if ( level.file == 0 || level.file == -1 ){ | if ( level.file == 0 || level.file == -1 ){ | 
| 1164 | printf("Show the Time of Flight detector, LEVEL2 data \n"); | printf("Show the Time of Flight detector, LEVEL2 data \n"); | 
| 1165 | }; | }; | 
| 1166 | }; | }; | 
| 1167 |  | // | 
| 1168 |  | if ( !otr ){ | 
| 1169 |  | return(0); | 
| 1170 |  | }; | 
| 1171 |  | // | 
| 1172 |  | return otr; | 
| 1173 | // | // | 
| 1174 | } | } | 
| 1175 |  |  | 
| 1245 | text->DrawLatex(0.33,txthi,testo.str().c_str()); | text->DrawLatex(0.33,txthi,testo.str().c_str()); | 
| 1246 | txthi -= 0.03; | txthi -= 0.03; | 
| 1247 | testo2.str(""); | testo2.str(""); | 
| 1248 | testo2 << "On Board Time: " << (int)OBT; | testo2 << "On Board Time: " << (unsigned int)OBT; | 
| 1249 | if ( DOBT > 0 ) { | if ( DOBT > 0 ) { | 
| 1250 | testo2 << " (delta: " << (int)DOBT; | testo2 << " (delta: " << (unsigned int)DOBT; | 
| 1251 | testo2 << ")"; | testo2 << ")"; | 
| 1252 | }; | }; | 
| 1253 | testo2 << " [ms]"; | testo2 << " [ms]"; | 
| 1364 | // | // | 
| 1365 | // SHOW PALETTE | // SHOW PALETTE | 
| 1366 | // | // | 
| 1367 |  | thefigure->cd(); | 
| 1368 | if ( var.PALETTE ) ShowPalette(); | if ( var.PALETTE ) ShowPalette(); | 
| 1369 | // | // | 
| 1370 | // SHOW VERBOSE INFOS | // SHOW VERBOSE INFOS | 
| 1865 | void FEVdetector::ShowTOF(){ | void FEVdetector::ShowTOF(){ | 
| 1866 | // | // | 
| 1867 | // | // | 
|  | // |  | 
| 1868 | if ( !var.TOF ) return; | if ( !var.TOF ) return; | 
| 1869 | // | // | 
| 1870 | Int_t tt = 0; | Int_t tt = 0; | 
| 2570 | ms11b[i] = 0.; | ms11b[i] = 0.; | 
| 2571 | } else { | } else { | 
| 2572 | ms11b[i] = 1.; | ms11b[i] = 1.; | 
| 2573 | };    }; | }; | 
| 2574 |  | }; | 
| 2575 | for ( Int_t i = 0; i<6; i++ ) { | for ( Int_t i = 0; i<6; i++ ) { | 
| 2576 | mt12[0][i] = tof->tdc[ch12a[i]][hb12a[i]]; | mt12[0][i] = tof->tdc[ch12a[i]][hb12a[i]]; | 
| 2577 | mt12[1][i] = tof->tdc[ch12b[i]][hb12b[i]]; | mt12[1][i] = tof->tdc[ch12b[i]][hb12b[i]]; | 
| 2665 | // | // | 
| 2666 | Bool_t repeat = true; | Bool_t repeat = true; | 
| 2667 | Int_t numtr = 1; | Int_t numtr = 1; | 
| 2668 |  | //  Int_t numtr = 0; | 
| 2669 | Int_t repuntil = 0; | Int_t repuntil = 0; | 
| 2670 | // | // | 
| 2671 | // | // | 
| 2672 | var.tofraw = 0; | var.tofraw = 0; | 
| 2673 | // | // | 
| 2674 | repuntil = L2->ToFLevel2::ntrk(); | if ( level.file == 2 ) repuntil = L2->GetToFLevel2()->ntrk(); | 
| 2675 | //  printf("repuntil = %i \n",repuntil); | //  printf("repuntil = %i \n",repuntil); | 
| 2676 |  | //if ( level.file == 2 ) repuntil = L2->GetTrkLevel2()->GetNTracks(); | 
| 2677 | //repuntil = L2->GetNTracks(); | //repuntil = L2->GetNTracks(); | 
| 2678 | // | // | 
| 2679 | while ( repeat ){ | while ( repeat ){ | 
| 2683 | // | // | 
| 2684 | // | // | 
| 2685 | ToFTrkVar *ptt = 0; | ToFTrkVar *ptt = 0; | 
| 2686 |  | //      PamTrack *ptrack = 0; | 
| 2687 |  | Float_t adc[4][12]; | 
| 2688 |  | Float_t tdc[4][12]; | 
| 2689 |  | memset(adc,0,4*12*sizeof(Float_t)); | 
| 2690 |  | memset(tdc,0,4*12*sizeof(Float_t)); | 
| 2691 | // | // | 
| 2692 | // | // | 
| 2693 |  | //      if ( repuntil == 0 || var.tofraw ){ | 
| 2694 | if ( repuntil == 1 || var.tofraw ){ | if ( repuntil == 1 || var.tofraw ){ | 
| 2695 | numtr = 0; | numtr = 0; | 
| 2696 | ptt = L2->GetToFTrkVar(0); | ptt = L2->GetToFLevel2()->GetToFTrkVar(0); | 
| 2697 | repeat = false; | repeat = false; | 
| 2698 | } else { | } else { | 
| 2699 | // | // | 
| 2700 | // | // | 
| 2701 | if ( numtr >= repuntil-1 ) repeat = false; | if ( numtr >= repuntil-1 ) repeat = false; | 
| 2702 | // | // | 
| 2703 | ptt = L2->GetToFTrkVar(numtr); | //      printf(" numtr is %i \n",numtr); | 
| 2704 |  | ptt = L2->GetToFLevel2()->GetToFTrkVar(numtr); | 
| 2705 |  | //ptrack = L2->GetTrack(numtr); | 
| 2706 |  | //ptt = ptrack->GetToFTrack(); | 
| 2707 | }; | }; | 
| 2708 | // | // | 
| 2709 | xp11[0] = 0.; | xp11[0] = 0.; | 
| 2717 | // | // | 
| 2718 | ii = 2; | ii = 2; | 
| 2719 | // | // | 
| 2720 | Float_t adc[4][12]; | Int_t myseq = ptt->trkseqno + 1; | 
| 2721 | Float_t tdc[4][12]; | L2->GetToFLevel2()->GetMatrix(myseq,adc,tdc); | 
| 2722 | L2->GetMatrix(numtr,adc,tdc); | // | 
| 2723 |  | //      printf(" qua \n"); | 
| 2724 | // | // | 
| 2725 | for ( Int_t i = 0; i<8; i++ ) { | for ( Int_t i = 0; i<8; i++ ) { | 
| 2726 | if ( adc[ch11a[i]][hb11a[i]] < 1000. ){ | if ( adc[ch11a[i]][hb11a[i]] < 1000. ){ | 
| 2729 | if ( adc[ch11b[i]][hb11b[i]] < 1000. ){ | if ( adc[ch11b[i]][hb11b[i]] < 1000. ){ | 
| 2730 | ms11b[i] = adc[ch11b[i]][hb11b[i]]; | ms11b[i] = adc[ch11b[i]][hb11b[i]]; | 
| 2731 | }; | }; | 
| 2732 | xp11[i] = 0.; | //      xp11[i] = 0.; | 
| 2733 | }; | }; | 
| 2734 |  |  | 
| 2735 | Int_t nmtof = 0; | Int_t nmtof = 0; | 
| 2769 | if ( adc[ch12b[i]][hb12b[i]] < 1000. ) ms12b[i] = adc[ch12b[i]][hb12b[i]]; | if ( adc[ch12b[i]][hb12b[i]] < 1000. ) ms12b[i] = adc[ch12b[i]][hb12b[i]]; | 
| 2770 | xp12[i] = 0.; | xp12[i] = 0.; | 
| 2771 | }; | }; | 
| 2772 |  | // | 
| 2773 | xp12[0] = ptt->xtofpos[0]; | xp12[0] = ptt->xtofpos[0]; | 
| 2774 | // | // | 
| 2775 | ii = 2; | ii = 2; | 
| 2777 | ii--; | ii--; | 
| 2778 | if ( adc[ch21a[i]][hb21a[i]] < 1000. ) ms21a[ii] = adc[ch21a[i]][hb21a[i]]; | if ( adc[ch21a[i]][hb21a[i]] < 1000. ) ms21a[ii] = adc[ch21a[i]][hb21a[i]]; | 
| 2779 | if ( adc[ch21b[i]][hb21b[i]] < 1000. ) ms21b[ii] = adc[ch21b[i]][hb21b[i]]; | if ( adc[ch21b[i]][hb21b[i]] < 1000. ) ms21b[ii] = adc[ch21b[i]][hb21b[i]]; | 
| 2780 | xp12[i] = 0.; | xp21[i] = 0.; | 
| 2781 | }; | }; | 
| 2782 | xp21[0] = ptt->xtofpos[1]; | xp21[0] = ptt->xtofpos[1]; | 
| 2783 | // | // | 
| 3363 | // full infos from ac | // full infos from ac | 
| 3364 | // | // | 
| 3365 | if ( level.file == 2 ){ | if ( level.file == 2 ){ | 
| 3366 | hitmapA = L2->hitmap[0]; | hitmapA = L2->GetAcLevel2()->hitmap[0]; | 
| 3367 | hitmapB = L2->hitmap[1]; | hitmapB = L2->GetAcLevel2()->hitmap[1]; | 
| 3368 | hitstatusA = L2->hitstatus[0]; | hitstatusA = L2->GetAcLevel2()->hitstatus[0]; | 
| 3369 | hitstatusB = L2->hitstatus[1]; | hitstatusB = L2->GetAcLevel2()->hitstatus[1]; | 
| 3370 | }; | }; | 
| 3371 | // | // | 
| 3372 | // | // | 
| 4240 | pcasp4b->Draw("f"); | pcasp4b->Draw("f"); | 
| 4241 | pcasp4b->Draw(); | pcasp4b->Draw(); | 
| 4242 | }; | }; | 
| 4243 | Float_t alfa = 1.2020334; | //  Float_t alfax = 1.2020334; | 
| 4244 |  | Float_t alfax = 1.22157778; | 
| 4245 |  | Float_t alfay = 1.27393111; | 
| 4246 | Float_t lcrd = 0.1815/2.; | Float_t lcrd = 0.1815/2.; | 
| 4247 | Float_t wcrd = 0.008; | Float_t wcrd = 0.008; | 
| 4248 | if ( true ){ | if ( true ){ | 
| 4453 | // | // | 
| 4454 | //    Float_t cardcx = 0.143168*var.sfx; | //    Float_t cardcx = 0.143168*var.sfx; | 
| 4455 | //Float_t cardcy = 0.1475*var.sfy; | //Float_t cardcy = 0.1475*var.sfy; | 
| 4456 | Float_t cardcx = 0.153168*var.sfx; | // | 
| 4457 | Float_t cardcy = 0.1575*var.sfy; | //    Float_t cardcx = 0.153168*var.sfx; | 
| 4458 | Float_t acrdx[4] = {-lcrd*cos(alfa), lcrd*cos(alfa), -lcrd*cos(alfa)+wcrd*sin(alfa), -lcrd*cos(alfa)}; | // | 
| 4459 | 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; | 
| 4460 | 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; | 
| 4461 | 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; | 
| 4462 |  | Float_t acrdx[4] = {-lcrd*cos(alfax), lcrd*cos(alfax), -lcrd*cos(alfax)+wcrd*sin(alfax), -lcrd*cos(alfax)}; | 
| 4463 |  | Float_t acrdy[4] = {-lcrd*sin(alfax), lcrd*sin(alfax), -lcrd*sin(alfax)-wcrd*cos(alfax), -lcrd*sin(alfax)}; | 
| 4464 |  | Float_t bcrdx[4] = { lcrd*cos(alfax), lcrd*cos(alfax)+wcrd*sin(alfax), -lcrd*cos(alfax)+wcrd*sin(alfax), lcrd*cos(alfax)}; | 
| 4465 |  | Float_t bcrdy[4] = { lcrd*sin(alfax), lcrd*sin(alfax)-wcrd*cos(alfax), -lcrd*sin(alfax)-wcrd*cos(alfax), lcrd*sin(alfax)}; | 
| 4466 |  |  | 
| 4467 | // | // | 
| 4468 | // CARD3  X/  Y | // CARD3  X/  Y | 
| 4522 | }; | }; | 
| 4523 |  |  | 
| 4524 | if ( true ){ | if ( true ){ | 
| 4525 | 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)}; | 
| 4526 | 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)}; | 
| 4527 | 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)}; | 
| 4528 | 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)}; | 
| 4529 | // | // | 
| 4530 | // CARD - Y-view | // CARD - Y-view | 
| 4531 | // | // | 
| 4532 | Float_t cardcx = 0.12*var.sfx; | //    Float_t cardcx = 0.12*var.sfx; | 
| 4533 | Float_t cardcy = 0.1475*var.sfy; | Float_t cardcx = (0.16014*(1.-lcrd*cos(alfay)))*var.sfx; | 
| 4534 |  | //    Float_t cardcy = 0.178818*var.sfy; | 
| 4535 |  | Float_t cardcy = (0.178818*(1.-lcrd*sin(alfay)))*var.sfy; | 
| 4536 |  | //    Float_t cardcy = 0.1475*var.sfy; | 
| 4537 | // | // | 
| 4538 | // CARD4  X  Y/ | // CARD4  X  Y/ | 
| 4539 | // | // | 
| 4632 | // | // | 
| 4633 | if ( level.file == 2 ){ | if ( level.file == 2 ){ | 
| 4634 | for ( Int_t j = 0; j<3; j++ ) { | for ( Int_t j = 0; j<3; j++ ) { | 
| 4635 | if ( L2->S4adc != 32. ) ms4[j] = L2->S4calibrated; | if ( L2->GetS4Level2()->S4adc != 32. ) ms4[j] = L2->GetS4Level2()->S4calibrated; | 
| 4636 | }; | }; | 
| 4637 | }; | }; | 
| 4638 | // | // | 
| 4717 | }; | }; | 
| 4718 | }; | }; | 
| 4719 | if ( level.file == 2 ){ | if ( level.file == 2 ){ | 
| 4720 | yUpperTrig = (Int_t)L2->trigPhysics; | yUpperTrig = (Int_t)L2->GetNDLevel2()->trigPhysics; | 
| 4721 | yUpperBk = (Int_t)L2->upperBack; | yUpperBk = (Int_t)L2->GetNDLevel2()->upperBack; | 
| 4722 | yBottomBk = (Int_t)L2->bottomBack; | yBottomBk = (Int_t)L2->GetNDLevel2()->bottomBack; | 
| 4723 | }; | }; | 
| 4724 | // | // | 
| 4725 | var.trup = yUpperTrig; | var.trup = yUpperTrig; | 
| 5026 | // | // | 
| 5027 | // singlets X | // singlets X | 
| 5028 | // | // | 
| 5029 | for (Int_t sing = 0; sing < L2->nclsx(); sing++){ | for (Int_t sing = 0; sing < L2->GetTrkLevel2()->nclsx(); sing++){ | 
| 5030 | TClonesArray &t = *(L2->SingletX); | TClonesArray &t = *(L2->GetTrkLevel2()->SingletX); | 
| 5031 | TrkSinglet *singlet = (TrkSinglet*)t[sing]; | TrkSinglet *singlet = (TrkSinglet*)t[sing]; | 
| 5032 | x = (singlet->coord[0]+singlet->coord[1])/2.; | x = (singlet->coord[0]+singlet->coord[1])/2.; | 
| 5033 | // | // | 
| 5051 | // | // | 
| 5052 | // singlets Y | // singlets Y | 
| 5053 | // | // | 
| 5054 | for (Int_t sing = 0; sing < L2->nclsy(); sing++){ | for (Int_t sing = 0; sing < L2->GetTrkLevel2()->nclsy(); sing++){ | 
| 5055 | TClonesArray &t = *(L2->SingletY); | TClonesArray &t = *(L2->GetTrkLevel2()->SingletY); | 
| 5056 | TrkSinglet *singlet = (TrkSinglet*)t[sing]; | TrkSinglet *singlet = (TrkSinglet*)t[sing]; | 
| 5057 | // | // | 
| 5058 | Int_t planepad = (singlet->plane - 1)* 2; | Int_t planepad = (singlet->plane - 1)* 2; | 
| 5097 | dcol = 2; | dcol = 2; | 
| 5098 | }; | }; | 
| 5099 | // | // | 
| 5100 | if ( L2->GetNTracks() > 0 ){ | if ( L2->GetTrkLevel2()->GetNTracks() > 0 ){ | 
| 5101 | for (Int_t nt = 0; nt < L2->GetNTracks(); nt++){ | for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ | 
| 5102 | TrkTrack *track = L2->GetTrack(nt); | PamTrack *ptrack= L2->GetTrack(nt); | 
| 5103 |  | TrkTrack *track = ptrack->GetTrkTrack(); | 
| 5104 | if ( nt == 0 ){ | if ( nt == 0 ){ | 
| 5105 | var.rig = 0.; | var.rig = 0.; | 
| 5106 | if ( track->al[4] != 0. ) var.rig = 1./track->al[4]; | if ( track->al[4] != 0. ) var.rig = 1./track->al[4]; | 
| 5196 | // | // | 
| 5197 | // first of all plot crosses relatives to tracks | // first of all plot crosses relatives to tracks | 
| 5198 | // | // | 
| 5199 | if ( L2->GetNTracks() > 0 ){ | if ( L2->GetTrkLevel2()->GetNTracks() > 0 ){ | 
| 5200 | for (Int_t nt = 0; nt < L2->GetNTracks(); nt++){ | //      for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ | 
| 5201 | TrkTrack *track = L2->GetTrack(nt); | //        TrkTrack *track = L2->GetTrkLevel2()->GetTrack(nt); | 
| 5202 |  | for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ | 
| 5203 |  | PamTrack *ptrack= L2->GetTrack(nt); | 
| 5204 |  | TrkTrack *track = ptrack->GetTrkTrack(); | 
| 5205 |  | // | 
| 5206 | for (Int_t plane = 0; plane<6; plane++){ | for (Int_t plane = 0; plane<6; plane++){ | 
| 5207 | // | // | 
| 5208 | x = track->xm[plane]; | x = track->xm[plane]; | 
| 5248 | // | // | 
| 5249 | // try to plot crosses relative to singlets | // try to plot crosses relative to singlets | 
| 5250 | // | // | 
| 5251 | if ( L2->nclsx() > 0 && L2->nclsy() > 0 ){ | if ( L2->GetTrkLevel2()->nclsx() > 0 && L2->GetTrkLevel2()->nclsy() > 0 ){ | 
| 5252 | for (Int_t plane = 1; plane<7; plane++){ | for (Int_t plane = 1; plane<7; plane++){ | 
| 5253 | // | // | 
| 5254 | // count how many singlet in the x and y view for this plane: | // count how many singlet in the x and y view for this plane: | 
| 5262 | TArrayF *array2 = new TArrayF(5000); | TArrayF *array2 = new TArrayF(5000); | 
| 5263 | TArrayF *sigarrax = new TArrayF(5000); | TArrayF *sigarrax = new TArrayF(5000); | 
| 5264 | TArrayF *sigarray = new TArrayF(5000); | TArrayF *sigarray = new TArrayF(5000); | 
| 5265 | for (Int_t sing = 0; sing < L2->nclsx(); sing++){ | for (Int_t sing = 0; sing < L2->GetTrkLevel2()->nclsx(); sing++){ | 
| 5266 | TClonesArray &t = *(L2->SingletX); | TClonesArray &t = *(L2->GetTrkLevel2()->SingletX); | 
| 5267 | TrkSinglet *singlet = (TrkSinglet*)t[sing]; | TrkSinglet *singlet = (TrkSinglet*)t[sing]; | 
| 5268 | if ( singlet->plane == plane ){ | if ( singlet->plane == plane ){ | 
| 5269 | arrax->AddAt(((singlet->coord[0]+singlet->coord[1])/2.),totsx); | arrax->AddAt(((singlet->coord[0]+singlet->coord[1])/2.),totsx); | 
| 5292 | totsx++; | totsx++; | 
| 5293 | }; | }; | 
| 5294 | }; | }; | 
| 5295 | for (Int_t sing = 0; sing < L2->nclsy(); sing++){ | for (Int_t sing = 0; sing < L2->GetTrkLevel2()->nclsy(); sing++){ | 
| 5296 | TClonesArray &t = *(L2->SingletY); | TClonesArray &t = *(L2->GetTrkLevel2()->SingletY); | 
| 5297 | TrkSinglet *singlet = (TrkSinglet*)t[sing]; | TrkSinglet *singlet = (TrkSinglet*)t[sing]; | 
| 5298 | if ( singlet->plane == plane ){ | if ( singlet->plane == plane ){ | 
| 5299 | array1->AddAt(singlet->coord[0],totsy); | array1->AddAt(singlet->coord[0],totsy); | 
| 5516 |  |  | 
| 5517 | void FEVdetector::ShowTrack(){ | void FEVdetector::ShowTrack(){ | 
| 5518 | // | // | 
| 5519 |  | if ( level.file != 2 ) return; | 
| 5520 |  | // | 
| 5521 |  | // | 
| 5522 | // | // | 
| 5523 |  | if ( var.CALO && var.CALOT ){ | 
| 5524 |  | if ( L2->GetCaloLevel2()->npcfit[0] > 0 && L2->GetCaloLevel2()->npcfit[1] > 0 ){ | 
| 5525 |  | Float_t calx[22]; | 
| 5526 |  | Float_t caly[22]; | 
| 5527 |  | Float_t calzx[22]; | 
| 5528 |  | Float_t calzy[22]; | 
| 5529 |  | Float_t zpiano[22]; | 
| 5530 |  | zpiano[0] = (CTZ+118.)*var.sfy/1000.; | 
| 5531 |  | for (Int_t plane = 1; plane < 22; plane++){ | 
| 5532 |  | if ( !(plane%2) ){ | 
| 5533 |  | zpiano[plane] = zpiano[plane-1] - 8.09*var.sfy/1000.; | 
| 5534 |  | }else { | 
| 5535 |  | zpiano[plane] = zpiano[plane-1] - 10.09*var.sfy/1000.; | 
| 5536 |  | }; | 
| 5537 |  | }; | 
| 5538 |  | for (Int_t plane = 0; plane < 22; plane++){ | 
| 5539 |  | calx[plane] = (L2->GetCaloLevel2()->cbar[plane][0]/100.)*var.sfx + var.xxvc;; | 
| 5540 |  | caly[plane] = (L2->GetCaloLevel2()->cbar[plane][1]/100.)*var.sfx + var.xyvc; | 
| 5541 |  | //      calzx[plane] = zpiano[plane] -5.81*var.sfy/1000. + var.yxvc; | 
| 5542 |  | calzx[plane] = zpiano[plane] + var.yxvc; | 
| 5543 |  | calzy[plane] = zpiano[plane] + var.yyvc; | 
| 5544 |  | //      printf(" calx %f caly %f calzx %f calzy %f \n",calx[plane],caly[plane],calzx[plane],calzy[plane]); | 
| 5545 |  | }; | 
| 5546 |  | // | 
| 5547 |  | // Calorimeter track | 
| 5548 |  | // | 
| 5549 |  | Int_t trcol = 30; | 
| 5550 |  | if ( var.bw ){ | 
| 5551 |  | trcol = 14; | 
| 5552 |  | } else { | 
| 5553 |  | trcol = 44; | 
| 5554 |  | }; | 
| 5555 |  | thefigure->cd(); | 
| 5556 |  | TPolyLine *trakx = new TPolyLine(22,calx,calzx); | 
| 5557 |  | trakx->SetLineColor(trcol); | 
| 5558 |  | if ( L2->GetCaloLevel2()->fitmode[0] == 1 ) trakx->SetLineStyle(3); | 
| 5559 |  | if ( L2->GetCaloLevel2()->fitmode[0] == 2 ) trakx->SetLineStyle(4); | 
| 5560 |  | trakx->SetLineWidth(2); | 
| 5561 |  | trakx->Draw(); | 
| 5562 |  | TPolyLine *traky = new TPolyLine(22,caly,calzy); | 
| 5563 |  | traky->SetLineColor(trcol); | 
| 5564 |  | if ( L2->GetCaloLevel2()->fitmode[1] == 1 ) traky->SetLineStyle(3); | 
| 5565 |  | if ( L2->GetCaloLevel2()->fitmode[1] == 2 ) traky->SetLineStyle(4); | 
| 5566 |  | traky->SetLineWidth(2); | 
| 5567 |  | traky->Draw(); | 
| 5568 |  | }; | 
| 5569 |  | if ( L2->GetCaloLevel2()->npcfit[2] > 0 ){ | 
| 5570 |  | Float_t calx[22]; | 
| 5571 |  | Float_t caly[22]; | 
| 5572 |  | Float_t calzx[22]; | 
| 5573 |  | Float_t calzy[22]; | 
| 5574 |  | Float_t zpiano[22]; | 
| 5575 |  | zpiano[0] = (CTZ+118.)*var.sfy/1000.; | 
| 5576 |  | for (Int_t plane = 1; plane < 22; plane++){ | 
| 5577 |  | if ( !(plane%2) ){ | 
| 5578 |  | zpiano[plane] = zpiano[plane-1] - 8.09*var.sfy/1000.; | 
| 5579 |  | }else { | 
| 5580 |  | zpiano[plane] = zpiano[plane-1] - 10.09*var.sfy/1000.; | 
| 5581 |  | }; | 
| 5582 |  | }; | 
| 5583 |  | // | 
| 5584 |  | // | 
| 5585 |  | CaloTrkVar *ctra = L2->GetCaloStoredTrack(-1); | 
| 5586 |  | // | 
| 5587 |  | for (Int_t plane = 0; plane < 22; plane++){ | 
| 5588 |  | calx[plane] = (ctra->tbar[plane][0]/100.)*var.sfx + var.xxvc;; | 
| 5589 |  | caly[plane] = (ctra->tbar[plane][1]/100.)*var.sfx + var.xyvc; | 
| 5590 |  | //      calzx[plane] = zpiano[plane] -5.81*var.sfy/1000. + var.yxvc; | 
| 5591 |  | calzx[plane] = zpiano[plane] + var.yxvc; | 
| 5592 |  | calzy[plane] = zpiano[plane] + var.yyvc; | 
| 5593 |  | //      printf(" calx %f caly %f calzx %f calzy %f \n",calx[plane],caly[plane],calzx[plane],calzy[plane]); | 
| 5594 |  | }; | 
| 5595 |  | // | 
| 5596 |  | // Calorimeter track | 
| 5597 |  | // | 
| 5598 |  | Int_t trcol = 30; | 
| 5599 |  | if ( var.bw ){ | 
| 5600 |  | trcol = 16; | 
| 5601 |  | } else { | 
| 5602 |  | trcol = 46; | 
| 5603 |  | }; | 
| 5604 |  | thefigure->cd(); | 
| 5605 |  | TPolyLine *trakx = new TPolyLine(22,calx,calzx); | 
| 5606 |  | trakx->SetLineColor(trcol); | 
| 5607 |  | trakx->SetLineStyle(3); | 
| 5608 |  | trakx->SetLineWidth(2); | 
| 5609 |  | trakx->Draw(); | 
| 5610 |  | TPolyLine *traky = new TPolyLine(22,caly,calzy); | 
| 5611 |  | traky->SetLineColor(trcol); | 
| 5612 |  | traky->SetLineStyle(3); | 
| 5613 |  | traky->SetLineWidth(2); | 
| 5614 |  | traky->Draw(); | 
| 5615 |  | }; | 
| 5616 |  | }; | 
| 5617 | // | // | 
| 5618 | if ( !var.TRK || level.file != 2 ) return; | if ( !var.TRK ) return; | 
| 5619 | // | // | 
| 5620 | if ( L2->GetNTracks() > 0 ){ | if ( L2->GetTrkLevel2()->GetNTracks() > 0 ){ | 
| 5621 | for (Int_t nt = 0; nt < L2->GetNTracks(); nt++){ | for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ | 
| 5622 | TrkTrack *track = L2->GetTrack(nt); |  | 
| 5623 |  | //      TrkTrack *track = L2->GetTrkLevel2()->GetTrack(nt); | 
| 5624 |  | //      printf("qui \n"); | 
| 5625 |  | PamTrack *ptrack = L2->GetTrack(nt); | 
| 5626 |  | TrkTrack *track = ptrack->GetTrkTrack(); | 
| 5627 |  | //      printf("qua \n"); | 
| 5628 | Int_t npoint = 100; | Int_t npoint = 100; | 
| 5629 | Float_t zin[100]; | Float_t zin[100]; | 
| 5630 | Double_t xout[100]; | Double_t xout[100]; | 
| 5694 | }; | }; | 
| 5695 | tzx[e] = (0.112)*var.sfy+((float)zin[e]/100.)*var.sfy + var.yxvc; | tzx[e] = (0.112)*var.sfy+((float)zin[e]/100.)*var.sfy + var.yxvc; | 
| 5696 | tzy[e] = (0.112)*var.sfy+((float)zin[e]/100.)*var.sfy + var.yyvc; | tzy[e] = (0.112)*var.sfy+((float)zin[e]/100.)*var.sfy + var.yyvc; | 
| 5697 |  | //      printf("tx[e] %f ty [e] %f tzx %f tzy %f \n",tx[e],ty[e],tzx[e],tzy[e]); | 
| 5698 | }; | }; | 
| 5699 | // | // | 
| 5700 | // From S1 to CALO | // From S1 to CALO | 
| 5832 | Int_t se = 5; | Int_t se = 5; | 
| 5833 | if ( !l && m%2 == 0 ) se = 3; | if ( !l && m%2 == 0 ) se = 3; | 
| 5834 | if ( !l && m%2 != 0 ) se = 2; | if ( !l && m%2 != 0 ) se = 2; | 
| 5835 | if (  l && m%2 == 0 ) se = 1; | if (  l && m%2 != 0 ) se = 1; | 
| 5836 | if (  l && m%2 != 0 ) se = 0; | if (  l && m%2 == 0 ) se = 0; | 
| 5837 | // | // | 
| 5838 | // determine what kind of event we are going to analyze | // determine what kind of event we are going to analyze | 
| 5839 | // | // | 
| 5948 | // | // | 
| 5949 | // Define variables | // Define variables | 
| 5950 | // | // | 
| 5951 | Int_t etime = var.etime; | UInt_t etime = var.etime; | 
| 5952 | 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]; | 
| 5953 | Int_t badstrip = 0; | Int_t badstrip = 0; | 
| 5954 | qtot = 0.; | qtot = 0.; | 
| 6020 | if ( calib.ttime[s][b[s]+1] && calib.time[s][b[s]] ){ | if ( calib.ttime[s][b[s]+1] && calib.time[s][b[s]] ){ | 
| 6021 | 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 ){ | 
| 6022 | printf(" CALORIMETER: \n" ); | printf(" CALORIMETER: \n" ); | 
| 6023 | 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]); | 
| 6024 | printf(" END CALORIMETER. \n\n" ); | printf(" END CALORIMETER. \n\n" ); | 
| 6025 | b[s]++; | b[s]++; | 
| 6026 | CaloPede(s); | CaloPede(s); | 
| 6040 | Int_t se = 5; | Int_t se = 5; | 
| 6041 | if (l == 0 && m%2 == 0) se = 3; | if (l == 0 && m%2 == 0) se = 3; | 
| 6042 | if (l == 0 && m%2 != 0) se = 2; | if (l == 0 && m%2 != 0) se = 2; | 
| 6043 | if (l == 1 && m%2 == 0) se = 1; | if (l == 1 && m%2 != 0) se = 1; | 
| 6044 | if (l == 1 && m%2 != 0) se = 0; | if (l == 1 && m%2 == 0) se = 0; | 
| 6045 | // | // | 
| 6046 | // determine what kind of event we are going to analyze | // determine what kind of event we are going to analyze | 
| 6047 | // | // | 
| 6244 | // | // | 
| 6245 | stringstream xvev; | stringstream xvev; | 
| 6246 | stringstream yvev; | stringstream yvev; | 
| 6247 | for (Int_t ii = 0; ii < L2->nstrip; ii++){ | for (Int_t ii = 0; ii < L2->GetCaloLevel2()->nstrip; ii++){ | 
| 6248 | Int_t colo; | Int_t colo; | 
| 6249 | Int_t l; | Int_t l; | 
| 6250 | Int_t m; | Int_t m; | 
| 6251 | Int_t n; | Int_t n; | 
| 6252 | Float_t mip = L2->DecodeEstrip(ii,l,m,n); | Float_t mip = L2->GetCaloLevel1()->DecodeEstrip(ii,l,m,n); | 
| 6253 | if ( var.bw ){ | if ( var.bw ){ | 
| 6254 | colo = -1; | colo = -1; | 
| 6255 | } else { | } else { | 
| 6283 | }; | }; | 
| 6284 | pd1->Update(); | pd1->Update(); | 
| 6285 | pd2->Update(); | pd2->Update(); | 
| 6286 | var.qtot=(int)L2->qtot; | var.qtot=(int)L2->GetCaloLevel2()->qtot; | 
| 6287 | var.nstrip=(int)L2->nstrip; | var.nstrip=(int)L2->GetCaloLevel2()->nstrip; | 
| 6288 | }; | }; | 
| 6289 | } | } | 
| 6290 |  |  | 
| 6325 | for (Int_t d = 0; d<48; d++){ | for (Int_t d = 0; d<48; d++){ | 
| 6326 | if ( calib.ttime[s][d] != 0 ) calibex++; | if ( calib.ttime[s][d] != 0 ) calibex++; | 
| 6327 | if ( calib.time[s][0] != 0 ){ | if ( calib.time[s][0] != 0 ){ | 
| 6328 | 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]); | 
| 6329 | if ( calib.time[s][d+1] != 0 ) { | if ( calib.time[s][d+1] != 0 ) { | 
| 6330 | 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]); | 
| 6331 | } else { | } else { | 
| 6332 | if ( !stop ){ | if ( !stop ){ | 
| 6333 | 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]); | 
| 6334 | stop = 1; | stop = 1; | 
| 6335 | }; | }; | 
| 6336 | }; | }; | 
| 6337 | } else { | } else { | 
| 6338 | 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]); | 
| 6339 | }; | }; | 
| 6340 | }; | }; | 
| 6341 | printf("\n"); | printf("\n"); | 
| 6400 | calib.ttime[s][inter] = 0; | calib.ttime[s][inter] = 0; | 
| 6401 | if ( ce->cstwerr[s] != 0 && ce->cperror[s] == 0 ) { | if ( ce->cstwerr[s] != 0 && ce->cperror[s] == 0 ) { | 
| 6402 | //calib.ttime[s][inter] = cph->GetOrbitalTime(); | //calib.ttime[s][inter] = cph->GetOrbitalTime(); | 
| 6403 | calib.ttime[s][inter] = cph->OrbitalTime; | calib.ttime[s][inter] = (UInt_t)cph->OrbitalTime; | 
| 6404 | inter++; | inter++; | 
| 6405 | } else { | } else { | 
| 6406 | if ( ce->cstwerr[s] != 0 && ce->cperror[s] != 0 ) { | if ( ce->cstwerr[s] != 0 && ce->cperror[s] != 0 ) { | 
| 6454 | tr->GetEntry(ci); | tr->GetEntry(ci); | 
| 6455 | cph = ceh->GetPscuHeader(); | cph = ceh->GetPscuHeader(); | 
| 6456 | //if ( atime == cph->GetOrbitalTime()){ | //if ( atime == cph->GetOrbitalTime()){ | 
| 6457 | if ( atime == cph->OrbitalTime){ | if ( atime == (UInt_t)cph->OrbitalTime){ | 
| 6458 | //      calib.iev = ce->iev; | //      calib.iev = ce->iev; | 
| 6459 | if (ce->cstwerr[s] != 0 && ce->cperror[s] == 0 ) { | if (ce->cstwerr[s] != 0 && ce->cperror[s] == 0 ) { | 
| 6460 | for ( Int_t d=0 ; d<11 ;d++  ){ | for ( Int_t d=0 ; d<11 ;d++  ){ |