Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | List of all members
slicer::TruthSlicer Class Reference
Inheritance diagram for slicer::TruthSlicer:
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

 TruthSlicer (fhicl::ParameterSet const &pset)
 
virtual ~TruthSlicer ()
 
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 ()
 

Public Attributes

std::string fCellHitInput
 Read CellHits from Cal/[fCellHitFolderIn]. More...
 
std::string fMCTruthInput
 Read MCTruth from this label. More...
 
bool fMerge
 Try to merge small ( < fMinHit) slices into bigger ones. More...
 
unsigned int fMinHits
 Minimum number of hits for a "non-small" slice. More...
 

Protected Member Functions

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

Detailed Description

Definition at line 34 of file TruthSlicer_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

slicer::TruthSlicer::TruthSlicer ( fhicl::ParameterSet const &  pset)
explicit

Definition at line 57 of file TruthSlicer_module.cc.

57  :
58  fCellHitInput (pset.get< std::string >("CellHitInput") ),
59  fMCTruthInput (pset.get< std::string >("MCTruthInput") ),
60  fMerge (pset.get< bool >("MergeSmallSlices")),
61  fMinHits (pset.get< unsigned int >("MinHits") )
62  {
63  produces< std::vector<rb::Cluster> >();
64  }
bool fMerge
Try to merge small ( < fMinHit) slices into bigger ones.
std::string fMCTruthInput
Read MCTruth from this label.
unsigned int fMinHits
Minimum number of hits for a "non-small" slice.
std::string fCellHitInput
Read CellHits from Cal/[fCellHitFolderIn].
enum BeamMode string
slicer::TruthSlicer::~TruthSlicer ( )
virtual

Definition at line 67 of file TruthSlicer_module.cc.

68  { }

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  }
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 slicer::TruthSlicer::produce ( art::Event evt)
virtual

\ TODO: fill this is...

Implements art::EDProducer.

Definition at line 71 of file TruthSlicer_module.cc.

References cheat::BackTracker::ClusterByTruth(), DEFINE_ART_MODULE(), fCellHitInput, fMCTruthInput, fMerge, art::DataViewImpl::getByLabel(), MECModelEnuComparisons::i, and art::Event::put().

72  {
73  // Load hit list (CellHits)
75  evt.getByLabel(fCellHitInput, hitcol);
76 
77  std::vector<art::Ptr<rb::CellHit > > hitlist;
78  for(unsigned int i = 0; i < hitcol->size(); ++i){
79  art::Ptr<rb::CellHit> hit(hitcol, i);
80  hitlist.push_back(hit);
81  }
82 
83  // Load the MCTruth list
85  evt.getByLabel(fMCTruthInput, mclist);
86 
87  // Make the backtracker.
89 
90  // make the final slice container that will be put into the event
91  std::unique_ptr< std::vector<rb::Cluster> >
92  clustercol(new std::vector<rb::Cluster>);
93 
94 
95 
96  //
97  // Do the truth slicing...
98  //
99  std::vector<rb::Cluster> clusters = BT->ClusterByTruth(hitlist);
100 
101 
102 
103  ///\ TODO: fill this is...
104  if(fMerge) {
105  // TruthSlicer will make a separate slice for each neutrino
106  // that leaves hits in the detector. This will leave many small
107  // slices that in "reality" would have been either swallowed up
108  // by some larger cluster or labeled as noise.
109  //
110  // This section attempts to merge the smaller clusters into
111  // the larger ones trying to make a more realistic picture of what
112  // the "ideal" slicing case might be.
113 
114 
115  } // end if fMerge
116 
117 
118 
119  // add the clusters to clustercol
120  for(unsigned int i = 0; i < clusters.size(); ++i) {
121  if(clusters[i].NCell() > 0) clustercol->push_back(clusters[i]);
122  }
123 
124  // put the slices into the event
125  evt.put(std::move(clustercol));
126 
127  } // end Produce function
bool fMerge
Try to merge small ( < fMinHit) slices into bigger ones.
std::string fMCTruthInput
Read MCTruth from this label.
std::vector< rb::Cluster > ClusterByTruth(std::vector< art::Ptr< rb::CellHit > > const &hits)
:
ProductID put(std::unique_ptr< PROD > &&product)
Definition: Event.h:102
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
Definition: DataViewImpl.h:344
Definition: structs.h:12
std::string fCellHitInput
Read CellHits from Cal/[fCellHitFolderIn].
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 slicer::TruthSlicer::fCellHitInput

Read CellHits from Cal/[fCellHitFolderIn].

Definition at line 42 of file TruthSlicer_module.cc.

Referenced by produce().

std::string slicer::TruthSlicer::fMCTruthInput

Read MCTruth from this label.

Definition at line 43 of file TruthSlicer_module.cc.

Referenced by produce().

bool slicer::TruthSlicer::fMerge

Try to merge small ( < fMinHit) slices into bigger ones.

Definition at line 44 of file TruthSlicer_module.cc.

Referenced by produce().

unsigned int slicer::TruthSlicer::fMinHits

Minimum number of hits for a "non-small" slice.

Definition at line 45 of file TruthSlicer_module.cc.


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