Public Member Functions | Private Attributes | List of all members
larg4::ISCalcAna Class Reference
Inheritance diagram for larg4::ISCalcAna:
art::EDAnalyzer art::detail::Analyzer art::detail::LegacyModule art::Observer art::ModuleBase

Public Member Functions

 ISCalcAna (fhicl::ParameterSet const &p)
 
 ISCalcAna (ISCalcAna const &)=delete
 
 ISCalcAna (ISCalcAna &&)=delete
 
ISCalcAnaoperator= (ISCalcAna const &)=delete
 
ISCalcAnaoperator= (ISCalcAna &&)=delete
 
void analyze (art::Event const &event) override
 
void beginJob () override
 
void endJob () override
 
- Public Member Functions inherited from art::EDAnalyzer
 EDAnalyzer (fhicl::ParameterSet const &pset)
 
template<typename Config >
 EDAnalyzer (Table< Config > const &config)
 
std::string workerType () const
 
- Public Member Functions inherited from art::detail::Analyzer
virtual ~Analyzer () noexcept
 
 Analyzer (fhicl::ParameterSet const &pset)
 
template<typename Config >
 Analyzer (Table< Config > const &config)
 
void doBeginJob (SharedResources const &resources)
 
void doEndJob ()
 
void doRespondToOpenInputFile (FileBlock const &fb)
 
void doRespondToCloseInputFile (FileBlock const &fb)
 
void doRespondToOpenOutputFiles (FileBlock const &fb)
 
void doRespondToCloseOutputFiles (FileBlock const &fb)
 
bool doBeginRun (RunPrincipal &rp, ModuleContext const &mc)
 
bool doEndRun (RunPrincipal &rp, ModuleContext const &mc)
 
bool doBeginSubRun (SubRunPrincipal &srp, ModuleContext const &mc)
 
bool doEndSubRun (SubRunPrincipal &srp, ModuleContext const &mc)
 
bool doEvent (EventPrincipal &ep, ModuleContext const &mc, std::atomic< std::size_t > &counts_run, std::atomic< std::size_t > &counts_passed, std::atomic< std::size_t > &counts_failed)
 
- Public Member Functions inherited from art::Observer
 ~Observer () noexcept
 
 Observer (Observer const &)=delete
 
 Observer (Observer &&)=delete
 
Observeroperator= (Observer const &)=delete
 
Observeroperator= (Observer &&)=delete
 
void registerProducts (ProductDescriptions &, ModuleDescription const &)
 
void fillDescriptions (ModuleDescription const &)
 
fhicl::ParameterSetID selectorConfig () const
 
- Public Member Functions inherited from art::ModuleBase
virtual ~ModuleBase () noexcept
 
 ModuleBase ()
 
ModuleDescription const & moduleDescription () const
 
void setModuleDescription (ModuleDescription const &)
 
std::array< std::vector< ProductInfo >, NumBranchTypes > const & getConsumables () const
 
void sortConsumables (std::string const &current_process_name)
 
template<typename T , BranchType BT>
ViewToken< T > consumesView (InputTag const &tag)
 
template<typename T , BranchType BT>
ViewToken< T > mayConsumeView (InputTag const &tag)
 

Private Attributes

std::unique_ptr< ISCalcfISAlg
 
art::InputTag fEDepTag
 
art::InputTag calcTag
 
CLHEP::HepRandomEngine & fEngine
 
TNtuple * fNtuple
 

Additional Inherited Members

- Public Types inherited from art::EDAnalyzer
using WorkerType = WorkerT< EDAnalyzer >
 
using ModuleType = EDAnalyzer
 
- Protected Member Functions inherited from art::Observer
std::string const & processName () const
 
bool wantAllEvents () const noexcept
 
bool wantEvent (ScheduleID id, Event const &e) const
 
Handle< TriggerResultsgetTriggerResults (Event const &e) const
 
 Observer (fhicl::ParameterSet const &config)
 
 Observer (std::vector< std::string > const &select_paths, std::vector< std::string > const &reject_paths, fhicl::ParameterSet const &config)
 
- Protected Member Functions inherited from art::ModuleBase
ConsumesCollectorconsumesCollector ()
 
template<typename T , BranchType = InEvent>
ProductToken< T > consumes (InputTag const &)
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > consumesView (InputTag const &)
 
template<typename T , BranchType = InEvent>
void consumesMany ()
 
template<typename T , BranchType = InEvent>
ProductToken< T > mayConsume (InputTag const &)
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > mayConsumeView (InputTag const &)
 
template<typename T , BranchType = InEvent>
void mayConsumeMany ()
 

Detailed Description

Definition at line 37 of file ISCalcAna_module.cc.

Constructor & Destructor Documentation

larg4::ISCalcAna::ISCalcAna ( fhicl::ParameterSet const &  p)
explicit

Definition at line 57 of file ISCalcAna_module.cc.

58  : EDAnalyzer(pset)
59  , fEDepTag{pset.get<art::InputTag>("SimulationLabel")}
60  , calcTag{pset.get<art::InputTag>("ISCalcAlg")}
62  ->createEngine(*this, "HepJamesRandom", "NEST", pset, "SeedNEST"))
63  {
64  std::cout << "ISCalcAna constructor." << std::endl;
65  }
EDAnalyzer(fhicl::ParameterSet const &pset)
Definition: EDAnalyzer.h:25
art::InputTag fEDepTag
art::InputTag calcTag
CLHEP::HepRandomEngine & fEngine
QTextStream & endl(QTextStream &s)
larg4::ISCalcAna::ISCalcAna ( ISCalcAna const &  )
delete
larg4::ISCalcAna::ISCalcAna ( ISCalcAna &&  )
delete

Member Function Documentation

void larg4::ISCalcAna::analyze ( art::Event const &  event)
overridevirtual

Implements art::EDAnalyzer.

Definition at line 97 of file ISCalcAna_module.cc.

98  {
100  if (!event.getByLabel(fEDepTag, edep_handle)) {
101  std::cout << "PDFastSimPAR Module Cannot getByLabel: " << fEDepTag << std::endl;
102  return;
103  }
104 
105  auto const detProp =
107  for (auto const& edepi : *edep_handle) {
108  auto const [energyDeposit, nElectrons, nPhotons, scintYieldRatio] =
109  fISAlg->CalcIonAndScint(detProp, edepi);
110  fNtuple->Fill(event.run(),
111  event.event(),
112  edepi.T(),
113  edepi.X(),
114  edepi.Y(),
115  edepi.Z(),
116  edepi.StepLength(),
117  edepi.Energy(),
118  edepi.TrackID(),
119  edepi.PdgCode(),
120  energyDeposit,
121  nElectrons,
122  nPhotons,
123  scintYieldRatio);
124  }
125 
126  std::cout << "ISCalcAna analyze completed." << std::endl;
127  }
art::InputTag fEDepTag
std::unique_ptr< ISCalc > fISAlg
QTextStream & endl(QTextStream &s)
Event finding and building.
void larg4::ISCalcAna::beginJob ( )
overridevirtual

Reimplemented from art::EDAnalyzer.

Definition at line 68 of file ISCalcAna_module.cc.

69  {
70  std::cout << "ISCalcAna beginJob." << std::endl;
71  std::cout << "Using " << calcTag.label() << " algorithm to calculate IS." << std::endl;
72 
73  if (calcTag.label() == "Separate")
74  fISAlg = std::make_unique<larg4::ISCalcSeparate>();
75  else if (calcTag.label() == "Correlated") {
76  auto const detProp = art::ServiceHandle<detinfo::DetectorPropertiesService>()->DataForJob();
77  fISAlg = std::make_unique<larg4::ISCalcCorrelated>(detProp);
78  }
79  else if (calcTag.label() == "NEST")
80  fISAlg = std::make_unique<larg4::ISCalcNESTLAr>(fEngine);
81  else
82  mf::LogWarning("IonAndScint") << "No ISCalculation set, this can't be good.";
83 
85  fNtuple = tfs->make<TNtuple>(
86  "nt_is",
87  "EDep IS Calc Ntuple",
88  "run:event:t:x:y:z:ds:e:trackid:pdg:e_deposit:n_electron:n_photon:scintyield");
89  }
std::string const & label() const noexcept
Definition: InputTag.cc:79
art::InputTag calcTag
std::unique_ptr< ISCalc > fISAlg
CLHEP::HepRandomEngine & fEngine
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
QTextStream & endl(QTextStream &s)
void larg4::ISCalcAna::endJob ( )
overridevirtual

Reimplemented from art::EDAnalyzer.

Definition at line 91 of file ISCalcAna_module.cc.

92  {
93  std::cout << "ISCalcAna endJob." << std::endl;
94  }
QTextStream & endl(QTextStream &s)
ISCalcAna& larg4::ISCalcAna::operator= ( ISCalcAna const &  )
delete
ISCalcAna& larg4::ISCalcAna::operator= ( ISCalcAna &&  )
delete

Member Data Documentation

art::InputTag larg4::ISCalcAna::calcTag
private

Definition at line 52 of file ISCalcAna_module.cc.

art::InputTag larg4::ISCalcAna::fEDepTag
private

Definition at line 51 of file ISCalcAna_module.cc.

CLHEP::HepRandomEngine& larg4::ISCalcAna::fEngine
private

Definition at line 53 of file ISCalcAna_module.cc.

std::unique_ptr<ISCalc> larg4::ISCalcAna::fISAlg
private

Definition at line 50 of file ISCalcAna_module.cc.

TNtuple* larg4::ISCalcAna::fNtuple
private

Definition at line 54 of file ISCalcAna_module.cc.


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