diff --git a/analysis/generic/ATLHECTBanalysis.C b/analysis/generic/ATLHECTBanalysis.C index 74bb195..c0f7ae2 100644 --- a/analysis/generic/ATLHECTBanalysis.C +++ b/analysis/generic/ATLHECTBanalysis.C @@ -8,6 +8,9 @@ //Usage: root 'ATLHECTBanalysis.C(folderpath/,version,g4version,physicslist)' //e.g. root -l 'ATLHECTBanalysis.C("Data1/","2.6","11.1.ref05","FTFP_BERT")' +// +//If hadronic data are generated with the Fluka interface add "true" +//as the last macro argument //Includers from C++ // @@ -21,13 +24,15 @@ #include "ecalibrate.h" #include "picalibrate.h" -void ATLHECTBanalysis(const string folder,const string version,const string g4version,const string pl){ +void ATLHECTBanalysis(const string folder,const string version,const string g4version,const string pl, const bool isFluka=false){ //This is a generic analysis therefore the legend for MC data //must be taken as input //e.g. "#splitline{ATLHECTB v2.6 }{Geant4.11.1.ref05 FTFP_BERT }" // - const string MClegend = "#splitline{ATLHECTB "+version+ "}{Geant4-"+g4version+" "+pl+ "}"; + const string emMClegend = "#splitline{ATLHECTB "+version+ "}{Geant4-"+g4version+" "+pl+ "}"; + string piMClegend = emMClegend; + if(isFluka) piMClegend = "#splitline{ATLHECTB "+version+ "}{FLUKA}"; // Analysis of e- data // energies 20, 40, 50, 80, 100, 119.1, 147.8 GeV @@ -39,11 +44,11 @@ void ATLHECTBanalysis(const string folder,const string version,const string g4ve } //First call to emanalysis to extract emdata, using dummy 44.95 value for SF //will be called again later with correct value - emoutput emdata = emanalysis( emenergies, emfiles, folder, MClegend ); - emdata.print(); + emoutput emdata = emanalysis( emenergies, emfiles, folder, emMClegend ); //Second call to emanalysis with correct SF value, final plots are //now recreated and correct - emanalysis( emenergies, emfiles, folder, MClegend, emdata.avgSF*10. ); + emanalysis( emenergies, emfiles, folder, emMClegend, emdata.avgSF*10. ); + emdata.print(); //Reconstrcuted energies for em runs //For missing energy points (30, 60, 120, 180 and 200 GeV) using 0.99*beamenergy @@ -60,7 +65,10 @@ void ATLHECTBanalysis(const string folder,const string version,const string g4ve for ( unsigned int i=0; i<11; i++ ){ pifiles.push_back( "ATLHECTBout_Run"+std::to_string(i)+".root" ); } - //pianalysis( pienergies, pifiles, recemenergies, folder, false); + //Last argument is FLUKA(bool). If true assumes the g4-to-fluka interface + //was used to generate the data. + // + pianalysis( pienergies, pifiles, recemenergies, folder, emdata.avgSF*10., piMClegend, isFluka); //Analysis to select channels for pi- analysis // diff --git a/analysis/generic/pianalysis.h b/analysis/generic/pianalysis.h index 85e4b19..0403503 100644 --- a/analysis/generic/pianalysis.h +++ b/analysis/generic/pianalysis.h @@ -1,16 +1,15 @@ //************************************************** // \file pianalysis.h -// \brief: Analysis #1 of ATLHECTB v2.6 -// for pi- +// \brief: Analysis for pi- // \author: Lorenzo Pezzotti (CERN EP-SFT-sim) // @lopezzot -// \start date: 10 July 2023 +// \start date: 17 August 2023 //************************************************** #ifndef pianalysis_H #define pianalysis_H -void pianalysis( const vector& pienergies, const vector& pifiles, const vector& recemenergies, const string folder, bool FLUKA){ +void pianalysis( const vector& pienergies, const vector& pifiles, const vector& recemenergies, const string folder, const double SF, const string MClegend, const bool FLUKA){ //Initiate objects through all the analysis // @@ -234,8 +233,8 @@ void pianalysis( const vector& pienergies, const vector& pifiles //Using SF from emanalysis for calibration // //H1Response->Fill( (addchannels / pienergies[RunNo])/44.88); //pi/e - H1Response->Fill( (addchannels / recemenergies[RunNo])/44.9565 ); //updated for v2.6 G411.1.ref05 using SampFraction - H1Recenergy->Fill( addchannels /44.9565 ); //updated for v2.6 G411.1.ref05 using SampFraction + H1Response->Fill( (addchannels / recemenergies[RunNo])/SF ); + H1Recenergy->Fill( addchannels /SF ); } //end for loop events energies[RunNo] = pienergies[RunNo]; @@ -370,16 +369,7 @@ void pianalysis( const vector& pienergies, const vector& pifiles "#splitline{ATLAS HEC}{#splitline{Test beam 2000/2001}{ATL-LARG-PUB-2022-001}}", "ep"); - if (FLUKA) { - Freslegend->AddEntry(G1energyresolution, - "#splitline{ATLHECTB v2.6 }{#splitline{GH }{w/ Birks Law}}", - "ep"); - } - else { - Freslegend->AddEntry(G1energyresolution, - "#splitline{ATLHECTB v2.6 }{#splitline{Geant4.11.1.ref05 FTFP_BERT }{w/ Birks Law}}", - "ep"); - } + Freslegend->AddEntry(G1energyresolution,MClegend.c_str(),"ep"); Freslegend->SetLineWidth(0); Freslegend->Draw("same"); @@ -445,16 +435,7 @@ void pianalysis( const vector& pienergies, const vector& pifiles legend->AddEntry(G1ATLASresponse, "#splitline{ATLAS HEC}{#splitline{Test beam 2000/2001}{ATL-LARG-PUB-2022-001}}", "ep"); - if (FLUKA) { - legend->AddEntry(G1responses, - "#splitline{ATLHECTB v2.6 }{#splitline{GH }{w/ Birks Law}}", - "ep"); - } - else { - legend->AddEntry(G1responses, - "#splitline{ATLHECTB v2.6 }{#splitline{Geant4.11.1.ref05 FTFP_BERT }{w/ Birks Law}}", - "ep"); - } + legend->AddEntry(G1responses,MClegend.c_str(),"ep"); legend->SetLineWidth(0); legend->Draw("same"); p2resp->cd(); @@ -523,16 +504,7 @@ void pianalysis( const vector& pienergies, const vector& pifiles F1legend->AddEntry(G1ATLASF1, "#splitline{ATLAS HEC}{#splitline{Test beam 2000/2001}{ATL-LARG-PUB-2022-001}}", "ep"); - if (FLUKA) { - F1legend->AddEntry(G1F1, - "#splitline{ATLHECTB v2.6 }{#splitline{GH }{w/ Birks Law}}", - "ep"); - } - else { - F1legend->AddEntry(G1F1, - "#splitline{ATLHECTB v2.6 }{#splitline{Geant4.11.1.ref05 FTFP_BERT }{w/ Birks Law}}", - "ep"); - } + F1legend->AddEntry(G1F1,MClegend.c_str(),"ep"); F1legend->SetLineWidth(0); F1legend->Draw("same"); p2F1->cd(); @@ -588,16 +560,7 @@ void pianalysis( const vector& pienergies, const vector& pifiles F2legend->AddEntry(G1ATLASF2, "#splitline{ATLAS HEC}{#splitline{Test beam 2000/2001}{ATL-LARG-PUB-2022-001}}", "ep"); - if (FLUKA) { - F2legend->AddEntry(G1F2, - "#splitline{ATLHECTB v2.6 }{#splitline{GH }{w/ Birks Law}}", - "ep"); - } - else { - F2legend->AddEntry(G1F2, - "#splitline{ATLHECTB v2.6 }{#splitline{Geant4.11.1.ref05 FTFP_BERT }{w/ Birks Law}}", - "ep"); - } + F2legend->AddEntry(G1F2,MClegend.c_str(),"ep"); F2legend->SetLineWidth(0); F2legend->Draw("same"); p2F2->cd(); @@ -654,16 +617,7 @@ void pianalysis( const vector& pienergies, const vector& pifiles F3legend->AddEntry(G1ATLASF3, "#splitline{ATLAS HEC}{#splitline{Test beam 2000/2001}{ATL-LARG-PUB-2022-001}}", "ep"); - if (FLUKA) { - F3legend->AddEntry(G1F3, - "#splitline{ATLHECTB v2.6 }{#splitline{GH }{w/ Birks Law}}", - "ep"); - } - else { - F3legend->AddEntry(G1F3, - "#splitline{ATLHECTB v2.6 }{#splitline{Geant4.11.1.ref05 FTFP_BERT }{w/ Birks Law}}", - "ep"); - } + F3legend->AddEntry(G1F3,MClegend.c_str(),"ep"); F3legend->SetLineWidth(0); F3legend->Draw("same"); p2F3->cd(); @@ -721,16 +675,7 @@ void pianalysis( const vector& pienergies, const vector& pifiles F4legend->AddEntry(G1ATLASF4, "#splitline{ATLAS HEC}{#splitline{Test beam 2000/2001}{ATL-LARG-PUB-2022-001}}", "ep"); - if (FLUKA) { - F4legend->AddEntry(G1F4, - "#splitline{ATLHECTB v2.6 }{#splitline{GH }{w/ Birks Law}}", - "ep"); - } - else { - F4legend->AddEntry(G1F4, - "#splitline{ATLHECTB v2.6 }{#splitline{Geant4.11.1.ref05 FTFP_BERT }{w/ Birks Law}}", - "ep"); - } + F4legend->AddEntry(G1F4,MClegend.c_str(),"ep"); F4legend->SetLineWidth(0); F4legend->Draw("same"); p2->cd(); @@ -796,16 +741,7 @@ void pianalysis( const vector& pienergies, const vector& pifiles L0legend->AddEntry(G1ATLASL0, "#splitline{ATLAS HEC}{#splitline{Test beam 2000/2001}{ATL-LARG-PUB-2022-001}}", "ep"); - if (FLUKA) { - L0legend->AddEntry(G1L0, - "#splitline{ATLHECTB v2.6 }{#splitline{GH }{w/ Birks Law}}", - "ep"); - } - else { - L0legend->AddEntry(G1L0, - "#splitline{ATLHECTB v2.6 }{#splitline{Geant4.11.1.ref05 FTFP_BERT }{w/ Birks Law}}", - "ep"); - } + L0legend->AddEntry(G1L0,MClegend.c_str(),"ep"); L0legend->SetLineWidth(0); L0legend->Draw("same"); p2L0->cd(); @@ -863,16 +799,7 @@ void pianalysis( const vector& pienergies, const vector& pifiles sigmaL0legend->AddEntry(G1ATLASsigmaL0, "#splitline{ATLAS HEC}{#splitline{Test beam 2000/2001}{ATL-LARG-PUB-2022-001}}", "ep"); - if (FLUKA) { - sigmaL0legend->AddEntry(G1sigmaL0, - "#splitline{ATLHECTB v2.6 }{#splitline{GH }{w/ Birks Law}}", - "ep"); - } - else { - sigmaL0legend->AddEntry(G1sigmaL0, - "#splitline{ATLHECTB v2.6 }{#splitline{Geant4.11.1.ref05 FTFP_BERT }{w/ Birks Law}}", - "ep"); - } + sigmaL0legend->AddEntry(G1sigmaL0,MClegend.c_str(),"ep"); sigmaL0legend->SetLineWidth(0); sigmaL0legend->Draw("same"); p2sigmaL0->cd();