#include <eSector.h>
Public Member Functions | |
MagESector * | buildMagESector () const |
Construct the MagESector upon request. | |
eSector (handles::const_iterator begin, handles::const_iterator end) | |
Constructor from list of volumes. | |
~eSector () | |
Destructor. | |
Private Attributes | |
std::vector< eLayer > | layers |
MagESector * | msector |
handles | theVolumes |
A sector of volumes in the endcap. One sector is composed of several layers (eLayer)
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(), and theVolumes.
: theVolumes(begin,end), msector(0) { //FIXME!!! //precomputed_value_sort(theVolumes.begin(), theVolumes.end(), ExtractAbsZ()); precomputed_value_sort(theVolumes.begin(), theVolumes.end(), ExtractZ()); // Clusterize in Z const float resolution = 1.; // cm //FIXME ?? float zmin = theVolumes.front()->center().z()-resolution; float zmax = theVolumes.back()->center().z()+resolution; ClusterizingHistogram hisZ( int((zmax-zmin)/resolution) + 1, zmin, zmax); if (MagGeoBuilderFromDDD::debug) cout << " Z layers: " << zmin << " " << zmax << endl; handles::const_iterator first = theVolumes.begin(); handles::const_iterator last = theVolumes.end(); for (handles::const_iterator i=first; i!=last; ++i){ hisZ.fill((*i)->center().z()); } vector<float> zClust = hisZ.clusterize(resolution); if (MagGeoBuilderFromDDD::debug) cout << " Found " << zClust.size() << " clusters in Z, " << " layers: " << endl; handles::const_iterator layStart = first; handles::const_iterator separ = first; for (unsigned int i=0; i<zClust.size() - 1; ++i) { float zSepar = (zClust[i] + zClust[i+1])/2.f; while ((*separ)->center().z() < zSepar) ++separ; if (MagGeoBuilderFromDDD::debug) { cout << " Layer at: " << zClust[i] << " elements: " << separ-layStart << " unique volumes: "; volumeHandle::printUniqueNames(layStart, separ); } layers.push_back(eLayer(layStart, separ)); layStart = separ; } { if (MagGeoBuilderFromDDD::debug) { cout << " Layer at: " << zClust.back() <<" elements: " << last-separ << " unique volumes: "; volumeHandle::printUniqueNames(separ,last); } layers.push_back(eLayer(separ, last)); } // FIXME: Check that all layers have the same dz?. }
MagGeoBuilderFromDDD::eSector::~eSector | ( | ) |
MagESector * MagGeoBuilderFromDDD::eSector::buildMagESector | ( | ) | const |
Construct the MagESector upon request.
Definition at line 84 of file eSector.cc.
{ if (msector==0) { vector<MagELayer*> mLayers; for (vector<eLayer>::const_iterator lay = layers.begin(); lay!=layers.end(); ++lay) { mLayers.push_back((*lay).buildMagELayer()); } msector = new MagESector(mLayers, theVolumes.front()->minPhi()); //FIXME } return msector; }
std::vector<eLayer> MagGeoBuilderFromDDD::eSector::layers [private] |
MagESector* MagGeoBuilderFromDDD::eSector::msector [mutable, private] |