Skip to content

Commit

Permalink
Merge pull request #22 from DandreaMichele/main
Browse files Browse the repository at this point in the history
Calibration and test updates for v2.6 using Geant4 (v 11.1.ref05)
  • Loading branch information
lopezzot authored Jul 12, 2023
2 parents fd4d99b + 3df4efd commit fd49876
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 22 deletions.
4 changes: 2 additions & 2 deletions analysis/v2.6/ATLHECTBanalysis1_v2p6.C
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ void ATLHECTBanalysis1_v2p6(){
}
//emanalysis( emenergies, emfiles );

//Reconstrcuted energies for em runs (G4.10.7.p01, v2.5)
//Reconstrcuted energies for em runs (G4.11.1.ref05, v2.6)
//For missing energy points (30, 60, 120, 180 and 200 GeV) using 0.99*beamenergy
//
vector<double> recemenergies = {19.8165,0.99*30.,39.6759,49.6068,0.99*60.,79.3625,99.2147,118.158,146.643,0.99*180.,0.99*200};
vector<double> recemenergies = {19.833,0.99*30.,39.6916,49.6423,0.99*60.,79.418,99.2707,118.209,146.685,0.99*180.,0.99*200}; //**Updated (G4.11.1.ref05 v2.6) **

// Analysis of pi- data
// energies 20, 30, 40, 50, 60, 80, 100, 120, 150, 180, 200 GeV
Expand Down
14 changes: 7 additions & 7 deletions analysis/v2.6/emanalysis.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ void emanalysis( const vector<double>& emenergies, const vector<string>& emfiles
cout<<"---> Analysis run # "<<RunNo<<", energy(GeV) "<<emenergies[RunNo]<<endl;
//Initiate objects through single Run
//
string filename = "Data1/"+emfiles[RunNo];
string filename = "FLUKAComparison/FTFP_BERT_v2.6/"+emfiles[RunNo];
double energy = emenergies[RunNo];
TFile* file = TFile::Open( filename.c_str(), "READ" );
TTree* tree = (TTree*)file->Get( "ATLHECTBout" );
Expand Down Expand Up @@ -167,7 +167,7 @@ void emanalysis( const vector<double>& emenergies, const vector<string>& emfiles
// average response
//
H1Response->Fill( addchannels / (edep/1000.) );
H1Recenergy->Fill( (addchannels / 44.88) ); //updated for v2.5 G410.7.1 using SampFraction
H1Recenergy->Fill( (addchannels / 44.9565) ); //updated for v2.6 G411.1.ref05 using SampFraction
} //end for loop events

energies[RunNo] = emenergies[RunNo];
Expand Down Expand Up @@ -266,7 +266,7 @@ void emanalysis( const vector<double>& emenergies, const vector<string>& emfiles
Sampfractionlegend->SetLineWidth(0);
//Sampfractionlegend->SetHeader("Sampling fraction e-", "C");
Sampfractionlegend->AddEntry(G1Sampfraction,
"#splitline{ATLHECTB v2.5 }{Geant4.10.7.p01 FTFP_BERT }","ep");
"#splitline{ATLHECTB v2.6 }{Geant4.11.1.ref05 FTFP_BERT }","ep");
Sampfractionlegend->Draw("same");
C1Sampfraction->Write();
delete C1Sampfraction;
Expand Down Expand Up @@ -336,7 +336,7 @@ void emanalysis( const vector<double>& emenergies, const vector<string>& emfiles
legend->AddEntry(G1ATLASenres,
"#splitline{ATLAS HEC }{#splitline{Test beam 2000/2001}{ATL-LARG-PUB-2022-001}}", "ep");
legend->AddEntry(G1energyresolution,
"#splitline{ATLHECTB v2.5 }{Geant4.10.7.p01 FTFP_BERT }","ep");
"#splitline{ATLHECTB v2.6 }{Geant4.11.1.ref05 FTFP_BERT }","ep");
legend->SetLineWidth(0);
legend->Draw("same");
p2->cd();
Expand Down Expand Up @@ -367,15 +367,15 @@ void emanalysis( const vector<double>& emenergies, const vector<string>& emfiles

// Final print out
//
double k;
double k = 0.;
for (unsigned int i = 0; i<emenergies.size(); i++){
k += responses[i];
}
double r;
double r = 0.;
for (unsigned int i = 0; i<emenergies.size(); i++){
r += Sampfraction[i];
}

cout<<"->Average sampling fraction to e-: "<<r/double(emenergies.size())<<"%"<<endl;
cout<<"->Average response to e-: "<<k/double(emenergies.size())<<" a.u./GeV"<<endl;
cout<<"->Reconstructed energies for 20,40,50,80,100,119.1,147.8 GeV e-: "<<endl;
Expand Down
26 changes: 13 additions & 13 deletions analysis/v2.6/pianalysis.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ void pianalysis( const vector<double>& pienergies, const vector<string>& pifiles
cout<<"---> Analysis run # "<<RunNo<<", energy(GeV) "<<pienergies[RunNo]<<endl;
//Initiate objects through single Run
//
string filename = "Data1/"+pifiles[RunNo];
string filename = "FLUKAComparison/FTFP_BERT_v2.6/"+pifiles[RunNo];
double energy = pienergies[RunNo];
TFile* file = TFile::Open( filename.c_str(), "READ" );
TTree* tree = (TTree*)file->Get( "ATLHECTBout" );
Expand Down Expand Up @@ -226,8 +226,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.88); //pi/e
H1Recenergy->Fill( addchannels /44.88);
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
} //end for loop events

energies[RunNo] = pienergies[RunNo];
Expand Down Expand Up @@ -359,7 +359,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");
Freslegend->AddEntry(G1energyresolution,
"#splitline{ATLHECTB v2.5 }{#splitline{Geant4.10.7.p01 FTFP_BERT }{w/ Birks Law}}",
"#splitline{ATLHECTB v2.6 }{#splitline{Geant4.11.1.ref05 FTFP_BERT }{w/ Birks Law}}",
"ep");
Freslegend->SetLineWidth(0);
Freslegend->Draw("same");
Expand Down Expand Up @@ -407,7 +407,7 @@ void pianalysis( const vector<double>& pienergies, const vector<string>& pifiles
G1ATLASresponse->SetMarkerStyle(8);
G1ATLASresponse->GetXaxis()->SetTitle("<E_{Beam}> [GeV]");
G1ATLASresponse->GetYaxis()->SetTitle("#pi/e");
G1ATLASresponse->GetYaxis()->SetRangeUser(0.75,0.9);
G1ATLASresponse->GetYaxis()->SetRangeUser(0.7,0.9);
G1ATLASresponse->GetXaxis()->SetRangeUser(0.,220.);
G1ATLASresponse->SetTitle("");
G1ATLASresponse->SetName("pi-ATLASresponse");
Expand All @@ -424,7 +424,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");
legend->AddEntry(G1responses,
"#splitline{ATLHECTB v2.5 }{#splitline{Geant4.10.7.p01 FTFP_BERT }{w/ Birks Law}}",
"#splitline{ATLHECTB v2.6 }{#splitline{Geant.11.1.ref05 FTFP_BERT }{w/ Birks Law}}",
"ep");
legend->SetLineWidth(0);
legend->Draw("same");
Expand Down Expand Up @@ -493,7 +493,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");
F1legend->AddEntry(G1F1,
"#splitline{ATLHECTB v2.5 }{#splitline{Geant4.10.7.p01 FTFP_BERT }{w/ Birks Law}}",
"#splitline{ATLHECTB v2.6 }{#splitline{Geant4.11.1.ref05 FTFP_BERT }{w/ Birks Law}}",
"ep");
F1legend->SetLineWidth(0);
F1legend->Draw("same");
Expand Down Expand Up @@ -551,7 +551,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");
F2legend->AddEntry(G1F2,
"#splitline{ATLHECTB v2.5 }{#splitline{Geant4.10.7.p01 FTFP_BERT }{w/ Birks Law}}",
"#splitline{ATLHECTB v2.6 }{#splitline{Geant4.11.1.ref05 FTFP_BERT }{w/ Birks Law}}",
"ep");
F2legend->SetLineWidth(0);
F2legend->Draw("same");
Expand Down Expand Up @@ -610,7 +610,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");
F3legend->AddEntry(G1F3,
"#splitline{ATLHECTB v2.5 }{#splitline{Geant4.10.7.p01 FTFP_BERT }{w/ Birks Law}}",
"#splitline{ATLHECTB v2.6 }{#splitline{Geant4.11.1.ref05 FTFP_BERT }{w/ Birks Law}}",
"ep");
F3legend->SetLineWidth(0);
F3legend->Draw("same");
Expand Down Expand Up @@ -670,7 +670,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");
F4legend->AddEntry(G1F4,
"#splitline{ATLHECTB v2.5 }{#splitline{Geant4.10.7.p01 FTFP_BERT }{w/ Birks Law}}",
"#splitline{ATLHECTB v2.6 }{#splitline{Geant4.11.1.ref05 FTFP_BERT }{w/ Birks Law}}",
"ep");
F4legend->SetLineWidth(0);
F4legend->Draw("same");
Expand Down Expand Up @@ -735,7 +735,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");
L0legend->AddEntry(G1L0,
"#splitline{ATLHECTB v2.5 }{#splitline{Geant4.10.7.p01 FTFP_BERT }{w/ Birks Law}}",
"#splitline{ATLHECTB v2.6 }{#splitline{Geant4.11.1.ref05 FTFP_BERT }{w/ Birks Law}}",
"ep");
L0legend->SetLineWidth(0);
L0legend->Draw("same");
Expand Down Expand Up @@ -790,7 +790,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");
sigmaL0legend->AddEntry(G1sigmaL0,
"#splitline{ATLHECTB v2.5 }{#splitline{Geant4.10.7.p01 FTFP_BERT }{w/ Birks Law}}",
"#splitline{ATLHECTB v2.6 }{#splitline{Geant4.11.1.ref05 FTFP_BERT }{w/ Birks Law}}",
"ep");
sigmaL0legend->SetLineWidth(0);
sigmaL0legend->Draw("same");
Expand Down Expand Up @@ -818,7 +818,7 @@ void pianalysis( const vector<double>& pienergies, const vector<string>& pifiles
delete outputfile;
// Final print out
//
double k;
double k = 0.;
for (unsigned int i = 0; i<pienergies.size(); i++){
k += responses[i];
}
Expand Down

0 comments on commit fd49876

Please sign in to comment.