11 #include "art/Framework/Core/EDAnalyzer.h"
12 #include "art/Framework/Core/ModuleMacros.h"
13 #include "art/Framework/Principal/Event.h"
14 #include "art/Framework/Principal/Handle.h"
15 #include "art/Framework/Principal/Run.h"
16 #include "art/Framework/Principal/SubRun.h"
17 #include "canvas/Utilities/InputTag.h"
18 #include "fhiclcpp/ParameterSet.h"
19 #include "messagefacility/MessageLogger/MessageLogger.h"
20 #include "nurandom/RandomUtils/NuRandomService.h"
23 #include "art_root_io/TFileService.h"
39 explicit ISCalcAna(fhicl::ParameterSet
const&
p);
45 void analyze(art::Event
const& event)
override;
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"))
64 std::cout <<
"ISCalcAna constructor." << std::endl;
70 std::cout <<
"ISCalcAna beginJob." << std::endl;
71 std::cout <<
"Using " <<
calcTag.label() <<
" algorithm to calculate IS." << std::endl;
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();
79 else if (
calcTag.label() ==
"NEST")
82 mf::LogWarning(
"IonAndScint") <<
"No ISCalculation set, this can't be good.";
84 art::ServiceHandle<art::TFileService const>
tfs;
87 "EDep IS Calc Ntuple",
88 "run:event:t:x:y:z:ds:e:trackid:pdg:e_deposit:n_electron:n_photon:scintyield");
93 std::cout <<
"ISCalcAna endJob." << std::endl;
99 art::Handle<std::vector<sim::SimEnergyDeposit>> edep_handle;
100 if (!event.getByLabel(
fEDepTag, edep_handle)) {
106 art::ServiceHandle<detinfo::DetectorPropertiesService const>()->DataFor(event);
107 for (
auto const& edepi : *edep_handle) {
108 auto const [energyDeposit, nElectrons, nPhotons, scintYieldRatio] =
126 std::cout <<
"ISCalcAna analyze completed." << std::endl;
Store parameters for running LArG4.
void analyze(art::Event const &event) override
ISCalcAna & operator=(ISCalcAna const &)=delete
ISCalcAna(fhicl::ParameterSet const &p)
std::unique_ptr< ISCalc > fISAlg
CLHEP::HepRandomEngine & fEngine
contains information for a single step in the detector simulation
art::ServiceHandle< art::TFileService > tfs
BEGIN_PROLOG could also be cout