00001 #ifndef FastSimulation_ParticlePropagator_MagneticFieldMap_H 00002 #define FastSimulation_ParticlePropagator_MagneticFieldMap_H 00003 00004 // Framework Headers 00005 #include "DataFormats/GeometryVector/interface/GlobalPoint.h" 00006 #include "DataFormats/GeometryVector/interface/GlobalVector.h" 00007 00008 // Famos headers 00009 #include "FastSimulation/TrackerSetup/interface/TrackerLayer.h" 00010 00011 #include <vector> 00012 #include <string> 00013 00014 class MagneticField; 00015 class TrackerInteractionGeometry; 00016 class TH1; 00017 00018 class MagneticFieldMap { 00019 00020 public: 00021 00022 // Constructor from a TrackerInteractionGeometry* 00023 MagneticFieldMap(const MagneticField* pmF, 00024 const TrackerInteractionGeometry* myGeo); 00025 00026 const GlobalVector inTesla( const GlobalPoint& ) const; 00027 const GlobalVector inKGauss( const GlobalPoint& ) const; 00028 const GlobalVector inInverseGeV( const GlobalPoint& ) const; 00029 const GlobalVector inTesla(const TrackerLayer& aLayer, double coord, int success) const; 00030 double inTeslaZ(const GlobalPoint&) const; 00031 double inKGaussZ(const GlobalPoint&) const; 00032 double inInverseGeVZ(const GlobalPoint&) const; 00033 double inTeslaZ(const TrackerLayer& aLayer, double coord, int success) const; 00034 00035 const MagneticField& magneticField() const {return *pMF_;} 00036 00037 private: 00038 00039 void initialize(); 00040 00041 const std::vector<double>* theFieldEndcapHisto(unsigned layer) const 00042 { return &(fieldEndcapHistos[layer]); } 00043 00044 const std::vector<double>* theFieldBarrelHisto(unsigned layer) const 00045 { return &(fieldBarrelHistos[layer]); } 00046 00047 const MagneticField* pMF_; 00048 const TrackerInteractionGeometry* geometry_; 00049 int bins; 00050 std::vector<std::vector<double> > fieldBarrelHistos; 00051 std::vector<std::vector<double> > fieldEndcapHistos; 00052 std::vector<double> fieldBarrelBinWidth; 00053 std::vector<double> fieldBarrelZMin; 00054 std::vector<double> fieldEndcapBinWidth; 00055 std::vector<double> fieldEndcapRMin; 00056 00057 }; 00058 00059 #endif // FastSimulation_ParticlePropagator_MagneticFieldMap_H