2 #include "art/Framework/Core/EDAnalyzer.h"
3 #include "art/Framework/Principal/Event.h"
4 #include "art/Framework/Principal/Handle.h"
5 #include "art/Framework/Core/ModuleMacros.h"
6 #include "art_root_io/TFileService.h"
7 #include "art_root_io/TFileDirectory.h"
8 #include "art/Framework/Services/Registry/ServiceHandle.h"
9 #include "artg4tk/services/DetectorHolder_service.hh"
20 #include "CLHEP/Units/SystemOfUnits.h"
33 void beginJob()
override;
34 void analyze(
const art::Event& event)
override;
36 TH1F* _hnHits{
nullptr};
37 TH1F* _hEdep{
nullptr};
38 TH1F* _hnumPhotons{
nullptr};
39 TH1F* _hLandauPhotons{
nullptr};
40 TH1F* _hLandauEdep{
nullptr};
41 TH1F* _hSteplength{
nullptr};
42 TNtuple* _ntuple{
nullptr};
51 art::ServiceHandle<art::TFileService const>
tfs;
52 _hnHits = tfs->make<TH1F>(
"hnHits",
"Number of SimEnergyDeposits", 300, 0, 0);
53 _hEdep = tfs->make<TH1F>(
"hEdep",
"Energy deposition in SimEnergyDeposits", 100,0.,0.02);
54 _hnumPhotons = tfs->make<TH1F>(
"hnumPhotons",
"number of photons per SimEnergyDeposit", 100,0.,500.);
55 _hLandauPhotons= tfs->make<TH1F>(
"hLandauPhotons",
"number of photons/cm", 100,0.,2000000.);
56 _hLandauEdep= tfs->make<TH1F>(
"hLandauEdep",
"Edep/cm", 100,0.,10.);
57 _hSteplength= tfs->make<TH1F>(
"hSteplength",
"geant 4 step length", 100,0.,0.05);
58 _ntuple = tfs->make<TNtuple>(
"ntuple",
"Demo ntuple",
59 "Event:Edep:em_Edep:nonem_Edep:xpos:ypos:zpos:time");
65 for (
auto const& sims : allSims) {
66 double sumPhotons=0.0;
68 _hnHits->Fill(sims->size());
69 for (
auto const&
hit : *sims) {
72 sumPhotons= sumPhotons +
hit.NumPhotons();
73 sumE= sumE +
hit.Energy();
75 _hnumPhotons->Fill(
hit.NumPhotons());
76 _hEdep->Fill(
hit.Energy());
77 _hSteplength->Fill(
hit.StepLength());
79 _hLandauPhotons->Fill(sumPhotons);
80 _hLandauEdep->Fill(sumE);
process_name opflashCryo1 flashfilter analyze
double std(const std::vector< short > &wf, const double ped_mean, size_t start, size_t nsample)
CheckSimEnergyDeposit(fhicl::ParameterSet const &p)
standard_singlep gaussian distribution ie ie ie gaussian gaussian gaussian simWire CheckSimEnergyDeposit
std::vector< SimEnergyDeposit > SimEnergyDepositCollection
contains information for a single step in the detector simulation
art::ServiceHandle< art::TFileService > tfs
void analyze(const art::Event &event) override