MagneticField
Layers
src
MagBRod.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/MagBRod.h
"
10
#include "
MagneticField/Layers/interface/MagBSlab.h
"
11
12
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
13
14
#include <iostream>
15
16
using namespace
std
;
17
18
MagBRod::MagBRod
(vector<MagBSlab *> &slabs,
Geom::Phi<float>
phiMin
)
19
: theSlabs(slabs), thePhiMin(
phiMin
), theBinFinder(nullptr) {
20
// LogTrace("MagGeometry") << "Building MagBRod with " << theSlabs.size()
21
// << " slabs, minPhi " << thePhiMin << endl;
22
23
if
(
theSlabs
.size() > 1) {
// Set the binfinder
24
vector<double> zBorders;
25
for
(vector<MagBSlab *>::const_iterator islab =
theSlabs
.begin(); islab !=
theSlabs
.end(); ++islab) {
26
LogTrace
(
"MagGeoBuilder"
) <<
" MagBSlab minZ="
<< (*islab)->minZ() << endl;
27
//FIXME assume layers are already sorted in Z
28
zBorders.push_back((*islab)->minZ());
29
}
30
theBinFinder
=
new
MagBinFinders::GeneralBinFinderInZ<double>
(zBorders);
31
}
32
}
33
34
MagBRod::~MagBRod
() {
35
delete
theBinFinder
;
36
37
for
(vector<MagBSlab *>::const_iterator islab =
theSlabs
.begin(); islab !=
theSlabs
.end(); ++islab) {
38
delete
(*islab);
39
}
40
}
41
42
const
MagVolume
*
MagBRod::findVolume
(
const
GlobalPoint
&
gp
,
double
tolerance
)
const
{
43
const
MagVolume
*
result
=
nullptr
;
44
float
Z
=
gp
.z();
45
46
int
bin
= 0;
47
if
(
theBinFinder
!=
nullptr
) {
// true if there is > 1 bin
48
bin
=
theBinFinder
->
binIndex
(
Z
);
49
}
50
51
LogTrace
(
"MagGeometry"
) <<
" Trying slab at Z "
<<
theSlabs
[
bin
]->minZ() <<
" "
<<
Z
<< endl;
52
result
=
theSlabs
[
bin
]->findVolume(
gp
,
tolerance
);
53
LogTrace
(
"MagGeometry"
) <<
"***In guessed bslab"
<< (
result
==
nullptr
?
" failed "
:
" OK "
) << endl;
54
55
return
result
;
56
}
MessageLogger.h
MagBRod::MagBRod
MagBRod(std::vector< MagBSlab * > &slabs, Geom::Phi< float > phiMin)
Constructor.
Definition:
MagBRod.cc:18
MagBRod::theBinFinder
MagBinFinders::GeneralBinFinderInZ< double > * theBinFinder
Definition:
MagBRod.h:42
MagBRod::theSlabs
std::vector< MagBSlab * > theSlabs
Definition:
MagBRod.h:40
MagBRod::~MagBRod
virtual ~MagBRod()
Destructor.
Definition:
MagBRod.cc:34
MagBinFinders::GeneralBinFinderInZ::binIndex
int binIndex(T z) const override
returns an index in the valid range for the bin closest to Z
Definition:
MagBinFinders.h:139
AlignmentTrackSelector_cfi.phiMin
phiMin
Definition:
AlignmentTrackSelector_cfi.py:18
Point3DBase< float, GlobalTag >
MagBRod::findVolume
const MagVolume * findVolume(const GlobalPoint &gp, double tolerance) const
Find the volume containing a point, with a given tolerance.
Definition:
MagBRod.cc:42
runTauDisplay.gp
gp
Definition:
runTauDisplay.py:431
MagVolume
Definition:
MagVolume.h:13
tolerance
const double tolerance
Definition:
HGCalGeomParameters.cc:29
Geom::Phi< float >
MagBSlab.h
newFWLiteAna.bin
bin
Definition:
newFWLiteAna.py:161
std
Definition:
JetResolutionObject.h:76
MagBRod.h
mps_fire.result
result
Definition:
mps_fire.py:311
LogTrace
#define LogTrace(id)
Definition:
MessageLogger.h:234
BeamSpotPI::Z
Definition:
BeamSpotPayloadInspectorHelper.h:33
MagBinFinders::GeneralBinFinderInZ< double >
Generated for CMSSW Reference Manual by
1.8.16