All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
icarusalg/icarusalg/gallery/galleryAnalysis/C++/HitAnalysisAlg.h
Go to the documentation of this file.
1 #ifndef HITANALYSISALG_H
2 #define HITANALYSISALG_H
3 ////////////////////////////////////////////////////////////////////////
4 //
5 // Class: HitAnalysisAlg
6 // Module Type: producer
7 // File: HitAnalysisAlg.h
8 //
9 // The intent of this module is to provide methods for
10 // "analyzing" hits on waveforms
11 //
12 // Configuration parameters:
13 //
14 // TruncMeanFraction - the fraction of waveform bins to discard when
15 //
16 // Created by Tracy Usher (usher@slac.stanford.edu) on February 19, 2016
17 //
18 ////////////////////////////////////////////////////////////////////////
19 
20 #include "fhiclcpp/ParameterSet.h"
21 
23 
25 
26 #include "TDirectory.h"
27 #include "TH1.h"
28 #include "TH2.h"
29 #include "TProfile.h"
30 #include "TProfile2D.h"
31 
32 namespace HitAnalysis
33 {
34 
35 // The following typedefs will, obviously, be useful
36 using HitVec = std::vector<recob::Hit>;
37 using PlaneHitMap = std::map<size_t,HitVec>;
38 using TrackPlaneHitMap = std::map<int,PlaneHitMap>;
39 
41 {
42 public:
43 
44  // Copnstructors, destructor.
45  HitAnalysisAlg(fhicl::ParameterSet const & pset);
47 
48  // provide for initialization
49  void reconfigure(fhicl::ParameterSet const & pset);
50  void setup(const geo::GeometryCore&, TDirectory*);
51  void endJob(int numEvents);
52 
53  void fillHistograms(const TrackPlaneHitMap&) const;
54  void fillHistograms(const HitVec&) const;
55 
56 private:
57 
58  // Fcl parameters.
59  std::string fLocalDirName; ///< Fraction for truncated mean
60  TDirectory* fRootDirectory;
61 
62  // Pointers to the histograms we'll create.
63  std::unique_ptr<TH1D> fHitsByWire[3];
64  std::unique_ptr<TH1D> fDriftTimes[3];
65  std::unique_ptr<TH1D> fHitsByTime[3];
66  std::unique_ptr<TH1D> fPulseHeight[3];
67  std::unique_ptr<TH1D> fPulseHeightSingle[3];
68  std::unique_ptr<TH1D> fPulseHeightMulti[3];
69  std::unique_ptr<TH1D> fChi2DOF[3];
70  std::unique_ptr<TH1D> fNumDegFree[3];
71  std::unique_ptr<TH1D> fChi2DOFSingle[3];
72  std::unique_ptr<TH1D> fHitMult[3];
73  std::unique_ptr<TH1D> fHitCharge[3];
74  std::unique_ptr<TH1D> fFitWidth[3];
75  std::unique_ptr<TH1D> fHitSumADC[3];
76  std::unique_ptr<TH2D> fNDFVsChi2[3];
77  std::unique_ptr<TH2D> fPulseHVsWidth[3];
78  std::unique_ptr<TH2D> fPulseHVsCharge[3];
79  std::unique_ptr<TH1D> fBadWPulseHeight;
80  std::unique_ptr<TH2D> fBadWPulseHVsWidth;
81  std::unique_ptr<TH1D> fBadWHitsByWire;
82  std::unique_ptr<TProfile> fPulseHVsHitNo[3];
83  std::unique_ptr<TProfile> fChargeVsHitNo[3];
84  std::unique_ptr<TProfile> fChargeVsHitNoS[3];
85 
86  std::unique_ptr<TH2D> fSPHvsIdx[3];
87  std::unique_ptr<TH2D> fSWidVsIdx[3];
88  std::unique_ptr<TH2D> f1PPHvsWid[3];
89  std::unique_ptr<TH2D> fSPPHvsWid[3];
90  std::unique_ptr<TH2D> fSOPHvsWid[3];
91  std::unique_ptr<TH2D> fPHRatVsIdx[3];
92 
93  // Useful services, keep copies for now (we can update during begin run periods)
94  const geo::GeometryCore* fGeometry; ///< pointer to Geometry service
95 };
96 
97 } // end of namespace caldata
98 
99 #endif
Declaration of signal hit object.
const geo::GeometryCore * fGeometry
pointer to Geometry service
Access the description of detector geometry.
Description of geometry of one entire detector.
void setup(const geo::GeometryCore &, TDirectory *)
Begin job method.