MagneticField
GeomBuilder
src
eLayer.cc
Go to the documentation of this file.
1
/*
2
* See header file for a description of this class.
3
*
4
* \author N. Amapane - INFN Torino
5
*/
6
7
#include "
eLayer.h
"
8
#include "
MagneticField/VolumeGeometry/interface/MagVolume6Faces.h
"
9
#include "
MagneticField/Layers/interface/MagELayer.h
"
10
11
#include "
Utilities/General/interface/precomputed_value_sort.h
"
12
13
using namespace
SurfaceOrientation
;
14
using namespace
std
;
15
using namespace
magneticfield
;
16
17
//The ctor is in charge of finding sectors inside the layer.
18
eLayer::eLayer(handles::const_iterator begin, handles::const_iterator end) : theVolumes(begin, end), mlayer(nullptr) {
19
// bool debug=MagGeoBuilderFromDDD::debug;
20
21
// Sort in R
22
precomputed_value_sort
(
theVolumes
.begin(),
theVolumes
.end(),
ExtractR
());
23
24
// if (debug) {
25
// cout << " elements: " << theVolumes.size() << " unique volumes: ";
26
// volumeHandle::printUniqueNames(theVolumes.begin(), theVolumes.end());
27
// }
28
}
29
30
// double MagGeoBuilderFromDDD::eLayer::minR() const {
31
// // ASSUMPTION: a layer is only 1 volume thick (by construction).
32
// return theVolumes.front()->minR();
33
// }
34
35
// double MagGeoBuilderFromDDD::eLayer::maxR() const {
36
// // ASSUMPTION: a layer is only 1 volume thick (by construction).
37
// return theVolumes.front()->maxR();
38
// }
39
40
MagELayer
*
eLayer::buildMagELayer
()
const
{
41
if
(
mlayer
==
nullptr
) {
42
//FIXME not guaranteed that all volumes in layer have the same zmin
43
// and zmax!
44
double
zmin
= 1e19;
45
double
zmax
= -1e19;
46
vector<MagVolume*> mVols;
47
for
(handles::const_iterator vol =
theVolumes
.begin(); vol !=
theVolumes
.end(); ++vol) {
48
mVols.push_back((*vol)->magVolume);
49
zmin
=
min
(
zmin
, (*vol)->minZ());
50
zmax
=
max
(
zmax
, (*vol)->maxZ());
51
}
52
mlayer
=
new
MagELayer
(mVols,
zmin
,
zmax
);
53
}
54
return
mlayer
;
55
}
magneticfield::eLayer::mlayer
MagELayer * mlayer
Definition:
eLayer.h:31
SurfaceOrientation
Definition:
Surface.h:17
SiStripMonitorCluster_cfi.zmax
zmax
Definition:
SiStripMonitorCluster_cfi.py:215
MagELayer.h
MagVolume6Faces.h
magneticfield::eLayer::theVolumes
handles theVolumes
Definition:
eLayer.h:30
std
Definition:
JetResolutionObject.h:76
eLayer.h
MagELayer
Definition:
MagELayer.h:16
magneticfield::eLayer::buildMagELayer
MagELayer * buildMagELayer() const
Construct the MagELayer upon request.
Definition:
eLayer.cc:40
SiStripPI::min
Definition:
SiStripPayloadInspectorHelper.h:178
SiStripPI::max
Definition:
SiStripPayloadInspectorHelper.h:178
precomputed_value_sort
void precomputed_value_sort(RandomAccessIterator begin, RandomAccessIterator end, const Extractor &extr, const Compare &comp)
Definition:
precomputed_value_sort.h:17
magneticfield::ExtractR
Definition:
BaseVolumeHandle.h:187
magneticfield
Definition:
MagFieldConfig.h:22
SiStripMonitorCluster_cfi.zmin
zmin
Definition:
SiStripMonitorCluster_cfi.py:214
precomputed_value_sort.h
Generated for CMSSW Reference Manual by
1.8.14