Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef FastSimulation_ParticlePropagator_MagneticFieldMap_H
0002 #define FastSimulation_ParticlePropagator_MagneticFieldMap_H
0003 
0004 // Framework Headers
0005 #include "DataFormats/GeometryVector/interface/GlobalPoint.h"
0006 #include "DataFormats/GeometryVector/interface/GlobalVector.h"
0007 
0008 // Famos headers
0009 #include "FastSimulation/TrackerSetup/interface/TrackerLayer.h"
0010 
0011 #include <vector>
0012 #include <string>
0013 
0014 class MagneticField;
0015 class TrackerInteractionGeometry;
0016 class TH1;
0017 
0018 class MagneticFieldMap {
0019 public:
0020   // Constructor from a TrackerInteractionGeometry*
0021   MagneticFieldMap(const MagneticField* pmF, const TrackerInteractionGeometry* myGeo);
0022 
0023   const GlobalVector inTesla(const GlobalPoint&) const;
0024   const GlobalVector inKGauss(const GlobalPoint&) const;
0025   const GlobalVector inInverseGeV(const GlobalPoint&) const;
0026   const GlobalVector inTesla(const TrackerLayer& aLayer, double coord, int success) const;
0027   double inTeslaZ(const GlobalPoint&) const;
0028   double inKGaussZ(const GlobalPoint&) const;
0029   double inInverseGeVZ(const GlobalPoint&) const;
0030   double inTeslaZ(const TrackerLayer& aLayer, double coord, int success) const;
0031 
0032   const MagneticField& magneticField() const { return *pMF_; }
0033 
0034 private:
0035   void initialize();
0036 
0037   const std::vector<double>* theFieldEndcapHisto(unsigned layer) const { return &(fieldEndcapHistos[layer]); }
0038 
0039   const std::vector<double>* theFieldBarrelHisto(unsigned layer) const { return &(fieldBarrelHistos[layer]); }
0040 
0041   const MagneticField* pMF_;
0042   const TrackerInteractionGeometry* geometry_;
0043   unsigned bins;
0044   std::vector<std::vector<double> > fieldBarrelHistos;
0045   std::vector<std::vector<double> > fieldEndcapHistos;
0046   std::vector<double> fieldBarrelBinWidth;
0047   std::vector<double> fieldBarrelZMin;
0048   std::vector<double> fieldEndcapBinWidth;
0049   std::vector<double> fieldEndcapRMin;
0050 };
0051 
0052 #endif  // FastSimulation_ParticlePropagator_MagneticFieldMap_H