All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Attributes | List of all members
larg4::ISCalcAna Class Reference
Inheritance diagram for larg4::ISCalcAna:

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
 

Private Attributes

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

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")}
61  , fEngine(art::ServiceHandle<rndm::NuRandomService>()
62  ->createEngine(*this, "HepJamesRandom", "NEST", pset, "SeedNEST"))
63  {
64  std::cout << "ISCalcAna constructor." << std::endl;
65  }
art::InputTag fEDepTag
art::InputTag calcTag
CLHEP::HepRandomEngine & fEngine
BEGIN_PROLOG could also be cout
larg4::ISCalcAna::ISCalcAna ( ISCalcAna const &  )
delete
larg4::ISCalcAna::ISCalcAna ( ISCalcAna &&  )
delete

Member Function Documentation

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

Definition at line 97 of file ISCalcAna_module.cc.

98  {
99  art::Handle<std::vector<sim::SimEnergyDeposit>> edep_handle;
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 =
106  art::ServiceHandle<detinfo::DetectorPropertiesService const>()->DataFor(event);
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
BEGIN_PROLOG could also be cout
auto const detProp
void larg4::ISCalcAna::beginJob ( )
override

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, fEngine);
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 
84  art::ServiceHandle<art::TFileService const> tfs;
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  }
art::InputTag calcTag
std::unique_ptr< ISCalc > fISAlg
CLHEP::HepRandomEngine & fEngine
art::ServiceHandle< art::TFileService > tfs
BEGIN_PROLOG could also be cout
auto const detProp
void larg4::ISCalcAna::endJob ( )
override

Definition at line 91 of file ISCalcAna_module.cc.

92  {
93  std::cout << "ISCalcAna endJob." << std::endl;
94  }
BEGIN_PROLOG could also be cout
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: