CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
MagGeoBuilderFromDDD::eSector Class Reference

#include <eSector.h>

Public Member Functions

MagESectorbuildMagESector () const
 Construct the MagESector upon request. More...
 
 eSector (handles::const_iterator begin, handles::const_iterator end)
 Constructor from list of volumes. More...
 
 ~eSector ()
 Destructor. More...
 

Private Attributes

std::vector< eLayerlayers
 
MagESectormsector
 
handles theVolumes
 

Detailed Description

A sector of volumes in the endcap. One sector is composed of several layers (eLayer)

Author
N. Amapane - INFN Torino

Definition at line 17 of file eSector.h.

Constructor & Destructor Documentation

MagGeoBuilderFromDDD::eSector::eSector ( handles::const_iterator  begin,
handles::const_iterator  end 
)

Constructor from list of volumes.

Definition at line 21 of file eSector.cc.

References ClusterizingHistogram::clusterize(), gather_cfg::cout, MagGeoBuilderFromDDD::debug, f, ClusterizingHistogram::fill(), plotBeamSpotDB::first, mps_fire::i, plotBeamSpotDB::last, layers, precomputed_value_sort(), MagGeoBuilderFromDDD::volumeHandle::printUniqueNames(), fftjetproducer_cfi::resolution, and theVolumes.

22  :
24  msector(nullptr)
25 {
26  //FIXME!!!
27  //precomputed_value_sort(theVolumes.begin(), theVolumes.end(), ExtractAbsZ());
28  precomputed_value_sort(theVolumes.begin(), theVolumes.end(), ExtractZ());
29 
30 
31  // Clusterize in Z
32  const float resolution = 1.; // cm //FIXME ??
33  float zmin = theVolumes.front()->center().z()-resolution;
34  float zmax = theVolumes.back()->center().z()+resolution;
35  ClusterizingHistogram hisZ( int((zmax-zmin)/resolution) + 1, zmin, zmax);
36 
37  if (MagGeoBuilderFromDDD::debug) cout << " Z layers: " << zmin << " " << zmax << endl;
38 
39  handles::const_iterator first = theVolumes.begin();
40  handles::const_iterator last = theVolumes.end();
41 
42  for (handles::const_iterator i=first; i!=last; ++i){
43  hisZ.fill((*i)->center().z());
44  }
45  vector<float> zClust = hisZ.clusterize(resolution);
46 
47  if (MagGeoBuilderFromDDD::debug) cout << " Found " << zClust.size() << " clusters in Z, "
48  << " layers: " << endl;
49 
50  handles::const_iterator layStart = first;
51  handles::const_iterator separ = first;
52 
53  for (unsigned int i=0; i<zClust.size() - 1; ++i) {
54  float zSepar = (zClust[i] + zClust[i+1])/2.f;
55  while ((*separ)->center().z() < zSepar) ++separ;
57  cout << " Layer at: " << zClust[i]
58  << " elements: " << separ-layStart << " unique volumes: ";
59  volumeHandle::printUniqueNames(layStart, separ);
60  }
61 
62  layers.push_back(eLayer(layStart, separ));
63  layStart = separ;
64  }
65  {
67  cout << " Layer at: " << zClust.back() <<" elements: " << last-separ
68  << " unique volumes: ";
70  }
71  layers.push_back(eLayer(separ, last));
72  }
73 
74  // FIXME: Check that all layers have the same dz?.
75 
76 }
std::vector< eLayer > layers
Definition: eSector.h:32
double f[11][100]
#define end
Definition: vmac.h:39
static void printUniqueNames(handles::const_iterator begin, handles::const_iterator end, bool uniq=true)
Just for debugging...
#define begin
Definition: vmac.h:32
void precomputed_value_sort(RandomAccessIterator begin, RandomAccessIterator end, const Extractor &extr)
MagGeoBuilderFromDDD::eSector::~eSector ( )

Destructor.

Definition at line 79 of file eSector.cc.

79 {}

Member Function Documentation

MagESector * MagGeoBuilderFromDDD::eSector::buildMagESector ( ) const

Construct the MagESector upon request.

Definition at line 82 of file eSector.cc.

References layers, msector, and theVolumes.

82  {
83  if (msector==nullptr) {
84  vector<MagELayer*> mLayers;
85  for (vector<eLayer>::const_iterator lay = layers.begin();
86  lay!=layers.end(); ++lay) {
87  mLayers.push_back((*lay).buildMagELayer());
88  }
89  msector = new MagESector(mLayers, theVolumes.front()->minPhi()); //FIXME
90  }
91  return msector;
92 }
std::vector< eLayer > layers
Definition: eSector.h:32

Member Data Documentation

std::vector<eLayer> MagGeoBuilderFromDDD::eSector::layers
private

Definition at line 32 of file eSector.h.

Referenced by buildMagESector(), and eSector().

MagESector* MagGeoBuilderFromDDD::eSector::msector
mutableprivate

Definition at line 34 of file eSector.h.

Referenced by buildMagESector().

handles MagGeoBuilderFromDDD::eSector::theVolumes
private

Definition at line 33 of file eSector.h.

Referenced by buildMagESector(), and eSector().