All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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:

Public Member Functions

 LArSimChannelAna (fhicl::ParameterSet const &pset)
 

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
 

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.
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 =
144  art::ServiceHandle<detinfo::DetectorPropertiesService const>()->DataFor(evt);
145  ensureHists(detProp.NumberTimeSamples());
146 
147  art::ServiceHandle<geo::Geometry const> geom;
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)
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
TCEvent evt
Definition: DataStructs.cxx:8
TH1D * fTDC
Which TDCs have activity.
auto const detProp
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
103  art::ServiceHandle<art::TFileService const> tfs;
104  // geometry data.
105  art::ServiceHandle<geo::Geometry const> geom;
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
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
art::ServiceHandle< art::TFileService > tfs
TH1D * fTDC
Which TDCs have activity.

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: