25 const std::vector<MagESector *>& tes,
26 const std::vector<MagVolume6Faces*>& tbv,
27 const std::vector<MagVolume6Faces*>& tev) :
32 const std::vector<MagESector const*>& tes,
33 const std::vector<MagVolume6Faces const*>& tbv,
34 const std::vector<MagVolume6Faces const*>& tev) :
35 lastVolume(0), theBLayers(tbl), theESectors(tes), theBVolumes(tbv), theEVolumes(tev), geometryVersion(0)
41 vector<double> rBorders;
43 for (vector<MagBLayer const*>::const_iterator ilay =
theBLayers.begin();
47 rBorders.push_back((*ilay)->minR());
53 for (vector<MagESector const*>::const_iterator isec =
theESectors.begin();
55 cout <<
" Endcap sector at " << (*isec)->minPhi() << endl;
70 for (vector<MagBLayer const*>::const_iterator ilay =
theBLayers.begin();
75 for (vector<MagESector const*>::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*>::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*>::const_iterator
v =
theEVolumes.begin();
127 cout << endl <<
"***ERROR: MagGeometry::findVolume: MagVolume not set" << endl;
130 if ((*v)->inside(gp,tolerance)) {
144 auto lastVolumeCheck =
lastVolume.load(std::memory_order_acquire);
145 if (lastVolumeCheck!=
nullptr && lastVolumeCheck->inside(gp)){
146 return lastVolumeCheck;
151 double R = gp.
perp();
154 for (
int bin1 = bin; bin1 >=
max(0,bin-2); --bin1) {
156 <<
" " << R << endl ;
157 result =
theBLayers[bin1]->findVolume(gp, tolerance);
159 << (result==0?
" failed " :
" OK ") <<endl;
160 if (result != 0)
break;
170 << (result==0?
" failed " :
" OK ") <<endl;
174 if (result==0 && tolerance < 0.0001) {
191 float Z = fabs(gp.
z());
197 (R>172.4 && Z<633.29) ||
198 (R>308.7345 && Z<662.01));
201 (R>172.4 && Z<633.89) ||
202 (R>308.755 && Z<662.01));
205 (R>172.4 && Z<633.29) ||
206 (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
MagGeometry(const edm::ParameterSet &config, const std::vector< MagBLayer * > &, const std::vector< MagESector * > &, const std::vector< MagVolume6Faces * > &, const std::vector< MagVolume6Faces * > &)
Constructor.
std::atomic< MagVolume const * > lastVolume
Geom::Phi< T > phi() const
~MagGeometry()
Destructor.
bool inBarrel(const GlobalPoint &gp) const
MagVolume const * findVolume(const GlobalPoint &gp, double tolerance=0.) const
Find a volume.
virtual int binIndex(T phi) const
returns an index in the valid range for the bin that contains phi
const T & max(const T &a, const T &b)
std::vector< MagESector const * > theESectors
PeriodicBinFinderInPhi< float > const * theEndcapBinFinder
MagVolume const * findVolume1(const GlobalPoint &gp, double tolerance=0.) const
std::vector< MagBLayer const * > theBLayers
std::vector< MagVolume6Faces const * > theBVolumes
LocalVector fieldInTesla(const LocalPoint &lp) const
GlobalVector fieldInTesla(const GlobalPoint &gp) const
Return field vector at the specified global point.
std::vector< MagVolume6Faces const * > theEVolumes
static constexpr bool debugOut
MagBinFinders::GeneralBinFinderInR< double > const * theBarrelBinFinder