Skip to content

Commit d250cf5

Browse files
authored
Merge 61d9a31 into sapling-pr-archive-ehellbar
2 parents cae116e + 61d9a31 commit d250cf5

11 files changed

Lines changed: 1218 additions & 1052 deletions

File tree

DATA/common/setenv_calib.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ fi
199199
( [[ -z ${CALIB_TPC_RESPADGAIN:-} ]] || [[ $CAN_DO_CALIB_TPC_RESPADGAIN == 0 ]] ) && CALIB_TPC_RESPADGAIN=0
200200
( [[ -z ${CALIB_TPC_IDC:-} ]] || [[ $CAN_DO_CALIB_TPC_IDC == 0 ]] ) && CALIB_TPC_IDC=0
201201
( [[ -z ${CALIB_TPC_SAC:-} ]] || [[ $CAN_DO_CALIB_TPC_SAC == 0 ]] ) && CALIB_TPC_SAC=0
202+
( [[ -z ${CALIB_TPC_CMV:-} ]] || [[ $CAN_DO_CALIB_TPC_CMV == 0 ]] ) && CALIB_TPC_CMV=0
202203
( [[ -z ${CALIB_TPC_VDRIFTTGL:-} ]] || [[ $CAN_DO_CALIB_TPC_VDRIFTTGL == 0 ]] ) && CALIB_TPC_VDRIFTTGL=0
203204
( [[ -z ${CALIB_TRD_VDRIFTEXB:-} ]] || [[ $CAN_DO_CALIB_TRD_VDRIFTEXB == 0 ]] ) && CALIB_TRD_VDRIFTEXB=0
204205
( [[ -z ${CALIB_TRD_GAIN:-} ]] || [[ $CAN_DO_CALIB_TRD_GAIN == 0 ]] ) && CALIB_TRD_GAIN=0
@@ -313,6 +314,7 @@ if [[ -z ${CALIBDATASPEC_TPCIDC_C:-} ]]; then
313314
# TPC
314315
if [[ $CALIB_TPC_IDC == 1 ]]; then add_semicolon_separated CALIBDATASPEC_TPCIDC_C "idcsgroupc:TPC/IDCGROUPC"; fi
315316
fi
317+
# define spec for proxy for TPC CMVs
316318
if [[ -z ${CALIBDATASPEC_TPCCMV:-} ]]; then
317319
# TPC
318320
if [[ $CALIB_TPC_CMV == 1 ]]; then

MC/bin/o2dpg_sim_workflow.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -672,10 +672,10 @@ def getDPL_global_options(bigshm=False, ccdbbackend=True, runcommand=True):
672672
f'--timestamp {args.timestamp}',
673673
f'--import-external {args.data_anchoring}' if len(args.data_anchoring) > 0 else None,
674674
'--bcPatternFile ccdb',
675+
' --nontrivial-mu-distribution ccdb://https://alice-ccdb.cern.ch/FTO/Calib/EventsPerBc',
675676
f'--QEDinteraction {qedspec}' if includeQED else None
676677
], configname = 'precollcontext')
677678
workflow['stages'].append(PreCollContextTask)
678-
#TODO: in future add standard ' --nontrivial-mu-distribution ccdb://http://ccdb-test.cern.ch:8080/GLO/CALIB/EVSELQA/HBCTVX'
679679

680680
if doembedding:
681681
if not usebkgcache:
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#NEV_TEST> 5
2+
[Diamond]
3+
width[2]=6.0
4+
5+
[GeneratorExternal]
6+
fileName=${O2DPG_MC_CONFIG_ROOT}/MC/config/ALICE3/pythia8/generator_pythia8_ALICE3.C
7+
funcName=generator_pythia8_ALICE3()
8+
9+
[GeneratorPythia8]
10+
config=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGEM/pythia8/generator/pythia8_pp_5360_VM2ee.cfg
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
int External() {
2+
std::string path{"o2sim_Kine.root"};
3+
// Check that file exists, can be opened and has the correct tree
4+
TFile file(path.c_str(), "READ");
5+
if (file.IsZombie())
6+
{
7+
std::cerr << "Cannot open ROOT file " << path << "\n";
8+
return 1;
9+
}
10+
auto tree = (TTree *)file.Get("o2sim");
11+
if (!tree)
12+
{
13+
std::cerr << "Cannot find tree o2sim in file " << path << "\n";
14+
return 1;
15+
}
16+
std::vector<o2::MCTrack> *tracks{};
17+
tree->SetBranchAddress("MCTrack", &tracks);
18+
19+
// Check if all events are filled
20+
auto nEvents = tree->GetEntries();
21+
for (Long64_t i = 0; i < nEvents; ++i)
22+
{
23+
tree->GetEntry(i);
24+
if (tracks->empty())
25+
{
26+
std::cerr << "Empty entry found at event " << i << "\n";
27+
return 1;
28+
}
29+
}
30+
// // check if each event has at least two oxygen ions
31+
// for (int i = 0; i < nEvents; i++)
32+
// {
33+
// auto check = tree->GetEntry(i);
34+
// int count = 0;
35+
// for (int idxMCTrack = 0; idxMCTrack < tracks->size(); ++idxMCTrack)
36+
// {
37+
// auto track = tracks->at(idxMCTrack);
38+
// if (track.GetPdgCode() == 1000080160)
39+
// {
40+
// count++;
41+
// }
42+
// }
43+
// if (count < 2)
44+
// {
45+
// std::cerr << "Event " << i << " has less than 2 oxygen ions\n";
46+
// return 1;
47+
// }
48+
// }
49+
50+
return 0;
51+
}
52+
53+
int pythia8()
54+
{
55+
return External();
56+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
### Specify beams
2+
Beams:idA = 2212
3+
Beams:idB = 2212
4+
Beams:eCM = 5360. ### energy
5+
6+
Beams:frameType = 1
7+
ParticleDecays:limitTau0 = on
8+
ParticleDecays:tau0Max = 10. ### match alice: 1cm/c = 10.0mm/c
9+
10+
### processes
11+
SoftQCD:inelastic = on # all inelastic processes
12+
13+
# default: do nothing, Monash 2013 will do its thing
14+
Tune:pp = 14
15+
16+
Random:setSeed = on
17+
18+
# don't modify pion's PR as charged multiplicity is drived by them.
19+
20+
# eta
21+
221:oneChannel = 1 1.0 0 -11 11 22
22+
23+
# eta'
24+
331:oneChannel = 1 0.294 0 -11 11 111
25+
331:addChannel = 1 0.706 0 -11 11 223
26+
27+
# rho
28+
113:oneChannel = 1 1.0 0 -11 11
29+
30+
# omega
31+
223:oneChannel = 1 0.088 0 -11 11
32+
223:addChannel = 1 0.912 0 -11 11 111
33+
34+
# phi
35+
333:oneChannel = 1 0.710 0 -11 11
36+
333:addChannel = 1 0.032 0 -11 11 111
37+
333:addChannel = 1 0.258 0 -11 11 221
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
/// Select π⁰ and η within a given rapidity window for enhancement
2+
/// pdgPartForAccCut: PDG of the particle to select (111=π⁰, 221=η)
3+
/// minNb: minimum number of such particles per event for enhancement
4+
5+
//// authors: Rashi Gupta (rashi.gupta@cern.ch)
6+
/// authors: Ravindra Singh (ravindra.singh@cern.ch)
7+
8+
9+
#if !defined(__CLING__) || defined(__ROOTCLING__)
10+
#include "FairGenerator.h"
11+
#include "FairPrimaryGenerator.h"
12+
#include "Generators/GeneratorPythia8.h"
13+
#include "TRandom3.h"
14+
#include "TParticlePDG.h"
15+
#include "TDatabasePDG.h"
16+
#include "TMath.h"
17+
#include <cmath>
18+
#include <vector>
19+
#endif
20+
21+
#include "Pythia8/Pythia.h"
22+
using namespace Pythia8;
23+
24+
class GeneratorPythia8Box : public o2::eventgen::GeneratorPythia8
25+
{
26+
public:
27+
28+
GeneratorPythia8Box(std::vector<int> pdgList, int nInject = 3, float ptMin = 0.1, float ptMax = 50.0, float etaMin = -0.8, float etaMax = 0.8)
29+
: mPdgList(pdgList), nParticles(nInject), genMinPt(ptMin), genMaxPt(ptMax), genMinEta(etaMin), genMaxEta(etaMax)
30+
{
31+
}
32+
33+
~GeneratorPythia8Box() = default;
34+
35+
Bool_t generateEvent() override
36+
{
37+
bool hasElectron = false;
38+
39+
while (!hasElectron) {
40+
mPythia.event.reset();
41+
42+
for (int i{0}; i < nParticles; ++i)
43+
{
44+
int currentPdg = mPdgList[gRandom->Integer(mPdgList.size())];
45+
double mass = TDatabasePDG::Instance()->GetParticle(currentPdg)->Mass();
46+
47+
const double pt = gRandom->Uniform(genMinPt, genMaxPt);
48+
const double eta = gRandom->Uniform(genMinEta, genMaxEta);
49+
const double phi = gRandom->Uniform(0, TMath::TwoPi());
50+
51+
const double px{pt * std::cos(phi)};
52+
const double py{pt * std::sin(phi)};
53+
const double pz{pt * std::sinh(eta)};
54+
const double et{std::hypot(std::hypot(pt, pz), mass)};
55+
56+
57+
mPythia.event.append(currentPdg, 11, 0, 0, px, py, pz, et, mass);
58+
}
59+
60+
61+
if (!mPythia.next()) continue;
62+
63+
64+
for (int i = 0; i < mPythia.event.size(); ++i) {
65+
if (std::abs(mPythia.event[i].id()) == 11) {
66+
67+
68+
double childPt = mPythia.event[i].pT();
69+
double childEta = mPythia.event[i].eta();
70+
71+
if (childPt > 0.1 && std::abs(childEta) < 1.2) {
72+
hasElectron = true; // Mil gaya!
73+
break;
74+
}
75+
}
76+
}
77+
78+
}
79+
80+
return true;
81+
}
82+
83+
private:
84+
std::vector<int> mPdgList;
85+
double genMinPt, genMaxPt;
86+
double genMinEta, genMaxEta;
87+
int nParticles;
88+
};
89+
90+
91+
FairGenerator *generatePythia8Box(float ptMin = 0.1, float ptMax = 50.0)
92+
{
93+
94+
std::vector<int> pdgList = {111, 221};
95+
return new GeneratorPythia8Box(pdgList, 3, ptMin, ptMax, -0.8, 0.8);
96+
}
Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
#### This configuration uses the Hybrid external generator to trigger π⁰/η production within the specified rapidity window
2-
3-
[GeneratorHybrid]
4-
configFile = ${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGHF/hybrid/GeneratorHF_Non_Hfe.json
1+
#### This configuration uses the Box generator to trigger π⁰/η production within the specified rapidity window
2+
[GeneratorExternal]
3+
fileName=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGHF/external/generator/selectNonHfe.C
4+
funcName = generatePythia8Box(0.1, 50.0)
5+
[GeneratorPythia8]
6+
config=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGHF/pythia8/generator/pythia8_NonHfe.cfg
7+
includePartonEvent=true

MC/config/PWGHF/ini/tests/GeneratorHF_Non_Hfe.C

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
int Hybrid() {
1+
int External() {
22
std::string path{"o2sim_Kine.root"};
33

44
const int pdgPi0 = 111;

MC/config/PWGHF/pythia8/generator/pythia8_NonHfe.cfg

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,14 @@ Beams:idB 2212 # proton
88
Beams:eCM 13600. # GeV
99

1010
### processes
11-
SoftQCD:inelastic on # all inelastic processes
11+
12+
ProcessLevel:all = off
1213

1314
### decays
1415
ParticleDecays:limitTau0 on
1516
ParticleDecays:tau0Max 10.
17+
### processes
18+
1619

1720
### switch off all decay channels
1821
111:onMode = off

MC/config/PWGHF/trigger/selectNonHfe.C

Lines changed: 0 additions & 41 deletions
This file was deleted.

0 commit comments

Comments
 (0)