QwGeant4
QweakSimUserPrimaryEvent.hh
Go to the documentation of this file.
1 //=============================================================================
2 //
3 // ---------------------------
4 // | Doxygen File Information |
5 // ---------------------------
6 /**
7 
8  \file QweakSimUserPrimaryEvent.hh
9  $Revision: 1.2 $
10  $Date: 2005/12/27 19:30:45 $
11  \author Klaus Hans Grimm
12 
13 */
14 //=============================================================================
15 //
16 //=============================================================================
17 //
18 // ---------------------------
19 // | Doxygen Class Information |
20 // ---------------------------
21 /**
22  \class QweakSimUserPrimaryEvent
23 
24  \ingroup root
25 
26  \brief Stores the PrimaryEvent information into the ROOT file for each event.
27 
28  Primary.xyz
29 
30  */
31 //=============================================================================
32 
33 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
34 #ifndef QweakSimUserPrimaryEvent_h
35 #define QweakSimUserPrimaryEvent_h
36 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
37 
38 // system includes
39 #include <sstream>
40 #include <fstream>
41 
42 // root includes
43 #include "TObject.h"
44 #include "TString.h"
45 
46 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
47 class QweakSimUserPrimaryEvent : public TObject
48 {
49 
50 private:
51 
52  Int_t TrackID; ///< ID of the primary track in this event
53  Float_t GlobalTime; ///< Time of primary interaction, starting 30 cm in front of the target, see \ref target_energy_loss (ns)
54 
55  /// \name Position of the primary vertex in global coordinates
56  /// The global coordinates are defined in the \ref global_coordinate_system.
57  //@{
58  Float_t OriginVertexPositionX; ///< (mm)
59  Float_t OriginVertexPositionY; ///< (mm)
60  Float_t OriginVertexPositionZ; ///< (mm)
61  //@}
62 
63  /// \name Direction right after the primary vertex in global coordinates
64  /// The global coordinates are defined in the \ref global_coordinate_system.
65  //@{
69  Float_t OriginVertexThetaAngle; ///< (degrees)
70  Float_t OriginVertexPhiAngle; ///< (degrees)
71  //@}
72 
73  Float_t PreScatteringKineticEnergy; ///< Kinetic energy right before the primary vertex (after external target energy loss)
74  Float_t OriginVertexKineticEnergy; ///< Kinetic energy right after the primary vertex
75  Float_t OriginVertexTotalEnergy; ///< Total energy right after the primary vertex
76 
78  Float_t PhiAngle_Min;
79  Float_t PhiAngle_Max;
80  Float_t ThetaAngle_Min;
81  Float_t ThetaAngle_Max;
82  Float_t EPrime_Min;
83  Float_t EPrime_Max;
84  Float_t BeamEnergy;
85  Float_t Luminosity;
86  Float_t PhaseSpace;
87 
92 
97 
98  Float_t PrimaryQ2; ///< Momentum transfer Q^2 for this event (GeV<sup>2</sup>)
99  Float_t CrossSection; ///< Cross section weight for events with these kinematics, assuming isotropic spherical picking (isotropy = 1, see \ref isotropy)
100  Float_t CrossSectionWeight; ///< Modified cross section weight for events with these kimematics, assuming flat-theta picking (isotropy = 0, see \ref isotropy)
113  Float_t Asymmetry; ///< Asymmetry for events with these kinematics
114 
115  Int_t PrimaryEventNumber; ///< The primary event number (increments by two due to target energy loss simulation)
116 
117  Int_t ReactionRegion; ///< The \ref reaction_region used for this event, e.g. LH2 interior = 1, US window = 2, DS window = 3
118  Int_t ReactionType; ///< The \ref reaction_type used for this event, e.g. elastic ep = 1, e+p -> e'+p+pi = 2
119  Int_t PDGcode; ///< The \ref Lund_type of the primary particle, e.g. electron = 11
120 
121  TString RandomSeed; ///< The state of the random number generator when this event was generated
122 
123  // various energy losses at the target
127  Float_t dETotIn, dETotOut, dETot;
128 
129 public:
130 
131  // Constructor
133  // Destructor
134  virtual ~QweakSimUserPrimaryEvent();
135 
136  void Initialize();
137 
138  void StoreTrackID(Int_t tid) { TrackID = tid; }
139  Int_t GetTrackID() const {return TrackID;}
140 
141  void StoreGlobalTime(Float_t gtime) { GlobalTime = gtime; }
142  Float_t GetGloablTime() const {return GlobalTime;}
143 
144  //-----------------
145  Int_t WriteRandomSeed() const {
146  std::stringstream name;
147  name << "event" << PrimaryEventNumber << ".rndm";
148  std::ofstream file(name.str().c_str()); // why can't fstream take a string?
149  TString seed(RandomSeed); // copy
150  seed.Remove(0,RandomSeed.First('\n') + 1); // remove first line with garbage
151  file << seed; // write to file
152  return seed.Length();
153  }
154 
155  void StoreRandomSeed(TString seed) { RandomSeed = seed; }
156  TString GetRandomSeed() const {return RandomSeed; }
157 
158  //-----------------
161 
164 
167  //-----------------
170 
173 
176  //-----------------
177  void StoreOriginVertexThetaAngle(Float_t theta) { OriginVertexThetaAngle = theta; }
179 
180  void StoreOriginVertexPhiAngle(Float_t phi) { OriginVertexPhiAngle = phi; }
182  //-----------------
185 
188 
191  //-----------------
194 
197 
200 
203 
204  //-----------------
207 
208  void StorePhiAngle_Min(Float_t ang) { PhiAngle_Min = ang; }
209  Float_t GetPhiAngle_Min() const {return PhiAngle_Min;}
210 
211  void StorePhiAngle_Max(Float_t ang) { PhiAngle_Max = ang; }
212  Float_t GetPhiAngle_Max() const {return PhiAngle_Max;}
213 
214  void StoreThetaAngle_Min(Float_t ang) { ThetaAngle_Min = ang; }
215  Float_t GetThetaAngle_Min() const {return ThetaAngle_Min;}
216 
217  void StoreThetaAngle_Max(Float_t ang) { ThetaAngle_Max = ang; }
218  Float_t GetThetaAngle_Max() const {return ThetaAngle_Max;}
219 
220  void StoreEPrime_Min(Float_t energy) { EPrime_Min = energy; }
221  Float_t GetEPrime_Min() const {return EPrime_Min;}
222 
223  void StoreEPrime_Max(Float_t energy) { EPrime_Max = energy; }
224  Float_t GetEPrime_Max() const {return EPrime_Max;}
225 
226  void StoreBeamEnergy(Float_t energy) { BeamEnergy = energy; }
227  Float_t GetBeamEnergy() const {return BeamEnergy;}
228 
229  void StoreLuminosity(Float_t lum) { Luminosity = lum; }
230  Float_t GetLuminosity() const {return Luminosity;}
231 
232  void StorePhaseSpace(Float_t ps) { PhaseSpace = ps; }
233  Float_t GetPhaseSpace() const {return PhaseSpace;}
234 
235  //-----------------
238 
241 
243  Float_t GetEffectiveKinematicX() const {return EffectiveKinematicX;}
244 
246  Float_t GetEffectiveKinematicW() const {return EffectiveKinematicW;}
247 
248  //-----------------
249  void StorePrimaryQ2(Float_t pq2) { PrimaryQ2 = pq2; }
250  Float_t GetPrimaryQ2() const {return PrimaryQ2; }
251 
252  void StoreCrossSection(Float_t cs) {CrossSection = cs;}
253  Float_t GetCrossSection() const {return CrossSection; }
254 
255  void StoreCrossSectionWeight(Float_t csw) {CrossSectionWeight = csw;}
256  Float_t GetCrossSectionWeight() const {return CrossSectionWeight; }
257 
258  //-----------------
261 
264 
266  Float_t GetCrossSectionBornQE() const {return CrossSectionBornQE; }
267 
270 
273 
274  void StoreCrossSectionRadQE(Float_t cs) {CrossSectionRadQE = cs;}
275  Float_t GetCrossSectionRadQE() const {return CrossSectionRadQE; }
276 
278  Float_t GetCrossSectionRadDIS() const {return CrossSectionRadDIS; }
279 
280  //-----------------
283 
286 
289 
292 
293  //-----------------
296 
297  //-----------------
298  void StoreAsymmetry(Float_t asym) {Asymmetry = asym;}
299  Float_t GetAsymmetry() const {return Asymmetry; }
300 
301  void StorePrimaryEventNumber(Int_t pen) { PrimaryEventNumber = pen; }
302  Int_t GetPrimaryEventNumber() const {return PrimaryEventNumber; }
303 
304  void StoreReactionRegion(Int_t rt) { ReactionRegion = rt; }
305  Int_t GetReactionRegion() const {return ReactionRegion; }
306 
307  void StoreReactionType(Int_t rt) { ReactionType = rt; }
308  Int_t GetReactionType() const {return ReactionType; }
309 
310  void StorePDGcode(Int_t code) { PDGcode = code; }
311  Int_t GetPDGcode() const {return PDGcode; }
312 
313  // store various Elosses at the target
314  void StoredEIonIn(Float_t dE){dEIonIn=dE;}
315  void StoredEIonOut(Float_t dE){dEIonOut=dE;}
316  void StoredEIonTot(Float_t dE){dEIonTot=dE;}
317  void StoredEBremIn(Float_t dE){dEBremIn=dE;}
318  void StoredEBremOut(Float_t dE){dEBremOut=dE;}
319  void StoredEBremTot(Float_t dE){dEBremTot=dE;}
320  void StoredEMscIn(Float_t dE){dEMscIn=dE;}
321  void StoredEMscOut(Float_t dE){dEMscOut=dE;}
322  void StoredEMscTot(Float_t dE){dEMscTot=dE;}
323  void StoredETotIn(Float_t dE){dETotIn=dE;}
324  void StoredETotOut(Float_t dE){dETotOut=dE;}
325  void StoredETot(Float_t dE){dETot=dE;}
326  ///
327 
328  // define a new Class known to ROOT
329  ClassDef(QweakSimUserPrimaryEvent,1)
330 
331 }; // end class QweakSimUserPrimaryEvent
332 
333 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
334 
335 #endif
336 
Float_t OriginVertexTotalEnergy
Total energy right after the primary vertex.
void StoreCrossSectionRadElastic(Float_t cs)
Float_t OriginVertexThetaAngle
(degrees)
Int_t ReactionRegion
The reaction region used for this event, e.g. LH2 interior = 1, US window = 2, DS window = 3...
Int_t PrimaryEventNumber
The primary event number (increments by two due to target energy loss simulation) ...
Float_t GetPreScatteringKineticEnergy() const
void StoreOriginVertexKinematicQ2(Float_t q2)
Float_t PrimaryQ2
Momentum transfer Q^2 for this event (GeV2)
void StoreCrossSectionBornInelastic(Float_t cs)
Float_t GetOriginVertexKineticEnergy() const
Float_t GetOriginVertexMomentumDirectionX() const
void StoreCrossSectionRadTotalIntOnly(Float_t cs)
Float_t OriginVertexKineticEnergy
Kinetic energy right after the primary vertex.
Int_t TrackID
ID of the primary track in this event.
void StoreEPrime_Min(Float_t energy)
Float_t GetCrossSectionRadDISIntOnly() const
Float_t GetCrossSectionRadTotalIntOnly() const
Int_t ReactionType
The reaction type used for this event, e.g. elastic ep = 1, e+p -&gt; e&#39;+p+pi = 2.
void StoreOriginVertexMomentumDirectionY(Float_t vy)
void StoreCrossSectionRadElasticPeak(Float_t cs)
Float_t GetCrossSectionRadQEIntOnly() const
Float_t Asymmetry
Asymmetry for events with these kinematics.
void StoreNumberOfEventToBeProcessed(Int_t events)
void StoreOriginVertexMomentumDirectionZ(Float_t vz)
Float_t GetOriginVertexMomentumDirectionY() const
Float_t CrossSectionWeight
Modified cross section weight for events with these kimematics, assuming flat-theta picking (isotropy...
TString RandomSeed
The state of the random number generator when this event was generated.
void StoreOriginVertexKineticEnergy(Float_t ekin)
Int_t PDGcode
The Lund type of the primary particle, e.g. electron = 11.
void StoreOriginVertexKinematicNu(Float_t nu)
void StoreOriginVertexPhiAngle(Float_t phi)
void StoreCrossSectionRadQEIntOnly(Float_t cs)
void StoreOriginVertexThetaAngle(Float_t theta)
void StoreOriginVertexTotalEnergy(Float_t etot)
Stores the PrimaryEvent information into the ROOT file for each event.
Float_t GetCrossSectionRadElasticIntOnly() const
Float_t GlobalTime
Time of primary interaction, starting 30 cm in front of the target, see target energy loss (ns) ...
void StoreEPrime_Max(Float_t energy)
Float_t GetCrossSectionBornInelastic() const
void StoreBeamEnergy(Float_t energy)
void StorePreScatteringKineticEnergy(Float_t ekin)
void StoreCrossSectionRadDISIntOnly(Float_t cs)
Float_t PreScatteringKineticEnergy
Kinetic energy right before the primary vertex (after external target energy loss) ...
Float_t GetOriginVertexMomentumDirectionZ() const
void StoreOriginVertexMomentumDirectionX(Float_t vx)
Float_t CrossSection
Cross section weight for events with these kinematics, assuming isotropic spherical picking (isotropy...
void StoreCrossSectionRadElasticIntOnly(Float_t cs)
Float_t GetCrossSectionRadElasticPeak() const