LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
hit::MagDriftAna Class Reference

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

Inheritance diagram for hit::MagDriftAna:
art::EDAnalyzer art::detail::Analyzer art::detail::LegacyModule art::Observer art::ModuleBase

Public Types

using ModuleType = EDAnalyzer
 

Public Member Functions

 MagDriftAna (fhicl::ParameterSet const &pset)
 
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)
 
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)
 
std::unique_ptr< Worker > makeWorker (WorkerParams const &wp)
 
template<typename T , BranchType BT>
ViewToken< T > consumesView (InputTag const &tag)
 
template<typename T , BranchType BT>
ViewToken< T > mayConsumeView (InputTag const &tag)
 

Protected Member Functions

std::string const & processName () const
 
bool wantAllEvents () const noexcept
 
bool wantEvent (ScheduleID id, Event const &e) const
 
Handle< TriggerResults > getTriggerResults (Event const &e) const
 
ConsumesCollector & consumesCollector ()
 
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 ()
 

Private Member Functions

void analyze (const art::Event &evt) override
 
void endJob () override
 
void ensureHists (art::Event const &evt, detinfo::DetectorClocksData const &clockData)
 

Private Attributes

std::string fFFTHitFinderModuleLabel
 
std::string fLArG4ModuleLabel
 
bool initDone {false}
 
double fDirCosY {0.}
 
double fDirCosZ {0.}
 
TH1D * fChargeXpos {nullptr}
 
TH1D * fChargeYpos {nullptr}
 
TH1D * fChargeZpos {nullptr}
 
TH1D * fHitZpos {nullptr}
 
TH1D * fDriftDeltaZ {nullptr}
 
TH1D * fDeltaZoverX {nullptr}
 
TH2D * fDeltaZvsX {nullptr}
 
TH1D * fDriftDeltaZAway {nullptr}
 
TH1D * fDeltaZoverXAway {nullptr}
 

Detailed Description

Base class for creation of raw signals on wires.

Definition at line 43 of file MagDriftAna_module.cc.

Member Typedef Documentation

Definition at line 22 of file EDAnalyzer.h.

Constructor & Destructor Documentation

hit::MagDriftAna::MagDriftAna ( fhicl::ParameterSet const &  pset)
explicit

Definition at line 88 of file MagDriftAna_module.cc.

References fLArG4ModuleLabel, and fhicl::ParameterSet::get().

89  : EDAnalyzer(pset)
90  , fFFTHitFinderModuleLabel{pset.get<std::string>("HitsModuleLabel")}
91  , fLArG4ModuleLabel{pset.get<std::string>("LArGeantModuleLabel")}
92  {}
std::string fLArG4ModuleLabel
std::string fFFTHitFinderModuleLabel
EDAnalyzer(fhicl::ParameterSet const &pset)
Definition: EDAnalyzer.cc:6

Member Function Documentation

void hit::MagDriftAna::analyze ( const art::Event evt)
overrideprivate

Definition at line 191 of file MagDriftAna_module.cc.

References DEFINE_ART_MODULE, ensureHists(), fChargeXpos, fChargeYpos, fChargeZpos, fDeltaZoverX, fDeltaZoverXAway, fDeltaZvsX, fDriftDeltaZ, fDriftDeltaZAway, fFFTHitFinderModuleLabel, fHitZpos, art::fill_ptr_vector(), art::ProductRetriever::getByLabel(), geo::WireGeo::GetCenter(), hits(), cheat::BackTrackerService::HitToXYZ(), art::Event::isRealData(), geo::GeometryCore::Nplanes(), geo::PlaneID::Plane, geo::GeometryCore::Plane(), geo::GeometryCore::TPC(), geo::PlaneGeo::Wire(), geo::WireID::Wire, geo::WireID::WireID(), and geo::TPCGeo::WirePitch().

192  {
193  if (evt.isRealData()) {
194  throw cet::exception("MagDriftAna: ") << "Not for use on Data yet...\n";
195  }
196 
197  auto const clockData = art::ServiceHandle<detinfo::DetectorClocksService const>()->DataFor(evt);
198 
199  ensureHists(evt, clockData);
200 
202  evt.getByLabel(fFFTHitFinderModuleLabel, hitHandle);
203 
205 
206  // We're going to want to compare the reconstructed Z with the
207  // simulted Z. For that purpose we use the simultion backtracking.
208 
210 
211  std::vector<art::Ptr<recob::Hit>> hits;
212  art::fill_ptr_vector(hits, hitHandle);
213 
214  geo::WireID hitWireID;
215 
216  //++++++++++
217  // Loop over the hits (data) and fill histos
218  //++++++++++
219  for (auto itr : hits) {
220 
221  hitWireID = itr->WireID();
222  // By assumption the drift occurs only in the z-direction, so
223  // we can get all the info we need from the z-measug plane.
224  if (hitWireID.Plane != (geom->Nplanes() - 1)) continue;
225 
226  // Charge collected at the wire
227  //
228  // Exactly once for each recob::Hit
229  auto const w0pos = geom->Plane(hitWireID).Wire(0).GetCenter();
230  double HitZpos = w0pos.Z() + hitWireID.Wire * geom->TPC(hitWireID).WirePitch();
231  double Charge = itr->Integral();
232  fHitZpos->Fill(HitZpos, Charge);
233 
234  // Charge deposition in the detector
235  std::vector<double> xyz = bt_serv->HitToXYZ(clockData, itr);
236  fChargeXpos->Fill(xyz[0], Charge);
237  fChargeYpos->Fill(xyz[1], Charge);
238  double ChargeZpos = xyz[2];
239  fChargeZpos->Fill(ChargeZpos, Charge);
240 
241  // Delta-Z
242  //
243  // Compares the collected z position from the wire to the
244  // simulated z position
245  double DeltaZ = HitZpos - ChargeZpos;
246  fDriftDeltaZ->Fill(DeltaZ, Charge);
247  // Delta Z correlation with X
248  fDeltaZoverX->Fill(DeltaZ / xyz[0], Charge);
249  fDeltaZvsX->Fill(xyz[0], DeltaZ, Charge);
250  // The X related histograms know the dimensions of the
251  // detector, so we use them to set the "away" limit
252  if (xyz[0] > (fChargeYpos->GetXaxis()->GetXmax() * 0.80)) {
253  fDriftDeltaZAway->Fill(DeltaZ, Charge);
254  fDeltaZoverXAway->Fill(DeltaZ / xyz[0], Charge);
255  }
256 
257  } // loop on Hits
258 
259  return;
260  } // end analyze method
Point_t const & GetCenter() const
Returns the world coordinate of the center of the wire [cm].
Definition: WireGeo.h:221
WireGeo const & Wire(unsigned int iwire) const
Definition: PlaneGeo.cxx:465
std::string fFFTHitFinderModuleLabel
WireID_t Wire
Index of the wire within its plane.
Definition: geo_types.h:563
bool isRealData() const
Definition: Event.cc:53
std::vector< double > HitToXYZ(detinfo::DetectorClocksData const &clockData, const recob::Hit &hit) const
TPCGeo const & TPC(TPCID const &tpcid=tpc_zero) const
Returns the specified TPC.
Definition: GeometryCore.h:722
PlaneGeo const & Plane(PlaneID const &planeid) const
Returns the specified wire.
void hits()
Definition: readHits.C:15
double WirePitch(unsigned plane=0) const
Returns the center of the TPC volume in world coordinates [cm].
Definition: TPCGeo.cxx:368
PlaneID_t Plane
Index of the plane within its TPC.
Definition: geo_types.h:481
void ensureHists(art::Event const &evt, detinfo::DetectorClocksData const &clockData)
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
constexpr WireID()=default
Default constructor: an invalid TPC ID.
unsigned int Nplanes(TPCID const &tpcid=tpc_zero) const
Returns the total number of planes in the specified TPC.
Definition: GeometryCore.h:977
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
Definition: Ptr.h:306
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
template<typename T , BranchType BT>
ProductToken< T > art::ModuleBase::consumes ( InputTag const &  tag)
protectedinherited

Definition at line 61 of file ModuleBase.h.

References art::ModuleBase::collector_, and art::ConsumesCollector::consumes().

62  {
63  return collector_.consumes<T, BT>(tag);
64  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
ProductToken< T > consumes(InputTag const &)
ConsumesCollector & art::ModuleBase::consumesCollector ( )
protectedinherited

Definition at line 57 of file ModuleBase.cc.

References art::ModuleBase::collector_.

58  {
59  return collector_;
60  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
template<typename T , BranchType BT>
void art::ModuleBase::consumesMany ( )
protectedinherited

Definition at line 75 of file ModuleBase.h.

References art::ModuleBase::collector_, and art::ConsumesCollector::consumesMany().

76  {
77  collector_.consumesMany<T, BT>();
78  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::ModuleBase::consumesView ( InputTag const &  )
protectedinherited
template<typename T , BranchType BT>
ViewToken<T> art::ModuleBase::consumesView ( InputTag const &  tag)
inherited

Definition at line 68 of file ModuleBase.h.

References art::ModuleBase::collector_, and art::ConsumesCollector::consumesView().

69  {
70  return collector_.consumesView<T, BT>(tag);
71  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
ViewToken< Element > consumesView(InputTag const &)
void art::detail::Analyzer::doBeginJob ( SharedResources const &  resources)
inherited

Definition at line 25 of file Analyzer.cc.

Referenced by art::detail::Analyzer::Analyzer().

26  {
27  setupQueues(resources);
28  ProcessingFrame const frame{ScheduleID{}};
29  beginJobWithFrame(frame);
30  }
virtual void beginJobWithFrame(ProcessingFrame const &)=0
virtual void setupQueues(SharedResources const &)=0
bool art::detail::Analyzer::doBeginRun ( RunPrincipal rp,
ModuleContext const &  mc 
)
inherited

Definition at line 68 of file Analyzer.cc.

References art::ModuleContext::scheduleID().

Referenced by art::detail::Analyzer::Analyzer().

69  {
70  ProcessingFrame const frame{mc.scheduleID()};
71  beginRunWithFrame(std::as_const(rp).makeRun(mc), frame);
72  return true;
73  }
virtual void beginRunWithFrame(Run const &, ProcessingFrame const &)=0
bool art::detail::Analyzer::doBeginSubRun ( SubRunPrincipal srp,
ModuleContext const &  mc 
)
inherited

Definition at line 84 of file Analyzer.cc.

References art::ModuleContext::scheduleID().

Referenced by art::detail::Analyzer::Analyzer().

85  {
86  ProcessingFrame const frame{mc.scheduleID()};
87  beginSubRunWithFrame(std::as_const(srp).makeSubRun(mc), frame);
88  return true;
89  }
virtual void beginSubRunWithFrame(SubRun const &, ProcessingFrame const &)=0
void art::detail::Analyzer::doEndJob ( )
inherited

Definition at line 33 of file Analyzer.cc.

Referenced by art::detail::Analyzer::Analyzer().

34  {
35  ProcessingFrame const frame{ScheduleID{}};
36  endJobWithFrame(frame);
37  }
virtual void endJobWithFrame(ProcessingFrame const &)=0
bool art::detail::Analyzer::doEndRun ( RunPrincipal rp,
ModuleContext const &  mc 
)
inherited

Definition at line 76 of file Analyzer.cc.

References art::ModuleContext::scheduleID().

Referenced by art::detail::Analyzer::Analyzer().

77  {
78  ProcessingFrame const frame{mc.scheduleID()};
79  endRunWithFrame(std::as_const(rp).makeRun(mc), frame);
80  return true;
81  }
virtual void endRunWithFrame(Run const &, ProcessingFrame const &)=0
bool art::detail::Analyzer::doEndSubRun ( SubRunPrincipal srp,
ModuleContext const &  mc 
)
inherited

Definition at line 92 of file Analyzer.cc.

References art::ModuleContext::scheduleID().

Referenced by art::detail::Analyzer::Analyzer().

93  {
94  ProcessingFrame const frame{mc.scheduleID()};
95  endSubRunWithFrame(std::as_const(srp).makeSubRun(mc), frame);
96  return true;
97  }
virtual void endSubRunWithFrame(SubRun const &, ProcessingFrame const &)=0
bool art::detail::Analyzer::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 
)
inherited

Definition at line 100 of file Analyzer.cc.

References e, and art::ModuleContext::scheduleID().

Referenced by art::detail::Analyzer::Analyzer().

105  {
106  auto const e = std::as_const(ep).makeEvent(mc);
107  if (wantEvent(mc.scheduleID(), e)) {
108  ++counts_run;
109  ProcessingFrame const frame{mc.scheduleID()};
110  analyzeWithFrame(e, frame);
111  ++counts_passed;
112  }
113  return true;
114  }
bool wantEvent(ScheduleID id, Event const &e) const
Definition: Observer.cc:63
Float_t e
Definition: plot.C:35
virtual void analyzeWithFrame(Event const &, ProcessingFrame const &)=0
void art::detail::Analyzer::doRespondToCloseInputFile ( FileBlock const &  fb)
inherited

Definition at line 47 of file Analyzer.cc.

Referenced by art::detail::Analyzer::Analyzer().

48  {
49  ProcessingFrame const frame{ScheduleID{}};
51  }
TFile fb("Li6.root")
virtual void respondToCloseInputFileWithFrame(FileBlock const &, ProcessingFrame const &)=0
void art::detail::Analyzer::doRespondToCloseOutputFiles ( FileBlock const &  fb)
inherited

Definition at line 61 of file Analyzer.cc.

Referenced by art::detail::Analyzer::Analyzer().

62  {
63  ProcessingFrame const frame{ScheduleID{}};
65  }
virtual void respondToCloseOutputFilesWithFrame(FileBlock const &, ProcessingFrame const &)=0
TFile fb("Li6.root")
void art::detail::Analyzer::doRespondToOpenInputFile ( FileBlock const &  fb)
inherited

Definition at line 40 of file Analyzer.cc.

Referenced by art::detail::Analyzer::Analyzer().

41  {
42  ProcessingFrame const frame{ScheduleID{}};
44  }
TFile fb("Li6.root")
virtual void respondToOpenInputFileWithFrame(FileBlock const &, ProcessingFrame const &)=0
void art::detail::Analyzer::doRespondToOpenOutputFiles ( FileBlock const &  fb)
inherited

Definition at line 54 of file Analyzer.cc.

Referenced by art::detail::Analyzer::Analyzer().

55  {
56  ProcessingFrame const frame{ScheduleID{}};
58  }
virtual void respondToOpenOutputFilesWithFrame(FileBlock const &, ProcessingFrame const &)=0
TFile fb("Li6.root")
void hit::MagDriftAna::endJob ( )
overrideprivatevirtual

Reimplemented from art::EDAnalyzer.

Definition at line 171 of file MagDriftAna_module.cc.

References fDeltaZoverX, fDeltaZoverXAway, and fDirCosZ.

172  {
173  // Add a line on the deltaZ/X graph to denote the calculated value
174  // of the drift ration
175  TLine* l = new TLine(fDirCosZ, 0, fDirCosZ, 1.05 * fDeltaZoverX->GetMaximum());
176  l->SetLineColor(kRed);
177  l->SetLineStyle(kDotted);
178  fDeltaZoverX->GetListOfFunctions()->Add(l);
179 
180  // I know this looks like a memory leak, but each historgram needs
181  // it's own copy of the line to prevent double freeing by the
182  // framework...
183  l = new TLine(fDirCosZ, 0, fDirCosZ, 1.05 * fDeltaZoverX->GetMaximum());
184 
185  l->SetLineColor(kRed);
186  l->SetLineStyle(kDotted);
187  fDeltaZoverXAway->GetListOfFunctions()->Add(l);
188  }
void hit::MagDriftAna::ensureHists ( art::Event const &  evt,
detinfo::DetectorClocksData const &  clockData 
)
private

Definition at line 95 of file MagDriftAna_module.cc.

References e, fChargeXpos, fChargeYpos, fChargeZpos, fDeltaZoverX, fDeltaZoverXAway, fDeltaZvsX, fDirCosY, fDirCosZ, fDriftDeltaZ, fDriftDeltaZAway, fHitZpos, geo::TPCGeo::HalfWidth(), initDone, MF_LOG_VERBATIM, mag::MagneticFieldService::provider(), and geo::GeometryCore::TPC().

Referenced by analyze().

96  {
97  if (initDone) return; // Bail if we've already done this.
98  initDone = true; // Insure that we bail later on
99 
101 
102  // Find magnetic field related corrections
103  auto const detProp =
105 
106  // art::ServiceHandle<mag::MagneticField const> MagField;
108  auto const* MagField = MagFieldHandle->provider();
109  double Efield = detProp.Efield();
110  double Temperature = detProp.Temperature();
111  double DriftVelocity = detProp.DriftVelocity(Efield, Temperature) / 1000.;
112 
113  // MagneticField::FieldAtPoint() returns (0, 0, 0) if there is no
114  // field at the requested point, so these direction cosines are
115  // 0 if there is no field
116  fDirCosY = -DriftVelocity * MagField->FieldAtPoint().z() / Efield;
117  fDirCosZ = +DriftVelocity * MagField->FieldAtPoint().y() / Efield;
118  MF_LOG_VERBATIM("MagDriftAna") << "Drift ratios: "
119  << "dY/dX = " << fDirCosY << ", "
120  << "dZ/dX = " << fDirCosZ;
121 
122  // geometry data.
124  // assumes all TPCs are the same
125  auto const& tpc_0 = geom->TPC();
126  double width = 2 * tpc_0.HalfWidth();
127  double halfHeight = tpc_0.HalfHeight();
128  double length = tpc_0.Length();
129 
130  double zScale = std::max(fDirCosZ / 2.0, 4e-4);
131 
132  // Assumes microboone dimensions. Ideally we'd fix this later...
133  fChargeXpos =
134  tfs->make<TH1D>("hChargeXpos", "MC X charge depositions; X (cm); Events", 101, 0.0, width);
135  fChargeYpos = tfs->make<TH1D>(
136  "hChargeYpos", "MC Y charge depositions; Y (cm); Events", 101, -halfHeight, halfHeight);
137  fChargeZpos =
138  tfs->make<TH1D>("hChargeZpos", "MC Z charge depositions; Z (cm); Events", 101, 0.0, length);
139  fHitZpos = tfs->make<TH1D>("hHitZpos", "Z charge collection; Z (cm); Events", 101, 0.0, length);
140 
141  fDriftDeltaZ = tfs->make<TH1D>("hDriftDeltaZ",
142  "Z drift of charge; delta Z (cm); Events",
143  101,
144  -5 * zScale * width,
145  5 * zScale * width);
146  fDeltaZoverX = tfs->make<TH1D>(
147  "hDeltaZoverX", "Z drift of charge; delta Z/X; Events", 51, -10 * zScale, 10 * zScale);
148  fDeltaZvsX = tfs->make<TH2D>("hDeltaZvsX",
149  "delta Z vs X; X (cm); delta Z (cm), Events",
150  51,
151  0.0,
152  width,
153  51,
154  -20 * zScale,
155  20 * zScale);
156 
157  // Some stats only when the Xdrift is large (more than 3/4)
158  fDriftDeltaZAway = tfs->make<TH1D>("hDriftDeltaZAway",
159  "Z drift of charge (long drift); delta Z (cm); Events",
160  101,
161  -5 * zScale * width,
162  5 * zScale * width);
163  fDeltaZoverXAway = tfs->make<TH1D>("hDeltaZoverXAway",
164  "Z drift of charge (long drift); delta Z/X; Events",
165  51,
166  -10 * zScale,
167  10 * zScale);
168  }
TPCGeo const & TPC(TPCID const &tpcid=tpc_zero) const
Returns the specified TPC.
Definition: GeometryCore.h:722
virtual const mag::MagneticField * provider() const =0
#define MF_LOG_VERBATIM(category)
TCEvent evt
Definition: DataStructs.cxx:8
Float_t e
Definition: plot.C:35
double HalfWidth() const
Width is associated with x coordinate [cm].
Definition: TPCGeo.h:96
std::array< std::vector< ProductInfo >, NumBranchTypes > const & art::ModuleBase::getConsumables ( ) const
inherited

Definition at line 43 of file ModuleBase.cc.

References art::ModuleBase::collector_, and art::ConsumesCollector::getConsumables().

44  {
45  return collector_.getConsumables();
46  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
std::array< std::vector< ProductInfo >, NumBranchTypes > const & getConsumables() const
Handle< TriggerResults > art::Observer::getTriggerResults ( Event const &  e) const
protectedinherited

Definition at line 75 of file Observer.cc.

References art::ProductRetriever::get(), and art::Observer::selectors_.

Referenced by art::OutputModule::doWriteEvent(), and art::Observer::wantAllEvents().

76  {
77  if (selectors_) {
78  return selectors_->getOneTriggerResults(e);
79  }
80 
81  // The following applies for cases where no SelectEvents entries
82  // exist.
83  Handle<TriggerResults> h;
84  if (e.get(empty_process_name, h)) {
85  return h;
86  }
87  return Handle<TriggerResults>{};
88  }
Float_t e
Definition: plot.C:35
std::optional< detail::ProcessAndEventSelectors > selectors_
Definition: Observer.h:79
std::unique_ptr< Worker > art::ModuleBase::makeWorker ( WorkerParams const &  wp)
inherited

Definition at line 37 of file ModuleBase.cc.

References art::ModuleBase::doMakeWorker(), and art::NumBranchTypes.

38  {
39  return doMakeWorker(wp);
40  }
virtual std::unique_ptr< Worker > doMakeWorker(WorkerParams const &wp)=0
template<typename T , BranchType BT>
ProductToken< T > art::ModuleBase::mayConsume ( InputTag const &  tag)
protectedinherited

Definition at line 82 of file ModuleBase.h.

References art::ModuleBase::collector_, and art::ConsumesCollector::mayConsume().

83  {
84  return collector_.mayConsume<T, BT>(tag);
85  }
ProductToken< T > mayConsume(InputTag const &)
ConsumesCollector collector_
Definition: ModuleBase.h:56
template<typename T , BranchType BT>
void art::ModuleBase::mayConsumeMany ( )
protectedinherited

Definition at line 96 of file ModuleBase.h.

References art::ModuleBase::collector_, and art::ConsumesCollector::mayConsumeMany().

97  {
98  collector_.mayConsumeMany<T, BT>();
99  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::ModuleBase::mayConsumeView ( InputTag const &  )
protectedinherited
template<typename T , BranchType BT>
ViewToken<T> art::ModuleBase::mayConsumeView ( InputTag const &  tag)
inherited

Definition at line 89 of file ModuleBase.h.

References art::ModuleBase::collector_, and art::ConsumesCollector::mayConsumeView().

90  {
91  return collector_.mayConsumeView<T, BT>(tag);
92  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
ViewToken< Element > mayConsumeView(InputTag const &)
ModuleDescription const & art::ModuleBase::moduleDescription ( ) const
inherited

Definition at line 13 of file ModuleBase.cc.

References art::errors::LogicError.

Referenced by art::OutputModule::doRespondToOpenInputFile(), art::OutputModule::doWriteEvent(), art::Modifier::fillProductDescriptions(), art::OutputModule::makePlugins_(), art::OutputWorker::OutputWorker(), reco::shower::LArPandoraModularShowerCreation::produce(), art::Modifier::registerProducts(), and art::OutputModule::registerProducts().

14  {
15  if (md_.has_value()) {
16  return *md_;
17  }
18 
20  "There was an error while calling moduleDescription().\n"}
21  << "The moduleDescription() base-class member function cannot be called\n"
22  "during module construction. To determine which module is "
23  "responsible\n"
24  "for calling it, find the '<module type>:<module "
25  "label>@Construction'\n"
26  "tag in the message prefix above. Please contact artists@fnal.gov\n"
27  "for guidance.\n";
28  }
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
std::optional< ModuleDescription > md_
Definition: ModuleBase.h:55
string const & art::Observer::processName ( ) const
protectedinherited

Definition at line 57 of file Observer.cc.

References art::Observer::process_name_.

Referenced by art::FileDumperOutput::printPrincipal().

58  {
59  return process_name_;
60  }
std::string process_name_
Definition: Observer.h:76
void art::ModuleBase::setModuleDescription ( ModuleDescription const &  md)
inherited

Definition at line 31 of file ModuleBase.cc.

References art::ModuleBase::md_.

32  {
33  md_ = md;
34  }
std::optional< ModuleDescription > md_
Definition: ModuleBase.h:55
void art::ModuleBase::sortConsumables ( std::string const &  current_process_name)
inherited

Definition at line 49 of file ModuleBase.cc.

References art::ModuleBase::collector_, and art::ConsumesCollector::sortConsumables().

50  {
51  // Now that we know we have seen all the consumes declarations,
52  // sort the results for fast lookup later.
53  collector_.sortConsumables(current_process_name);
54  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
void sortConsumables(std::string const &current_process_name)
bool art::Observer::wantAllEvents ( ) const
inlineprotectednoexceptinherited

Definition at line 31 of file Observer.h.

References e, art::Observer::getTriggerResults(), art::Observer::wantAllEvents_, and art::Observer::wantEvent().

32  {
33  return wantAllEvents_;
34  }
bool wantAllEvents_
Definition: Observer.h:75
bool art::Observer::wantEvent ( ScheduleID  id,
Event const &  e 
) const
protectedinherited

Definition at line 63 of file Observer.cc.

References art::Observer::rejectors_, art::Observer::selectors_, and art::Observer::wantAllEvents_.

Referenced by art::OutputModule::doEvent(), art::OutputModule::doWriteEvent(), and art::Observer::wantAllEvents().

64  {
65  if (wantAllEvents_) {
66  return true;
67  }
68  bool const select_event = selectors_ ? selectors_->matchEvent(id, e) : true;
69  bool const reject_event =
70  rejectors_ ? rejectors_->matchEvent(id, e) : false;
71  return select_event and not reject_event;
72  }
bool wantAllEvents_
Definition: Observer.h:75
std::optional< detail::ProcessAndEventSelectors > rejectors_
Definition: Observer.h:80
Float_t e
Definition: plot.C:35
std::optional< detail::ProcessAndEventSelectors > selectors_
Definition: Observer.h:79

Member Data Documentation

TH1D* hit::MagDriftAna::fChargeXpos {nullptr}
private

Definition at line 70 of file MagDriftAna_module.cc.

Referenced by analyze(), and ensureHists().

TH1D* hit::MagDriftAna::fChargeYpos {nullptr}
private

Definition at line 71 of file MagDriftAna_module.cc.

Referenced by analyze(), and ensureHists().

TH1D* hit::MagDriftAna::fChargeZpos {nullptr}
private

Definition at line 72 of file MagDriftAna_module.cc.

Referenced by analyze(), and ensureHists().

TH1D* hit::MagDriftAna::fDeltaZoverX {nullptr}
private

Definition at line 77 of file MagDriftAna_module.cc.

Referenced by analyze(), endJob(), and ensureHists().

TH1D* hit::MagDriftAna::fDeltaZoverXAway {nullptr}
private

Definition at line 83 of file MagDriftAna_module.cc.

Referenced by analyze(), endJob(), and ensureHists().

TH2D* hit::MagDriftAna::fDeltaZvsX {nullptr}
private

Definition at line 78 of file MagDriftAna_module.cc.

Referenced by analyze(), and ensureHists().

double hit::MagDriftAna::fDirCosY {0.}
private

Definition at line 67 of file MagDriftAna_module.cc.

Referenced by ensureHists().

double hit::MagDriftAna::fDirCosZ {0.}
private

Definition at line 68 of file MagDriftAna_module.cc.

Referenced by endJob(), and ensureHists().

TH1D* hit::MagDriftAna::fDriftDeltaZ {nullptr}
private

Definition at line 76 of file MagDriftAna_module.cc.

Referenced by analyze(), and ensureHists().

TH1D* hit::MagDriftAna::fDriftDeltaZAway {nullptr}
private

Definition at line 82 of file MagDriftAna_module.cc.

Referenced by analyze(), and ensureHists().

std::string hit::MagDriftAna::fFFTHitFinderModuleLabel
private

Definition at line 58 of file MagDriftAna_module.cc.

Referenced by analyze().

TH1D* hit::MagDriftAna::fHitZpos {nullptr}
private

Definition at line 73 of file MagDriftAna_module.cc.

Referenced by analyze(), and ensureHists().

std::string hit::MagDriftAna::fLArG4ModuleLabel
private

Definition at line 59 of file MagDriftAna_module.cc.

Referenced by MagDriftAna().

bool hit::MagDriftAna::initDone {false}
private

Definition at line 64 of file MagDriftAna_module.cc.

Referenced by ensureHists().


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