All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
calo::GnocchiCalorimetry Class Reference
Inheritance diagram for calo::GnocchiCalorimetry:

Classes

struct  Config
 

Public Types

using Parameters = art::EDProducer::Table< Config >
 

Public Member Functions

 GnocchiCalorimetry (Parameters const &config)
 
void produce (art::Event &evt) override
 

Private Member Functions

std::vector< std::vector
< unsigned > > 
OrganizeHits (const std::vector< art::Ptr< recob::Hit >> &hits, const std::vector< const recob::TrackHitMeta * > &thms, const recob::Track &track, unsigned nplanes)
 
std::vector< std::vector
< unsigned > > 
OrganizeHitsIndividual (const std::vector< art::Ptr< recob::Hit >> &hits, const std::vector< const recob::TrackHitMeta * > &thms, const recob::Track &track, unsigned nplanes)
 
std::vector< std::vector
< unsigned > > 
OrganizeHitsSnippets (const std::vector< art::Ptr< recob::Hit >> &hits, const std::vector< const recob::TrackHitMeta * > &thms, const recob::Track &track, unsigned nplanes)
 
bool HitIsValid (const art::Ptr< recob::Hit > hit, const recob::TrackHitMeta *thm, const recob::Track &track)
 
geo::Point_t GetLocation (const recob::Track &track, const art::Ptr< recob::Hit > hit, const recob::TrackHitMeta *meta)
 
geo::Point_t GetLocationAtWires (const recob::Track &track, const art::Ptr< recob::Hit > hit, const recob::TrackHitMeta *meta)
 
geo::Point_t WireToTrajectoryPosition (const geo::Point_t &loc, const geo::TPCID &tpc)
 
geo::Point_t TrajectoryToWirePosition (const geo::Point_t &loc, const geo::TPCID &tpc)
 
double GetPitch (const recob::Track &track, const art::Ptr< recob::Hit > hit, const recob::TrackHitMeta *meta)
 
double GetCharge (const art::Ptr< recob::Hit > hit)
 
double GetEfield (const detinfo::DetectorPropertiesData &dprop, const recob::Track &track, const art::Ptr< recob::Hit > hit, const recob::TrackHitMeta *meta)
 
double Normalize (double dQdx, const art::Event &e, const recob::Hit &h, const geo::Point_t &location, const geo::Vector_t &direction, double t0)
 

Private Attributes

Config fConfig
 
CalorimetryAlg fCaloAlg
 
std::vector< std::unique_ptr
< INormalizeCharge > > 
fNormTools
 

Detailed Description

Definition at line 60 of file GnocchiCalorimetry_module.cc.

Member Typedef Documentation

using calo::GnocchiCalorimetry::Parameters = art::EDProducer::Table<Config>

Definition at line 134 of file GnocchiCalorimetry_module.cc.

Constructor & Destructor Documentation

calo::GnocchiCalorimetry::GnocchiCalorimetry ( Parameters const &  config)
explicit

Definition at line 170 of file GnocchiCalorimetry_module.cc.

170  :
171  EDProducer{param},
172  fConfig(param()),
174 {
175  produces< std::vector<anab::Calorimetry> >();
176  produces< art::Assns<recob::Track, anab::Calorimetry> >();
177 
178  std::vector<fhicl::ParameterSet> norm_tool_configs = fConfig.NormTools.get<std::vector<fhicl::ParameterSet>>();
179  for (const fhicl::ParameterSet &p: norm_tool_configs) {
180  fNormTools.push_back(art::make_tool<INormalizeCharge>(p));
181  }
182 
183 }
pdgs p
Definition: selectors.fcl:22
std::vector< std::unique_ptr< INormalizeCharge > > fNormTools
fhicl::Table< calo::CalorimetryAlg::Config > CalorimetryAlgConfig

Member Function Documentation

double calo::GnocchiCalorimetry::GetCharge ( const art::Ptr< recob::Hit hit)
private
double calo::GnocchiCalorimetry::GetEfield ( const detinfo::DetectorPropertiesData dprop,
const recob::Track track,
const art::Ptr< recob::Hit hit,
const recob::TrackHitMeta meta 
)
private

Definition at line 583 of file GnocchiCalorimetry_module.cc.

583  {
584  auto const* sce = lar::providerFrom<spacecharge::SpaceChargeService>();
585 
586  double EField = dprop.Efield();
587  if (sce->EnableSimEfieldSCE() && fConfig.FieldDistortionEfield()) {
588  // Gets relative E field Distortions
589  geo::Vector_t EFieldOffsets = sce->GetEfieldOffsets(GetLocation(track, hit, meta));
590  // Add 1 in X direction as this is the direction of the drift field
591  EFieldOffsets = EFieldOffsets + geo::Vector_t{1, 0, 0};
592  // Convert to Absolute E Field from relative
593  EFieldOffsets = EField * EFieldOffsets;
594  // We only care about the magnitude for recombination
595  EField = EFieldOffsets.r();
596  }
597  return EField;
598 
599 }
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
process_name hit
Definition: cheaterreco.fcl:51
double Efield(unsigned int planegap=0) const
kV/cm
geo::Point_t GetLocation(const recob::Track &track, const art::Ptr< recob::Hit > hit, const recob::TrackHitMeta *meta)
geo::Point_t calo::GnocchiCalorimetry::GetLocation ( const recob::Track track,
const art::Ptr< recob::Hit hit,
const recob::TrackHitMeta meta 
)
private

Definition at line 461 of file GnocchiCalorimetry_module.cc.

461  {
462  geo::Point_t loc = track.LocationAtPoint(meta->Index());
463  return !fConfig.TrackIsFieldDistortionCorrected() ? WireToTrajectoryPosition(loc, hit->WireID()) : loc;
464 }
Point_t const & LocationAtPoint(size_t i) const
process_name hit
Definition: cheaterreco.fcl:51
geo::Point_t WireToTrajectoryPosition(const geo::Point_t &loc, const geo::TPCID &tpc)
unsigned int Index() const
Hit index along the track trajectory.
Definition: TrackHitMeta.h:55
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
geo::Point_t calo::GnocchiCalorimetry::GetLocationAtWires ( const recob::Track track,
const art::Ptr< recob::Hit hit,
const recob::TrackHitMeta meta 
)
private

Definition at line 483 of file GnocchiCalorimetry_module.cc.

483  {
484  geo::Point_t loc = track.LocationAtPoint(meta->Index());
485  return fConfig.TrackIsFieldDistortionCorrected() ? TrajectoryToWirePosition(loc, hit->WireID()) : loc;
486 }
Point_t const & LocationAtPoint(size_t i) const
process_name hit
Definition: cheaterreco.fcl:51
geo::Point_t TrajectoryToWirePosition(const geo::Point_t &loc, const geo::TPCID &tpc)
unsigned int Index() const
Hit index along the track trajectory.
Definition: TrackHitMeta.h:55
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
double calo::GnocchiCalorimetry::GetPitch ( const recob::Track track,
const art::Ptr< recob::Hit hit,
const recob::TrackHitMeta meta 
)
private

Definition at line 508 of file GnocchiCalorimetry_module.cc.

508  {
509  art::ServiceHandle<geo::Geometry const> geom;
510  auto const* sce = lar::providerFrom<spacecharge::SpaceChargeService>();
511 
512  double angleToVert = geom->WireAngleToVertical(hit->View(), hit->WireID().TPC, hit->WireID().Cryostat) - 0.5*::util::pi<>();
513 
515 
516  // "dir" should be the direction that the wires see. If the track already has the field
517  // distortion corrections applied, then we need to de-apply them to get the direction as
518  // seen by the wire planes
519  if (sce->EnableCalSpatialSCE() && fConfig.FieldDistortion() && fConfig.TrackIsFieldDistortionCorrected()) {
520  geo::Point_t loc = track.LocationAtPoint(meta->Index());
521 
522  // compute the dir of the track trajectory
523  geo::Vector_t track_dir = track.DirectionAtPoint(meta->Index());
524  geo::Point_t loc_mdx = loc - track_dir * (geom->WirePitch(hit->View()) / 2.);
525  geo::Point_t loc_pdx = loc + track_dir * (geom->WirePitch(hit->View()) / 2.);
526 
527  loc_mdx = TrajectoryToWirePosition(loc_mdx, hit->WireID());
528  loc_pdx = TrajectoryToWirePosition(loc_pdx, hit->WireID());
529 
530  // Direction at wires
531  dir = (loc_pdx - loc_mdx) / (loc_mdx - loc_pdx).r();
532  }
533  // If there is no space charge or the track is not yet corrected, then the dir
534  // is the track is what we want
535  else {
536  dir = track.DirectionAtPoint(meta->Index());
537  }
538 
539  double cosgamma = std::abs(std::sin(angleToVert)*dir.Y() + std::cos(angleToVert)*dir.Z());
540  double pitch;
541  if (cosgamma) {
542  pitch = geom->WirePitch(hit->View())/cosgamma;
543  }
544  else {
545  pitch = 0.;
546  }
547 
548  // now take the pitch computed on the wires and correct it back to the particle trajectory
549  geo::Point_t loc_w = GetLocationAtWires(track, hit, meta);
550 
551  geo::Point_t locw_pdx_traj = WireToTrajectoryPosition(loc_w + pitch*dir, hit->WireID());
552  geo::Point_t loc = WireToTrajectoryPosition(loc_w, hit->WireID());
553 
554  pitch = (locw_pdx_traj - loc).R();
555 
556  return pitch;
557 }
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
Point_t const & LocationAtPoint(size_t i) const
process_name hit
Definition: cheaterreco.fcl:51
geo::Point_t GetLocationAtWires(const recob::Track &track, const art::Ptr< recob::Hit > hit, const recob::TrackHitMeta *meta)
T abs(T value)
geo::Point_t WireToTrajectoryPosition(const geo::Point_t &loc, const geo::TPCID &tpc)
tuple dir
Definition: dropbox.py:28
geo::Point_t TrajectoryToWirePosition(const geo::Point_t &loc, const geo::TPCID &tpc)
unsigned int Index() const
Hit index along the track trajectory.
Definition: TrackHitMeta.h:55
Vector_t DirectionAtPoint(size_t i) const
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
bool calo::GnocchiCalorimetry::HitIsValid ( const art::Ptr< recob::Hit hit,
const recob::TrackHitMeta thm,
const recob::Track track 
)
private

Definition at line 455 of file GnocchiCalorimetry_module.cc.

455  {
456  if (thm->Index() == int_max_as_unsigned_int) return false;
457  if (!track.HasValidPoint(thm->Index())) return false;
458  return true;
459 }
bool HasValidPoint(size_t i) const
unsigned int Index() const
Hit index along the track trajectory.
Definition: TrackHitMeta.h:55
double calo::GnocchiCalorimetry::Normalize ( double  dQdx,
const art::Event &  e,
const recob::Hit h,
const geo::Point_t location,
const geo::Vector_t direction,
double  t0 
)
private

Definition at line 574 of file GnocchiCalorimetry_module.cc.

574  {
575  double ret = dQdx;
576  for (auto const &nt: fNormTools) {
577  ret = nt->Normalize(ret, e, h, location, direction, t0);
578  }
579 
580  return ret;
581 }
std::vector< std::unique_ptr< INormalizeCharge > > fNormTools
do i e
std::vector< std::vector< unsigned > > calo::GnocchiCalorimetry::OrganizeHits ( const std::vector< art::Ptr< recob::Hit >> &  hits,
const std::vector< const recob::TrackHitMeta * > &  thms,
const recob::Track track,
unsigned  nplanes 
)
private

Definition at line 369 of file GnocchiCalorimetry_module.cc.

371  {
372  // charge is computed per hit -- we organize hits indivudally
374  return OrganizeHitsIndividual(hits, thms, track, nplanes);
375  }
376  // charge is computed per snippet -- we organize hits by snippet
377  else {
378  return OrganizeHitsSnippets(hits, thms, track, nplanes);
379  }
380 }
std::vector< std::vector< unsigned > > OrganizeHitsSnippets(const std::vector< art::Ptr< recob::Hit >> &hits, const std::vector< const recob::TrackHitMeta * > &thms, const recob::Track &track, unsigned nplanes)
std::vector< std::vector< unsigned > > OrganizeHitsIndividual(const std::vector< art::Ptr< recob::Hit >> &hits, const std::vector< const recob::TrackHitMeta * > &thms, const recob::Track &track, unsigned nplanes)
std::vector< std::vector< unsigned > > calo::GnocchiCalorimetry::OrganizeHitsIndividual ( const std::vector< art::Ptr< recob::Hit >> &  hits,
const std::vector< const recob::TrackHitMeta * > &  thms,
const recob::Track track,
unsigned  nplanes 
)
private

Definition at line 382 of file GnocchiCalorimetry_module.cc.

384  {
385  std::vector<std::vector<unsigned>> ret(nplanes);
386  for (unsigned i = 0; i < hits.size(); i++) {
387  if (HitIsValid(hits[i], thms[i], track)) {
388  ret[hits[i]->WireID().Plane].push_back(i);
389  }
390  }
391 
392  return ret;
393 }
bool HitIsValid(const art::Ptr< recob::Hit > hit, const recob::TrackHitMeta *thm, const recob::Track &track)
std::vector< std::vector< unsigned > > calo::GnocchiCalorimetry::OrganizeHitsSnippets ( const std::vector< art::Ptr< recob::Hit >> &  hits,
const std::vector< const recob::TrackHitMeta * > &  thms,
const recob::Track track,
unsigned  nplanes 
)
private

Definition at line 395 of file GnocchiCalorimetry_module.cc.

397  {
398  // In this case, we need to only accept one hit in each snippet
399  // Snippets are counted by the Start, End, and Wire. If all these are the same for a hit, then they are on the same snippet.
400  //
401  // If there are multiple valid hits on the same snippet, we need a way to pick the best one.
402  // (TODO: find a good way). The current method is to take the one with the highest charge integral.
403  struct HitIdentifier {
404  int startTick;
405  int endTick;
406  int wire;
407  float integral;
408 
409  // construct
410  explicit HitIdentifier(const recob::Hit &hit):
411  startTick(hit.StartTick()),
412  endTick(hit.EndTick()),
413  wire(hit.WireID().Wire),
414  integral(hit.Integral())
415  {}
416 
417  // Defines whether two hits are on the same snippet
418  inline bool operator==(const HitIdentifier& rhs) const {
419  return startTick == rhs.startTick && endTick == rhs.endTick && wire == rhs.wire;
420  }
421 
422  // Defines which hit to pick between two both on the same snippet
423  inline bool operator>(const HitIdentifier& rhs) const {
424  return integral > rhs.integral;
425  }
426  };
427 
428  std::vector<std::vector<unsigned>> ret(nplanes);
429  std::vector<std::vector<HitIdentifier>> hit_idents(nplanes);
430  for (unsigned i = 0; i < hits.size(); i++) {
431  if (HitIsValid(hits[i], thms[i], track)) {
432  HitIdentifier this_ident(*hits[i]);
433 
434  // check if we have found a hit on this snippet before
435  bool found_snippet = false;
436  for (unsigned j = 0; j < ret[hits[i]->WireID().Plane].size(); j++) {
437  if (this_ident == hit_idents[hits[i]->WireID().Plane][j]) {
438  found_snippet = true;
439  if (this_ident > hit_idents[hits[i]->WireID().Plane][j]) {
440  ret[hits[i]->WireID().Plane][j] = i;
441  hit_idents[hits[i]->WireID().Plane][j] = this_ident;
442  }
443  break;
444  }
445  }
446  if (!found_snippet) {
447  ret[hits[i]->WireID().Plane].push_back(i);
448  hit_idents[hits[i]->WireID().Plane].push_back(this_ident);
449  }
450  }
451  }
452  return ret;
453 }
BEGIN_PROLOG StartTick
bool HitIsValid(const art::Ptr< recob::Hit > hit, const recob::TrackHitMeta *thm, const recob::Track &track)
process_name hit
Definition: cheaterreco.fcl:51
IDparameter< geo::WireID > WireID
Member type of validated geo::WireID parameter.
constexpr bool operator>(Interval< Q, Cat > const a, Quantity< Args...> const b) noexcept
Definition: intervals.h:476
2D representation of charge deposited in the TDC/wire plane
Definition: Hit.h:48
bool operator==(infinite_endcount_iterator< T > const &, count_iterator< T > const &)
Definition: counter.h:269
void calo::GnocchiCalorimetry::produce ( art::Event &  evt)
override

Definition at line 185 of file GnocchiCalorimetry_module.cc.

185  {
186  // Get services
187  art::ServiceHandle<geo::Geometry const> geom;
188  auto const clock_data = art::ServiceHandle<detinfo::DetectorClocksService const>()->DataFor(evt);
189  auto const det_prop =
190  art::ServiceHandle<detinfo::DetectorPropertiesService const>()->DataFor(evt, clock_data);
191 
192  size_t nplanes = geom->Nplanes();
193 
194  // Define output collections
195  std::unique_ptr< std::vector<anab::Calorimetry> > outputCalo(new std::vector<anab::Calorimetry>);
196  std::unique_ptr< art::Assns<recob::Track, anab::Calorimetry> > outputCaloAssn(new art::Assns<recob::Track, anab::Calorimetry>);
197 
198  // collect input
199  art::Handle< std::vector<recob::Track> > trackListHandle;
200  std::vector<art::Ptr<recob::Track> > tracklist;
201  if (evt.getByLabel(fConfig.TrackModuleLabel(), trackListHandle)) {
202  art::fill_ptr_vector(tracklist, trackListHandle);
203  }
204 
205  // get the label to collect this hits
206  const std::string &hitLabel = (fConfig.AssocHitModuleLabel() == "") ? fConfig.TrackModuleLabel() : fConfig.AssocHitModuleLabel();
207  art::FindManyP<recob::Hit, recob::TrackHitMeta> fmHits(trackListHandle, evt, hitLabel);
208 
209  // must be valid if the T0 module label is non-empty
210  art::FindManyP<anab::T0> fmT0s(trackListHandle, evt, fConfig.T0ModuleLabel());
211 
212  // iterate over all the tracks
213  for (unsigned trk_i = 0; trk_i < tracklist.size(); trk_i++) {
214  const recob::Track &track = *tracklist[trk_i];
215 
216  // collect input for this track
217  const std::vector<art::Ptr<recob::Hit>> &hits = fmHits.at(trk_i);
218  const std::vector<const recob::TrackHitMeta *> &thms = fmHits.data(trk_i);
219 
220  double T0 = 0;
221  if (fConfig.T0ModuleLabel().size()) {
222  const std::vector<art::Ptr<anab::T0>> &this_t0s = fmT0s.at(trk_i);
223  if (this_t0s.size()) T0 = this_t0s.at(0)->Time();
224  }
225 
226  // organize the hits by plane
227  std::vector<std::vector<unsigned>> hit_indices = OrganizeHits(hits, thms, track, nplanes);
228 
229  for (unsigned plane_i = 0; plane_i < nplanes; plane_i++) {
230 
231  float kinetic_energy = 0.;
232  std::vector<float> dEdxs;
233  std::vector<float> dQdxs;
234  std::vector<float> resranges;
235  std::vector<float> deadwireresranges;
236  float range = 0.;
237  std::vector<float> pitches;
238  std::vector<geo::Point_t> xyzs;
239  std::vector<size_t> tp_indices;
240  geo::PlaneID plane;
241 
242  // setup the plane ID
243  plane.Plane = plane_i;
244  plane.TPC = 0; // arbitrary -- tracks can cross TPC boundaries
245  plane.Cryostat = fConfig.Cryostat();
246  plane.isValid = true;
247 
248  std::vector<float> lengths;
249  for (unsigned hit_i = 0; hit_i < hit_indices[plane_i].size(); hit_i++) {
250  unsigned hit_index = hit_indices[plane_i][hit_i];
251 
252  // Get the location of this point
253  geo::Point_t location = GetLocation(track, hits[hit_index], thms[hit_index]);
254 
255  // Get the pitch
256  double pitch = GetPitch(track, hits[hit_index], thms[hit_index]);
257 
258  // And the charge
259  double charge = GetCharge(hits[hit_index]);
260 
261  // Get the EField
262  double EField = GetEfield(det_prop, track, hits[hit_index], thms[hit_index]);
263 
264  double dQdx = charge / pitch;
265 
266  // Normalize out the detector response
267  dQdx = Normalize(dQdx, evt,
268  *hits[hit_index], track.LocationAtPoint(thms[hit_index]->Index()), track.DirectionAtPoint(thms[hit_index]->Index()), T0);
269 
270  // turn into dEdx
272  fCaloAlg.dEdx_AMP(clock_data, det_prop, dQdx, hits[hit_index]->PeakTime(), hits[hit_index]->WireID().Plane, T0, EField) : \
273  fCaloAlg.dEdx_AREA(clock_data, det_prop, dQdx, hits[hit_index]->PeakTime(), hits[hit_index]->WireID().Plane, T0, EField);
274 
275  // save the length between each pair of hits
276  if (xyzs.size() == 0) {
277  lengths.push_back(0.);
278  }
279  else {
280  lengths.push_back((location - xyzs.back()).r());
281  }
282 
283  // save stuff
284  dEdxs.push_back(dEdx);
285  dQdxs.push_back(dQdx);
286  pitches.push_back(pitch);
287  xyzs.push_back(location);
288  kinetic_energy += dEdx * pitch;
289 
290  // TODO: FIXME
291  // It seems weird that the "trajectory-point-index" actually is the
292  // index of the hit... is this a bug in the documentation
293  // of anab::Calorimetry?
294  //
295  // i.e. -- I think this piece of code should actually be:
296  // tp_indices.push_back(thms[hit_index]->Index());
297  tp_indices.push_back(hits[hit_index].key());
298 
299 
300  } // end iterate over hits
301 
302 
303  // turn the lengths vector into a residual-range vector and total length
304  if (lengths.size() > 1) {
305  range = std::accumulate(lengths.begin(), lengths.end(), 0.);
306 
307  // check the direction that the hits are going in the track:
308  // upstream (end-start) or downstream (start-end)
309  bool is_downstream = \
310  (track.Trajectory().Start() - xyzs[0]).r() + (track.Trajectory().End() - xyzs.back()).r() <
311  (track.Trajectory().End() - xyzs[0]).r() + (track.Trajectory().Start() - xyzs.back()).r();
312 
313  resranges.resize(lengths.size());
314  if (is_downstream) {
315  resranges[lengths.size() - 1] = lengths.back() / 2.;
316  for (int i_len = lengths.size() - 2; i_len >= 0; i_len --) {
317  resranges[i_len] = resranges[i_len+1] + lengths[i_len+1];
318  }
319  }
320  else {
321  resranges[0] = lengths[1] / 2.;
322  for (unsigned i_len = 1; i_len < lengths.size(); i_len ++) {
323  resranges[i_len] = resranges[i_len-1] + lengths[i_len];
324  }
325  }
326  }
327 
328  // save the Calorimetry output
329  //
330  // Bogus if less than two hits on this plane
331  if (lengths.size() > 1) {
332  outputCalo->push_back(anab::Calorimetry(kinetic_energy,
333  dEdxs,
334  dQdxs,
335  resranges,
336  deadwireresranges,
337  range,
338  pitches,
339  xyzs,
340  tp_indices,
341  plane));
342  }
343  else {
344  outputCalo->push_back(anab::Calorimetry(util::kBogusD,
345  {},
346  {},
347  {},
348  {},
350  {},
351  {},
352  {},
353  plane));
354  }
355 
356  util::CreateAssn(*this, evt, *outputCalo, tracklist[trk_i], *outputCaloAssn);
357 
358  } // end iterate over planes
359 
360  } // end iterate over tracks
361 
362  evt.put(std::move(outputCalo));
363  evt.put(std::move(outputCaloAssn));
364 
365  return;
366 
367 }
const recob::TrackTrajectory & Trajectory() const
Access to the stored recob::TrackTrajectory.
Point_t const & LocationAtPoint(size_t i) const
The data type to uniquely identify a Plane.
Definition: geo_types.h:472
bool isValid
Whether this ID points to a valid element.
Definition: geo_types.h:211
CryostatID_t Cryostat
Index of cryostat.
Definition: geo_types.h:212
process_name use argoneut_mc_hitfinder track
double Normalize(double dQdx, const art::Event &e, const recob::Hit &h, const geo::Point_t &location, const geo::Vector_t &direction, double t0)
fhicl::Atom< std::string > TrackModuleLabel
fhicl::Atom< std::string > T0ModuleLabel
double dEdx_AMP(detinfo::DetectorClocksData const &clock_data, detinfo::DetectorPropertiesData const &det_prop, recob::Hit const &hit, double pitch, double T0=0) const
double GetEfield(const detinfo::DetectorPropertiesData &dprop, const recob::Track &track, const art::Ptr< recob::Hit > hit, const recob::TrackHitMeta *meta)
PlaneID_t Plane
Index of the plane within its TPC.
Definition: geo_types.h:493
float dEdx(detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, const TCSlice &slc, TP3D &tp3d)
Definition: PFPUtils.cxx:2687
bool CreateAssn(art::Event &evt, std::vector< T > const &a, art::Ptr< U > const &b, art::Assns< U, T > &assn, std::string a_instance, size_t index=UINT_MAX)
Creates a single one-to-one association.
std::vector< std::vector< unsigned > > OrganizeHits(const std::vector< art::Ptr< recob::Hit >> &hits, const std::vector< const recob::TrackHitMeta * > &thms, const recob::Track &track, unsigned nplanes)
Point_t const & End() const
Returns the position of the last valid point of the trajectory [cm].
double dEdx_AREA(detinfo::DetectorClocksData const &clock_data, detinfo::DetectorPropertiesData const &det_prop, recob::Hit const &hit, double pitch, double T0=0) const
double GetPitch(const recob::Track &track, const art::Ptr< recob::Hit > hit, const recob::TrackHitMeta *meta)
Vector_t DirectionAtPoint(size_t i) const
double GetCharge(const art::Ptr< recob::Hit > hit)
constexpr double kBogusD
obviously bogus double value
geo::Point_t GetLocation(const recob::Track &track, const art::Ptr< recob::Hit > hit, const recob::TrackHitMeta *meta)
TCEvent evt
Definition: DataStructs.cxx:8
TPCID_t TPC
Index of the TPC within its cryostat.
Definition: geo_types.h:406
fhicl::Atom< std::string > AssocHitModuleLabel
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
Point_t const & Start() const
Returns the position of the first valid point of the trajectory [cm].
esac echo uname r
Track from a non-cascading particle.A recob::Track consists of a recob::TrackTrajectory, plus additional members relevant for a &quot;fitted&quot; track:
process_name opdaq physics producers generator physics producers generator physics producers generator physics producers generator physics producers generator physics producers generator physics producers generator physics producers generator T0
Definition: gen_protons.fcl:45
geo::Point_t calo::GnocchiCalorimetry::TrajectoryToWirePosition ( const geo::Point_t loc,
const geo::TPCID tpc 
)
private

Definition at line 488 of file GnocchiCalorimetry_module.cc.

488  {
489  auto const* sce = lar::providerFrom<spacecharge::SpaceChargeService>();
490  art::ServiceHandle<geo::Geometry const> geom;
491 
492  geo::Point_t ret = loc;
493 
494  if (sce->EnableCalSpatialSCE() && fConfig.FieldDistortion()) {
495  // Returned X is the drift -- multiply by the drift direction to undo this
496  int corr = geom->TPC(tpc.TPC).DriftDir()[0];
497 
498  geo::Vector_t offset = sce->GetPosOffsets(ret);
499 
500  ret.SetX(ret.X() + corr * fConfig.FieldDistortionCorrectionXSign() * offset.X());
501  ret.SetY(ret.Y() + offset.Y());
502  ret.SetZ(ret.Z() + offset.Z());
503  }
504 
505  return ret;
506 }
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
BEGIN_PROLOG TPC Trig offset(g4 rise time) ProjectToHeight
Definition: CORSIKAGen.fcl:7
TPCID_t TPC
Index of the TPC within its cryostat.
Definition: geo_types.h:406
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
geo::Point_t calo::GnocchiCalorimetry::WireToTrajectoryPosition ( const geo::Point_t loc,
const geo::TPCID tpc 
)
private

Definition at line 466 of file GnocchiCalorimetry_module.cc.

466  {
467  auto const* sce = lar::providerFrom<spacecharge::SpaceChargeService>();
468 
469  geo::Point_t ret = loc;
470 
471  if (sce->EnableCalSpatialSCE() && fConfig.FieldDistortion()) {
472  geo::Vector_t offset = sce->GetCalPosOffsets(ret, tpc.TPC);
473 
474  ret.SetX(ret.X() + fConfig.FieldDistortionCorrectionXSign() * offset.X());
475  ret.SetY(ret.Y() + offset.Y());
476  ret.SetZ(ret.Z() + offset.Z());
477  }
478 
479  return ret;
480 
481 }
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
BEGIN_PROLOG TPC Trig offset(g4 rise time) ProjectToHeight
Definition: CORSIKAGen.fcl:7
TPCID_t TPC
Index of the TPC within its cryostat.
Definition: geo_types.h:406
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

Member Data Documentation

CalorimetryAlg calo::GnocchiCalorimetry::fCaloAlg
private

Definition at line 143 of file GnocchiCalorimetry_module.cc.

Config calo::GnocchiCalorimetry::fConfig
private

Definition at line 142 of file GnocchiCalorimetry_module.cc.

std::vector<std::unique_ptr<INormalizeCharge> > calo::GnocchiCalorimetry::fNormTools
private

Definition at line 144 of file GnocchiCalorimetry_module.cc.


The documentation for this class was generated from the following file: