forked from cms-sw/cmssw
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMagELayer.cc
41 lines (33 loc) · 1.25 KB
/
MagELayer.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// #include "Utilities/Configuration/interface/Architecture.h"
/*
* See header file for a description of this class.
*
* \author N. Amapane - INFN Torino
*/
#include "MagneticField/Layers/interface/MagELayer.h"
#include "MagneticField/VolumeGeometry/interface/MagVolume.h"
#include "MagneticField/VolumeGeometry/interface/MagVolume6Faces.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include <iostream>
using namespace std;
MagELayer::MagELayer(const vector<MagVolume*>& volumes, double zMin, double zMax)
: theVolumes(volumes), theZMin(zMin), theZMax(zMax) {}
MagELayer::~MagELayer() {
for (vector<MagVolume*>::const_iterator ivol = theVolumes.begin(); ivol != theVolumes.end(); ++ivol) {
delete (*ivol);
}
}
const MagVolume* MagELayer::findVolume(const GlobalPoint& gp, double tolerance) const {
for (vector<MagVolume*>::const_iterator ivol = theVolumes.begin(); ivol != theVolumes.end(); ++ivol) {
// FIXME : use a binfinder
#ifdef EDM_ML_DEBUG
{
MagVolume6Faces* mv = static_cast<MagVolume6Faces*>(*ivol);
LogTrace("MagGeometry") << " Trying volume " << mv->volumeNo << " " << int(mv->copyno) << endl;
}
#endif
if ((*ivol)->inside(gp, tolerance))
return (*ivol);
}
return nullptr;
}