Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
trackinfo::TrackInfo Class Reference
Inheritance diagram for trackinfo::TrackInfo:
art::EDProducer art::ProducerBase art::Consumer art::EngineCreator art::ProductRegistryHelper

Public Types

using ModuleType = EDProducer
 
using WorkerType = WorkerT< EDProducer >
 
template<typename UserConfig , typename KeysToIgnore = void>
using Table = ProducerBase::Table< UserConfig, KeysToIgnore >
 

Public Member Functions

 TrackInfo (fhicl::ParameterSet const &pset)
 
virtual ~TrackInfo ()
 
void produce (art::Event &evt)
 
template<typename PROD , BranchType B = InEvent>
ProductID getProductID (std::string const &instanceName={}) const
 
template<typename PROD , BranchType B>
ProductID getProductID (ModuleDescription const &moduleDescription, std::string const &instanceName) const
 
bool modifiesEvent () const
 
template<typename T , BranchType = InEvent>
ProductToken< Tconsumes (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ProductToken< Tconsumes (InputTag const &it)
 
template<typename T , BranchType = InEvent>
void consumesMany ()
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > consumesView (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ViewToken< TconsumesView (InputTag const &it)
 
template<typename T , BranchType = InEvent>
ProductToken< TmayConsume (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ProductToken< TmayConsume (InputTag const &it)
 
template<typename T , BranchType = InEvent>
void mayConsumeMany ()
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > mayConsumeView (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ViewToken< TmayConsumeView (InputTag const &it)
 
base_engine_tcreateEngine (seed_t seed)
 
base_engine_tcreateEngine (seed_t seed, std::string const &kind_of_engine_to_make)
 
base_engine_tcreateEngine (seed_t seed, std::string const &kind_of_engine_to_make, label_t const &engine_label)
 
seed_t get_seed_value (fhicl::ParameterSet const &pset, char const key[]="seed", seed_t const implicit_seed=-1)
 

Static Public Member Functions

static cet::exempt_ptr< Consumernon_module_context ()
 

Protected Member Functions

void Init ()
 
CurrentProcessingContext const * currentContext () const
 
void validateConsumedProduct (BranchType const bt, ProductInfo const &pi)
 
void prepareForJob (fhicl::ParameterSet const &pset)
 
void showMissingConsumes () const
 

Protected Attributes

trackinfo::TrackInfoFxsfTrackInfoFxs
 
bpfit::dEdxCalculator fdEdxCalc
 helper class for computing dEdx values More...
 
double fdxTOL
 cut off value for dx, if dx is less than this, don't compute dE/dx More...
 
std::string fSlicerLabel
 
std::string fTrackLabel
 
std::string fCosmicTrackLabel
 

Detailed Description

Definition at line 36 of file TrackInfo_module.cc.

Member Typedef Documentation

using art::EDProducer::ModuleType = EDProducer
inherited

Definition at line 34 of file EDProducer.h.

template<typename UserConfig , typename KeysToIgnore = void>
using art::EDProducer::Table = ProducerBase::Table<UserConfig, KeysToIgnore>
inherited

Definition at line 43 of file EDProducer.h.

using art::EDProducer::WorkerType = WorkerT<EDProducer>
inherited

Definition at line 35 of file EDProducer.h.

Constructor & Destructor Documentation

trackinfo::TrackInfo::TrackInfo ( fhicl::ParameterSet const &  pset)
explicit

Definition at line 60 of file TrackInfo_module.cc.

60  :
61  fTrackInfoFxs (new TrackInfoFxs()),
62  fdxTOL (pset.get<double> ("dxTOL")),
63  fSlicerLabel (pset.get< std::string >("SlicerLabel")),
64  fTrackLabel (pset.get< std::string >("TrackLabel")){
65  produces< std::vector<trackinfo::TrackInfoObj> >();
66  produces< art::Assns<trackinfo::TrackInfoObj, rb::Track> >();
67  }
double fdxTOL
cut off value for dx, if dx is less than this, don&#39;t compute dE/dx
trackinfo::TrackInfoFxs * fTrackInfoFxs
enum BeamMode string
trackinfo::TrackInfo::~TrackInfo ( )
virtual

Definition at line 71 of file TrackInfo_module.cc.

References fTrackInfoFxs.

71  {
72  if(fTrackInfoFxs) delete fTrackInfoFxs;
73  }
trackinfo::TrackInfoFxs * fTrackInfoFxs

Member Function Documentation

template<typename T , BranchType = InEvent>
ProductToken<T> art::Consumer::consumes ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ProductToken<T> art::Consumer::consumes ( InputTag const &  it)
inherited

Definition at line 146 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

147 {
148  if (!moduleContext_)
149  return ProductToken<T>::invalid();
150 
151  consumables_[BT].emplace_back(ConsumableType::Product,
152  TypeID{typeid(T)},
153  it.label(),
154  it.instance(),
155  it.process());
156  return ProductToken<T>{it};
157 }
set< int >::iterator it
static ProductToken< T > invalid()
Definition: ProductToken.h:47
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename T , art::BranchType BT>
void art::Consumer::consumesMany ( )
inherited

Definition at line 161 of file Consumer.h.

References T.

162 {
163  if (!moduleContext_)
164  return;
165 
166  consumables_[BT].emplace_back(ConsumableType::Many, TypeID{typeid(T)});
167 }
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::Consumer::consumesView ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ViewToken<T> art::Consumer::consumesView ( InputTag const &  it)
inherited

Definition at line 171 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

172 {
173  if (!moduleContext_)
174  return ViewToken<T>::invalid();
175 
176  consumables_[BT].emplace_back(ConsumableType::ViewElement,
177  TypeID{typeid(T)},
178  it.label(),
179  it.instance(),
180  it.process());
181  return ViewToken<T>{it};
182 }
set< int >::iterator it
static ViewToken< Element > invalid()
Definition: ProductToken.h:75
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
base_engine_t& art::EngineCreator::createEngine ( seed_t  seed)
inherited
base_engine_t& art::EngineCreator::createEngine ( seed_t  seed,
std::string const &  kind_of_engine_to_make 
)
inherited
base_engine_t& art::EngineCreator::createEngine ( seed_t  seed,
std::string const &  kind_of_engine_to_make,
label_t const &  engine_label 
)
inherited
CurrentProcessingContext const* art::EDProducer::currentContext ( ) const
protectedinherited
seed_t art::EngineCreator::get_seed_value ( fhicl::ParameterSet const &  pset,
char const  key[] = "seed",
seed_t const  implicit_seed = -1 
)
inherited
template<typename PROD , BranchType B>
ProductID art::EDProducer::getProductID ( std::string const &  instanceName = {}) const
inlineinherited

Definition at line 123 of file EDProducer.h.

References art::EDProducer::moduleDescription_.

Referenced by skim::NueSkimmer::CopyMichelSlice(), and skim::NueSkimmer::CopyMichelTrack().

124  {
125  return ProducerBase::getProductID<PROD, B>(moduleDescription_,
126  instanceName);
127  }
ModuleDescription moduleDescription_
Definition: EDProducer.h:115
template<typename PROD , BranchType B>
ProductID art::ProducerBase::getProductID ( ModuleDescription const &  moduleDescription,
std::string const &  instanceName 
) const
inherited

Definition at line 56 of file ProducerBase.h.

References art::ModuleDescription::moduleLabel().

Referenced by art::ProducerBase::modifiesEvent().

58  {
59  auto const& pd =
60  get_ProductDescription<PROD>(B, md.moduleLabel(), instanceName);
61  return pd.productID();
62  }
void trackinfo::TrackInfo::Init ( )
protected

Definition at line 76 of file TrackInfo_module.cc.

References geom().

Referenced by produce().

76  {
78  }
void geom(int which=0)
Definition: geom.C:163
template<typename T , BranchType = InEvent>
ProductToken<T> art::Consumer::mayConsume ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ProductToken<T> art::Consumer::mayConsume ( InputTag const &  it)
inherited

Definition at line 189 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

190 {
191  if (!moduleContext_)
192  return ProductToken<T>::invalid();
193 
194  consumables_[BT].emplace_back(ConsumableType::Product,
195  TypeID{typeid(T)},
196  it.label(),
197  it.instance(),
198  it.process());
199  return ProductToken<T>{it};
200 }
set< int >::iterator it
static ProductToken< T > invalid()
Definition: ProductToken.h:47
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename T , art::BranchType BT>
void art::Consumer::mayConsumeMany ( )
inherited

Definition at line 204 of file Consumer.h.

References T.

205 {
206  if (!moduleContext_)
207  return;
208 
209  consumables_[BT].emplace_back(ConsumableType::Many, TypeID{typeid(T)});
210 }
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::Consumer::mayConsumeView ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ViewToken<T> art::Consumer::mayConsumeView ( InputTag const &  it)
inherited

Definition at line 214 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

215 {
216  if (!moduleContext_)
217  return ViewToken<T>::invalid();
218 
219  consumables_[BT].emplace_back(ConsumableType::ViewElement,
220  TypeID{typeid(T)},
221  it.label(),
222  it.instance(),
223  it.process());
224  return ViewToken<T>{it};
225 }
set< int >::iterator it
static ViewToken< Element > invalid()
Definition: ProductToken.h:75
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
bool art::ProducerBase::modifiesEvent ( ) const
inlineinherited

Definition at line 40 of file ProducerBase.h.

References art::ProducerBase::getProductID(), and string.

41  {
42  return true;
43  }
static cet::exempt_ptr<Consumer> art::Consumer::non_module_context ( )
staticinherited
void art::Consumer::prepareForJob ( fhicl::ParameterSet const &  pset)
protectedinherited
void trackinfo::TrackInfo::produce ( art::Event evt)
virtual

Implements art::EDProducer.

Definition at line 81 of file TrackInfo_module.cc.

References bpfit::dEdxCalculator::computeDEDX(), util::CreateAssn(), dE, DEFINE_ART_MODULE(), rb::Prong::Dir(), dx, fdEdxCalc, fdxTOL, fSlicerLabel, fTrackInfoFxs, fTrackLabel, geom(), trackinfo::TrackInfoFxs::getAveTrackdEdxEnd(), art::DataViewImpl::getByLabel(), bpfit::dEdxCalculator::getDE(), bpfit::dEdxCalculator::getDX(), bpfit::dEdxCalculator::getS(), MECModelEnuComparisons::i, Init(), rb::Cluster::IsNoise(), art::Event::put(), trackinfo::TrackInfoObj::SetAvedEdxTrackLast10cm(), trackinfo::TrackInfoObj::SetAvedEdxTrackLast20cm(), trackinfo::TrackInfoObj::SetAvedEdxTrackLast30cm(), trackinfo::TrackInfoObj::SetAvedEdxTrackLast40cm(), and rb::Track::TotalLength().

81  {
82 
83  Init();
88  evt.getByLabel(fSlicerLabel,slicevec);
90 
91  if(slicevec->empty()) {
92  mf::LogWarning ("No Slices")<<"No Slices in the input file";
93  return;
94  }
95  art::FindManyP<rb::Track> trackAssnList(slicevec, evt, fTrackLabel);
96  std::unique_ptr< std::vector<trackinfo::TrackInfoObj> > outputObjects(new std::vector<trackinfo::TrackInfoObj>);
97  std::unique_ptr< art::Assns<trackinfo::TrackInfoObj, rb::Track> > assoc(new art::Assns<trackinfo::TrackInfoObj, rb::Track>);
98 
99  for(size_t i = 0; i < slicevec->size(); ++i){
100  art::Ptr<rb::Cluster> slice(slicevec,i);
101 
102  if(slice->IsNoise()) {
103  continue;
104  }
105 
106  const std::vector< art::Ptr<rb::Track> > sliceTracks = trackAssnList.at(i);
107  for(size_t iTrack = 0; iTrack < sliceTracks.size(); ++iTrack){
108  trackinfo::TrackInfoObj trackinfoobj;
109  art::Ptr<rb::Track> track = sliceTracks[iTrack];
110 
111  // ignore bad track
112  double tdx = track->Dir().X();
113  double tdy = track->Dir().Y();
114  double tdz = track->Dir().Z();
115  bool bad_track_dir = (tdx < -1) || (tdx > 1) ||
116  (tdy < -1) || (tdy > 1) ||
117  (tdz < -1) || (tdz > 1);
118  if(bad_track_dir){
119  outputObjects->push_back(trackinfoobj);
120  util::CreateAssn(*this,evt,*(outputObjects.get()),track,*(assoc.get()));
121  continue;
122  }
123 
124  //We are only interested on the dE,dx and s info from dEdxCalculator:
125  const int fake_pdg = 13;
126  fdEdxCalc.computeDEDX(track,fake_pdg);
127  std::vector<double> dE, dx, s;
128  fdEdxCalc.getDE(dE,fdxTOL);
129  fdEdxCalc.getDX(dx,fdxTOL);
130  fdEdxCalc.getS( s ,fdxTOL);
131  trackinfoobj.SetAvedEdxTrackLast10cm( fTrackInfoFxs->getAveTrackdEdxEnd(dE, dx, s, track->TotalLength(), 10.) );
132  trackinfoobj.SetAvedEdxTrackLast20cm( fTrackInfoFxs->getAveTrackdEdxEnd(dE, dx, s, track->TotalLength(), 20.) );
133  trackinfoobj.SetAvedEdxTrackLast30cm( fTrackInfoFxs->getAveTrackdEdxEnd(dE, dx, s, track->TotalLength(), 30.) );
134  trackinfoobj.SetAvedEdxTrackLast40cm( fTrackInfoFxs->getAveTrackdEdxEnd(dE, dx, s, track->TotalLength(), 40.) );
135  outputObjects->push_back(trackinfoobj);
136  util::CreateAssn(*this,evt,*(outputObjects.get()),track,*(assoc.get()));
137 
138  } // end of loop over tracks on slice
139 
140  } //loop over slices
141 
142  evt.put(std::move(outputObjects));
143  evt.put(std::move(assoc));
144 
145  } //end produce
static bool CreateAssn(art::EDProducer const &prod, art::Event &evt, std::vector< T > &a, art::Ptr< U > b, art::Assns< T, U > &assn, size_t indx=UINT_MAX, std::string const &instance=std::string())
Create a 1 to 1 association between a new product and one already in the event.
void SetAvedEdxTrackLast20cm(float AvedEdxTrackLast20cm_val)
Definition: TrackInfoObj.h:25
void SetAvedEdxTrackLast30cm(float AvedEdxTrackLast30cm_val)
Definition: TrackInfoObj.h:26
Definition: event.h:19
bpfit::dEdxCalculator fdEdxCalc
helper class for computing dEdx values
void getS(std::vector< double > &stemp, double dxTol)
void computeDEDX(art::Ptr< rb::Track > &track, int pdg=13)
Compute dE/dx for all cells along this track and the fitsum object that went with it...
double fdxTOL
cut off value for dx, if dx is less than this, don&#39;t compute dE/dx
double dE
void SetAvedEdxTrackLast40cm(float AvedEdxTrackLast40cm_val)
Definition: TrackInfoObj.h:27
ProductID put(std::unique_ptr< PROD > &&product)
Definition: Event.h:102
virtual double TotalLength() const
Length (cm) of all the track segments.
Definition: Track.cxx:213
const XML_Char * s
Definition: expat.h:262
trackinfo::TrackInfoFxs * fTrackInfoFxs
double dx[NP][NC]
virtual TVector3 Dir() const
Unit vector describing prong direction.
Definition: Prong.h:77
float getAveTrackdEdxEnd(std::vector< double > &dEtemp, std::vector< double > &dxtemp, std::vector< double > &stemp, double trk_len, double wanted_dist)
void SetAvedEdxTrackLast10cm(float AvedEdxTrackLast10cm_val)
Definition: TrackInfoObj.h:24
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
Definition: DataViewImpl.h:344
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
void geom(int which=0)
Definition: geom.C:163
void getDE(std::vector< double > &dEtemp, double dxTol)
...can also get the individual results...
void getDX(std::vector< double > &dxtemp, double dxTol)
void art::Consumer::showMissingConsumes ( ) const
protectedinherited

Referenced by art::RootOutput::endJob().

void art::Consumer::validateConsumedProduct ( BranchType const  bt,
ProductInfo const &  pi 
)
protectedinherited

Member Data Documentation

std::string trackinfo::TrackInfo::fCosmicTrackLabel
protected

Definition at line 51 of file TrackInfo_module.cc.

bpfit::dEdxCalculator trackinfo::TrackInfo::fdEdxCalc
protected

helper class for computing dEdx values

Definition at line 47 of file TrackInfo_module.cc.

Referenced by produce().

double trackinfo::TrackInfo::fdxTOL
protected

cut off value for dx, if dx is less than this, don't compute dE/dx

Definition at line 48 of file TrackInfo_module.cc.

Referenced by produce().

std::string trackinfo::TrackInfo::fSlicerLabel
protected

Definition at line 49 of file TrackInfo_module.cc.

Referenced by produce().

trackinfo::TrackInfoFxs* trackinfo::TrackInfo::fTrackInfoFxs
protected

Definition at line 46 of file TrackInfo_module.cc.

Referenced by produce(), and ~TrackInfo().

std::string trackinfo::TrackInfo::fTrackLabel
protected

Definition at line 50 of file TrackInfo_module.cc.

Referenced by produce().


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