/[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.25 by mocchiut, Thu Nov 29 15:53:10 2007 UTC revision 1.38 by mocchiut, Tue Nov 4 11:14:53 2014 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 112  void FEVdetector::checkctrlword(){ Line 117  void FEVdetector::checkctrlword(){
117    var.INFOS = 0;    var.INFOS = 0;
118    var.VINFOS = 0;    var.VINFOS = 0;
119    var.PALETTE = 0;    var.PALETTE = 0;
120      var.PATTRIG = 1;
121    if ( *ctrlword & (1<<0) ) {    if ( *ctrlword & (1<<0) ) {
122      var.PALETTE = 1;      var.PALETTE = 1;
123    };    };
# Line 139  void FEVdetector::checkctrlword(){ Line 145  void FEVdetector::checkctrlword(){
145    if ( *ctrlword & (1<<8) ) {    if ( *ctrlword & (1<<8) ) {
146      var.TOF = 1;      var.TOF = 1;
147    };    };
148      if ( *ctrlword & (1<<9) ) {
149        var.PATTRIG = 1;
150      };
151  }  }
152    
153  void FEVdetector::SetDDEC(TString de){  void FEVdetector::SetDDEC(TString de){
# Line 206  void FEVdetector::ClearVariables(){ Line 215  void FEVdetector::ClearVariables(){
215  void FEVdetector::GetEntry(Int_t i){  void FEVdetector::GetEntry(Int_t i){
216    thisentry = i;      thisentry = i;  
217    if ( level.file == 2 ){    if ( level.file == 2 ){
218      L2->Clear();      //    L2->Clear();
219      //    printf("qui\n");      //    printf("qui\n");
220      L2->GetEntry(i);      L2->GetEntry(i);
221      if ( var.showall ){      if ( var.showall ){
# Line 394  void FEVdetector::ShowInfo(TString detec Line 403  void FEVdetector::ShowInfo(TString detec
403    Int_t dlen = 10;    Int_t dlen = 10;
404    //    //
405    char o[200000];    char o[200000];
406      char zz[200000];
407    char col[13];    char col[13];
408    char col2[13];    char col2[13];
409    //    //
410    setcolor(col,RESET, GREEN, WHITE);    setcolor(col,RESET, GREEN, WHITE);
411    sprintf(o,"%s======> EVENT:%i\n",col, thisentry);    sprintf(o,"%s======> EVENT:%i\n",col, thisentry);
412      sprintf(zz,"======> EVENT:%i\n", thisentry);
413    //    //
414    setcolor(col,RESET, RED, WHITE);    setcolor(col,RESET, RED, WHITE);
415    sprintf(o,"%s%sBranch %s\n",o,col,b1->GetName());    sprintf(o,"%s%sBranch %s\n",o,col,b1->GetName());
416      sprintf(zz,"%sBranch %s\n",zz,b1->GetName());
417    setcolor(col,RESET, BLACK, WHITE);    setcolor(col,RESET, BLACK, WHITE);
418    sprintf(o,"%s%s",o,col);    sprintf(o,"%s%s",o,col);
419    //    //
# Line 414  void FEVdetector::ShowInfo(TString detec Line 426  void FEVdetector::ShowInfo(TString detec
426      TBranchElement *tb = (TBranchElement*)branch_array->At(l);      TBranchElement *tb = (TBranchElement*)branch_array->At(l);
427      Int_t type = tb->GetType();      Int_t type = tb->GetType();
428      Int_t atype = tb->GetStreamerType() - 20;      Int_t atype = tb->GetStreamerType() - 20;
429      Int_t len = (tb->GetInfo()->GetLengths())[tb->GetID()];      //    Int_t len = (tb->GetInfo()->GetLengths())[tb->GetID()];
430        Int_t len = tb->GetInfo()->GetLength(tb->GetID());
431      Int_t length = min(len,dlen);      Int_t length = min(len,dlen);
432      //      //
433      //        printf("Branches : type is %i type is %i tb getname %s  slen %i slength %i\n",atype,type,tb->GetName(),len,length);      //        printf("Branches : type is %i type is %i tb getname %s  slen %i slength %i\n",atype,type,tb->GetName(),len,length);
# Line 429  void FEVdetector::ShowInfo(TString detec Line 442  void FEVdetector::ShowInfo(TString detec
442        setcolor(col,RESET, BLUE, WHITE);        setcolor(col,RESET, BLUE, WHITE);
443        setcolor(col2,RESET, BLACK, WHITE);        setcolor(col2,RESET, BLACK, WHITE);
444        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);
445          sprintf(zz,"%s %-15s =",zz,((TBranch*)branch_array->At(l))->GetName());
446        //        //
447        j = 0;        j = 0;
448        //        //
# Line 441  void FEVdetector::ShowInfo(TString detec Line 455  void FEVdetector::ShowInfo(TString detec
455          while ( j < length ){          while ( j < length ){
456            if ( j < length -1 ){            if ( j < length -1 ){
457              sprintf(o,"%s %i ,",o,(Int_t)tb->GetValue(j,0));              sprintf(o,"%s %i ,",o,(Int_t)tb->GetValue(j,0));
458                sprintf(zz,"%s %i ,",zz,(Int_t)tb->GetValue(j,0));
459            } else {            } else {
460              sprintf(o,"%s %i",o,(Int_t)tb->GetValue(j,0));              sprintf(o,"%s %i",o,(Int_t)tb->GetValue(j,0));
461                sprintf(zz,"%s %i",zz,(Int_t)tb->GetValue(j,0));
462            };            };
463            j++;            j++;
464          };          };
# Line 454  void FEVdetector::ShowInfo(TString detec Line 470  void FEVdetector::ShowInfo(TString detec
470          while ( j < length ){          while ( j < length ){
471            if ( j < length -1 ){            if ( j < length -1 ){
472              sprintf(o,"%s %u ,",o,(UInt_t)tb->GetValue(j,0));              sprintf(o,"%s %u ,",o,(UInt_t)tb->GetValue(j,0));
473                sprintf(zz,"%s %u ,",zz,(UInt_t)tb->GetValue(j,0));
474            } else {            } else {
475              sprintf(o,"%s %u",o,(UInt_t)tb->GetValue(j,0));              sprintf(o,"%s %u",o,(UInt_t)tb->GetValue(j,0));
476                sprintf(zz,"%s %u",zz,(UInt_t)tb->GetValue(j,0));
477            };            };
478            j++;            j++;
479          };          };
# Line 467  void FEVdetector::ShowInfo(TString detec Line 485  void FEVdetector::ShowInfo(TString detec
485          while ( j < length ){          while ( j < length ){
486            if ( j < length -1 ){            if ( j < length -1 ){
487              sprintf(o,"%s %f ,",o,tb->GetValue(j,0));              sprintf(o,"%s %f ,",o,tb->GetValue(j,0));
488                sprintf(zz,"%s %f ,",zz,tb->GetValue(j,0));
489            } else {            } else {
490              sprintf(o,"%s %f",o,tb->GetValue(j,0));              sprintf(o,"%s %f",o,tb->GetValue(j,0));
491                sprintf(zz,"%s %f",zz,tb->GetValue(j,0));
492            };            };
493            j++;            j++;
494          };          };
# Line 503  void FEVdetector::ShowInfo(TString detec Line 523  void FEVdetector::ShowInfo(TString detec
523  //        printf("ciao %s \n",pr->Data());  //        printf("ciao %s \n",pr->Data());
524  //      };  //      };
525          sprintf(o,"%s TString - not implemented yet -",o);          sprintf(o,"%s TString - not implemented yet -",o);
526            sprintf(zz,"%s TString - not implemented yet -",zz);
527        };        };
528        //        //
529        // TArray        // TArray
# Line 603  void FEVdetector::ShowInfo(TString detec Line 624  void FEVdetector::ShowInfo(TString detec
624  //      sprintf(o,"%s\n",o);  //      sprintf(o,"%s\n",o);
625          //                //      
626          sprintf(o,"%s TArray - not implemented yet -",o);          sprintf(o,"%s TArray - not implemented yet -",o);
627            sprintf(zz,"%s TArray - not implemented yet -",zz);
628          //          //
629        };        };
630        //        //
631        sprintf(o,"%s\n",o);        sprintf(o,"%s\n",o);
632          sprintf(zz,"%s\n",zz);
633        break;        break;
634      case 3:      case 3:
635        //        //
# Line 615  void FEVdetector::ShowInfo(TString detec Line 638  void FEVdetector::ShowInfo(TString detec
638        setcolor(col,RESET, BLUE, WHITE);        setcolor(col,RESET, BLUE, WHITE);
639        setcolor(col2,RESET, BLACK, WHITE);        setcolor(col2,RESET, BLACK, WHITE);
640        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());
641          sprintf(zz,"%s %-15s = %d\n",zz,tb->GetName(), tb->GetNdata());
642    
643        //        //
644        if ( tb->GetNdata() ){        if ( tb->GetNdata() ){
# Line 636  void FEVdetector::ShowInfo(TString detec Line 660  void FEVdetector::ShowInfo(TString detec
660              TBranchElement *stb = (TBranchElement*)tb->FindBranch(name);              TBranchElement *stb = (TBranchElement*)tb->FindBranch(name);
661              Int_t stype = stb->GetType();              Int_t stype = stb->GetType();
662              Int_t satype = stb->GetStreamerType() - 20;              Int_t satype = stb->GetStreamerType() - 20;
663              Int_t slen = (stb->GetInfo()->GetLengths())[stb->GetID()];              //      Int_t slen = (stb->GetInfo()->GetLengths())[stb->GetID()];
664                Int_t slen = stb->GetInfo()->GetLength(stb->GetID());
665              Int_t slength = min(slen,dlen);              Int_t slength = min(slen,dlen);
666              //      printf("SubBranches : atype is %i type is %i tb getname %s  slen %i slength %i\n",satype,stype,stb->GetName(),slen,slength);              //      printf("SubBranches : atype is %i type is %i tb getname %s  slen %i slength %i\n",satype,stype,stb->GetName(),slen,slength);
667              switch (stype){              switch (stype){
# Line 665  void FEVdetector::ShowInfo(TString detec Line 690  void FEVdetector::ShowInfo(TString detec
690                  setcolor(col,RESET, BLUE, WHITE);                  setcolor(col,RESET, BLUE, WHITE);
691                  setcolor(col2,RESET, BLACK, WHITE);                  setcolor(col2,RESET, BLACK, WHITE);
692                  sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2);                  sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2);
693                    sprintf(zz,"%s %-15s = ",zz,foglia->GetName());
694                  while ( j < cl->GetEntriesFast() ){                  while ( j < cl->GetEntriesFast() ){
695                    if ( j < cl->GetEntriesFast() -1 ){                    if ( j < cl->GetEntriesFast() -1 ){
696                      sprintf(o,"%s %i ,",o,(Int_t)stb->GetValue(j,slength));                      sprintf(o,"%s %i ,",o,(Int_t)stb->GetValue(j,slength));
697                        sprintf(zz,"%s %i ,",zz,(Int_t)stb->GetValue(j,slength));
698                    } else {                    } else {
699                      sprintf(o,"%s %i",o,(Int_t)stb->GetValue(j,slength));                      sprintf(o,"%s %i",o,(Int_t)stb->GetValue(j,slength));
700                        sprintf(zz,"%s %i",zz,(Int_t)stb->GetValue(j,slength));
701                    };                    };
702                    j++;                    j++;
703                  };                  };
# Line 682  void FEVdetector::ShowInfo(TString detec Line 710  void FEVdetector::ShowInfo(TString detec
710                  setcolor(col,RESET, BLUE, WHITE);                  setcolor(col,RESET, BLUE, WHITE);
711                  setcolor(col2,RESET, BLACK, WHITE);                  setcolor(col2,RESET, BLACK, WHITE);
712                  sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2);                  sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2);
713                    sprintf(zz,"%s %-15s = ",zz,foglia->GetName());
714                  while ( j < cl->GetEntriesFast() ){                  while ( j < cl->GetEntriesFast() ){
715                    if ( j < cl->GetEntriesFast() -1 ){                    if ( j < cl->GetEntriesFast() -1 ){
716                      sprintf(o,"%s %f ,",o,stb->GetValue(j,slength));                      sprintf(o,"%s %f ,",o,stb->GetValue(j,slength));
717                        sprintf(zz,"%s %f ,",zz,stb->GetValue(j,slength));
718                    } else {                    } else {
719                      sprintf(o,"%s %f",o,stb->GetValue(j,slength));                      sprintf(o,"%s %f",o,stb->GetValue(j,slength));
720                        sprintf(zz,"%s %f",zz,stb->GetValue(j,slength));
721                    };                    };
722                    j++;                    j++;
723                  };                  };
# Line 699  void FEVdetector::ShowInfo(TString detec Line 730  void FEVdetector::ShowInfo(TString detec
730                  setcolor(col,RESET, BLUE, WHITE);                  setcolor(col,RESET, BLUE, WHITE);
731                  setcolor(col2,RESET, BLACK, WHITE);                  setcolor(col2,RESET, BLACK, WHITE);
732                  sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2);                  sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2);
733                    sprintf(zz,"%s %-15s = ",zz,foglia->GetName());
734                  Bool_t bold = true;                  Bool_t bold = true;
735                  while ( j < tb->GetNdata() ){                  while ( j < tb->GetNdata() ){
736                    if ( bold ){                    if ( bold ){
# Line 712  void FEVdetector::ShowInfo(TString detec Line 744  void FEVdetector::ShowInfo(TString detec
744                    while ( jj < slength ){                                      while ( jj < slength ){                  
745                      if ( jj < slength-1 ){                      if ( jj < slength-1 ){
746                        sprintf(o,"%s %f ,",o,stb->GetValue(j,jj,true));                        sprintf(o,"%s %f ,",o,stb->GetValue(j,jj,true));
747                          sprintf(zz,"%s %f ,",zz,stb->GetValue(j,jj,true));
748                      } else {                      } else {
749                        sprintf(o,"%s %f",o,stb->GetValue(j,jj,true));                        sprintf(o,"%s %f",o,stb->GetValue(j,jj,true));
750                          sprintf(zz,"%s %f",zz,stb->GetValue(j,jj,true));
751                      };                      };
752                      jj++;                      jj++;
753                    };                    };
754                    if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o);                    if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o);
755                      if ( j < tb->GetNdata() -1 ) sprintf(zz,"%s ,",zz);
756                    if ( !bold ){                    if ( !bold ){
757                      bold = true;                      bold = true;
758                    } else {                    } else {
# Line 738  void FEVdetector::ShowInfo(TString detec Line 773  void FEVdetector::ShowInfo(TString detec
773                  setcolor(col,RESET, BLUE, WHITE);                  setcolor(col,RESET, BLUE, WHITE);
774                  setcolor(col2,RESET, BLACK, WHITE);                  setcolor(col2,RESET, BLACK, WHITE);
775                  sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2);                  sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2);
776                    sprintf(zz,"%s %-15s = ",zz,foglia->GetName());
777                  while ( j < tb->GetNdata() ){                  while ( j < tb->GetNdata() ){
778                    Int_t jj = 0;                    Int_t jj = 0;
779                    while ( jj < slength ){                    while ( jj < slength ){
780                      if ( jj < slength-1 ){                      if ( jj < slength-1 ){
781                        sprintf(o,"%s %i ,",o,(Int_t)stb->GetValue(j,jj,true));                        sprintf(o,"%s %i ,",o,(Int_t)stb->GetValue(j,jj,true));
782                          sprintf(zz,"%s %i ,",zz,(Int_t)stb->GetValue(j,jj,true));
783                      } else {                      } else {
784                        sprintf(o,"%s %i",o,(Int_t)stb->GetValue(j,jj,true));                        sprintf(o,"%s %i",o,(Int_t)stb->GetValue(j,jj,true));
785                          sprintf(zz,"%s %i",zz,(Int_t)stb->GetValue(j,jj,true));
786                      };                      };
787                      jj++;                      jj++;
788                    };                    };
789                    if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o);                    if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o);
790                      if ( j < tb->GetNdata() -1 ) sprintf(zz,"%s ,",zz);
791                    j++;                    j++;
792                  };                  };
793                };                };
# Line 781  void FEVdetector::ShowInfo(TString detec Line 820  void FEVdetector::ShowInfo(TString detec
820                    setcolor(col,RESET, BLUE, WHITE);                    setcolor(col,RESET, BLUE, WHITE);
821                    setcolor(col2,RESET, BLACK, WHITE);                    setcolor(col2,RESET, BLACK, WHITE);
822                    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);
823                      sprintf(zz,"%s %s[%i] = ",zz,foglia->GetName(),arr->GetSize());
824                    //                    //
825                    while ( j < tb->GetNdata() ){                    while ( j < tb->GetNdata() ){
826                      //                      //
# Line 791  void FEVdetector::ShowInfo(TString detec Line 831  void FEVdetector::ShowInfo(TString detec
831                      while ( jj < arlen ){                      while ( jj < arlen ){
832                        if ( jj < arlen-1 ){                        if ( jj < arlen-1 ){
833                          sprintf(o,"%s %i ,",o,arr->At(jj));                          sprintf(o,"%s %i ,",o,arr->At(jj));
834                            sprintf(zz,"%s %i ,",zz,arr->At(jj));
835                        } else {                        } else {
836                          sprintf(o,"%s %i",o,arr->At(jj));                          sprintf(o,"%s %i",o,arr->At(jj));
837                            sprintf(zz,"%s %i",zz,arr->At(jj));
838                        };                        };
839                        jj++;                        jj++;
840                      };                      };
841                      if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o);                      if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o);
842                        if ( j < tb->GetNdata() -1 ) sprintf(zz,"%s ,",zz);
843                      j++;                      j++;
844                    };                    };
845                  };                  };
# Line 814  void FEVdetector::ShowInfo(TString detec Line 857  void FEVdetector::ShowInfo(TString detec
857                    setcolor(col,RESET, BLUE, WHITE);                    setcolor(col,RESET, BLUE, WHITE);
858                    setcolor(col2,RESET, BLACK, WHITE);                    setcolor(col2,RESET, BLACK, WHITE);
859                    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);
860                      sprintf(zz,"%s %s[%i] = ",zz,foglia->GetName(),arr->GetSize());
861                    //                    //
862                    while ( j < tb->GetNdata() ){                    while ( j < tb->GetNdata() ){
863                      //                      //
# Line 824  void FEVdetector::ShowInfo(TString detec Line 868  void FEVdetector::ShowInfo(TString detec
868                      while ( jj < arlen ){                      while ( jj < arlen ){
869                        if ( jj < arlen-1 ){                        if ( jj < arlen-1 ){
870                          sprintf(o,"%s %f ,",o,arr->At(jj));                          sprintf(o,"%s %f ,",o,arr->At(jj));
871                            sprintf(zz,"%s %f ,",zz,arr->At(jj));
872                        } else {                        } else {
873                          sprintf(o,"%s %f",o,arr->At(jj));                          sprintf(o,"%s %f",o,arr->At(jj));
874                            sprintf(zz,"%s %f",zz,arr->At(jj));
875                        };                        };
876                        jj++;                        jj++;
877                      };                      };
878                      if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o);                      if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o);
879                        if ( j < tb->GetNdata() -1 ) sprintf(zz,"%s ,",zz);
880                      j++;                      j++;
881                    };                    };
882                  };                  };
883                };                };
884                sprintf(o,"%s\n",o);                sprintf(o,"%s\n",o);
885                  sprintf(zz,"%s\n",zz);
886                break;                        break;        
887              };              };
888            };            };
# Line 843  void FEVdetector::ShowInfo(TString detec Line 891  void FEVdetector::ShowInfo(TString detec
891        break;        break;
892      };      };
893    };      };  
   //  pamgui->DIALOG(0,o);  
894    printf("%s\n",o);    printf("%s\n",o);
895      pamgui->DIALOG(4,zz);
896  };  };
897    
898    
# Line 1016  int FEVdetector::SelectEvent(){ Line 1064  int FEVdetector::SelectEvent(){
1064        //        //
1065        if ( level.file == 2 ){        if ( level.file == 2 ){
1066          cintcom.str("");          cintcom.str("");
1067          cintcom << "PamLevel2 *L2 = (PamLevel2*)0x" << hex;          cintcom << "PamLevel2 *L2 = (PamLevel2*)" << hex; //con const e l2 funziona
1068          cintcom << L2;          cintcom << L2;
1069          gROOT->ProcessLine(cintcom.str().c_str());          gROOT->ProcessLine(cintcom.str().c_str());
1070            //      printf(" comando: %s \n",cintcom.str().c_str());
1071        } else {        } else {
1072          cintcom.str("");          cintcom.str("");
1073          cintcom << "TTree *otr = (TTree*)0x" << hex;          cintcom << "TTree *otr = (TTree*)" << hex;
1074          cintcom << otr;          cintcom << otr;
1075          gROOT->ProcessLine(cintcom.str().c_str());          gROOT->ProcessLine(cintcom.str().c_str());
1076          //          //
1077          cintcom.str("");          cintcom.str("");
1078          cintcom << "struct Variables &var = (struct Variables &)0x" << hex;          cintcom << "struct Variables &var = (struct Variables &)" << hex;
1079          cintcom << &var;          cintcom << &var;
1080          gROOT->ProcessLine(cintcom.str().c_str());          gROOT->ProcessLine(cintcom.str().c_str());
1081        };        };
# Line 1057  TChain* FEVdetector::Load(TString file){ Line 1106  TChain* FEVdetector::Load(TString file){
1106    //    //
1107    if ( level.file == 2 ){    if ( level.file == 2 ){
1108      //      //
1109      printf(" %s \n",ddec.Data());      //    printf(" %s \n",ddec.Data());
1110      if ( !L2 ){      if ( !L2 ){
1111        L2 = new PamLevel2("",file.Data(),ddec.Data());        L2 = new PamLevel2("",file.Data(),ddec.Data());
1112          if ( NODB ) L2->NoDBconnections();
1113        otr = L2->GetPamTree();        otr = L2->GetPamTree();
1114        printf(" l2 constructor\n");        //      printf(" l2 constructor\n");
1115        //      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);    
1116      } else {      } else {
1117        //        //
1118        printf(" l2 already exist \n");        //      printf(" l2 already exist \n");
1119        otr = L2->GetPamTree(gSystem->DirName(file.Data()),file.Data(),ddec.Data());        otr = L2->GetPamTree(gSystem->DirName(file.Data()),file.Data(),ddec.Data());
1120        L2->GetRunTree(gSystem->DirName(file.Data()),file.Data());        L2->GetRunTree(gSystem->DirName(file.Data()),file.Data());
1121        //        //
# Line 1216  TChain* FEVdetector::Load(TString file){ Line 1266  TChain* FEVdetector::Load(TString file){
1266    //        //    
1267  }  }
1268    
1269    bool bit(int decimal, char pos)
1270    {
1271      return( (decimal>>pos)%2 );
1272    }
1273    //
1274    // THE PATTERN TRIGGER
1275    //
1276    void FEVdetector::ShowTRG(){
1277      //
1278      if ( level.file != 2 ) return;
1279      //
1280      if ( !var.TRG ) return;
1281      //
1282      int S11[8];
1283      S11[0] = 0;
1284      S11[1] = 0;
1285      S11[2] = 0;
1286      S11[3] = 0;
1287      S11[4] = 0;
1288      S11[5] = 0;
1289      S11[6] = 0;
1290      S11[7] = 0;
1291    
1292      int S12[6];
1293      S12[0] = 0;
1294      S12[1] = 0;
1295      S12[2] = 0;
1296      S12[3] = 0;
1297      S12[4] = 0;
1298      S12[5] = 0;
1299    
1300      int S21[2];
1301      S21[0] = 0;
1302      S21[1] = 0;
1303    
1304      int S22[2];
1305      S22[0] = 0;
1306      S22[1] = 0;
1307    
1308      int S31[3];
1309      S31[0] = 0;
1310      S31[1] = 0;
1311      S31[2] = 0;
1312    
1313      int S32[3];
1314      S32[0] = 0;
1315      S32[1] = 0;
1316      S32[2] = 0;
1317    
1318      //S3
1319      if ( bit(L2->GetTrigLevel2()->patterntrig[2],0) ) S31[0]++;
1320      if ( bit(L2->GetTrigLevel2()->patterntrig[2],1) ) S31[1]++;
1321      if ( bit(L2->GetTrigLevel2()->patterntrig[2],2) ) S31[2]++;
1322      if ( bit(L2->GetTrigLevel2()->patterntrig[2],3) ) S31[0]++;
1323      if ( bit(L2->GetTrigLevel2()->patterntrig[2],4) ) S31[1]++;
1324      if ( bit(L2->GetTrigLevel2()->patterntrig[2],5) ) S31[2]++;
1325      if ( bit(L2->GetTrigLevel2()->patterntrig[2],6) ) S32[0]++;
1326      if ( bit(L2->GetTrigLevel2()->patterntrig[2],7) ) S32[1]++;
1327      if ( bit(L2->GetTrigLevel2()->patterntrig[2],8) ) S32[2]++;
1328      if ( bit(L2->GetTrigLevel2()->patterntrig[2],9) ) S32[0]++;
1329      if ( bit(L2->GetTrigLevel2()->patterntrig[2],10) ) S32[1]++;
1330      if ( bit(L2->GetTrigLevel2()->patterntrig[2],11) ) S32[2]++;
1331      //S2
1332      if ( bit(L2->GetTrigLevel2()->patterntrig[3],0) ) S21[0]++;
1333      if ( bit(L2->GetTrigLevel2()->patterntrig[3],1) ) S21[1]++;
1334      if ( bit(L2->GetTrigLevel2()->patterntrig[3],2) ) S21[0]++;
1335      if ( bit(L2->GetTrigLevel2()->patterntrig[3],3) ) S21[1]++;
1336      if ( bit(L2->GetTrigLevel2()->patterntrig[3],4) ) S22[0]++;
1337      if ( bit(L2->GetTrigLevel2()->patterntrig[3],5) ) S22[1]++;
1338      if ( bit(L2->GetTrigLevel2()->patterntrig[3],6) ) S22[0]++;
1339      if ( bit(L2->GetTrigLevel2()->patterntrig[3],7) ) S22[1]++;
1340      //S12
1341      if ( bit(L2->GetTrigLevel2()->patterntrig[4],0) ) S12[0]++;
1342      if ( bit(L2->GetTrigLevel2()->patterntrig[4],1) ) S12[1]++;
1343      if ( bit(L2->GetTrigLevel2()->patterntrig[4],2) ) S12[2]++;
1344      if ( bit(L2->GetTrigLevel2()->patterntrig[4],3) ) S12[3]++;
1345      if ( bit(L2->GetTrigLevel2()->patterntrig[4],4) ) S12[4]++;
1346      if ( bit(L2->GetTrigLevel2()->patterntrig[4],5) ) S12[5]++;
1347      if ( bit(L2->GetTrigLevel2()->patterntrig[4],6) ) S12[0]++;
1348      if ( bit(L2->GetTrigLevel2()->patterntrig[4],7) ) S12[1]++;
1349      if ( bit(L2->GetTrigLevel2()->patterntrig[4],8) ) S12[2]++;
1350      if ( bit(L2->GetTrigLevel2()->patterntrig[4],9) ) S12[3]++;
1351      if ( bit(L2->GetTrigLevel2()->patterntrig[4],10) ) S12[4]++;
1352      if ( bit(L2->GetTrigLevel2()->patterntrig[4],11) ) S12[5]++;
1353      //S11
1354      if ( bit(L2->GetTrigLevel2()->patterntrig[5],0) ) S11[0]++;
1355      if ( bit(L2->GetTrigLevel2()->patterntrig[5],1) ) S11[1]++;
1356      if ( bit(L2->GetTrigLevel2()->patterntrig[5],2) ) S11[2]++;
1357      if ( bit(L2->GetTrigLevel2()->patterntrig[5],3) ) S11[3]++;
1358      if ( bit(L2->GetTrigLevel2()->patterntrig[5],4) ) S11[4]++;
1359      if ( bit(L2->GetTrigLevel2()->patterntrig[5],5) ) S11[5]++;
1360      if ( bit(L2->GetTrigLevel2()->patterntrig[5],6) ) S11[6]++;
1361      if ( bit(L2->GetTrigLevel2()->patterntrig[5],7) ) S11[7]++;
1362      if ( bit(L2->GetTrigLevel2()->patterntrig[5],8) ) S11[0]++;
1363      if ( bit(L2->GetTrigLevel2()->patterntrig[5],9) ) S11[1]++;
1364      if ( bit(L2->GetTrigLevel2()->patterntrig[5],10) ) S11[2]++;
1365      if ( bit(L2->GetTrigLevel2()->patterntrig[5],11) ) S11[3]++;
1366      if ( bit(L2->GetTrigLevel2()->patterntrig[5],12) ) S11[4]++;
1367      if ( bit(L2->GetTrigLevel2()->patterntrig[5],13) ) S11[5]++;
1368      if ( bit(L2->GetTrigLevel2()->patterntrig[5],14) ) S11[6]++;
1369      if ( bit(L2->GetTrigLevel2()->patterntrig[5],15) ) S11[7]++;
1370    
1371    
1372      //
1373      Int_t rj = 0;
1374      Float_t xs2x = var.xxvc;
1375      Float_t ys2x = var.yxvc + 0.36*var.sfy;
1376      Float_t xs2y = var.xyvc;
1377      Float_t ys2y = var.yyvc + 0.36*var.sfy;
1378      Float_t ws2 = 0.005;
1379      Float_t ws13 = 0.007;
1380      Int_t noadc;
1381      if ( var.bw ){
1382        noadc=12;
1383      } else {
1384        noadc=kRed;
1385      };
1386      //
1387      // S11  X-view
1388      //
1389      Float_t s11p = 0.051;
1390      TPolyLine *ftrg11x[8];
1391      for ( Int_t j=0; j<8; j++){
1392        Float_t nxc1[5]={ (s11p*j),       (s11p*j),               s11p*(j+1),     s11p*(j+1), (s11p*j)};
1393        Float_t nyc1[5]={ 0.,                       ws13,     ws13,   0.,  0.};
1394        Float_t nxc[5];    
1395        Float_t nyc[5];
1396        for (Int_t i = 0; i<5 ; i++) {
1397          nxc[i]= xs2x + (-0.204+nxc1[i])*var.sfx;
1398          nyc[i] = ys2x + (0.295+nyc1[i])*var.sfy;
1399        };
1400        ftrg11x[j] = new TPolyLine(5,nxc,nyc);
1401        ftrg11x[j]->SetLineColor(noadc);
1402        ftrg11x[j]->SetLineWidth(S11[j]);
1403        if ( S11[j] )  ftrg11x[j]->Draw();
1404      };
1405      //
1406      // S12  Y-view
1407      //
1408      Float_t s12p = 0.055;
1409      TPolyLine *ftrg12y[6];
1410      rj = 6;
1411      for ( Int_t j=0; j<6; j++){
1412        rj--;
1413        Float_t nxc1[5]={ (s12p*j),       (s12p*j),               s12p*(j+1), s12p*(j+1),    (s12p*j)};
1414        Float_t nyc1[5]={      -ws13,     0.,  0., -ws13, -ws13};
1415        Float_t nxc[5];    
1416        Float_t nyc[5];
1417        for (Int_t i = 0; i<5 ; i++) {
1418          nxc[i]= xs2y + (-0.165+nxc1[i])*var.sfx;
1419          nyc[i] = ys2y + (0.295+nyc1[i])*var.sfy;
1420        };
1421        ftrg12y[j] = new TPolyLine(5,nxc,nyc);
1422        ftrg12y[j]->SetLineColor(noadc);
1423        ftrg12y[j]->SetLineWidth(S12[rj]);
1424        if ( S12[rj] ) ftrg12y[j]->Draw();
1425      };
1426    
1427      
1428      //
1429      // S21  Y-view
1430      //
1431      Float_t s21p = 0.075;
1432      TPolyLine *ftrg21y[2];
1433      rj=2;
1434      for ( Int_t j=0; j<2; j++){
1435        rj--;
1436        Float_t nxc1[5]={ s21p*(j-1),       s21p*(j-1),               s21p*j,s21p*j,     s21p*(j-1)};
1437        Float_t nyc1[5]={ 0.,                ws2,     ws2,  0.,  0.};
1438        Float_t nxc[5];    
1439        Float_t nyc[5];
1440        for (Int_t i = 0; i<5 ; i++) {
1441          nxc[i]= xs2y + nxc1[i]*var.sfx;
1442          nyc[i] = ys2y + nyc1[i]*var.sfy;
1443          //      printf(" TRG i %i x %f y %f \n",i,nxc[i],nyc[i]);
1444        };
1445        ftrg21y[j] = new TPolyLine(5,nxc,nyc);
1446        ftrg21y[j]->SetLineColor(noadc);
1447        ftrg21y[j]->SetLineWidth(S21[j]);
1448        if ( S21[j]) ftrg21y[j]->Draw();
1449      };
1450    
1451      //
1452      // S22  X-view
1453      //
1454      Float_t s22p = 0.090;
1455      TPolyLine *ftrg22x[2];
1456      for ( Int_t j=0; j<2; j++){
1457        Float_t nxc1[5]={ s22p*(j-1),       s22p*(j-1),               s22p*j, s22p*j,     s22p*(j-1)};
1458        Float_t nyc1[5]={                -ws2,   0., 0.,  -ws2,  -ws2};
1459        Float_t nxc[5];    
1460        Float_t nyc[5];
1461        for (Int_t i = 0; i<5 ; i++) {
1462          nxc[i]= xs2x + nxc1[i]*var.sfx;
1463          nyc[i] = ys2x + nyc1[i]*var.sfy;
1464        };
1465        ftrg22x[j] = new TPolyLine(5,nxc,nyc);
1466        ftrg22x[j]->SetLineColor(noadc);
1467        ftrg22x[j]->SetLineWidth(S22[j]);
1468        if ( S22[j] ) ftrg22x[j]->Draw();
1469      };
1470      //
1471      // S31  X-view
1472      //
1473      Float_t s31p = 0.060;
1474      TPolyLine *ftrg31x[3];
1475      for ( Int_t j=0; j<3; j++){
1476        Float_t nxc1[5]={ (s31p*j),       (s31p*j),               s31p*(j+1), s31p*(j+1),       (s31p*j)};
1477        Float_t nyc1[5]={ 0.,                       ws13,     ws13,    0.,    0.};
1478        Float_t nxc[5];    
1479        Float_t nyc[5];
1480        for (Int_t i = 0; i<5 ; i++) {
1481          nxc[i]= xs2x + (-0.090+nxc1[i])*var.sfx;
1482          nyc[i] = ys2x + (-0.488+nyc1[i])*var.sfy;
1483        };
1484        ftrg31x[j] = new TPolyLine(5,nxc,nyc);
1485        ftrg31x[j]->SetLineColor(noadc);
1486        ftrg31x[j]->SetLineWidth(S31[j]);
1487        if ( S31[j] ) ftrg31x[j]->Draw();
1488      };
1489    
1490      //
1491      // S32  Y-view
1492      //
1493      Float_t s32p = 0.050;
1494      TPolyLine *ftrg32y[3];
1495      rj = 3;
1496      for ( Int_t j=0; j<3; j++){
1497        rj--;
1498        Float_t nxc1[5]={ (s32p*j),       (s32p*j),               s32p*(j+1),s32p*(j+1),     (s32p*j)};
1499        Float_t nyc1[5]={     -ws13,     0.,    0., -ws13, -ws13};
1500        Float_t nxc[5];    
1501        Float_t nyc[5];
1502        for (Int_t i = 0; i<5 ; i++) {
1503          nxc[i]= xs2y + (-0.075+nxc1[i])*var.sfx;
1504          nyc[i] = ys2y + (-0.488+nyc1[i])*var.sfy;
1505        };
1506        ftrg32y[j] = new TPolyLine(5,nxc,nyc);
1507        ftrg32y[j]->SetLineColor(noadc);
1508        ftrg32y[j]->SetLineWidth(S32[rj]);
1509        if ( S32[rj] ) ftrg32y[j]->Draw();
1510      }
1511    }
1512    
1513  void FEVdetector::DisplayEvent(){  void FEVdetector::DisplayEvent(){
1514    TLatex *text=new TLatex();    TLatex *text=new TLatex();
1515    stringstream testo;    stringstream testo;
# Line 1231  void FEVdetector::DisplayEvent(){ Line 1525  void FEVdetector::DisplayEvent(){
1525    thefigure->cd();          thefigure->cd();      
1526    ShowTOF();    ShowTOF();
1527    //    //
1528      // show pattern trigger if the case
1529      //
1530      thefigure->cd();
1531      if ( var.PATTRIG ){
1532        ShowTRG();
1533        thefigure->Modified();
1534        thefigure->Update();
1535      }
1536      //
1537    // show anticounters    // show anticounters
1538    //    //
1539    thefigure->cd();          thefigure->cd();      
# Line 1327  void FEVdetector::DisplayEvent(){ Line 1630  void FEVdetector::DisplayEvent(){
1630      testo3 << "S4: ";// << setprecision(2);      testo3 << "S4: ";// << setprecision(2);
1631      testo3 << var.s4sig << " [MIP]   TOF: #beta = ";      testo3 << var.s4sig << " [MIP]   TOF: #beta = ";
1632      testo3 << setprecision(3) << var.beta[4];      testo3 << setprecision(3) << var.beta[4];
1633        if ( level.file == 2 ){
1634          testo3 << " SVL cutoff: ";
1635          testo3 << setprecision(3) << L2->GetOrbitalInfo()->GetCutoffSVL();//quiquiqui
1636        }
1637      text->DrawLatex(0.33,txthi,testo3.str().c_str());            text->DrawLatex(0.33,txthi,testo3.str().c_str());      
1638      txthi -= 0.03;      txthi -= 0.03;
1639      testo3.str("");      testo3.str("");
# Line 1943  void FEVdetector::ShowTOF(){ Line 2250  void FEVdetector::ShowTOF(){
2250      Float_t mt31[2][3];      Float_t mt31[2][3];
2251      Float_t mt32[2][3];      Float_t mt32[2][3];
2252      //      //
2253        memset(mt11,0,2*8*sizeof(Float_t));
2254        memset(mt12,0,2*6*sizeof(Float_t));
2255        memset(mt21,0,2*2*sizeof(Float_t));
2256        memset(mt22,0,2*2*sizeof(Float_t));
2257        memset(mt31,0,2*3*sizeof(Float_t));
2258        memset(mt32,0,2*3*sizeof(Float_t));
2259        //
2260      Int_t S3 = 0;      Int_t S3 = 0;
2261      Int_t S2 = 0;      Int_t S2 = 0;
2262      Int_t S12 = 0;      Int_t S12 = 0;
# Line 2726  void FEVdetector::ShowTOF(){ Line 3040  void FEVdetector::ShowTOF(){
3040    //    //
3041    //    //
3042    Bool_t repeat = true;    Bool_t repeat = true;
3043    Int_t numtr = 1;    //  Int_t numtr = 1;
3044  //  Int_t numtr = 0;    Int_t numtr = 0;
3045    Int_t repuntil = 0;    Int_t repuntil = 0;
3046      Int_t repuntiltr = 0;
3047    //      //  
3048    //    //
3049    var.tofraw = 0;    var.tofraw = 0;
3050    //    //
3051    if ( level.file == 2 ) repuntil = L2->GetToFLevel2()->ntrk();        if ( level.file == 2 ) repuntil = L2->GetToFLevel2()->ntrk();    
3052    //  printf("repuntil = %i \n",repuntil);    //  printf("repuntil = %i \n",repuntil);
3053    //if ( level.file == 2 ) repuntil = L2->GetTrkLevel2()->GetNTracks();        if ( level.file == 2 ) repuntiltr = L2->GetTrkLevel2()->GetNTracks();    
3054    //repuntil = L2->GetNTracks();        //  repuntiltr = L2->GetNTracks();    
3055    //    //
3056    while ( repeat ){    while ( repeat ){
3057      //    printf("B repuntil = %i \n",repuntil);      //    printf("B repuntil = %i \n",repuntil);
# Line 2745  void FEVdetector::ShowTOF(){ Line 3060  void FEVdetector::ShowTOF(){
3060        //        //
3061        //        //
3062        ToFTrkVar *ptt = 0;        ToFTrkVar *ptt = 0;
3063  //      PamTrack *ptrack = 0;        PamTrack *ptrack = 0;
3064        Float_t adc[4][12];        Float_t adc[4][12];
3065        Float_t tdc[4][12];        Float_t tdc[4][12];
3066        memset(adc,0,4*12*sizeof(Float_t));        memset(adc,0,4*12*sizeof(Float_t));
3067        memset(tdc,0,4*12*sizeof(Float_t));        memset(tdc,0,4*12*sizeof(Float_t));
3068        //              //      
3069        //        //
3070          Int_t myseq = 0;
3071        //      if ( repuntil == 0 || var.tofraw ){        //      if ( repuntil == 0 || var.tofraw ){
3072        if ( repuntil == 1 || var.tofraw ){        if ( repuntil == 1 || var.tofraw ){
3073          numtr = 0;          numtr = 0;
# Line 2759  void FEVdetector::ShowTOF(){ Line 3075  void FEVdetector::ShowTOF(){
3075          repeat = false;          repeat = false;
3076        } else {        } else {
3077          //          //
3078    //        printf(" deH_ \n");
3079          //          //
3080          if ( numtr >= repuntil-1 ) repeat = false;          if ( numtr == 0 ){
3081          //  //          printf(" ques \n");
3082          //      printf(" numtr is %i \n",numtr);            ptt = L2->GetToFLevel2()->GetToFTrkVar(0);
3083          ptt = L2->GetToFLevel2()->GetToFTrkVar(numtr);              myseq = 0;
3084          //ptrack = L2->GetTrack(numtr);  //          printf(" que \n");
3085          //ptt = ptrack->GetToFTrack();  
3086            } else {
3087              if ( numtr >= (repuntiltr-1) ) repeat = false;
3088              //
3089              printf(" numtr is %i \n",numtr);
3090              // ptt = L2->GetToFLevel2()->GetToFTrkVar(numtr);    
3091              ptrack = L2->GetTrack(numtr-1);
3092              ptt = ptrack->GetToFTrack();
3093              myseq = ptt->trkseqno + 1;
3094            };
3095        };        };
3096        //        //
3097        xp11[0] = 0.;        xp11[0] = 0.;
# Line 2779  void FEVdetector::ShowTOF(){ Line 3105  void FEVdetector::ShowTOF(){
3105        //        //
3106        ii = 2;        ii = 2;
3107        //        //
3108        Int_t myseq = ptt->trkseqno + 1;        //      Int_t myseq = ptt->trkseqno + 1;
3109          //
3110    //      printf(" qui \n");
3111        L2->GetToFLevel2()->GetMatrix(myseq,adc,tdc);        L2->GetToFLevel2()->GetMatrix(myseq,adc,tdc);
3112        //        //
3113        //      printf(" qua \n");  //      printf(" qua \n");
3114        //        //
3115        for ( Int_t i = 0; i<8; i++ ) {          //       for ( Int_t i = 0; i<8; i++ ) {  
3116          if ( adc[ch11a[i]][hb11a[i]] < 1000. ){        //        if ( adc[ch11a[i]][hb11a[i]] < 1000. ){
3117            ms11a[i] = adc[ch11a[i]][hb11a[i]];        //          ms11a[i] = adc[ch11a[i]][hb11a[i]];
3118          };              //        };      
3119          if ( adc[ch11b[i]][hb11b[i]] < 1000. ){        //        if ( adc[ch11b[i]][hb11b[i]] < 1000. ){
3120            ms11b[i] = adc[ch11b[i]][hb11b[i]];        //          ms11b[i] = adc[ch11b[i]][hb11b[i]];
3121          };        //        };
3122          //      xp11[i] = 0.;        //        xp11[i] = 0.;
3123        };        //    };
3124    
3125        Int_t nmtof = 0;        Int_t nmtof = 0;
3126        Float_t mtof = 0.;        Float_t mtof = 0.;
# Line 2909  void FEVdetector::ShowTOF(){ Line 3237  void FEVdetector::ShowTOF(){
3237        if ( level.file == -1 ){        if ( level.file == -1 ){
3238          ColorMIP(ms11a[j]+ms11b[j],colo);                ColorMIP(ms11a[j]+ms11b[j],colo);      
3239        } else {        } else {
3240          ColorTOFMIP(ms11a[j]+ms11b[j],colo);              ColorTOFMIP((ms11a[j]+ms11b[j])/2.,colo);      
3241        };        };
3242        //        //
3243        if ( colo != 10 ) ocolo = colo;        if ( colo != 10 ) ocolo = colo;
# Line 2954  void FEVdetector::ShowTOF(){ Line 3282  void FEVdetector::ShowTOF(){
3282          if ( higp > 0.164 ) higp = 0.164;          if ( higp > 0.164 ) higp = 0.164;
3283          if ( lowp < higp && ( level.file == -1 || (level.file == 2 && xp11[rj] != 0.))){          if ( lowp < higp && ( level.file == -1 || (level.file == 2 && xp11[rj] != 0.))){
3284            Float_t nxc1[5]={ lowp, higp, higp, lowp, lowp};            Float_t nxc1[5]={ lowp, higp, higp, lowp, lowp};
3285            Float_t nyc1[5]={ 0.0015,         0.0015,                ws13-0.0015,    ws13-0.0015,    0.0015};            Float_t nyc1[5]={ 0.0015,         0.0015,                (float)(ws13-0.0015),    (float)(ws13-0.0015),    0.0015};
3286            Float_t nxc[5];                Float_t nxc[5];    
3287            Float_t nyc[5];            Float_t nyc[5];
3288            for (Int_t i = 0; i<5 ; i++) {            for (Int_t i = 0; i<5 ; i++) {
# Line 2998  void FEVdetector::ShowTOF(){ Line 3326  void FEVdetector::ShowTOF(){
3326        if ( level.file == -1 ){        if ( level.file == -1 ){
3327          ColorMIP(ms12a[rj]+ms12b[rj],colo);          ColorMIP(ms12a[rj]+ms12b[rj],colo);
3328        } else {        } else {
3329          ColorTOFMIP(ms12a[rj]+ms12b[rj],colo);          ColorTOFMIP((ms12a[rj]+ms12b[rj])/2.,colo);
3330        };        };
3331        //        //
3332        if ( colo != 10 ) ocolo = colo;        if ( colo != 10 ) ocolo = colo;
# Line 3040  void FEVdetector::ShowTOF(){ Line 3368  void FEVdetector::ShowTOF(){
3368            if ( higp > 0.203 ) higp = 0.203;            if ( higp > 0.203 ) higp = 0.203;
3369            if ( lowp < higp && ( level.file == -1 || (level.file == 2 && xp12[j] != 0.))){            if ( lowp < higp && ( level.file == -1 || (level.file == 2 && xp12[j] != 0.))){
3370              Float_t nxc1[5]={ lowp, higp, higp, lowp, lowp};              Float_t nxc1[5]={ lowp, higp, higp, lowp, lowp};
3371              Float_t nyc1[5]={ -0.0015,         -0.0015,                -ws13+0.0015,    -ws13+0.0015,    -0.0015};              Float_t nyc1[5]={ -0.0015,         -0.0015,                (float)(-ws13+0.0015),    (float)(-ws13+0.0015),    -0.0015};
3372              Float_t nxc[5];                  Float_t nxc[5];    
3373              Float_t nyc[5];              Float_t nyc[5];
3374              for (Int_t i = 0; i<5 ; i++) {              for (Int_t i = 0; i<5 ; i++) {
# Line 3075  void FEVdetector::ShowTOF(){ Line 3403  void FEVdetector::ShowTOF(){
3403        for (Int_t i = 0; i<5 ; i++) {        for (Int_t i = 0; i<5 ; i++) {
3404          nxc[i]= xs2y + nxc1[i]*var.sfx;          nxc[i]= xs2y + nxc1[i]*var.sfx;
3405          nyc[i] = ys2y + nyc1[i]*var.sfy;          nyc[i] = ys2y + nyc1[i]*var.sfy;
3406            //        printf(" TOF i %i x %f y %f \n",i,nxc[i],nyc[i]);
3407        };        };
3408        ftof21y[j] = new TPolyLine(5,nxc,nyc);        ftof21y[j] = new TPolyLine(5,nxc,nyc);
3409        ftof21y[j]->SetLineColor(1);        ftof21y[j]->SetLineColor(1);
# Line 3086  void FEVdetector::ShowTOF(){ Line 3415  void FEVdetector::ShowTOF(){
3415        if ( level.file == -1 ){        if ( level.file == -1 ){
3416          ColorMIP(ms21a[rj]+ms21b[rj],colo);          ColorMIP(ms21a[rj]+ms21b[rj],colo);
3417        } else {        } else {
3418          ColorTOFMIP(ms21a[rj]+ms21b[rj],colo);          ColorTOFMIP((ms21a[rj]+ms21b[rj])/2.,colo);
3419        };        };
3420        //        //
3421        if ( colo != 10 ) ocolo = colo;        if ( colo != 10 ) ocolo = colo;
# Line 3128  void FEVdetector::ShowTOF(){ Line 3457  void FEVdetector::ShowTOF(){
3457            if ( higp > 0.089 ) higp = 0.089;            if ( higp > 0.089 ) higp = 0.089;
3458            if ( lowp < higp && ( level.file == -1 || (level.file == 2 && xp21[j] != 0.))){            if ( lowp < higp && ( level.file == -1 || (level.file == 2 && xp21[j] != 0.))){
3459              Float_t nxc1[5]={ lowp, higp, higp, lowp, lowp};              Float_t nxc1[5]={ lowp, higp, higp, lowp, lowp};
3460              Float_t nyc1[5]={ 0.0015,         0.0015,                ws2-0.0015,    ws2-0.0015,    0.};              Float_t nyc1[5]={ 0.0015,         0.0015,                (float)(ws2-0.0015),    (float)(ws2-0.0015),    0.};
3461              Float_t nxc[5];                  Float_t nxc[5];    
3462              Float_t nyc[5];              Float_t nyc[5];
3463              for (Int_t i = 0; i<5 ; i++) {              for (Int_t i = 0; i<5 ; i++) {
# Line 3172  void FEVdetector::ShowTOF(){ Line 3501  void FEVdetector::ShowTOF(){
3501        if ( level.file == -1 ){        if ( level.file == -1 ){
3502          ColorMIP(ms22a[j]+ms22b[j],colo);          ColorMIP(ms22a[j]+ms22b[j],colo);
3503        } else {        } else {
3504          ColorTOFMIP(ms22a[j]+ms22b[j],colo);          ColorTOFMIP((ms22a[j]+ms22b[j])/2.,colo);
3505        };        };
3506        //        //
3507        if ( colo != 10 ) ocolo = colo;        if ( colo != 10 ) ocolo = colo;
# Line 3219  void FEVdetector::ShowTOF(){ Line 3548  void FEVdetector::ShowTOF(){
3548            if ( higp > 0.074 ) higp = 0.074;            if ( higp > 0.074 ) higp = 0.074;
3549            if ( lowp < higp && ( level.file == -1 || (level.file == 2 && xp22[rj] != 0.))){            if ( lowp < higp && ( level.file == -1 || (level.file == 2 && xp22[rj] != 0.))){
3550              Float_t nxc1[5]={ lowp, higp, higp, lowp, lowp};              Float_t nxc1[5]={ lowp, higp, higp, lowp, lowp};
3551              Float_t nyc1[5]={ -0.0015,         -0.0015,                -ws2+0.0015,    -ws2+0.0015,    -0.0015};              Float_t nyc1[5]={ -0.0015,         -0.0015,                (float)(-ws2+0.0015),    (float)(-ws2+0.0015),    -0.0015};
3552              Float_t nxc[5];                  Float_t nxc[5];    
3553              Float_t nyc[5];              Float_t nyc[5];
3554              for (Int_t i = 0; i<5 ; i++) {              for (Int_t i = 0; i<5 ; i++) {
# Line 3263  void FEVdetector::ShowTOF(){ Line 3592  void FEVdetector::ShowTOF(){
3592        if ( level.file == -1 ){        if ( level.file == -1 ){
3593          ColorMIP(ms31a[j]+ms31b[j],colo);          ColorMIP(ms31a[j]+ms31b[j],colo);
3594        } else {        } else {
3595          ColorTOFMIP(ms31a[j]+ms31b[j],colo);          ColorTOFMIP((ms31a[j]+ms31b[j])/2.,colo);
3596        };        };
3597        //        //
3598        if ( colo != 10 ) ocolo = colo;        if ( colo != 10 ) ocolo = colo;
# Line 3310  void FEVdetector::ShowTOF(){ Line 3639  void FEVdetector::ShowTOF(){
3639            if ( higp > 0.074 ) higp = 0.074;            if ( higp > 0.074 ) higp = 0.074;
3640            if ( lowp < higp && ( level.file == -1 || (level.file == 2 && xp31[rj] != 0.))){            if ( lowp < higp && ( level.file == -1 || (level.file == 2 && xp31[rj] != 0.))){
3641              Float_t nxc1[5]={ lowp, higp, higp, lowp, lowp};              Float_t nxc1[5]={ lowp, higp, higp, lowp, lowp};
3642              Float_t nyc1[5]={ 0.0015,         0.0015,                ws13-0.0015,    ws13-0.0015,    0.0015};              Float_t nyc1[5]={ 0.0015,         0.0015,                (float)(ws13-0.0015),    (float)(ws13-0.0015),    0.0015};
3643              Float_t nxc[5];                  Float_t nxc[5];    
3644              Float_t nyc[5];              Float_t nyc[5];
3645              for (Int_t i = 0; i<5 ; i++) {              for (Int_t i = 0; i<5 ; i++) {
# Line 3356  void FEVdetector::ShowTOF(){ Line 3685  void FEVdetector::ShowTOF(){
3685        if ( level.file == -1 ){        if ( level.file == -1 ){
3686          ColorMIP(ms32a[rj]+ms32b[rj],colo);          ColorMIP(ms32a[rj]+ms32b[rj],colo);
3687        } else {        } else {
3688          ColorTOFMIP(ms32a[rj]+ms32b[rj],colo);          ColorTOFMIP((ms32a[rj]+ms32b[rj])/2.,colo);
3689        };        };
3690        //        //
3691        if ( colo != 10 ) ocolo = colo;        if ( colo != 10 ) ocolo = colo;
# Line 3398  void FEVdetector::ShowTOF(){ Line 3727  void FEVdetector::ShowTOF(){
3727            if ( higp > 0.089 ) higp = 0.089;            if ( higp > 0.089 ) higp = 0.089;
3728            if ( lowp < higp && ( level.file == -1 || (level.file == 2 && xp32[j] != 0.))){            if ( lowp < higp && ( level.file == -1 || (level.file == 2 && xp32[j] != 0.))){
3729              Float_t nxc1[5]={ lowp, higp, higp, lowp, lowp};              Float_t nxc1[5]={ lowp, higp, higp, lowp, lowp};
3730              Float_t nyc1[5]={ -0.0015,         -0.0015,                -ws13+0.0015,    -ws13+0.0015,    -0.0015};              Float_t nyc1[5]={ -0.0015,         -0.0015,                (float)(-ws13+0.0015),    (float)(-ws13+0.0015),    -0.0015};
3731              Float_t nxc[5];                  Float_t nxc[5];    
3732              Float_t nyc[5];              Float_t nyc[5];
3733              for (Int_t i = 0; i<5 ; i++) {              for (Int_t i = 0; i<5 ; i++) {
# Line 3774  void FEVdetector::ShowAC(){ Line 4103  void FEVdetector::ShowAC(){
4103    //    //
4104    if ( true ){    if ( true ){
4105      // PMTs      // PMTs
4106      Float_t xc1[5]={ 0., 0.014*var.sfx, 0.014*var.sfx-var.sfx*var.sfx*pmt1*cos(apmt1), -var.sfx*var.sfx*pmt1*cos(apmt1), 0.};      Float_t xc1[5]={ 0., (float)(0.014*var.sfx), (float)(0.014*var.sfx-var.sfx*var.sfx*pmt1*cos(apmt1)), (float)(-var.sfx*var.sfx*pmt1*cos(apmt1)), 0.};
4107      Float_t yc1[5]={ 0., 0.011*var.sfy, 0.011*var.sfy+var.sfy*var.sfy*pmt1*sin(apmt1), var.sfy*var.sfy*pmt1*sin(apmt1), 0.};      Float_t yc1[5]={ 0., (float)(0.011*var.sfy), (float)(0.011*var.sfy+var.sfy*var.sfy*pmt1*sin(apmt1)), (float)(var.sfy*var.sfy*pmt1*sin(apmt1)), 0.};
4108      Float_t xc2[5]={ 0., 0.011*var.sfx, 0.011*var.sfx-pmt2*var.sfx*var.sfx*cos(apmt2), -pmt2*var.sfx*var.sfx*cos(apmt2), 0.};      Float_t xc2[5]={ 0., (float)(0.011*var.sfx), (float)(0.011*var.sfx-pmt2*var.sfx*var.sfx*cos(apmt2)), (float)(-pmt2*var.sfx*var.sfx*cos(apmt2)), 0.};
4109      Float_t yc2[5]={ 0., 0.015*var.sfy, 0.015*var.sfy+var.sfy*pmt2*var.sfy*sin(apmt2), var.sfy*pmt2*var.sfy*sin(apmt2), 0.};      Float_t yc2[5]={ 0., (float)(0.015*var.sfy), (float)(0.015*var.sfy+var.sfy*pmt2*var.sfy*sin(apmt2)), (float)(var.sfy*pmt2*var.sfy*sin(apmt2)), 0.};
4110      // SCINTs      // SCINTs
4111      Float_t xcc1[10]={-0.149, -0.090165, -0.090165, -0.149, -0.242, -0.257, -0.212,   -0.257,   -0.242,   -0.149};      Float_t xcc1[10]={-0.149, -0.090165, -0.090165, -0.149, -0.242, -0.257, -0.212,   -0.257,   -0.242,   -0.149};
4112      Float_t ycc1[10]={ 0.169,  0.108165, -0.108165, -0.169, -0.169, -0.158, 0.,   0.158,    0.169,    0.169};      Float_t ycc1[10]={ 0.169,  0.108165, -0.108165, -0.169, -0.169, -0.158, 0.,   0.158,    0.169,    0.169};
# Line 5198  void FEVdetector::ShowTRK(Bool_t upd){ Line 5527  void FEVdetector::ShowTRK(Bool_t upd){
5527              trkpad[planepad]->Range(-8.1,0.,8.1,8.);              trkpad[planepad]->Range(-8.1,0.,8.1,8.);
5528              //              //
5529              x = track->xm[plane];              x = track->xm[plane];
5530              Float_t xsig = track->dedx_x[plane];              Float_t xsig = fabs(track->dedx_x[plane]);
5531              if ( track->XGood(plane) ){              if ( track->XGood(plane) ){
5532                //if ( x > -100 ){                //if ( x > -100 ){
5533                if ( xsig > 8. ) xsig = 8.;                if ( xsig > 8. ) xsig = 8.;
# Line 5207  void FEVdetector::ShowTRK(Bool_t upd){ Line 5536  void FEVdetector::ShowTRK(Bool_t upd){
5536                } else {                } else {
5537                  sigcol2 = 1;                  sigcol2 = 1;
5538                };                };
5539                ColorTRKMIP(track->dedx_x[plane],sigcol2,0);                ColorTRKMIP(fabs(track->dedx_x[plane]),sigcol2,0);
5540                linea = new TLine(x,0.01,x,xsig);                linea = new TLine(x,0.01,x,xsig);
5541                linea->SetLineWidth(2);                linea->SetLineWidth(2);
5542                linea->SetLineColor(sigcol2);                linea->SetLineColor(sigcol2);
5543                linea->Draw();                linea->Draw();
5544                Float_t tx[5] = {x-0.3, x+0.3, x+0.3, x-0.3, x-0.3};                Float_t tx[5] = {(float)(x-0.3), (float)(x+0.3), (float)(x+0.3), (float)(x-0.3), (float)(x-0.3)};
5545                Float_t tz[5] = {0., 0., 0.5, 0.5, 0.};                Float_t tz[5] = {0., 0., 0.5, 0.5, 0.};
5546                TPolyLine *tlinea = new TPolyLine(5,tx,tz);                TPolyLine *tlinea = new TPolyLine(5,tx,tz);
5547                tlinea->SetLineWidth(1);                tlinea->SetLineWidth(1);
# Line 5228  void FEVdetector::ShowTRK(Bool_t upd){ Line 5557  void FEVdetector::ShowTRK(Bool_t upd){
5557              trkpad[planepad]->cd();              trkpad[planepad]->cd();
5558              trkpad[planepad]->Range(-7.05,0.,7.05,8.);              trkpad[planepad]->Range(-7.05,0.,7.05,8.);
5559              x = -track->ym[plane];              x = -track->ym[plane];
5560              xsig = track->dedx_y[plane];              xsig = fabs(track->dedx_y[plane]);
5561              if ( track->YGood(plane) ){              if ( track->YGood(plane) ){
5562                //            if ( x > -100 ){                //            if ( x > -100 ){
5563                if ( xsig > 8. ) xsig = 8.;                if ( xsig > 8. ) xsig = 8.;
# Line 5237  void FEVdetector::ShowTRK(Bool_t upd){ Line 5566  void FEVdetector::ShowTRK(Bool_t upd){
5566                } else {                } else {
5567                  sigcol2 = 1;                  sigcol2 = 1;
5568                };                };
5569                ColorTRKMIP(track->dedx_y[plane],sigcol2,0);                ColorTRKMIP(fabs(track->dedx_y[plane]),sigcol2,0);
5570                linea = new TLine(x,0.01,x,xsig);                linea = new TLine(x,0.01,x,xsig);
5571                linea->SetLineWidth(2);                linea->SetLineWidth(2);
5572                linea->SetLineColor(sigcol2);                linea->SetLineColor(sigcol2);
5573                linea->Draw();                linea->Draw();
5574                Float_t tx[5] = {x-0.3, x+0.3, x+0.3, x-0.3, x-0.3};                Float_t tx[5] = {(float)(x-0.3), (float)(x+0.3), (float)(x+0.3), (float)(x-0.3), (float)(x-0.3)};
5575                Float_t tz[5] = {0., 0., 0.5, 0.5, 0.};                Float_t tz[5] = {0., 0., 0.5, 0.5, 0.};
5576                TPolyLine *tlinea = new TPolyLine(5,tx,tz);                TPolyLine *tlinea = new TPolyLine(5,tx,tz);
5577                tlinea->SetLineColor(dcol);                tlinea->SetLineColor(dcol);
# Line 5290  void FEVdetector::ShowTRK(Bool_t upd){ Line 5619  void FEVdetector::ShowTRK(Bool_t upd){
5619              //              //
5620              x = track->xm[plane];              x = track->xm[plane];
5621              Float_t y = -track->ym[plane];              Float_t y = -track->ym[plane];
5622              Float_t xsig = track->dedx_x[plane];              Float_t xsig = fabs(track->dedx_x[plane]);
5623              Float_t ysig = track->dedx_y[plane];              Float_t ysig = fabs(track->dedx_y[plane]);
5624              //    if ( x > -100 && y > -100. ){              //    if ( x > -100 && y > -100. ){
5625              if ( track->XGood(plane) && track->YGood(plane) ){              if ( track->XGood(plane) && track->YGood(plane) ){
5626                if ( var.bw ){                if ( var.bw ){
# Line 5710  void FEVdetector::ShowTrack(){ Line 6039  void FEVdetector::ShowTrack(){
6039        //      printf("qua \n");        //      printf("qua \n");
6040        Int_t npoint = 100;        Int_t npoint = 100;
6041        Float_t zin[100];        Float_t zin[100];
6042        Double_t xout[100];        //      Double_t xout[100];
6043        Double_t yout[100];        //      Double_t yout[100];
6044        Int_t ifail = 0;        Int_t ifail = 0;
6045        Int_t trcol = 10;        Int_t trcol = 10;
6046        //        //
# Line 5729  void FEVdetector::ShowTrack(){ Line 6058  void FEVdetector::ShowTrack(){
6058        Float_t tzy1[15];        Float_t tzy1[15];
6059        //        //
6060        for ( Int_t e = 0; e < 100 ; e++) {        for ( Int_t e = 0; e < 100 ; e++) {
6061          xout[e] = 0.;          //      xout[e] = 0.;
6062          yout[e] = 0.;          //      yout[e] = 0.;
6063          //          //
6064          tx[e] = 0.;          tx[e] = 0.;
6065          ty[e] = 0.;          ty[e] = 0.;
# Line 5756  void FEVdetector::ShowTrack(){ Line 6085  void FEVdetector::ShowTrack(){
6085        //        //
6086        Trajectory *tr = new Trajectory(npoint,zin);                                      Trajectory *tr = new Trajectory(npoint,zin);                              
6087        //        //
6088        ifail = track->DoTrack2(tr);        //      ifail = track->DoTrack2(tr);
6089          ifail = track->DoTrack(tr);
6090        //        //
6091        if ( !ifail ){        if ( !ifail ){
6092          for ( Int_t e = 0; e < npoint ; e++) {          for ( Int_t e = 0; e < npoint ; e++) {
# Line 5904  void FEVdetector::ShowCalo(Bool_t upd){ Line 6234  void FEVdetector::ShowCalo(Bool_t upd){
6234      //      //
6235      stringstream xevent;      stringstream xevent;
6236      stringstream yevent;      stringstream yevent;
6237      Float_t sdexy[2][22][96];      //    Float_t sdexy[2][22][96];
6238      Float_t sdexyc[2][22][96];      //    Float_t sdexyc[2][22][96];
6239      //      //
6240      for (Int_t m = 0; m < 22; m++){      for (Int_t m = 0; m < 22; m++){
6241        for (Int_t l = 0; l < 2; l++){        for (Int_t l = 0; l < 2; l++){
# Line 5920  void FEVdetector::ShowCalo(Bool_t upd){ Line 6250  void FEVdetector::ShowCalo(Bool_t upd){
6250          //          //
6251          // determine what kind of event we are going to analyze          // determine what kind of event we are going to analyze
6252          //          //
6253          bool isCOMP = 0;          //      bool isCOMP = 0;
6254          bool isFULL = 0;          //      bool isFULL = 0;
6255          bool isRAW = 0;          bool isRAW = 0;
6256          if ( de->stwerr[se] & (1 << 16) ) isCOMP = 1;          //      if ( de->stwerr[se] & (1 << 16) ) isCOMP = 1;
6257          if ( de->stwerr[se] & (1 << 17) ) isFULL = 1;          //      if ( de->stwerr[se] & (1 << 17) ) isFULL = 1;
6258          if ( de->stwerr[se] & (1 << 3) ) isRAW = 1;              if ( de->stwerr[se] & (1 << 3) ) isRAW = 1;    
6259          //          //
6260          // save the prevoius energy deposit and calibration in sbase, sdexy, sdexyc          // save the prevoius energy deposit and calibration in sbase, sdexy, sdexyc
# Line 5934  void FEVdetector::ShowCalo(Bool_t upd){ Line 6264  void FEVdetector::ShowCalo(Bool_t upd){
6264            for (Int_t nn = 0; nn < 96; nn++){                            for (Int_t nn = 0; nn < 96; nn++){                
6265              if ( nn%16 == 0 ) pre++;                              if ( nn%16 == 0 ) pre++;                
6266              evento.base[l][m][pre] = calib.calbase[l][m][pre];              evento.base[l][m][pre] = calib.calbase[l][m][pre];
6267              sdexy[l][m][nn] = evento.dexy[l][m][nn];              //      sdexy[l][m][nn] = evento.dexy[l][m][nn];
6268              evento.dexy[l][m][nn] = de->dexy[l][m][nn] ;              evento.dexy[l][m][nn] = de->dexy[l][m][nn] ;
6269              sdexyc[l][m][nn] = evento.dexy[l][m][nn];              //      sdexyc[l][m][nn] = evento.dexy[l][m][nn];
6270              evento.dexyc[l][m][nn] = de->dexy[l][m][nn] ;              evento.dexyc[l][m][nn] = de->dexy[l][m][nn] ;
6271            };            };
6272          };          };
# Line 6032  void FEVdetector::ShowCalo(Bool_t upd){ Line 6362  void FEVdetector::ShowCalo(Bool_t upd){
6362      // Define variables      // Define variables
6363      //      //
6364      UInt_t etime = var.etime;      UInt_t etime = var.etime;
6365      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];
6366      Int_t badstrip = 0;      Int_t badstrip = 0;
6367      qtot = 0.;      qtot = 0.;
6368      nstrip = 0;      nstrip = 0;
# Line 6128  void FEVdetector::ShowCalo(Bool_t upd){ Line 6458  void FEVdetector::ShowCalo(Bool_t upd){
6458          //          //
6459          // determine what kind of event we are going to analyze          // determine what kind of event we are going to analyze
6460          //          //
6461          bool isCOMP = 0;          //      bool isCOMP = 0;
6462          bool isFULL = 0;          //      bool isFULL = 0;
6463          bool isRAW = 0;          bool isRAW = 0;
6464          if ( de->stwerr[se] & (1 << 16) ) isCOMP = 1;          //      if ( de->stwerr[se] & (1 << 16) ) isCOMP = 1;
6465          if ( de->stwerr[se] & (1 << 17) ) isFULL = 1;          //      if ( de->stwerr[se] & (1 << 17) ) isFULL = 1;
6466          if ( de->stwerr[se] & (1 << 3) ) isRAW = 1;          if ( de->stwerr[se] & (1 << 3) ) isRAW = 1;
6467          //          //
6468          // save the prevoius energy deposit and calibration in sbase, sdexy, sdexyc          // save the prevoius energy deposit and calibration in sbase, sdexy, sdexyc
# Line 6142  void FEVdetector::ShowCalo(Bool_t upd){ Line 6472  void FEVdetector::ShowCalo(Bool_t upd){
6472            for (Int_t nn = 0; nn < 96; nn++){                            for (Int_t nn = 0; nn < 96; nn++){                
6473              if ( nn%16 == 0 ) pre++;                              if ( nn%16 == 0 ) pre++;                
6474              evento.base[l][m][pre] = calib.calbase[l][m][pre];              evento.base[l][m][pre] = calib.calbase[l][m][pre];
6475              sdexy[l][m][nn] = evento.dexy[l][m][nn];              //      sdexy[l][m][nn] = evento.dexy[l][m][nn];
6476              evento.dexy[l][m][nn] = de->dexy[l][m][nn] ;              evento.dexy[l][m][nn] = de->dexy[l][m][nn] ;
6477              sdexyc[l][m][nn] = evento.dexy[l][m][nn];              //      sdexyc[l][m][nn] = evento.dexy[l][m][nn];
6478              evento.dexyc[l][m][nn] = de->dexy[l][m][nn] ;              evento.dexyc[l][m][nn] = de->dexy[l][m][nn] ;
6479            };            };
6480          };          };
# Line 6153  void FEVdetector::ShowCalo(Bool_t upd){ Line 6483  void FEVdetector::ShowCalo(Bool_t upd){
6483          //          //
6484          Int_t done = 0;          Int_t done = 0;
6485          Int_t rdone = 0;          Int_t rdone = 0;
6486          Int_t fdone = 0;                      //      Int_t fdone = 0;            
6487          pre = -1;          pre = -1;
6488          for (Int_t n =0 ; n < 96; n++){                      for (Int_t n =0 ; n < 96; n++){            
6489            if ( n%16 == 0 ) {            if ( n%16 == 0 ) {
6490              pre++;              pre++;
6491              done = 0;              done = 0;
6492              rdone = 0;              rdone = 0;
6493              fdone = 0;              //      fdone = 0;
6494            };                };    
6495            //            //
6496            // baseline check and calculation            // baseline check and calculation
# Line 6327  void FEVdetector::ShowCalo(Bool_t upd){ Line 6657  void FEVdetector::ShowCalo(Bool_t upd){
6657      //      //
6658      stringstream xvev;      stringstream xvev;
6659      stringstream yvev;          stringstream yvev;    
6660      for (Int_t ii = 0; ii < L2->GetCaloLevel2()->nstrip; ii++){      //    for (Int_t ii = 0; ii < L2->GetCaloLevel2()->nstrip; ii++){
6661        for (Int_t ii = 0; ii < L2->GetCaloLevel1()->istrip; ii++){
6662        Int_t colo;        Int_t colo;
6663        Int_t l;        Int_t l;
6664        Int_t m;        Int_t m;
6665        Int_t n;        Int_t n;
6666        Float_t mip = L2->GetCaloLevel1()->DecodeEstrip(ii,l,m,n);        Bool_t satura = false;
6667          Float_t mip = L2->GetCaloLevel1()->DecodeEstrip(ii,l,m,n,satura);
6668        if ( var.bw ){        if ( var.bw ){
6669          colo = -1;          colo = -1;
6670        } else {        } else {
6671          colo = 1;          colo = 1;
6672        };        };      
6673        ColorMIP(mip,colo);        ColorMIP(mip,colo);
6674        if ( l == 0 ) {        if ( l == 0 ) {
6675          xvev.str("");          xvev.str("");
# Line 6346  void FEVdetector::ShowCalo(Bool_t upd){ Line 6678  void FEVdetector::ShowCalo(Bool_t upd){
6678          xvev << " " << l;          xvev << " " << l;
6679          gDirectory->Delete(xvev.str().c_str());          gDirectory->Delete(xvev.str().c_str());
6680          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);
6681          Xview->SetFillColor(colo);          if ( satura ){
6682              Xview->SetFillColor(kBlack);
6683            } else {
6684              Xview->SetFillColor(colo);
6685            };
6686          Xview->Fill(n,21-m,1.);          Xview->Fill(n,21-m,1.);
6687          pd1->cd();                                            pd1->cd();                                  
6688          Xview->Draw("box same");          Xview->Draw("box same");
# Line 6358  void FEVdetector::ShowCalo(Bool_t upd){ Line 6694  void FEVdetector::ShowCalo(Bool_t upd){
6694          yvev << " " << l;          yvev << " " << l;
6695          gDirectory->Delete(yvev.str().c_str());          gDirectory->Delete(yvev.str().c_str());
6696          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);                  
6697          Yview->SetFillColor(colo);          if ( satura ){
6698              Yview->SetFillColor(kBlack);
6699            } else {
6700              Yview->SetFillColor(colo);
6701            };
6702          Yview->Fill(96-n,21-m,1.);          Yview->Fill(96-n,21-m,1.);
6703          pd2->cd();          pd2->cd();
6704          Yview->Draw("box same");          Yview->Draw("box same");
# Line 6372  void FEVdetector::ShowCalo(Bool_t upd){ Line 6712  void FEVdetector::ShowCalo(Bool_t upd){
6712  }  }
6713    
6714  void FEVdetector::Calo1stcalib(){  void FEVdetector::Calo1stcalib(){
6715    Float_t estrip[2][22][96];    //  Float_t estrip[2][22][96];
6716    //        //    
6717    // this is the value of the mip for each strip. To be changed when we will have the real values    // this is the value of the mip for each strip. To be changed when we will have the real values
6718    //    //
# Line 6390  void FEVdetector::Calo1stcalib(){ Line 6730  void FEVdetector::Calo1stcalib(){
6730      for (Int_t k = 0; k < 22; k++ ){      for (Int_t k = 0; k < 22; k++ ){
6731        for (Int_t l = 0; l < 96; l++ ){        for (Int_t l = 0; l < 96; l++ ){
6732          calib.calped[m][k][l] = 0. ;          calib.calped[m][k][l] = 0. ;
6733          estrip[m][k][l] = 0.;          //      estrip[m][k][l] = 0.;
6734        };        };
6735      };      };
6736    }    }

Legend:
Removed from v.1.25  
changed lines
  Added in v.1.38

  ViewVC Help
Powered by ViewVC 1.1.23