NuEEnergyAlg.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 /// \file NuEEnergyAlg.h
3 /// \brief Calculates deposited and corrected energy of the electron
4 /// shower and of electron flavoured neutrino.
5 ///
6 /// \author ksachdev@physics.umn.edu
7 ////////////////////////////////////////////////////////////////////////
8 
9 
10 #ifndef NuEEnergyAlg_h
11 #define NuEEnergyAlg_h
12 
13 
14 #include "fhiclcpp/ParameterSet.h"
18 
19 #include "Geometry/Geometry.h"
20 
21 namespace rb {
22  class Cluster;
23  class Shower;
24  class CellHit;
25  class Vertex;
26 }
27 
28 
29 namespace slid {
30 
31  class NuEEnergyAlg {
32  public:
33 
34  explicit NuEEnergyAlg(fhicl::ParameterSet const& pset);
35 
36  ~NuEEnergyAlg();
37 
38  void reconfigure(const fhicl::ParameterSet& pset);
39 
40 
41  /// \brief Returns the energy deposited in a cell.
42  /// Used in computation of total shower energy.
43  /// Only used if fUseStdCellE is false.
44  double CellEnergy(const rb::Shower* shower,
45  const std::vector< const rb::Shower* > showercol,
46  const int & index,
47  const art::EventID & evtid,
48  bool useweight = true,
49  bool* isCalibrated = NULL
50  );
51 
52 
53  /// \brief Correct cell DATA/MC difference in
54  /// cell energy computation. Only used if
55  /// fCorDataCell is true
56  double CellEDataMC(double gev, double w,
58 
59 
60  /// \brief Convert ADC to GeV based on JM
61  /// attenuation fits
62  double CellADCToGeV(double d, geo::View_t view);
63 
64 
65  /// \brief EM shower energy correction for MC
66  /// Only used if fCorAbsCell is false
67  double ECorrMC(double gev);
68 
69 
70  /// \brief Returns the deposited energy of a shower.
71  /// Does not contain corrections due to dead material
72  /// or threshold effects.
73  double ShowerDepEnergy(const rb::Shower* shower,
74  const std::vector< const rb::Shower* > showercol,
75  const art::Event& evt);
76 
77 
78  /// \brief Returns the total energy of a shower.
79  /// along with corrections due to dead material
80  /// and threshold effects (position correction).
81  double ShowerEnergy(const rb::Shower* shower,
82  const std::vector< const rb::Shower* > showercol,
83  const art::Event& evt);
84 
85 
86 
87  /// \brief Returns the deposited hadronic energy
88  double HadronicDepEnergy(const std::vector< const rb::Shower* > showercol,
89  const rb::Cluster* slice,
90  const int & elecShowerIndex,
91  const art::Event& evt);
92 
93 
94  /// \brief Returns the hadronic energy in the
95  /// slice, assuming 'shower' is the electron
96  /// shower
97  double HadronicEnergy(const std::vector< const rb::Shower* > showercol,
98  const rb::Cluster* slice,
99  const int & elecShowerIndex,
100  const art::Event& evt);
101 
102 
103  /// \brief Returns the neutrino energy, assuming
104  /// 'shower' is electron shower.
105  double NuEEnergy(const std::vector< const rb::Shower* > shower,
106  const rb::Cluster* slice,
107  const int & elecShowerIndex,
108  const art::Event& evt);
109 
110  /// \brief Returns energy within 8 planes of the start of the shower
111  double VertexEnergy( const rb::Shower * shower,
112  const std::vector< const rb::Shower* > showercol,
113  const rb::Vertex * vertex,
114  const rb::Cluster * slice,
115  const art::Event& evt);
116 
117  /// \brief Returns sum of ShowerEnergy of all showers in showercol
118  double ShowerSumEnergy(const std::vector< const rb::Shower* > shower,
119  const art::Event& evt);
120 
121 
122  private:
123 
125 
126  bool fCorDataCell; ///< Should Data MC cell energy correction be used?
127  bool fCorAbsCell; ///< Should non-standard absolute energy calibration be used?
128  bool fUseStdCellE; ///< Should standard recoHit function, GeV(), be used to compute cell energy?
129  float fPEThreshold; ///< PE threshold for considering a hit in hadronic energy calculation
130 
131  bool fUseUncalibHits; ///< Do we want to use uncalibrated hits in the energy calculations?
132 
133  /// This map holds info about the cells that are shared by
134  /// multiple prongs. The key is the channel, and the value
135  /// is another map. In the inner map, the key is the index
136  /// of the prong and the value is the index of the cell in
137  /// that prong. Therefore, fHitShowerMap[chan][prgIdx] = [cellIdx]
138  std::map< uint32_t , std::map< int, int > > fHitShowerMap;
139 
140  /// \brief Fills fHitShowerMap
141  void GetHitShowerMap( std::vector< const rb::Shower *> showercol);
142 
143  ///
144  std::vector< const rb::Shower* > fShowerCol;
145 
146  /// Function to determine whether or not fHitShowerMap is filled for
147  /// the current shower collection?
148  bool MapFilled(std::vector< const rb::Shower *> showercol);
149 
150  /// Is fHitShowerMap filled for the current shower collection?
152 
153  /// Event number
155 
156  /// This function calculates the cell energy that doesn't
157  /// use the standard calibration. This gets used in CellEnergy
158  /// function, if fUseStdCellE is set to false.
159  double NonStdCellEnergy( const rb::CellHit * cHit,
160  const int & detid,
161  const double & readoutD,
162  const double & w,
163  const double & norm,
164  const double & weight);
165 
166  /// Clears the privately owned variables of this class.
167  void ClearVars(const art::EventID& evtid);
168 
169  }; // end of NuEEnergyAlg class definition
170 
171 } // end of slid namespace
172 
173 #endif //NuEEnergyAlg_h
std::vector< const rb::Shower * > fShowerCol
Definition: NuEEnergyAlg.h:144
A 3D position and time representing an interaction vertex.
Definition: Vertex.h:15
Definition: event.h:34
static float NuEEnergy(float leptonicEnergy, float hadronicEnergy, cmf::BeamType_t const &beamType)
Definition: VarVals.h:338
const Var weight
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
A collection of associated CellHits.
Definition: Cluster.h:47
bool fCorDataCell
Should Data MC cell energy correction be used?
Definition: NuEEnergyAlg.h:126
float fPEThreshold
PE threshold for considering a hit in hadronic energy calculation.
Definition: NuEEnergyAlg.h:129
std::map< uint32_t, std::map< int, int > > fHitShowerMap
Definition: NuEEnergyAlg.h:138
int evt
Float_t d
Definition: plot.C:236
Perform a "2 point" Hough transform on a collection of hits.
bool fUseStdCellE
Should standard recoHit function, GeV(), be used to compute cell energy?
Definition: NuEEnergyAlg.h:128
A rawdata::RawDigit with channel information decoded.
Definition: CellHit.h:27
Float_t norm
bool fUseUncalibHits
Do we want to use uncalibrated hits in the energy calculations?
Definition: NuEEnergyAlg.h:131
A rb::Prong with a length.
Definition: Shower.h:18
art::EventID fEvtId
Event number.
Definition: NuEEnergyAlg.h:154
bool fMapIsFilled
Is fHitShowerMap filled for the current shower collection?
Definition: NuEEnergyAlg.h:151
Build slid::LID objects to store electron ID, if asked for, otherwise, calculate LID info and make av...
Definition: FillPIDs.h:13
art::ServiceHandle< geo::Geometry > fGeom
Definition: NuEEnergyAlg.h:124
Float_t w
Definition: plot.C:20
Encapsulate the geometry of one entire detector (near, far, ndos)
bool fCorAbsCell
Should non-standard absolute energy calibration be used?
Definition: NuEEnergyAlg.h:127