CaloHitCreator.h
Go to the documentation of this file.
1 #ifndef CALO_HIT_CREATOR_H
2 #define CALO_HIT_CREATOR_H 1
3 
5 
6 #include "Geometry/GeometryGAr.h"
9 
10 #include "RotationTransformation.h"
11 
12 #include "Api/PandoraApi.h"
13 
14 namespace gar {
15  namespace gar_pandora {
16 
17  typedef std::vector<art::Ptr<gar::rec::CaloHit>> CalorimeterHitVector;
18  typedef std::vector<gar::rec::CaloHit> RawCalorimeterHitVector;
19 
21  {
22  public:
23  typedef std::vector<float> FloatVector;
24 
25  class Settings
26  {
27  public:
28  Settings();
29 
30  std::string m_CaloHitCollection; ///< The calorimeter hit collection
31 
32  std::string m_CaloHitInstanceName; ///< The calorimeter hit instance name
33 
34  float m_eCalToMip; ///< The calibration from deposited ECal energy to mip
35  float m_eCalMipThreshold; ///< Threshold for creating calo hits in the ECal, units mip
36  float m_eCalToEMGeV; ///< The calibration from deposited ECal energy to EM energy
37  float m_eCalToHadGeVBarrel; ///< The calibration from deposited ECal barrel energy to hadronic energy
38  float m_eCalToHadGeVEndCap; ///< The calibration from deposited ECal endcap energy to hadronic energy
39  float m_maxECalHitHadronicEnergy; ///< The maximum hadronic energy allowed for a single hcal hit
40  int m_nOuterSamplingLayers; ///< Number of layers from edge for hit to be flagged as an outer layer hit
41  float m_layersFromEdgeMaxRearDistance; ///< Maximum number of layers from candidate outer layer hit to rear of detector
42  float m_eCalBarrelOuterR; ///< ECal barrel outer r coordinate
43  float m_eCalBarrelOuterZ; ///< ECal barrel outer z coordinate
44  float m_eCalBarrelInnerPhi0; ///< ECal barrel inner phi0 coordinate
45  float m_eCalBarrelOuterPhi0; ///< ECal barrel outer phi0 coordinate
46  unsigned int m_eCalBarrelInnerSymmetry; ///< ECal barrel inner symmetry order
47  unsigned int m_eCalBarrelOuterSymmetry; ///< ECal barrel outer symmetry order
48  FloatVector m_eCalBarrelNormalVector; ///< ECal barrel normal vector
49  float m_eCalEndCapOuterR; ///< ECal endcap outer r coordinate
50  float m_eCalEndCapOuterZ; ///< ECal endcap outer z coordinate
51  unsigned int m_eCalEndCapInnerSymmetryOrder; ///< ECal endcap inner symmetry
52  float m_eCalEndCapInnerPhiCoordinate; ///< ECal endcap inner phi
53  };
54 
55  CaloHitCreator(const Settings &settings, const pandora::Pandora *const pPandora, const RotationTransformation *const pRotation);
56 
58 
59  pandora::StatusCode CreateCaloHits(const art::Event &pEvent);
60  const CalorimeterHitVector &GetCalorimeterHitVector() const;
61 
62  void Reset();
63 
64  private:
65 
66  pandora::StatusCode CreateECalCaloHits() const;
67 
68  void GetCommonCaloHitProperties(const gar::rec::CaloHit *const pCaloHit, PandoraApi::CaloHit::Parameters &caloHitParameters) const;
69  void GetEndCapCaloHitProperties(const gar::rec::CaloHit *const pCaloHit, const std::vector<gar::geo::LayeredCalorimeterStruct::Layer> &layers, PandoraApi::CaloHit::Parameters &caloHitParameters, float &absorberCorrection) const;
70  void GetBarrelCaloHitProperties( const gar::rec::CaloHit *const pCaloHit,
71  const std::vector<gar::geo::LayeredCalorimeterStruct::Layer> &layers, unsigned int barrelSymmetryOrder, PandoraApi::CaloHit::Parameters &caloHitParameters, FloatVector const& normalVector, float &absorberCorrection ) const;
72  int GetNLayersFromEdge(const gar::rec::CaloHit *const pCaloHit) const;
73  float GetMaximumRadius(const gar::rec::CaloHit *const pCaloHit, const unsigned int symmetryOrder, const float phi0) const;
74 
75  pandora::StatusCode CollectECALCaloHits(const art::Event &pEvent, const std::string &label, const std::string &instanceName, CalorimeterHitVector &ecalCaloHitVector);
76 
77  const Settings m_settings; ///< The calo hit creator settings
78  const pandora::Pandora & m_pandora; ///< Reference to the pandora object to create calo hits
79  const geo::GeometryCore* fGeo; //Geometry Manager
81  float m_origin[3] = {0, 0, 0};
82 
84 
85  float m_eCalBarrelLayerThickness; ///< ECal barrel layer thickness
86  float m_eCalEndCapLayerThickness; ///< ECal endcap layer thickness
87 
88  CalorimeterHitVector artCalorimeterHitVector;
89  };
90 
91  //------------------------------------------------------------------------------------------------------------------------------------------
92 
93  inline const CalorimeterHitVector &CaloHitCreator::GetCalorimeterHitVector() const
94  {
96  }
97 
98  //------------------------------------------------------------------------------------------------------------------------------------------
99 
100  inline void CaloHitCreator::Reset()
101  {
102  artCalorimeterHitVector.clear();
103  }
104 
105  }
106 }
107 
108 #endif // #ifndef CALO_HIT_CREATOR_H
float m_eCalToHadGeVEndCap
The calibration from deposited ECal endcap energy to hadronic energy.
std::vector< art::Ptr< gar::rec::CaloHit > > CalorimeterHitVector
std::string m_CaloHitCollection
The calorimeter hit collection.
std::vector< float > FloatVector
float m_eCalMipThreshold
Threshold for creating calo hits in the ECal, units mip.
void GetBarrelCaloHitProperties(const gar::rec::CaloHit *const pCaloHit, const std::vector< gar::geo::LayeredCalorimeterStruct::Layer > &layers, unsigned int barrelSymmetryOrder, PandoraApi::CaloHit::Parameters &caloHitParameters, FloatVector const &normalVector, float &absorberCorrection) const
float m_eCalEndCapOuterR
ECal endcap outer r coordinate.
std::string string
Definition: nybbler.cc:12
CaloHitCreator(const Settings &settings, const pandora::Pandora *const pPandora, const RotationTransformation *const pRotation)
const CalorimeterHitVector & GetCalorimeterHitVector() const
float m_eCalEndCapOuterZ
ECal endcap outer z coordinate.
std::vector< gar::rec::CaloHit > RawCalorimeterHitVector
float m_eCalToEMGeV
The calibration from deposited ECal energy to EM energy.
float m_eCalBarrelInnerPhi0
ECal barrel inner phi0 coordinate.
gar::geo::BitFieldCoder const * m_fieldDecoder
int m_nOuterSamplingLayers
Number of layers from edge for hit to be flagged as an outer layer hit.
Description of geometry of one entire detector.
Definition: GeometryCore.h:436
float GetMaximumRadius(const gar::rec::CaloHit *const pCaloHit, const unsigned int symmetryOrder, const float phi0) const
float m_eCalToHadGeVBarrel
The calibration from deposited ECal barrel energy to hadronic energy.
pandora::StatusCode CreateCaloHits(const art::Event &pEvent)
float m_eCalBarrelOuterZ
ECal barrel outer z coordinate.
Helper class for decoding and encoding a bit field of 64bits for convenient declaration.
float m_eCalBarrelOuterPhi0
ECal barrel outer phi0 coordinate.
std::string m_CaloHitInstanceName
The calorimeter hit instance name.
int GetNLayersFromEdge(const gar::rec::CaloHit *const pCaloHit) const
float m_eCalBarrelOuterR
ECal barrel outer r coordinate.
const geo::GeometryCore * fGeo
const Settings m_settings
The calo hit creator settings.
CalorimeterHitVector artCalorimeterHitVector
FloatVector m_eCalBarrelNormalVector
ECal barrel normal vector.
void GetEndCapCaloHitProperties(const gar::rec::CaloHit *const pCaloHit, const std::vector< gar::geo::LayeredCalorimeterStruct::Layer > &layers, PandoraApi::CaloHit::Parameters &caloHitParameters, float &absorberCorrection) const
const RotationTransformation & m_rotation
General GArSoft Utilities.
unsigned int m_eCalEndCapInnerSymmetryOrder
ECal endcap inner symmetry.
unsigned int m_eCalBarrelOuterSymmetry
ECal barrel outer symmetry order.
float m_eCalToMip
The calibration from deposited ECal energy to mip.
const pandora::Pandora & m_pandora
Reference to the pandora object to create calo hits.
void GetCommonCaloHitProperties(const gar::rec::CaloHit *const pCaloHit, PandoraApi::CaloHit::Parameters &caloHitParameters) const
float m_maxECalHitHadronicEnergy
The maximum hadronic energy allowed for a single hcal hit.
pandora::StatusCode CollectECALCaloHits(const art::Event &pEvent, const std::string &label, const std::string &instanceName, CalorimeterHitVector &ecalCaloHitVector)
float m_layersFromEdgeMaxRearDistance
Maximum number of layers from candidate outer layer hit to rear of detector.
art framework interface to geometry description
unsigned int m_eCalBarrelInnerSymmetry
ECal barrel inner symmetry order.
float m_eCalBarrelLayerThickness
ECal barrel layer thickness.
float m_eCalEndCapLayerThickness
ECal endcap layer thickness.
pandora::StatusCode CreateECalCaloHits() const
float m_eCalEndCapInnerPhiCoordinate
ECal endcap inner phi.