CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
11 
13 
14 #include <iostream>
15 
16 using namespace std;
17 
18 MagESector::MagESector(vector<MagELayer*>& layers, Geom::Phi<float> phiMin):
19  theLayers(layers),
20  thePhiMin(phiMin)
21 {}
22 
23 
25  for (vector<MagELayer *>::const_iterator ilay = theLayers.begin();
26  ilay != theLayers.end(); ++ilay) {
27  delete (*ilay);
28  }
29 }
30 
31 
32 const MagVolume * MagESector::findVolume(const GlobalPoint & gp, double tolerance) const {
33  const MagVolume * result = 0;
34  float Z = gp.z();
35 
36  // FIXME : use a binfinder
37  for(vector<MagELayer*>::const_reverse_iterator ilay = theLayers.rbegin();
38  ilay != theLayers.rend(); ++ilay) {
39 
40  if (Z+tolerance>(*ilay)->minZ()) {
41  if (Z-tolerance<(*ilay)->maxZ()) {
42 #ifdef MF_DEBUG
43  cout << " Trying elayer at Z " << (*ilay)->minZ() << " " << Z << endl ;
44 #endif
45  result = (*ilay)->findVolume(gp, tolerance);
46 #ifdef MF_DEBUG
47  cout << "***In elayer " << (result==0? " failed " : " OK ") << endl;
48 #endif
49  } else {
50  // break; // FIXME: OK if sorted by maxZ
51  }
52  }
53  if (result!=0) return result;
54  }
55 
56  return 0;
57 }
const double Z[kNumberCalorimeter]
std::vector< LayerSetAndLayers > layers(const SeedingLayerSetsHits &sets)
Definition: LayerTriplets.cc:4
const MagVolume * findVolume(const GlobalPoint &gp, double tolerance) const
Find the volume containing a point, with a given tolerance.
Definition: MagESector.cc:32
T z() const
Definition: PV3DBase.h:64
tuple result
Definition: query.py:137
std::vector< MagELayer * > theLayers
Definition: MagESector.h:33
MagESector(std::vector< MagELayer * > &layers, Geom::Phi< float > phiMin)
Constructor.
Definition: MagESector.cc:18
tuple cout
Definition: gather_cfg.py:121
virtual ~MagESector()
Destructor.
Definition: MagESector.cc:24