26 std::vector<MagESector *> tes,
27 std::vector<MagVolume6Faces*> tbv,
28 std::vector<MagVolume6Faces*> tev) :
29 lastVolume(0), theBLayers(tbl), theESectors(tes), theBVolumes(tbv), theEVolumes(tev), geometryVersion(0)
35 if (config.
exists(
"geometryVersion")) {
41 vector<double> rBorders;
43 for (vector<MagBLayer *>::const_iterator ilay =
theBLayers.begin();
47 rBorders.push_back((*ilay)->minR());
53 for (vector<MagESector *>::const_iterator isec =
theESectors.begin();
55 cout <<
" Endcap sector at " << (*isec)->minPhi() << endl;
70 for (vector<MagBLayer *>::const_iterator ilay =
theBLayers.begin();
75 for (vector<MagESector *>::const_iterator ilay =
theESectors.begin();
95 LogWarning(
"InvalidInput") <<
"Input value invalid (not a number): " << gp << endl;
98 LogWarning(
"MagneticField") <<
"MagGeometry::fieldInTesla: failed to find volume for " << gp << endl;
111 for (vector<MagVolume6Faces*>::const_iterator
v =
theBVolumes.begin();
114 cout << endl <<
"***ERROR: MagGeometry::findVolume: MagVolume not set" << endl;
117 if ((*v)->inside(gp,tolerance)) {
124 for (vector<MagVolume6Faces*>::const_iterator
v =
theEVolumes.begin();
127 cout << endl <<
"***ERROR: MagGeometry::findVolume: MagVolume not set" << endl;
130 if ((*v)->inside(gp,tolerance)) {
150 double R = gp.
perp();
153 for (
int bin1 = bin; bin1 >=
max(0,bin-2); --bin1) {
155 <<
" " << R << endl ;
156 result =
theBLayers[bin1]->findVolume(gp, tolerance);
158 << (result==0?
" failed " :
" OK ") <<endl;
159 if (result != 0)
break;
169 << (result==0?
" failed " :
" OK ") <<endl;
173 if (result==0 && tolerance < 0.0001) {
190 float Z = fabs(gp.
z());
196 (R>172.4 && Z<633.89) ||
197 (R>308.755 && Z<662.01));
200 (R>172.4 && Z<633.29) ||
201 (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
bool exists(std::string const ¶meterName) const
checks if a parameter exists
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