/[PAMELA software]/eventviewer/flight/macros/FEventViewer.cxx
ViewVC logotype

Diff of /eventviewer/flight/macros/FEventViewer.cxx

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

revision 1.2 by mocchiut, Wed Mar 22 15:05:27 2006 UTC revision 1.3 by mocchiut, Tue Apr 4 14:04:08 2006 UTC
# Line 1  Line 1 
1  //-------------------------------------------------------------------------------------------------------------------------------------------------------  //-------------------------------------------------------------------------------------------------------------------------------------------------------
2  //  //
3  //   FEventViewer.c      version 1.02  (2006-03-22)  //   FEventViewer.c      version 1.03  (2006-04-04)
4  //  //
5  //   Shows PAMELA events - Emiliano Mocchiutti  //   Shows PAMELA events - Emiliano Mocchiutti
6  //  //
# Line 23  Line 23 
23  //  //
24  //   Changelog:  //   Changelog:
25  //  //
26    //   1.02 - 1.03 (2006-04-04): Make it possible to select events with the calorimeter also when generating level1 from level0.
27    //
28  //   1.01 - 1.02 (2006-03-22): Read calorimeter ADC2MIP flight conversion file. Do not install FEventviewer.cxx!  //   1.01 - 1.02 (2006-03-22): Read calorimeter ADC2MIP flight conversion file. Do not install FEventviewer.cxx!
29  //  //
30  //   1.00 - 1.01 (2006-03-09): Flight version, read unique YODA file. Many capabilities disabled at the moment (reads only LEVEL0 data).  //   1.00 - 1.01 (2006-03-09): Flight version, read unique YODA file. Many capabilities disabled at the moment (reads only LEVEL0 data).
# Line 5116  void ShowTOFGENL1(Int_t j, TTree *otr, V Line 5118  void ShowTOFGENL1(Int_t j, TTree *otr, V
5118  //                           OTHER         SUBROUTINES                            **  //                           OTHER         SUBROUTINES                            **
5119  //**********************************************************************************  //**********************************************************************************
5120    
5121  void ShowCaloL0(TString filename, Int_t i, Calib & calib, Int_t b[4], Float_t mip[2][22][96], TTree *otr, Variables & var){  void ShowCaloL0(TString filename, Int_t i, Calib & calib, Int_t b[4], Float_t mip[2][22][96], TTree *otr, Variables & var, Bool_t upd){
5122      struct Evento evento;      struct Evento evento;
5123      Int_t tot0 = 0;      Int_t tot0 = 0;
5124      Int_t tot1 = 0;      Int_t tot1 = 0;
# Line 5156  void ShowCaloL0(TString filename, Int_t Line 5158  void ShowCaloL0(TString filename, Int_t
5158      Int_t bgcolor = 10;      Int_t bgcolor = 10;
5159      TPad *pd1 = new TPad("calox","This is pad1",var.xxvc-0.154*var.sfx,var.yxvc-0.3645*var.sfy,var.xxvc+0.154*var.sfx,var.yxvc-0.1200*var.sfy,bgcolor);      TPad *pd1 = new TPad("calox","This is pad1",var.xxvc-0.154*var.sfx,var.yxvc-0.3645*var.sfy,var.xxvc+0.154*var.sfx,var.yxvc-0.1200*var.sfy,bgcolor);
5160      TPad *pd2 = new TPad("caloy","This is pad2",var.xyvc-0.154*var.sfx,var.yyvc-0.3645*var.sfy,var.xyvc+0.154*var.sfx,var.yyvc-0.1200*var.sfy,bgcolor);      TPad *pd2 = new TPad("caloy","This is pad2",var.xyvc-0.154*var.sfx,var.yyvc-0.3645*var.sfy,var.xyvc+0.154*var.sfx,var.yyvc-0.1200*var.sfy,bgcolor);
5161        if ( upd ){
5162    
5163      pd1->SetFillStyle(4000);      pd1->SetFillStyle(4000);
5164      pd1->SetFillColor(0);      pd1->SetFillColor(0);
# Line 5190  void ShowCaloL0(TString filename, Int_t Line 5193  void ShowCaloL0(TString filename, Int_t
5193      Yview->Fill(1.,1.,1.);                Yview->Fill(1.,1.,1.);          
5194      Yview->Draw("box");      Yview->Draw("box");
5195      pd2->Update();      pd2->Update();
5196        };
5197      //      //
5198      // for each event check that the calibration we are using are still within calibration limits, if not call the next calibration      // for each event check that the calibration we are using are still within calibration limits, if not call the next calibration
5199      //      //
# Line 5311  void ShowCaloL0(TString filename, Int_t Line 5315  void ShowCaloL0(TString filename, Int_t
5315                      //                      //
5316                      // OK, now in estrip we have the energy deposit in MIP of all the strips for this event (at the end of loops of course)                      // OK, now in estrip we have the energy deposit in MIP of all the strips for this event (at the end of loops of course)
5317                      //                      //
5318                        if ( upd ){
5319                      xve.str("");                      xve.str("");
5320                      yve.str("");                      yve.str("");
5321                      xve << "x-view event " << n;                      xve << "x-view event " << n;
# Line 5343  void ShowCaloL0(TString filename, Int_t Line 5348  void ShowCaloL0(TString filename, Int_t
5348                              pd2->cd();                              pd2->cd();
5349                              Yview->Draw("box same");                              Yview->Draw("box same");
5350                          };                          };
5351                      };                                        };          
5352                        };  
5353                      if ( estrip[l][m][n] > 0.7 && calib.calgood[l][m][n] != 0  ) badstrip++;                      if ( estrip[l][m][n] > 0.7 && calib.calgood[l][m][n] != 0  ) badstrip++;
5354                      if ( estrip[l][m][n] > 0.7 && calib.calgood[l][m][n] == 0 ) {                                                if ( estrip[l][m][n] > 0.7 && calib.calgood[l][m][n] == 0 ) {                          
5355                          qtot += estrip[l][m][n];                          qtot += estrip[l][m][n];
# Line 5354  void ShowCaloL0(TString filename, Int_t Line 5360  void ShowCaloL0(TString filename, Int_t
5360              };                        };          
5361          };          };
5362      };      };
5363        if ( upd ){
5364      pd1->Update();      pd1->Update();
5365      pd2->Update();      pd2->Update();
5366        };
5367      var.qtot=(int)qtot;      var.qtot=(int)qtot;
5368      var.nstrip=nstrip;      var.nstrip=nstrip;
5369  }  }
# Line 6475  void ShowEvent(TString filename="help", Line 6483  void ShowEvent(TString filename="help",
6483              isOK = 1;              isOK = 1;
6484              seldone = 1;              seldone = 1;
6485          } else {          } else {
6486              if ( CALOLEV == 0 ) ShowCaloL0(calcalibfile,i,calib,b,mip,otr,var,false);
6487              isOK = 0;              isOK = 0;
6488              stringstream cintcom;              stringstream cintcom;
6489              cintcom.str("");              cintcom.str("");
# Line 6494  void ShowEvent(TString filename="help", Line 6503  void ShowEvent(TString filename="help",
6503              cintcom << "struct Levels &level = (struct Levels &)0x" << hex;              cintcom << "struct Levels &level = (struct Levels &)0x" << hex;
6504              cintcom << &level;              cintcom << &level;
6505              gROOT->ProcessLine(cintcom.str().c_str());              gROOT->ProcessLine(cintcom.str().c_str());
6506              isOK = gApplication->ProcessLine("filter((Int_t)a,(TTree *)otr,(TTree *)ttr,(Levels &)level);");              cintcom.str("");
6507                cintcom << "struct Variables &var = (struct Variables &)0x" << hex;
6508                cintcom << &var;
6509                gROOT->ProcessLine(cintcom.str().c_str());
6510                isOK = gApplication->ProcessLine("filter((Int_t)a,(TTree *)otr,(TTree *)ttr,(Levels &)level,(Variables &)var);");
6511              seldone = 1;              seldone = 1;
6512              printf("Scanning data: %d%c done",100*(i-minevent)/(maxevent-minevent),37);              printf("Scanning data: %d%c done",100*(i-minevent)/(maxevent-minevent),37);
6513              fflush(stdout);              fflush(stdout);
# Line 6698  void ShowEvent(TString filename="help", Line 6711  void ShowEvent(TString filename="help",
6711                  //                  //
6712                  if ( CALOLEV == 0 ) {                  if ( CALOLEV == 0 ) {
6713                      if ( !thefirst ) {                      if ( !thefirst ) {
6714                          ShowCaloL0(calcalibfile,i,calib,b,mip,otr,var);                            ShowCaloL0(calcalibfile,i,calib,b,mip,otr,var,true);          
6715                      } else {                      } else {
6716                          printf("\n\n CALORIMETER: looking for calibration data...\n");                          printf("\n\n CALORIMETER: looking for calibration data...\n");
6717                          thefirst = 0;                          thefirst = 0;
# Line 6727  void ShowEvent(TString filename="help", Line 6740  void ShowEvent(TString filename="help",
6740                              printf(" No calorimeter calibrations! Switching to raw mode visualitation \n Only COMPRESS and FULL mode acquisition are supported \n\n");                              printf(" No calorimeter calibrations! Switching to raw mode visualitation \n Only COMPRESS and FULL mode acquisition are supported \n\n");
6741                              CALOLEV = -1;                              CALOLEV = -1;
6742                          } else {                          } else {
6743                              ShowCaloL0(calcalibfile,i,calib,b,mip,otr,var);                                    ShowCaloL0(calcalibfile,i,calib,b,mip,otr,var,true);      
6744                          };                          };
6745                      };                      };
6746                  };                  };

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

  ViewVC Help
Powered by ViewVC 1.1.23