Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
mcchk::DetSimAna Class Reference

A module to check the results from the Monte Carlo generator. More...

Inheritance diagram for mcchk::DetSimAna:
art::EDAnalyzer art::EventObserverBase art::Consumer art::EngineCreator

Public Types

using WorkerType = WorkerT< EDAnalyzer >
 
using ModuleType = EDAnalyzer
 

Public Member Functions

 DetSimAna (fhicl::ParameterSet const &pset)
 
virtual ~DetSimAna ()
 
void analyze (art::Event const &evt)
 
void beginJob ()
 
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

int GetPDGBin (int pdgCode) const
 

Private Attributes

bool fDetOnly
 
std::string fMCTruthModuleLabel
 
TH1F * fNParticles_truth
 Number of particles in MCTruth list. More...
 
TH1F * fNParticles_detsim
 Number of particles after DetSim, in ParticleNavigator list. More...
 
TH1F * fPDG_truth
 PDG of all particles in MCTruth list. More...
 
TH1F * fPDG_detsim
 PDG of all particles after DetSim, in ParticleNavigator list. More...
 
TH1F * fFLS_hits
 FLS hits. More...
 
TH1F * fFLS_EDep
 Total FLS energy deposition in event. More...
 
TH1F * fFLS_EDep_perhit
 FLS energy deposition per hit. More...
 
TH1F * fFLS_Entry_X
 FLS hit cell X entry. More...
 
TH1F * fFLS_Entry_Y
 
TH1F * fFLS_Entry_Z
 
TH2F * fFLS_Entry_XY
 X vs Y entry. More...
 
TH2F * fFLS_Entry_XZ
 X vs Z entry. More...
 
TH2F * fFLS_Entry_YZ
 Y vs Z entry. More...
 
TH1F * fFLS_Delta_X
 FLS hit passing distance in the cell along X axis. More...
 
TH1F * fFLS_Delta_Y
 
TH1F * fFLS_Delta_Z
 
TH1F * fFLS_Delta_R
 Total passing distance in the cell. More...
 
TH1F * fPhotonEvap
 Energy spectrum of photons with neutron parents. More...
 

Detailed Description

A module to check the results from the Monte Carlo generator.

Definition at line 58 of file DetSimAna_module.cc.

Member Typedef Documentation

Definition at line 39 of file EDAnalyzer.h.

Definition at line 38 of file EDAnalyzer.h.

Constructor & Destructor Documentation

mcchk::DetSimAna::DetSimAna ( fhicl::ParameterSet const &  pset)
explicit

Definition at line 104 of file DetSimAna_module.cc.

105  : EDAnalyzer(pset),
106  fDetOnly(pset.get<bool>("DetOnly")),
107  fMCTruthModuleLabel(pset.get<std::string>("MCTruthModuleLabel"))
108  {
109  }
std::string fMCTruthModuleLabel
EDAnalyzer(Table< Config > const &config)
Definition: EDAnalyzer.h:100
enum BeamMode string
mcchk::DetSimAna::~DetSimAna ( )
virtual

Definition at line 112 of file DetSimAna_module.cc.

113  {
114  }

Member Function Documentation

void mcchk::DetSimAna::analyze ( art::Event const &  evt)
virtual

Implements art::EDAnalyzer.

Definition at line 244 of file DetSimAna_module.cc.

References std::abs(), DEFINE_ART_MODULE(), geo::GeometryBase::DetHalfHeight(), geo::GeometryBase::DetHalfWidth(), geo::GeometryBase::DetLength(), fDetOnly, fFLS_Delta_R, fFLS_Delta_X, fFLS_Delta_Y, fFLS_Delta_Z, fFLS_EDep, fFLS_EDep_perhit, fFLS_Entry_X, fFLS_Entry_XY, fFLS_Entry_XZ, fFLS_Entry_Y, fFLS_Entry_YZ, fFLS_Entry_Z, fFLS_hits, art::fill_ptr_vector(), fMCTruthModuleLabel, fNParticles_detsim, fNParticles_truth, fPDG_detsim, fPDG_truth, fPhotonEvap, art::DataViewImpl::getByLabel(), GetPDGBin(), hits(), mc, cheat::BackTracker::MCTruthToParticles(), simb::MCNeutrino::Nu(), cheat::BackTracker::ParticleToFLSHit(), std::sqrt(), simb::MCParticle::Vx(), simb::MCParticle::Vy(), and simb::MCParticle::Vz().

245  {
246  // Get the MC generator information out of the event
247  bool isMCTruthListEmpty = false;
249  try {
250  evt.getByLabel(fMCTruthModuleLabel, mclist);
251  if(mclist->size() == 0) { isMCTruthListEmpty = true; }
252  }
253  catch(...) { isMCTruthListEmpty = true; }
254 
255  std::vector<art::Ptr<simb::MCTruth> > mcptrs;
256  art::fill_ptr_vector(mcptrs, mclist);
257 
258  // Create a particle navigator from BackTracker
260  // const sim::ParticleNavigator& pnav = bt->ParticleNavigator();
261 
262  // Fill histograms based on MC Truth information
263  // If there is no truth list, skip this section
264  // But don't return, maybe the FLSHit list exists
265  if(!isMCTruthListEmpty) {
267  double detHalfWidth = geo->DetHalfWidth();
268  double detHalfHeight = geo->DetHalfHeight();
269  double detLength = geo->DetLength();
270 
271  // Particles are accessed by MCTruth via BackTracker
272  // Initialize values that are summed over interactions outside loop
273  unsigned int n_particles_bt = 0;
274 
275  // Loop over MC Truth interactions
276  for(const auto& mc : mcptrs) {
277  // Skip non detector events if FCL says to
278  if(fDetOnly) {
279  const simb::MCNeutrino& mc_neutrino = mc->GetNeutrino();
280  const simb::MCParticle& nu = mc_neutrino.Nu();
281  if(std::abs(nu.Vx()) > detHalfWidth ||
282  std::abs(nu.Vy()) > detHalfHeight ||
283  nu.Vz() < 0. || nu.Vz() > detLength) {
284  continue;
285  }
286  }
287 
288  // Number of particles in the interaction
289  unsigned int n_particle = mc->NParticles();
290 
291  // Fill the number of particles
292  fNParticles_truth->Fill((float)n_particle);
293 
294  // Loop over particles in the interaction, fill their PDG values
295  for(unsigned int i_particle = 0; i_particle < n_particle; ++i_particle)
296  fPDG_truth->Fill(GetPDGBin( mc->GetParticle(i_particle).PdgCode()) );
297 
298  // Get the list of Particles associated with this MCTruth
299  std::vector<const sim::Particle*> particles = bt->MCTruthToParticles(mc);
300  n_particles_bt += particles.size();
301 
302  // Set of particle track IDs (no duplicates)
303  std::set<int> trackIds;
304 
305  // Loop over particles in this MCTruth
306  for(const auto& particle : particles) {
307  fPDG_detsim->Fill( GetPDGBin(particle->PdgCode()) );
308 
309  trackIds.insert(particle->TrackId());
310 
311  if (particle->PdgCode() == 22 && particle->Process() == "nCapture")
312  fPhotonEvap->Fill(1e3*particle->E());
313  }
314 
315  unsigned int n_FLSHits = 0;
316  float EDep_Total = 0.;
317 
318  // Loop over all the track IDs
319  for(const auto& trackId : trackIds) {
320  std::vector<sim::FLSHit> hits = bt->ParticleToFLSHit(trackId);
321 
322  n_FLSHits += hits.size();
323 
324  for(const auto& hit : hits) {
325  // Sum the total FLS energy deposited in the event
326  EDep_Total += hit.GetEdep();
327 
328  // Fill FLS energy deposited per hit
329  fFLS_EDep_perhit->Fill(hit.GetEdep());
330 
331  // Calculate FLS hit passing distance in the cell
332  float deltaX = hit.GetEntryX() - hit.GetExitX();
333  float deltaY = hit.GetEntryY() - hit.GetExitY();
334  float deltaZ = hit.GetEntryZ() - hit.GetExitZ();
335  float deltaR = sqrt(deltaX*deltaX + deltaY*deltaY + deltaZ*deltaZ);
336 
337  // Fill the FLS hit cell entry points
338  fFLS_Entry_X->Fill(hit.GetEntryX());
339  fFLS_Entry_Y->Fill(hit.GetEntryY());
340  fFLS_Entry_Z->Fill(hit.GetEntryZ());
341 
342  fFLS_Entry_XY->Fill(hit.GetEntryX(), hit.GetEntryY());
343  fFLS_Entry_XZ->Fill(hit.GetEntryX(), hit.GetEntryZ());
344  fFLS_Entry_YZ->Fill(hit.GetEntryY(), hit.GetEntryZ());
345 
346  // Fill the FLS hit cell passing distances
347  fFLS_Delta_X->Fill(deltaX);
348  fFLS_Delta_Y->Fill(deltaY);
349  fFLS_Delta_Z->Fill(deltaZ);
350  fFLS_Delta_R->Fill(deltaR);
351  } // end of loop over individual FLS hits
352  } // end of loop over track IDs
353 
354  fFLS_hits->Fill(n_FLSHits); // Fill number of FLS Hits
355 
356  fFLS_EDep->Fill(EDep_Total); // Fill total energy deposition
357  } // end loop over interactions
358 
359  fNParticles_detsim->Fill((float)n_particles_bt);
360  } // end conditional if there is no mctruth
361  }
TH1F * fNParticles_truth
Number of particles in MCTruth list.
TH1F * fFLS_Delta_R
Total passing distance in the cell.
TH1F * fPDG_detsim
PDG of all particles after DetSim, in ParticleNavigator list.
const simb::MCParticle & Nu() const
Definition: MCNeutrino.h:146
T sqrt(T number)
Definition: d0nt_math.hpp:156
std::vector< sim::FLSHit > ParticleToFLSHit(const int &trackID) const
All the FLSHits that were created by the track id trackID, sorted from most to least light...
TH1F * fPhotonEvap
Energy spectrum of photons with neutron parents.
double DetLength() const
TH2F * fFLS_Entry_YZ
Y vs Z entry.
TH1F * fNParticles_detsim
Number of particles after DetSim, in ParticleNavigator list.
TH2F * fFLS_Entry_XZ
X vs Z entry.
float abs(float number)
Definition: d0nt_math.hpp:39
TH1F * fFLS_EDep
Total FLS energy deposition in event.
TH1F * fFLS_Delta_X
FLS hit passing distance in the cell along X axis.
TH2F * fFLS_Entry_XY
X vs Y entry.
TH1F * fFLS_Entry_X
FLS hit cell X entry.
TH1F * fFLS_EDep_perhit
FLS energy deposition per hit.
void hits()
Definition: readHits.C:15
std::string fMCTruthModuleLabel
int evt
int GetPDGBin(int pdgCode) const
double DetHalfHeight() const
double Vx(const int i=0) const
Definition: MCParticle.h:220
double DetHalfWidth() const
Definition: structs.h:12
double Vz(const int i=0) const
Definition: MCParticle.h:222
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
Definition: Ptr.h:464
TH1F * fPDG_truth
PDG of all particles in MCTruth list.
Event generator information.
Definition: MCNeutrino.h:18
Helper for AttenCurve.
Definition: Path.h:10
TH1F * fFLS_hits
FLS hits.
double Vy(const int i=0) const
Definition: MCParticle.h:221
std::vector< const sim::Particle * > MCTruthToParticles(art::Ptr< simb::MCTruth > const &mct) const
void mcchk::DetSimAna::beginJob ( )
virtual

Reimplemented from art::EDAnalyzer.

Definition at line 151 of file DetSimAna_module.cc.

References fFLS_Delta_R, fFLS_Delta_X, fFLS_Delta_Y, fFLS_Delta_Z, fFLS_EDep, fFLS_EDep_perhit, fFLS_Entry_X, fFLS_Entry_XY, fFLS_Entry_XZ, fFLS_Entry_Y, fFLS_Entry_YZ, fFLS_Entry_Z, fFLS_hits, fNParticles_detsim, fNParticles_truth, fPDG_detsim, fPDG_truth, fPhotonEvap, art::TFileDirectory::make(), mcchk::PDG_BINS, and moon_position_table_new3::second.

152  {
154 
155  // Helpful for spacing/readability
156  // Also helpful in case histograms are made in loops over, say, axis labels
157  char HistoName[200];
158  char HistoTitle[200];
159 
160  sprintf(HistoName, "fNParticles_truth");
161  sprintf(HistoTitle, "Number of Particles in MCTruth List;Number of Particles in Event;");
162  fNParticles_truth = tfs->make<TH1F>(HistoName, HistoTitle, 200, 0., 200.);
163 
164  sprintf(HistoName, "fNParticles_detsim");
165  sprintf(HistoTitle, "Number of Particles in ParticleNavigator List;Number of Particles in Event;");
166  fNParticles_detsim = tfs->make<TH1F>(HistoName, HistoTitle, 200, 0., 2000.);
167 
168  sprintf(HistoName, "fPDG_truth");
169  sprintf(HistoTitle, "PDG of particles in MCTruth;");
170  fPDG_truth = tfs->make<TH1F>(HistoName, HistoTitle, PDG_BINS.size(), 0, PDG_BINS.size());
171 
172  sprintf(HistoName, "fPDG_detsim");
173  sprintf(HistoTitle, "PDG of Particles in ParticleNavigator List;");
174  fPDG_detsim = tfs->make<TH1F>(HistoName, HistoTitle, PDG_BINS.size(), 0., PDG_BINS.size());
175 
176  for (std::size_t labelIdx = 0; labelIdx < PDG_BINS.size(); labelIdx++)
177  {
178  fPDG_truth->GetXaxis()->SetBinLabel(labelIdx+1, PDG_BINS[labelIdx].second.c_str());
179  fPDG_detsim->GetXaxis()->SetBinLabel(labelIdx+1, PDG_BINS[labelIdx].second.c_str());
180  }
181 
182 
183  sprintf(HistoName, "fFLS_hits");
184  sprintf(HistoTitle, "Number of FLS Hits in an Event;FLS hits");
185  fFLS_hits = tfs->make<TH1F>(HistoName, HistoTitle, 200, 0., 4000.);
186 
187  sprintf(HistoName, "fFLS_EDep");
188  sprintf(HistoTitle, "Total FLS Energy Deposited;Energy (GeV)");
189  fFLS_EDep = tfs->make<TH1F>(HistoName, HistoTitle, 1000, 0., 10.);
190 
191  sprintf(HistoName, "fFLS_EDep_perhit");
192  sprintf(HistoTitle, "FLS Energy Deposited per Hit;Energy (GeV)");
193  fFLS_EDep_perhit = tfs->make<TH1F>(HistoName, HistoTitle, 1000, 0., .01);
194 
195  sprintf(HistoName, "fFLS_Entry_X");
196  sprintf(HistoTitle, "FLS Hit Cell X Entry;FLS Entry X (cm)");
197  fFLS_Entry_X = tfs->make<TH1F>(HistoName, HistoTitle, 1000, -10., 10.);
198 
199  sprintf(HistoName, "fFLS_Entry_Y");
200  sprintf(HistoTitle, "FLS Hit Cell Y Entry;FLS Entry Y (cm)");
201  fFLS_Entry_Y = tfs->make<TH1F>(HistoName, HistoTitle, 1000, -10., 10.);
202 
203  sprintf(HistoName, "fFLS_Entry_Z");
204  sprintf(HistoTitle, "FLS Hit Cell Z Entry;FLS Entry Z (cm)");
205  fFLS_Entry_Z = tfs->make<TH1F>(HistoName, HistoTitle, 10000, -210., 210.);
206 
207  sprintf(HistoName, "fFLS_Entry_XY");
208  sprintf(HistoTitle, "FLS Hit Cell Entry;FLS Entry X (cm);FLS Entry Y (cm);");
209  fFLS_Entry_XY = tfs->make<TH2F>(HistoName, HistoTitle, 1000, -3.5, 3.5,
210  1000, -3.5, 3.5);
211 
212  sprintf(HistoName, "fFLS_Entry_XZ");
213  sprintf(HistoTitle, "FLS Hit Cell Entry;FLS Entry X (cm);FLS Entry Z (cm);");
214  fFLS_Entry_XZ = tfs->make<TH2F>(HistoName, HistoTitle, 1000, -3.5, 3.5,
215  5000, -210., 210.);
216 
217  sprintf(HistoName, "fFLS_Entry_YZ");
218  sprintf(HistoTitle, "FLS Hit Cell Entry;FLS_Entry Y (cm);FLS_Entry Z (cm);");
219  fFLS_Entry_YZ = tfs->make<TH2F>(HistoName, HistoTitle, 1000, -3.5, 3.5,
220  5000, -210., 210.);
221 
222  sprintf(HistoName, "fFLS_Delta_X");
223  sprintf(HistoTitle, "FLS Hit Passing X Distance in Cell;FLS Delta X (cm)");
224  fFLS_Delta_X = tfs->make<TH1F>(HistoName, HistoTitle, 20000, -10., 10.);
225 
226  sprintf(HistoName, "fFLS_Delta_Y");
227  sprintf(HistoTitle, "FLS Hit Passing Y Distance in Cell;FLS Delta Y (cm)");
228  fFLS_Delta_Y = tfs->make<TH1F>(HistoName, HistoTitle, 20000, -10., 10.);
229 
230  sprintf(HistoName, "fFLS_Delta_Z");
231  sprintf(HistoTitle, "FLS Hit Passing Z Distance in Cell;FLS Delta Z (cm)");
232  fFLS_Delta_Z = tfs->make<TH1F>(HistoName, HistoTitle, 20000, -10., 10.);
233 
234  sprintf(HistoName, "fFLS_Delta_R");
235  sprintf(HistoTitle, "FLS Hit Total Passing Distance in Cell;FLS Delta R (cm)");
236  fFLS_Delta_R = tfs->make<TH1F>(HistoName, HistoTitle, 10000, 0., 10.);
237 
238  sprintf(HistoName, "fPhotonEvap");
239  sprintf(HistoTitle, "Energy of photons produced from neutron capture (MeV)");
240  fPhotonEvap = tfs->make<TH1F>(HistoName, HistoTitle, 100, 0., 20.);
241  }
TH1F * fNParticles_truth
Number of particles in MCTruth list.
TH1F * fFLS_Delta_R
Total passing distance in the cell.
std::vector< std::pair< int, std::string > > PDG_BINS
TH1F * fPDG_detsim
PDG of all particles after DetSim, in ParticleNavigator list.
TH1F * fPhotonEvap
Energy spectrum of photons with neutron parents.
TH2F * fFLS_Entry_YZ
Y vs Z entry.
TH1F * fNParticles_detsim
Number of particles after DetSim, in ParticleNavigator list.
TH2F * fFLS_Entry_XZ
X vs Z entry.
TH1F * fFLS_EDep
Total FLS energy deposition in event.
TH1F * fFLS_Delta_X
FLS hit passing distance in the cell along X axis.
TH2F * fFLS_Entry_XY
X vs Y entry.
TH1F * fFLS_Entry_X
FLS hit cell X entry.
TH1F * fFLS_EDep_perhit
FLS energy deposition per hit.
T * make(ARGS...args) const
TH1F * fPDG_truth
PDG of all particles in MCTruth list.
TH1F * fFLS_hits
FLS hits.
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
seed_t art::EngineCreator::get_seed_value ( fhicl::ParameterSet const &  pset,
char const  key[] = "seed",
seed_t const  implicit_seed = -1 
)
inherited
int mcchk::DetSimAna::GetPDGBin ( int  pdgCode) const
private

Definition at line 117 of file DetSimAna_module.cc.

References std::abs(), distance(), srt_file_template::find_if, compare_h5_caf::idx, mcchk::kGENIEinternal, mcchk::kNuclFragment, make_root_from_grid_output::pdg, and mcchk::PDG_BINS.

Referenced by analyze().

118  {
119  auto FinderFn = [](int pdg)
120  {
121  return std::distance(PDG_BINS.begin(),
122  std::find_if(PDG_BINS.begin(),
123  PDG_BINS.end(),
124  [&](const auto & item) { return item.first == pdg; }
125  )
126  );
127  };
128 
129  auto pdg = std::abs(p);
130  int idx;
131  if (pdg > 2e9)
132  idx = FinderFn(kGENIEinternal);
133  else if (pdg > 1e9)
134  idx = FinderFn(kNuclFragment);
135  else
136  {
137  idx = FinderFn(pdg);
138  // find() returns end() if it finds nothing, and distance(begin(), end()) == size()
139  // also, the std::find() can return a negative number. but I'm comparing to begin()
140  // so that can't happen, so I'm just casting it away
141  if (std::size_t(idx) == PDG_BINS.size())
142  {
143  // std::cout << "other PID: " << pdg << std::endl;
144  idx--;
145  }
146  }
147  return idx;
148  }
int kNuclFragment
std::vector< std::pair< int, std::string > > PDG_BINS
const char * p
Definition: xmltok.h:285
unsigned distance(const T &t1, const T &t2)
float abs(float number)
Definition: d0nt_math.hpp:39
int kGENIEinternal
stuff for decent PDG code binning
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 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  }

Member Data Documentation

bool mcchk::DetSimAna::fDetOnly
private

Definition at line 70 of file DetSimAna_module.cc.

Referenced by analyze().

TH1F* mcchk::DetSimAna::fFLS_Delta_R
private

Total passing distance in the cell.

Definition at line 95 of file DetSimAna_module.cc.

Referenced by analyze(), and beginJob().

TH1F* mcchk::DetSimAna::fFLS_Delta_X
private

FLS hit passing distance in the cell along X axis.

Definition at line 92 of file DetSimAna_module.cc.

Referenced by analyze(), and beginJob().

TH1F* mcchk::DetSimAna::fFLS_Delta_Y
private

Definition at line 93 of file DetSimAna_module.cc.

Referenced by analyze(), and beginJob().

TH1F* mcchk::DetSimAna::fFLS_Delta_Z
private

Definition at line 94 of file DetSimAna_module.cc.

Referenced by analyze(), and beginJob().

TH1F* mcchk::DetSimAna::fFLS_EDep
private

Total FLS energy deposition in event.

Definition at line 81 of file DetSimAna_module.cc.

Referenced by analyze(), and beginJob().

TH1F* mcchk::DetSimAna::fFLS_EDep_perhit
private

FLS energy deposition per hit.

Definition at line 82 of file DetSimAna_module.cc.

Referenced by analyze(), and beginJob().

TH1F* mcchk::DetSimAna::fFLS_Entry_X
private

FLS hit cell X entry.

Definition at line 84 of file DetSimAna_module.cc.

Referenced by analyze(), and beginJob().

TH2F* mcchk::DetSimAna::fFLS_Entry_XY
private

X vs Y entry.

Definition at line 88 of file DetSimAna_module.cc.

Referenced by analyze(), and beginJob().

TH2F* mcchk::DetSimAna::fFLS_Entry_XZ
private

X vs Z entry.

Definition at line 89 of file DetSimAna_module.cc.

Referenced by analyze(), and beginJob().

TH1F* mcchk::DetSimAna::fFLS_Entry_Y
private

Definition at line 85 of file DetSimAna_module.cc.

Referenced by analyze(), and beginJob().

TH2F* mcchk::DetSimAna::fFLS_Entry_YZ
private

Y vs Z entry.

Definition at line 90 of file DetSimAna_module.cc.

Referenced by analyze(), and beginJob().

TH1F* mcchk::DetSimAna::fFLS_Entry_Z
private

Definition at line 86 of file DetSimAna_module.cc.

Referenced by analyze(), and beginJob().

TH1F* mcchk::DetSimAna::fFLS_hits
private

FLS hits.

Definition at line 80 of file DetSimAna_module.cc.

Referenced by analyze(), and beginJob().

std::string mcchk::DetSimAna::fMCTruthModuleLabel
private

Definition at line 72 of file DetSimAna_module.cc.

Referenced by analyze().

TH1F* mcchk::DetSimAna::fNParticles_detsim
private

Number of particles after DetSim, in ParticleNavigator list.

Definition at line 75 of file DetSimAna_module.cc.

Referenced by analyze(), and beginJob().

TH1F* mcchk::DetSimAna::fNParticles_truth
private

Number of particles in MCTruth list.

Definition at line 74 of file DetSimAna_module.cc.

Referenced by analyze(), and beginJob().

TH1F* mcchk::DetSimAna::fPDG_detsim
private

PDG of all particles after DetSim, in ParticleNavigator list.

Definition at line 78 of file DetSimAna_module.cc.

Referenced by analyze(), and beginJob().

TH1F* mcchk::DetSimAna::fPDG_truth
private

PDG of all particles in MCTruth list.

Definition at line 77 of file DetSimAna_module.cc.

Referenced by analyze(), and beginJob().

TH1F* mcchk::DetSimAna::fPhotonEvap
private

Energy spectrum of photons with neutron parents.

Definition at line 97 of file DetSimAna_module.cc.

Referenced by analyze(), and beginJob().


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