/[PAMELA software]/eventviewer/flight/src/FEVdetector.cpp
ViewVC logotype

Diff of /eventviewer/flight/src/FEVdetector.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.21 by mocchiut, Thu Nov 8 11:05:34 2007 UTC revision 1.34 by mocchiut, Tue Jan 3 20:53:29 2012 UTC
# Line 72  char* operator+( std::streampos&, char* Line 72  char* operator+( std::streampos&, char*
72  #include <color.h>  #include <color.h>
73  //  //
74  extern Bool_t existfile(TString);  extern Bool_t existfile(TString);
75    extern Bool_t NODB;
76  //  //
77    
78  using namespace std;  using namespace std;
# Line 97  FEVdetector::FEVdetector(TString filenam Line 98  FEVdetector::FEVdetector(TString filenam
98    var.showac = false;    var.showac = false;
99  }  }
100    
101    void FEVdetector::Reset(){
102      L2 = NULL;
103    }
104    
105  void FEVdetector::checkctrlword(){  void FEVdetector::checkctrlword(){
106    var.SHOWDEC = 0;    var.SHOWDEC = 0;
107    var.TOF = 0;    var.TOF = 0;
# Line 206  void FEVdetector::ClearVariables(){ Line 211  void FEVdetector::ClearVariables(){
211  void FEVdetector::GetEntry(Int_t i){  void FEVdetector::GetEntry(Int_t i){
212    thisentry = i;      thisentry = i;  
213    if ( level.file == 2 ){    if ( level.file == 2 ){
214      L2->Clear();      //    L2->Clear();
215      //    printf("qui\n");      //    printf("qui\n");
216      L2->GetEntry(i);      L2->GetEntry(i);
217      if ( var.showall ){      if ( var.showall ){
# Line 394  void FEVdetector::ShowInfo(TString detec Line 399  void FEVdetector::ShowInfo(TString detec
399    Int_t dlen = 10;    Int_t dlen = 10;
400    //    //
401    char o[200000];    char o[200000];
402      char zz[200000];
403    char col[13];    char col[13];
404    char col2[13];    char col2[13];
405    //    //
406    setcolor(col,RESET, GREEN, WHITE);    setcolor(col,RESET, GREEN, WHITE);
407    sprintf(o,"%s======> EVENT:%i\n",col, thisentry);    sprintf(o,"%s======> EVENT:%i\n",col, thisentry);
408      sprintf(zz,"======> EVENT:%i\n", thisentry);
409    //    //
410    setcolor(col,RESET, RED, WHITE);    setcolor(col,RESET, RED, WHITE);
411    sprintf(o,"%s%sBranch %s\n",o,col,b1->GetName());    sprintf(o,"%s%sBranch %s\n",o,col,b1->GetName());
412      sprintf(zz,"%sBranch %s\n",zz,b1->GetName());
413    setcolor(col,RESET, BLACK, WHITE);    setcolor(col,RESET, BLACK, WHITE);
414    sprintf(o,"%s%s",o,col);    sprintf(o,"%s%s",o,col);
415    //    //
# Line 429  void FEVdetector::ShowInfo(TString detec Line 437  void FEVdetector::ShowInfo(TString detec
437        setcolor(col,RESET, BLUE, WHITE);        setcolor(col,RESET, BLUE, WHITE);
438        setcolor(col2,RESET, BLACK, WHITE);        setcolor(col2,RESET, BLACK, WHITE);
439        sprintf(o,"%s%s %-15s%s =",o,col,((TBranch*)branch_array->At(l))->GetName(),col2);        sprintf(o,"%s%s %-15s%s =",o,col,((TBranch*)branch_array->At(l))->GetName(),col2);
440          sprintf(zz,"%s %-15s =",zz,((TBranch*)branch_array->At(l))->GetName());
441        //        //
442        j = 0;        j = 0;
443        //        //
# Line 441  void FEVdetector::ShowInfo(TString detec Line 450  void FEVdetector::ShowInfo(TString detec
450          while ( j < length ){          while ( j < length ){
451            if ( j < length -1 ){            if ( j < length -1 ){
452              sprintf(o,"%s %i ,",o,(Int_t)tb->GetValue(j,0));              sprintf(o,"%s %i ,",o,(Int_t)tb->GetValue(j,0));
453                sprintf(zz,"%s %i ,",zz,(Int_t)tb->GetValue(j,0));
454            } else {            } else {
455              sprintf(o,"%s %i",o,(Int_t)tb->GetValue(j,0));              sprintf(o,"%s %i",o,(Int_t)tb->GetValue(j,0));
456                sprintf(zz,"%s %i",zz,(Int_t)tb->GetValue(j,0));
457            };            };
458            j++;            j++;
459          };          };
# Line 454  void FEVdetector::ShowInfo(TString detec Line 465  void FEVdetector::ShowInfo(TString detec
465          while ( j < length ){          while ( j < length ){
466            if ( j < length -1 ){            if ( j < length -1 ){
467              sprintf(o,"%s %u ,",o,(UInt_t)tb->GetValue(j,0));              sprintf(o,"%s %u ,",o,(UInt_t)tb->GetValue(j,0));
468                sprintf(zz,"%s %u ,",zz,(UInt_t)tb->GetValue(j,0));
469            } else {            } else {
470              sprintf(o,"%s %u",o,(UInt_t)tb->GetValue(j,0));              sprintf(o,"%s %u",o,(UInt_t)tb->GetValue(j,0));
471                sprintf(zz,"%s %u",zz,(UInt_t)tb->GetValue(j,0));
472            };            };
473            j++;            j++;
474          };          };
# Line 467  void FEVdetector::ShowInfo(TString detec Line 480  void FEVdetector::ShowInfo(TString detec
480          while ( j < length ){          while ( j < length ){
481            if ( j < length -1 ){            if ( j < length -1 ){
482              sprintf(o,"%s %f ,",o,tb->GetValue(j,0));              sprintf(o,"%s %f ,",o,tb->GetValue(j,0));
483                sprintf(zz,"%s %f ,",zz,tb->GetValue(j,0));
484            } else {            } else {
485              sprintf(o,"%s %f",o,tb->GetValue(j,0));              sprintf(o,"%s %f",o,tb->GetValue(j,0));
486                sprintf(zz,"%s %f",zz,tb->GetValue(j,0));
487            };            };
488            j++;            j++;
489          };          };
# Line 503  void FEVdetector::ShowInfo(TString detec Line 518  void FEVdetector::ShowInfo(TString detec
518  //        printf("ciao %s \n",pr->Data());  //        printf("ciao %s \n",pr->Data());
519  //      };  //      };
520          sprintf(o,"%s TString - not implemented yet -",o);          sprintf(o,"%s TString - not implemented yet -",o);
521            sprintf(zz,"%s TString - not implemented yet -",zz);
522        };        };
523        //        //
524        // TArray        // TArray
# Line 603  void FEVdetector::ShowInfo(TString detec Line 619  void FEVdetector::ShowInfo(TString detec
619  //      sprintf(o,"%s\n",o);  //      sprintf(o,"%s\n",o);
620          //                //      
621          sprintf(o,"%s TArray - not implemented yet -",o);          sprintf(o,"%s TArray - not implemented yet -",o);
622            sprintf(zz,"%s TArray - not implemented yet -",zz);
623          //          //
624        };        };
625        //        //
626        sprintf(o,"%s\n",o);        sprintf(o,"%s\n",o);
627          sprintf(zz,"%s\n",zz);
628        break;        break;
629      case 3:      case 3:
630        //        //
# Line 615  void FEVdetector::ShowInfo(TString detec Line 633  void FEVdetector::ShowInfo(TString detec
633        setcolor(col,RESET, BLUE, WHITE);        setcolor(col,RESET, BLUE, WHITE);
634        setcolor(col2,RESET, BLACK, WHITE);        setcolor(col2,RESET, BLACK, WHITE);
635        sprintf(o,"%s%s %-15s%s = %d\n",o,col,tb->GetName(), col2, tb->GetNdata());        sprintf(o,"%s%s %-15s%s = %d\n",o,col,tb->GetName(), col2, tb->GetNdata());
636          sprintf(zz,"%s %-15s = %d\n",zz,tb->GetName(), tb->GetNdata());
637    
638        //        //
639        if ( tb->GetNdata() ){        if ( tb->GetNdata() ){
# Line 665  void FEVdetector::ShowInfo(TString detec Line 684  void FEVdetector::ShowInfo(TString detec
684                  setcolor(col,RESET, BLUE, WHITE);                  setcolor(col,RESET, BLUE, WHITE);
685                  setcolor(col2,RESET, BLACK, WHITE);                  setcolor(col2,RESET, BLACK, WHITE);
686                  sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2);                  sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2);
687                    sprintf(zz,"%s %-15s = ",zz,foglia->GetName());
688                  while ( j < cl->GetEntriesFast() ){                  while ( j < cl->GetEntriesFast() ){
689                    if ( j < cl->GetEntriesFast() -1 ){                    if ( j < cl->GetEntriesFast() -1 ){
690                      sprintf(o,"%s %i ,",o,(Int_t)stb->GetValue(j,slength));                      sprintf(o,"%s %i ,",o,(Int_t)stb->GetValue(j,slength));
691                        sprintf(zz,"%s %i ,",zz,(Int_t)stb->GetValue(j,slength));
692                    } else {                    } else {
693                      sprintf(o,"%s %i",o,(Int_t)stb->GetValue(j,slength));                      sprintf(o,"%s %i",o,(Int_t)stb->GetValue(j,slength));
694                        sprintf(zz,"%s %i",zz,(Int_t)stb->GetValue(j,slength));
695                    };                    };
696                    j++;                    j++;
697                  };                  };
# Line 682  void FEVdetector::ShowInfo(TString detec Line 704  void FEVdetector::ShowInfo(TString detec
704                  setcolor(col,RESET, BLUE, WHITE);                  setcolor(col,RESET, BLUE, WHITE);
705                  setcolor(col2,RESET, BLACK, WHITE);                  setcolor(col2,RESET, BLACK, WHITE);
706                  sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2);                  sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2);
707                    sprintf(zz,"%s %-15s = ",zz,foglia->GetName());
708                  while ( j < cl->GetEntriesFast() ){                  while ( j < cl->GetEntriesFast() ){
709                    if ( j < cl->GetEntriesFast() -1 ){                    if ( j < cl->GetEntriesFast() -1 ){
710                      sprintf(o,"%s %f ,",o,stb->GetValue(j,slength));                      sprintf(o,"%s %f ,",o,stb->GetValue(j,slength));
711                        sprintf(zz,"%s %f ,",zz,stb->GetValue(j,slength));
712                    } else {                    } else {
713                      sprintf(o,"%s %f",o,stb->GetValue(j,slength));                      sprintf(o,"%s %f",o,stb->GetValue(j,slength));
714                        sprintf(zz,"%s %f",zz,stb->GetValue(j,slength));
715                    };                    };
716                    j++;                    j++;
717                  };                  };
# Line 699  void FEVdetector::ShowInfo(TString detec Line 724  void FEVdetector::ShowInfo(TString detec
724                  setcolor(col,RESET, BLUE, WHITE);                  setcolor(col,RESET, BLUE, WHITE);
725                  setcolor(col2,RESET, BLACK, WHITE);                  setcolor(col2,RESET, BLACK, WHITE);
726                  sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2);                  sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2);
727                    sprintf(zz,"%s %-15s = ",zz,foglia->GetName());
728                  Bool_t bold = true;                  Bool_t bold = true;
729                  while ( j < tb->GetNdata() ){                  while ( j < tb->GetNdata() ){
730                    if ( bold ){                    if ( bold ){
# Line 712  void FEVdetector::ShowInfo(TString detec Line 738  void FEVdetector::ShowInfo(TString detec
738                    while ( jj < slength ){                                      while ( jj < slength ){                  
739                      if ( jj < slength-1 ){                      if ( jj < slength-1 ){
740                        sprintf(o,"%s %f ,",o,stb->GetValue(j,jj,true));                        sprintf(o,"%s %f ,",o,stb->GetValue(j,jj,true));
741                          sprintf(zz,"%s %f ,",zz,stb->GetValue(j,jj,true));
742                      } else {                      } else {
743                        sprintf(o,"%s %f",o,stb->GetValue(j,jj,true));                        sprintf(o,"%s %f",o,stb->GetValue(j,jj,true));
744                          sprintf(zz,"%s %f",zz,stb->GetValue(j,jj,true));
745                      };                      };
746                      jj++;                      jj++;
747                    };                    };
748                    if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o);                    if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o);
749                      if ( j < tb->GetNdata() -1 ) sprintf(zz,"%s ,",zz);
750                    if ( !bold ){                    if ( !bold ){
751                      bold = true;                      bold = true;
752                    } else {                    } else {
# Line 738  void FEVdetector::ShowInfo(TString detec Line 767  void FEVdetector::ShowInfo(TString detec
767                  setcolor(col,RESET, BLUE, WHITE);                  setcolor(col,RESET, BLUE, WHITE);
768                  setcolor(col2,RESET, BLACK, WHITE);                  setcolor(col2,RESET, BLACK, WHITE);
769                  sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2);                  sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2);
770                    sprintf(zz,"%s %-15s = ",zz,foglia->GetName());
771                  while ( j < tb->GetNdata() ){                  while ( j < tb->GetNdata() ){
772                    Int_t jj = 0;                    Int_t jj = 0;
773                    while ( jj < slength ){                    while ( jj < slength ){
774                      if ( jj < slength-1 ){                      if ( jj < slength-1 ){
775                        sprintf(o,"%s %i ,",o,(Int_t)stb->GetValue(j,jj,true));                        sprintf(o,"%s %i ,",o,(Int_t)stb->GetValue(j,jj,true));
776                          sprintf(zz,"%s %i ,",zz,(Int_t)stb->GetValue(j,jj,true));
777                      } else {                      } else {
778                        sprintf(o,"%s %i",o,(Int_t)stb->GetValue(j,jj,true));                        sprintf(o,"%s %i",o,(Int_t)stb->GetValue(j,jj,true));
779                          sprintf(zz,"%s %i",zz,(Int_t)stb->GetValue(j,jj,true));
780                      };                      };
781                      jj++;                      jj++;
782                    };                    };
783                    if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o);                    if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o);
784                      if ( j < tb->GetNdata() -1 ) sprintf(zz,"%s ,",zz);
785                    j++;                    j++;
786                  };                  };
787                };                };
# Line 781  void FEVdetector::ShowInfo(TString detec Line 814  void FEVdetector::ShowInfo(TString detec
814                    setcolor(col,RESET, BLUE, WHITE);                    setcolor(col,RESET, BLUE, WHITE);
815                    setcolor(col2,RESET, BLACK, WHITE);                    setcolor(col2,RESET, BLACK, WHITE);
816                    sprintf(o,"%s%s %s[%i]%s = ",o,col,foglia->GetName(),arr->GetSize(),col2);                    sprintf(o,"%s%s %s[%i]%s = ",o,col,foglia->GetName(),arr->GetSize(),col2);
817                      sprintf(zz,"%s %s[%i] = ",zz,foglia->GetName(),arr->GetSize());
818                    //                    //
819                    while ( j < tb->GetNdata() ){                    while ( j < tb->GetNdata() ){
820                      //                      //
# Line 791  void FEVdetector::ShowInfo(TString detec Line 825  void FEVdetector::ShowInfo(TString detec
825                      while ( jj < arlen ){                      while ( jj < arlen ){
826                        if ( jj < arlen-1 ){                        if ( jj < arlen-1 ){
827                          sprintf(o,"%s %i ,",o,arr->At(jj));                          sprintf(o,"%s %i ,",o,arr->At(jj));
828                            sprintf(zz,"%s %i ,",zz,arr->At(jj));
829                        } else {                        } else {
830                          sprintf(o,"%s %i",o,arr->At(jj));                          sprintf(o,"%s %i",o,arr->At(jj));
831                            sprintf(zz,"%s %i",zz,arr->At(jj));
832                        };                        };
833                        jj++;                        jj++;
834                      };                      };
835                      if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o);                      if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o);
836                        if ( j < tb->GetNdata() -1 ) sprintf(zz,"%s ,",zz);
837                      j++;                      j++;
838                    };                    };
839                  };                  };
# Line 814  void FEVdetector::ShowInfo(TString detec Line 851  void FEVdetector::ShowInfo(TString detec
851                    setcolor(col,RESET, BLUE, WHITE);                    setcolor(col,RESET, BLUE, WHITE);
852                    setcolor(col2,RESET, BLACK, WHITE);                    setcolor(col2,RESET, BLACK, WHITE);
853                    sprintf(o,"%s%s %s[%i]%s = ",o,col,foglia->GetName(),arr->GetSize(),col2);                    sprintf(o,"%s%s %s[%i]%s = ",o,col,foglia->GetName(),arr->GetSize(),col2);
854                      sprintf(zz,"%s %s[%i] = ",zz,foglia->GetName(),arr->GetSize());
855                    //                    //
856                    while ( j < tb->GetNdata() ){                    while ( j < tb->GetNdata() ){
857                      //                      //
# Line 824  void FEVdetector::ShowInfo(TString detec Line 862  void FEVdetector::ShowInfo(TString detec
862                      while ( jj < arlen ){                      while ( jj < arlen ){
863                        if ( jj < arlen-1 ){                        if ( jj < arlen-1 ){
864                          sprintf(o,"%s %f ,",o,arr->At(jj));                          sprintf(o,"%s %f ,",o,arr->At(jj));
865                            sprintf(zz,"%s %f ,",zz,arr->At(jj));
866                        } else {                        } else {
867                          sprintf(o,"%s %f",o,arr->At(jj));                          sprintf(o,"%s %f",o,arr->At(jj));
868                            sprintf(zz,"%s %f",zz,arr->At(jj));
869                        };                        };
870                        jj++;                        jj++;
871                      };                      };
872                      if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o);                      if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o);
873                        if ( j < tb->GetNdata() -1 ) sprintf(zz,"%s ,",zz);
874                      j++;                      j++;
875                    };                    };
876                  };                  };
877                };                };
878                sprintf(o,"%s\n",o);                sprintf(o,"%s\n",o);
879                  sprintf(zz,"%s\n",zz);
880                break;                        break;        
881              };              };
882            };            };
# Line 843  void FEVdetector::ShowInfo(TString detec Line 885  void FEVdetector::ShowInfo(TString detec
885        break;        break;
886      };      };
887    };      };  
   //  pamgui->DIALOG(0,o);  
888    printf("%s\n",o);    printf("%s\n",o);
889      pamgui->DIALOG(4,zz);
890  };  };
891    
892    
# Line 1016  int FEVdetector::SelectEvent(){ Line 1058  int FEVdetector::SelectEvent(){
1058        //        //
1059        if ( level.file == 2 ){        if ( level.file == 2 ){
1060          cintcom.str("");          cintcom.str("");
1061          cintcom << "PamLevel2 *L2 = (PamLevel2*)0x" << hex;          cintcom << "PamLevel2 *L2 = (PamLevel2*)" << hex; //con const e l2 funziona
1062          cintcom << L2;          cintcom << L2;
1063          gROOT->ProcessLine(cintcom.str().c_str());          gROOT->ProcessLine(cintcom.str().c_str());
1064            //      printf(" comando: %s \n",cintcom.str().c_str());
1065        } else {        } else {
1066          cintcom.str("");          cintcom.str("");
1067          cintcom << "TTree *otr = (TTree*)0x" << hex;          cintcom << "TTree *otr = (TTree*)" << hex;
1068          cintcom << otr;          cintcom << otr;
1069          gROOT->ProcessLine(cintcom.str().c_str());          gROOT->ProcessLine(cintcom.str().c_str());
1070          //          //
1071          cintcom.str("");          cintcom.str("");
1072          cintcom << "struct Variables &var = (struct Variables &)0x" << hex;          cintcom << "struct Variables &var = (struct Variables &)" << hex;
1073          cintcom << &var;          cintcom << &var;
1074          gROOT->ProcessLine(cintcom.str().c_str());          gROOT->ProcessLine(cintcom.str().c_str());
1075        };        };
# Line 1057  TChain* FEVdetector::Load(TString file){ Line 1100  TChain* FEVdetector::Load(TString file){
1100    //    //
1101    if ( level.file == 2 ){    if ( level.file == 2 ){
1102      //      //
1103      printf(" %s \n",ddec.Data());      //    printf(" %s \n",ddec.Data());
1104      if ( !L2 ){      if ( !L2 ){
1105        L2 = new PamLevel2("",file.Data(),ddec.Data());        L2 = new PamLevel2("",file.Data(),ddec.Data());
1106          if ( NODB ) L2->NoDBconnections();
1107        otr = L2->GetPamTree();        otr = L2->GetPamTree();
1108        printf(" l2 constructor\n");        //      printf(" l2 constructor\n");
1109        //      printf(" abst %u obt %u qtot %f \n",L2->GetOrbitalInfo()->absTime,L2->GetOrbitalInfo()->OBT,L2->GetCaloLevel2()->qtot);            //      printf(" abst %u obt %u qtot %f \n",L2->GetOrbitalInfo()->absTime,L2->GetOrbitalInfo()->OBT,L2->GetCaloLevel2()->qtot);    
1110      } else {      } else {
1111        //        //
1112        printf(" l2 already exist \n");        //      printf(" l2 already exist \n");
1113        otr = L2->GetPamTree(gSystem->DirName(file.Data()),file.Data(),ddec.Data());        otr = L2->GetPamTree(gSystem->DirName(file.Data()),file.Data(),ddec.Data());
1114        L2->GetRunTree(gSystem->DirName(file.Data()),file.Data());        L2->GetRunTree(gSystem->DirName(file.Data()),file.Data());
1115        //        //
# Line 1448  void FEVdetector::DisplayEvent(){ Line 1492  void FEVdetector::DisplayEvent(){
1492        text->DrawLatex(var.xxvc+0.17*var.sfx,var.yxvc-0.08*var.sfy,"CAS1");        text->DrawLatex(var.xxvc+0.17*var.sfx,var.yxvc-0.08*var.sfy,"CAS1");
1493        text->DrawLatex(var.xyvc-0.192*var.sfx,var.yyvc-0.08*var.sfy,"CAS4");        text->DrawLatex(var.xyvc-0.192*var.sfx,var.yyvc-0.08*var.sfy,"CAS4");
1494        text->DrawLatex(var.xyvc+0.17*var.sfx,var.yyvc-0.08*var.sfy,"CAS3");        text->DrawLatex(var.xyvc+0.17*var.sfx,var.yyvc-0.08*var.sfy,"CAS3");
1495        text->DrawLatex(var.xxvc-0.192*var.sfx,var.yxvc+0.48*var.sfy,"CARD2");        text->DrawLatex(var.xxvc-0.222*var.sfx,var.yxvc+0.48*var.sfy,"CARD2");
1496        text->DrawLatex(var.xxvc+0.155*var.sfx,var.yxvc+0.48*var.sfy,"CARD3");        text->DrawLatex(var.xxvc+0.185*var.sfx,var.yxvc+0.48*var.sfy,"CARD3");
1497        text->DrawLatex(var.xyvc-0.170*var.sfx,var.yyvc+0.48*var.sfy,"CARD1");        text->DrawLatex(var.xyvc-0.190*var.sfx,var.yyvc+0.48*var.sfy,"CARD1");
1498        text->DrawLatex(var.xyvc+0.13*var.sfx,var.yyvc+0.48*var.sfy,"CARD4");        text->DrawLatex(var.xyvc+0.16*var.sfx,var.yyvc+0.48*var.sfy,"CARD4");
1499        text->DrawLatex(var.xxvc-0.192*var.sfx,var.yxvc+0.39*var.sfy,"CAT3");        text->DrawLatex(var.xxvc-0.192*var.sfx,var.yxvc+0.39*var.sfy,"CAT3");
1500        text->DrawLatex(var.xxvc+0.155*var.sfx,var.yxvc+0.39*var.sfy,"CAT4");        text->DrawLatex(var.xxvc+0.155*var.sfx,var.yxvc+0.39*var.sfy,"CAT4");
1501        text->DrawLatex(var.xyvc-0.170*var.sfx,var.yyvc+0.39*var.sfy,"CAT2");        text->DrawLatex(var.xyvc-0.170*var.sfx,var.yyvc+0.39*var.sfy,"CAT2");
# Line 1579  void FEVdetector::DisplayEvent(){ Line 1623  void FEVdetector::DisplayEvent(){
1623    //    //
1624    // print infos on terminal    // print infos on terminal
1625    //    //
1626      //  if ( !var.selex ){
1627    printf(" File: %s \n",var.thefilename.Data());            printf(" File: %s \n",var.thefilename.Data());        
1628    if ( !s4pulser && !calotrig ){    if ( !s4pulser && !calotrig ){
1629      printf(" Pkt_num: %i  - Progressive number: %i \n",(int)headc,thisentry+1);      printf(" Pkt_num: %i  - Progressive number: %i \n",(int)headc,thisentry+1);
# Line 1589  void FEVdetector::DisplayEvent(){ Line 1634  void FEVdetector::DisplayEvent(){
1634    if ( calotrig ){    if ( calotrig ){
1635      printf(" Pkt_num: %i  - Progressive number: %i   - CALO trigger -\n",(int)headc,thisentry+1);      printf(" Pkt_num: %i  - Progressive number: %i   - CALO trigger -\n",(int)headc,thisentry+1);
1636    };    };
1637    printf(" On Board Time: %i (delta %i) [ms]\n",OBT,DOBT);    printf(" On Board Time: %u (delta %i) [ms]\n",OBT,DOBT);
1638    const char *trc2 = trcs;    const char *trc2 = trcs;
1639    printf(" TRIGGER: %s \n",trc2);          printf(" TRIGGER: %s \n",trc2);      
1640    printf(" AC: CARD hit = %i  CAT hit = %i  CAS hit = %i \n",var.hcard,var.hcat,var.hcas);          printf(" AC: CARD hit = %i  CAT hit = %i  CAS hit = %i \n",var.hcard,var.hcat,var.hcas);      
# Line 1601  void FEVdetector::DisplayEvent(){ Line 1646  void FEVdetector::DisplayEvent(){
1646    printf(" CALO: NSTRIP = %i  QTOT = %i [MIP]\n",var.nstrip,var.qtot);      printf(" CALO: NSTRIP = %i  QTOT = %i [MIP]\n",var.nstrip,var.qtot);  
1647    printf(" S4: %.2f [MIP]   TOF: beta = %.2f \n",var.s4sig,var.beta[4]);            printf(" S4: %.2f [MIP]   TOF: beta = %.2f \n",var.s4sig,var.beta[4]);        
1648    printf(" ND: Trigger: neutrons = %i - Background: upper = %i lower = %i \n",var.trup,var.bkup,var.bkbo);          printf(" ND: Trigger: neutrons = %i - Background: upper = %i lower = %i \n",var.trup,var.bkup,var.bkbo);      
1649      //  };
1650    //    //
1651  }  }
1652    
# Line 1911  void FEVdetector::ShowTOF(){ Line 1957  void FEVdetector::ShowTOF(){
1957    if ( !var.TOF ) return;    if ( !var.TOF ) return;
1958    //    //
1959    Int_t tt = 0;    Int_t tt = 0;
1960      Int_t rj = 0;
1961    //    //
1962    // force level0, i.e. show patterntrig variable!    // force level0, i.e. show patterntrig variable!
1963    //    //
# Line 1940  void FEVdetector::ShowTOF(){ Line 1987  void FEVdetector::ShowTOF(){
1987      Float_t mt31[2][3];      Float_t mt31[2][3];
1988      Float_t mt32[2][3];      Float_t mt32[2][3];
1989      //      //
1990        memset(mt11,0,2*8*sizeof(Float_t));
1991        memset(mt12,0,2*6*sizeof(Float_t));
1992        memset(mt21,0,2*2*sizeof(Float_t));
1993        memset(mt22,0,2*2*sizeof(Float_t));
1994        memset(mt31,0,2*3*sizeof(Float_t));
1995        memset(mt32,0,2*3*sizeof(Float_t));
1996        //
1997      Int_t S3 = 0;      Int_t S3 = 0;
1998      Int_t S2 = 0;      Int_t S2 = 0;
1999      Int_t S12 = 0;      Int_t S12 = 0;
# Line 2104  void FEVdetector::ShowTOF(){ Line 2158  void FEVdetector::ShowTOF(){
2158      Float_t s12p = 0.055;      Float_t s12p = 0.055;
2159      ocolo = 10;      ocolo = 10;
2160      TPolyLine *ftof12ya[6];      TPolyLine *ftof12ya[6];
2161        rj=6;
2162      for ( Int_t j=0; j<6; j++){      for ( Int_t j=0; j<6; j++){
2163          rj--;
2164        Float_t xc1[4]={ (s12p*j),       s12p*(j),               s12p*(j+1),     (s12p*j)};        Float_t xc1[4]={ (s12p*j),       s12p*(j),               s12p*(j+1),     (s12p*j)};
2165        Float_t yc1[4]={      -ws13,     0.,  0., -ws13};        Float_t yc1[4]={      -ws13,     0.,  0., -ws13};
2166        Float_t xc[4];            Float_t xc[4];    
# Line 2120  void FEVdetector::ShowTOF(){ Line 2176  void FEVdetector::ShowTOF(){
2176        } else {        } else {
2177          colo = 1;          colo = 1;
2178        };        };
2179        ColorMIP(ms12a[j],colo);        ColorMIP(ms12a[rj],colo);
2180        //        //
2181        if ( colo != 10 ) ocolo = colo;        if ( colo != 10 ) ocolo = colo;
2182        if ( mt12[0][j] == 4095. ) colo = noadc;        if ( mt12[0][rj] == 4095. ) colo = noadc;
2183        //        //
2184        ftof12ya[j]->SetFillColor(colo);        ftof12ya[j]->SetFillColor(colo);
2185        ftof12ya[j]->SetLineWidth(1);        ftof12ya[j]->SetLineWidth(1);
# Line 2133  void FEVdetector::ShowTOF(){ Line 2189  void FEVdetector::ShowTOF(){
2189      // B      // B
2190      s12p = 0.055;      s12p = 0.055;
2191      TPolyLine *ftof12yb[6];      TPolyLine *ftof12yb[6];
2192        rj=6;
2193      for ( Int_t j=0; j<6; j++){      for ( Int_t j=0; j<6; j++){
2194          rj--;
2195        Float_t xc1[4]={ (s12p*j),       s12p*(j+1),               s12p*(j+1),     (s12p*j)};        Float_t xc1[4]={ (s12p*j),       s12p*(j+1),               s12p*(j+1),     (s12p*j)};
2196        Float_t yc1[4]={ -ws13,     -ws13,    0., -ws13};        Float_t yc1[4]={ -ws13,     -ws13,    0., -ws13};
2197        Float_t xc[4];            Float_t xc[4];    
# Line 2149  void FEVdetector::ShowTOF(){ Line 2207  void FEVdetector::ShowTOF(){
2207        } else {        } else {
2208          colo = 1;          colo = 1;
2209        };        };
2210        ColorMIP(ms12b[j],colo);        ColorMIP(ms12b[rj],colo);
2211        //        //
2212        if ( colo != 10 ) ocolo = colo;        if ( colo != 10 ) ocolo = colo;
2213        if ( mt12[1][j] == 4095. ) colo = noadc;        if ( mt12[1][rj] == 4095. ) colo = noadc;
2214        //        //
2215        ftof12yb[j]->SetFillColor(colo);        ftof12yb[j]->SetFillColor(colo);
2216        ftof12yb[j]->SetLineWidth(1);        ftof12yb[j]->SetLineWidth(1);
# Line 2186  void FEVdetector::ShowTOF(){ Line 2244  void FEVdetector::ShowTOF(){
2244      Float_t s21p = 0.075;      Float_t s21p = 0.075;
2245      ocolo = 10;      ocolo = 10;
2246      TPolyLine *ftof21ya[2];      TPolyLine *ftof21ya[2];
2247        rj=2;
2248      for ( Int_t j=0; j<2; j++){      for ( Int_t j=0; j<2; j++){
2249          rj--;
2250        Float_t xc1[4]={ s21p*(j-1),       s21p*(j-1),               s21p*j,     s21p*(j-1)};        Float_t xc1[4]={ s21p*(j-1),       s21p*(j-1),               s21p*j,     s21p*(j-1)};
2251        Float_t yc1[4]={ 0.,                ws2,     ws2,    0.};        Float_t yc1[4]={ 0.,                ws2,     ws2,    0.};
2252        Float_t xc[4];            Float_t xc[4];    
# Line 2202  void FEVdetector::ShowTOF(){ Line 2262  void FEVdetector::ShowTOF(){
2262        } else {        } else {
2263          colo = 1;          colo = 1;
2264        };        };
2265        ColorMIP(ms21a[j],colo);        ColorMIP(ms21a[rj],colo);
2266        //        //
2267        if ( colo != 10 ) ocolo = colo;        if ( colo != 10 ) ocolo = colo;
2268        if ( mt21[0][j] == 4095. ) colo = noadc;        if ( mt21[0][rj] == 4095. ) colo = noadc;
2269        //        //
2270        ftof21ya[j]->SetFillColor(colo);        ftof21ya[j]->SetFillColor(colo);
2271        ftof21ya[j]->SetLineWidth(1);        ftof21ya[j]->SetLineWidth(1);
# Line 2215  void FEVdetector::ShowTOF(){ Line 2275  void FEVdetector::ShowTOF(){
2275      // B      // B
2276      s21p = 0.075;      s21p = 0.075;
2277      TPolyLine *ftof21yb[2];      TPolyLine *ftof21yb[2];
2278        rj=2;
2279      for ( Int_t j=0; j<2; j++){      for ( Int_t j=0; j<2; j++){
2280          rj--;
2281        Float_t xc1[4]={ s21p*(j-1),       s21p*j,               s21p*j,     s21p*(j-1)};        Float_t xc1[4]={ s21p*(j-1),       s21p*j,               s21p*j,     s21p*(j-1)};
2282        Float_t yc1[4]={ 0.,         0.,                ws2,         0.};        Float_t yc1[4]={ 0.,         0.,                ws2,         0.};
2283        Float_t xc[4];            Float_t xc[4];    
# Line 2231  void FEVdetector::ShowTOF(){ Line 2293  void FEVdetector::ShowTOF(){
2293        } else {        } else {
2294          colo = 1;          colo = 1;
2295        };        };
2296        ColorMIP(ms21b[j],colo);        ColorMIP(ms21b[rj],colo);
2297        //        //
2298        if ( colo != 10 ) ocolo = colo;        if ( colo != 10 ) ocolo = colo;
2299        if ( mt21[1][j] == 4095. ) colo = noadc;        if ( mt21[1][rj] == 4095. ) colo = noadc;
2300        //        //
2301        ftof21yb[j]->SetFillColor(colo);        ftof21yb[j]->SetFillColor(colo);
2302        ftof21yb[j]->SetLineWidth(1);        ftof21yb[j]->SetLineWidth(1);
# Line 2349  void FEVdetector::ShowTOF(){ Line 2411  void FEVdetector::ShowTOF(){
2411      Float_t s31p = 0.060;      Float_t s31p = 0.060;
2412      ocolo = 10;      ocolo = 10;
2413      TPolyLine *ftof31xa[3];      TPolyLine *ftof31xa[3];
2414        rj=3;
2415      for ( Int_t j=0; j<3; j++){      for ( Int_t j=0; j<3; j++){
2416          rj--;
2417        Float_t xc1[4]={ (s31p*j),       (s31p*j),               s31p*(j+1),       (s31p*j)};        Float_t xc1[4]={ (s31p*j),       (s31p*j),               s31p*(j+1),       (s31p*j)};
2418        Float_t yc1[4]={ 0.,                       ws13,     ws13,    0.};        Float_t yc1[4]={ 0.,                       ws13,     ws13,    0.};
2419        Float_t xc[4];            Float_t xc[4];    
# Line 2365  void FEVdetector::ShowTOF(){ Line 2429  void FEVdetector::ShowTOF(){
2429        } else {        } else {
2430          colo = 1;          colo = 1;
2431        };        };
2432        ColorMIP(ms31a[j],colo);        ColorMIP(ms31a[rj],colo);
2433        //        //
2434        if ( colo != 10 ) ocolo = colo;        if ( colo != 10 ) ocolo = colo;
2435        if ( mt31[0][j] == 4095. ) colo = noadc;        if ( mt31[0][rj] == 4095. ) colo = noadc;
2436        //        //
2437        ftof31xa[j]->SetFillColor(colo);        ftof31xa[j]->SetFillColor(colo);
2438        ftof31xa[j]->SetLineWidth(1);        ftof31xa[j]->SetLineWidth(1);
# Line 2378  void FEVdetector::ShowTOF(){ Line 2442  void FEVdetector::ShowTOF(){
2442      // B      // B
2443      s31p = 0.060;      s31p = 0.060;
2444      TPolyLine *ftof31xb[3];      TPolyLine *ftof31xb[3];
2445        rj=3;
2446      for ( Int_t j=0; j<3; j++){      for ( Int_t j=0; j<3; j++){
2447          rj--;
2448        Float_t xc1[4]={ (s31p*j),       s31p*(j+1),               s31p*(j+1),     (s31p*j)};        Float_t xc1[4]={ (s31p*j),       s31p*(j+1),               s31p*(j+1),     (s31p*j)};
2449        Float_t yc1[4]={ 0.,                        0.,     ws13,    0.};        Float_t yc1[4]={ 0.,                        0.,     ws13,    0.};
2450        Float_t xc[4];            Float_t xc[4];    
# Line 2394  void FEVdetector::ShowTOF(){ Line 2460  void FEVdetector::ShowTOF(){
2460        } else {        } else {
2461          colo = 1;          colo = 1;
2462        };        };
2463        ColorMIP(ms31b[j],colo);        ColorMIP(ms31b[rj],colo);
2464        //        //
2465        if ( colo != 10 ) ocolo = colo;        if ( colo != 10 ) ocolo = colo;
2466        if ( mt31[1][j] == 4095. ) colo = noadc;        if ( mt31[1][rj] == 4095. ) colo = noadc;
2467        //        //
2468        ftof31xb[j]->SetFillColor(colo);        ftof31xb[j]->SetFillColor(colo);
2469        ftof31xb[j]->SetLineWidth(1);        ftof31xb[j]->SetLineWidth(1);
# Line 2429  void FEVdetector::ShowTOF(){ Line 2495  void FEVdetector::ShowTOF(){
2495      Float_t s32p = 0.050;      Float_t s32p = 0.050;
2496      ocolo = 10;      ocolo = 10;
2497      TPolyLine *ftof32ya[3];      TPolyLine *ftof32ya[3];
2498        rj=3;
2499      for ( Int_t j=0; j<3; j++){      for ( Int_t j=0; j<3; j++){
2500          rj--;
2501        Float_t xc1[4]={ (s32p*j),       (s32p*j),               s32p*(j+1),     (s32p*j)};        Float_t xc1[4]={ (s32p*j),       (s32p*j),               s32p*(j+1),     (s32p*j)};
2502        Float_t yc1[4]={     -ws13,     0.,    0., -ws13};        Float_t yc1[4]={     -ws13,     0.,    0., -ws13};
2503        Float_t xc[4];            Float_t xc[4];    
# Line 2445  void FEVdetector::ShowTOF(){ Line 2513  void FEVdetector::ShowTOF(){
2513        } else {        } else {
2514          colo = 1;          colo = 1;
2515        };        };
2516        ColorMIP(ms32a[j],colo);        ColorMIP(ms32a[rj],colo);
2517        //        //
2518        if ( colo != 10 ) ocolo = colo;        if ( colo != 10 ) ocolo = colo;
2519        if ( mt32[0][j] == 4095. ) colo = noadc;        if ( mt32[0][rj] == 4095. ) colo = noadc;
2520        //        //
2521        ftof32ya[j]->SetFillColor(colo);        ftof32ya[j]->SetFillColor(colo);
2522        ftof32ya[j]->SetLineWidth(1);        ftof32ya[j]->SetLineWidth(1);
# Line 2457  void FEVdetector::ShowTOF(){ Line 2525  void FEVdetector::ShowTOF(){
2525      };      };
2526      s32p = 0.050;      s32p = 0.050;
2527      TPolyLine *ftof32yb[3];      TPolyLine *ftof32yb[3];
2528        rj=3;
2529      for ( Int_t j=0; j<3; j++){      for ( Int_t j=0; j<3; j++){
2530          rj--;
2531        Float_t xc1[4]={ (s32p*j),       s32p*(j+1),               s32p*(j+1),     (s32p*j)};        Float_t xc1[4]={ (s32p*j),       s32p*(j+1),               s32p*(j+1),     (s32p*j)};
2532        Float_t yc1[4]={ -ws13,   -ws13,    0., -ws13};        Float_t yc1[4]={ -ws13,   -ws13,    0., -ws13};
2533        Float_t xc[4];            Float_t xc[4];    
# Line 2473  void FEVdetector::ShowTOF(){ Line 2543  void FEVdetector::ShowTOF(){
2543        } else {        } else {
2544          colo = 1;          colo = 1;
2545        };        };
2546        ColorMIP(ms32b[j],colo);        ColorMIP(ms32b[rj],colo);
2547        //        //
2548        if ( colo != 10 ) ocolo = colo;        if ( colo != 10 ) ocolo = colo;
2549        if ( mt32[1][j] == 4095. ) colo = noadc;        if ( mt32[1][rj] == 4095. ) colo = noadc;
2550        //        //
2551        ftof32yb[j]->SetFillColor(colo);        ftof32yb[j]->SetFillColor(colo);
2552        ftof32yb[j]->SetLineWidth(1);        ftof32yb[j]->SetLineWidth(1);
# Line 2707  void FEVdetector::ShowTOF(){ Line 2777  void FEVdetector::ShowTOF(){
2777    //    //
2778    //    //
2779    Bool_t repeat = true;    Bool_t repeat = true;
2780    Int_t numtr = 1;    //  Int_t numtr = 1;
2781  //  Int_t numtr = 0;    Int_t numtr = 0;
2782    Int_t repuntil = 0;    Int_t repuntil = 0;
2783      Int_t repuntiltr = 0;
2784    //      //  
2785    //    //
2786    var.tofraw = 0;    var.tofraw = 0;
2787    //    //
2788    if ( level.file == 2 ) repuntil = L2->GetToFLevel2()->ntrk();        if ( level.file == 2 ) repuntil = L2->GetToFLevel2()->ntrk();    
2789    //  printf("repuntil = %i \n",repuntil);    //  printf("repuntil = %i \n",repuntil);
2790    //if ( level.file == 2 ) repuntil = L2->GetTrkLevel2()->GetNTracks();        if ( level.file == 2 ) repuntiltr = L2->GetTrkLevel2()->GetNTracks();    
2791    //repuntil = L2->GetNTracks();        //  repuntiltr = L2->GetNTracks();    
2792    //    //
2793    while ( repeat ){    while ( repeat ){
2794      //    printf("B repuntil = %i \n",repuntil);      //    printf("B repuntil = %i \n",repuntil);
# Line 2726  void FEVdetector::ShowTOF(){ Line 2797  void FEVdetector::ShowTOF(){
2797        //        //
2798        //        //
2799        ToFTrkVar *ptt = 0;        ToFTrkVar *ptt = 0;
2800  //      PamTrack *ptrack = 0;        PamTrack *ptrack = 0;
2801        Float_t adc[4][12];        Float_t adc[4][12];
2802        Float_t tdc[4][12];        Float_t tdc[4][12];
2803        memset(adc,0,4*12*sizeof(Float_t));        memset(adc,0,4*12*sizeof(Float_t));
2804        memset(tdc,0,4*12*sizeof(Float_t));        memset(tdc,0,4*12*sizeof(Float_t));
2805        //              //      
2806        //        //
2807          Int_t myseq = 0;
2808        //      if ( repuntil == 0 || var.tofraw ){        //      if ( repuntil == 0 || var.tofraw ){
2809        if ( repuntil == 1 || var.tofraw ){        if ( repuntil == 1 || var.tofraw ){
2810          numtr = 0;          numtr = 0;
# Line 2740  void FEVdetector::ShowTOF(){ Line 2812  void FEVdetector::ShowTOF(){
2812          repeat = false;          repeat = false;
2813        } else {        } else {
2814          //          //
2815    //        printf(" deH_ \n");
2816          //          //
2817          if ( numtr >= repuntil-1 ) repeat = false;          if ( numtr == 0 ){
2818          //  //          printf(" ques \n");
2819          //      printf(" numtr is %i \n",numtr);            ptt = L2->GetToFLevel2()->GetToFTrkVar(0);
2820          ptt = L2->GetToFLevel2()->GetToFTrkVar(numtr);              myseq = 0;
2821          //ptrack = L2->GetTrack(numtr);  //          printf(" que \n");
2822          //ptt = ptrack->GetToFTrack();  
2823            } else {
2824              if ( numtr >= (repuntiltr-1) ) repeat = false;
2825              //
2826              printf(" numtr is %i \n",numtr);
2827              // ptt = L2->GetToFLevel2()->GetToFTrkVar(numtr);    
2828              ptrack = L2->GetTrack(numtr-1);
2829              ptt = ptrack->GetToFTrack();
2830              myseq = ptt->trkseqno + 1;
2831            };
2832        };        };
2833        //        //
2834        xp11[0] = 0.;        xp11[0] = 0.;
# Line 2760  void FEVdetector::ShowTOF(){ Line 2842  void FEVdetector::ShowTOF(){
2842        //        //
2843        ii = 2;        ii = 2;
2844        //        //
2845        Int_t myseq = ptt->trkseqno + 1;        //      Int_t myseq = ptt->trkseqno + 1;
2846          //
2847    //      printf(" qui \n");
2848        L2->GetToFLevel2()->GetMatrix(myseq,adc,tdc);        L2->GetToFLevel2()->GetMatrix(myseq,adc,tdc);
2849        //        //
2850        //      printf(" qua \n");  //      printf(" qua \n");
2851        //        //
2852        for ( Int_t i = 0; i<8; i++ ) {          //       for ( Int_t i = 0; i<8; i++ ) {  
2853          if ( adc[ch11a[i]][hb11a[i]] < 1000. ){        //        if ( adc[ch11a[i]][hb11a[i]] < 1000. ){
2854            ms11a[i] = adc[ch11a[i]][hb11a[i]];        //          ms11a[i] = adc[ch11a[i]][hb11a[i]];
2855          };              //        };      
2856          if ( adc[ch11b[i]][hb11b[i]] < 1000. ){        //        if ( adc[ch11b[i]][hb11b[i]] < 1000. ){
2857            ms11b[i] = adc[ch11b[i]][hb11b[i]];        //          ms11b[i] = adc[ch11b[i]][hb11b[i]];
2858          };        //        };
2859          //      xp11[i] = 0.;        //        xp11[i] = 0.;
2860        };        //    };
2861    
2862        Int_t nmtof = 0;        Int_t nmtof = 0;
2863        Float_t mtof = 0.;        Float_t mtof = 0.;
# Line 2890  void FEVdetector::ShowTOF(){ Line 2974  void FEVdetector::ShowTOF(){
2974        if ( level.file == -1 ){        if ( level.file == -1 ){
2975          ColorMIP(ms11a[j]+ms11b[j],colo);                ColorMIP(ms11a[j]+ms11b[j],colo);      
2976        } else {        } else {
2977          ColorTOFMIP(ms11a[j]+ms11b[j],colo);              ColorTOFMIP((ms11a[j]+ms11b[j])/2.,colo);      
2978        };        };
2979        //        //
2980        if ( colo != 10 ) ocolo = colo;        if ( colo != 10 ) ocolo = colo;
# Line 2920  void FEVdetector::ShowTOF(){ Line 3004  void FEVdetector::ShowTOF(){
3004      ftof11y->Draw();      ftof11y->Draw();
3005      TPolyLine *sftof11[8];      TPolyLine *sftof11[8];
3006      tt = 1;      tt = 1;
3007      if ( level.file == -1 ) tt = 8;      rj=1;
3008        if ( level.file == -1 ){
3009          tt = 8;
3010          rj = 8;
3011        };
3012      for ( Int_t j=0; j<tt; j++){      for ( Int_t j=0; j<tt; j++){
3013        if ( (mt11[0][j]<4095. || mt11[1][j]<4095.)){        rj--;
3014          if ( (mt11[0][rj]<4095. || mt11[1][rj]<4095.)){
3015          if ( ocolo == 10 ) ocolo = noadc;          if ( ocolo == 10 ) ocolo = noadc;
3016          Float_t lowp = (xp11[j]-E11[j])/100.;          Float_t lowp = -(xp11[rj]+E11[rj])/100.;
3017          Float_t higp = (xp11[j]+E11[j])/100.;          Float_t higp = -(xp11[rj]-E11[rj])/100.;
3018          if ( lowp < -0.164 ) lowp = -0.164;          if ( lowp < -0.164 ) lowp = -0.164;
3019          if ( higp > 0.164 ) higp = 0.164;          if ( higp > 0.164 ) higp = 0.164;
3020          if ( lowp < higp && ( level.file == -1 || (level.file == 2 && xp11[j] != 0.))){          if ( lowp < higp && ( level.file == -1 || (level.file == 2 && xp11[rj] != 0.))){
3021            Float_t nxc1[5]={ lowp, higp, higp, lowp, lowp};            Float_t nxc1[5]={ lowp, higp, higp, lowp, lowp};
3022            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};
3023            Float_t nxc[5];                Float_t nxc[5];    
# Line 2953  void FEVdetector::ShowTOF(){ Line 3042  void FEVdetector::ShowTOF(){
3042      Float_t s12p = 0.055;      Float_t s12p = 0.055;
3043      ocolo = 10;      ocolo = 10;
3044      TPolyLine *ftof12y[6];      TPolyLine *ftof12y[6];
3045        rj = 6;
3046      for ( Int_t j=0; j<6; j++){      for ( Int_t j=0; j<6; j++){
3047          rj--;
3048        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)};
3049        Float_t nyc1[5]={      -ws13,     0.,  0., -ws13, -ws13};        Float_t nyc1[5]={      -ws13,     0.,  0., -ws13, -ws13};
3050        Float_t nxc[5];            Float_t nxc[5];    
# Line 2970  void FEVdetector::ShowTOF(){ Line 3061  void FEVdetector::ShowTOF(){
3061          colo = 1;          colo = 1;
3062        };        };
3063        if ( level.file == -1 ){        if ( level.file == -1 ){
3064          ColorMIP(ms12a[j]+ms12b[j],colo);          ColorMIP(ms12a[rj]+ms12b[rj],colo);
3065        } else {        } else {
3066          ColorTOFMIP(ms12a[j]+ms12b[j],colo);          ColorTOFMIP((ms12a[rj]+ms12b[rj])/2.,colo);
3067        };        };
3068        //        //
3069        if ( colo != 10 ) ocolo = colo;        if ( colo != 10 ) ocolo = colo;
# Line 3039  void FEVdetector::ShowTOF(){ Line 3130  void FEVdetector::ShowTOF(){
3130      Float_t s21p = 0.075;      Float_t s21p = 0.075;
3131      ocolo = 10;      ocolo = 10;
3132      TPolyLine *ftof21y[2];      TPolyLine *ftof21y[2];
3133        rj=2;
3134      for ( Int_t j=0; j<2; j++){      for ( Int_t j=0; j<2; j++){
3135          rj--;
3136        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)};
3137        Float_t nyc1[5]={ 0.,                ws2,     ws2,  0.,  0.};        Float_t nyc1[5]={ 0.,                ws2,     ws2,  0.,  0.};
3138        Float_t nxc[5];            Float_t nxc[5];    
# Line 3056  void FEVdetector::ShowTOF(){ Line 3149  void FEVdetector::ShowTOF(){
3149          colo = 1;          colo = 1;
3150        };        };
3151        if ( level.file == -1 ){        if ( level.file == -1 ){
3152          ColorMIP(ms21a[j]+ms21b[j],colo);          ColorMIP(ms21a[rj]+ms21b[rj],colo);
3153        } else {        } else {
3154          ColorTOFMIP(ms21a[j]+ms21b[j],colo);          ColorTOFMIP((ms21a[rj]+ms21b[rj])/2.,colo);
3155        };        };
3156        //        //
3157        if ( colo != 10 ) ocolo = colo;        if ( colo != 10 ) ocolo = colo;
# Line 3144  void FEVdetector::ShowTOF(){ Line 3237  void FEVdetector::ShowTOF(){
3237        if ( level.file == -1 ){        if ( level.file == -1 ){
3238          ColorMIP(ms22a[j]+ms22b[j],colo);          ColorMIP(ms22a[j]+ms22b[j],colo);
3239        } else {        } else {
3240          ColorTOFMIP(ms22a[j]+ms22b[j],colo);          ColorTOFMIP((ms22a[j]+ms22b[j])/2.,colo);
3241        };        };
3242        //        //
3243        if ( colo != 10 ) ocolo = colo;        if ( colo != 10 ) ocolo = colo;
# Line 3175  void FEVdetector::ShowTOF(){ Line 3268  void FEVdetector::ShowTOF(){
3268        ftof22y->Draw();        ftof22y->Draw();
3269        TPolyLine *sftof22[2];        TPolyLine *sftof22[2];
3270        tt = 1;        tt = 1;
3271        if ( level.file == -1 ) tt = 2;        rj = 1;
3272          if ( level.file == -1 ){
3273            tt = 2;
3274            rj = 2;
3275          };
3276        for (Int_t j=0; j<tt; j++){        for (Int_t j=0; j<tt; j++){
3277            rj--;
3278          //    for ( Int_t j=0; j<2; j++){          //    for ( Int_t j=0; j<2; j++){
3279          if ( (mt22[0][j]<4095. || mt22[1][j]<4095.) ){          if ( (mt22[0][rj]<4095. || mt22[1][rj]<4095.) ){
3280            if ( ocolo == 10 ) ocolo = noadc;            if ( ocolo == 10 ) ocolo = noadc;
3281            Float_t lowp = (xp22[j]-E22[j])/100.;            Float_t lowp = -(xp22[rj]+E22[rj])/100.;
3282            Float_t higp = (xp22[j]+E22[j])/100.;            Float_t higp = -(xp22[rj]-E22[rj])/100.;
3283            if ( lowp < -0.074 ) lowp = -0.074;            if ( lowp < -0.074 ) lowp = -0.074;
3284            if ( higp > 0.074 ) higp = 0.074;            if ( higp > 0.074 ) higp = 0.074;
3285            if ( lowp < higp && ( level.file == -1 || (level.file == 2 && xp22[j] != 0.))){            if ( lowp < higp && ( level.file == -1 || (level.file == 2 && xp22[rj] != 0.))){
3286              Float_t nxc1[5]={ lowp, higp, higp, lowp, lowp};              Float_t nxc1[5]={ lowp, higp, higp, lowp, lowp};
3287              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};
3288              Float_t nxc[5];                  Float_t nxc[5];    
# Line 3204  void FEVdetector::ShowTOF(){ Line 3302  void FEVdetector::ShowTOF(){
3302        };        };
3303      };      };
3304      //      //
3305        //daquiinbasso
3306      //      //
3307      // S31  X-view      // S31  X-view
3308      //      //
# Line 3230  void FEVdetector::ShowTOF(){ Line 3328  void FEVdetector::ShowTOF(){
3328        if ( level.file == -1 ){        if ( level.file == -1 ){
3329          ColorMIP(ms31a[j]+ms31b[j],colo);          ColorMIP(ms31a[j]+ms31b[j],colo);
3330        } else {        } else {
3331          ColorTOFMIP(ms31a[j]+ms31b[j],colo);          ColorTOFMIP((ms31a[j]+ms31b[j])/2.,colo);
3332        };        };
3333        //        //
3334        if ( colo != 10 ) ocolo = colo;        if ( colo != 10 ) ocolo = colo;
# Line 3261  void FEVdetector::ShowTOF(){ Line 3359  void FEVdetector::ShowTOF(){
3359        ftof31y->Draw();        ftof31y->Draw();
3360        TPolyLine *sftof31[3];        TPolyLine *sftof31[3];
3361        tt = 1;        tt = 1;
3362        if ( level.file == -1 ) tt = 3;        rj = 1;
3363          if ( level.file == -1 ){
3364            tt = 3;
3365            rj = 3;
3366          };
3367        for (Int_t j=0; j<tt; j++){        for (Int_t j=0; j<tt; j++){
3368            rj--;
3369          //    for ( Int_t j=0; j<3; j++){          //    for ( Int_t j=0; j<3; j++){
3370          if ( (mt31[0][j]<4095. || mt31[1][j]<4095.)){          if ( (mt31[0][rj]<4095. || mt31[1][rj]<4095.)){
3371            if ( ocolo == 10 ) ocolo = noadc;            if ( ocolo == 10 ) ocolo = noadc;
3372            Float_t lowp = (xp31[j]-E31[j])/100.;            Float_t lowp = -(xp31[rj]+E31[rj])/100.;
3373            Float_t higp = (xp31[j]+E31[j])/100.;            Float_t higp = -(xp31[rj]-E31[rj])/100.;
3374            if ( lowp < -0.074 ) lowp = -0.074;            if ( lowp < -0.074 ) lowp = -0.074;
3375            if ( higp > 0.074 ) higp = 0.074;            if ( higp > 0.074 ) higp = 0.074;
3376            if ( lowp < higp && ( level.file == -1 || (level.file == 2 && xp31[j] != 0.))){            if ( lowp < higp && ( level.file == -1 || (level.file == 2 && xp31[rj] != 0.))){
3377              Float_t nxc1[5]={ lowp, higp, higp, lowp, lowp};              Float_t nxc1[5]={ lowp, higp, higp, lowp, lowp};
3378              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};
3379              Float_t nxc[5];                  Float_t nxc[5];    
# Line 3297  void FEVdetector::ShowTOF(){ Line 3400  void FEVdetector::ShowTOF(){
3400      Float_t s32p = 0.050;      Float_t s32p = 0.050;
3401      ocolo = 10;      ocolo = 10;
3402      TPolyLine *ftof32y[3];      TPolyLine *ftof32y[3];
3403        rj = 3;
3404      for ( Int_t j=0; j<3; j++){      for ( Int_t j=0; j<3; j++){
3405          rj--;
3406        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)};
3407        Float_t nyc1[5]={     -ws13,     0.,    0., -ws13, -ws13};        Float_t nyc1[5]={     -ws13,     0.,    0., -ws13, -ws13};
3408        Float_t nxc[5];            Float_t nxc[5];    
# Line 3314  void FEVdetector::ShowTOF(){ Line 3419  void FEVdetector::ShowTOF(){
3419          colo = 1;          colo = 1;
3420        };        };
3421        if ( level.file == -1 ){        if ( level.file == -1 ){
3422          ColorMIP(ms32a[j]+ms32b[j],colo);          ColorMIP(ms32a[rj]+ms32b[rj],colo);
3423        } else {        } else {
3424          ColorTOFMIP(ms32a[j]+ms32b[j],colo);          ColorTOFMIP((ms32a[rj]+ms32b[rj])/2.,colo);
3425        };        };
3426        //        //
3427        if ( colo != 10 ) ocolo = colo;        if ( colo != 10 ) ocolo = colo;
# Line 5030  void FEVdetector::ShowTRK(Bool_t upd){ Line 5135  void FEVdetector::ShowTRK(Bool_t upd){
5135            for (Int_t m = 0; m<3; m++){            for (Int_t m = 0; m<3; m++){
5136              if ( trk->signcluster[l][m] != 0. ){              if ( trk->signcluster[l][m] != 0. ){
5137                if ( planeno == 10 ) {                if ( planeno == 10 ) {
                 x = 1024 - trk->addrcluster[l][m];  
               } else {  
5138                  x = trk->addrcluster[l][m];                  x = trk->addrcluster[l][m];
5139                  } else {
5140                    x = 1024 - trk->addrcluster[l][m];
5141                };                };
5142                linea = new TLine(14.+x,0.01,14.+x,0.3);                linea = new TLine(14.+x,0.01,14.+x,0.3);
5143                linea->SetLineWidth(2);                linea->SetLineWidth(2);
# Line 5102  void FEVdetector::ShowTRK(Bool_t upd){ Line 5207  void FEVdetector::ShowTRK(Bool_t upd){
5207          trkpad[planepad]->cd();          trkpad[planepad]->cd();
5208          trkpad[planepad]->Range(-7.05,0.,7.05,8.);          trkpad[planepad]->Range(-7.05,0.,7.05,8.);
5209          for (Int_t img=0; img<2; img++){          for (Int_t img=0; img<2; img++){
5210            x = singlet->coord[img];            x = -singlet->coord[img];
5211            Float_t xsig = singlet->sgnl;            Float_t xsig = singlet->sgnl;
5212            if ( xsig > 8. ) xsig = 8.;            if ( xsig > 8. ) xsig = 8.;
5213            //            //
# Line 5158  void FEVdetector::ShowTRK(Bool_t upd){ Line 5263  void FEVdetector::ShowTRK(Bool_t upd){
5263              trkpad[planepad]->Range(-8.1,0.,8.1,8.);              trkpad[planepad]->Range(-8.1,0.,8.1,8.);
5264              //              //
5265              x = track->xm[plane];              x = track->xm[plane];
5266              Float_t xsig = track->dedx_x[plane];              Float_t xsig = fabs(track->dedx_x[plane]);
5267              if ( track->xgood[plane] ){              if ( track->XGood(plane) ){
5268                //if ( x > -100 ){                //if ( x > -100 ){
5269                if ( xsig > 8. ) xsig = 8.;                if ( xsig > 8. ) xsig = 8.;
5270                if ( var.bw ){                if ( var.bw ){
# Line 5167  void FEVdetector::ShowTRK(Bool_t upd){ Line 5272  void FEVdetector::ShowTRK(Bool_t upd){
5272                } else {                } else {
5273                  sigcol2 = 1;                  sigcol2 = 1;
5274                };                };
5275                ColorTRKMIP(track->dedx_x[plane],sigcol2,0);                ColorTRKMIP(fabs(track->dedx_x[plane]),sigcol2,0);
5276                linea = new TLine(x,0.01,x,xsig);                linea = new TLine(x,0.01,x,xsig);
5277                linea->SetLineWidth(2);                linea->SetLineWidth(2);
5278                linea->SetLineColor(sigcol2);                linea->SetLineColor(sigcol2);
# Line 5187  void FEVdetector::ShowTRK(Bool_t upd){ Line 5292  void FEVdetector::ShowTRK(Bool_t upd){
5292              planepad = plane * 2;              planepad = plane * 2;
5293              trkpad[planepad]->cd();              trkpad[planepad]->cd();
5294              trkpad[planepad]->Range(-7.05,0.,7.05,8.);              trkpad[planepad]->Range(-7.05,0.,7.05,8.);
5295              x = track->ym[plane];              x = -track->ym[plane];
5296              xsig = track->dedx_y[plane];              xsig = fabs(track->dedx_y[plane]);
5297              if ( track->ygood[plane] ){              if ( track->YGood(plane) ){
5298                //            if ( x > -100 ){                //            if ( x > -100 ){
5299                if ( xsig > 8. ) xsig = 8.;                if ( xsig > 8. ) xsig = 8.;
5300                if ( var.bw ){                if ( var.bw ){
# Line 5197  void FEVdetector::ShowTRK(Bool_t upd){ Line 5302  void FEVdetector::ShowTRK(Bool_t upd){
5302                } else {                } else {
5303                  sigcol2 = 1;                  sigcol2 = 1;
5304                };                };
5305                ColorTRKMIP(track->dedx_y[plane],sigcol2,0);                ColorTRKMIP(fabs(track->dedx_y[plane]),sigcol2,0);
5306                linea = new TLine(x,0.01,x,xsig);                linea = new TLine(x,0.01,x,xsig);
5307                linea->SetLineWidth(2);                linea->SetLineWidth(2);
5308                linea->SetLineColor(sigcol2);                linea->SetLineColor(sigcol2);
# Line 5249  void FEVdetector::ShowTRK(Bool_t upd){ Line 5354  void FEVdetector::ShowTRK(Bool_t upd){
5354            for (Int_t plane = 0; plane<6; plane++){            for (Int_t plane = 0; plane<6; plane++){
5355              //              //
5356              x = track->xm[plane];              x = track->xm[plane];
5357              Float_t y = track->ym[plane];              Float_t y = -track->ym[plane];
5358              Float_t xsig = track->dedx_x[plane];              Float_t xsig = fabs(track->dedx_x[plane]);
5359              Float_t ysig = track->dedx_y[plane];              Float_t ysig = fabs(track->dedx_y[plane]);
5360              //    if ( x > -100 && y > -100. ){              //    if ( x > -100 && y > -100. ){
5361              if ( track->xgood[plane] && track->ygood[plane] ){              if ( track->XGood(plane) && track->YGood(plane) ){
5362                if ( var.bw ){                if ( var.bw ){
5363                  sigcol1 = -1;                  sigcol1 = -1;
5364                  sigcol2 = -1;                  sigcol2 = -1;
# Line 5371  void FEVdetector::ShowTRK(Bool_t upd){ Line 5476  void FEVdetector::ShowTRK(Bool_t upd){
5476              for (Int_t sing = 0; sing < min(totsx,totsy); sing++){              for (Int_t sing = 0; sing < min(totsx,totsy); sing++){
5477                //                              //              
5478                x = arrax->At(orderx->At(sing));                x = arrax->At(orderx->At(sing));
5479                Float_t y1 = array1->At(ordery->At(sing));                Float_t y1 = -array1->At(ordery->At(sing));
5480                Float_t y2 = array2->At(ordery->At(sing));                Float_t y2 = -array2->At(ordery->At(sing));
5481                Float_t xsig = sigarrax->At(orderx->At(sing));                Float_t xsig = sigarrax->At(orderx->At(sing));
5482                Float_t ysig = sigarray->At(ordery->At(sing));                Float_t ysig = sigarray->At(ordery->At(sing));
5483                if ( x > -100 && y1 > -100. ){                if ( x > -100 && y1 > -100. ){
# Line 5465  void FEVdetector::ShowTRK(Bool_t upd){ Line 5570  void FEVdetector::ShowTRK(Bool_t upd){
5570                  for (Int_t m = 0; m<3; m++){                                          for (Int_t m = 0; m<3; m++){                        
5571                    if ( trk->signcluster[l][m] != 0. ){                    if ( trk->signcluster[l][m] != 0. ){
5572                      if ( planeno == 10 ) {                      if ( planeno == 10 ) {
                       x = 1024 - trk->addrcluster[l][m];  
                     } else {  
5573                        x = trk->addrcluster[l][m];                        x = trk->addrcluster[l][m];
5574                        } else {
5575                          x = 1024 - trk->addrcluster[l][m];
5576                      };                      };
5577                      x += 1024.;                                      x += 1024.;                
5578                      if ( trk->signcluster[l][m]> ysig  ){                      if ( trk->signcluster[l][m]> ysig  ){
5579                        ysig = trk->signcluster[l][m];                        ysig = trk->signcluster[l][m];
5580                        yh1[ncro] = x-1024.;                        yh1[ncro] = x - 1024.;
5581                        yh2[ncro] = x;                        yh2[ncro] = x;
5582                      };                      };
5583                    };                    };
# Line 5500  void FEVdetector::ShowTRK(Bool_t upd){ Line 5605  void FEVdetector::ShowTRK(Bool_t upd){
5605                    for (Int_t m = 0; m<3; m++){                    for (Int_t m = 0; m<3; m++){
5606                      if ( trk->signcluster[e][m] != 0. ){                      if ( trk->signcluster[e][m] != 0. ){
5607                        if ( planeno == 10 ) {                        if ( planeno == 10 ) {
                         x = 1024 - trk->addrcluster[e][m];  
                       } else {  
5608                          x = trk->addrcluster[e][m];                          x = trk->addrcluster[e][m];
5609                          } else {
5610                            x = 1024 - trk->addrcluster[e][m];
5611                        };                        };
5612                        x += 1024.;                                              x += 1024.;                      
5613                        if ( trk->signcluster[e][m]> ysig  ){                        if ( trk->signcluster[e][m]> ysig  ){
5614                          ysig = trk->signcluster[e][m];                          ysig = trk->signcluster[e][m];
5615                          yh1[ncro] = x-1024.;                          yh1[ncro] = x - 1024.;
5616                          yh2[ncro] = x;                          yh2[ncro] = x;
5617                        };                        };
5618                      };                      };
# Line 5580  void FEVdetector::ShowTrack(){ Line 5685  void FEVdetector::ShowTrack(){
5685        };        };
5686        for (Int_t plane = 0; plane < 22; plane++){              for (Int_t plane = 0; plane < 22; plane++){      
5687          calx[plane] = (L2->GetCaloLevel2()->cbar[plane][0]/100.)*var.sfx + var.xxvc;;          calx[plane] = (L2->GetCaloLevel2()->cbar[plane][0]/100.)*var.sfx + var.xxvc;;
5688          caly[plane] = (L2->GetCaloLevel2()->cbar[plane][1]/100.)*var.sfx + var.xyvc;          caly[plane] = (-L2->GetCaloLevel2()->cbar[plane][1]/100.)*var.sfx + var.xyvc;
5689          //      calzx[plane] = zpiano[plane] -5.81*var.sfy/1000. + var.yxvc;          //      calzx[plane] = zpiano[plane] -5.81*var.sfy/1000. + var.yxvc;
5690          calzx[plane] = zpiano[plane] + var.yxvc;          calzx[plane] = zpiano[plane] + var.yxvc;
5691          calzy[plane] = zpiano[plane] + var.yyvc;          calzy[plane] = zpiano[plane] + var.yyvc;
# Line 5629  void FEVdetector::ShowTrack(){ Line 5734  void FEVdetector::ShowTrack(){
5734        //        //
5735        for (Int_t plane = 0; plane < 22; plane++){              for (Int_t plane = 0; plane < 22; plane++){      
5736          calx[plane] = (ctra->tbar[plane][0]/100.)*var.sfx + var.xxvc;;          calx[plane] = (ctra->tbar[plane][0]/100.)*var.sfx + var.xxvc;;
5737          caly[plane] = (ctra->tbar[plane][1]/100.)*var.sfx + var.xyvc;          caly[plane] = (-ctra->tbar[plane][1]/100.)*var.sfx + var.xyvc;
5738          //      calzx[plane] = zpiano[plane] -5.81*var.sfy/1000. + var.yxvc;          //      calzx[plane] = zpiano[plane] -5.81*var.sfy/1000. + var.yxvc;
5739          calzx[plane] = zpiano[plane] + var.yxvc;          calzx[plane] = zpiano[plane] + var.yxvc;
5740          calzy[plane] = zpiano[plane] + var.yyvc;          calzy[plane] = zpiano[plane] + var.yyvc;
# Line 5716  void FEVdetector::ShowTrack(){ Line 5821  void FEVdetector::ShowTrack(){
5821        //        //
5822        Trajectory *tr = new Trajectory(npoint,zin);                                      Trajectory *tr = new Trajectory(npoint,zin);                              
5823        //        //
5824        ifail = track->DoTrack2(tr);        //      ifail = track->DoTrack2(tr);
5825          ifail = track->DoTrack(tr);
5826        //        //
5827        if ( !ifail ){        if ( !ifail ){
5828          for ( Int_t e = 0; e < npoint ; e++) {          for ( Int_t e = 0; e < npoint ; e++) {
5829            tx[e] = ((float)tr->x[e]/100.)*var.sfx + var.xxvc;            tx[e] = ((float)tr->x[e]/100.)*var.sfx + var.xxvc;
5830            ty[e] = ((float)tr->y[e]/100.)*var.sfx + var.xyvc;            ty[e] = (-(float)tr->y[e]/100.)*var.sfx + var.xyvc;
5831            if ( e < 50 ) {            if ( e < 50 ) {
5832              ptx1[e] = ((float)tr->y[e]/100.)*var.sfx + var.xcat;              ptx1[e] = (-(float)tr->y[e]/100.)*var.sfx + var.xcat;
5833              pty1[e] = ((float)tr->x[e]/100.)*var.sfy + var.ycat;              pty1[e] = ((float)tr->x[e]/100.)*var.sfy + var.ycat;
5834            } else {            } else {
5835              ptx2[e-50] = ((float)tr->y[e]/100.)*var.sfx + var.xcat;              ptx2[e-50] = (-(float)tr->y[e]/100.)*var.sfx + var.xcat;
5836              pty2[e-50] = ((float)tr->x[e]/100.)*var.sfy + var.ycat;              pty2[e-50] = ((float)tr->x[e]/100.)*var.sfy + var.ycat;
5837            };            };
5838            if ( e > 84 ) {            if ( e > 84 ) {
5839              tx1[e-85] = ((float)tr->x[e]/100.)*var.nds4 + var.xxvc;              tx1[e-85] = ((float)tr->x[e]/100.)*var.nds4 + var.xxvc;
5840              ty1[e-85] = ((float)tr->y[e]/100.)*var.nds4 + var.xyvc;                  ty1[e-85] = (-(float)tr->y[e]/100.)*var.nds4 + var.xyvc;    
5841              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;
5842              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;
5843            };            };
# Line 5971  void FEVdetector::ShowCalo(Bool_t upd){ Line 6077  void FEVdetector::ShowCalo(Bool_t upd){
6077                Xview->Draw("box same");                Xview->Draw("box same");
6078              };                                            };                              
6079              if ( l == 1 ) {                                      if ( l == 1 ) {                        
6080                Yview->Fill(n,21-m,1.);                Yview->Fill(95-n,21-m,1.);
6081                pd2->cd();                pd2->cd();
6082                Yview->Draw("box same");                Yview->Draw("box same");
6083              };              };
# Line 6200  void FEVdetector::ShowCalo(Bool_t upd){ Line 6306  void FEVdetector::ShowCalo(Bool_t upd){
6306                    Xview->Draw("box same");                    Xview->Draw("box same");
6307                  };                                                    };                                  
6308                  if ( l == 1 ) {                                      if ( l == 1 ) {                    
6309                    Yview->Fill(n,21-m,1.);                    Yview->Fill(96-n,21-m,1.);
6310                    pd2->cd();                    pd2->cd();
6311                    Yview->Draw("box same");                    Yview->Draw("box same");
6312                  };                  };
# Line 6287  void FEVdetector::ShowCalo(Bool_t upd){ Line 6393  void FEVdetector::ShowCalo(Bool_t upd){
6393      //      //
6394      stringstream xvev;      stringstream xvev;
6395      stringstream yvev;          stringstream yvev;    
6396      for (Int_t ii = 0; ii < L2->GetCaloLevel2()->nstrip; ii++){      //    for (Int_t ii = 0; ii < L2->GetCaloLevel2()->nstrip; ii++){
6397        for (Int_t ii = 0; ii < L2->GetCaloLevel1()->istrip; ii++){
6398        Int_t colo;        Int_t colo;
6399        Int_t l;        Int_t l;
6400        Int_t m;        Int_t m;
6401        Int_t n;        Int_t n;
6402        Float_t mip = L2->GetCaloLevel1()->DecodeEstrip(ii,l,m,n);        Bool_t satura = false;
6403          Float_t mip = L2->GetCaloLevel1()->DecodeEstrip(ii,l,m,n,satura);
6404        if ( var.bw ){        if ( var.bw ){
6405          colo = -1;          colo = -1;
6406        } else {        } else {
6407          colo = 1;          colo = 1;
6408        };        };      
6409        ColorMIP(mip,colo);        ColorMIP(mip,colo);
6410        if ( l == 0 ) {        if ( l == 0 ) {
6411          xvev.str("");          xvev.str("");
# Line 6306  void FEVdetector::ShowCalo(Bool_t upd){ Line 6414  void FEVdetector::ShowCalo(Bool_t upd){
6414          xvev << " " << l;          xvev << " " << l;
6415          gDirectory->Delete(xvev.str().c_str());          gDirectory->Delete(xvev.str().c_str());
6416          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);
6417          Xview->SetFillColor(colo);          if ( satura ){
6418              Xview->SetFillColor(kBlack);
6419            } else {
6420              Xview->SetFillColor(colo);
6421            };
6422          Xview->Fill(n,21-m,1.);          Xview->Fill(n,21-m,1.);
6423          pd1->cd();                                            pd1->cd();                                  
6424          Xview->Draw("box same");          Xview->Draw("box same");
# Line 6318  void FEVdetector::ShowCalo(Bool_t upd){ Line 6430  void FEVdetector::ShowCalo(Bool_t upd){
6430          yvev << " " << l;          yvev << " " << l;
6431          gDirectory->Delete(yvev.str().c_str());          gDirectory->Delete(yvev.str().c_str());
6432          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);                  
6433          Yview->SetFillColor(colo);          if ( satura ){
6434          Yview->Fill(n,21-m,1.);            Yview->SetFillColor(kBlack);
6435            } else {
6436              Yview->SetFillColor(colo);
6437            };
6438            Yview->Fill(96-n,21-m,1.);
6439          pd2->cd();          pd2->cd();
6440          Yview->Draw("box same");          Yview->Draw("box same");
6441        };        };

Legend:
Removed from v.1.21  
changed lines
  Added in v.1.34

  ViewVC Help
Powered by ViewVC 1.1.23