Public Member Functions | Private Member Functions | Private Attributes | List of all members
larg::LArSimChannelAna Class Reference

Base class for creation of raw signals on wires. More...

Inheritance diagram for larg::LArSimChannelAna:
art::EDAnalyzer art::detail::Analyzer art::detail::LegacyModule art::Observer art::ModuleBase

Public Member Functions

 LArSimChannelAna (fhicl::ParameterSet const &pset)
 
- 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 Member Functions

void analyze (const art::Event &evt) override
 
void ensureHists (unsigned int const nTimeSamples)
 

Private Attributes

std::string fLArG4ModuleLabel
 
bool initDone
 
TH1D * fChargeXpos
 position of the MC Truth charge deposition More...
 
TH1D * fChargeYpos
 position of the MC Truth charge deposition More...
 
TH1D * fChargeZpos
 position of the MC Truth charge deposition More...
 
TH1D * fTDC
 Which TDCs have activity. More...
 
TH1D * fTDCsPerChannel
 Number of TDCs with activity. More...
 
TH1D * fIDEsPerChannel
 
TH1D * fElectrons
 Electrons in the whole channel entry. More...
 
TH1D * fEnergy
 Energy in the whole channel entry. More...
 
TH1D * fElectronsPerTDC
 
TH1D * fEnergyPerTDC
 
TH1D * fElectronsPerIDE
 
TH1D * fEnergyPerIDE
 

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

Base class for creation of raw signals on wires.

Definition at line 35 of file LArSimChannelAna_module.cc.

Constructor & Destructor Documentation

larg::LArSimChannelAna::LArSimChannelAna ( fhicl::ParameterSet const &  pset)
explicit

Definition at line 77 of file LArSimChannelAna_module.cc.

78  : EDAnalyzer(pset)
79  , fLArG4ModuleLabel{pset.get<std::string>("LArGeantModuleLabel")}
80  , initDone(false)
81  , fChargeXpos()
82  , fChargeYpos()
83  , fChargeZpos()
84  , fTDC()
85  , fTDCsPerChannel()
86  , fIDEsPerChannel()
87  , fElectrons()
88  , fEnergy()
90  , fEnergyPerTDC()
92  , fEnergyPerIDE()
93  {}
TH1D * fTDCsPerChannel
Number of TDCs with activity.
std::string string
Definition: nybbler.cc:12
EDAnalyzer(fhicl::ParameterSet const &pset)
Definition: EDAnalyzer.h:25
TH1D * fElectrons
Electrons in the whole channel entry.
TH1D * fChargeXpos
position of the MC Truth charge deposition
TH1D * fChargeYpos
position of the MC Truth charge deposition
TH1D * fEnergy
Energy in the whole channel entry.
TH1D * fChargeZpos
position of the MC Truth charge deposition
TH1D * fTDC
Which TDCs have activity.

Member Function Documentation

void larg::LArSimChannelAna::analyze ( const art::Event evt)
overrideprivate

Definition at line 137 of file LArSimChannelAna_module.cc.

138  {
139  if (evt.isRealData()) {
140  throw cet::exception("LArSimChannelAna") << "Not for use on Data yet...\n";
141  }
142 
143  auto const detProp =
145  ensureHists(detProp.NumberTimeSamples());
146 
148 
149  auto const& scVec = *evt.getValidHandle<std::vector<sim::SimChannel>>(fLArG4ModuleLabel);
150 
151  //++++++++++
152  // Loop over the Chnnels and fill histograms
153  //++++++++++
154  unsigned int totalIDEs = 0;
155  double totalElectrons = 0;
156  double totalEnergy = 0;
157  for (const auto& sc : scVec) {
158  const auto& tdcidemap = sc.TDCIDEMap();
159  fTDCsPerChannel->Fill(tdcidemap.size());
160 
161  for (auto const& [tdc, ideVec] : tdcidemap) {
162  totalIDEs += ideVec.size();
163  double tdcElectrons = 0;
164  double tdcEnergy = 0;
165 
166  fTDC->Fill(tdc);
167 
168  for (const auto& ide : ideVec) {
169  totalElectrons += ide.numElectrons;
170  totalEnergy += ide.energy;
171  tdcElectrons += ide.numElectrons;
172  tdcEnergy += ide.energy;
173 
174  fChargeXpos->Fill(ide.x);
175  fChargeYpos->Fill(ide.y);
176  fChargeZpos->Fill(ide.z);
177  fElectronsPerIDE->Fill(ide.numElectrons);
178  fEnergyPerIDE->Fill(ide.energy);
179  }
180  fElectronsPerTDC->Fill(tdcElectrons);
181  fEnergyPerTDC->Fill(tdcEnergy);
182  }
183  }
184  fIDEsPerChannel->Fill(totalIDEs);
185  fElectrons->Fill(totalElectrons);
186  fEnergy->Fill(totalEnergy);
187  } //end analyze method
TH1D * fTDCsPerChannel
Number of TDCs with activity.
TH1D * fElectrons
Electrons in the whole channel entry.
TH1D * fChargeXpos
position of the MC Truth charge deposition
void ensureHists(unsigned int const nTimeSamples)
bool isRealData() const
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
Definition: DataViewImpl.h:441
TH1D * fChargeYpos
position of the MC Truth charge deposition
TH1D * fEnergy
Energy in the whole channel entry.
TH1D * fChargeZpos
position of the MC Truth charge deposition
TH1D * fTDC
Which TDCs have activity.
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
void larg::LArSimChannelAna::ensureHists ( unsigned int const  nTimeSamples)
private

Definition at line 97 of file LArSimChannelAna_module.cc.

98  {
99  if (initDone) return; // Bail if we've already done this.
100  initDone = true; // Insure that we bail later on
101 
102  // get access to the TFile service
104  // geometry data.
106 
107  // assumes all TPCs are the same
108  double width = 2 * geom->TPC(0).HalfWidth();
109  double halfHeight = geom->TPC(0).HalfHeight();
110  double length = geom->TPC(0).Length();
111 
112  // Assumes microboone dimensions. Ideally we'd fix this later...
113  fChargeXpos =
114  tfs->make<TH1D>("hChargeXpos", "X charge depositions;X (cm);Events", 101, 0.0, width);
115  fChargeYpos = tfs->make<TH1D>(
116  "hChargeYpos", "Y charge depositions;Y (cm);Events", 101, -halfHeight, halfHeight);
117  fChargeZpos =
118  tfs->make<TH1D>("hChargeZpos", "Z charge depositions;Z (cm);Events", 101, 0.0, length);
119  fTDC = tfs->make<TH1D>("hTDC", "Active TDC;TDCs;Events;", nTimeSamples, 0, nTimeSamples);
120  fTDCsPerChannel = tfs->make<TH1D>(
121  "hTDCsPerChannel", "TDCs per channel entry;# TDCs;Events", 128, 0, nTimeSamples);
123  tfs->make<TH1D>("hIDEsPerChannel", "IDE per channel entry;# IDEs;Events", 100, 0, 20000);
124  fElectrons =
125  tfs->make<TH1D>("hElectrons", "Electrons per channel;Electrons;Events", 100, 0, 2e7);
126  fEnergy = tfs->make<TH1D>("hEnergy", "Energy per channel;energy;Events", 100, 0, 2500);
128  tfs->make<TH1D>("hElectronsPerIDE", "Electrons per IDE;Electrons;Events", 100, 0, 10000);
129  fEnergyPerIDE = tfs->make<TH1D>("hEnergyPerIDE", "Energy per IDE;energy;Events", 100, 0, 50);
131  tfs->make<TH1D>("hElectronsPerTDC", "Electrons per TDC;Electrons;Events", 100, 0, 10000);
132  fEnergyPerTDC = tfs->make<TH1D>("hEnergyPerTDC", "Energy per YDC;energy;Events", 100, 0, 50);
133  }
TH1D * fTDCsPerChannel
Number of TDCs with activity.
TH1D * fElectrons
Electrons in the whole channel entry.
TH1D * fChargeXpos
position of the MC Truth charge deposition
double Length() const
Length is associated with z coordinate [cm].
Definition: TPCGeo.h:115
TH1D * fChargeYpos
position of the MC Truth charge deposition
TH1D * fEnergy
Energy in the whole channel entry.
double HalfHeight() const
Height is associated with y coordinate [cm].
Definition: TPCGeo.h:111
TH1D * fChargeZpos
position of the MC Truth charge deposition
TPCGeo const & TPC(unsigned int const tpc=0, unsigned int const cstat=0) const
Returns the specified TPC.
TH1D * fTDC
Which TDCs have activity.
double HalfWidth() const
Width is associated with x coordinate [cm].
Definition: TPCGeo.h:107

Member Data Documentation

TH1D* larg::LArSimChannelAna::fChargeXpos
private

position of the MC Truth charge deposition

Definition at line 56 of file LArSimChannelAna_module.cc.

TH1D* larg::LArSimChannelAna::fChargeYpos
private

position of the MC Truth charge deposition

Definition at line 57 of file LArSimChannelAna_module.cc.

TH1D* larg::LArSimChannelAna::fChargeZpos
private

position of the MC Truth charge deposition

Definition at line 58 of file LArSimChannelAna_module.cc.

TH1D* larg::LArSimChannelAna::fElectrons
private

Electrons in the whole channel entry.

Definition at line 65 of file LArSimChannelAna_module.cc.

TH1D* larg::LArSimChannelAna::fElectronsPerIDE
private

Definition at line 71 of file LArSimChannelAna_module.cc.

TH1D* larg::LArSimChannelAna::fElectronsPerTDC
private

Definition at line 68 of file LArSimChannelAna_module.cc.

TH1D* larg::LArSimChannelAna::fEnergy
private

Energy in the whole channel entry.

Definition at line 66 of file LArSimChannelAna_module.cc.

TH1D* larg::LArSimChannelAna::fEnergyPerIDE
private

Definition at line 72 of file LArSimChannelAna_module.cc.

TH1D* larg::LArSimChannelAna::fEnergyPerTDC
private

Definition at line 69 of file LArSimChannelAna_module.cc.

TH1D* larg::LArSimChannelAna::fIDEsPerChannel
private

Definition at line 63 of file LArSimChannelAna_module.cc.

std::string larg::LArSimChannelAna::fLArG4ModuleLabel
private

Definition at line 49 of file LArSimChannelAna_module.cc.

TH1D* larg::LArSimChannelAna::fTDC
private

Which TDCs have activity.

Definition at line 60 of file LArSimChannelAna_module.cc.

TH1D* larg::LArSimChannelAna::fTDCsPerChannel
private

Number of TDCs with activity.

Definition at line 62 of file LArSimChannelAna_module.cc.

bool larg::LArSimChannelAna::initDone
private

Definition at line 54 of file LArSimChannelAna_module.cc.


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