src
MagneticField
Layers
src
MagESector.cc
Go to the documentation of this file.
1
// #include "Utilities/Configuration/interface/Architecture.h"
2
3
/*
4
* See header file for a description of this class.
5
*
6
* \author N. Amapane - INFN Torino
7
*/
8
9
#include "
MagneticField/Layers/interface/MagESector.h
"
10
#include "
MagneticField/Layers/interface/MagELayer.h
"
11
12
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
13
14
#include <iostream>
15
16
using namespace
std
;
17
18
MagESector::MagESector
(vector<MagELayer*>&
layers
,
Geom::Phi<float>
phiMin
) : theLayers(
layers
), thePhiMin(
phiMin
) {}
19
20
MagESector::~MagESector
() {
21
for
(vector<MagELayer*>::const_iterator ilay =
theLayers
.begin(); ilay !=
theLayers
.end(); ++ilay) {
22
delete
(*ilay);
23
}
24
}
25
26
const
MagVolume
*
MagESector::findVolume
(
const
GlobalPoint
&
gp
,
double
tolerance
)
const
{
27
const
MagVolume
*
result
=
nullptr
;
28
float
Z
=
gp
.z();
29
30
// FIXME : use a binfinder
31
for
(vector<MagELayer*>::const_reverse_iterator ilay =
theLayers
.rbegin(); ilay !=
theLayers
.rend(); ++ilay) {
32
if
(
Z
+
tolerance
> (*ilay)->minZ()) {
33
if
(
Z
-
tolerance
< (*ilay)->maxZ()) {
34
LogTrace
(
"MagGeometry"
) <<
" Trying elayer at Z "
<< (*ilay)->minZ() <<
" "
<<
Z
<< endl;
35
result
= (*ilay)->findVolume(
gp
,
tolerance
);
36
LogTrace
(
"MagGeometry"
) <<
"***In elayer "
<< (
result
==
nullptr
?
" failed "
:
" OK "
) << endl;
37
}
else
{
38
// break; // FIXME: OK if sorted by maxZ
39
}
40
}
41
if
(
result
!=
nullptr
)
42
return
result
;
43
}
44
45
return
nullptr
;
46
}
hgcalTBTopologyTester_cfi.layers
layers
Definition:
hgcalTBTopologyTester_cfi.py:8
MessageLogger.h
mps_fire.result
result
Definition:
mps_fire.py:311
tolerance
const double tolerance
Definition:
HGCalGeomParameters.cc:29
MagELayer.h
MagESector::findVolume
const MagVolume * findVolume(const GlobalPoint &gp, double tolerance) const
Find the volume containing a point, with a given tolerance.
Definition:
MagESector.cc:26
std
Definition:
JetResolutionObject.h:76
LogTrace
#define LogTrace(id)
Definition:
MessageLogger.h:234
runTauDisplay.gp
gp
Definition:
runTauDisplay.py:431
AlignmentTrackSelector_cfi.phiMin
phiMin
Definition:
AlignmentTrackSelector_cfi.py:18
MagVolume
Definition:
MagVolume.h:13
MagESector::MagESector
MagESector(std::vector< MagELayer *> &layers, Geom::Phi< float > phiMin)
Constructor.
Definition:
MagESector.cc:18
MagESector::theLayers
std::vector< MagELayer * > theLayers
Definition:
MagESector.h:33
Point3DBase< float, GlobalTag >
MagESector::~MagESector
virtual ~MagESector()
Destructor.
Definition:
MagESector.cc:20
MagESector.h
Geom::Phi< float >
BeamSpotPI::Z
Definition:
BeamSpotPayloadInspectorHelper.h:36
Generated for CMSSW Reference Manual by
1.8.14