All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Types | Public Member Functions | Private Attributes | List of all members
trkf::MCSFitProducerICARUS Class Reference

Producer for TrajectoryMCSFitterICARUS. More...

Inheritance diagram for trkf::MCSFitProducerICARUS:

Classes

struct  Config
 
struct  Inputs
 

Public Types

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

Public Member Functions

 MCSFitProducerICARUS (Parameters const &p)
 
 ~MCSFitProducerICARUS ()
 
 MCSFitProducerICARUS (MCSFitProducerICARUS const &)=delete
 
 MCSFitProducerICARUS (MCSFitProducerICARUS &&)=delete
 
MCSFitProducerICARUSoperator= (MCSFitProducerICARUS const &)=delete
 
MCSFitProducerICARUSoperator= (MCSFitProducerICARUS &&)=delete
 
void produce (art::Event &e) override
 
std::vector< recob::HitprojectHitsOnPlane (art::Event &e, const recob::Track &traj, unsigned int p) const
 

Private Attributes

Parameters p_
 
art::InputTag inputTag
 
TrajectoryMCSFitterICARUS mcsfitter
 

Detailed Description

Producer for TrajectoryMCSFitterICARUS.

Producer for TrajectoryMCSFitterICARUS, which performs a Maximum Likelihood fit of Multiple Coulomb Scattering angles between segments within a Track or Trajectory. It reads a recob::Track collection and produces a collection of recob::MCSFitResult where the elements are in the same order as the input collection (no explicit association is written).

For configuration options see MCSFitProducer::Inputs and MCSFsitProducer::Config

Author
F. Varanini (Padova, ICARUS)
Date
2018
Version
1.0

Definition at line 41 of file MCSFitProducerICARUS_module.cc.

Member Typedef Documentation

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

Definition at line 62 of file MCSFitProducerICARUS_module.cc.

Constructor & Destructor Documentation

trkf::MCSFitProducerICARUS::MCSFitProducerICARUS ( Parameters const &  p)
explicit

Definition at line 83 of file MCSFitProducerICARUS_module.cc.

84  : EDProducer{p}, p_(p), mcsfitter(p_().fitter)
85 {
86  inputTag = art::InputTag(p_().inputs().inputLabel());
87  produces<std::vector<recob::MCSFitResult> >();
88 }
pdgs p
Definition: selectors.fcl:22
TrajectoryMCSFitterICARUS mcsfitter
trkf::MCSFitProducerICARUS::~MCSFitProducerICARUS ( )

Definition at line 90 of file MCSFitProducerICARUS_module.cc.

90 {}
trkf::MCSFitProducerICARUS::MCSFitProducerICARUS ( MCSFitProducerICARUS const &  )
delete
trkf::MCSFitProducerICARUS::MCSFitProducerICARUS ( MCSFitProducerICARUS &&  )
delete

Member Function Documentation

MCSFitProducerICARUS& trkf::MCSFitProducerICARUS::operator= ( MCSFitProducerICARUS const &  )
delete
MCSFitProducerICARUS& trkf::MCSFitProducerICARUS::operator= ( MCSFitProducerICARUS &&  )
delete
void trkf::MCSFitProducerICARUS::produce ( art::Event &  e)
override

Definition at line 92 of file MCSFitProducerICARUS_module.cc.

93 {
94  //std::cout << " MCSFitProducerICARUS produce " << std::endl;
95  //
96  auto output = std::make_unique<std::vector<recob::MCSFitResult> >();
97  //
98  art::Handle<std::vector<recob::Track> > inputH;
99  bool ok = e.getByLabel(inputTag,inputH);
100  if (!ok) throw cet::exception("MCSFitProducerICARUS") << "Cannot find input art::Handle with inputTag " << inputTag;
101  const auto& inputVec = *(inputH.product());
102 
103 //std::cout << " inputh size " << inputVec.size() << std::endl;
104 
105 for (const auto& element : inputVec) {
106  //fit
107  std::vector<recob::Hit> hits2d=projectHitsOnPlane(e,element,2);
108  mcsfitter.set2DHits(hits2d);
110  try{
112  output->emplace_back(std::move(result));
113  } catch(...)
114  {
115  continue;
116  }
117  }
118 
119  e.put(std::move(output));
120 }
TrajectoryMCSFitterICARUS mcsfitter
void set2DHits(std::vector< recob::Hit > h)
std::vector< recob::Hit > projectHitsOnPlane(art::Event &e, const recob::Track &traj, unsigned int p) const
Class storing the result of the Maximum Likelihood fit of Multiple Coulomb Scattering angles between ...
Definition: MCSFitResult.h:19
BEGIN_PROLOG sequence::SlidingWindowTriggerPatternsOppositeWindows END_PROLOG simSlidingORM6O6 effSlidingORW output
do i e
recob::MCSFitResult fitMcs(const recob::TrackTrajectory &traj, bool momDepConst=true) const
std::vector< recob::Hit > trkf::MCSFitProducerICARUS::projectHitsOnPlane ( art::Event &  e,
const recob::Track traj,
unsigned int  p 
) const

Definition at line 122 of file MCSFitProducerICARUS_module.cc.

123 {
124 std::vector<recob::Hit> v;
125  // Get track collection proxy and parallel mcs fit data (associated hits loaded by default)
126  // Note: if tracks were produced from a TrackTrajectory collection you could access the original trajectories adding ',proxy::withOriginalTrajectory()' to the list of arguments
127 //std::cout << " before calling proxy " << std::endl;
128 auto const& tracks = proxy::getCollection<proxy::Tracks>(e,inputTag);
129 //std::cout << " after calling proxy " << std::endl;
130 const auto& track = tracks[0];
131 //std::cout << " proxy nhits " << track.nHits() << std::endl;
132 
133  for (const art::Ptr<recob::Hit>& h : track.hits())
134  if(h->WireID().Plane == p) {
135  //std::cout << "collection hit wire=" << h->WireID() << " peak time=" << h->PeakTime() << std::endl;
136  v.emplace_back(*h);
137  }
138 return v;
139 }
ClusterModuleLabel join with tracks
pdgs p
Definition: selectors.fcl:22
process_name use argoneut_mc_hitfinder track
while getopts h
do i e

Member Data Documentation

art::InputTag trkf::MCSFitProducerICARUS::inputTag
private

Definition at line 78 of file MCSFitProducerICARUS_module.cc.

TrajectoryMCSFitterICARUS trkf::MCSFitProducerICARUS::mcsfitter
private

Definition at line 79 of file MCSFitProducerICARUS_module.cc.

Parameters trkf::MCSFitProducerICARUS::p_
private

Definition at line 77 of file MCSFitProducerICARUS_module.cc.


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