--- eventviewer/flight/macros/FEventViewer.cxx 2006/03/22 15:05:27 1.2 +++ eventviewer/flight/macros/FEventViewer.cxx 2006/04/04 14:04:08 1.3 @@ -1,6 +1,6 @@ //------------------------------------------------------------------------------------------------------------------------------------------------------- // -// FEventViewer.c version 1.02 (2006-03-22) +// FEventViewer.c version 1.03 (2006-04-04) // // Shows PAMELA events - Emiliano Mocchiutti // @@ -23,6 +23,8 @@ // // Changelog: // +// 1.02 - 1.03 (2006-04-04): Make it possible to select events with the calorimeter also when generating level1 from level0. +// // 1.01 - 1.02 (2006-03-22): Read calorimeter ADC2MIP flight conversion file. Do not install FEventviewer.cxx! // // 1.00 - 1.01 (2006-03-09): Flight version, read unique YODA file. Many capabilities disabled at the moment (reads only LEVEL0 data). @@ -5116,7 +5118,7 @@ // OTHER SUBROUTINES ** //********************************************************************************** -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){ struct Evento evento; Int_t tot0 = 0; Int_t tot1 = 0; @@ -5156,6 +5158,7 @@ Int_t bgcolor = 10; 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 *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); + if ( upd ){ pd1->SetFillStyle(4000); pd1->SetFillColor(0); @@ -5190,6 +5193,7 @@ Yview->Fill(1.,1.,1.); Yview->Draw("box"); pd2->Update(); + }; // // for each event check that the calibration we are using are still within calibration limits, if not call the next calibration // @@ -5311,6 +5315,7 @@ // // 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) // + if ( upd ){ xve.str(""); yve.str(""); xve << "x-view event " << n; @@ -5343,7 +5348,8 @@ pd2->cd(); Yview->Draw("box same"); }; - }; + }; + }; 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 ) { qtot += estrip[l][m][n]; @@ -5354,8 +5360,10 @@ }; }; }; + if ( upd ){ pd1->Update(); pd2->Update(); + }; var.qtot=(int)qtot; var.nstrip=nstrip; } @@ -6475,6 +6483,7 @@ isOK = 1; seldone = 1; } else { + if ( CALOLEV == 0 ) ShowCaloL0(calcalibfile,i,calib,b,mip,otr,var,false); isOK = 0; stringstream cintcom; cintcom.str(""); @@ -6494,7 +6503,11 @@ cintcom << "struct Levels &level = (struct Levels &)0x" << hex; cintcom << &level; gROOT->ProcessLine(cintcom.str().c_str()); - isOK = gApplication->ProcessLine("filter((Int_t)a,(TTree *)otr,(TTree *)ttr,(Levels &)level);"); + cintcom.str(""); + cintcom << "struct Variables &var = (struct Variables &)0x" << hex; + cintcom << &var; + gROOT->ProcessLine(cintcom.str().c_str()); + isOK = gApplication->ProcessLine("filter((Int_t)a,(TTree *)otr,(TTree *)ttr,(Levels &)level,(Variables &)var);"); seldone = 1; printf("Scanning data: %d%c done",100*(i-minevent)/(maxevent-minevent),37); fflush(stdout); @@ -6698,7 +6711,7 @@ // if ( CALOLEV == 0 ) { if ( !thefirst ) { - ShowCaloL0(calcalibfile,i,calib,b,mip,otr,var); + ShowCaloL0(calcalibfile,i,calib,b,mip,otr,var,true); } else { printf("\n\n CALORIMETER: looking for calibration data...\n"); thefirst = 0; @@ -6727,7 +6740,7 @@ printf(" No calorimeter calibrations! Switching to raw mode visualitation \n Only COMPRESS and FULL mode acquisition are supported \n\n"); CALOLEV = -1; } else { - ShowCaloL0(calcalibfile,i,calib,b,mip,otr,var); + ShowCaloL0(calcalibfile,i,calib,b,mip,otr,var,true); }; }; };