/[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.31 by mocchiut, Fri Oct 2 12:51:01 2009 UTC
# Line 97  FEVdetector::FEVdetector(TString filenam Line 97  FEVdetector::FEVdetector(TString filenam
97    var.showac = false;    var.showac = false;
98  }  }
99    
100    void FEVdetector::Reset(){
101      L2 = NULL;
102    }
103    
104  void FEVdetector::checkctrlword(){  void FEVdetector::checkctrlword(){
105    var.SHOWDEC = 0;    var.SHOWDEC = 0;
106    var.TOF = 0;    var.TOF = 0;
# Line 206  void FEVdetector::ClearVariables(){ Line 210  void FEVdetector::ClearVariables(){
210  void FEVdetector::GetEntry(Int_t i){  void FEVdetector::GetEntry(Int_t i){
211    thisentry = i;      thisentry = i;  
212    if ( level.file == 2 ){    if ( level.file == 2 ){
213      L2->Clear();      //    L2->Clear();
214      //    printf("qui\n");      //    printf("qui\n");
215      L2->GetEntry(i);      L2->GetEntry(i);
216      if ( var.showall ){      if ( var.showall ){
# Line 394  void FEVdetector::ShowInfo(TString detec Line 398  void FEVdetector::ShowInfo(TString detec
398    Int_t dlen = 10;    Int_t dlen = 10;
399    //    //
400    char o[200000];    char o[200000];
401      char zz[200000];
402    char col[13];    char col[13];
403    char col2[13];    char col2[13];
404    //    //
405    setcolor(col,RESET, GREEN, WHITE);    setcolor(col,RESET, GREEN, WHITE);
406    sprintf(o,"%s======> EVENT:%i\n",col, thisentry);    sprintf(o,"%s======> EVENT:%i\n",col, thisentry);
407      sprintf(zz,"======> EVENT:%i\n", thisentry);
408    //    //
409    setcolor(col,RESET, RED, WHITE);    setcolor(col,RESET, RED, WHITE);
410    sprintf(o,"%s%sBranch %s\n",o,col,b1->GetName());    sprintf(o,"%s%sBranch %s\n",o,col,b1->GetName());
411      sprintf(zz,"%sBranch %s\n",zz,b1->GetName());
412    setcolor(col,RESET, BLACK, WHITE);    setcolor(col,RESET, BLACK, WHITE);
413    sprintf(o,"%s%s",o,col);    sprintf(o,"%s%s",o,col);
414    //    //
# Line 429  void FEVdetector::ShowInfo(TString detec Line 436  void FEVdetector::ShowInfo(TString detec
436        setcolor(col,RESET, BLUE, WHITE);        setcolor(col,RESET, BLUE, WHITE);
437        setcolor(col2,RESET, BLACK, WHITE);        setcolor(col2,RESET, BLACK, WHITE);
438        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);
439          sprintf(zz,"%s %-15s =",zz,((TBranch*)branch_array->At(l))->GetName());
440        //        //
441        j = 0;        j = 0;
442        //        //
# Line 441  void FEVdetector::ShowInfo(TString detec Line 449  void FEVdetector::ShowInfo(TString detec
449          while ( j < length ){          while ( j < length ){
450            if ( j < length -1 ){            if ( j < length -1 ){
451              sprintf(o,"%s %i ,",o,(Int_t)tb->GetValue(j,0));              sprintf(o,"%s %i ,",o,(Int_t)tb->GetValue(j,0));
452                sprintf(zz,"%s %i ,",zz,(Int_t)tb->GetValue(j,0));
453            } else {            } else {
454              sprintf(o,"%s %i",o,(Int_t)tb->GetValue(j,0));              sprintf(o,"%s %i",o,(Int_t)tb->GetValue(j,0));
455                sprintf(zz,"%s %i",zz,(Int_t)tb->GetValue(j,0));
456            };            };
457            j++;            j++;
458          };          };
# Line 454  void FEVdetector::ShowInfo(TString detec Line 464  void FEVdetector::ShowInfo(TString detec
464          while ( j < length ){          while ( j < length ){
465            if ( j < length -1 ){            if ( j < length -1 ){
466              sprintf(o,"%s %u ,",o,(UInt_t)tb->GetValue(j,0));              sprintf(o,"%s %u ,",o,(UInt_t)tb->GetValue(j,0));
467                sprintf(zz,"%s %u ,",zz,(UInt_t)tb->GetValue(j,0));
468            } else {            } else {
469              sprintf(o,"%s %u",o,(UInt_t)tb->GetValue(j,0));              sprintf(o,"%s %u",o,(UInt_t)tb->GetValue(j,0));
470                sprintf(zz,"%s %u",zz,(UInt_t)tb->GetValue(j,0));
471            };            };
472            j++;            j++;
473          };          };
# Line 467  void FEVdetector::ShowInfo(TString detec Line 479  void FEVdetector::ShowInfo(TString detec
479          while ( j < length ){          while ( j < length ){
480            if ( j < length -1 ){            if ( j < length -1 ){
481              sprintf(o,"%s %f ,",o,tb->GetValue(j,0));              sprintf(o,"%s %f ,",o,tb->GetValue(j,0));
482                sprintf(zz,"%s %f ,",zz,tb->GetValue(j,0));
483            } else {            } else {
484              sprintf(o,"%s %f",o,tb->GetValue(j,0));              sprintf(o,"%s %f",o,tb->GetValue(j,0));
485                sprintf(zz,"%s %f",zz,tb->GetValue(j,0));
486            };            };
487            j++;            j++;
488          };          };
# Line 503  void FEVdetector::ShowInfo(TString detec Line 517  void FEVdetector::ShowInfo(TString detec
517  //        printf("ciao %s \n",pr->Data());  //        printf("ciao %s \n",pr->Data());
518  //      };  //      };
519          sprintf(o,"%s TString - not implemented yet -",o);          sprintf(o,"%s TString - not implemented yet -",o);
520            sprintf(zz,"%s TString - not implemented yet -",zz);
521        };        };
522        //        //
523        // TArray        // TArray
# Line 603  void FEVdetector::ShowInfo(TString detec Line 618  void FEVdetector::ShowInfo(TString detec
618  //      sprintf(o,"%s\n",o);  //      sprintf(o,"%s\n",o);
619          //                //      
620          sprintf(o,"%s TArray - not implemented yet -",o);          sprintf(o,"%s TArray - not implemented yet -",o);
621            sprintf(zz,"%s TArray - not implemented yet -",zz);
622          //          //
623        };        };
624        //        //
625        sprintf(o,"%s\n",o);        sprintf(o,"%s\n",o);
626          sprintf(zz,"%s\n",zz);
627        break;        break;
628      case 3:      case 3:
629        //        //
# Line 615  void FEVdetector::ShowInfo(TString detec Line 632  void FEVdetector::ShowInfo(TString detec
632        setcolor(col,RESET, BLUE, WHITE);        setcolor(col,RESET, BLUE, WHITE);
633        setcolor(col2,RESET, BLACK, WHITE);        setcolor(col2,RESET, BLACK, WHITE);
634        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());
635          sprintf(zz,"%s %-15s = %d\n",zz,tb->GetName(), tb->GetNdata());
636    
637        //        //
638        if ( tb->GetNdata() ){        if ( tb->GetNdata() ){
# Line 665  void FEVdetector::ShowInfo(TString detec Line 683  void FEVdetector::ShowInfo(TString detec
683                  setcolor(col,RESET, BLUE, WHITE);                  setcolor(col,RESET, BLUE, WHITE);
684                  setcolor(col2,RESET, BLACK, WHITE);                  setcolor(col2,RESET, BLACK, WHITE);
685                  sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2);                  sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2);
686                    sprintf(zz,"%s %-15s = ",zz,foglia->GetName());
687                  while ( j < cl->GetEntriesFast() ){                  while ( j < cl->GetEntriesFast() ){
688                    if ( j < cl->GetEntriesFast() -1 ){                    if ( j < cl->GetEntriesFast() -1 ){
689                      sprintf(o,"%s %i ,",o,(Int_t)stb->GetValue(j,slength));                      sprintf(o,"%s %i ,",o,(Int_t)stb->GetValue(j,slength));
690                        sprintf(zz,"%s %i ,",zz,(Int_t)stb->GetValue(j,slength));
691                    } else {                    } else {
692                      sprintf(o,"%s %i",o,(Int_t)stb->GetValue(j,slength));                      sprintf(o,"%s %i",o,(Int_t)stb->GetValue(j,slength));
693                        sprintf(zz,"%s %i",zz,(Int_t)stb->GetValue(j,slength));
694                    };                    };
695                    j++;                    j++;
696                  };                  };
# Line 682  void FEVdetector::ShowInfo(TString detec Line 703  void FEVdetector::ShowInfo(TString detec
703                  setcolor(col,RESET, BLUE, WHITE);                  setcolor(col,RESET, BLUE, WHITE);
704                  setcolor(col2,RESET, BLACK, WHITE);                  setcolor(col2,RESET, BLACK, WHITE);
705                  sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2);                  sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2);
706                    sprintf(zz,"%s %-15s = ",zz,foglia->GetName());
707                  while ( j < cl->GetEntriesFast() ){                  while ( j < cl->GetEntriesFast() ){
708                    if ( j < cl->GetEntriesFast() -1 ){                    if ( j < cl->GetEntriesFast() -1 ){
709                      sprintf(o,"%s %f ,",o,stb->GetValue(j,slength));                      sprintf(o,"%s %f ,",o,stb->GetValue(j,slength));
710                        sprintf(zz,"%s %f ,",zz,stb->GetValue(j,slength));
711                    } else {                    } else {
712                      sprintf(o,"%s %f",o,stb->GetValue(j,slength));                      sprintf(o,"%s %f",o,stb->GetValue(j,slength));
713                        sprintf(zz,"%s %f",zz,stb->GetValue(j,slength));
714                    };                    };
715                    j++;                    j++;
716                  };                  };
# Line 699  void FEVdetector::ShowInfo(TString detec Line 723  void FEVdetector::ShowInfo(TString detec
723                  setcolor(col,RESET, BLUE, WHITE);                  setcolor(col,RESET, BLUE, WHITE);
724                  setcolor(col2,RESET, BLACK, WHITE);                  setcolor(col2,RESET, BLACK, WHITE);
725                  sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2);                  sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2);
726                    sprintf(zz,"%s %-15s = ",zz,foglia->GetName());
727                  Bool_t bold = true;                  Bool_t bold = true;
728                  while ( j < tb->GetNdata() ){                  while ( j < tb->GetNdata() ){
729                    if ( bold ){                    if ( bold ){
# Line 712  void FEVdetector::ShowInfo(TString detec Line 737  void FEVdetector::ShowInfo(TString detec
737                    while ( jj < slength ){                                      while ( jj < slength ){                  
738                      if ( jj < slength-1 ){                      if ( jj < slength-1 ){
739                        sprintf(o,"%s %f ,",o,stb->GetValue(j,jj,true));                        sprintf(o,"%s %f ,",o,stb->GetValue(j,jj,true));
740                          sprintf(zz,"%s %f ,",zz,stb->GetValue(j,jj,true));
741                      } else {                      } else {
742                        sprintf(o,"%s %f",o,stb->GetValue(j,jj,true));                        sprintf(o,"%s %f",o,stb->GetValue(j,jj,true));
743                          sprintf(zz,"%s %f",zz,stb->GetValue(j,jj,true));
744                      };                      };
745                      jj++;                      jj++;
746                    };                    };
747                    if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o);                    if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o);
748                      if ( j < tb->GetNdata() -1 ) sprintf(zz,"%s ,",zz);
749                    if ( !bold ){                    if ( !bold ){
750                      bold = true;                      bold = true;
751                    } else {                    } else {
# Line 738  void FEVdetector::ShowInfo(TString detec Line 766  void FEVdetector::ShowInfo(TString detec
766                  setcolor(col,RESET, BLUE, WHITE);                  setcolor(col,RESET, BLUE, WHITE);
767                  setcolor(col2,RESET, BLACK, WHITE);                  setcolor(col2,RESET, BLACK, WHITE);
768                  sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2);                  sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2);
769                    sprintf(zz,"%s %-15s = ",zz,foglia->GetName());
770                  while ( j < tb->GetNdata() ){                  while ( j < tb->GetNdata() ){
771                    Int_t jj = 0;                    Int_t jj = 0;
772                    while ( jj < slength ){                    while ( jj < slength ){
773                      if ( jj < slength-1 ){                      if ( jj < slength-1 ){
774                        sprintf(o,"%s %i ,",o,(Int_t)stb->GetValue(j,jj,true));                        sprintf(o,"%s %i ,",o,(Int_t)stb->GetValue(j,jj,true));
775                          sprintf(zz,"%s %i ,",zz,(Int_t)stb->GetValue(j,jj,true));
776                      } else {                      } else {
777                        sprintf(o,"%s %i",o,(Int_t)stb->GetValue(j,jj,true));                        sprintf(o,"%s %i",o,(Int_t)stb->GetValue(j,jj,true));
778                          sprintf(zz,"%s %i",zz,(Int_t)stb->GetValue(j,jj,true));
779                      };                      };
780                      jj++;                      jj++;
781                    };                    };
782                    if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o);                    if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o);
783                      if ( j < tb->GetNdata() -1 ) sprintf(zz,"%s ,",zz);
784                    j++;                    j++;
785                  };                  };
786                };                };
# Line 781  void FEVdetector::ShowInfo(TString detec Line 813  void FEVdetector::ShowInfo(TString detec
813                    setcolor(col,RESET, BLUE, WHITE);                    setcolor(col,RESET, BLUE, WHITE);
814                    setcolor(col2,RESET, BLACK, WHITE);                    setcolor(col2,RESET, BLACK, WHITE);
815                    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);
816                      sprintf(zz,"%s %s[%i] = ",zz,foglia->GetName(),arr->GetSize());
817                    //                    //
818                    while ( j < tb->GetNdata() ){                    while ( j < tb->GetNdata() ){
819                      //                      //
# Line 791  void FEVdetector::ShowInfo(TString detec Line 824  void FEVdetector::ShowInfo(TString detec
824                      while ( jj < arlen ){                      while ( jj < arlen ){
825                        if ( jj < arlen-1 ){                        if ( jj < arlen-1 ){
826                          sprintf(o,"%s %i ,",o,arr->At(jj));                          sprintf(o,"%s %i ,",o,arr->At(jj));
827                            sprintf(zz,"%s %i ,",zz,arr->At(jj));
828                        } else {                        } else {
829                          sprintf(o,"%s %i",o,arr->At(jj));                          sprintf(o,"%s %i",o,arr->At(jj));
830                            sprintf(zz,"%s %i",zz,arr->At(jj));
831                        };                        };
832                        jj++;                        jj++;
833                      };                      };
834                      if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o);                      if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o);
835                        if ( j < tb->GetNdata() -1 ) sprintf(zz,"%s ,",zz);
836                      j++;                      j++;
837                    };                    };
838                  };                  };
# Line 814  void FEVdetector::ShowInfo(TString detec Line 850  void FEVdetector::ShowInfo(TString detec
850                    setcolor(col,RESET, BLUE, WHITE);                    setcolor(col,RESET, BLUE, WHITE);
851                    setcolor(col2,RESET, BLACK, WHITE);                    setcolor(col2,RESET, BLACK, WHITE);
852                    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);
853                      sprintf(zz,"%s %s[%i] = ",zz,foglia->GetName(),arr->GetSize());
854                    //                    //
855                    while ( j < tb->GetNdata() ){                    while ( j < tb->GetNdata() ){
856                      //                      //
# Line 824  void FEVdetector::ShowInfo(TString detec Line 861  void FEVdetector::ShowInfo(TString detec
861                      while ( jj < arlen ){                      while ( jj < arlen ){
862                        if ( jj < arlen-1 ){                        if ( jj < arlen-1 ){
863                          sprintf(o,"%s %f ,",o,arr->At(jj));                          sprintf(o,"%s %f ,",o,arr->At(jj));
864                            sprintf(zz,"%s %f ,",zz,arr->At(jj));
865                        } else {                        } else {
866                          sprintf(o,"%s %f",o,arr->At(jj));                          sprintf(o,"%s %f",o,arr->At(jj));
867                            sprintf(zz,"%s %f",zz,arr->At(jj));
868                        };                        };
869                        jj++;                        jj++;
870                      };                      };
871                      if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o);                      if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o);
872                        if ( j < tb->GetNdata() -1 ) sprintf(zz,"%s ,",zz);
873                      j++;                      j++;
874                    };                    };
875                  };                  };
876                };                };
877                sprintf(o,"%s\n",o);                sprintf(o,"%s\n",o);
878                  sprintf(zz,"%s\n",zz);
879                break;                        break;        
880              };              };
881            };            };
# Line 843  void FEVdetector::ShowInfo(TString detec Line 884  void FEVdetector::ShowInfo(TString detec
884        break;        break;
885      };      };
886    };      };  
   //  pamgui->DIALOG(0,o);  
887    printf("%s\n",o);    printf("%s\n",o);
888      pamgui->DIALOG(4,zz);
889  };  };
890    
891    
# Line 1016  int FEVdetector::SelectEvent(){ Line 1057  int FEVdetector::SelectEvent(){
1057        //        //
1058        if ( level.file == 2 ){        if ( level.file == 2 ){
1059          cintcom.str("");          cintcom.str("");
1060          cintcom << "PamLevel2 *L2 = (PamLevel2*)0x" << hex;          cintcom << "PamLevel2 *L2 = (PamLevel2*)" << hex; //con const e l2 funziona
1061          cintcom << L2;          cintcom << L2;
1062          gROOT->ProcessLine(cintcom.str().c_str());          gROOT->ProcessLine(cintcom.str().c_str());
1063            //      printf(" comando: %s \n",cintcom.str().c_str());
1064        } else {        } else {
1065          cintcom.str("");          cintcom.str("");
1066          cintcom << "TTree *otr = (TTree*)0x" << hex;          cintcom << "TTree *otr = (TTree*)" << hex;
1067          cintcom << otr;          cintcom << otr;
1068          gROOT->ProcessLine(cintcom.str().c_str());          gROOT->ProcessLine(cintcom.str().c_str());
1069          //          //
1070          cintcom.str("");          cintcom.str("");
1071          cintcom << "struct Variables &var = (struct Variables &)0x" << hex;          cintcom << "struct Variables &var = (struct Variables &)" << hex;
1072          cintcom << &var;          cintcom << &var;
1073          gROOT->ProcessLine(cintcom.str().c_str());          gROOT->ProcessLine(cintcom.str().c_str());
1074        };        };
# Line 1057  TChain* FEVdetector::Load(TString file){ Line 1099  TChain* FEVdetector::Load(TString file){
1099    //    //
1100    if ( level.file == 2 ){    if ( level.file == 2 ){
1101      //      //
1102      printf(" %s \n",ddec.Data());      //    printf(" %s \n",ddec.Data());
1103      if ( !L2 ){      if ( !L2 ){
1104        L2 = new PamLevel2("",file.Data(),ddec.Data());        L2 = new PamLevel2("",file.Data(),ddec.Data());
1105        otr = L2->GetPamTree();        otr = L2->GetPamTree();
1106        printf(" l2 constructor\n");        //      printf(" l2 constructor\n");
1107        //      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);    
1108      } else {      } else {
1109        //        //
1110        printf(" l2 already exist \n");        //      printf(" l2 already exist \n");
1111        otr = L2->GetPamTree(gSystem->DirName(file.Data()),file.Data(),ddec.Data());        otr = L2->GetPamTree(gSystem->DirName(file.Data()),file.Data(),ddec.Data());
1112        L2->GetRunTree(gSystem->DirName(file.Data()),file.Data());        L2->GetRunTree(gSystem->DirName(file.Data()),file.Data());
1113        //        //
# Line 1943  void FEVdetector::ShowTOF(){ Line 1985  void FEVdetector::ShowTOF(){
1985      Float_t mt31[2][3];      Float_t mt31[2][3];
1986      Float_t mt32[2][3];      Float_t mt32[2][3];
1987      //      //
1988        memset(mt11,0,2*8*sizeof(Float_t));
1989        memset(mt12,0,2*6*sizeof(Float_t));
1990        memset(mt21,0,2*2*sizeof(Float_t));
1991        memset(mt22,0,2*2*sizeof(Float_t));
1992        memset(mt31,0,2*3*sizeof(Float_t));
1993        memset(mt32,0,2*3*sizeof(Float_t));
1994        //
1995      Int_t S3 = 0;      Int_t S3 = 0;
1996      Int_t S2 = 0;      Int_t S2 = 0;
1997      Int_t S12 = 0;      Int_t S12 = 0;
# Line 2726  void FEVdetector::ShowTOF(){ Line 2775  void FEVdetector::ShowTOF(){
2775    //    //
2776    //    //
2777    Bool_t repeat = true;    Bool_t repeat = true;
2778    Int_t numtr = 1;    //  Int_t numtr = 1;
2779  //  Int_t numtr = 0;    Int_t numtr = 0;
2780    Int_t repuntil = 0;    Int_t repuntil = 0;
2781      Int_t repuntiltr = 0;
2782    //      //  
2783    //    //
2784    var.tofraw = 0;    var.tofraw = 0;
2785    //    //
2786    if ( level.file == 2 ) repuntil = L2->GetToFLevel2()->ntrk();        if ( level.file == 2 ) repuntil = L2->GetToFLevel2()->ntrk();    
2787    //  printf("repuntil = %i \n",repuntil);    //  printf("repuntil = %i \n",repuntil);
2788    //if ( level.file == 2 ) repuntil = L2->GetTrkLevel2()->GetNTracks();        if ( level.file == 2 ) repuntiltr = L2->GetTrkLevel2()->GetNTracks();    
2789    //repuntil = L2->GetNTracks();        //  repuntiltr = L2->GetNTracks();    
2790    //    //
2791    while ( repeat ){    while ( repeat ){
2792      //    printf("B repuntil = %i \n",repuntil);      //    printf("B repuntil = %i \n",repuntil);
# Line 2745  void FEVdetector::ShowTOF(){ Line 2795  void FEVdetector::ShowTOF(){
2795        //        //
2796        //        //
2797        ToFTrkVar *ptt = 0;        ToFTrkVar *ptt = 0;
2798  //      PamTrack *ptrack = 0;        PamTrack *ptrack = 0;
2799        Float_t adc[4][12];        Float_t adc[4][12];
2800        Float_t tdc[4][12];        Float_t tdc[4][12];
2801        memset(adc,0,4*12*sizeof(Float_t));        memset(adc,0,4*12*sizeof(Float_t));
# Line 2760  void FEVdetector::ShowTOF(){ Line 2810  void FEVdetector::ShowTOF(){
2810        } else {        } else {
2811          //          //
2812          //          //
2813          if ( numtr >= repuntil-1 ) repeat = false;          if ( numtr >= (repuntiltr-1) ) repeat = false;
2814          //          //
2815          //      printf(" numtr is %i \n",numtr);          //printf(" numtr is %i \n",numtr);
2816          ptt = L2->GetToFLevel2()->GetToFTrkVar(numtr);            // ptt = L2->GetToFLevel2()->GetToFTrkVar(numtr);      
2817          //ptrack = L2->GetTrack(numtr);          ptrack = L2->GetTrack(numtr);
2818          //ptt = ptrack->GetToFTrack();          ptt = ptrack->GetToFTrack();
2819        };        };
2820        //        //
2821        xp11[0] = 0.;        xp11[0] = 0.;
# Line 2780  void FEVdetector::ShowTOF(){ Line 2830  void FEVdetector::ShowTOF(){
2830        ii = 2;        ii = 2;
2831        //        //
2832        Int_t myseq = ptt->trkseqno + 1;        Int_t myseq = ptt->trkseqno + 1;
2833          //
2834        L2->GetToFLevel2()->GetMatrix(myseq,adc,tdc);        L2->GetToFLevel2()->GetMatrix(myseq,adc,tdc);
2835        //        //
2836        //      printf(" qua \n");        //      printf(" qua \n");
2837        //        //
2838        for ( Int_t i = 0; i<8; i++ ) {          //       for ( Int_t i = 0; i<8; i++ ) {  
2839          if ( adc[ch11a[i]][hb11a[i]] < 1000. ){        //        if ( adc[ch11a[i]][hb11a[i]] < 1000. ){
2840            ms11a[i] = adc[ch11a[i]][hb11a[i]];        //          ms11a[i] = adc[ch11a[i]][hb11a[i]];
2841          };              //        };      
2842          if ( adc[ch11b[i]][hb11b[i]] < 1000. ){        //        if ( adc[ch11b[i]][hb11b[i]] < 1000. ){
2843            ms11b[i] = adc[ch11b[i]][hb11b[i]];        //          ms11b[i] = adc[ch11b[i]][hb11b[i]];
2844          };        //        };
2845          //      xp11[i] = 0.;        //        xp11[i] = 0.;
2846        };        //    };
2847    
2848        Int_t nmtof = 0;        Int_t nmtof = 0;
2849        Float_t mtof = 0.;        Float_t mtof = 0.;
# Line 2909  void FEVdetector::ShowTOF(){ Line 2960  void FEVdetector::ShowTOF(){
2960        if ( level.file == -1 ){        if ( level.file == -1 ){
2961          ColorMIP(ms11a[j]+ms11b[j],colo);                ColorMIP(ms11a[j]+ms11b[j],colo);      
2962        } else {        } else {
2963          ColorTOFMIP(ms11a[j]+ms11b[j],colo);              ColorTOFMIP((ms11a[j]+ms11b[j])/2.,colo);      
2964        };        };
2965        //        //
2966        if ( colo != 10 ) ocolo = colo;        if ( colo != 10 ) ocolo = colo;
# Line 2998  void FEVdetector::ShowTOF(){ Line 3049  void FEVdetector::ShowTOF(){
3049        if ( level.file == -1 ){        if ( level.file == -1 ){
3050          ColorMIP(ms12a[rj]+ms12b[rj],colo);          ColorMIP(ms12a[rj]+ms12b[rj],colo);
3051        } else {        } else {
3052          ColorTOFMIP(ms12a[rj]+ms12b[rj],colo);          ColorTOFMIP((ms12a[rj]+ms12b[rj])/2.,colo);
3053        };        };
3054        //        //
3055        if ( colo != 10 ) ocolo = colo;        if ( colo != 10 ) ocolo = colo;
# Line 3086  void FEVdetector::ShowTOF(){ Line 3137  void FEVdetector::ShowTOF(){
3137        if ( level.file == -1 ){        if ( level.file == -1 ){
3138          ColorMIP(ms21a[rj]+ms21b[rj],colo);          ColorMIP(ms21a[rj]+ms21b[rj],colo);
3139        } else {        } else {
3140          ColorTOFMIP(ms21a[rj]+ms21b[rj],colo);          ColorTOFMIP((ms21a[rj]+ms21b[rj])/2.,colo);
3141        };        };
3142        //        //
3143        if ( colo != 10 ) ocolo = colo;        if ( colo != 10 ) ocolo = colo;
# Line 3172  void FEVdetector::ShowTOF(){ Line 3223  void FEVdetector::ShowTOF(){
3223        if ( level.file == -1 ){        if ( level.file == -1 ){
3224          ColorMIP(ms22a[j]+ms22b[j],colo);          ColorMIP(ms22a[j]+ms22b[j],colo);
3225        } else {        } else {
3226          ColorTOFMIP(ms22a[j]+ms22b[j],colo);          ColorTOFMIP((ms22a[j]+ms22b[j])/2.,colo);
3227        };        };
3228        //        //
3229        if ( colo != 10 ) ocolo = colo;        if ( colo != 10 ) ocolo = colo;
# Line 3263  void FEVdetector::ShowTOF(){ Line 3314  void FEVdetector::ShowTOF(){
3314        if ( level.file == -1 ){        if ( level.file == -1 ){
3315          ColorMIP(ms31a[j]+ms31b[j],colo);          ColorMIP(ms31a[j]+ms31b[j],colo);
3316        } else {        } else {
3317          ColorTOFMIP(ms31a[j]+ms31b[j],colo);          ColorTOFMIP((ms31a[j]+ms31b[j])/2.,colo);
3318        };        };
3319        //        //
3320        if ( colo != 10 ) ocolo = colo;        if ( colo != 10 ) ocolo = colo;
# Line 3356  void FEVdetector::ShowTOF(){ Line 3407  void FEVdetector::ShowTOF(){
3407        if ( level.file == -1 ){        if ( level.file == -1 ){
3408          ColorMIP(ms32a[rj]+ms32b[rj],colo);          ColorMIP(ms32a[rj]+ms32b[rj],colo);
3409        } else {        } else {
3410          ColorTOFMIP(ms32a[rj]+ms32b[rj],colo);          ColorTOFMIP((ms32a[rj]+ms32b[rj])/2.,colo);
3411        };        };
3412        //        //
3413        if ( colo != 10 ) ocolo = colo;        if ( colo != 10 ) ocolo = colo;
# Line 5198  void FEVdetector::ShowTRK(Bool_t upd){ Line 5249  void FEVdetector::ShowTRK(Bool_t upd){
5249              trkpad[planepad]->Range(-8.1,0.,8.1,8.);              trkpad[planepad]->Range(-8.1,0.,8.1,8.);
5250              //              //
5251              x = track->xm[plane];              x = track->xm[plane];
5252              Float_t xsig = track->dedx_x[plane];              Float_t xsig = fabs(track->dedx_x[plane]);
5253              if ( track->XGood(plane) ){              if ( track->XGood(plane) ){
5254                //if ( x > -100 ){                //if ( x > -100 ){
5255                if ( xsig > 8. ) xsig = 8.;                if ( xsig > 8. ) xsig = 8.;
# Line 5207  void FEVdetector::ShowTRK(Bool_t upd){ Line 5258  void FEVdetector::ShowTRK(Bool_t upd){
5258                } else {                } else {
5259                  sigcol2 = 1;                  sigcol2 = 1;
5260                };                };
5261                ColorTRKMIP(track->dedx_x[plane],sigcol2,0);                ColorTRKMIP(fabs(track->dedx_x[plane]),sigcol2,0);
5262                linea = new TLine(x,0.01,x,xsig);                linea = new TLine(x,0.01,x,xsig);
5263                linea->SetLineWidth(2);                linea->SetLineWidth(2);
5264                linea->SetLineColor(sigcol2);                linea->SetLineColor(sigcol2);
# Line 5228  void FEVdetector::ShowTRK(Bool_t upd){ Line 5279  void FEVdetector::ShowTRK(Bool_t upd){
5279              trkpad[planepad]->cd();              trkpad[planepad]->cd();
5280              trkpad[planepad]->Range(-7.05,0.,7.05,8.);              trkpad[planepad]->Range(-7.05,0.,7.05,8.);
5281              x = -track->ym[plane];              x = -track->ym[plane];
5282              xsig = track->dedx_y[plane];              xsig = fabs(track->dedx_y[plane]);
5283              if ( track->YGood(plane) ){              if ( track->YGood(plane) ){
5284                //            if ( x > -100 ){                //            if ( x > -100 ){
5285                if ( xsig > 8. ) xsig = 8.;                if ( xsig > 8. ) xsig = 8.;
# Line 5237  void FEVdetector::ShowTRK(Bool_t upd){ Line 5288  void FEVdetector::ShowTRK(Bool_t upd){
5288                } else {                } else {
5289                  sigcol2 = 1;                  sigcol2 = 1;
5290                };                };
5291                ColorTRKMIP(track->dedx_y[plane],sigcol2,0);                ColorTRKMIP(fabs(track->dedx_y[plane]),sigcol2,0);
5292                linea = new TLine(x,0.01,x,xsig);                linea = new TLine(x,0.01,x,xsig);
5293                linea->SetLineWidth(2);                linea->SetLineWidth(2);
5294                linea->SetLineColor(sigcol2);                linea->SetLineColor(sigcol2);
# Line 5290  void FEVdetector::ShowTRK(Bool_t upd){ Line 5341  void FEVdetector::ShowTRK(Bool_t upd){
5341              //              //
5342              x = track->xm[plane];              x = track->xm[plane];
5343              Float_t y = -track->ym[plane];              Float_t y = -track->ym[plane];
5344              Float_t xsig = track->dedx_x[plane];              Float_t xsig = fabs(track->dedx_x[plane]);
5345              Float_t ysig = track->dedx_y[plane];              Float_t ysig = fabs(track->dedx_y[plane]);
5346              //    if ( x > -100 && y > -100. ){              //    if ( x > -100 && y > -100. ){
5347              if ( track->XGood(plane) && track->YGood(plane) ){              if ( track->XGood(plane) && track->YGood(plane) ){
5348                if ( var.bw ){                if ( var.bw ){
# Line 5756  void FEVdetector::ShowTrack(){ Line 5807  void FEVdetector::ShowTrack(){
5807        //        //
5808        Trajectory *tr = new Trajectory(npoint,zin);                                      Trajectory *tr = new Trajectory(npoint,zin);                              
5809        //        //
5810        ifail = track->DoTrack2(tr);        //      ifail = track->DoTrack2(tr);
5811          ifail = track->DoTrack(tr);
5812        //        //
5813        if ( !ifail ){        if ( !ifail ){
5814          for ( Int_t e = 0; e < npoint ; e++) {          for ( Int_t e = 0; e < npoint ; e++) {
# Line 6332  void FEVdetector::ShowCalo(Bool_t upd){ Line 6384  void FEVdetector::ShowCalo(Bool_t upd){
6384        Int_t l;        Int_t l;
6385        Int_t m;        Int_t m;
6386        Int_t n;        Int_t n;
6387        Float_t mip = L2->GetCaloLevel1()->DecodeEstrip(ii,l,m,n);        Bool_t satura = false;
6388          Float_t mip = L2->GetCaloLevel1()->DecodeEstrip(ii,l,m,n,satura);
6389        if ( var.bw ){        if ( var.bw ){
6390          colo = -1;          colo = -1;
6391        } else {        } else {
6392          colo = 1;          colo = 1;
6393        };        };      
6394        ColorMIP(mip,colo);        ColorMIP(mip,colo);
6395        if ( l == 0 ) {        if ( l == 0 ) {
6396          xvev.str("");          xvev.str("");
# Line 6346  void FEVdetector::ShowCalo(Bool_t upd){ Line 6399  void FEVdetector::ShowCalo(Bool_t upd){
6399          xvev << " " << l;          xvev << " " << l;
6400          gDirectory->Delete(xvev.str().c_str());          gDirectory->Delete(xvev.str().c_str());
6401          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);
6402          Xview->SetFillColor(colo);          if ( satura ){
6403              Xview->SetFillColor(kBlack);
6404            } else {
6405              Xview->SetFillColor(colo);
6406            };
6407          Xview->Fill(n,21-m,1.);          Xview->Fill(n,21-m,1.);
6408          pd1->cd();                                            pd1->cd();                                  
6409          Xview->Draw("box same");          Xview->Draw("box same");
# Line 6358  void FEVdetector::ShowCalo(Bool_t upd){ Line 6415  void FEVdetector::ShowCalo(Bool_t upd){
6415          yvev << " " << l;          yvev << " " << l;
6416          gDirectory->Delete(yvev.str().c_str());          gDirectory->Delete(yvev.str().c_str());
6417          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);                  
6418          Yview->SetFillColor(colo);          if ( satura ){
6419              Yview->SetFillColor(kBlack);
6420            } else {
6421              Yview->SetFillColor(colo);
6422            };
6423          Yview->Fill(96-n,21-m,1.);          Yview->Fill(96-n,21-m,1.);
6424          pd2->cd();          pd2->cd();
6425          Yview->Draw("box same");          Yview->Draw("box same");

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

  ViewVC Help
Powered by ViewVC 1.1.23