Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:11:20

0001 #ifndef FASTSIM_SIMPLIFIEDGEOMETRYFACTORY
0002 #define FASTSIM_SIMPLIFIEDGEOMETRYFACTORY
0003 
0004 class GeometricSearchTracker;
0005 class MagneticField;
0006 class DetLayer;
0007 class BarrelDetLayer;
0008 class ForwardDetLayer;
0009 
0010 #include <memory>
0011 #include <map>
0012 #include <vector>
0013 #include <string>
0014 
0015 ///////////////////////////////////////////////
0016 // Author: L. Vanelderen
0017 // Date: 13 May 2014
0018 //
0019 // Revision: Class structure modified to match SimplifiedGeometryPropagator
0020 //           S. Kurz, 29 May 2017
0021 //////////////////////////////////////////////////////////
0022 
0023 namespace edm {
0024   class ParameterSet;
0025 }
0026 
0027 namespace fastsim {
0028   class SimplifiedGeometry;
0029   class BarrelSimplifiedGeometry;
0030   class ForwardSimplifiedGeometry;
0031   class InteractionModel;
0032 
0033   //! Constructs a tracker layer according to entry in python config (incl interaction models).
0034   /*!
0035         Also creates links to DetLayer (if active layer) and stores strength of magnetic field along the layer.
0036         If some parameters are not stored in the config file, tries to get them from the full detector geometry (GeometricSearchTracker). This is however only possible for active layers.
0037         \sa Geometry()
0038         \sa SimplifiedGeometry()
0039     */
0040   class SimplifiedGeometryFactory {
0041   public:
0042     //! Constructor
0043     /*!
0044             \param geometricSearchTracker The full tracker geometry (needed for links to active detLayers).
0045             \param magneticField The full magnetic field.
0046             \param interactionModelMap Map of interaction models that should be assigned for that layer.
0047             \param magneticFieldHistMaxR Max Radius for initialization of magnetic field histogram (TH1, limit of axis).
0048             \param magneticFieldHistMaxZ Max Z for initialization of magnetic field histogram (TH1, limit of axis).
0049         */
0050     SimplifiedGeometryFactory(const GeometricSearchTracker *geometricSearchTracker,
0051                               const MagneticField &magneticField,
0052                               const std::map<std::string, fastsim::InteractionModel *> &interactionModelMap,
0053                               double magneticFieldHistMaxR,
0054                               double magneticFieldHistMaxZ);
0055 
0056     //! Each layer is either a barrel layer, or a forward layer (either at ppositive or negative Z).
0057     enum LayerType { BARREL, POSFWD, NEGFWD };
0058 
0059     //! Main method of this class. Creates a new detector layer (SimplifiedGeometry).
0060     /*!
0061             Reads the config file, does all the initialization etc. and creates either a forward or a barrel layer (depends on LayerType type).
0062             \param type Either BARREL, POSFWD or NEGFWD.
0063             \return A SimplifiedGeometry (either ForwardSimplifiedGeometry or BarrelSimplifiedGeometry).
0064         */
0065     std::unique_ptr<SimplifiedGeometry> createSimplifiedGeometry(LayerType type, const edm::ParameterSet &cfg) const;
0066 
0067     //! Helper method for createSimplifiedGeometry(..) to create a forward layer (ForwardSimplifiedGeometry).
0068     /*!
0069             \param type Either POSFWD or NEGFWD.
0070             \return A ForwardSimplifiedGeometry
0071             \sa createSimplifiedGeometry(LayerType type, const edm::ParameterSet & cfg)
0072         */
0073     std::unique_ptr<ForwardSimplifiedGeometry> createForwardSimplifiedGeometry(LayerType type,
0074                                                                                const edm::ParameterSet &cfg) const;
0075 
0076     //! Helper method for createSimplifiedGeometry(..) to create a barrel layer (BarrelSimplifiedGeometry).
0077     /*!
0078             \return A BarrelSimplifiedGeometry
0079             \sa createSimplifiedGeometry(LayerType type, const edm::ParameterSet & cfg)
0080         */
0081     std::unique_ptr<BarrelSimplifiedGeometry> createBarrelSimplifiedGeometry(const edm::ParameterSet &cfg) const;
0082 
0083   private:
0084     //! Method returns a pointer to a DetLayer according to the string that was passed.
0085     /*!
0086             A convention for the name of the layer is used.
0087             For barrel layers this is "XXX?" where XXX is a part of the tracker and ? is the index of the layer (starting at one).
0088             For forward layers one has to add neg/pos in front to distinguish between the disk at -Z and +Z spatial position, so the convention is "xxxXXX?"
0089             Valid names: BPix, TIB, TOB, negFPix, posFPix, negTID, posTID, negTEC, posTEC
0090             Accordingly, the innermost layer of the barrel pixel detector is "BPix1".
0091             \param detLayerName A string following the naming convention.
0092         */
0093     const DetLayer *getDetLayer(const std::string &detLayerName,
0094                                 const GeometricSearchTracker &geometricSearchTracker) const;
0095 
0096     const GeometricSearchTracker *const geometricSearchTracker_;                     //!< The full tracker geometry.
0097     const MagneticField *const magneticField_;                                       //!< The full magnetic field.
0098     const std::map<std::string, fastsim::InteractionModel *> *interactionModelMap_;  //!< Map of interaction models.
0099     const double magneticFieldHistMaxR_;  //!< Limit in R for histogram of magnetic field.
0100     const double magneticFieldHistMaxZ_;  //!< Limit in +-Z for histogram of magnetic field.
0101     std::map<std::string, const std::vector<BarrelDetLayer const *> *>
0102         barrelDetLayersMap_;  //!< A map of strings and pointers to detLayers.
0103     std::map<std::string, const std::vector<ForwardDetLayer const *> *>
0104         forwardDetLayersMap_;  //!< A map of strings and pointers to detLayers.
0105   };
0106 }  // namespace fastsim
0107 
0108 #endif