File indexing completed on 2025-04-02 08:47:06
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef INCLUDE_EICSMEAR_SMEAR_ACCEPTANCE_H_
0011 #define INCLUDE_EICSMEAR_SMEAR_ACCEPTANCE_H_
0012
0013 #include <set>
0014 #include <vector>
0015
0016 #include <TFormula.h>
0017 #include <TMath.h>
0018
0019 #include "eicsmear/smear/Smear.h" // Definition of KinType
0020
0021 typedef bool (*cutfunc)(const erhic::VirtualParticle&);
0022
0023 class TString;
0024
0025 namespace erhic {
0026
0027 class VirtualParticle;
0028
0029 }
0030
0031 namespace Smear {
0032
0033
0034
0035
0036
0037
0038 class Acceptance {
0039 public:
0040
0041
0042
0043
0044
0045
0046 class CustomCut {
0047 public:
0048 virtual ~CustomCut();
0049 CustomCut();
0050 CustomCut(const TString&, double min, double max);
0051 virtual bool Contains(const erhic::VirtualParticle&) const;
0052 protected:
0053 TFormula mFormula;
0054 int dim;
0055 KinType Kin1;
0056 KinType Kin2;
0057 double Min;
0058 double Max;
0059 };
0060
0061
0062
0063 class CustomCutFunction {
0064
0065 public:
0066 virtual ~CustomCutFunction();
0067 CustomCutFunction( cutfunc func);
0068
0069 protected:
0070
0071 cutfunc func;
0072 };
0073
0074
0075
0076
0077 class Zone {
0078 public:
0079
0080 virtual ~Zone();
0081
0082
0083
0084
0085
0086
0087
0088 Zone(double theta = 0., double = TMath::Pi(),
0089 double phi = 0., double = TMath::TwoPi(),
0090 double E = 0., double = TMath::Infinity(),
0091 double p = 0., double = TMath::Infinity(),
0092 double pt = 0., double = TMath::Infinity(),
0093 double pz = -TMath::Infinity(), double = TMath::Infinity());
0094
0095
0096
0097
0098 virtual void Add(const CustomCut&);
0099
0100
0101
0102
0103 virtual Bool_t Contains(const erhic::VirtualParticle&) const;
0104
0105 protected:
0106 double thetaMin;
0107 double thetaMax;
0108 double phiMin;
0109 double phiMax;
0110 double EMin;
0111 double EMax;
0112 double PMin;
0113 double PMax;
0114 double pTMin;
0115 double pTMax;
0116 double pZMin;
0117 double pZMax;
0118 std::vector<Smear::Acceptance::CustomCut> CustomCuts;
0119
0120
0121 ClassDef(Smear::Acceptance::Zone, 1)
0122 };
0123
0124
0125 virtual ~Acceptance();
0126
0127
0128
0129
0130
0131
0132
0133 explicit Acceptance(int genre = kAll);
0134
0135
0136
0137
0138
0139 void AddZone(const Zone&);
0140
0141
0142
0143
0144 UInt_t GetNZones() const;
0145
0146
0147
0148
0149 Int_t GetGenre() const;
0150
0151
0152
0153
0154 void SetGenre(int genre);
0155
0156
0157
0158
0159 void SetCharge(ECharge charge);
0160
0161
0162
0163
0164 ECharge GetCharge() const;
0165
0166
0167
0168
0169
0170
0171
0172 void AddParticle(int particle);
0173
0174
0175
0176
0177
0178
0179
0180
0181
0182 bool Is(const erhic::VirtualParticle& prt) const;
0183
0184 protected:
0185 int mGenre;
0186 ECharge mCharge;
0187 std::vector<Zone> mZones;
0188 std::set<int> mParticles;
0189
0190 ClassDef(Smear::Acceptance, 1)
0191 };
0192
0193 inline UInt_t Acceptance::GetNZones() const {
0194 return mZones.size();
0195 }
0196
0197 inline Int_t Acceptance::GetGenre() const {
0198 return mGenre;
0199 }
0200
0201 inline ECharge Acceptance::GetCharge() const {
0202 return mCharge;
0203 }
0204
0205 }
0206
0207 #endif