Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
cvn::CVNEventProngDump Class Reference
Inheritance diagram for cvn::CVNEventProngDump:
art::EDAnalyzer art::EventObserverBase art::Consumer art::EngineCreator

Public Types

using WorkerType = WorkerT< EDAnalyzer >
 
using ModuleType = EDAnalyzer
 

Public Member Functions

 CVNEventProngDump (fhicl::ParameterSet const &pset)
 
 ~CVNEventProngDump ()
 
void analyze (const art::Event &evt)
 
void reconfigure (const fhicl::ParameterSet &pset)
 
void beginJob ()
 
void endJob ()
 
std::string workerType () const
 
bool modifiesEvent () const
 
void registerProducts (MasterProductRegistry &, ProductDescriptions &, ModuleDescription const &)
 
std::string const & processName () const
 
bool wantAllEvents () const
 
bool wantEvent (Event const &e)
 
fhicl::ParameterSetID selectorConfig () const
 
art::Handle< art::TriggerResultsgetTriggerResults (Event const &e) 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

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

Private Member Functions

void WriteMapTH2 (const art::Event &evt, const PixelMap &pm, bool isProng, unsigned int slice, unsigned int id)
 Function to extract TH2 from PixelMap and write to TFile. More...
 

Private Attributes

std::string fClusterLabel
 
std::string fProngModLabel
 Module label for input prongs. More...
 
std::string fProng3DLabel
 Instance label for input 3D prongs. More...
 
std::string fProng2DLabel
 Instance label for input 2D prongs. More...
 
std::string fClusterPMLabel
 Instance label for cluster pixelmaps. More...
 
std::string fProngPMLabel
 Instance label for prong pixelmaps. More...
 
std::string fVertexLabel
 Instance label for vertex. More...
 
std::string fShowerLabel
 Instance label for showers. More...
 
std::string fShowerLIDLabel
 Instance label for showers. More...
 
bool fMapProngs
 Option to save maps for prongs. More...
 
std::string fPixelMapInput
 
bool fWriteMapTH2
 
bool fObeyPreselection
 
std::vector< std::stringfPreselectionLabels
 
EventLabeledPMapsfEventPMapsData
 
TTree * fTrainTree
 
art::ServiceHandle< cheat::BackTrackerfBT
 
std::string fCAFLabel
 label for process that made standard records More...
 
bool fApplyCAFCuts
 do you want to apply CAF-level cuts? More...
 
int fCutType
 what cuts do you want to apply? (see CAFCutter.h) More...
 
recovalid::CAFCutter fCAFCutter
 CAFCutter helper class. More...
 

Detailed Description

Definition at line 58 of file CVNEventProngDump_module.cc.

Member Typedef Documentation

Definition at line 39 of file EDAnalyzer.h.

Definition at line 38 of file EDAnalyzer.h.

Constructor & Destructor Documentation

cvn::CVNEventProngDump::CVNEventProngDump ( fhicl::ParameterSet const &  pset)
explicit

Definition at line 127 of file CVNEventProngDump_module.cc.

References reconfigure().

128  : EDAnalyzer(pset)
129  {
130  this->reconfigure(pset);
131  }
void reconfigure(const fhicl::ParameterSet &pset)
EDAnalyzer(Table< Config > const &config)
Definition: EDAnalyzer.h:100
cvn::CVNEventProngDump::~CVNEventProngDump ( )

Definition at line 134 of file CVNEventProngDump_module.cc.

135  {
136  }

Member Function Documentation

void cvn::CVNEventProngDump::analyze ( const art::Event evt)

Definition at line 179 of file CVNEventProngDump_module.cc.

References cheat::BackTracker::allMCTruth(), angle, fApplyCAFCuts, fBT, fCAFCutter, fCAFLabel, fClusterLabel, fCutType, fEventPMapsData, fMapProngs, fObeyPreselection, fPixelMapInput, cvn::TrainingData::fPMap, fPreselectionLabels, fProng2DLabel, fProng3DLabel, cvn::EventLabeledPMaps::fProngLabeledPMs, fProngModLabel, cvn::ProngTrainingData::fProngPMap, fShowerLabel, fShowerLIDLabel, cvn::EventLabeledPMaps::fSliceLabeledPM, fTrainTree, fVertexLabel, fWriteMapTH2, geom(), art::DataViewImpl::getByLabel(), cvn::GetFinalStateProngsType(), cvn::GetFinalStateType(), MECModelEnuComparisons::i, rb::IsFiltered(), cvn::kOther, cvn::kOtherFS, cvn::kOtherFSp, demo0::length, geo::GeometryBase::NuMIBeamDirection(), recovalid::CAFCutter::passCuts(), cvn::ProngClassify(), art::PtrVector< T >::push_back(), cvn::SliceClassify(), cheat::BackTracker::SlicesToMCTruthsTable(), cheat::BackTracker::SliceToOrderedNuIdsByEnergy(), train(), registry_explorer::v, vtxx, vtxy, vtxz, and WriteMapTH2().

180  {
181 
183 
184  InteractionType interaction = kOther;
185  FinalStateType finalstate = kOtherFS;
186  FinalStateProngsType finalstateprongs = kOtherFSp;
187 
188  // get the slices
190  evt.getByLabel(fClusterLabel, clusterHandle);
191  const std::vector<rb::Cluster> & clusters = *clusterHandle;
193  for(unsigned int i=0; i<clusterHandle->size(); ++i){
194  slices.push_back(art::Ptr<rb::Cluster>(clusterHandle, i));
195  }
196 
197  // Get the Standard Records
199 
200  art::FindManyP<PixelMap> fmPixelMap(clusterHandle, evt, fPixelMapInput);
201 
202  std::vector<int> bestNuId;
203  std::vector<cheat::NeutrinoWithIndex> nus;
204  std::vector<std::vector<cheat::NeutrinoEffPur>> sEffPur;
205  nus = fBT->allMCTruth();
206  sEffPur = fBT->SlicesToMCTruthsTable(slices);
207  bestNuId =fBT->SliceToOrderedNuIdsByEnergy(nus, sEffPur);
208 
209 
210  for(size_t iClust = 0; iClust < clusters.size(); ++iClust){
211 
212  if(fObeyPreselection && rb::IsFiltered(evt, clusterHandle, iClust,
213  fPreselectionLabels)) continue;
214  // get record associated with the slice
215  std::vector< art::Ptr<caf::StandardRecord> > srs;
216  bool pass = true;
217  // Apply the CAF-level cuts
218  if(fApplyCAFCuts && fmpSR.isValid()){
219  srs = fmpSR.at(iClust);
220  if(srs.size() > 0) pass = fCAFCutter.passCuts(fCutType, srs[0].get());
221  }
222 
223  // if we don't pass the CAF cuts (when applying), skip this slice
224  if(!pass) continue;
225 
226  const rb::Cluster& cluster = clusters[iClust];
227  if(!fmPixelMap.isValid()) continue;
228 
229  const std::vector<art::Ptr<PixelMap>> pixelMaps = fmPixelMap.at(iClust);
230  if(pixelMaps.empty()) continue;
231 
233  if(bestNuId[iClust] != -1) truth = sEffPur[iClust][bestNuId[iClust]].neutrinoInt;
234  else continue;
235 
236  TrainingData train;
237  float nuEnergy, lepEnergy;
238  double vtxx, vtxy, vtxz;
239  interaction = SliceClassify(truth, cluster, nuEnergy, lepEnergy, vtxx, vtxy, vtxz);
240  finalstate = GetFinalStateType(truth);
241  finalstateprongs = GetFinalStateProngsType(truth);
242 
243  train = TrainingData(interaction, finalstate, finalstateprongs, nuEnergy, lepEnergy, *pixelMaps[0]);
244 
245  if(fWriteMapTH2) WriteMapTH2(evt, train.fPMap, 0, (unsigned int)iClust, 0);
246 
247 
248  if(fMapProngs){
249 
250  art::FindManyP<rb::Vertex> fmv(clusterHandle, evt, fVertexLabel);
251  art::FindManyP<rb::Prong> fmProng3D(clusterHandle, evt, art::InputTag(fProngModLabel, fProng3DLabel));
252  art::FindManyP<rb::Prong> fmProng2D(clusterHandle, evt, art::InputTag(fProngModLabel, fProng2DLabel));
253 
254  std::vector< art::Ptr<rb::Prong> > prongs3D;
255  std::vector< art::Ptr<rb::Prong> > prongs2D;
256  std::vector< art::Ptr<rb::Vertex> > vert;
257 
258  if(fmProng2D.isValid() ) prongs2D = fmProng2D.at(iClust);
259  if(fmProng3D.isValid() ) prongs3D = fmProng3D.at(iClust);
260  if(fmv.isValid() ) vert = fmv.at(iClust);
261  if(!fmProng2D.isValid() && !fmProng3D.isValid()) continue;
262 
263  art::FindManyP<PixelMap> fmPixelMap3D(prongs3D, evt, fPixelMapInput);
264  art::FindManyP<PixelMap> fmPixelMap2D(prongs2D, evt, fPixelMapInput);
265  art::FindOneP<rb::Shower> foSh(prongs3D, evt, fShowerLabel);
266 
267  TVector3 v;
268  if(!vert.empty() ) v = vert[0]->GetXYZ();
269  else v.SetXYZ(-999.,-999.,-999.);
270 
271 
272  double length;
273  TVector3 prongdir;
274  TVector3 beamdir = geom->NuMIBeamDirection();
275  float angle;
276 
277 
278  for(unsigned int iProng = 0; iProng < prongs3D.size(); ++iProng){
279 
280  length = -5.0;
281  angle = -5.0;
282 
283  if(!fmPixelMap3D.isValid()) continue;
284 
285  const std::vector< art::Ptr<PixelMap> > pixelMaps3D = fmPixelMap3D.at(iProng);
286  if(pixelMaps3D.empty()) continue;
287 
288  // Get gap to vertex from showerlid
289  double gap = -5.0;
290  if(foSh.isValid()){
291  cet::maybe_ref< art::Ptr<rb::Shower> const > roSh(foSh.at(iProng));
292  art::Ptr<rb::Shower> shower = roSh.ref();
293 
294  std::vector< art::Ptr<rb::Shower> > showers;
295  showers.push_back(shower);
296 
297  art::FindOneP<slid::ShowerLID> foShLID(showers, evt,fShowerLIDLabel);
298  if (foShLID.isValid()){
299  cet::maybe_ref< art::Ptr<slid::ShowerLID> const > roShLID(foShLID.at(0));
300  art::Ptr<slid::ShowerLID> showerLID = roShLID.ref();
301  gap = showerLID->Gap();
302  }
303  }
304 
305  // Currently not stored, for pm drawing only
306  ProngTrainingData p_train;
307  ProngType ptype3D, ptypeX, ptypeY;
308  double purity3D, purityX, purityY, recE;
309  unsigned int ncellX, ncellY;
310  bool isprimary;
311 
312  TrainingData pmtrain(interaction, finalstate, finalstateprongs,
313  nuEnergy, lepEnergy, *pixelMaps3D[0]);
314 
315  length = prongs3D[iProng]->TotalLength();
316  angle = prongdir*beamdir;
317 
318  ptype3D = ProngClassify(*prongs3D[iProng], &ptype3D, &ptypeX, &ptypeY,
319  &isprimary, &purity3D, &purityX, &purityY,
320  &recE, &ncellX, &ncellY);
321 
322  p_train = ProngTrainingData(ptype3D, ptypeX, ptypeY, isprimary,
323  purity3D, purityX, purityY, recE,
324  ncellX, ncellY, v.X(), v.Y(), v.Z(),
325  length, (double)angle, gap, *pixelMaps3D[0]);
326 
327 
328 
329  if(fWriteMapTH2) WriteMapTH2(evt, p_train.fProngPMap, 1, (unsigned int)iClust, iProng+1);
330 
333  fTrainTree->Fill();
334 
335  } // loop over 3D prongs
336 
337  for(unsigned int iProng2 = 0; iProng2 < prongs2D.size(); ++iProng2){
338 
339  if(!fmPixelMap2D.isValid()) continue;
340 
341  const std::vector< art::Ptr<PixelMap> > pixelMaps2D = fmPixelMap2D.at(iProng2);
342  if(pixelMaps2D.empty()) continue;
343 
344  ProngTrainingData p2_train;
345  ProngType ptype2D, ptypeX2D, ptypeY2D;
346  double purity2D, purityX2D, purityY2D, recE;
347  unsigned int ncellX, ncellY;
348  bool isprimary;
349 
350  ptype2D = ProngClassify(*prongs2D[iProng2], &ptype2D, &ptypeX2D, &ptypeY2D,
351  &isprimary, &purity2D, &purityX2D, &purityY2D,
352  &recE, &ncellX, &ncellY);
353 
354  p2_train = ProngTrainingData(ptype2D, ptypeX2D, ptypeY2D, isprimary,
355  purity2D, purityX2D, purityY2D, recE,
356  ncellX, ncellY, v.X(), v.Y(), v.Z(),
357  0.0, 0.0, 0.0, *pixelMaps2D[0]);
358 
360  fEventPMapsData->fProngLabeledPMs = p2_train;
361  fTrainTree->Fill();
362 
363  } // loop over 2D prongs
364  } // if(fMapProngs)
365 
366 
367  } // loop over slices
368  } // analyze
InteractionType SliceClassify(const art::Ptr< simb::MCTruth > truth, const rb::Cluster &slice, float &nuEnergy, float &lepEnergy, double &vtxx, double &vtxy, double &vtxz)
enum cvn::PType ProngType
Double_t angle
Definition: plot.C:86
FinalStateType GetFinalStateType(const art::Ptr< simb::MCTruth > truth)
std::vector< NeutrinoWithIndex > allMCTruth() const
float vtxx
A collection of associated CellHits.
Definition: Cluster.h:47
enum cvn::Interaction InteractionType
recovalid::CAFCutter fCAFCutter
CAFCutter helper class.
std::vector< std::vector< cheat::NeutrinoEffPur > > SlicesToMCTruthsTable(const std::vector< const rb::Cluster * > &sliceList) const
Given ALL the slices in an event, including the noise slice, returns a vector of vector of structures...
std::string fCAFLabel
label for process that made standard records
Something else. Tau? Hopefully we don&#39;t use this.
std::vector< int > SliceToOrderedNuIdsByEnergy(const std::vector< cheat::NeutrinoWithIndex > &nusWithIdx, const std::vector< std::vector< cheat::NeutrinoEffPur >> &slTruthTable) const
bool passCuts(int cut, const caf::StandardRecord *sr)
Definition: CAFCutter.cxx:37
length
Definition: demo0.py:21
std::string fShowerLabel
Instance label for showers.
std::string fVertexLabel
Instance label for vertex.
void push_back(Ptr< U > const &p)
Definition: PtrVector.h:441
TrainingData fSliceLabeledPM
Class of the event.
Something else. Tau? Hopefully we don&#39;t use this.
float vtxy
FinalStateProngsType GetFinalStateProngsType(const art::Ptr< simb::MCTruth > truth)
bool IsFiltered(const art::Event &evt, art::Ptr< T > x, const std::vector< std::string > &labels)
Is this Ptr marked "filtered out"?
Definition: FilterList.h:96
std::string fProng2DLabel
Instance label for input 2D prongs.
enum cvn::FinalState FinalStateType
EventLabeledPMaps * fEventPMapsData
bool fApplyCAFCuts
do you want to apply CAF-level cuts?
TVector3 NuMIBeamDirection() const
Direction of neutrinos from the NuMI beam (unit vector)
Something else. Tau? Hopefully we don&#39;t use this.
float vtxz
void WriteMapTH2(const art::Event &evt, const PixelMap &pm, bool isProng, unsigned int slice, unsigned int id)
Function to extract TH2 from PixelMap and write to TFile.
ProngTrainingData fProngLabeledPMs
PixelMap for the event.
void train()
Definition: train.C:24
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
Definition: DataViewImpl.h:344
ProngType ProngClassify(const rb::Prong &prong, ProngType *pType3D, ProngType *pTypeX, ProngType *pTypeY, bool *isprimary, double *purity3D, double *purityX, double *purityY, double *recE, unsigned int *ncellX, unsigned int *ncellY)
void geom(int which=0)
Definition: geom.C:163
int fCutType
what cuts do you want to apply? (see CAFCutter.h)
std::string fShowerLIDLabel
Instance label for showers.
enum cvn::FinalStateProngs FinalStateProngsType
art::ServiceHandle< cheat::BackTracker > fBT
std::vector< std::string > fPreselectionLabels
std::string fProngModLabel
Module label for input prongs.
std::string fProng3DLabel
Instance label for input 3D prongs.
bool fMapProngs
Option to save maps for prongs.
void cvn::CVNEventProngDump::beginJob ( )
virtual

Reimplemented from art::EDAnalyzer.

Definition at line 162 of file CVNEventProngDump_module.cc.

References fEventPMapsData, fTrainTree, and art::TFileDirectory::make().

163  {
164 
166 
167  fEventPMapsData = new EventLabeledPMaps;
168  fTrainTree = tfs->make<TTree>("CVNTrainTree", "Training records");
169  fTrainTree->Branch("EventPMapsData", "cvn::EventLabeledPMaps", &fEventPMapsData);
170 
171  }
EventLabeledPMaps * fEventPMapsData
T * make(ARGS...args) const
detail::CachedProducts& art::EventObserverBase::cachedProducts ( )
inlineprotectedinherited

Definition at line 79 of file EventObserverBase.h.

References art::EventObserverBase::selectors_.

80  {
81  return selectors_;
82  }
detail::CachedProducts selectors_
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::EDAnalyzer::currentContext ( ) const
protectedinherited
void cvn::CVNEventProngDump::endJob ( )
virtual

Reimplemented from art::EDAnalyzer.

Definition at line 174 of file CVNEventProngDump_module.cc.

175  {
176  }
seed_t art::EngineCreator::get_seed_value ( fhicl::ParameterSet const &  pset,
char const  key[] = "seed",
seed_t const  implicit_seed = -1 
)
inherited
art::Handle<art::TriggerResults> art::EventObserverBase::getTriggerResults ( Event const &  e) const
inlineinherited

Definition at line 61 of file EventObserverBase.h.

References art::detail::CachedProducts::getOneTriggerResults(), and art::EventObserverBase::selectors_.

62  {
64  }
detail::CachedProducts selectors_
art::Handle< art::TriggerResults > getOneTriggerResults(Event const &) const
Float_t e
Definition: plot.C:35
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::EventObserverBase::modifiesEvent ( ) const
inlineinherited

Definition at line 25 of file EventObserverBase.h.

26  {
27  return false;
28  }
static cet::exempt_ptr<Consumer> art::Consumer::non_module_context ( )
staticinherited
void art::Consumer::prepareForJob ( fhicl::ParameterSet const &  pset)
protectedinherited
std::string const& art::EventObserverBase::processName ( ) const
inlineinherited
void cvn::CVNEventProngDump::reconfigure ( const fhicl::ParameterSet pset)

Definition at line 139 of file CVNEventProngDump_module.cc.

References fApplyCAFCuts, fCAFLabel, fClusterLabel, fClusterPMLabel, fCutType, fMapProngs, fObeyPreselection, fPixelMapInput, fPreselectionLabels, fProng2DLabel, fProng3DLabel, fProngModLabel, fProngPMLabel, fShowerLabel, fShowerLIDLabel, fVertexLabel, fWriteMapTH2, fhicl::ParameterSet::get(), and string.

Referenced by CVNEventProngDump().

140  {
141  fClusterLabel = pset.get<std::string>("ClusterLabel");
142  fPixelMapInput = pset.get<std::string>("PixelMapInput");
143  fProngModLabel = pset.get<std::string>("ProngModLabel");
144  fProng3DLabel = pset.get<std::string>("Prong3DLabel");
145  fProng2DLabel = pset.get<std::string>("Prong2DLabel");
146  fClusterPMLabel = pset.get<std::string>("ClusterPMLabel");
147  fProngPMLabel = pset.get<std::string>("ProngPMLabel");
148  fVertexLabel = pset.get<std::string>("VertexLabel");
149  fShowerLabel = pset.get<std::string>("ShowerLabel");
150  fShowerLIDLabel = pset.get<std::string>("ShowerLIDLabel");
151  fMapProngs = pset.get<bool> ("MapProngs");
152  fWriteMapTH2 = pset.get<bool> ("WriteMapTH2");
153  fObeyPreselection = pset.get<bool> ("ObeyPreselection");
154  fPreselectionLabels = pset.get< std::vector<std::string> >("PreselectionLabels");
155  fCAFLabel = pset.get<std::string>("CAFLabel");
156  fApplyCAFCuts = pset.get<bool> ("ApplyCAFCuts");
157  fCutType = pset.get<int> ("CutType");
158 
159  }
std::string fClusterPMLabel
Instance label for cluster pixelmaps.
std::string fCAFLabel
label for process that made standard records
std::string fProngPMLabel
Instance label for prong pixelmaps.
std::string fShowerLabel
Instance label for showers.
std::string fVertexLabel
Instance label for vertex.
T get(std::string const &key) const
Definition: ParameterSet.h:231
std::string fProng2DLabel
Instance label for input 2D prongs.
bool fApplyCAFCuts
do you want to apply CAF-level cuts?
int fCutType
what cuts do you want to apply? (see CAFCutter.h)
std::string fShowerLIDLabel
Instance label for showers.
std::vector< std::string > fPreselectionLabels
std::string fProngModLabel
Module label for input prongs.
std::string fProng3DLabel
Instance label for input 3D prongs.
bool fMapProngs
Option to save maps for prongs.
enum BeamMode string
void art::EventObserverBase::registerProducts ( MasterProductRegistry ,
ProductDescriptions ,
ModuleDescription const &   
)
inlineinherited

Definition at line 33 of file EventObserverBase.h.

References string.

36  {}
fhicl::ParameterSetID art::EventObserverBase::selectorConfig ( ) const
inlineinherited

Definition at line 56 of file EventObserverBase.h.

References art::EventObserverBase::selector_config_id_.

57  {
58  return selector_config_id_;
59  }
fhicl::ParameterSetID selector_config_id_
void art::Consumer::showMissingConsumes ( ) const
protectedinherited

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

void art::Consumer::validateConsumedProduct ( BranchType const  bt,
ProductInfo const &  pi 
)
protectedinherited
bool art::EventObserverBase::wantAllEvents ( ) const
inlineinherited

Definition at line 46 of file EventObserverBase.h.

References art::EventObserverBase::wantAllEvents_.

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

47  {
48  return wantAllEvents_;
49  }
bool art::EventObserverBase::wantEvent ( Event const &  e)
inlineinherited

Definition at line 51 of file EventObserverBase.h.

References art::EventObserverBase::selectors_, and art::detail::CachedProducts::wantEvent().

52  {
53  return selectors_.wantEvent(e);
54  }
detail::CachedProducts selectors_
Float_t e
Definition: plot.C:35
bool wantEvent(Event const &)
std::string art::EDAnalyzer::workerType ( ) const
inlineinherited

Definition at line 109 of file EDAnalyzer.h.

References art::EDAnalyzer::currentContext().

110  {
111  return "WorkerT<EDAnalyzer>";
112  }
void cvn::CVNEventProngDump::WriteMapTH2 ( const art::Event evt,
const PixelMap pm,
bool  isProng,
unsigned int  slice,
unsigned int  id 
)
private

Function to extract TH2 from PixelMap and write to TFile.

Definition at line 372 of file CVNEventProngDump_module.cc.

References DEFINE_ART_MODULE(), art::Event::event(), analysePickle::hist, art::TFileDirectory::make(), art::Event::run(), cvn::PixelMap::SingleViewToTH2(), art::Event::subRun(), art::to_string(), and cvn::PixelMap::ToTH2().

Referenced by analyze().

374  {
375 
376  TString mapid = "_r"+std::to_string(evt.run())+"_s"+std::to_string(evt.subRun())+"_e"
377  +std::to_string(evt.event())+"_sl"+std::to_string(slice)+"_p"+std::to_string(id);
378  TString data = "ProngPixelMap";
379  if (!isProng) data = "SlicePixelMap";
380 
381  TH2F* hist = pm.ToTH2(data+mapid);
382  TH2F* histX = pm.SingleViewToTH2(0, data+"ViewX"+mapid);
383  TH2F* histY = pm.SingleViewToTH2(1, data+"ViewY"+mapid);
384 
386 
387  TH2F* histWrite = tfs->make<TH2F>(*hist);
388  histWrite->Write();
389  TH2F* histWriteX = tfs->make<TH2F>(*histX);
390  histWriteX->Write();
391  TH2F* histWriteY = tfs->make<TH2F>(*histY);
392  histWriteY->Write();
393 
394  delete hist;
395  delete histWrite;
396  delete histX;
397  delete histWriteX;
398  delete histY;
399  delete histWriteY;
400 
401  }
SubRunNumber_t subRun() const
Definition: Event.h:72
const XML_Char const XML_Char * data
Definition: expat.h:268
EventNumber_t event() const
Definition: Event.h:67
T * make(ARGS...args) const
std::string to_string(ModuleType mt)
Definition: ModuleType.h:32
RunNumber_t run() const
Definition: Event.h:77

Member Data Documentation

bool cvn::CVNEventProngDump::fApplyCAFCuts
private

do you want to apply CAF-level cuts?

Definition at line 118 of file CVNEventProngDump_module.cc.

Referenced by analyze(), and reconfigure().

art::ServiceHandle<cheat::BackTracker> cvn::CVNEventProngDump::fBT
private

Definition at line 111 of file CVNEventProngDump_module.cc.

Referenced by analyze().

recovalid::CAFCutter cvn::CVNEventProngDump::fCAFCutter
private

CAFCutter helper class.

Definition at line 121 of file CVNEventProngDump_module.cc.

Referenced by analyze().

std::string cvn::CVNEventProngDump::fCAFLabel
private

label for process that made standard records

Definition at line 117 of file CVNEventProngDump_module.cc.

Referenced by analyze(), and reconfigure().

std::string cvn::CVNEventProngDump::fClusterLabel
private

Definition at line 72 of file CVNEventProngDump_module.cc.

Referenced by analyze(), and reconfigure().

std::string cvn::CVNEventProngDump::fClusterPMLabel
private

Instance label for cluster pixelmaps.

Definition at line 84 of file CVNEventProngDump_module.cc.

Referenced by reconfigure().

int cvn::CVNEventProngDump::fCutType
private

what cuts do you want to apply? (see CAFCutter.h)

Definition at line 119 of file CVNEventProngDump_module.cc.

Referenced by analyze(), and reconfigure().

EventLabeledPMaps* cvn::CVNEventProngDump::fEventPMapsData
private

Definition at line 107 of file CVNEventProngDump_module.cc.

Referenced by analyze(), and beginJob().

bool cvn::CVNEventProngDump::fMapProngs
private

Option to save maps for prongs.

Definition at line 99 of file CVNEventProngDump_module.cc.

Referenced by analyze(), and reconfigure().

bool cvn::CVNEventProngDump::fObeyPreselection
private

Definition at line 104 of file CVNEventProngDump_module.cc.

Referenced by analyze(), and reconfigure().

std::string cvn::CVNEventProngDump::fPixelMapInput
private

Definition at line 101 of file CVNEventProngDump_module.cc.

Referenced by analyze(), and reconfigure().

std::vector<std::string> cvn::CVNEventProngDump::fPreselectionLabels
private

Definition at line 105 of file CVNEventProngDump_module.cc.

Referenced by analyze(), and reconfigure().

std::string cvn::CVNEventProngDump::fProng2DLabel
private

Instance label for input 2D prongs.

Definition at line 81 of file CVNEventProngDump_module.cc.

Referenced by analyze(), and reconfigure().

std::string cvn::CVNEventProngDump::fProng3DLabel
private

Instance label for input 3D prongs.

Definition at line 78 of file CVNEventProngDump_module.cc.

Referenced by analyze(), and reconfigure().

std::string cvn::CVNEventProngDump::fProngModLabel
private

Module label for input prongs.

Definition at line 75 of file CVNEventProngDump_module.cc.

Referenced by analyze(), and reconfigure().

std::string cvn::CVNEventProngDump::fProngPMLabel
private

Instance label for prong pixelmaps.

Definition at line 87 of file CVNEventProngDump_module.cc.

Referenced by reconfigure().

std::string cvn::CVNEventProngDump::fShowerLabel
private

Instance label for showers.

Definition at line 93 of file CVNEventProngDump_module.cc.

Referenced by analyze(), and reconfigure().

std::string cvn::CVNEventProngDump::fShowerLIDLabel
private

Instance label for showers.

Definition at line 96 of file CVNEventProngDump_module.cc.

Referenced by analyze(), and reconfigure().

TTree* cvn::CVNEventProngDump::fTrainTree
private

Definition at line 109 of file CVNEventProngDump_module.cc.

Referenced by analyze(), and beginJob().

std::string cvn::CVNEventProngDump::fVertexLabel
private

Instance label for vertex.

Definition at line 90 of file CVNEventProngDump_module.cc.

Referenced by analyze(), and reconfigure().

bool cvn::CVNEventProngDump::fWriteMapTH2
private

Definition at line 102 of file CVNEventProngDump_module.cc.

Referenced by analyze(), and reconfigure().


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