Skip to content

Commit 9f8b43b

Browse files
authored
Merge pull request #105 from njacazio/nj-nuclei
General improvements in the AOD creation
2 parents 3598232 + 8cfae71 commit 9f8b43b

File tree

6 files changed

+61
-69
lines changed

6 files changed

+61
-69
lines changed

examples/pythia8/pythia_nuclei.cfg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
#Config file to define the nuclei species that are not in vanilla pythia
22
1000020030:all 3He 3Hebar 1 6 0 2.8094
33
1000010030:all 3Tr 3Trbar 1 3 0 2.8089218
4+
2010010020:all 2CDeuteron 2CDeuteronbar 1 3 0 3.226
5+
# c-deuteron -> deuteron K- pi+
6+
2010010020:tau0=0.06000000000
7+
2010010020:addChannel = 1 .1 0 1000010020 -321 211

examples/scripts/common.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
"""
44
Common header for AOD python scripts
5+
Author: Nicolo' Jacazio, [email protected]
56
"""
67

78
import argparse

examples/scripts/createO2tables.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
#! /usr/bin/env python3
22

33
"""
4-
Handler to run the DelphesO2 framework and to create O2 analysis tables
4+
Handler to run the DelphesO2 framework and to create O2 analysis tables.
5+
Author: Nicolo' Jacazio, [email protected]
56
"""
67

78
import configparser

examples/scripts/default_configfile.ini

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,23 +74,41 @@ generators = $DELPHESO2_ROOT/examples/pythia8/pythia8_XeXe.cfg
7474
custom_gen = INPUT_FILES /tmp/AnalysisResults_*.hepmc
7575

7676
[GUN]
77-
custom_gen = rpythia8-gun --pdg 421 --px 1. --py 0. --pz 0. --xProd 0. --yProd 0. --zProd 0. --config $DELPHESO2_ROOT/examples/pythia8/decays/force_hadronic_D.cfg --decay
77+
custom_gen = rpythia8-gun --pdg 421 --px 1. --py 0. --pz 0. --xProd 0. --yProd 0. --zProd 0. --config $DELPHESO2_ROOT/examples/pythia8/decays/force_hadronic_D.cfg --decay --npart 100
7878

7979
[BOX_pion]
8080
custom_gen = rpythia8-box --pdg 211 --etamin -2. --etamax 2. --phimin 0. --phimax 6.28 --pmin 0 --pmax 10 --xProd 0. --yProd 0. --zProd 0. --decay --npart 100
8181

8282
[BOX_proton]
83-
custom_gen = rpythia8-box --pdg 2212 --etamin -2. --etamax 2. --phimin 0. --phimax 6.28 --pmin 0 --pmax 10 --xProd 0. --yProd 0. --zProd 0. --decay --npart 100
83+
custom_gen = rpythia8-box --pdg 2212 --etamin -2. --etamax 2. --phimin 0. --phimax 6.28 --pmin 0 --pmax 10 --xProd 0. --yProd 0. --zProd 0. --decay --npart 100 --config $DELPHESO2_ROOT/examples/pythia8/pythia_nuclei.cfg --background-config $O2_ROOT/share/Generators/egconfig/pythia8_hi.cfg
84+
85+
[BOX_proton_nobkg]
86+
custom_gen = rpythia8-box --pdg 2212 --etamin -2. --etamax 2. --phimin 0. --phimax 6.28 --pmin 0 --pmax 10 --xProd 0. --yProd 0. --zProd 0. --decay --npart 100 --config $DELPHESO2_ROOT/examples/pythia8/pythia_nuclei.cfg
8487

8588
[BOX_deuteron]
86-
custom_gen = rpythia8-box --pdg 1000010020 --etamin -2. --etamax 2. --phimin 0. --phimax 6.28 --pmin 0 --pmax 10 --xProd 0. --yProd 0. --zProd 0. --decay --npart 100
89+
custom_gen = rpythia8-box --pdg 1000010020 --etamin -2. --etamax 2. --phimin 0. --phimax 6.28 --pmin 0 --pmax 10 --xProd 0. --yProd 0. --zProd 0. --decay --npart 100 --config $DELPHESO2_ROOT/examples/pythia8/pythia_nuclei.cfg --background-config $O2_ROOT/share/Generators/egconfig/pythia8_hi.cfg
90+
91+
[BOX_deuteron_nobkg]
92+
custom_gen = rpythia8-box --pdg 1000010020 --etamin -2. --etamax 2. --phimin 0. --phimax 6.28 --pmin 0 --pmax 10 --xProd 0. --yProd 0. --zProd 0. --decay --npart 100 --config $DELPHESO2_ROOT/examples/pythia8/pythia_nuclei.cfg
8793

8894
[BOX_triton]
95+
custom_gen = rpythia8-box --pdg 1000010030 --etamin -2. --etamax 2. --phimin 0. --phimax 6.28 --pmin 0 --pmax 10 --xProd 0. --yProd 0. --zProd 0. --decay --npart 100 --config $DELPHESO2_ROOT/examples/pythia8/pythia_nuclei.cfg --background-config $O2_ROOT/share/Generators/egconfig/pythia8_hi.cfg
96+
97+
[BOX_triton_nobkg]
8998
custom_gen = rpythia8-box --pdg 1000010030 --etamin -2. --etamax 2. --phimin 0. --phimax 6.28 --pmin 0 --pmax 10 --xProd 0. --yProd 0. --zProd 0. --decay --npart 100 --config $DELPHESO2_ROOT/examples/pythia8/pythia_nuclei.cfg
9099

91100
[BOX_helium3]
101+
custom_gen = rpythia8-box --pdg 1000020030 --etamin -2. --etamax 2. --phimin 0. --phimax 6.28 --pmin 0 --pmax 10 --xProd 0. --yProd 0. --zProd 0. --decay --npart 100 --config $DELPHESO2_ROOT/examples/pythia8/pythia_nuclei.cfg --background-config $O2_ROOT/share/Generators/egconfig/pythia8_hi.cfg
102+
103+
[BOX_helium3_nobkg]
92104
custom_gen = rpythia8-box --pdg 1000020030 --etamin -2. --etamax 2. --phimin 0. --phimax 6.28 --pmin 0 --pmax 10 --xProd 0. --yProd 0. --zProd 0. --decay --npart 100 --config $DELPHESO2_ROOT/examples/pythia8/pythia_nuclei.cfg
93105

106+
[BOX_c_deuteron_nobkg]
107+
custom_gen = rpythia8-box --pdg 2010010020 --etamin -2. --etamax 2. --phimin 0. --phimax 6.28 --pmin 0 --pmax 10 --xProd 0. --yProd 0. --zProd 0. --decay --npart 100 --config /home/njacazio/alice/DelphesO2/examples/pythia8/pythia_nuclei.cfg
108+
109+
[BOX_c_deuteron]
110+
custom_gen = rpythia8-box --pdg 2010010020 --etamin -2. --etamax 2. --phimin 0. --phimax 6.28 --pmin 0 --pmax 10 --xProd 0. --yProd 0. --zProd 0. --decay --npart 100 --config /home/njacazio/alice/DelphesO2/examples/pythia8/pythia_nuclei.cfg --background-config $O2_ROOT/share/Generators/egconfig/pythia8_hi.cfg
111+
94112
[GUN_Lc_pKpi]
95113
custom_gen = rpythia8-gun --pdg 4122 --px 1. --py 0. --pz 0. --xProd 1. --yProd 0. --zProd 0. --config $O2DPG_ROOT/MC/config/PWGHF/pythia8/decayer/force_hadronic_D_forceLcChannel1.cfg --decay
96114

src/TrackSmearer.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,9 @@ TrackSmearer::smearTrack(O2Track &o2track, int pid, float nch)
135135
{
136136

137137
auto pt = o2track.getPt();
138+
if (abs(pid) == 1000020030) {
139+
pt *= 2.f;
140+
}
138141
auto eta = o2track.getEta();
139142
auto lutEntry = getLUTEntry(pid, nch, 0., eta, pt);
140143
if (!lutEntry || !lutEntry->valid) return false;

src/lutWrite_aod.cc

Lines changed: 30 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
/// @author: Nicolo' Jacazio
55
/// @email: [email protected]
66

7+
/// \brief LUT writer with the AnalysisResults from AODs as input
8+
79
#include "TCanvas.h"
810
#include "TDatabasePDG.h"
911
#include "TFile.h"
@@ -12,32 +14,23 @@
1214
#include "TProfile2D.h"
1315
#include "TProfile3D.h"
1416
#include "TVectorD.h"
15-
#include "fwdRes/fwdRes.C"
17+
#include "DetectorK/DetectorK.h"
1618
#include "lutCovm.hh"
1719
#include <Riostream.h>
18-
19-
void diagonalise(lutEntry_t& lutEntry);
20-
21-
bool fwdSolve(float* covm, float pt = 0.1, float eta = 0.0,
22-
float mass = 0.13957000)
23-
{
24-
if (fwdRes(covm, pt, eta, mass) < 0)
25-
return false;
26-
return true;
27-
}
20+
#include "lutWrite.cc"
2821

2922
void lutWrite_aod(const char* filename = "/tmp/lutCovm.pi.aod.dat",
30-
int pdg = 211,
31-
float field = 0.2, int layer = 0, int what = 0,
32-
int efftype = 0,
33-
const char* infilename = "/tmp/AnalysisResults_LUT.root",
34-
float minPt = 0.f,
35-
float maxPt = 80.f,
36-
float minEta = -4.f,
37-
float maxEta = 4.f)
23+
int pdg = 211,
24+
float field = 0.2, int layer = 0, int what = 0,
25+
int efftype = 0,
26+
const char* infilename = "/tmp/AnalysisResults_LUT.root",
27+
float minPt = 0.f,
28+
float maxPt = 80.f,
29+
float minEta = -4.f,
30+
float maxEta = 4.f)
3831
{
3932

40-
std::map<int, std::string> partname{ { 11, "electron" }, { 13, "muon" }, { 211, "pion" }, { 321, "kaon" }, { 2212, "proton" } };
33+
std::map<int, std::string> partname{{11, "electron"}, {13, "muon"}, {211, "pion"}, {321, "kaon"}, {2212, "proton"}};
4134
const std::string dn = "alice3-lutmaker-" + partname[pdg];
4235

4336
// Get the input from the analysis results
@@ -55,23 +48,23 @@ void lutWrite_aod(const char* filename = "/tmp/lutCovm.pi.aod.dat",
5548
return;
5649
}
5750
// d->ls();
58-
std::map<std::string, TH1F*> h{ { "eta", nullptr }, { "pt", nullptr } };
59-
std::map<std::string, TProfile2D*> m{ { "CovMat_cYY", nullptr },
60-
{ "CovMat_cZY", nullptr },
61-
{ "CovMat_cZZ", nullptr },
62-
{ "CovMat_cSnpY", nullptr },
63-
{ "CovMat_cSnpZ", nullptr },
64-
{ "CovMat_cSnpSnp", nullptr },
65-
{ "CovMat_cTglY", nullptr },
66-
{ "CovMat_cTglZ", nullptr },
67-
{ "CovMat_cTglSnp", nullptr },
68-
{ "CovMat_cTglTgl", nullptr },
69-
{ "CovMat_c1PtY", nullptr },
70-
{ "CovMat_c1PtZ", nullptr },
71-
{ "CovMat_c1PtSnp", nullptr },
72-
{ "CovMat_c1PtTgl", nullptr },
73-
{ "CovMat_c1Pt21Pt2", nullptr },
74-
{ "Efficiency", nullptr } };
51+
std::map<std::string, TH1F*> h{{"eta", nullptr}, {"pt", nullptr}};
52+
std::map<std::string, TProfile2D*> m{{"CovMat_cYY", nullptr},
53+
{"CovMat_cZY", nullptr},
54+
{"CovMat_cZZ", nullptr},
55+
{"CovMat_cSnpY", nullptr},
56+
{"CovMat_cSnpZ", nullptr},
57+
{"CovMat_cSnpSnp", nullptr},
58+
{"CovMat_cTglY", nullptr},
59+
{"CovMat_cTglZ", nullptr},
60+
{"CovMat_cTglSnp", nullptr},
61+
{"CovMat_cTglTgl", nullptr},
62+
{"CovMat_c1PtY", nullptr},
63+
{"CovMat_c1PtZ", nullptr},
64+
{"CovMat_c1PtSnp", nullptr},
65+
{"CovMat_c1PtTgl", nullptr},
66+
{"CovMat_c1Pt21Pt2", nullptr},
67+
{"Efficiency", nullptr}};
7568

7669
struct binning {
7770
int n = 0;
@@ -288,31 +281,3 @@ void lutWrite_aod(const char* filename = "/tmp/lutCovm.pi.aod.dat",
288281
can->cd(2);
289282
hetacalls->Draw("HIST");
290283
}
291-
292-
void diagonalise(lutEntry_t& lutEntry)
293-
{
294-
// Printf(" --- diagonalise: pt = %f, eta = %f", lutEntry.pt, lutEntry.eta);
295-
TMatrixDSym m(5);
296-
double fcovm[5][5];
297-
for (int i = 0, k = 0; i < 5; ++i)
298-
for (int j = 0; j < i + 1; ++j, ++k) {
299-
fcovm[i][j] = lutEntry.covm[k];
300-
fcovm[j][i] = lutEntry.covm[k];
301-
}
302-
m.SetMatrixArray((double*)fcovm);
303-
TMatrixDSymEigen eigen(m);
304-
// eigenvalues vector
305-
TVectorD eigenVal = eigen.GetEigenValues();
306-
for (int i = 0; i < 5; ++i)
307-
lutEntry.eigval[i] = eigenVal[i];
308-
// eigenvectors matrix
309-
TMatrixD eigenVec = eigen.GetEigenVectors();
310-
for (int i = 0; i < 5; ++i)
311-
for (int j = 0; j < 5; ++j)
312-
lutEntry.eigvec[i][j] = eigenVec[i][j];
313-
// inverse eigenvectors matrix
314-
eigenVec.Invert();
315-
for (int i = 0; i < 5; ++i)
316-
for (int j = 0; j < 5; ++j)
317-
lutEntry.eiginv[i][j] = eigenVec[i][j];
318-
}

0 commit comments

Comments
 (0)