All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
VertexChargeVacuum_module.cc
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 // Class: VertexChargeVacuumFinder
3 // Plugin Type: producer (art v3_02_06)
4 // File: VertexChargeVacuum_module.cc
5 // Author: grayputnam@uchicago.edu
6 //
7 // Art module for finding large charge depositions near a reconstructed
8 // vertex. Operates on input recob::Hit's. Produces sbn::VertexHit objects
9 // which conatin summary information useful for downstream reco/analysis.
10 ////////////////////////////////////////////////////////////////////////
11 
12 #include "art/Framework/Core/EDProducer.h"
13 #include "art/Framework/Core/ModuleMacros.h"
14 #include "art/Framework/Principal/Event.h"
15 #include "art/Framework/Principal/Handle.h"
16 #include "art/Framework/Principal/Run.h"
17 #include "art/Framework/Principal/SubRun.h"
18 #include "canvas/Utilities/InputTag.h"
19 #include "fhiclcpp/ParameterSet.h"
20 #include "messagefacility/MessageLogger/MessageLogger.h"
22 
23 #include <memory>
24 
40 
43 
44 #include "art/Utilities/make_tool.h"
45 
48 
49 namespace sbn {
50  class VertexChargeVacuum;
51 }
52 
53 
54 class sbn::VertexChargeVacuum : public art::EDProducer {
55 public:
56  explicit VertexChargeVacuum(fhicl::ParameterSet const& p);
57  // The compiler-generated destructor is fine for non-base
58  // classes without bare pointers or other resource use.
59 
60  // Plugins should not be copied or assigned.
61  VertexChargeVacuum(VertexChargeVacuum const&) = delete;
65 
66  // Required functions.
67  void produce(art::Event& e) override;
68 
69 
70 private:
71  // config
72  art::InputTag fPFParticleLabel;
73  art::InputTag fTrackLabel;
79  std::vector<fhicl::ParameterSet> fNormToolConfig;
80  std::vector<std::unique_ptr<INormalizeCharge>> fNormTools;
81 
82  // private data
84 
85  // helpers
88  double Normalize(double dQdx, const art::Event &e, const recob::Hit &h, const geo::Point_t &location, const geo::Vector_t &direction, double t0);
89 };
90 
91 
93  : EDProducer{p},
94  fPFParticleLabel(p.get<std::string>("PFParticleLabel", "pandora")),
95  fTrackLabel(p.get<std::string>("TrackLabel", "pandoraTrack")),
96  fHitVacuumRadius(p.get<float>("HitVacuumRadius")),
97  fUseTrackSPRecovery(p.get<bool>("UseTrackSPRecovery")),
98  fCorrectSCE(p.get<bool>("CorrectSCE")),
99  fPositionsAreSCECorrected(p.get<bool>("PositionsAreSCECorrected")),
100  fSelectNeutrino(p.get<bool>("SelectNeutrino")),
101  fNormToolConfig(p.get<std::vector<fhicl::ParameterSet>>("NormTools", {})),
102  fCaloAlg(p.get<fhicl::ParameterSet >("CaloAlg"))
103 {
104 
105  for (const fhicl::ParameterSet &p: fNormToolConfig) {
106  fNormTools.push_back(art::make_tool<INormalizeCharge>(p));
107  }
108 
109  produces<std::vector<sbn::VertexHit>>();
110  produces<art::Assns<recob::Slice, sbn::VertexHit>>();
111  produces<art::Assns<recob::Hit, sbn::VertexHit>>();
112  produces<art::Assns<recob::Vertex, sbn::VertexHit>>();
113 }
114 
115 std::array<float, 2> HitVector(const recob::Hit &hit, const geo::GeometryCore *geo, const detinfo::DetectorPropertiesData &dprop) {
116  float wire_distance = hit.WireID().Wire;
117  // convert to cm
118  float wire_distance_cm = wire_distance * geo->WirePitch();
119  // and the time difference
120  float time_distance = hit.PeakTime();
121  // convert to cm
122  float time_distance_cm = dprop.ConvertTicksToX(time_distance, hit.WireID());
123 
124  return {wire_distance_cm, time_distance_cm};
125 }
126 
127 std::array<float, 2> VertexVector(const recob::Vertex &vert, const geo::PlaneID &plane, const geo::GeometryCore *geo, const detinfo::DetectorPropertiesData &dprop) {
128  return {(float)(geo->WireCoordinate(vert.position(), plane) * geo->WirePitch()), (float)vert.position().X()};
129 }
130 
132  std::array<float, 2> vert_v = VertexVector(vert, hit.WireID(), geo, dprop);
133  std::array<float, 2> hit_v = HitVector(hit, geo, dprop);
134 
135  return sqrt((vert_v[0] - hit_v[0]) * (vert_v[0] - hit_v[0]) + (vert_v[1] - hit_v[1]) * (vert_v[1] - hit_v[1]));
136 }
137 
138 // local helper function: Get the mean direction of a set of hits away from a vertex (projected on a plane)
139 std::array<float, 2> HitDirection(const std::vector<art::Ptr<recob::Hit>> &hits, const recob::Vertex &vert,
140  const geo::GeometryCore *geo, const detinfo::DetectorPropertiesData &dprop) {
141  if (!hits.size()) return {0., 0.};
142 
143  geo::Vector_t avg(0., 0., 0.);
144 
145  std::array<float, 2> vert_v = VertexVector(vert, hits[0]->WireID(), geo, dprop);
146  geo::Point_t vert_p(vert_v[0], vert_v[1], 0.);
147 
148  for (const art::Ptr<recob::Hit> &h: hits) {
149  std::array<float, 2> hit_v = HitVector(*h, geo, dprop);
150  geo::Point_t hit_p(hit_v[0], hit_v[1], 0.);
151  avg += (hit_p - vert_p).Unit();
152  }
153 
154  avg = avg.Unit();
155 
156  return {(float)avg.X(), (float)avg.Y()};
157 }
158 
159 float TrackDirectionParallel(const recob::Track &trk, const geo::PlaneID &plane,
160  const geo::GeometryCore *geo, const detinfo::DetectorPropertiesData &dprop) {
161  double angleToVert = geo->WireAngleToVertical(geo->View(plane), plane) - 0.5*::util::pi<>();
162  double cosgamma = std::abs(std::sin(angleToVert)*trk.StartDirection().y() + std::cos(angleToVert)*trk.StartDirection().z());
163 
164  float ret = sqrt(cosgamma * cosgamma + trk.StartDirection().x() * trk.StartDirection().x());
165 
166  return ret;
167 
168 }
169 
171  const geo::GeometryCore *geo, const detinfo::DetectorPropertiesData &dprop) {
172  // project the vertex onto the hit Plane
173  std::array<float, 2> v_plane = VertexVector(vert, hit.WireID(), geo, dprop);
174 
175  // also get the 2d hit location
176  std::array<float, 2> h_plane = HitVector(hit, geo, dprop);
177 
178  float t_dir_parallel_plane = TrackDirectionParallel(trk, hit.WireID(), geo, dprop);
179 
180  // Get the distance from the vertex to the hit on the plane.
181  //
182  // The track "should" be along the same direction as the vertex to the hit in the plane,
183  // so this distance is the same as the distance along the track
184  float plane_dist = (h_plane[0] - v_plane[0]) + (h_plane[1] - v_plane[1]);
185 
186  // Use this distance to place the hit along the track trajectory in 3D
187  float dist_3d = plane_dist / t_dir_parallel_plane;
188 
189  // std::cout << "Placing Hit\n";
190  // std::cout << "Hit wire: " << hit.WireID() << std::endl;
191  // std::cout << "Hit plane coord: " << h_plane[0] << " " << h_plane[1] << std::endl;
192  // std::cout << "Vtx plane coord: " << v_plane[0] << " " << v_plane[1] << std::endl;
193  // std::cout << "Trk dir: " << trk.StartDirection().x() << " " << trk.StartDirection().y() << " " << trk.StartDirection().z() << std::endl;
194  // std::cout << "Vtx pos: " << vert.position().x() << " " << vert.position().y() << " " << vert.position().z() << std::endl;
195 
196  // std::cout << "Trk parallel dir: " << t_dir_parallel_plane << std::endl;
197  // std::cout << "Hit plane dist: " << plane_dist << std::endl;
198  // std::cout << "Hit 3d dist: " << dist_3d << std::endl;
199 
200  geo::Vector_t trk_dir(trk.StartDirection().x(), trk.StartDirection().y(), trk.StartDirection().z());
201 
202  return vert.position() + trk_dir * dist_3d;
203 }
204 
206  geo::TPCID tpc = geo->FindTPCAtPosition(p);
207 
208  if (tpc && fPositionsAreSCECorrected) return sbn::GetLocationAtWires(sce, geo, p, tpc);
209  return p;
210 }
211 
213  geo::TPCID tpc = geo->FindTPCAtPosition(p);
214 
215  if (tpc && !fPositionsAreSCECorrected) return sbn::GetLocation(sce, p, tpc);
216  return p;
217 }
218 
219 double sbn::VertexChargeVacuum::Normalize(double dQdx, const art::Event &e, const recob::Hit &h, const geo::Point_t &location, const geo::Vector_t &direction, double t0) {
220 
221  double ret = dQdx;
222 
223  // Normtools configured -- use those
224  if (fNormTools.size()) {
225  for (auto const &nt: fNormTools) {
226  ret = nt->Normalize(ret, e, h, location, direction, t0);
227  }
228  }
229  // Otherwise, fix using configured electron lifetime
230  else {
231  auto const clock_data = art::ServiceHandle<detinfo::DetectorClocksService const>()->DataFor(e);
232  auto const dprop =
233  art::ServiceHandle<detinfo::DetectorPropertiesService const>()->DataFor(e, clock_data);
234 
235  ret = ret * fCaloAlg.LifetimeCorrection(clock_data, dprop, h.PeakTime(), 0.);
236  }
237 
238  return ret;
239 }
240 
242 {
243  // output stuff
244  std::unique_ptr<std::vector<sbn::VertexHit>> outVHit(new std::vector<sbn::VertexHit>);
245  std::unique_ptr<art::Assns<recob::Slice, sbn::VertexHit>> assn(new art::Assns<recob::Slice, sbn::VertexHit>);
246  std::unique_ptr<art::Assns<recob::Vertex, sbn::VertexHit>> vtxAssn(new art::Assns<recob::Vertex, sbn::VertexHit>);
247  std::unique_ptr<art::Assns<recob::Hit, sbn::VertexHit>> hitAssn(new art::Assns<recob::Hit, sbn::VertexHit>);
248 
249  art::PtrMaker<sbn::VertexHit> vhitPtrMaker {evt};
250 
251  // collect services
252  const geo::GeometryCore *geo = lar::providerFrom<geo::Geometry>();
253  auto const clock_data = art::ServiceHandle<detinfo::DetectorClocksService const>()->DataFor(evt);
254  auto const dprop =
255  art::ServiceHandle<detinfo::DetectorPropertiesService const>()->DataFor(evt, clock_data);
256  auto const* sce = lar::providerFrom<spacecharge::SpaceChargeService>();
257  // If we are not correcting for SCE, then blank out the service
258  if (!fCorrectSCE) sce = nullptr;
259 
260  // get the PFParticle's and the associated data
261  art::Handle<std::vector<recob::PFParticle>> pfparticle_handle;
262  evt.getByLabel(fPFParticleLabel, pfparticle_handle);
263 
264  std::vector<art::Ptr<recob::PFParticle>> pfparticles;
265  art::fill_ptr_vector(pfparticles, pfparticle_handle);
266 
267  art::FindManyP<recob::Vertex> pfparticleVertices(pfparticles, evt, fPFParticleLabel);
268  art::FindManyP<recob::Cluster> pfparticleClusters(pfparticles, evt, fPFParticleLabel);
269  art::FindManyP<recob::Slice> pfparticleSlices(pfparticles, evt, fPFParticleLabel);
270  art::FindManyP<recob::Track> pfparticleTracks(pfparticles, evt, fTrackLabel);
271 
272  // organize the PFPlist into a map
273  std::map<unsigned, art::Ptr<recob::PFParticle>> id_to_pfp;
274  for (unsigned i = 0; i < pfparticles.size(); i++) {
275  id_to_pfp[pfparticles[i]->Self()] = pfparticles[i];
276  }
277 
278  // get all the hits
279  // art::Handle<std::vector<recob::Hit>> hit_handle;
280  // evt.getByLabel(fHitLabel, hit_handle);
281 
282  // std::vector<art::Ptr<recob::Hit>> hits;
283  // art::fill_ptr_vector(hits, hit_handle);
284 
285  // map to space-points
286  // art::FindManyP<recob::SpacePoint> hitSPs(hits, evt, fPFParticleLabel);
287 
288  // iterate over the "primary" PFParticles
289  for (unsigned i_pfp = 0; i_pfp < pfparticles.size(); i_pfp++) {
290  const recob::PFParticle &pfp = *pfparticles[i_pfp];
291  if (!pfp.IsPrimary()) continue;
292  // Ignore PFP's with no vertex
293  if (!pfparticleVertices.at(i_pfp).size()) continue;
294 
295  // If configured, require this to be a PFP neutrino
296  unsigned pfpPDGC = std::abs(pfp.PdgCode());
297  if(fSelectNeutrino &&
298  (pfpPDGC != 12) && (pfpPDGC != 14) && (pfpPDGC != 16) ) continue;
299 
300  // we found a primary PFP! Get its vertex.
301  const art::Ptr<recob::Vertex> &vtx_ptr = pfparticleVertices.at(i_pfp).at(0);
302  const recob::Vertex &vert = *vtx_ptr;
303 
304  // The presence of space charge creates two different positions: the position as
305  // "seen" by the wires (post-space charge) and the true position (pre-space charge)
306  //
307  // In some cases we want the wire-position and in other we want the true-position.
308  // To be explicit, create two different vertexes for these two different cases
309  recob::Vertex vert_absolute(PositionAbsolute(vert.position(), geo, sce),
310  vert.covariance(),
311  vert.chi2(),
312  vert.ndof(),
313  vert.ID());
314 
315  recob::Vertex vert_atwires(PositionAtWires(vert.position(), geo, sce),
316  vert.covariance(),
317  vert.chi2(),
318  vert.ndof(),
319  vert.ID());
320 
321  // also get all the daughter PFParticles
322  const std::vector<size_t> &daughters = pfp.Daughters();
323  std::vector<art::Ptr<recob::PFParticle>> daughterPFPs;
324  for (size_t d: daughters) {
325  daughterPFPs.push_back(id_to_pfp.at(d));
326  }
327 
328  // look up the hits of each daughter
329  std::array<std::vector<std::vector<art::Ptr<recob::Hit>>>, 3> daughterPlaneHits;
330  for (const art::Ptr<recob::PFParticle> &d: daughterPFPs) {
331  for (unsigned i_plane = 0; i_plane < 3; i_plane++) {
332  daughterPlaneHits[i_plane].emplace_back();
333  }
334  const std::vector<art::Ptr<recob::Cluster>> &d_clusters = pfparticleClusters.at(d.key());
335  art::FindManyP<recob::Hit> d_cluster_hits(d_clusters, evt, fPFParticleLabel);
336  for (unsigned i = 0; i < d_clusters.size(); i++) {
337  const std::vector<art::Ptr<recob::Hit>> &this_cluster_hits = d_cluster_hits.at(i);
338  daughterPlaneHits[d_clusters[i]->Plane().Plane].back().insert(
339  daughterPlaneHits[d_clusters[i]->Plane().Plane].back().end(),
340  this_cluster_hits.begin(), this_cluster_hits.end());
341  }
342  }
343 
344  // Get the Slice associated with the primary PFP
345  art::Ptr<recob::Slice> thisSlc = pfparticleSlices.at(i_pfp).at(0);
346  // look up the hits
347  art::FindManyP<recob::Hit> thisSlcHits({thisSlc}, evt, fPFParticleLabel);
348  const std::vector<art::Ptr<recob::Hit>> &hits = thisSlcHits.at(0);
349 
350  // work on each plane
351  for (unsigned i_plane = 0; i_plane < 3; i_plane++) {
352  // vacuum up all the hits within the radius
353  std::vector<art::Ptr<recob::Hit>> nearbyHits;
354  for (unsigned i_hit = 0; i_hit < hits.size(); i_hit++) {
355  const recob::Hit &hit = *hits[i_hit];
356  if (hit.WireID().Plane == i_plane) {
357  if (Vert2HitDistance(hit, vert_atwires, geo, dprop) < fHitVacuumRadius) {
358  nearbyHits.push_back(hits[i_hit]);
359  }
360  }
361  }
362 
363  // and find the hit SP's
364  art::FindManyP<recob::SpacePoint> hitSPs(nearbyHits, evt, fPFParticleLabel);
365 
366  // Compute all needed information for each hit
367  for (unsigned i_hit = 0; i_hit < nearbyHits.size(); i_hit++) {
368  const recob::Hit &hit = *nearbyHits[i_hit];
369 
370  sbn::VertexHit vhit;
371  vhit.wire = hit.WireID();
372  vhit.proj_dist_to_vertex = Vert2HitDistance(hit, vert_atwires, geo, dprop);
373  vhit.vtxw = geo->WireCoordinate(vert_atwires.position(), hit.WireID());
374  vhit.vtxx = vert_atwires.position().x();
375  vhit.vtxXYZ = vert_absolute.position();
376 
377  // Compute the charge, using everything we have
378  vhit.charge = fCaloAlg.ElectronsFromADCArea(Normalize(hit.Integral(), evt, hit,
379  vert_absolute.position() /* close enuff to hit */,
380  geo::Vector_t() /* no direction available */,
381  0. /* TODO: add T0*/),
382  hit.WireID().Plane);
383 
384 
385  // lookup the spacepoint location
386  const std::vector<art::Ptr<recob::SpacePoint>> &hit_sp = hitSPs.at(i_hit);
387 
388  bool has_xyz = false;
389  int spID = -1;
390  geo::Point_t spXYZ;
391  // Space-Point!
392  if (hit_sp.size()) {
393  const recob::SpacePoint sp = *hit_sp.at(0);
394  spID = sp.ID();
395  spXYZ = PositionAbsolute(sp.position(), geo, sce);
396  has_xyz = true;
397  }
398  // No Space-Point. If configured, see if we can look up a point along the assigned track
399  else if (fUseTrackSPRecovery) {
400  unsigned plane = hit.WireID().Plane;
401  art::Ptr<recob::PFParticle> matchingPFP;
402  for (unsigned i_pfp_chk = 0; i_pfp_chk < daughterPlaneHits[plane].size(); i_pfp_chk++) {
403  for (unsigned i_hit_chk = 0; i_hit_chk < daughterPlaneHits[plane][i_pfp_chk].size(); i_hit_chk++) {
404  if (daughterPlaneHits[plane][i_pfp_chk][i_hit_chk] == nearbyHits[i_hit]) {
405  matchingPFP = daughterPFPs[i_pfp_chk];
406  break;
407  }
408  }
409  }
410  if (matchingPFP) {
411  const std::vector<art::Ptr<recob::Track>> &pfptrack = pfparticleTracks.at(matchingPFP.key());
412  if (pfptrack.size()) {
413  const recob::Track &thisTrack = *pfptrack.at(0);
414  spXYZ = PositionAbsolute(PlaceHitAlongTrack(thisTrack, vert_atwires, hit, geo, dprop), geo, sce);
415  has_xyz = true;
416  }
417  }
418  }
419 
420  if (has_xyz) {
421  vhit.spID = spID;
422  vhit.spXYZ = spXYZ;
423 
424  geo::Vector_t dir = (spXYZ - vert_absolute.position()).Unit();
425 
426  // Compute the pitch. Since we have used the corrected vertex and Space-Point position, the
427  // pt and dir here are space-charge corrected regardless of the input configuration
428  vhit.pitch = sbn::GetPitch(geo, sce, spXYZ, dir, hit.View(), hit.WireID(), fCorrectSCE, true);
429 
430  vhit.dqdx = vhit.charge / vhit.pitch;
431 
432  // Same here -- input position is already corrected
433  float EField = sbn::GetEfield(dprop, sce, spXYZ, hit.WireID(), false);
434 
435  vhit.dedx = fCaloAlg.dEdx_AREA(clock_data, dprop, vhit.dqdx, hit.PeakTime(), hit.WireID().Plane, 0., EField);
436  }
437  else {
438  vhit.spID = -1;
439  vhit.pitch = -1;
440  vhit.dqdx = -1;
441  vhit.dedx = -1;
442  }
443 
444  // Save!
445  outVHit->push_back(vhit);
446  art::Ptr<sbn::VertexHit> thisVHitPtr = vhitPtrMaker(outVHit->size()-1);
447  assn->addSingle(thisSlc, thisVHitPtr);
448  vtxAssn->addSingle(vtx_ptr, thisVHitPtr);
449  hitAssn->addSingle(nearbyHits[i_hit], thisVHitPtr);
450 
451  } // end iterate over hits
452  } // end iterate over planes
453  } // end iterate over pfparticle's
454 
455  evt.put(std::move(outVHit));
456  evt.put(std::move(vtxAssn));
457  evt.put(std::move(assn));
458  evt.put(std::move(hitAssn));
459 
460 }
461 
462 DEFINE_ART_MODULE(sbn::VertexChargeVacuum)
geo::Length_t WireCoordinate(double YPos, double ZPos, geo::PlaneID const &planeid) const
Returns the index of the nearest wire to the specified position.
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Vector_t
Type for representation of momenta in 3D space.
Definition: geo_vectors.h:164
const std::vector< size_t > & Daughters() const
Returns the collection of daughter particles.
Definition: PFParticle.h:114
float dqdx
charge/pitch [#elec/cm]
Definition: VertexHit.h:20
Utilities related to art service access.
void produce(art::Event &e) override
BEGIN_PROLOG true icarus_rawdigitfilter FilterTools FilterPlane1 Plane
geo::Point_t spXYZ
3D location of the SpacePoint associated with this hit. Space charge corrected. [cm] ...
Definition: VertexHit.h:17
VertexChargeVacuum(fhicl::ParameterSet const &p)
float dedx
Recombination corrected dQ/dx [MeV/cm].
Definition: VertexHit.h:21
geo::WireID WireID() const
Definition: Hit.h:233
geo::WireID wire
Wire that the hit is on.
Definition: VertexHit.h:11
Declaration of signal hit object.
geo::Point_t PositionAbsolute(const geo::Point_t &p, const geo::GeometryCore *geo, const spacecharge::SpaceCharge *sce)
pdgs p
Definition: selectors.fcl:22
The data type to uniquely identify a Plane.
Definition: geo_types.h:472
geo::Point_t position() const
Returns the position of the point in world coordinates [cm].
Definition: SpacePoint.h:80
geo::Point_t GetLocation(const spacecharge::SpaceCharge *sce, geo::Point_t loc_w, geo::TPCID TPC, float xsign=1.)
Get the location in the presence of space charge.
int PdgCode() const
Return the type of particle as a PDG ID.
Definition: PFParticle.h:83
float Integral() const
Integral under the calibrated signal waveform of the hit, in tick x ADC units.
Definition: Hit.h:224
WireID_t Wire
Index of the wire within its plane.
Definition: geo_types.h:580
process_name hit
Definition: cheaterreco.fcl:51
Definition of vertex object for LArSoft.
Definition: Vertex.h:35
float charge
Calibrated and lifetime-corrected charge on the hit [#elec].
Definition: VertexHit.h:12
geo::Length_t WirePitch(geo::PlaneID const &planeid) const
Returns the distance between two consecutive wires.
std::array< float, 2 > HitVector(const recob::Hit &hit, const geo::GeometryCore *geo, const detinfo::DetectorPropertiesData &dprop)
double chi2() const
Definition: Vertex.h:64
geo::Point_t GetLocationAtWires(const spacecharge::SpaceCharge *sce, const geo::GeometryCore *geo, geo::Point_t loc, geo::TPCID TPC, float xsign=1.)
Get the SCE-distorted location (i.e. the location &quot;seen&quot; by the wireplanes)
while getopts h
geo::TPCID FindTPCAtPosition(double const worldLoc[3]) const
Returns the ID of the TPC at specified location.
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
Definition: DumpUtils.h:265
Access the description of detector geometry.
T abs(T value)
Vector_t StartDirection() const
Access to track direction at different points.
IDparameter< geo::WireID > WireID
Member type of validated geo::WireID parameter.
std::array< float, 2 > HitDirection(const std::vector< art::Ptr< recob::Hit >> &hits, const recob::Vertex &vert, const geo::GeometryCore *geo, const detinfo::DetectorPropertiesData &dprop)
double Normalize(double dQdx, const art::Event &e, const recob::Hit &h, const geo::Point_t &location, const geo::Vector_t &direction, double t0)
std::vector< fhicl::ParameterSet > fNormToolConfig
auto end(FixedBins< T, C > const &) noexcept
Definition: FixedBins.h:585
float proj_dist_to_vertex
Distnace from the hit to the vertex on the wireplane.
Definition: VertexHit.h:13
float TrackDirectionParallel(const recob::Track &trk, const geo::PlaneID &plane, const geo::GeometryCore *geo, const detinfo::DetectorPropertiesData &dprop)
bool IsPrimary() const
Returns whether the particle is the root of the flow.
Definition: PFParticle.h:86
double GetPitch(const geo::GeometryCore *geo, const spacecharge::SpaceCharge *sce, geo::Point_t loc, geo::Vector_t dir, geo::View_t view, geo::TPCID tpc, bool correct_sce, bool track_is_sce_corrected, float xsign=1.)
Computes the track-pitch on a plane given an input direction and location.
The data type to uniquely identify a TPC.
Definition: geo_types.h:386
PlaneID_t Plane
Index of the plane within its TPC.
Definition: geo_types.h:493
Description of geometry of one entire detector.
Declaration of cluster object.
float vtxx
X-Position of the vertex associated with this hit as seen by wire-planes. Not space charge corrected...
Definition: VertexHit.h:15
View_t View(geo::PlaneID const &pid) const
Returns the view (wire orientation) on the channels of specified TPC plane.
float Vert2HitDistance(const recob::Hit &hit, const recob::Vertex &vert, const geo::GeometryCore *geo, const detinfo::DetectorPropertiesData &dprop)
Provides recob::Track data product.
geo::Point_t PlaceHitAlongTrack(const recob::Track &trk, const recob::Vertex &vert, const recob::Hit &hit, const geo::GeometryCore *geo, const detinfo::DetectorPropertiesData &dprop)
const SMatrixSym33 & covariance() const
Return vertex 3D covariance (be careful, the matrix may have rank=2).
Definition: Vertex.h:62
tuple dir
Definition: dropbox.py:28
double ConvertTicksToX(double ticks, int p, int t, int c) const
ID_t ID() const
Definition: SpacePoint.h:75
float pitch
Computed pitch of a track traversing from the vertex to this hit. Space charge corrected. [cm].
Definition: VertexHit.h:19
float PeakTime() const
Time of the signal peak, in tick units.
Definition: Hit.h:218
Hierarchical representation of particle flow.
Definition: PFParticle.h:44
int ID() const
Return vertex id.
Definition: Vertex.h:99
do i e
geo::Point_t PositionAtWires(const geo::Point_t &p, const geo::GeometryCore *geo, const spacecharge::SpaceCharge *sce)
std::vector< std::unique_ptr< INormalizeCharge > > fNormTools
double GetEfield(const detinfo::DetectorPropertiesData &dprop, const spacecharge::SpaceCharge *sce, geo::Point_t loc, geo::TPCID TPC, bool correct_loc_sce, float xsign=1.)
Get the E-Field in the presence of space charge.
Declaration of basic channel signal object.
int ndof() const
Definition: Vertex.h:66
VertexChargeVacuum & operator=(VertexChargeVacuum const &)=delete
int spID
ID of the SpacePoint associated with this hit.
Definition: VertexHit.h:16
2D representation of charge deposited in the TDC/wire plane
Definition: Hit.h:48
TCEvent evt
Definition: DataStructs.cxx:8
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
Definition: geo_vectors.h:184
std::array< float, 2 > VertexVector(const recob::Vertex &vert, const geo::PlaneID &plane, const geo::GeometryCore *geo, const detinfo::DetectorPropertiesData &dprop)
double WireAngleToVertical(geo::View_t view, geo::TPCID const &tpcid) const
Returns the angle of the wires in the specified view from vertical.
const Point_t & position() const
Return vertex 3D position.
Definition: Vertex.h:60
art framework interface to geometry description
Track from a non-cascading particle.A recob::Track consists of a recob::TrackTrajectory, plus additional members relevant for a &quot;fitted&quot; track:
geo::Point_t vtxXYZ
3D location of the Vertex associated with this hit. Space charge corrected. [cm]
Definition: VertexHit.h:18
float vtxw
Wire of the vertex associated with this hit. Not space charge corrected. [cm].
Definition: VertexHit.h:14
This is an interface for an art Tool which scales charge by some factor given information about its a...