Public Member Functions | Private Member Functions | Private Attributes | List of all members
trkf::Track3DKalmanHit Class Reference
Inheritance diagram for trkf::Track3DKalmanHit:
art::EDProducer art::detail::Producer art::detail::LegacyModule art::Modifier art::ModuleBase art::ProductRegistryHelper

Public Member Functions

 Track3DKalmanHit (fhicl::ParameterSet const &pset)
 
- Public Member Functions inherited from art::EDProducer
 EDProducer (fhicl::ParameterSet const &pset)
 
template<typename Config >
 EDProducer (Table< Config > const &config)
 
std::string workerType () const
 
- Public Member Functions inherited from art::detail::Producer
virtual ~Producer () noexcept
 
 Producer (fhicl::ParameterSet const &)
 
 Producer (Producer const &)=delete
 
 Producer (Producer &&)=delete
 
Produceroperator= (Producer const &)=delete
 
Produceroperator= (Producer &&)=delete
 
void doBeginJob (SharedResources const &resources)
 
void doEndJob ()
 
void doRespondToOpenInputFile (FileBlock const &fb)
 
void doRespondToCloseInputFile (FileBlock const &fb)
 
void doRespondToOpenOutputFiles (FileBlock const &fb)
 
void doRespondToCloseOutputFiles (FileBlock const &fb)
 
bool doBeginRun (RunPrincipal &rp, ModuleContext const &mc)
 
bool doEndRun (RunPrincipal &rp, ModuleContext const &mc)
 
bool doBeginSubRun (SubRunPrincipal &srp, ModuleContext const &mc)
 
bool doEndSubRun (SubRunPrincipal &srp, ModuleContext const &mc)
 
bool doEvent (EventPrincipal &ep, ModuleContext const &mc, std::atomic< std::size_t > &counts_run, std::atomic< std::size_t > &counts_passed, std::atomic< std::size_t > &counts_failed)
 
- Public Member Functions inherited from art::Modifier
 ~Modifier () noexcept
 
 Modifier ()
 
 Modifier (Modifier const &)=delete
 
 Modifier (Modifier &&)=delete
 
Modifieroperator= (Modifier const &)=delete
 
Modifieroperator= (Modifier &&)=delete
 
- Public Member Functions inherited from art::ModuleBase
virtual ~ModuleBase () noexcept
 
 ModuleBase ()
 
ModuleDescription const & moduleDescription () const
 
void setModuleDescription (ModuleDescription const &)
 
std::array< std::vector< ProductInfo >, NumBranchTypes > const & getConsumables () const
 
void sortConsumables (std::string const &current_process_name)
 
template<typename T , BranchType BT>
ViewToken< T > consumesView (InputTag const &tag)
 
template<typename T , BranchType BT>
ViewToken< T > mayConsumeView (InputTag const &tag)
 

Private Member Functions

void produce (art::Event &e) override
 
void beginJob () override
 Begin job method. More...
 
void endJob () override
 End job method. More...
 
void prepareForInput ()
 
KalmanInputs getInput (const art::Event &evt) const
 
Hits getClusteredHits (const art::Event &evt) const
 Fill a collection using clustered hits. More...
 
KalmanInputs getPFParticleStuff (const art::Event &evt) const
 If UsePFParticles is true use this method to fill in hits. More...
 
Hits getAllHits (const art::Event &evt) const
 If both UseClusteredHits and UsePFParticles is false use this method to fill in hits. More...
 
void createOutputs (const art::Event &evt, detinfo::DetectorPropertiesData const &detProp, const std::vector< KalmanOutput > &outputs, const KalmanInputs &inputs, std::vector< recob::Track > &tracks, std::vector< recob::SpacePoint > &spts, art::Assns< recob::Track, recob::Hit > &th_assn, art::Assns< recob::Track, recob::Hit, recob::TrackHitMeta > &thm_assn, art::Assns< recob::Track, recob::SpacePoint > &tsp_assn, art::Assns< recob::SpacePoint, recob::Hit > &sph_assn, art::Assns< recob::PFParticle, recob::Track > &pfPartTrack_assns)
 
void fillHistograms (std::vector< KalmanOutput > &outputs)
 Fill Histograms method. More...
 

Private Attributes

bool fHist
 Make histograms. More...
 
bool fUseClusterHits
 Use clustered hits as input. More...
 
bool fUsePFParticleHits
 Use PFParticle hits as input. More...
 
bool fUsePFParticleSeeds
 Use PFParticle seeds. More...
 
std::string fHitModuleLabel
 Unclustered Hits. More...
 
std::string fClusterModuleLabel
 Clustered Hits. More...
 
std::string fPFParticleModuleLabel
 PFParticle label. More...
 
Track3DKalmanHitAlg fTKHAlg
 Track3DKalmanHit algorithm. More...
 
SpacePointAlg fSpacePointAlg
 Space point algorithm. More...
 
TH1F * fHIncChisq
 Incremental chisquare. More...
 
TH1F * fHPull
 Hit pull. More...
 
int fNumEvent
 Number of events seen. More...
 

Additional Inherited Members

- Public Types inherited from art::EDProducer
using ModuleType = EDProducer
 
using WorkerType = WorkerT< EDProducer >
 
- Public Types inherited from art::detail::Producer
template<typename UserConfig , typename KeysToIgnore = void>
using Table = Modifier::Table< UserConfig, KeysToIgnore >
 
- Public Types inherited from art::Modifier
template<typename UserConfig , typename UserKeysToIgnore = void>
using Table = ProducerTable< UserConfig, detail::ModuleConfig, UserKeysToIgnore >
 
- Static Public Member Functions inherited from art::EDProducer
static void commitEvent (EventPrincipal &ep, Event &e)
 
- Protected Member Functions inherited from art::ModuleBase
ConsumesCollectorconsumesCollector ()
 
template<typename T , BranchType = InEvent>
ProductToken< T > consumes (InputTag const &)
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > consumesView (InputTag const &)
 
template<typename T , BranchType = InEvent>
void consumesMany ()
 
template<typename T , BranchType = InEvent>
ProductToken< T > mayConsume (InputTag const &)
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > mayConsumeView (InputTag const &)
 
template<typename T , BranchType = InEvent>
void mayConsumeMany ()
 

Detailed Description

Definition at line 73 of file Track3DKalmanHit_module.cc.

Constructor & Destructor Documentation

trkf::Track3DKalmanHit::Track3DKalmanHit ( fhicl::ParameterSet const &  pset)
explicit

Constructor.

Arguments:

p - Fcl parameters.

Definition at line 131 of file Track3DKalmanHit_module.cc.

132  : EDProducer{pset}
133  , fHist(false)
134  , fUseClusterHits(false)
135  , fUsePFParticleHits(false)
136  , fUsePFParticleSeeds(false)
137  , fTKHAlg(pset.get<fhicl::ParameterSet>("Track3DKalmanHitAlg"))
138  , fSpacePointAlg(pset.get<fhicl::ParameterSet>("SpacePointAlg"))
139  , fHIncChisq(0)
140  , fHPull(0)
141  , fNumEvent(0)
142 {
143  fHist = pset.get<bool>("Hist");
144  fUseClusterHits = pset.get<bool>("UseClusterHits");
145  fUsePFParticleHits = pset.get<bool>("UsePFParticleHits");
146  fUsePFParticleSeeds = pset.get<bool>("UsePFParticleSeeds");
147  fHitModuleLabel = pset.get<std::string>("HitModuleLabel");
148  fClusterModuleLabel = pset.get<std::string>("ClusterModuleLabel");
149  fPFParticleModuleLabel = pset.get<std::string>("PFParticleModuleLabel");
150  if (fUseClusterHits && fUsePFParticleHits) {
151  throw cet::exception("Track3DKalmanHit")
152  << "Using input from both clustered and PFParticle hits.\n";
153  }
154 
155  produces<std::vector<recob::Track>>();
156  produces<std::vector<recob::SpacePoint>>();
158  recob::Hit>>(); // ****** REMEMBER to remove when FindMany improved ******
159  produces<art::Assns<recob::Track, recob::Hit, recob::TrackHitMeta>>();
160  produces<art::Assns<recob::Track, recob::SpacePoint>>();
161  produces<art::Assns<recob::SpacePoint, recob::Hit>>();
162  produces<art::Assns<recob::PFParticle, recob::Track>>();
163 
164  // Report.
165 
166  mf::LogInfo("Track3DKalmanHit") << "Track3DKalmanHit configured with the following parameters:\n"
167  << " UseClusterHits = " << fUseClusterHits << "\n"
168  << " HitModuleLabel = " << fHitModuleLabel << "\n"
169  << " ClusterModuleLabel = " << fClusterModuleLabel;
170 }
bool fUseClusterHits
Use clustered hits as input.
std::string fHitModuleLabel
Unclustered Hits.
Track3DKalmanHitAlg fTKHAlg
Track3DKalmanHit algorithm.
bool fUsePFParticleSeeds
Use PFParticle seeds.
std::string string
Definition: nybbler.cc:12
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
EDProducer(fhicl::ParameterSet const &pset)
Definition: EDProducer.h:20
std::string fPFParticleModuleLabel
PFParticle label.
void produces(std::string const &instanceName={}, Persistable const persistable=Persistable::Yes)
std::string fClusterModuleLabel
Clustered Hits.
SpacePointAlg fSpacePointAlg
Space point algorithm.
int fNumEvent
Number of events seen.
bool fUsePFParticleHits
Use PFParticle hits as input.
TrackCollectionProxyElement< TrackCollProxy > Track
Proxy to an element of a proxy collection of recob::Track objects.
Definition: Track.h:1036
2D representation of charge deposited in the TDC/wire plane
Definition: Hit.h:48
TH1F * fHIncChisq
Incremental chisquare.
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33

Member Function Documentation

void trkf::Track3DKalmanHit::beginJob ( )
overrideprivatevirtual

Begin job method.

Reimplemented from art::EDProducer.

Definition at line 175 of file Track3DKalmanHit_module.cc.

176 {
177  if (fHist) {
178  // Book histograms.
180  art::TFileDirectory dir = tfs->mkdir("hitkalman", "Track3DKalmanHit histograms");
181 
182  fHIncChisq = dir.make<TH1F>("IncChisq", "Incremental Chisquare", 100, 0., 20.);
183  fHPull = dir.make<TH1F>("Pull", "Hit Pull", 100, -10., 10.);
184  }
185 }
string dir
TH1F * fHIncChisq
Incremental chisquare.
void trkf::Track3DKalmanHit::createOutputs ( const art::Event evt,
detinfo::DetectorPropertiesData const &  detProp,
const std::vector< KalmanOutput > &  outputs,
const KalmanInputs inputs,
std::vector< recob::Track > &  tracks,
std::vector< recob::SpacePoint > &  spts,
art::Assns< recob::Track, recob::Hit > &  th_assn,
art::Assns< recob::Track, recob::Hit, recob::TrackHitMeta > &  thm_assn,
art::Assns< recob::Track, recob::SpacePoint > &  tsp_assn,
art::Assns< recob::SpacePoint, recob::Hit > &  sph_assn,
art::Assns< recob::PFParticle, recob::Track > &  pfPartTrack_assns 
)
private

Definition at line 380 of file Track3DKalmanHit_module.cc.

392 {
393  if (outputs.size() != inputs.size()) return;
394 
395  size_t tracksSize(0);
396  for (auto const& kalman_output : outputs) {
397  tracksSize += kalman_output.tracks.size();
398  }
399  tracks.reserve(tracksSize);
400 
401  auto const tid = evt.getProductID<std::vector<recob::Track>>();
402  auto const tidgetter = evt.productGetter(tid);
403 
404  auto const spacepointId = evt.getProductID<std::vector<recob::SpacePoint>>();
405  auto const getter = evt.productGetter(spacepointId);
406 
407  for (size_t i = 0; i < outputs.size(); ++i) {
408  // Recover the kalman tracks double ended queue
409  const std::deque<KGTrack>& kalman_tracks = outputs[i].tracks;
410 
411  for (auto const& kalman_track : kalman_tracks) {
412 
413  // Add Track object to collection.
414  recob::Track track;
415  kalman_track.fillTrack(detProp, track, tracks.size());
416  if (track.NumberTrajectoryPoints() < 2) { continue; }
417  unsigned int numtrajpts = track.NumberTrajectoryPoints();
418  tracks.emplace_back(std::move(track));
419  // SS: tracks->size() does not change after this point in each iteration
420 
421  //fill hits from this track
422  Hits trhits;
423  std::vector<unsigned int> hittpindex; //hit-trajectory point index
424  kalman_track.fillHits(trhits, hittpindex);
425  if (hittpindex.back() >= numtrajpts) { //something is wrong
426  throw cet::exception("Track3DKalmanHit")
427  << "Last hit corresponds to trajectory point index " << hittpindex.back()
428  << " while the number of trajectory points is " << numtrajpts << '\n';
429  }
430 
431  // Make space points from this track.
432  auto nspt = spts.size();
433  fSpacePointAlg.fillSpacePoints(detProp, spts, kalman_track.TrackMap());
434 
435  std::vector<art::Ptr<recob::SpacePoint>> sptvec;
436  for (auto ispt = nspt; ispt < spts.size(); ++ispt) {
437  sptvec.emplace_back(spacepointId, ispt, getter);
438  // Associate newly created space points with hits.
439  // Make space point to hit associations.
440  auto const& sphits = fSpacePointAlg.getAssociatedHits((spts)[ispt]);
441  for (auto const& sphit : sphits) {
442  sph_assn.addSingle(sptvec.back(), sphit);
443  }
444  }
445 
446  art::Ptr<recob::Track> aptr(tid, tracks.size() - 1, tidgetter);
447 
448  // Make Track to Hit associations.
449  for (size_t h = 0; h < trhits.size(); ++h) {
450  th_assn.addSingle(aptr, trhits[h]);
451  recob::TrackHitMeta metadata(hittpindex[h], -1);
452  thm_assn.addSingle(aptr, trhits[h], metadata);
453  }
454 
455  // Make track to space point associations
456  for (auto const& spt : sptvec) {
457  tsp_assn.addSingle(aptr, spt);
458  }
459 
460  // Optionally fill track-to-PFParticle associations.
461  if (fUsePFParticleHits) { pfPartTrack_assns.addSingle(inputs[i].pfPartPtr, aptr); }
462  } // end of loop over a given collection
463  }
464 }
ProductID getProductID(std::string const &instance_name="") const
Definition: DataViewImpl.h:338
size_t NumberTrajectoryPoints() const
Various functions related to the presence and the number of (valid) points.
Definition: Track.h:102
Data related to recob::Hit associated with recob::Track.The purpose is to collect several variables t...
Definition: TrackHitMeta.h:43
const art::PtrVector< recob::Hit > & getAssociatedHits(const recob::SpacePoint &spt) const
SpacePointAlg fSpacePointAlg
Space point algorithm.
def move(depos, offset)
Definition: depos.py:107
EDProductGetter const * productGetter(ProductID const pid) const
void fillSpacePoints(detinfo::DetectorPropertiesData const &detProp, std::vector< recob::SpacePoint > &spts, std::multimap< double, KHitTrack > const &trackMap) const
Fill a collection of space points.
art::PtrVector< recob::Hit > Hits
bool fUsePFParticleHits
Use PFParticle hits as input.
void addSingle(Ptr< left_t > const &left, Ptr< right_t > const &right, data_t const &data)
Definition: Assns.h:546
Track from a non-cascading particle.A recob::Track consists of a recob::TrackTrajectory, plus additional members relevant for a "fitted" track:
Definition: Track.h:49
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
void trkf::Track3DKalmanHit::endJob ( )
overrideprivatevirtual

End job method.

Reimplemented from art::EDProducer.

Definition at line 238 of file Track3DKalmanHit_module.cc.

239 {
240  mf::LogInfo("Track3DKalmanHit") << "Track3DKalmanHit statistics:\n"
241  << " Number of events = " << fNumEvent << "\n";
242 }
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
int fNumEvent
Number of events seen.
void trkf::Track3DKalmanHit::fillHistograms ( std::vector< KalmanOutput > &  outputs)
private

Fill Histograms method.

Definition at line 471 of file Track3DKalmanHit_module.cc.

472 {
473  for (auto const& output : outputs) {
474  const std::deque<KGTrack>& kalman_tracks = output.tracks;
475  for (size_t i = 0; i < kalman_tracks.size(); ++i) {
476  const KGTrack& trg = kalman_tracks[i];
477  // Loop over measurements in this track.
478  const std::multimap<double, KHitTrack>& trackmap = trg.getTrackMap();
480  ih != trackmap.end();
481  ++ih) {
482  const KHitTrack& trh = (*ih).second;
483  const std::shared_ptr<const KHitBase>& hit = trh.getHit();
484  double chisq = hit->getChisq();
485  fHIncChisq->Fill(chisq);
486  const KHit<1>* ph1 = dynamic_cast<const KHit<1>*>(&*hit);
487  if (ph1 != 0) {
488  double pull = ph1->getResVector()(0) / std::sqrt(ph1->getResError()(0, 0));
489  fHPull->Fill(pull);
490  }
491  }
492  }
493  }
494 }
intermediate_table::const_iterator const_iterator
Detector simulation of raw signals on wires.
TH1F * fHIncChisq
Incremental chisquare.
trkf::Hits trkf::Track3DKalmanHit::getAllHits ( const art::Event evt) const
private

If both UseClusteredHits and UsePFParticles is false use this method to fill in hits.

Definition at line 288 of file Track3DKalmanHit_module.cc.

289 {
290  Hits hits;
292  evt.getByLabel(fHitModuleLabel, hith);
293  if (!hith.isValid()) return hits;
294  size_t nhits = hith->size();
295  hits.reserve(nhits);
296 
297  for (size_t i = 0; i < nhits; ++i) {
298  hits.push_back(art::Ptr<recob::Hit>(hith, i));
299  }
300  return hits;
301 }
std::string fHitModuleLabel
Unclustered Hits.
bool isValid() const noexcept
Definition: Handle.h:191
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
Definition: DataViewImpl.h:633
art::PtrVector< recob::Hit > Hits
trkf::Hits trkf::Track3DKalmanHit::getClusteredHits ( const art::Event evt) const
private

Fill a collection using clustered hits.

Definition at line 268 of file Track3DKalmanHit_module.cc.

269 {
270  Hits hits;
272  evt.getByLabel(fClusterModuleLabel, clusterh);
273 
274  if (!clusterh.isValid()) return hits;
275  // Get hits from all clusters.
276  art::FindManyP<recob::Hit> hitsbycluster(clusterh, evt, fClusterModuleLabel);
277 
278  for (size_t i = 0; i < clusterh->size(); ++i) {
279  std::vector<art::Ptr<recob::Hit>> clushits = hitsbycluster.at(i);
280  hits.insert(hits.end(), clushits.begin(), clushits.end());
281  }
282  return hits;
283 }
std::string fClusterModuleLabel
Clustered Hits.
bool isValid() const noexcept
Definition: Handle.h:191
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
Definition: DataViewImpl.h:633
art::PtrVector< recob::Hit > Hits
trkf::KalmanInputs trkf::Track3DKalmanHit::getInput ( const art::Event evt) const
private

Definition at line 259 of file Track3DKalmanHit_module.cc.

260 {
261  if (fUsePFParticleHits) return getPFParticleStuff(evt);
262  return KalmanInputs(1, KalmanInput(fUseClusterHits ? getClusteredHits(evt) : getAllHits(evt)));
263 }
bool fUseClusterHits
Use clustered hits as input.
Hits getClusteredHits(const art::Event &evt) const
Fill a collection using clustered hits.
Hits getAllHits(const art::Event &evt) const
If both UseClusteredHits and UsePFParticles is false use this method to fill in hits.
bool fUsePFParticleHits
Use PFParticle hits as input.
std::vector< KalmanInput > KalmanInputs
KalmanInputs getPFParticleStuff(const art::Event &evt) const
If UsePFParticles is true use this method to fill in hits.
trkf::KalmanInputs trkf::Track3DKalmanHit::getPFParticleStuff ( const art::Event evt) const
private

If UsePFParticles is true use this method to fill in hits.

Definition at line 306 of file Track3DKalmanHit_module.cc.

307 {
309  // Our program is to drive the track creation/fitting off the PFParticles in the data store
310  // We'll use the hits associated to the PFParticles for each track - and only those hits.
311  // Without a valid collection of PFParticles there is nothing to do here
312  // We need a handle to the collection of clusters in the data store so we can
313  // handle associations to hits.
315  evt.getByLabel(fPFParticleModuleLabel, pfParticleHandle);
316  if (!pfParticleHandle.isValid()) return inputs;
317 
319  evt.getByLabel(fClusterModuleLabel, clusterHandle);
320 
321  // If there are no clusters then something is really wrong
322  if (!clusterHandle.isValid()) return inputs;
323 
324  // Recover the collection of associations between PFParticles and clusters, this will
325  // be the mechanism by which we actually deal with clusters
326  art::FindManyP<recob::Cluster> clusterAssns(pfParticleHandle, evt, fPFParticleModuleLabel);
327 
328  // Associations to seeds.
329  art::FindManyP<recob::Seed> seedAssns(pfParticleHandle, evt, fPFParticleModuleLabel);
330 
331  // Likewise, recover the collection of associations to hits
332  art::FindManyP<recob::Hit> clusterHitAssns(clusterHandle, evt, fClusterModuleLabel);
333 
334  inputs.reserve(pfParticleHandle->size());
335 
336  // While PFParticle describes a hierarchal structure, for now we simply loop over the collection
337  for (size_t partIdx = 0; partIdx < pfParticleHandle->size(); partIdx++) {
338 
339  // Add a new empty hit collection.
340  inputs.emplace_back();
341  KalmanInput& kalman_input = inputs.back();
342  kalman_input.pfPartPtr = art::Ptr<recob::PFParticle>(pfParticleHandle, partIdx);
343  Hits& hits = kalman_input.hits;
344 
345  // Fill this hit vector by looping over associated clusters and finding the
346  // hits associated to them
347  std::vector<art::Ptr<recob::Cluster>> clusterVec = clusterAssns.at(partIdx);
348 
349  for (auto const& cluster : clusterVec) {
350  std::vector<art::Ptr<recob::Hit>> hitVec = clusterHitAssns.at(cluster.key());
351  hits.insert(hits.end(), hitVec.begin(), hitVec.end());
352  }
353 
354  // If requested, fill associated seeds.
355  if (!fUsePFParticleSeeds) continue;
356  art::PtrVector<recob::Seed>& seeds = kalman_input.seeds;
357  std::vector<art::Ptr<recob::Seed>> seedVec = seedAssns.at(partIdx);
358  seeds.insert(seeds.end(), seedVec.begin(), seedVec.end());
359  art::FindManyP<recob::Hit> seedHitAssns(seedVec, evt, fPFParticleModuleLabel);
360 
361  for (size_t seedIdx = 0; seedIdx < seedVec.size(); ++seedIdx) {
362  std::vector<art::Ptr<recob::Hit>> seedHitVec;
363  //SS: why seedIdx can have an invalid value?
364  try {
365  seedHitVec = seedHitAssns.at(seedIdx);
366  }
367  catch (art::Exception const&) {
368  seedHitVec.clear();
369  }
370  kalman_input.seedhits.emplace_back();
371  Hits& seedhits = kalman_input.seedhits.back();
372  seedhits.insert(seedhits.end(), seedHitVec.begin(), seedHitVec.end());
373  }
374  }
375  return inputs;
376 }
bool fUsePFParticleSeeds
Use PFParticle seeds.
std::string fPFParticleModuleLabel
PFParticle label.
std::string fClusterModuleLabel
Clustered Hits.
Cluster finding and building.
bool isValid() const noexcept
Definition: Handle.h:191
reference back()
Definition: PtrVector.h:387
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
Definition: DataViewImpl.h:633
iterator end()
Definition: PtrVector.h:231
reference at(size_type n)
Definition: PtrVector.h:359
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
std::vector< TrajPoint > seeds
Definition: DataStructs.cxx:13
art::PtrVector< recob::Hit > Hits
iterator insert(iterator position, Ptr< U > const &p)
std::vector< KalmanInput > KalmanInputs
void trkf::Track3DKalmanHit::prepareForInput ( )
private

Definition at line 247 of file Track3DKalmanHit_module.cc.

248 {
250 }
SpacePointAlg fSpacePointAlg
Space point algorithm.
void clearHitMap() const
void trkf::Track3DKalmanHit::produce ( art::Event evt)
overrideprivatevirtual

Produce method.

Implements art::EDProducer.

Definition at line 191 of file Track3DKalmanHit_module.cc.

192 {
193  ++fNumEvent;
194  auto tracks = std::make_unique<std::vector<recob::Track>>();
195  auto th_assn = std::make_unique<art::Assns<recob::Track, recob::Hit>>();
196  auto thm_assn = std::make_unique<art::Assns<recob::Track, recob::Hit, recob::TrackHitMeta>>();
197  auto tsp_assn = std::make_unique<art::Assns<recob::Track, recob::SpacePoint>>();
198  auto pfPartTrack_assns = std::make_unique<art::Assns<recob::PFParticle, recob::Track>>();
199  auto spts = std::make_unique<std::vector<recob::SpacePoint>>();
200  auto sph_assn = std::make_unique<art::Assns<recob::SpacePoint, recob::Hit>>();
201 
202  prepareForInput();
203  auto inputs = getInput(evt);
204 
205  auto const clockData = art::ServiceHandle<detinfo::DetectorClocksService const>()->DataFor(evt);
206  auto const detProp =
208  auto outputs = fTKHAlg.makeTracks(clockData, detProp, inputs);
209 
210  if (fHist) { fillHistograms(outputs); }
211 
212  createOutputs(evt,
213  detProp,
214  outputs,
215  inputs,
216  *tracks,
217  *spts,
218  *th_assn,
219  *thm_assn,
220  *tsp_assn,
221  *sph_assn,
222  *pfPartTrack_assns);
223 
225 
226  evt.put(std::move(tracks));
227  evt.put(std::move(spts));
228  evt.put(std::move(th_assn));
229  evt.put(std::move(thm_assn));
230  evt.put(std::move(tsp_assn));
231  evt.put(std::move(sph_assn));
232  evt.put(std::move(pfPartTrack_assns));
233 }
Track3DKalmanHitAlg fTKHAlg
Track3DKalmanHit algorithm.
KalmanInputs getInput(const art::Event &evt) const
std::vector< trkf::KalmanOutput > makeTracks(detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, KalmanInputs &kalman_inputs)
SpacePointAlg fSpacePointAlg
Space point algorithm.
def move(depos, offset)
Definition: depos.py:107
ProductID put(std::unique_ptr< PROD > &&edp, std::string const &instance={})
Definition: DataViewImpl.h:686
void fillHistograms(std::vector< KalmanOutput > &outputs)
Fill Histograms method.
int fNumEvent
Number of events seen.
Definition: tracks.py:1
void clearHitMap() const
void createOutputs(const art::Event &evt, detinfo::DetectorPropertiesData const &detProp, const std::vector< KalmanOutput > &outputs, const KalmanInputs &inputs, std::vector< recob::Track > &tracks, std::vector< recob::SpacePoint > &spts, art::Assns< recob::Track, recob::Hit > &th_assn, art::Assns< recob::Track, recob::Hit, recob::TrackHitMeta > &thm_assn, art::Assns< recob::Track, recob::SpacePoint > &tsp_assn, art::Assns< recob::SpacePoint, recob::Hit > &sph_assn, art::Assns< recob::PFParticle, recob::Track > &pfPartTrack_assns)

Member Data Documentation

std::string trkf::Track3DKalmanHit::fClusterModuleLabel
private

Clustered Hits.

Definition at line 109 of file Track3DKalmanHit_module.cc.

TH1F* trkf::Track3DKalmanHit::fHIncChisq
private

Incremental chisquare.

Definition at line 115 of file Track3DKalmanHit_module.cc.

bool trkf::Track3DKalmanHit::fHist
private

Make histograms.

Definition at line 104 of file Track3DKalmanHit_module.cc.

std::string trkf::Track3DKalmanHit::fHitModuleLabel
private

Unclustered Hits.

Definition at line 108 of file Track3DKalmanHit_module.cc.

TH1F* trkf::Track3DKalmanHit::fHPull
private

Hit pull.

Definition at line 116 of file Track3DKalmanHit_module.cc.

int trkf::Track3DKalmanHit::fNumEvent
private

Number of events seen.

Definition at line 119 of file Track3DKalmanHit_module.cc.

std::string trkf::Track3DKalmanHit::fPFParticleModuleLabel
private

PFParticle label.

Definition at line 110 of file Track3DKalmanHit_module.cc.

SpacePointAlg trkf::Track3DKalmanHit::fSpacePointAlg
private

Space point algorithm.

Definition at line 112 of file Track3DKalmanHit_module.cc.

Track3DKalmanHitAlg trkf::Track3DKalmanHit::fTKHAlg
private

Track3DKalmanHit algorithm.

Definition at line 111 of file Track3DKalmanHit_module.cc.

bool trkf::Track3DKalmanHit::fUseClusterHits
private

Use clustered hits as input.

Definition at line 105 of file Track3DKalmanHit_module.cc.

bool trkf::Track3DKalmanHit::fUsePFParticleHits
private

Use PFParticle hits as input.

Definition at line 106 of file Track3DKalmanHit_module.cc.

bool trkf::Track3DKalmanHit::fUsePFParticleSeeds
private

Use PFParticle seeds.

Definition at line 107 of file Track3DKalmanHit_module.cc.


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