Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-27 09:15:00

0001 /**
0002  *  @file   LCContent/include/LCPlugins/LCPseudoLayerPlugin.h
0003  *
0004  *  @brief  Header file for the lc pseudo layer plugin class.
0005  *
0006  *  $Log: $
0007  */
0008 #ifndef LC_PSEUDO_LAYER_PLUGIN_H
0009 #define LC_PSEUDO_LAYER_PLUGIN_H 1
0010 
0011 #include "Pandora/PandoraInputTypes.h"
0012 
0013 #include "Plugins/PseudoLayerPlugin.h"
0014 
0015 namespace lc_content {
0016 
0017 /**
0018  *  @brief  LCPseudoLayerPlugin class
0019  */
0020 class LCPseudoLayerPlugin : public pandora::PseudoLayerPlugin {
0021 public:
0022   /**
0023    *  @brief  Default constructor
0024    */
0025   LCPseudoLayerPlugin();
0026 
0027 private:
0028   pandora::StatusCode Initialize();
0029   unsigned int GetPseudoLayer(const pandora::CartesianVector& positionVector) const;
0030   unsigned int GetPseudoLayerAtIp() const;
0031 
0032   /**
0033    *  @brief  Get the appropriate pseudolayer for a specified parameters
0034    *
0035    *  @param  rCoordinate the radial coordinate
0036    *  @param  zCoordinate the z coordinate
0037    *  @param  rCorrection the barrel/endcap overlap r correction
0038    *  @param  zCorrection the barrel/endcap overlap z correction
0039    *  @param  barrelInnerR the barrel inner r coordinate
0040    *  @param  endCapInnerZ the endcap inner z coordinate
0041    *  @param  pseudoLayer to receive the appropriate pseudolayer
0042    */
0043   pandora::StatusCode GetPseudoLayer(const float rCoordinate, const float zCoordinate, const float rCorrection,
0044                                      const float zCorrection, const float barrelInnerR, const float endCapInnerZ,
0045                                      unsigned int& pseudoLayer) const;
0046 
0047   typedef std::vector<float> LayerPositionList;
0048 
0049   /**
0050    *  @brief  Find the layer number corresponding to a specified position, via reference to a specified layer position
0051    * list
0052    *
0053    *  @param  position the specified position
0054    *  @param  layerPositionList the specified layer position list
0055    *  @param  layer to receive the layer number
0056    */
0057   pandora::StatusCode FindMatchingLayer(const float position, const LayerPositionList& layerPositionList,
0058                                         unsigned int& layer) const;
0059 
0060   /**
0061    *  @brief  Store all revelevant barrel and endcap layer positions upon initialization
0062    */
0063   void StoreLayerPositions();
0064 
0065   /**
0066    *  @brief  Store subdetector layer positions upon initialization
0067    *
0068    *  @param  subDetector the sub detector
0069    *  @param  layerParametersList the layer parameters list
0070    */
0071   void StoreLayerPositions(const pandora::SubDetector& subDetector, LayerPositionList& LayerPositionList);
0072 
0073   /**
0074    *  @brief  Store positions of barrel and endcap outer edges upon initialization
0075    */
0076   void StoreDetectorOuterEdge();
0077 
0078   /**
0079    *  @brief  Store sine and cosine of angles used to project hit positions onto polygonal calorimeter surfaces upon
0080    * initialization
0081    */
0082   void StorePolygonAngles();
0083 
0084   /**
0085    *  @brief  Store all details revelevant to barrel/endcap overlap corrections upon initialization
0086    */
0087   void StoreOverlapCorrectionDetails();
0088 
0089   typedef std::vector<std::pair<float, float>> AngleVector;
0090 
0091   /**
0092    *  @brief  Get the maximum polygon radius, with reference to cached sine/cosine values for relevant polygon angles
0093    *
0094    *  @param  angleVector vector containing cached sine/cosine values
0095    *  @param  x the cartesian x coordinate
0096    *  @param  y the cartesian y coordinate
0097    *
0098    *  @return the maximum radius
0099    */
0100   float GetMaximumRadius(const AngleVector& angleVector, const float x, const float y) const;
0101 
0102   /**
0103    *  @brief  Fill a vector with sine/cosine values for relevant polygon angles
0104    *
0105    *  @param  symmetryOrder the polygon symmetry order
0106    *  @param  phi0 the polygon cylindrical polar phi coordinate
0107    *  @param  angleVector the vector to fill with sine/cosine values for relevant polygon angles
0108    */
0109   void FillAngleVector(const unsigned int symmetryOrder, const float phi0, AngleVector& angleVector) const;
0110 
0111   pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle);
0112 
0113   LayerPositionList m_barrelLayerPositions; ///< List of barrel layer positions
0114   LayerPositionList m_endCapLayerPositions; ///< List of endcap layer positions
0115   AngleVector m_eCalBarrelAngleVector;      ///< The ecal barrel angle vector
0116   AngleVector m_muonBarrelAngleVector;      ///< The muon barrel angle vector
0117 
0118   float m_barrelInnerR;     ///< Barrel inner radius
0119   float m_endCapInnerZ;     ///< Endcap inner z position
0120   float m_barrelInnerRMuon; ///< Muon barrel inner radius
0121   float m_endCapInnerZMuon; ///< Muon endcap inner z position
0122 
0123   float m_rCorrection;     ///< Barrel/endcap overlap r correction
0124   float m_zCorrection;     ///< Barrel/endcap overlap z correction
0125   float m_rCorrectionMuon; ///< Muon barrel/endcap overlap r correction
0126   float m_zCorrectionMuon; ///< Muon barrel/endcap overlap z correction
0127 
0128   float m_barrelEdgeR; ///< Extremal barrel r coordinate
0129   float m_endCapEdgeZ; ///< Extremal endcap z coordinate
0130 };
0131 
0132 //------------------------------------------------------------------------------------------------------------------------------------------
0133 
0134 inline unsigned int LCPseudoLayerPlugin::GetPseudoLayerAtIp() const {
0135   const unsigned int pseudoLayerAtIp(this->GetPseudoLayer(pandora::CartesianVector(0.f, 0.f, 0.f)));
0136   return pseudoLayerAtIp;
0137 }
0138 
0139 } // namespace lc_content
0140 
0141 #endif // #ifndef LC_PSEUDO_LAYER_PLUGIN_H