All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TrackCaloSkimmerObj.h
Go to the documentation of this file.
1 #ifndef SBN_TrackCaloSkimmerObj
2 #define SBN_TrackCaloSkimmerObj
3 
4 #include <climits>
5 
6 #include <vector>
7 
8 namespace sbn {
9  struct Vector3D {
10  float x;
11  float y;
12  float z;
13 
15  x(std::numeric_limits<float>::signaling_NaN()),
16  y(std::numeric_limits<float>::signaling_NaN()),
17  z(std::numeric_limits<float>::signaling_NaN())
18  {}
19 
20  };
21 
22  struct WireInfo {
23  uint16_t wire; //!< Wire number
24  uint16_t plane; //!< Plane number
25  uint16_t tpc; //!< TPC number
26  uint16_t channel; //!< Channel number
27  int16_t tdc0; //!< TDC tick of the first ADC value
28  std::vector<short> adcs; //!< List of ADC values
29 
31  wire((uint16_t)-1),
32  plane((uint16_t)-1),
33  tpc((uint16_t)-1),
34  tdc0((uint16_t)-1) {}
35 
36  };
37 
38  struct HitTruth {
39  float e;
40  float nelec;
41  };
42 
43  struct HitInfo {
44  float integral; //!< Integral of gaussian fit to ADC values in hit [ADC]
45  float sumadc; //!< "SummedADC" -- sum of ADC values under gaussian fit [ADC]
46  float width; //!< Width of fitted gaussian hit [ticks]
47  Vector3D sp; //!< Space-Point Position of hit [cm]
48  float time; //!< Peak time of hit [ticks]
49  int id; //!< ID of hit
50  uint16_t channel; //!< Channel number of hit
51  uint16_t wire; //!< Wire number of hit
52  uint16_t plane; //!< Plane number of hit
53  uint16_t tpc; //!< TPC number of hit
54  uint16_t mult; //!< Multiplicity of hit
55  int16_t start; //!< Start tick of hit [ticks]
56  int16_t end; //!< End tick of hit [ticks]
57  bool hasSP; //!< Whether the hit has a SpacePoint
58 
60 
62  integral(-1),
63  sumadc(-1),
64  width(-1),
65  time(-1),
66  id(-1),
67  channel((uint16_t)-1),
68  wire((uint16_t)-1),
69  plane((uint16_t)-1),
70  tpc((uint16_t)-1),
71  mult((uint16_t)-1),
72  start(-1),
73  end(-1) {}
74  };
75 
76  struct TrackHitInfo {
77  HitInfo h; //!< Hit information by itself
78  float pitch; //!< Pitch of track across wire the hit is on [cm]
79  float dqdx; //!< Initial computed dq/dx of hit [ADC/cm]
80  float rr; //!< Residual range of hit along track [cm]
81  Vector3D tp; //!< Track Trajectory position of hit [cm]
82  Vector3D dir; //!< Direction of track at hit location
83  uint16_t i_snippet; //!< Index of hit into snippet
84  bool ontraj; //!< Whether the hit is on the track trajectory
85  bool oncalo; //!< Whether the hit is on the track calorimetry
86 
88  pitch(-1),
89  dqdx(-1),
90  rr(-1),
91  i_snippet((uint16_t)-1),
92  ontraj(false),
93  oncalo(false) {}
94 
95  };
96 
97  struct MetaInfo {
98  int run; //!< Run number
99  int evt; //!< Event number
100  int subrun; //!< Subrun number
101  uint64_t time; //!< Timestamp
102  int ifile; //!< Index of file into processing
103  int iproc; //!< Index of process number into processing (useful for grid)
104 
106  run(-1),
107  evt(-1),
108  subrun(-1),
109  ifile(-1),
110  iproc(-1) {}
111  };
112 
113  struct TrueHit {
114  int16_t cryo; //!< Cryostat of hit
115  int16_t tpc; //!< TPC of hit
116  int16_t plane; //!< Plane of hit
117  int wire; //!< Wire of hit
118  int channel; //!< Channel of hit
119 
120  unsigned ndep; //!< Number of depositions in hit
121  float nelec; //!< Number of electrons in hit
122  float e; //!< energy in hit [MeV]
123  float pitch; //!< Track pitch for hit, using true direction [cm]
124  float pitch_sce; //!< Track pitch for hit, after distortion to pitch caused by space charge [cm]
125 
126  float rr; //!< Track residual range for hit [cm]
127  int itraj; //!< Index of hit along trajectory
128  Vector3D p; //!< Location of hit, computed after space charge [cm]
129  Vector3D p_scecorr; //!< Location of the hit after un-doing space charge [cm]
130  Vector3D p_width; //!< Width of depositions going into hit [cm^2]
131  Vector3D p_scecorr_width; //!< Width of depositions going into hit after un-doing space charge [cm^2]
132  float time; //!< Time of hit [ticks]
133  float tdrift; //!< Drift time [us]
134 
136  cryo(-1),
137  tpc(-1),
138  wire(-1),
139  channel(-1),
140  ndep(0),
141  nelec(0.),
142  e(0.),
143  pitch(0.),
144  rr(0.),
145  itraj(-1),
146  time(0.)
147  {
148  // set the location to 0.
149  p.x = 0;
150  p.y = 0;
151  p.z = 0;
152 
153  p_scecorr.x = 0;
154  p_scecorr.y = 0;
155  p_scecorr.z = 0;
156 
157  p_width.x = 0;
158  p_width.y = 0;
159 
160  p_scecorr_width.z = 0;
161  p_scecorr_width.x = 0;
162  p_scecorr_width.y = 0;
163  p_scecorr_width.z = 0;
164  }
165  };
166 
167  struct TrueParticle {
168  float plane0VisE; //!< Sum of energy deposited on plane 0 (1st Ind.) [GeV]
169  float plane1VisE; //!< Sum of energy deposited on plane 1 (2nd Ind.) [GeV]
170  float plane2VisE; //!< Sum of energy deposited on plane 2 (Col.) [GeV]
171 
172  float genE; //!< Energy at generation pt [GeV]
173  float startE; //!< Energy at first pt in active TPC volume [GeV]
174  float endE; //!< Energy at last pt in active TPC volume [GeV]
175  float genT; //!< Start time of gen point [mus -- t=0 is spill time]
176  float startT; //!< Start time of first TPC point [mus -- t=0 is spill time]
177  float endT; //!< End time last point in the active [mus -- t=0 is spill time]
178  float length; //!< Trajectory length in active TPC volume the particle first enters [cm]
179 
180  unsigned plane0nhit; //!< Number of hits on plane 0 (1st Ind.)
181  unsigned plane1nhit; //!< Number of hits on plane 1 (2nd Ind.)
182  unsigned plane2nhit; //!< Number of hits on plane 2 (Col.)
183 
184  Vector3D genp; //!< Momentum at generation point [GeV/c]
185  Vector3D startp; //!< Momentum at first point in the active TPC volume [GeV/c]
186  Vector3D endp; //!< Momentum at last point in the active TPC volume [GeV/c]
187  Vector3D gen; //!< Generation position [cm]
188  Vector3D start; //!< Start position in the active TPC volume [cm]
189  Vector3D end; //!< End position in the active TPC volume [cm]
190 
191  int wallin; //!< Wall of cryostat particle enters (wNone if starting in detector)
192  int wallout; //!< Wall of cryostat particle exits (wNone if stopping in detector)
193 
194  bool cont_tpc; //!< Whether the particle is contained in a single TPC
195  bool crosses_tpc; //!< Whether the particle crosses a TPC boundary
196  bool contained; //!< Whether the particle is contained in a single active volume
197 
198  int pdg; //!< Particle ID code
199  int G4ID; //!< ID of the particle (taken from G4 -- -1 if this particle is not propogated by G4)
200  int parent; //!< ID of parent particle
201 
202  int start_process; //!< Start G4 process of the particle. Values defned as enum in StandardRecord
203  int end_process; //!< End G4 process of the particle. Values defined as enum in StandardRecord
204 
205  std::vector<TrueHit> truehits0; //!< List of True "hits" of this particle on Plane 0
206  std::vector<TrueHit> truehits1; //!< List of True "hits" of this particle on Plane 1
207  std::vector<TrueHit> truehits2; //!< List of True "hits" of this particle on Plane 2
208 
210  plane0VisE(std::numeric_limits<float>::signaling_NaN()),
211  plane1VisE(std::numeric_limits<float>::signaling_NaN()),
212  plane2VisE(std::numeric_limits<float>::signaling_NaN()),
213  genE(std::numeric_limits<float>::signaling_NaN()),
214  startE(std::numeric_limits<float>::signaling_NaN()),
215  endE(std::numeric_limits<float>::signaling_NaN()),
216  genT(std::numeric_limits<float>::signaling_NaN()),
217  startT(std::numeric_limits<float>::signaling_NaN()),
218  endT(std::numeric_limits<float>::signaling_NaN()),
219  length(std::numeric_limits<float>::signaling_NaN()),
220  plane0nhit(0),
221  plane1nhit(0),
222  plane2nhit(0),
223  wallin(-1),
224  wallout(-1),
225  cont_tpc(false),
227  contained(false),
228  pdg(-1),
229  G4ID(-1), // Invalid
230  start_process(-1),
231  end_process(-1)
232  {}
233  };
234 
235  struct TrackTruth {
236  TrueParticle p; //!< Truth information on particle
237  TrueParticle michel; //!< Truth information on daughter-Michel-electron. Invalid if it doesn't exist
238  float pur; //!< Purity of truth matching
239  float eff; //!< Efficiency of truth matching
240  float depE; //!< Total deposited energy of hits matched to track [GeV]
241 
243  pur(std::numeric_limits<float>::signaling_NaN()),
244  eff(std::numeric_limits<float>::signaling_NaN()),
245  depE(std::numeric_limits<float>::signaling_NaN())
246  {}
247 
248  };
249 
250  struct TrackInfo {
251  MetaInfo meta; //!< Meta-data associated with this track
252  std::vector<TrackHitInfo> hits0; //!< List of hits on plane 0
253  std::vector<TrackHitInfo> hits1; //!< List of hits on plane 1
254  std::vector<TrackHitInfo> hits2; //!< List of hits on plane 2
255  std::vector<WireInfo> wires0; //!< List of wire information on plane 0
256  std::vector<WireInfo> wires1; //!< List of wire information on plane 1
257  std::vector<WireInfo> wires2; //!< List of wire information on plane 2
258 
259  float t0; //!< T0 of track [us]
260  int whicht0; //!< Which T0 producer was used to tag
261  int id; //!< ID of track
262  int cryostat; //!< Cryostat number of track
263  bool clear_cosmic_muon; //!< Whether Pandora thinks the track is "clearly" a cosmic
264  Vector3D start; //!< Start position of track [cm]
265  Vector3D end; //!< End position of track [cm]
266  Vector3D dir; //!< Direction of track
267  float length; //!< Length of track [cm]
268 
269  float hit_min_time_p0_tpcE; //!< Min hit time of track on plane 0 TPC E
270  float hit_max_time_p0_tpcE; //!< Max hit time of track on plane 0 TPC E
271  float hit_min_time_p1_tpcE; //!< Min hit time of track on plane 1 TPC E
272  float hit_max_time_p1_tpcE; //!< Max hit time of track on plane 1 TPC E
273  float hit_min_time_p2_tpcE; //!< Min hit time of track on plane 2 TPC E
274  float hit_max_time_p2_tpcE; //!< Max hit time of track on plane 2 TPC E
275  float hit_min_time_p0_tpcW; //!< Min hit time of track on plane 0 TPC W
276  float hit_max_time_p0_tpcW; //!< Max hit time of track on plane 0 TPC W
277  float hit_min_time_p1_tpcW; //!< Min hit time of track on plane 1 TPC W
278  float hit_max_time_p1_tpcW; //!< Max hit time of track on plane 1 TPC W
279  float hit_min_time_p2_tpcW; //!< Min hit time of track on plane 2 TPC W
280  float hit_max_time_p2_tpcW; //!< Max hit time of track on plane 2 TPC W
281 
282  float const_fit_C; //!< Fit parameter
283  float const_fit_residuals; //!< Fit parameter
284 
285  float exp_fit_A; //!< Fit parameter
286  float exp_fit_R; //!< Fit parameter
287  float exp_fit_residuals; //!< Fit parameter
288 
289  int n_fit_point; //!< Fit parameter
290 
291  int selected; //!< Index of the tool that selected this track
292  int nprescale; //!< Prescale of the tool that selected this track
293 
294  std::vector<int> daughter_pdg; //!< Pandora PDG codes of daughter PFP's
295  std::vector<unsigned> daughter_nsp; //!< Number of space points in each daughter
296  std::vector<float> daughter_sp_toend_dist; //!< Smallest distance from any daughter Space Point to Track End [cm]
297 
298  std::vector<float> tracks_near_end_dist; //!< List of tracks near the end of this track
299  std::vector<float> tracks_near_end_costh; //!< List of tracks near the end of this track
300 
301  std::vector<float> tracks_near_start_dist; //!< List of tracks near the start of this track
302  std::vector<float> tracks_near_start_costh; //!< List of tracks near the start of this track
303 
304  std::vector<HitInfo> endhits; //!< List of hits near the endpoint of the track on the collection plane
305 
306  TrackTruth truth; //!< Truth-matching information
307 
309  t0(-1),
310  id(-1),
311  cryostat(-1),
313  length(-1),
314  hit_min_time_p0_tpcE(-100000),
315  hit_max_time_p0_tpcE(-100000),
316  hit_min_time_p1_tpcE(-100000),
317  hit_max_time_p1_tpcE(-100000),
318  hit_min_time_p2_tpcE(-100000),
319  hit_max_time_p2_tpcE(-100000),
320  hit_min_time_p0_tpcW(-100000),
321  hit_max_time_p0_tpcW(-100000),
322  hit_min_time_p1_tpcW(-100000),
323  hit_max_time_p1_tpcW(-100000),
324  hit_min_time_p2_tpcW(-100000),
325  hit_max_time_p2_tpcW(-100000),
326  const_fit_C(-1),
328  exp_fit_A(-1),
329  exp_fit_R(-1),
330  exp_fit_residuals(-1),
331  n_fit_point(-1),
332  selected(-1),
333  nprescale(-1) {}
334  };
335 
336 }
337 
338 #endif
std::vector< float > tracks_near_start_costh
List of tracks near the start of this track.
float hit_max_time_p1_tpcE
Max hit time of track on plane 1 TPC E.
int end_process
End G4 process of the particle. Values defined as enum in StandardRecord.
double std(const std::vector< short > &wf, const double ped_mean, size_t start, size_t nsample)
Definition: UtilFunc.cxx:42
float depE
Total deposited energy of hits matched to track [GeV].
float hit_max_time_p2_tpcE
Max hit time of track on plane 2 TPC E.
float hit_max_time_p1_tpcW
Max hit time of track on plane 1 TPC W.
int nprescale
Prescale of the tool that selected this track.
int wallout
Wall of cryostat particle exits (wNone if stopping in detector)
int ifile
Index of file into processing.
int16_t plane
Plane of hit.
int subrun
Subrun number.
float eff
Efficiency of truth matching.
uint16_t plane
Plane number.
Vector3D endp
Momentum at last point in the active TPC volume [GeV/c].
Vector3D sp
Space-Point Position of hit [cm].
uint16_t tpc
TPC number of hit.
Vector3D genp
Momentum at generation point [GeV/c].
HitInfo h
Hit information by itself.
float length
Length of track [cm].
Vector3D gen
Generation position [cm].
std::vector< WireInfo > wires1
List of wire information on plane 1.
float time
Time of hit [ticks].
std::vector< float > tracks_near_end_dist
List of tracks near the end of this track.
int id
ID of hit.
uint16_t channel
Channel number of hit.
float hit_min_time_p2_tpcE
Min hit time of track on plane 2 TPC E.
float const_fit_C
Fit parameter.
Vector3D p
Location of hit, computed after space charge [cm].
float hit_min_time_p0_tpcW
Min hit time of track on plane 0 TPC W.
int16_t tdc0
TDC tick of the first ADC value.
Vector3D end
End position of track [cm].
uint16_t plane
Plane number of hit.
float integral
Integral of gaussian fit to ADC values in hit [ADC].
float exp_fit_A
Fit parameter.
int n_fit_point
Fit parameter.
std::vector< int > daughter_pdg
Pandora PDG codes of daughter PFP&#39;s.
float pitch
Pitch of track across wire the hit is on [cm].
std::vector< HitInfo > endhits
List of hits near the endpoint of the track on the collection plane.
TrackTruth truth
Truth-matching information.
std::vector< TrueHit > truehits0
List of True &quot;hits&quot; of this particle on Plane 0.
float tdrift
Drift time [us].
int whicht0
Which T0 producer was used to tag.
unsigned plane1nhit
Number of hits on plane 1 (2nd Ind.)
int wallin
Wall of cryostat particle enters (wNone if starting in detector)
int itraj
Index of hit along trajectory.
std::vector< TrueHit > truehits2
List of True &quot;hits&quot; of this particle on Plane 2.
uint16_t mult
Multiplicity of hit.
int cryostat
Cryostat number of track.
std::vector< float > tracks_near_start_dist
List of tracks near the start of this track.
Vector3D dir
Direction of track at hit location.
float hit_max_time_p0_tpcW
Max hit time of track on plane 0 TPC W.
uint16_t wire
Wire number of hit.
bool clear_cosmic_muon
Whether Pandora thinks the track is &quot;clearly&quot; a cosmic.
Vector3D start
Start position of track [cm].
float genE
Energy at generation pt [GeV].
int16_t start
Start tick of hit [ticks].
float dqdx
Initial computed dq/dx of hit [ADC/cm].
MetaInfo meta
Meta-data associated with this track.
unsigned plane0nhit
Number of hits on plane 0 (1st Ind.)
float plane2VisE
Sum of energy deposited on plane 2 (Col.) [GeV].
int iproc
Index of process number into processing (useful for grid)
std::vector< WireInfo > wires0
List of wire information on plane 0.
int16_t cryo
Cryostat of hit.
float const_fit_residuals
Fit parameter.
uint16_t channel
Channel number.
float pitch
Track pitch for hit, using true direction [cm].
Vector3D p_scecorr_width
Width of depositions going into hit after un-doing space charge [cm^2].
Vector3D tp
Track Trajectory position of hit [cm].
bool contained
Whether the particle is contained in a single active volume.
int id
ID of track.
float endT
End time last point in the active [mus – t=0 is spill time].
std::vector< TrackHitInfo > hits1
List of hits on plane 1.
Vector3D start
Start position in the active TPC volume [cm].
bool crosses_tpc
Whether the particle crosses a TPC boundary.
bool cont_tpc
Whether the particle is contained in a single TPC.
std::vector< TrueHit > truehits1
List of True &quot;hits&quot; of this particle on Plane 1.
float rr
Track residual range for hit [cm].
std::vector< unsigned > daughter_nsp
Number of space points in each daughter.
Vector3D p_width
Width of depositions going into hit [cm^2].
float hit_min_time_p0_tpcE
Min hit time of track on plane 0 TPC E.
int run
Run number.
float pur
Purity of truth matching.
float time
Peak time of hit [ticks].
float nelec
Number of electrons in hit.
float sumadc
&quot;SummedADC&quot; – sum of ADC values under gaussian fit [ADC]
std::vector< float > daughter_sp_toend_dist
Smallest distance from any daughter Space Point to Track End [cm].
std::vector< WireInfo > wires2
List of wire information on plane 2.
float plane1VisE
Sum of energy deposited on plane 1 (2nd Ind.) [GeV].
float rr
Residual range of hit along track [cm].
float endE
Energy at last pt in active TPC volume [GeV].
Vector3D end
End position in the active TPC volume [cm].
float hit_min_time_p1_tpcE
Min hit time of track on plane 1 TPC E.
uint64_t time
Timestamp.
float startT
Start time of first TPC point [mus – t=0 is spill time].
TrueParticle michel
Truth information on daughter-Michel-electron. Invalid if it doesn&#39;t exist.
float exp_fit_residuals
Fit parameter.
int channel
Channel of hit.
float hit_min_time_p1_tpcW
Min hit time of track on plane 1 TPC W.
float hit_min_time_p2_tpcW
Min hit time of track on plane 2 TPC W.
std::vector< TrackHitInfo > hits0
List of hits on plane 0.
float length
Trajectory length in active TPC volume the particle first enters [cm].
float t0
T0 of track [us].
int selected
Index of the tool that selected this track.
float hit_max_time_p0_tpcE
Max hit time of track on plane 0 TPC E.
uint16_t i_snippet
Index of hit into snippet.
float startE
Energy at first pt in active TPC volume [GeV].
std::vector< TrackHitInfo > hits2
List of hits on plane 2.
float plane0VisE
Sum of energy deposited on plane 0 (1st Ind.) [GeV].
bool hasSP
Whether the hit has a SpacePoint.
float genT
Start time of gen point [mus – t=0 is spill time].
unsigned plane2nhit
Number of hits on plane 2 (Col.)
Vector3D p_scecorr
Location of the hit after un-doing space charge [cm].
float e
energy in hit [MeV]
int G4ID
ID of the particle (taken from G4 – -1 if this particle is not propogated by G4)
float pitch_sce
Track pitch for hit, after distortion to pitch caused by space charge [cm].
int wire
Wire of hit.
int pdg
Particle ID code.
float width
Width of fitted gaussian hit [ticks].
uint16_t wire
Wire number.
TrueParticle p
Truth information on particle.
unsigned ndep
Number of depositions in hit.
std::vector< float > tracks_near_end_costh
List of tracks near the end of this track.
Vector3D dir
Direction of track.
int16_t end
End tick of hit [ticks].
uint16_t tpc
TPC number.
int start_process
Start G4 process of the particle. Values defned as enum in StandardRecord.
bool oncalo
Whether the hit is on the track calorimetry.
float hit_max_time_p2_tpcW
Max hit time of track on plane 2 TPC W.
int evt
Event number.
bool ontraj
Whether the hit is on the track trajectory.
std::vector< short > adcs
List of ADC values.
int16_t tpc
TPC of hit.
int parent
ID of parent particle.
float exp_fit_R
Fit parameter.
Vector3D startp
Momentum at first point in the active TPC volume [GeV/c].