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
EventGmcTrans.cxx
Go to the documentation of this file.
1 
11 
12 #include <cmath>
13 #include <sstream>
14 #include <string>
15 
16 namespace erhic {
17 
18 EventGmcTrans::EventGmcTrans(const std::string& s)
19 // Initialise all floats to NAN for consistency with EventDis
20 : mStruckQuark(0)
21 , mQSquared(NAN)
22 , mBjorkenX(NAN)
23 , mInelasticity(NAN)
24 , mWSquared(NAN)
25 , mNu(NAN)
26 , mS(NAN)
27 , mZ(NAN)
28 , mHadronPt(NAN)
29 , mLeptonTheta(NAN)
30 , mLeptonPhi(NAN)
31 , mPhiSpin(NAN)
32 , mPhiHadron(NAN)
33 , mF1(NAN)
34 , mG1(NAN)
35 , mH1(NAN)
36 , mD1(NAN)
37 , mF1TPerp(NAN)
38 , mF1TPerp1(NAN)
39 , mF1TPerp12(NAN)
40 , mH1Perp(NAN)
41 , mH1Perp1(NAN)
42 , mH1Perp12(NAN)
43 , mAutSiv(NAN)
44 , mAutWtSiv(NAN)
45 , mAutSivAllQ(NAN)
46 , mAutWtSivAllQ(NAN)
47 , mAutSivPiDiff(NAN)
48 , mAutWtSivPiDiff(NAN)
49 , mAutCol(NAN)
50 , mAutWtCol(NAN)
51 , mAutTw3Col(NAN)
52 , mAutWtTw3Col(NAN)
53 , mAutColAllQ(NAN)
54 , mAutWtColAllQ(NAN)
55 , mXUnpolarised(NAN)
56 , mXSivers(NAN)
57 , mXCollins(NAN) {
58  // Initialise from a string if provided.
59  if (!s.empty()) {
60  Parse(s);
61  } // if
62 }
63 
64 bool EventGmcTrans::Parse(const std::string& line) {
65  // Save ourselves the overhead of a new stringstream with each event read.
66  static std::stringstream stream;
67  // Clear the stream contents and flags from any previous use.
68  stream.str("");
69  stream.clear();
70  // Read values from the input line.
71  stream << line;
72  stream
73  // The first integer is always 0 (indicating start of event record)
74  // so skip that and read the next int, which is the struck quark.
76  >> mBjorkenX
77  >> mQSquared
78  >> mNu
79  >> mInelasticity
80  >> mWSquared
81  >> mZ
82  >> mHadronPt
83  >> mLeptonTheta
84  >> mLeptonPhi
85  >> mPhiSpin
86  >> mPhiHadron
87  >> mF1 >> mG1 >> mH1 >> mD1
88  >> mF1TPerp >> mF1TPerp1 >> mF1TPerp12
89  >> mH1Perp >> mH1Perp1 >> mH1Perp12
90  >> mAutSiv >> mAutWtSiv >> mAutSivAllQ >> mAutWtSivAllQ
91  >> mAutSivPiDiff >> mAutWtSivPiDiff
92  >> mAutCol >> mAutWtCol >> mAutTw3Col >> mAutWtTw3Col
93  >> mAutColAllQ >> mAutWtColAllQ
94  >> mXUnpolarised >> mXSivers >> mXCollins;
95  // Inherits process from EventMC. Always set this equal to 99 for DIS
96  process = 99;
97  // The stream state should still be good if processing
98  // the string went OK.
99  return !stream.fail();
100 }
101 
102 } // namespace erhic
Double32_t mZ
z of the produced hadron
Double32_t mNu
Energy of the exchanged boson in the hadron rest frame.
Double32_t mXCollins
Cross sections.
virtual bool Parse(const std::string &)
Double32_t mLeptonTheta
Polar angle of the scattered lepton.
Int_t process
PYTHIA code for the physics process producing the event.
Definition: EventMC.h:202
Int_t mStruckQuark
Flavour of struck quark.
Double32_t mLeptonPhi
Azimuthal angle of the scattered lepton.
Double32_t mHadronPt
pT of the produced hadron
Double32_t mWSquared
Invariant mass of the hadronic final state.
EventGmcTrans(const std::string &="")