Skip to content

Commit

Permalink
Add (pi) genericanalysis
Browse files Browse the repository at this point in the history
Add generic pion analysis. Assumes g4-generated data by default. If data
are generated with the g4-to-fluka interface add a "true" as last macro
parser argument.
  • Loading branch information
lopezzot committed Aug 17, 2023
1 parent 7f90b51 commit 13a1467
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 92 deletions.
20 changes: 14 additions & 6 deletions analysis/generic/ATLHECTBanalysis.C
Original file line number Diff line number Diff line change
Expand Up @@ -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++
//
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
//
Expand Down
99 changes: 13 additions & 86 deletions analysis/generic/pianalysis.h
Original file line number Diff line number Diff line change
@@ -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<double>& pienergies, const vector<string>& pifiles, const vector<double>& recemenergies, const string folder, bool FLUKA){
void pianalysis( const vector<double>& pienergies, const vector<string>& pifiles, const vector<double>& recemenergies, const string folder, const double SF, const string MClegend, const bool FLUKA){

//Initiate objects through all the analysis
//
Expand Down Expand Up @@ -234,8 +233,8 @@ void pianalysis( const vector<double>& pienergies, const vector<string>& 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];
Expand Down Expand Up @@ -370,16 +369,7 @@ void pianalysis( const vector<double>& pienergies, const vector<string>& 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");
Expand Down Expand Up @@ -445,16 +435,7 @@ void pianalysis( const vector<double>& pienergies, const vector<string>& 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();
Expand Down Expand Up @@ -523,16 +504,7 @@ void pianalysis( const vector<double>& pienergies, const vector<string>& 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();
Expand Down Expand Up @@ -588,16 +560,7 @@ void pianalysis( const vector<double>& pienergies, const vector<string>& 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();
Expand Down Expand Up @@ -654,16 +617,7 @@ void pianalysis( const vector<double>& pienergies, const vector<string>& 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();
Expand Down Expand Up @@ -721,16 +675,7 @@ void pianalysis( const vector<double>& pienergies, const vector<string>& 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();
Expand Down Expand Up @@ -796,16 +741,7 @@ void pianalysis( const vector<double>& pienergies, const vector<string>& 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();
Expand Down Expand Up @@ -863,16 +799,7 @@ void pianalysis( const vector<double>& pienergies, const vector<string>& 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();
Expand Down

0 comments on commit 13a1467

Please sign in to comment.