12 fieldBarrelHistos(200,static_cast<std::vector<double> >
13 (std::vector<double>(
bins,static_cast<double>(0.)))),
14 fieldEndcapHistos(200,static_cast<std::vector<double> >
15 (std::vector<double>(
bins,static_cast<double>(0.)))),
16 fieldBarrelBinWidth(200,static_cast<double>(0.)),
17 fieldBarrelZMin(200,static_cast<double>(0.)),
18 fieldEndcapBinWidth(200,static_cast<double>(0.)),
19 fieldEndcapRMin(200,static_cast<double>(0.))
23 std::list<TrackerLayer>::const_iterator cyliter;
29 for ( cyliter=cylitBeg; cyliter != cylitEnd; ++cyliter ) {
30 int layer = cyliter->layerNumber();
38 if ( cyliter->forward() ) {
39 zmax = cyliter->disk()->position().z();
40 rmax = cyliter->disk()->outerRadius();
42 zmax = cyliter->cylinder()->bounds().length()/2.;
43 rmax = cyliter->cylinder()->bounds().width()/2.
44 - cyliter->cylinder()->bounds().thickness()/2.;
51 step = (rmax-rmin)/(
bins-1);
63 step = (zmax-zmin)/(
bins-1);
69 for (
double zed=zmin+step/2.; zed<zmax+
step; zed+=
step ) {
109 return inKGauss(gp) * 2.99792458e-4;
131 const std::vector<double>* theHisto;
133 if ( success == 1 ) {
144 double x = fabs(coord);
145 unsigned bin = (unsigned) ((x-theXMin)/theBinWidth);
146 if ( bin+1 == (
unsigned)
bins ) bin -= 1;
147 double x1 = theXMin + (bin-0.5)*theBinWidth;
148 double x2 = x1+theBinWidth;
151 double field1 = (*theHisto)[
bin];
152 double field2 = (*theHisto)[bin+1];
154 return field1 + (field2-field1) * (x-x1)/(x2-x1);
std::vector< double > fieldEndcapBinWidth
double inTeslaZ(const GlobalPoint &) const
unsigned int layerNumber() const
Returns the layer number.
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
double inInverseGeVZ(const GlobalPoint &) const
Global3DPoint GlobalPoint
std::list< TrackerLayer >::const_iterator cylinderEnd() const
Returns the last pointer in the cylinder list.
const GlobalVector inKGauss(const GlobalPoint &) const
double inKGaussZ(const GlobalPoint &) const
const GlobalVector inTesla(const GlobalPoint &) const
const MagneticField * pMF_
std::vector< double > fieldEndcapRMin
MagneticFieldMap(const MagneticField *pmF, const TrackerInteractionGeometry *myGeo)
const GlobalVector inInverseGeV(const GlobalPoint &) const
const TrackerInteractionGeometry * geometry_
std::vector< std::vector< double > > fieldBarrelHistos
std::vector< double > fieldBarrelBinWidth
std::list< TrackerLayer >::const_iterator cylinderBegin() const
Returns the first pointer in the cylinder list.
const std::vector< double > * theFieldEndcapHisto(unsigned layer) const
std::vector< double > fieldBarrelZMin
std::vector< std::vector< double > > fieldEndcapHistos
const std::vector< double > * theFieldBarrelHisto(unsigned layer) const
Global3DVector GlobalVector