LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
trkf::SpacePointAna Class Reference
Inheritance diagram for trkf::SpacePointAna:
art::EDAnalyzer art::EventObserverBase art::Consumer art::EngineCreator

Public Types

using WorkerType = WorkerT< EDAnalyzer >
 
using ModuleType = EDAnalyzer
 

Public Member Functions

 SpacePointAna (fhicl::ParameterSet const &pset)
 
virtual ~SpacePointAna ()
 
void bookHistograms (bool mc)
 
void analyze (const art::Event &evt)
 
std::string workerType () const
 
bool modifiesEvent () const
 
void registerProducts (MasterProductRegistry &, ProductDescriptions &, ModuleDescription const &)
 
std::string const & processName () const
 
bool wantAllEvents () const
 
bool wantEvent (Event const &e)
 
fhicl::ParameterSetID selectorConfig () const
 
art::Handle< art::TriggerResultsgetTriggerResults (Event const &e) const
 
template<typename T , BranchType = InEvent>
ProductToken< T > consumes (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ProductToken< T > consumes (InputTag const &it)
 
template<typename T , BranchType = InEvent>
void consumesMany ()
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > consumesView (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ViewToken< T > consumesView (InputTag const &it)
 
template<typename T , BranchType = InEvent>
ProductToken< T > mayConsume (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ProductToken< T > mayConsume (InputTag const &it)
 
template<typename T , BranchType = InEvent>
void mayConsumeMany ()
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > mayConsumeView (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ViewToken< T > mayConsumeView (InputTag const &it)
 
base_engine_tcreateEngine (seed_t seed)
 
base_engine_tcreateEngine (seed_t seed, std::string const &kind_of_engine_to_make)
 
base_engine_tcreateEngine (seed_t seed, std::string const &kind_of_engine_to_make, label_t const &engine_label)
 
seed_t get_seed_value (fhicl::ParameterSet const &pset, char const key[]="seed", seed_t const implicit_seed=-1)
 

Static Public Member Functions

static cet::exempt_ptr< Consumernon_module_context ()
 

Protected Member Functions

CurrentProcessingContext const * currentContext () const
 
detail::CachedProducts & cachedProducts ()
 
void validateConsumedProduct (BranchType const bt, ProductInfo const &pi)
 
void prepareForJob (fhicl::ParameterSet const &pset)
 
void showMissingConsumes () const
 

Private Attributes

const SpacePointAlg fSptalgTime
 
const SpacePointAlg fSptalgSep
 
const SpacePointAlg fSptalgDefault
 
std::string fHitModuleLabel
 
bool fUseClusterHits
 
std::string fClusterModuleLabel
 
bool fUseMC
 
bool fBooked
 
TH1F * fHDTUE
 
TH1F * fHDTVE
 
TH1F * fHDTWE
 
TH1F * fHDTUPull
 
TH1F * fHDTVPull
 
TH1F * fHDTWPull
 
TH1F * fHDTUV
 
TH1F * fHDTVW
 
TH1F * fHDTWU
 
TH1F * fHS
 
TH1F * fHchisq
 
TH1F * fHx
 
TH1F * fHy
 
TH1F * fHz
 
TH1F * fHAmpU
 
TH1F * fHAmpV
 
TH1F * fHAmpW
 
TH1F * fHAreaU
 
TH1F * fHAreaV
 
TH1F * fHAreaW
 
TH1F * fHSumU
 
TH1F * fHSumV
 
TH1F * fHSumW
 
TH1F * fHMCdx
 
TH1F * fHMCdy
 
TH1F * fHMCdz
 
TH1F * fHMCxpull
 
TH1F * fHMCypull
 
TH1F * fHMCzpull
 
int fNumEvent
 

Detailed Description

Definition at line 50 of file SpacePointAna_module.cc.

Member Typedef Documentation

Definition at line 39 of file EDAnalyzer.h.

Definition at line 38 of file EDAnalyzer.h.

Constructor & Destructor Documentation

trkf::SpacePointAna::SpacePointAna ( fhicl::ParameterSet const &  pset)
explicit

Definition at line 119 of file SpacePointAna_module.cc.

References fClusterModuleLabel, fHitModuleLabel, fUseClusterHits, and fUseMC.

125  : EDAnalyzer(pset)
126  , fSptalgTime(pset.get<fhicl::ParameterSet>("SpacePointAlgTime"))
127  , fSptalgSep(pset.get<fhicl::ParameterSet>("SpacePointAlgSep"))
128  , fSptalgDefault(pset.get<fhicl::ParameterSet>("SpacePointAlgDefault"))
129  , fHitModuleLabel(pset.get<std::string>("HitModuleLabel"))
130  , fUseClusterHits(pset.get<bool>("UseClusterHits"))
131  , fClusterModuleLabel(pset.get<std::string>("ClusterModuleLabel"))
132  , fUseMC(pset.get<bool>("UseMC"))
133  , fBooked(false)
134  , fHDTUE(0)
135  , fHDTVE(0)
136  , fHDTWE(0)
137  , fHDTUPull(0)
138  , fHDTVPull(0)
139  , fHDTWPull(0)
140  , fHDTUV(0)
141  , fHDTVW(0)
142  , fHDTWU(0)
143  , fHS(0)
144  , fHchisq(0)
145  , fHx(0)
146  , fHy(0)
147  , fHz(0)
148  , fHAmpU(0)
149  , fHAmpV(0)
150  , fHAmpW(0)
151  , fHAreaU(0)
152  , fHAreaV(0)
153  , fHAreaW(0)
154  , fHSumU(0)
155  , fHSumV(0)
156  , fHSumW(0)
157  , fHMCdx(0)
158  , fHMCdy(0)
159  , fHMCdz(0)
160  , fHMCxpull(0)
161  , fHMCypull(0)
162  , fHMCzpull(0)
163  , fNumEvent(0)
164  {
165 
166  // Report.
167 
168  mf::LogInfo("SpacePointAna")
169  << "SpacePointAna configured with the following parameters:\n"
170  << " HitModuleLabel = " << fHitModuleLabel << "\n"
171  << " UseClusterHits = " << fUseClusterHits << "\n"
172  << " ClusterModuleLabel = " << fClusterModuleLabel << "\n"
173  << " UseMC = " << fUseMC;
174  }
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
const SpacePointAlg fSptalgSep
EDAnalyzer(Table< Config > const &config)
Definition: EDAnalyzer.h:100
const SpacePointAlg fSptalgTime
const SpacePointAlg fSptalgDefault
trkf::SpacePointAna::~SpacePointAna ( )
virtual

Definition at line 176 of file SpacePointAna_module.cc.

180  {}

Member Function Documentation

void trkf::SpacePointAna::analyze ( const art::Event evt)

Definition at line 236 of file SpacePointAna_module.cc.

References art::PtrVector< T >::begin(), bookHistograms(), recob::SpacePoint::Chisq(), detinfo::DetectorProperties::ConvertXToTicks(), trkf::SpacePointAlg::correctedTime(), art::PtrVector< T >::end(), recob::SpacePoint::ErrXYZ(), fClusterModuleLabel, fHAmpU, fHAmpV, fHAmpW, fHAreaU, fHAreaV, fHAreaW, fHchisq, fHDTUE, fHDTUPull, fHDTUV, fHDTVE, fHDTVPull, fHDTVW, fHDTWE, fHDTWPull, fHDTWU, fHitModuleLabel, fHMCdx, fHMCdy, fHMCdz, fHMCxpull, fHMCypull, fHMCzpull, fHS, fHSumU, fHSumV, fHSumW, fHx, fHy, fHz, fNumEvent, fSptalgDefault, fSptalgSep, fSptalgTime, fUseClusterHits, fUseMC, trkf::SpacePointAlg::getAssociatedHits(), art::DataViewImpl::getByLabel(), hits(), cheat::BackTrackerService::HitToXYZ(), recob::Hit::Integral(), art::Event::isRealData(), art::Handle< T >::isValid(), geo::kU, geo::kV, geo::kZ, LOG_DEBUG, trkf::SpacePointAlg::makeMCTruthSpacePoints(), trkf::SpacePointAlg::makeSpacePoints(), trkf::SpacePointAlg::merge(), recob::Hit::PeakAmplitude(), recob::Hit::PeakTime(), geo::PlaneID::Plane, trkf::SpacePointAlg::separation(), recob::Hit::SigmaPeakTime(), cheat::BackTrackerService::SpacePointHitsToWeightedXYZ(), recob::Hit::SummedADC(), t1, t2, geo::TPCID::TPC, lar::dump::vector(), recob::Hit::View(), recob::Hit::WireID(), x, and recob::SpacePoint::XYZ().

242  {
243  ++fNumEvent;
244 
245  // Make sure histograms are booked.
246 
247  bool mc = !evt.isRealData();
248  bookHistograms(mc);
249 
250  // Get Services.
251 
253  const detinfo::DetectorProperties* detprop = lar::providerFrom<detinfo::DetectorPropertiesService>();
254 
255  // Get Hits.
256 
258 
259  if(fUseClusterHits) {
260 
261  // Get clusters.
262 
264  evt.getByLabel(fClusterModuleLabel, clusterh);
265 
266  // Get hits from all clusters.
268 
269  if(clusterh.isValid()) {
270  int nclus = clusterh->size();
271 
272  for(int i = 0; i < nclus; ++i) {
273  art::Ptr<recob::Cluster> pclus(clusterh, i);
274  std::vector< art::Ptr<recob::Hit> > clushits = fm.at(i);
275  int nhits = clushits.size();
276  hits.reserve(hits.size() + nhits);
277 
278  for(std::vector< art::Ptr<recob::Hit> >::const_iterator ihit = clushits.begin(); ihit != clushits.end(); ++ihit) {
279  hits.push_back(*ihit);
280  }
281  }
282  }
283  }
284  else {
285 
286  // Get unclustered hits.
287 
289  evt.getByLabel(fHitModuleLabel, hith);
290  if(hith.isValid()) {
291  int nhits = hith->size();
292  hits.reserve(nhits);
293 
294  for(int i = 0; i < nhits; ++i)
295  hits.push_back(art::Ptr<recob::Hit>(hith, i));
296  }
297  }
298 
299  // Fill histograms that don't depend on space points.
300 
301  if(mc && fUseMC) {
302 
304 
305  // Loop over hits and fill hit-electron time difference histogram.
306 
307  for(art::PtrVector<recob::Hit>::const_iterator ihit = hits.begin();
308  ihit != hits.end(); ++ihit) {
309  const recob::Hit& hit = **ihit;
310 
311  //unsigned int channel = hit.Channel();
312  //geo::View_t geo_view = geom->View(channel);
313  //geo::View_t hit_view = hit.View();
314  //assert(geo_view == hit_view);
315  double tpeak = hit.PeakTime();
316  double terr = hit.SigmaPeakTime();
317 
318  //assert(channel == hit.Channel());
319 
320  // Loop over electrons associated with this hit/channel and fill
321  // hit-electron time difference histograms.
322 
323  // loop over the map of TDC to sim::IDE to get the TDC for each energy dep
324  // Find the average time in ticks for this hit.
325 
326  //double sumw = 0.;
327  //double sumt = 0.;
328 
329  //const std::map<unsigned short, std::vector<sim::IDE> > &idemap = simchan.TDCIDEMap();
330  //std::map<unsigned short, std::vector<sim::IDE> >::const_iterator mitr = idemap.begin();
331  //for(mitr = idemap.begin(); mitr != idemap.end(); mitr++) {
332  // double tdc = double((*mitr).first);
333  // if(tdc >= tstart && tdc <= tend) {
334  // const std::vector<sim::IDE>& idevec = (*mitr).second;
335  // for(std::vector<sim::IDE>::const_iterator iide=idevec.begin();
336  // iide != idevec.end(); ++iide) {
337  // const sim::IDE& ide = *iide;
338  // double w = ide.numElectrons;
339  // sumw += w;
340  // sumt += w*tdc;
341  // }
342  // }
343  //}
344  //double tav = 0.;
345  //if(sumw != 0.)
346  // tav = sumt / sumw;
347 
348  bool tav_ok = true;
349  double tav = 0.;
350  try {
351  std::vector<double> hitxyz = bt_serv->HitToXYZ(*ihit);
352  tav = detprop->ConvertXToTicks(hitxyz[0], (*ihit)->WireID().Plane, (*ihit)->WireID().TPC, (*ihit)->WireID().Cryostat);
353  }
354  catch(cet::exception& x) {
355  tav_ok = false;
356  }
357  if(tav_ok) {
358  if((*ihit)->View() == geo::kU) {
359  fHDTUE->Fill(tpeak - tav);
360  fHDTUPull->Fill((tpeak - tav) / terr);
361  }
362  else if((*ihit)->View() == geo::kV) {
363  fHDTVE->Fill(tpeak - tav);
364  fHDTVPull->Fill((tpeak - tav) / terr);
365  }
366  else if((*ihit)->View() == geo::kZ) {
367  fHDTWE->Fill(tpeak - tav);
368  fHDTWPull->Fill((tpeak - tav) / terr);
369  }
370  else
371  throw cet::exception("SpacePointAna") << "Bad view = " << (*ihit)->View() << "\n";
372  }
373  }
374  }
375 
376  std::vector<recob::SpacePoint> spts1; // For time histograms.
377  std::vector<recob::SpacePoint> spts2; // For separation histogram.
378  std::vector<recob::SpacePoint> spts3; // Default cuts.
379 
380  // If nonzero time cut is specified, make space points using that
381  // time cut (for time histograms).
382 
383  if(!fSptalgTime.merge()) {
384  if(mc && fUseMC)
385  fSptalgTime.makeMCTruthSpacePoints(hits, spts1);
386  else
387  fSptalgTime.makeSpacePoints(hits, spts1);
388 
389  // Report number of space points.
390 
391  LOG_DEBUG("SpacePointAna") << "Found " << spts1.size()
392  << " space points using special time cut.";
393  }
394 
395  // If nonzero separation cut is specified, make space points using that
396  // separation cut (for separation histogram).
397 
398  if(!fSptalgSep.merge()) {
399  if(mc && fUseMC)
400  fSptalgSep.makeMCTruthSpacePoints(hits, spts2);
401  else
402  fSptalgSep.makeSpacePoints(hits, spts2);
403 
404  // Report number of space points.
405 
406  LOG_DEBUG("SpacePointAna") << "Found " << spts2.size()
407  << " space points using special seperation cut.";
408  }
409 
410  // Make space points using default cuts.
411 
412  if(mc && fUseMC)
414  else
415  fSptalgDefault.makeSpacePoints(hits, spts3);
416 
417  // Report number of space points.
418 
419  LOG_DEBUG("SpacePointAna") << "Found " << spts3.size()
420  << " space points using default cuts.";
421 
422  if(!fSptalgTime.merge()) {
423 
424  // Loop over space points and fill time histograms.
425 
426  for(std::vector<recob::SpacePoint>::const_iterator i = spts1.begin();
427  i != spts1.end(); ++i) {
428  const recob::SpacePoint& spt = *i;
429 
430  // Get hits associated with this SpacePoint.
431 
433 
434  // Make a double loop over hits and fill hit time difference histograms.
435 
437  ihit != spthits.end(); ++ihit) {
438  const recob::Hit& hit1 = **ihit;
439 
440  geo::WireID hit1WireID = hit1.WireID();
441  unsigned int tpc1, plane1;
442  tpc1 = hit1WireID.TPC;
443  plane1 = hit1WireID.Plane;
444 
445  geo::View_t view1 = hit1.View();
446  double t1 = fSptalgTime.correctedTime(hit1);
447 
449  jhit != spthits.end(); ++jhit) {
450  const recob::Hit& hit2 = **jhit;
451 
452  geo::WireID hit2WireID = hit2.WireID();
453  unsigned int tpc2, plane2;
454  tpc2 = hit2WireID.TPC;
455  plane2 = hit2WireID.Plane;
456 
457  // Require same tpc, different view.
458 
459  if(tpc1 == tpc2 && plane1 != plane2) {
460 
461  geo::View_t view2 = hit2.View();
462  double t2 = fSptalgTime.correctedTime(hit2);
463 
464  if(view1 == geo::kU) {
465  if(view2 == geo::kV)
466  fHDTUV->Fill(t1-t2);
467  if(view2 == geo::kZ)
468  fHDTWU->Fill(t2-t1);
469  }
470  if(view1 == geo::kV) {
471  if(view2 == geo::kZ)
472  fHDTVW->Fill(t1-t2);
473  if(view2 == geo::kU)
474  fHDTUV->Fill(t2-t1);
475  }
476  if(view1 == geo::kZ) {
477  if(view2 == geo::kU)
478  fHDTWU->Fill(t1-t2);
479  if(view2 == geo::kV)
480  fHDTVW->Fill(t2-t1);
481  }
482  }
483  }
484  }
485  }
486 
487  // Loop over space points and fill seperation histograms.
488 
489  for(std::vector<recob::SpacePoint>::const_iterator i = spts2.begin();
490  i != spts2.end(); ++i) {
491  const recob::SpacePoint& spt = *i;
492 
493  // Get hits associated with this SpacePoint.
494 
496 
497  // Fill separation histogram.
498 
499  double sep = fSptalgSep.separation(spthits);
500  fHS->Fill(sep);
501  }
502  }
503 
504  // Loop over default space points and fill histograms.
505 
507  i != spts3.end(); ++i) {
508  const recob::SpacePoint& spt = *i;
509 
510  fHchisq->Fill(spt.Chisq());
511  fHx->Fill(spt.XYZ()[0]);
512  fHy->Fill(spt.XYZ()[1]);
513  fHz->Fill(spt.XYZ()[2]);
514 
515  // Get hits associated with this SpacePoint.
516 
517  std::vector<art::Ptr<recob::Hit> > spthits;
519  for( auto const& ptr : av_spthits ){ spthits.push_back(ptr);}
520 
521  // Fill single hit histograms.
522 
523  for(art::PtrVector<recob::Hit>::const_iterator ihit = spthits.begin();
524  ihit != spthits.end(); ++ihit) {
525  const recob::Hit& hit = **ihit;
526 
527  geo::View_t view = hit.View();
528 
529  if(view == geo::kU) {
530  fHAmpU->Fill(hit.PeakAmplitude());
531  fHAreaU->Fill(hit.Integral());
532  fHSumU->Fill(hit.SummedADC());
533  }
534  if(view == geo::kV) {
535  fHAmpV->Fill(hit.PeakAmplitude());
536  fHAreaV->Fill(hit.Integral());
537  fHSumV->Fill(hit.SummedADC());
538  }
539  if(view == geo::kZ) {
540  fHAmpW->Fill(hit.PeakAmplitude());
541  fHAreaW->Fill(hit.Integral());
542  fHSumW->Fill(hit.SummedADC());
543  }
544  }
545 
546  if(mc && fUseMC) {
547 
549 
550  try {
551  std::vector<double> mcxyz = bt_serv->SpacePointHitsToWeightedXYZ(spthits);
552  fHMCdx->Fill(spt.XYZ()[0] - mcxyz[0]);
553  fHMCdy->Fill(spt.XYZ()[1] - mcxyz[1]);
554  fHMCdz->Fill(spt.XYZ()[2] - mcxyz[2]);
555  if(spt.ErrXYZ()[0] > 0.)
556  fHMCxpull->Fill((spt.XYZ()[0] - mcxyz[0]) / std::sqrt(spt.ErrXYZ()[0]));
557  if(spt.ErrXYZ()[2] > 0.)
558  fHMCypull->Fill((spt.XYZ()[1] - mcxyz[1]) / std::sqrt(spt.ErrXYZ()[2]));
559  if(spt.ErrXYZ()[5] > 0.)
560  fHMCzpull->Fill((spt.XYZ()[2] - mcxyz[2]) / std::sqrt(spt.ErrXYZ()[5]));
561  }
562  catch(cet::exception& x) {}
563  }
564  }
565  }
Float_t x
Definition: compare.C:6
double correctedTime(const recob::Hit &hit) const
TTree * t1
Definition: plottest35.C:26
const std::vector< double > HitToXYZ(const recob::Hit &hit)
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
Planes which measure V.
Definition: geo_types.h:77
geo::WireID WireID() const
Initial tdc tick for hit.
Definition: Hit.h:234
iterator begin()
Definition: PtrVector.h:223
Planes which measure Z direction.
Definition: geo_types.h:79
float Integral() const
Integral under the calibrated signal waveform of the hit, in tick x ADC units.
Definition: Hit.h:225
geo::View_t View() const
View for the plane of the hit.
Definition: Hit.h:233
bool isRealData() const
Definition: Event.h:83
const art::PtrVector< recob::Hit > & getAssociatedHits(const recob::SpacePoint &spt) const
const SpacePointAlg fSptalgSep
void makeMCTruthSpacePoints(const art::PtrVector< recob::Hit > &hits, std::vector< recob::SpacePoint > &spts) const
virtual double ConvertXToTicks(double X, int p, int t, int c) const =0
float PeakAmplitude() const
The estimated amplitude of the hit at its peak, in ADC units.
Definition: Hit.h:222
double separation(const art::PtrVector< recob::Hit > &hits) const
bool isValid() const
Definition: Handle.h:190
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
Definition: DumpUtils.h:265
Planes which measure U.
Definition: geo_types.h:76
void hits()
Definition: readHits.C:15
intermediate_table::const_iterator const_iterator
iterator end()
Definition: PtrVector.h:237
PlaneID_t Plane
Index of the plane within its TPC.
Definition: geo_types.h:258
const std::vector< double > SpacePointHitsToWeightedXYZ(std::vector< art::Ptr< recob::Hit >> const &hits)
Detector simulation of raw signals on wires.
TTree * t2
Definition: plottest35.C:36
const double * ErrXYZ() const
Definition: SpacePoint.h:65
data_t::const_iterator const_iterator
Definition: PtrVector.h:61
void makeSpacePoints(const art::PtrVector< recob::Hit > &hits, std::vector< recob::SpacePoint > &spts) const
float PeakTime() const
Time of the signal peak, in tick units.
Definition: Hit.h:219
double Chisq() const
Definition: SpacePoint.h:66
const double * XYZ() const
Definition: SpacePoint.h:64
const SpacePointAlg fSptalgTime
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
Definition: DataViewImpl.h:344
#define LOG_DEBUG(id)
float SummedADC() const
The sum of calibrated ADC counts of the hit (0. by default)
Definition: Hit.h:224
const SpacePointAlg fSptalgDefault
float SigmaPeakTime() const
Uncertainty for the signal peak, in tick units.
Definition: Hit.h:220
bool merge() const
Definition: SpacePointAlg.h:89
2D representation of charge deposited in the TDC/wire plane
Definition: Hit.h:49
TPCID_t TPC
Index of the TPC within its cryostat.
Definition: geo_types.h:203
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
void trkf::SpacePointAna::bookHistograms ( bool  mc)

Definition at line 182 of file SpacePointAna_module.cc.

References geo::GeometryCore::DetHalfHeight(), geo::GeometryCore::DetHalfWidth(), geo::GeometryCore::DetLength(), dir, fBooked, fHAmpU, fHAmpV, fHAmpW, fHAreaU, fHAreaV, fHAreaW, fHchisq, fHDTUE, fHDTUPull, fHDTUV, fHDTVE, fHDTVPull, fHDTVW, fHDTWE, fHDTWPull, fHDTWU, fHMCdx, fHMCdy, fHMCdz, fHMCxpull, fHMCypull, fHMCzpull, fHS, fHSumU, fHSumV, fHSumW, fHx, fHy, fHz, fSptalgTime, fUseMC, art::TFileDirectory::make(), trkf::SpacePointAlg::merge(), and art::TFileDirectory::mkdir().

Referenced by analyze().

186  {
187  if(!fBooked) {
188  fBooked = true;
189 
192  art::TFileDirectory dir = tfs->mkdir("sptana", "SpacePointAna histograms");
193 
194  if(mc && fUseMC) {
195  fHDTUE = dir.make<TH1F>("MCDTUE", "U-Drift Electrons Time Difference", 100, -5., 5.);
196  fHDTVE = dir.make<TH1F>("MCDTVE", "V-Drift Electrons Time Difference", 100, -5., 5.);
197  fHDTWE = dir.make<TH1F>("MCDTWE", "W-Drift Electrons Time Difference", 100, -5., 5.);
198  fHDTUPull = dir.make<TH1F>("MCDTUPull", "U-Drift Electrons Time Pull", 100, -50., 50.);
199  fHDTVPull = dir.make<TH1F>("MCDTVPull", "V-Drift Electrons Time Pull", 100, -50., 50.);
200  fHDTWPull = dir.make<TH1F>("MCDTWPull", "W-Drift Electrons Time Pull", 100, -50., 50.);
201  }
202  if(!fSptalgTime.merge()) {
203  fHDTUV = dir.make<TH1F>("DTUV", "U-V time difference", 100, -20., 20.);
204  fHDTVW = dir.make<TH1F>("DTVW", "V-W time difference", 100, -20., 20.);
205  fHDTWU = dir.make<TH1F>("DTWU", "W-U time difference", 100, -20., 20.);
206  fHS = dir.make<TH1F>("DS", "Spatial Separation", 100, -2., 2.);
207  }
208  fHchisq = dir.make<TH1F>("chisq", "Chisquare", 100, 0., 20.);
209 
210  fHx = dir.make<TH1F>("xpos", "X Position",
211  100, 0., 2.*geom->DetHalfWidth());
212  fHy = dir.make<TH1F>("ypos", "Y Position",
213  100, -geom->DetHalfHeight(), geom->DetHalfHeight());
214  fHz = dir.make<TH1F>("zpos", "Z Position",
215  100, 0., geom->DetLength());
216  fHAmpU = dir.make<TH1F>("ampU", "U Hit Amplitude", 50, 0., 50.);
217  fHAmpV = dir.make<TH1F>("ampV", "V Hit Amplitude", 50, 0., 50.);
218  fHAmpW = dir.make<TH1F>("ampW", "W Hit Amplitude", 50, 0., 50.);
219  fHAreaU = dir.make<TH1F>("areaU", "U Hit Area", 100, 0., 500.);
220  fHAreaV = dir.make<TH1F>("areaV", "V Hit Area", 100, 0., 500.);
221  fHAreaW = dir.make<TH1F>("areaW", "W Hit Area", 100, 0., 500.);
222  fHSumU = dir.make<TH1F>("sumU", "U Hit Sum ADC", 100, 0., 500.);
223  fHSumV = dir.make<TH1F>("sumV", "V Hit Sum ADC", 100, 0., 500.);
224  fHSumW = dir.make<TH1F>("sumW", "W Hit Sum ADC", 100, 0., 500.);
225  if(mc && fUseMC) {
226  fHMCdx = dir.make<TH1F>("MCdx", "X MC Residual", 100, -1., 1.);
227  fHMCdy = dir.make<TH1F>("MCdy", "Y MC Residual", 100, -1., 1.);
228  fHMCdz = dir.make<TH1F>("MCdz", "Z MC Residual", 100, -1., 1.);
229  fHMCxpull = dir.make<TH1F>("MCxpull", "X MC Pull", 100, -50., 50.);
230  fHMCypull = dir.make<TH1F>("MCypull", "Y MC Pull", 100, -50., 50.);
231  fHMCzpull = dir.make<TH1F>("MCzpull", "Z MC Pull", 100, -50., 50.);
232  }
233  }
234  }
TFileDirectory mkdir(std::string const &dir, std::string const &descr="")
T * make(ARGS...args) const
const SpacePointAlg fSptalgTime
TDirectory * dir
Definition: macro.C:5
bool merge() const
Definition: SpacePointAlg.h:89
detail::CachedProducts& art::EventObserverBase::cachedProducts ( )
inlineprotectedinherited

Definition at line 79 of file EventObserverBase.h.

References art::EventObserverBase::selectors_.

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

80  {
81  return selectors_;
82  }
detail::CachedProducts selectors_
template<typename T , BranchType = InEvent>
ProductToken<T> art::Consumer::consumes ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ProductToken<T> art::Consumer::consumes ( InputTag const &  it)
inherited

Definition at line 147 of file Consumer.h.

References art::InputTag::instance(), art::InputTag::label(), and art::InputTag::process().

148 {
149  if (!moduleContext_)
150  return ProductToken<T>::invalid();
151 
152  consumables_[BT].emplace_back(ConsumableType::Product,
153  TypeID{typeid(T)},
154  it.label(),
155  it.instance(),
156  it.process());
157  return ProductToken<T>{it};
158 }
static ProductToken< T > invalid()
Definition: ProductToken.h:47
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
template<typename T , art::BranchType BT>
void art::Consumer::consumesMany ( )
inherited

Definition at line 162 of file Consumer.h.

163 {
164  if (!moduleContext_)
165  return;
166 
167  consumables_[BT].emplace_back(ConsumableType::Many, TypeID{typeid(T)});
168 }
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::Consumer::consumesView ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ViewToken<T> art::Consumer::consumesView ( InputTag const &  it)
inherited

Definition at line 172 of file Consumer.h.

References art::InputTag::instance(), art::InputTag::label(), and art::InputTag::process().

173 {
174  if (!moduleContext_)
175  return ViewToken<T>::invalid();
176 
177  consumables_[BT].emplace_back(ConsumableType::ViewElement,
178  TypeID{typeid(T)},
179  it.label(),
180  it.instance(),
181  it.process());
182  return ViewToken<T>{it};
183 }
static ViewToken< Element > invalid()
Definition: ProductToken.h:75
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
EngineCreator::base_engine_t & EngineCreator::createEngine ( seed_t  seed,
std::string const &  kind_of_engine_to_make 
)
inherited

Definition at line 32 of file EngineCreator.cc.

References art::EngineCreator::rng().

34 {
35  return rng()->createEngine(
36  placeholder_schedule_id(), seed, kind_of_engine_to_make);
37 }
long seed
Definition: chem4.cc:68
static art::ServiceHandle< art::RandomNumberGenerator > & rng()
EngineCreator::base_engine_t & EngineCreator::createEngine ( seed_t  seed,
std::string const &  kind_of_engine_to_make,
label_t const &  engine_label 
)
inherited

Definition at line 40 of file EngineCreator.cc.

References art::EngineCreator::rng().

43 {
44  return rng()->createEngine(
45  placeholder_schedule_id(), seed, kind_of_engine_to_make, engine_label);
46 }
long seed
Definition: chem4.cc:68
static art::ServiceHandle< art::RandomNumberGenerator > & rng()
CurrentProcessingContext const * art::EDAnalyzer::currentContext ( ) const
protectedinherited

Definition at line 114 of file EDAnalyzer.cc.

References art::EDAnalyzer::current_context_.

Referenced by art::EDAnalyzer::workerType().

115  {
116  return current_context_.get();
117  }
CPC_exempt_ptr current_context_
Definition: EDAnalyzer.h:179
EngineCreator::seed_t EngineCreator::get_seed_value ( fhicl::ParameterSet const &  pset,
char const  key[] = "seed",
seed_t const  implicit_seed = -1 
)
inherited

Definition at line 49 of file EngineCreator.cc.

References fhicl::ParameterSet::get().

Referenced by art::MixFilter< T >::initEngine_().

52 {
53  auto const& explicit_seeds = pset.get<std::vector<int>>(key, {});
54  return explicit_seeds.empty() ? implicit_seed : explicit_seeds.front();
55 }
art::Handle<art::TriggerResults> art::EventObserverBase::getTriggerResults ( Event const &  e) const
inlineinherited

Definition at line 61 of file EventObserverBase.h.

References art::detail::CachedProducts::getOneTriggerResults(), and art::EventObserverBase::selectors_.

Referenced by art::OutputModule::doWriteEvent().

62  {
64  }
detail::CachedProducts selectors_
art::Handle< art::TriggerResults > getOneTriggerResults(Event const &) const
Float_t e
Definition: plot.C:34
template<typename T , BranchType = InEvent>
ProductToken<T> art::Consumer::mayConsume ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ProductToken<T> art::Consumer::mayConsume ( InputTag const &  it)
inherited

Definition at line 190 of file Consumer.h.

References art::InputTag::instance(), art::InputTag::label(), and art::InputTag::process().

191 {
192  if (!moduleContext_)
193  return ProductToken<T>::invalid();
194 
195  consumables_[BT].emplace_back(ConsumableType::Product,
196  TypeID{typeid(T)},
197  it.label(),
198  it.instance(),
199  it.process());
200  return ProductToken<T>{it};
201 }
static ProductToken< T > invalid()
Definition: ProductToken.h:47
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
template<typename T , art::BranchType BT>
void art::Consumer::mayConsumeMany ( )
inherited

Definition at line 205 of file Consumer.h.

206 {
207  if (!moduleContext_)
208  return;
209 
210  consumables_[BT].emplace_back(ConsumableType::Many, TypeID{typeid(T)});
211 }
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::Consumer::mayConsumeView ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ViewToken<T> art::Consumer::mayConsumeView ( InputTag const &  it)
inherited

Definition at line 215 of file Consumer.h.

References art::InputTag::instance(), art::InputTag::label(), and art::InputTag::process().

216 {
217  if (!moduleContext_)
218  return ViewToken<T>::invalid();
219 
220  consumables_[BT].emplace_back(ConsumableType::ViewElement,
221  TypeID{typeid(T)},
222  it.label(),
223  it.instance(),
224  it.process());
225  return ViewToken<T>{it};
226 }
static ViewToken< Element > invalid()
Definition: ProductToken.h:75
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
bool art::EventObserverBase::modifiesEvent ( ) const
inlineinherited

Definition at line 25 of file EventObserverBase.h.

26  {
27  return false;
28  }
void art::Consumer::prepareForJob ( fhicl::ParameterSet const &  pset)
protectedinherited

Definition at line 89 of file Consumer.cc.

References fhicl::ParameterSet::get_if_present().

Referenced by art::EDProducer::doBeginJob(), art::EDFilter::doBeginJob(), and art::EDAnalyzer::doBeginJob().

90 {
91  if (!moduleContext_)
92  return;
93 
94  pset.get_if_present("errorOnMissingConsumes", requireConsumes_);
95  for (auto& consumablesPerBranch : consumables_) {
96  cet::sort_all(consumablesPerBranch);
97  }
98 }
bool requireConsumes_
Definition: Consumer.h:137
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
std::string const& art::EventObserverBase::processName ( ) const
inlineinherited
void art::EventObserverBase::registerProducts ( MasterProductRegistry ,
ProductDescriptions ,
ModuleDescription const &   
)
inlineinherited

Definition at line 33 of file EventObserverBase.h.

36  {}
fhicl::ParameterSetID art::EventObserverBase::selectorConfig ( ) const
inlineinherited

Definition at line 56 of file EventObserverBase.h.

References art::EventObserverBase::selector_config_id_.

Referenced by art::RootOutputFile::writeOne().

57  {
58  return selector_config_id_;
59  }
fhicl::ParameterSetID selector_config_id_
void art::Consumer::showMissingConsumes ( ) const
protectedinherited

Definition at line 125 of file Consumer.cc.

Referenced by art::EDProducer::doEndJob(), art::EDFilter::doEndJob(), art::EDAnalyzer::doEndJob(), and art::RootOutput::endJob().

126 {
127  if (!moduleContext_)
128  return;
129 
130  // If none of the branches have missing consumes statements, exit early.
131  if (std::all_of(cbegin(missingConsumes_),
132  cend(missingConsumes_),
133  [](auto const& perBranch) { return perBranch.empty(); }))
134  return;
135 
136  constexpr cet::HorizontalRule rule{60};
137  mf::LogPrint log{"MTdiagnostics"};
138  log << '\n'
139  << rule('=') << '\n'
140  << "The following consumes (or mayConsume) statements are missing from\n"
141  << module_context(moduleDescription_) << '\n'
142  << rule('-') << '\n';
143 
144  cet::for_all_with_index(
145  missingConsumes_, [&log](std::size_t const i, auto const& perBranch) {
146  for (auto const& pi : perBranch) {
147  log << " "
148  << assemble_consumes_statement(static_cast<BranchType>(i), pi)
149  << '\n';
150  }
151  });
152  log << rule('=');
153 }
cet::exempt_ptr< ModuleDescription const > moduleDescription_
Definition: Consumer.h:140
constexpr T pi()
Returns the constant pi (up to 35 decimal digits of precision)
bool moduleContext_
Definition: Consumer.h:136
ConsumableProductSets missingConsumes_
Definition: Consumer.h:139
void art::Consumer::validateConsumedProduct ( BranchType const  bt,
ProductInfo const &  pi 
)
protectedinherited

Definition at line 101 of file Consumer.cc.

References art::errors::ProductRegistrationFailure.

103 {
104  // Early exits if consumes tracking has been disabled or if the
105  // consumed product is an allowed consumable.
106  if (!moduleContext_)
107  return;
108 
109  if (cet::binary_search_all(consumables_[bt], pi))
110  return;
111 
112  if (requireConsumes_) {
114  "Consumer: an error occurred during validation of a "
115  "retrieved product\n\n")
116  << "The following consumes (or mayConsume) statement is missing from\n"
117  << module_context(moduleDescription_) << ":\n\n"
118  << " " << assemble_consumes_statement(bt, pi) << "\n\n";
119  }
120 
121  missingConsumes_[bt].insert(pi);
122 }
cet::exempt_ptr< ModuleDescription const > moduleDescription_
Definition: Consumer.h:140
bool requireConsumes_
Definition: Consumer.h:137
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
constexpr T pi()
Returns the constant pi (up to 35 decimal digits of precision)
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
ConsumableProductSets missingConsumes_
Definition: Consumer.h:139
bool art::EventObserverBase::wantAllEvents ( ) const
inlineinherited
bool art::EventObserverBase::wantEvent ( Event const &  e)
inlineinherited
std::string art::EDAnalyzer::workerType ( ) const
inlineinherited

Definition at line 109 of file EDAnalyzer.h.

References art::EDAnalyzer::currentContext().

110  {
111  return "WorkerT<EDAnalyzer>";
112  }

Member Data Documentation

bool trkf::SpacePointAna::fBooked
private

Definition at line 81 of file SpacePointAna_module.cc.

Referenced by bookHistograms().

std::string trkf::SpacePointAna::fClusterModuleLabel
private

Definition at line 76 of file SpacePointAna_module.cc.

Referenced by analyze(), and SpacePointAna().

TH1F* trkf::SpacePointAna::fHAmpU
private

Definition at line 96 of file SpacePointAna_module.cc.

Referenced by analyze(), and bookHistograms().

TH1F* trkf::SpacePointAna::fHAmpV
private

Definition at line 97 of file SpacePointAna_module.cc.

Referenced by analyze(), and bookHistograms().

TH1F* trkf::SpacePointAna::fHAmpW
private

Definition at line 98 of file SpacePointAna_module.cc.

Referenced by analyze(), and bookHistograms().

TH1F* trkf::SpacePointAna::fHAreaU
private

Definition at line 99 of file SpacePointAna_module.cc.

Referenced by analyze(), and bookHistograms().

TH1F* trkf::SpacePointAna::fHAreaV
private

Definition at line 100 of file SpacePointAna_module.cc.

Referenced by analyze(), and bookHistograms().

TH1F* trkf::SpacePointAna::fHAreaW
private

Definition at line 101 of file SpacePointAna_module.cc.

Referenced by analyze(), and bookHistograms().

TH1F* trkf::SpacePointAna::fHchisq
private

Definition at line 92 of file SpacePointAna_module.cc.

Referenced by analyze(), and bookHistograms().

TH1F* trkf::SpacePointAna::fHDTUE
private

Definition at line 82 of file SpacePointAna_module.cc.

Referenced by analyze(), and bookHistograms().

TH1F* trkf::SpacePointAna::fHDTUPull
private

Definition at line 85 of file SpacePointAna_module.cc.

Referenced by analyze(), and bookHistograms().

TH1F* trkf::SpacePointAna::fHDTUV
private

Definition at line 88 of file SpacePointAna_module.cc.

Referenced by analyze(), and bookHistograms().

TH1F* trkf::SpacePointAna::fHDTVE
private

Definition at line 83 of file SpacePointAna_module.cc.

Referenced by analyze(), and bookHistograms().

TH1F* trkf::SpacePointAna::fHDTVPull
private

Definition at line 86 of file SpacePointAna_module.cc.

Referenced by analyze(), and bookHistograms().

TH1F* trkf::SpacePointAna::fHDTVW
private

Definition at line 89 of file SpacePointAna_module.cc.

Referenced by analyze(), and bookHistograms().

TH1F* trkf::SpacePointAna::fHDTWE
private

Definition at line 84 of file SpacePointAna_module.cc.

Referenced by analyze(), and bookHistograms().

TH1F* trkf::SpacePointAna::fHDTWPull
private

Definition at line 87 of file SpacePointAna_module.cc.

Referenced by analyze(), and bookHistograms().

TH1F* trkf::SpacePointAna::fHDTWU
private

Definition at line 90 of file SpacePointAna_module.cc.

Referenced by analyze(), and bookHistograms().

std::string trkf::SpacePointAna::fHitModuleLabel
private

Definition at line 74 of file SpacePointAna_module.cc.

Referenced by analyze(), and SpacePointAna().

TH1F* trkf::SpacePointAna::fHMCdx
private

Definition at line 105 of file SpacePointAna_module.cc.

Referenced by analyze(), and bookHistograms().

TH1F* trkf::SpacePointAna::fHMCdy
private

Definition at line 106 of file SpacePointAna_module.cc.

Referenced by analyze(), and bookHistograms().

TH1F* trkf::SpacePointAna::fHMCdz
private

Definition at line 107 of file SpacePointAna_module.cc.

Referenced by analyze(), and bookHistograms().

TH1F* trkf::SpacePointAna::fHMCxpull
private

Definition at line 108 of file SpacePointAna_module.cc.

Referenced by analyze(), and bookHistograms().

TH1F* trkf::SpacePointAna::fHMCypull
private

Definition at line 109 of file SpacePointAna_module.cc.

Referenced by analyze(), and bookHistograms().

TH1F* trkf::SpacePointAna::fHMCzpull
private

Definition at line 110 of file SpacePointAna_module.cc.

Referenced by analyze(), and bookHistograms().

TH1F* trkf::SpacePointAna::fHS
private

Definition at line 91 of file SpacePointAna_module.cc.

Referenced by analyze(), and bookHistograms().

TH1F* trkf::SpacePointAna::fHSumU
private

Definition at line 102 of file SpacePointAna_module.cc.

Referenced by analyze(), and bookHistograms().

TH1F* trkf::SpacePointAna::fHSumV
private

Definition at line 103 of file SpacePointAna_module.cc.

Referenced by analyze(), and bookHistograms().

TH1F* trkf::SpacePointAna::fHSumW
private

Definition at line 104 of file SpacePointAna_module.cc.

Referenced by analyze(), and bookHistograms().

TH1F* trkf::SpacePointAna::fHx
private

Definition at line 93 of file SpacePointAna_module.cc.

Referenced by analyze(), and bookHistograms().

TH1F* trkf::SpacePointAna::fHy
private

Definition at line 94 of file SpacePointAna_module.cc.

Referenced by analyze(), and bookHistograms().

TH1F* trkf::SpacePointAna::fHz
private

Definition at line 95 of file SpacePointAna_module.cc.

Referenced by analyze(), and bookHistograms().

int trkf::SpacePointAna::fNumEvent
private

Definition at line 114 of file SpacePointAna_module.cc.

Referenced by analyze().

const SpacePointAlg trkf::SpacePointAna::fSptalgDefault
private

Definition at line 73 of file SpacePointAna_module.cc.

Referenced by analyze().

const SpacePointAlg trkf::SpacePointAna::fSptalgSep
private

Definition at line 72 of file SpacePointAna_module.cc.

Referenced by analyze().

const SpacePointAlg trkf::SpacePointAna::fSptalgTime
private

Definition at line 71 of file SpacePointAna_module.cc.

Referenced by analyze(), and bookHistograms().

bool trkf::SpacePointAna::fUseClusterHits
private

Definition at line 75 of file SpacePointAna_module.cc.

Referenced by analyze(), and SpacePointAna().

bool trkf::SpacePointAna::fUseMC
private

Definition at line 77 of file SpacePointAna_module.cc.

Referenced by analyze(), bookHistograms(), and SpacePointAna().


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