24 const std::vector<MagESector *>& tes,
25 const std::vector<MagVolume6Faces*>& tbv,
26 const std::vector<MagVolume6Faces*>& tev) :
31 const std::vector<MagESector const*>& tes,
32 const std::vector<MagVolume6Faces const*>& tbv,
33 const std::vector<MagVolume6Faces const*>& tev) :
36 vector<double> rBorders;
38 for (vector<MagBLayer const*>::const_iterator ilay =
theBLayers.begin();
42 rBorders.push_back((*ilay)->minR());
48 for (vector<MagESector const*>::const_iterator isec =
theESectors.begin();
50 cout <<
" Endcap sector at " << (*isec)->minPhi() << endl;
65 for (vector<MagBLayer const*>::const_iterator ilay =
theBLayers.begin();
70 for (vector<MagESector const*>::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*>::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*>::const_iterator
v =
theEVolumes.begin();
122 cout << endl <<
"***ERROR: MagGeometry::findVolume: MagVolume not set" << endl;
125 if ((*v)->inside(gp,tolerance)) {
139 auto lastVolumeCheck =
lastVolume.load(std::memory_order_acquire);
140 if (lastVolumeCheck!=
nullptr && lastVolumeCheck->inside(gp)){
141 return lastVolumeCheck;
146 double R = gp.
perp();
150 for (
int bin1 = bin; bin1 >=
max(0,bin-3); --bin1) {
152 <<
" " << R << endl ;
153 result =
theBLayers[bin1]->findVolume(gp, tolerance);
155 << (result==
nullptr?
" failed " :
" OK ") <<endl;
156 if (result !=
nullptr)
break;
166 << (result==
nullptr?
" failed " :
" OK ") <<endl;
170 if (result==
nullptr && tolerance < 0.0001) {
187 float Z = fabs(gp.
z());
193 (R>172.4 && Z<633.29) ||
194 (R>308.735 && Z<662.01));
197 (R>172.4 && Z<633.89) ||
198 (R>308.755 && Z<662.01));
201 (R>172.4 && Z<633.29) ||
202 (R>308.755 && Z<661.01));
Surface::GlobalVector GlobalVector
std::atomic< MagVolume const * > lastVolume
Geom::Phi< T > phi() const
int binIndex(T phi) const override
returns an index in the valid range for the bin that contains phi
~MagGeometry()
Destructor.
bool inBarrel(const GlobalPoint &gp) const
MagVolume const * findVolume(const GlobalPoint &gp, double tolerance=0.) const
Find a volume.
std::vector< MagESector const * > theESectors
PeriodicBinFinderInPhi< float > const * theEndcapBinFinder
MagVolume const * findVolume1(const GlobalPoint &gp, double tolerance=0.) const
int binIndex(T R) const override
std::vector< MagBLayer const * > theBLayers
bin
set the eta bin as selection string.
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.
MagGeometry(int geomVersion, const std::vector< MagBLayer * > &, const std::vector< MagESector * > &, const std::vector< MagVolume6Faces * > &, const std::vector< MagVolume6Faces * > &)
Constructor.
std::vector< MagVolume6Faces const * > theEVolumes
static constexpr bool debugOut
MagBinFinders::GeneralBinFinderInR< double > const * theBarrelBinFinder