CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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)

Date:
2005/09/27 15:15:52
Revision:
1.2
Author
N. Amapane - INFN Torino

Definition at line 19 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 23 of file eSector.cc.

References ClusterizingHistogram::clusterize(), gather_cfg::cout, MagGeoBuilderFromDDD::debug, f, ClusterizingHistogram::fill(), first, i, prof2calltree::last, layers, precomputed_value_sort(), MagGeoBuilderFromDDD::volumeHandle::printUniqueNames(), dtDQMClient_cfg::resolution, theVolumes, SiStripMonitorClusterAlca_cfi::zmax, and SiStripMonitorClusterAlca_cfi::zmin.

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

Destructor.

Definition at line 81 of file eSector.cc.

81 {}

Member Function Documentation

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

Construct the MagESector upon request.

Definition at line 84 of file eSector.cc.

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

Member Data Documentation

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

Definition at line 34 of file eSector.h.

Referenced by eSector().

MagESector* MagGeoBuilderFromDDD::eSector::msector
mutableprivate

Definition at line 36 of file eSector.h.

handles MagGeoBuilderFromDDD::eSector::theVolumes
private

Definition at line 35 of file eSector.h.

Referenced by eSector().