27 std::vector<MagESector *> tes,
28 std::vector<MagVolume6Faces*> tbv,
29 std::vector<MagVolume6Faces*> tev) :
30 lastVolume(0), theBLayers(tbl), theESectors(tes), theBVolumes(tbv), theEVolumes(tev), geometryVersion(0)
36 vector<double> rBorders;
38 for (vector<MagBLayer *>::const_iterator ilay =
theBLayers.begin();
42 rBorders.push_back((*ilay)->minR());
48 for (vector<MagESector *>::const_iterator isec =
theESectors.begin();
50 cout <<
" Endcap sector at " << (*isec)->minPhi() << endl;
65 for (vector<MagBLayer *>::const_iterator ilay =
theBLayers.begin();
70 for (vector<MagESector *>::const_iterator ilay =
theESectors.begin();
90 LogWarning(
"InvalidInput") <<
"Input value invalid (not a number): " << gp << endl;
93 LogWarning(
"MagneticField") <<
"MagGeometry::fieldInTesla: failed to find volume for " << gp << endl;
106 for (vector<MagVolume6Faces*>::const_iterator
v =
theBVolumes.begin();
109 cout << endl <<
"***ERROR: MagGeometry::findVolume: MagVolume not set" << endl;
112 if ((*v)->inside(gp,tolerance)) {
119 for (vector<MagVolume6Faces*>::const_iterator
v =
theEVolumes.begin();
122 cout << endl <<
"***ERROR: MagGeometry::findVolume: MagVolume not set" << endl;
125 if ((*v)->inside(gp,tolerance)) {
145 double R = gp.
perp();
148 for (
int bin1 = bin; bin1 >=
max(0,bin-2); --bin1) {
150 <<
" " << R << endl ;
151 result =
theBLayers[bin1]->findVolume(gp, tolerance);
153 << (result==0?
" failed " :
" OK ") <<endl;
154 if (result != 0)
break;
164 << (result==0?
" failed " :
" OK ") <<endl;
168 if (result==0 && tolerance < 0.0001) {
185 float Z = fabs(gp.
z());
191 (R>172.4 && Z<633.29) ||
192 (R>308.7345 && Z<662.01));
195 (R>172.4 && Z<633.89) ||
196 (R>308.755 && Z<662.01));
199 (R>172.4 && Z<633.29) ||
200 (R>308.755 && Z<661.01));
const double Z[kNumberCalorimeter]
Surface::GlobalVector GlobalVector
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
virtual int binIndex(T R) const
MagVolume * findVolume1(const GlobalPoint &gp, double tolerance=0.) const
Geom::Phi< T > phi() const
PeriodicBinFinderInPhi< float > * theEndcapBinFinder
~MagGeometry()
Destructor.
bool inBarrel(const GlobalPoint &gp) const
virtual int binIndex(T phi) const
returns an index in the valid range for the bin that contains phi
MagGeometry(const edm::ParameterSet &config, std::vector< MagBLayer * >, std::vector< MagESector * >, std::vector< MagVolume6Faces * >, std::vector< MagVolume6Faces * >)
Constructor.
virtual bool inside(const GlobalPoint &gp, double tolerance=0.) const =0
MagBinFinders::GeneralBinFinderInR< double > * theBarrelBinFinder
const T & max(const T &a, const T &b)
std::vector< MagVolume6Faces * > theEVolumes
std::vector< MagVolume6Faces * > theBVolumes
std::vector< MagESector * > theESectors
LocalVector fieldInTesla(const LocalPoint &lp) const
GlobalVector fieldInTesla(const GlobalPoint &gp) const
Return field vector at the specified global point.
MagVolume * findVolume(const GlobalPoint &gp, double tolerance=0.) const
Find a volume.
std::vector< MagBLayer * > theBLayers