CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
magneticfield::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, bool debugFlag=false)
 Constructor from list of volumes. More...
 
 ~eSector ()=default
 Destructor. More...
 

Private Attributes

const bool debug
 
std::vector< eLayerlayers
 
MagESectormsector
 
handles theVolumes
 

Detailed Description

Definition at line 16 of file eSector.h.

Constructor & Destructor Documentation

◆ eSector()

eSector::eSector ( handles::const_iterator  begin,
handles::const_iterator  end,
bool  debugFlag = false 
)

Constructor from list of volumes.

Definition at line 21 of file eSector.cc.

22  : theVolumes(begin, end), msector(nullptr), debug(debugFlag) {
23  //FIXME!!!
24  //precomputed_value_sort(theVolumes.begin(), theVolumes.end(), ExtractAbsZ());
26 
27  // Clusterize in Z
28  const float resolution = 1.; // cm //FIXME ??
29  float zmin = theVolumes.front()->center().z() - resolution;
30  float zmax = theVolumes.back()->center().z() + resolution;
31  ClusterizingHistogram hisZ(int((zmax - zmin) / resolution) + 1, zmin, zmax);
32 
33  if (debug)
34  cout << " Z layers: " << zmin << " " << zmax << endl;
35 
36  handles::const_iterator first = theVolumes.begin();
37  handles::const_iterator last = theVolumes.end();
38 
39  for (handles::const_iterator i = first; i != last; ++i) {
40  hisZ.fill((*i)->center().z());
41  }
42  vector<float> zClust = hisZ.clusterize(resolution);
43 
44  if (debug)
45  cout << " Found " << zClust.size() << " clusters in Z, "
46  << " layers: " << endl;
47 
48  handles::const_iterator layStart = first;
49  handles::const_iterator separ = first;
50 
51  for (unsigned int i = 0; i < zClust.size() - 1; ++i) {
52  float zSepar = (zClust[i] + zClust[i + 1]) / 2.f;
53  while ((*separ)->center().z() < zSepar)
54  ++separ;
55  if (debug) {
56  cout << " Layer at: " << zClust[i] << " elements: " << separ - layStart << " unique volumes: ";
57  printUniqueNames(layStart, separ);
58  }
59 
60  layers.push_back(eLayer(layStart, separ));
61  layStart = separ;
62  }
63  {
64  if (debug) {
65  cout << " Layer at: " << zClust.back() << " elements: " << last - separ << " unique volumes: ";
66  printUniqueNames(separ, last);
67  }
68  layers.push_back(eLayer(separ, last));
69  }
70 
71  // FIXME: Check that all layers have the same dz?.
72 }

References ClusterizingHistogram::clusterize(), gather_cfg::cout, debug, f, ClusterizingHistogram::fill(), first, mps_fire::i, dqmdumpme::last, layers, precomputed_value_sort(), magneticfield::printUniqueNames(), L1TObjectsTimingClient_cff::resolution, theVolumes, SiStripMonitorCluster_cfi::zmax, and SiStripMonitorCluster_cfi::zmin.

◆ ~eSector()

magneticfield::eSector::~eSector ( )
default

Destructor.

Member Function Documentation

◆ buildMagESector()

MagESector * eSector::buildMagESector ( ) const

Construct the MagESector upon request.

Definition at line 74 of file eSector.cc.

74  {
75  if (msector == nullptr) {
76  vector<MagELayer*> mLayers;
77  for (vector<eLayer>::const_iterator lay = layers.begin(); lay != layers.end(); ++lay) {
78  mLayers.push_back((*lay).buildMagELayer());
79  }
80  msector = new MagESector(mLayers, theVolumes.front()->minPhi()); //FIXME
81  }
82  return msector;
83 }

References layers, msector, and theVolumes.

Member Data Documentation

◆ debug

const bool magneticfield::eSector::debug
private

◆ layers

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

Definition at line 31 of file eSector.h.

Referenced by buildMagESector(), and eSector().

◆ msector

MagESector* magneticfield::eSector::msector
mutableprivate

Definition at line 33 of file eSector.h.

Referenced by buildMagESector().

◆ theVolumes

handles magneticfield::eSector::theVolumes
private

Definition at line 32 of file eSector.h.

Referenced by buildMagESector(), and eSector().

mps_fire.i
i
Definition: mps_fire.py:428
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
gather_cfg.cout
cout
Definition: gather_cfg.py:144
magneticfield::printUniqueNames
void printUniqueNames(handles::const_iterator begin, handles::const_iterator end, bool uniq=true)
Just for debugging...
Definition: printUniqueNames.cc:9
SiStripMonitorCluster_cfi.zmin
zmin
Definition: SiStripMonitorCluster_cfi.py:200
magneticfield::ExtractZ
Definition: BaseVolumeHandle.h:159
magneticfield::eSector::debug
const bool debug
Definition: eSector.h:34
dqmdumpme.last
last
Definition: dqmdumpme.py:56
magneticfield::eSector::theVolumes
handles theVolumes
Definition: eSector.h:32
SiStripMonitorCluster_cfi.zmax
zmax
Definition: SiStripMonitorCluster_cfi.py:201
mps_fire.end
end
Definition: mps_fire.py:242
L1TObjectsTimingClient_cff.resolution
resolution
Definition: L1TObjectsTimingClient_cff.py:52
magneticfield::eSector::msector
MagESector * msector
Definition: eSector.h:33
first
auto first
Definition: CAHitNtupletGeneratorKernelsImpl.h:125
BeamSplash_cfg.debugFlag
debugFlag
Definition: BeamSplash_cfg.py:21
MagESector
Definition: MagESector.h:18
magneticfield::eLayer
Definition: eLayer.h:15
precomputed_value_sort
void precomputed_value_sort(RandomAccessIterator begin, RandomAccessIterator end, const Extractor &extr, const Compare &comp)
Definition: precomputed_value_sort.h:17
magneticfield::eSector::layers
std::vector< eLayer > layers
Definition: eSector.h:31
ClusterizingHistogram
Definition: ClusterizingHistogram.h:13