eic-smear
1.0.3
A collection of ROOT classes for Monte Carlo events and a fast-smearing code simulating detector effects for the Electron-Ion Collider task force
|
Go to the documentation of this file.
12 #include <TDatabasePDG.h>
13 #include <TLorentzVector.h>
54 TParticlePDG* pdg = prt.
Id().
Info();
56 bool charged = fabs(pdg->Charge()) > 0.;
77 for (
unsigned i(0); i <
mZones.size(); i++) {
78 if (
mZones.at(i).Contains(prt)) {
93 : mFormula(
"CustomCutFormula",
"0")
97 , Min(-TMath::Infinity())
98 , Max(TMath::Infinity()) {
102 double min,
double max)
103 : mFormula(
"CustomCutFormula",
"0")
113 "ERROR! Custom acceptance is not a function of E, p, theta, phi"
116 if (1 ==
dim || 2 ==
dim) {
117 mFormula = TFormula(
"CustomCutFormula", s);
120 "ERROR! Provided custom acceptance is not of dimension 1 or 2."
124 std::cout <<
"Added custom cut " << formula << std::endl;
134 double z = mFormula.Eval(x, y);
135 return z >= Min && z < Max;
146 double phMin,
double phMax,
147 double eMin,
double eMax,
148 double pMin,
double pMax,
149 double ptmin,
double ptmax,
150 double pzmin,
double pzmax)
166 CustomCuts.push_back(cut);
173 if (theta < thetaMin || theta > thetaMax) {
175 }
else if (phi < phiMin || phi > phiMax) {
177 }
else if (prt.
GetE() < EMin || prt.
GetE() > EMax) {
179 }
else if (prt.
GetP() < PMin || prt.
GetP() > PMax) {
181 }
else if (prt.
GetPz() < pZMin || prt.
GetPz() > pZMax) {
183 }
else if (prt.
GetPt() < pTMin || prt.
GetPt() > pTMax) {
188 for (
unsigned j(0); j < CustomCuts.size(); ++j) {
189 if (!CustomCuts.at(j).Contains(prt)) {
int ParseInputFunction(TString &s, KinType &kin1, KinType &kin2)
Acceptance(int genre=kAll)
Default constructor.
bool Is(const erhic::VirtualParticle &prt) const
This function determines if the particle provided lies within the acceptance of the detector.
double FixPhi(double phi)
Fix an azimuthal angle so that it lies within [0,2*pi).
virtual Double_t GetPz() const =0
Returns the z component of 3-momentum.
TParticlePDG * Info() const
Returns the particle information object corresponding to this PDG code.
virtual Double_t GetP() const =0
Returns the magnitude of 3-momentum (GeV).
virtual void Add(const CustomCut &)
Add a CustomCut to the list of acceptance tests.
void AddParticle(int particle)
Add a particle type to the list of particles to be smeared.
A single contiguous region of acceptance.
virtual ~Zone()
Destructor.
virtual Double_t GetE() const =0
Returns total energy.
std::set< int > mParticles
void SetGenre(int genre)
Select the class(es) of particles to accept.
void SetCharge(ECharge charge)
Select the charges of particles to accept.
double FixTheta(double theta)
Fix a polar angle so that it lies within [0,pi].
Abstract base class for a general particle.
bool IsCoreType(KinType kin)
virtual Bool_t Contains(const erhic::VirtualParticle &) const
Returns true if the particle lies in this zone, false if not.
virtual ~Acceptance()
Destructor.
virtual Double_t GetPt() const =0
Returns momentum perpendicular to the beam direction.
virtual Double_t GetTheta() const =0
Returns the polar angle in the range [0, pi] radians.
A (min, max) range in some variable evaluated as an arbitrary function of theta, phi,...
std::vector< Zone > mZones
Zone(double theta=0., double=TMath::Pi(), double phi=0., double=TMath::TwoPi(), double E=0., double=TMath::Infinity(), double p=0., double=TMath::Infinity(), double pt=0., double=TMath::Infinity(), double pz=-TMath::Infinity(), double=TMath::Infinity())
Constructor.
void AddZone(const Zone &)
Add a new zone with user-specified coverage.
int PGenre(const erhic::VirtualParticle &prt)
Determine particle "genre".
virtual Double_t GetPhi() const =0
Returns the polar angle in the range [0, 2pi] radians.
double GetVariable(const erhic::VirtualParticle &prt, KinType kin)
Returns the kinematic variable associated with kin from the input particle.
virtual bool Contains(const erhic::VirtualParticle &) const
virtual Pid Id() const =0
Returns identity information for the Particle species.