PseudoLayerPlugin.h
Go to the documentation of this file.
1 #ifndef PSEUDOLAYER_PLUGIN_H
2 #define PSEUDOLAYER_PLUGIN_H 1
3 
4 //std
5 #include "Objects/CartesianVector.h"
6 
7 //Pandora
8 #include "Plugins/PseudoLayerPlugin.h"
9 
10 // Pandora SDK
11 #include "Api/PandoraApi.h"
12 
13 //------------------------------------------------------------------------------------------------------------------------------------------
14 
15 /**
16 * @brief PseudoLayerPlugin class
17 */
18 
19 namespace gar {
20  namespace gar_pandora {
21 
22  class PseudoLayerPlugin : public pandora::PseudoLayerPlugin
23  {
24  public:
25 
26  /**
27  * @brief Default constructor
28  */
30 
31  private:
32 
33  pandora::StatusCode Initialize();
34 
35  unsigned int GetPseudoLayer(const pandora::CartesianVector &positionVector) const;
36  unsigned int GetPseudoLayerAtIp() const;
37 
38  /**
39  * @brief Get the appropriate pseudolayer for a specified parameters
40  *
41  * @param rCoordinate the radial coordinate
42  * @param zCoordinate the z coordinate
43  * @param rCorrection the barrel/endcap overlap r correction
44  * @param zCorrection the barrel/endcap overlap z correction
45  * @param barrelInnerR the barrel inner r coordinate
46  * @param endCapInnerZ the endcap inner z coordinate
47  * @param pseudoLayer to receive the appropriate pseudolayer
48  */
49  pandora::StatusCode GetPseudoLayer(const float rCoordinate, const float zCoordinate, const float rCorrection, const float zCorrection, const float barrelInnerR, const float endCapInnerZ, unsigned int &pseudoLayer) const;
50 
51  typedef std::vector<float> LayerPositionList;
52 
53  /**
54  * @brief Find the layer number corresponding to a specified position, via reference to a specified layer position list
55  *
56  * @param position the specified position
57  * @param layerPositionList the specified layer position list
58  * @param layer to receive the layer number
59  */
60  pandora::StatusCode FindMatchingLayer(const float position, const LayerPositionList &layerPositionList, unsigned int &layer) const;
61 
62  /**
63  * @brief Store all revelevant barrel and endcap layer positions upon initialization
64  */
65  void StoreLayerPositions();
66 
67  /**
68  * @brief Store subdetector layer positions upon initialization
69  *
70  * @param subDetector the sub detector
71  * @param layerParametersList the layer parameters list
72  */
73  void StoreLayerPositions(const pandora::SubDetector &subDetector, LayerPositionList &LayerPositionList);
74 
75  /**
76  * @brief Store positions of barrel and endcap outer edges upon initialization
77  */
79 
80  /**
81  * @brief Store sine and cosine of angles used to project hit positions onto polygonal calorimeter surfaces upon initialization
82  */
83  void StorePolygonAngles();
84 
85  /**
86  * @brief Store all details revelevant to barrel/endcap overlap corrections upon initialization
87  */
89 
90  typedef std::vector< std::pair<float, float> > AngleVector;
91 
92  /**
93  * @brief Get the maximum polygon radius, with reference to cached sine/cosine values for relevant polygon angles
94  *
95  * @param angleVector vector containing cached sine/cosine values
96  * @param x the cartesian x coordinate
97  * @param y the cartesian y coordinate
98  *
99  * @return the maximum radius
100  */
101  float GetMaximumRadius(const AngleVector &angleVector, const float x, const float y) const;
102 
103  /**
104  * @brief Fill a vector with sine/cosine values for relevant polygon angles
105  *
106  * @param symmetryOrder the polygon symmetry order
107  * @param phi0 the polygon cylindrical polar phi coordinate
108  * @param angleVector the vector to fill with sine/cosine values for relevant polygon angles
109  */
110  void FillAngleVector(const unsigned int symmetryOrder, const float phi0, AngleVector &angleVector) const;
111 
112  pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle);
113 
114  LayerPositionList m_barrelLayerPositions; ///< List of barrel layer positions
115  LayerPositionList m_endCapLayerPositions; ///< List of endcap layer positions
116  AngleVector m_eCalBarrelAngleVector; ///< The ecal barrel angle vector
117 
118  float m_barrelInnerR; ///< Barrel inner radius
119  float m_endCapInnerZ; ///< Endcap inner z position
120 
121  float m_rCorrection; ///< Barrel/endcap overlap r correction
122  float m_zCorrection; ///< Barrel/endcap overlap z correction
123 
124  float m_barrelEdgeR; ///< Extremal barrel r coordinate
125  float m_endCapEdgeZ; ///< Extremal endcap z coordinate
126  };
127 
128  //------------------------------------------------------------------------------------------------------------------------------------------
129 
130  inline unsigned int PseudoLayerPlugin::GetPseudoLayerAtIp() const
131  {
132  const unsigned int pseudoLayerAtIp(this->GetPseudoLayer(pandora::CartesianVector(0.f, 0.f, 0.f)));
133  return pseudoLayerAtIp;
134  }
135  }
136 }
137 
138 #endif // #ifndef PSEUDOLAYER_PLUGIN_H
void StoreLayerPositions()
Store all revelevant barrel and endcap layer positions upon initialization.
void StoreDetectorOuterEdge()
Store positions of barrel and endcap outer edges upon initialization.
float m_barrelEdgeR
Extremal barrel r coordinate.
LayerPositionList m_barrelLayerPositions
List of barrel layer positions.
std::vector< std::pair< float, float > > AngleVector
LayerPositionList m_endCapLayerPositions
List of endcap layer positions.
float m_endCapEdgeZ
Extremal endcap z coordinate.
float m_endCapInnerZ
Endcap inner z position.
unsigned int GetPseudoLayer(const pandora::CartesianVector &positionVector) const
void StoreOverlapCorrectionDetails()
Store all details revelevant to barrel/endcap overlap corrections upon initialization.
pandora::StatusCode FindMatchingLayer(const float position, const LayerPositionList &layerPositionList, unsigned int &layer) const
Find the layer number corresponding to a specified position, via reference to a specified layer posit...
unsigned int GetPseudoLayerAtIp() const
PseudoLayerPlugin()
Default constructor.
void FillAngleVector(const unsigned int symmetryOrder, const float phi0, AngleVector &angleVector) const
Fill a vector with sine/cosine values for relevant polygon angles.
float m_zCorrection
Barrel/endcap overlap z correction.
General GArSoft Utilities.
float GetMaximumRadius(const AngleVector &angleVector, const float x, const float y) const
Get the maximum polygon radius, with reference to cached sine/cosine values for relevant polygon angl...
void StorePolygonAngles()
Store sine and cosine of angles used to project hit positions onto polygonal calorimeter surfaces upo...
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
float m_barrelInnerR
Barrel inner radius.
list x
Definition: train.py:276
AngleVector m_eCalBarrelAngleVector
The ecal barrel angle vector.
float m_rCorrection
Barrel/endcap overlap r correction.