43 |
#include <TPolyLine.h> |
#include <TPolyLine.h> |
44 |
#include <TStyle.h> |
#include <TStyle.h> |
45 |
#include <TSystem.h> |
#include <TSystem.h> |
46 |
|
#include <TApplication.h> |
47 |
// |
// |
48 |
#include <PamelaRun.h> |
#include <PamelaRun.h> |
49 |
#include <physics/calorimeter/CalorimeterEvent.h> |
#include <physics/calorimeter/CalorimeterEvent.h> |
86 |
return file2; |
return file2; |
87 |
} |
} |
88 |
|
|
89 |
void FCaloQLOOK(TString filename, Int_t fromevent=0, Int_t toevent=0, TString outDir="", TString saveas = "ps"){ |
void FCaloQLOOK(TString filename, Int_t fromevent=0, Int_t toevent=0, TString outDir="", TString saveas = "png", Bool_t iactive =false, Bool_t w4i=false){ |
90 |
gStyle->SetPaperSize(19.,25.); |
gStyle->SetPaperSize(19.,25.); |
91 |
const char* startingdir = gSystem->WorkingDirectory(); |
const char* startingdir = gSystem->WorkingDirectory(); |
92 |
// printf(" basename is %s \n",gSystem->BaseName(filename.Data())); |
// printf(" basename is %s \n",gSystem->BaseName(filename.Data())); |
93 |
// printf(" getfilename is %s \n",getFilename(filename).Data()); |
// printf(" getfilename is %s \n",getFilename(filename).Data()); |
94 |
if ( !strcmp(outDir.Data(),"") ) outDir = startingdir; |
if ( !strcmp(outDir.Data(),"") ) outDir = startingdir; |
95 |
// |
// |
96 |
|
TApplication *app = 0; |
97 |
|
if ( iactive ) app = new TApplication("app",0,0); |
98 |
// |
// |
99 |
ifstream myfile; |
ifstream myfile; |
100 |
myfile.open(filename.Data()); |
myfile.open(filename.Data()); |
998 |
Calstriphit->Draw("SAME"); |
Calstriphit->Draw("SAME"); |
999 |
// |
// |
1000 |
pd4->cd(); |
pd4->cd(); |
1001 |
|
gPad->SetLogy(); |
1002 |
Dexy->SetXTitle("ADC channels"); |
Dexy->SetXTitle("ADC channels"); |
1003 |
Dexy->SetYTitle("Number of events"); |
Dexy->SetYTitle("Number of events"); |
1004 |
Dexy->Draw(); |
Dexy->Draw(); |
1005 |
h1max = Dexy->GetMaximum()*1.05; |
// h1max = Dexy->GetMaximum()*1.05; |
1006 |
|
h1max = Dexy->GetMaximum()*2.05; |
1007 |
Double_t xd[4] = {2000.,5000.,5000.,2000.}; |
Double_t xd[4] = {2000.,5000.,5000.,2000.}; |
1008 |
Double_t yd[4] = {0.,0.,h1max,h1max}; |
Double_t yd[4] = {0.,0.,h1max,h1max}; |
1009 |
banda1 = new TPolyLine(4,xd,yd); |
banda1 = new TPolyLine(4,xd,yd); |
1039 |
pd4->Draw(); |
pd4->Draw(); |
1040 |
// |
// |
1041 |
pd4->cd(); |
pd4->cd(); |
1042 |
|
gPad->SetLogy(); |
1043 |
Dexy->SetXTitle("ADC channels"); |
Dexy->SetXTitle("ADC channels"); |
1044 |
Dexy->SetYTitle("Number of events"); |
Dexy->SetYTitle("Number of events"); |
1045 |
Dexy->Draw(); |
Dexy->Draw(); |
1046 |
h1max = Dexy->GetMaximum()*1.05; |
// h1max = Dexy->GetMaximum()*1.05; |
1047 |
|
h1max = Dexy->GetMaximum()*2.05; |
1048 |
Double_t xd[4] = {2000.,5000.,5000.,2000.}; |
Double_t xd[4] = {2000.,5000.,5000.,2000.}; |
1049 |
Double_t yd[4] = {0.,0.,h1max,h1max}; |
Double_t yd[4] = {0.,0.,h1max,h1max}; |
1050 |
banda1 = new TPolyLine(4,xd,yd); |
banda1 = new TPolyLine(4,xd,yd); |
1512 |
figsave << format; |
figsave << format; |
1513 |
rapporto->SaveAs(figsave.str().c_str()); |
rapporto->SaveAs(figsave.str().c_str()); |
1514 |
}; |
}; |
1515 |
|
if ( iactive && w4i ){ |
1516 |
|
while ( gROOT->GetListOfCanvases()->FindObject(rapporto) || gROOT->GetListOfCanvases()->FindObject(figura3) || gROOT->GetListOfCanvases()->FindObject(figura2) || gROOT->GetListOfCanvases()->FindObject(figura) ){ |
1517 |
|
gSystem->ProcessEvents(); |
1518 |
|
gSystem->Sleep(10); |
1519 |
|
}; |
1520 |
|
}; |
1521 |
} |
} |
1522 |
|
|