LBNEDataNtp_t.hh
Go to the documentation of this file.
1 //
2 // G4LBNEData_t.hh
3 //
4 // ADM, July 2005
5 // This is a class that defines the LBNEDataNtp_t object that is used to store the g4numi output
6 // in a root tree.
7 //------------------
8 #ifndef LBNEDATANTP_T_HH
9 #define LBNEDATANTP_T_HH
10 
11 //C++
12 #include <vector>
13 #include <map>
14 #include <iostream>
15 #include <string>
16 
17 #include "TROOT.h" // Top level (or root) structure for all classes
18 #include "TObject.h"
19 
20 #include "TrackPoint_t.hh"
21 
22 
23 namespace TrkPoint
24 {
25  typedef enum ETrkPoint
26  {
27  kTarget = 1 ,
29  kTargetEndPlane = 3 , //this one will only be valid if the target is not inside horn 1 at all
30  kHorn1Enter = 11 ,
32  kHorn1Exit = 13 ,
34  kHorn2Enter = 21 ,
36  kHorn2Exit = 23 ,
38  kDPipeEnter = 31 ,
39  kDPipeExit = 32 ,
40  kUnknown = -99
41  } TrkPoint_t;
42 
43  TrkPoint_t StringToEnum(const std::string &trkpt);
44  TrkPoint_t IntToEnum (int trkpt);
45  std::string IntToString (int trkpt);
46  int StringToInt (const std::string &trkpt);
49  int AsInt (TrkPoint_t trkpt);
50 
51 
52  bool Overlap(const TrkPoint_t lhs, const TrkPoint_t rhs);
53 
54 }
55 
56 
57 
59 {
60 
61 public:
62  // a constructor and a destructor
63  LBNEDataNtp_t();
64  virtual ~LBNEDataNtp_t();
65 
66  typedef std::map<int, TrackPoint_t> TrkPtMap;
68 
69  void Clear();
70 
71 
72  void AddTrkPoint(TrkPoint::TrkPoint_t trkpt, TrackPoint_t &tp);
73  void AddTrkPoint(std::string &strkpt, TrackPoint_t &tp);
74  void AddTrkPoint(TrkPoint::TrkPoint_t trkpt, int type, int trkid,
75  int gen, double impwt, float x, float y, float z,
76  float px, float py, float pz);
77  void AddTrkPoint(std::string &strkpt, int type, int trkid,
78  int gen, double impwt, float x, float y, float z,
79  float px, float py, float pz);
80  /*
81  void AddTrkPointTrackID(TrkPoint::TrkPoint_t &trkpt, int trkid);
82  void AddTrkPointParticleType(TrkPoint::TrkPoint_t &trkpt, int type);
83  void AddTrkPointPosition (TrkPoint::TrkPoint_t &trkpt,
84  float x, float y, float z);
85  void AddTrkPointMomentum (TrkPoint::TrkPoint_t &trkpt,
86  float px, float py, float pz);
87  */
88 
89  const TrkPtMap& GetTrackPointMap() const;
90 
91  bool TrkPtKeyExists(int key) const;
92  const TrackPoint_t& GetTrkPtAt(int key) const;
93 
94  int GetTrkPtParticleTypeAt(int key) const;
95  int GetTrkPtTrackIDAt(int key) const;
96  int GetTrkPtGenerationAt(int key) const;
97  double GetTrkPtImpWeightAt(int key) const;
98  float GetTrkPtPositionAt(int key, const std::string &pos) const;
99  float GetTrkPtMomentumAt(int key, const std::string &mpos) const;
100 
101 
102 public:
103 
104 
105  // the following variables are placed in the root tree
106  Int_t run;
107  Int_t evtno;
108  Int_t protonN;
109  Float_t beamHWidth;
110  Float_t beamVWidth;
111  Float_t beamX;
112  Float_t beamY;
113  Float_t protonX;
114  Float_t protonY;
115  Float_t protonZ;
116  Float_t protonPx;
117  Float_t protonPy;
118  Float_t protonPz;
119  Float_t nuTarZ;
120  Float_t hornCurrent;
121  Float_t Ndxdz;
122  Float_t Ndydz;
123  Float_t Npz;
124  Float_t Nenergy;
125  Float_t NdxdzNear[5];
126  Float_t NdydzNear[5];
127  Float_t NenergyN[5];
128  Double_t NWtNear[5];
129  Float_t NdxdzFar[3];
130  Float_t NdydzFar[3];
131  Float_t NenergyF[3];
132  Double_t NWtFar[3];
133  Int_t Norig;
134  Int_t Ndecay;
135  Int_t Ntype;
136  Float_t Vx;
137  Float_t Vy;
138  Float_t Vz;
139  Float_t pdPx;
140  Float_t pdPy;
141  Float_t pdPz;
142  Float_t ppdxdz;
143  Float_t ppdydz;
144  Float_t pppz;
145  Float_t ppenergy;
146  Float_t ppmedium;
147  Int_t ptype;
148  Int_t ptrkid;
149  Float_t ppvx;
150  Float_t ppvy;
151  Float_t ppvz;
152  Float_t muparpx;
153  Float_t muparpy;
154  Float_t muparpz;
155  Float_t mupare;
156  Float_t Necm;
157  Double_t Nimpwt;
158  Float_t xpoint;
159  Float_t ypoint;
160  Float_t zpoint;
161  Float_t tvx;
162  Float_t tvy;
163  Float_t tvz;
164  Float_t tpx;
165  Float_t tpy;
166  Float_t tpz;
167  Int_t tptype;
168  Int_t tgen;
169 //----------------------------------Created By Amit Bashyal-----------
170  Float_t h1posx;
171  Float_t h1posy;
172  Float_t h1posz;
173  Float_t h2posx;
174  Float_t h2posy;
175  Float_t h2posz;
176  Float_t h1momx;
177  Float_t h1momy;
178  Float_t h1momz;
179  Float_t h2momx;
180  Float_t h2momy;
181  Float_t h2momz;
182  Int_t h1trackid;
183  Int_t h2trackid;
184 //-----------------------------------------------------//
185 
186 
187 private:
188 
189  TrkPtMap fTrkPtMap;
190 
191 
192 
193 
194 private:
195  ClassDef(LBNEDataNtp_t ,1) // LBNEDataNtp_t
196 
197 };
198 
200 {
201  return fTrkPtMap;
202 }
203 
204 inline bool LBNEDataNtp_t::TrkPtKeyExists(int key) const
205 {
206  TrkPtMapIter tpit = fTrkPtMap.find(key);
207  if(tpit == fTrkPtMap.end())
208  {
209  return false;
210  }
211 
212  return true;
213 }
214 
215 
216 
217 #endif
218 
std::map< int, TrackPoint_t > TrkPtMap
Float_t hornCurrent
std::string string
Definition: nybbler.cc:12
Float_t beamVWidth
const TrkPtMap & GetTrackPointMap() const
intermediate_table::const_iterator const_iterator
std::string AsString(TrkPoint_t trkpt)
TrkPtMap::const_iterator TrkPtMapIter
TrkPtMap fTrkPtMap
bool Overlap(const TrkPoint_t lhs, const TrkPoint_t rhs)
double y
int AsInt(TrkPoint_t trkpt)
enum TrkPoint::ETrkPoint TrkPoint_t
double z
TrkPoint_t StringToEnum(const std::string &trkpt)
TrkPoint_t IntToEnum(int trkpt)
int StringToInt(const std::string &trkpt)
static QCString type
Definition: declinfo.cpp:672
list x
Definition: train.py:276
std::string AsLabel(TrkPoint_t trkpt)
bool TrkPtKeyExists(int key) const
Float_t beamHWidth
std::string IntToString(int trkpt)