forked from AliceO2Group/O2DPG
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathselectParticlesInAcceptance.C
More file actions
55 lines (50 loc) · 2.38 KB
/
selectParticlesInAcceptance.C
File metadata and controls
55 lines (50 loc) · 2.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
R__ADD_INCLUDE_PATH($O2DPG_MC_CONFIG_ROOT)
#include <TParticle.h>
#include "Generators/Trigger.h"
/// =================================================================================================================================
/// Select event with VM or track in a given rapidity or eta window
/// =================================================================================================================================
o2::eventgen::Trigger selectMotherPartInAcc(double rapidityMin = -1., double rapidityMax = -1.)
{
return [rapidityMin, rapidityMax](const std::vector<TParticle>& particles) -> bool {
for (const auto& particle : particles) {
if (particle.GetFirstMother() == -1)
if ((particle.Y() > rapidityMin) && (particle.Y() < rapidityMax))
return kTRUE;
}
return kFALSE;
};
}
o2::eventgen::Trigger selectDaughterPartInAcc(double etaMin = -1., double etaMax = -1.)
{
return [etaMin, etaMax](const std::vector<TParticle>& particles) -> bool {
for (const auto& particle : particles) {
if (particle.GetFirstMother() == -1)
if ((particle.Y() < etaMin) || (particle.Y() > etaMax)) return kFALSE;
if (particle.GetFirstMother() != -1 && particle.GetFirstDaughter() == -1 && particle.GetPdgCode() != 22 && TMath::Abs(particle.GetPdgCode()) != 12 && TMath::Abs(particle.GetPdgCode()) != 14 && TMath::Abs(particle.GetPdgCode()) != 16)
if ((particle.Eta() < etaMin) || (particle.Eta() > etaMax)) return kFALSE;
}
return kTRUE;
};
}
o2::eventgen::Trigger selectDileptonsInAcc(double etaMin = -1., double etaMax = -1.)
{
return [etaMin, etaMax](const std::vector<TParticle>& particles) -> bool {
for (const auto& particle : particles) {
if (particle.GetFirstMother() != -1 && particle.GetFirstDaughter() == -1 && (TMath::Abs(particle.GetPdgCode()) == 11 || TMath::Abs(particle.GetPdgCode() == 13)))
if ((particle.Eta() < etaMin) || (particle.Eta() > etaMax)) return kFALSE;
}
return kTRUE;
};
}
o2::eventgen::Trigger selectDirectPartInAcc(double etaMin = -1., double etaMax = -1.)
{
return [etaMin, etaMax](const std::vector<TParticle>& particles) -> bool {
for (const auto& particle : particles) {
if (particle.GetFirstMother() == -1)
if ((particle.Eta() < etaMin) || (particle.Eta() > etaMax))
return kFALSE;
}
return kTRUE;
};
}