CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
ME0ReDigiProducer::TemporaryGeometry Class Reference

Public Member Functions

unsigned int findEtaPartition (float locY) const
 
float getCentralTOF (const ME0DetId &me0Id, unsigned int partIdx) const
 
float getPartCenter (const unsigned int partIdx) const
 
const TrapezoidalStripTopologygetTopo (const unsigned int partIdx) const
 
unsigned int numLayers () const
 
 TemporaryGeometry (const ME0Geometry *geometry, const unsigned int numberOfStrips, const unsigned int numberOfPartitions)
 
 ~TemporaryGeometry ()
 

Private Member Functions

TrapezoidalStripTopologybuildTopo (const std::vector< float > &_p) const
 

Private Attributes

float middleDistanceFromBeam
 
std::vector< float > partitionTops
 
std::vector< TrapezoidalStripTopology * > stripTopos
 
std::vector< std::vector< double > > tofs
 

Detailed Description

Definition at line 47 of file ME0ReDigiProducer.cc.

Constructor & Destructor Documentation

◆ TemporaryGeometry()

ME0ReDigiProducer::TemporaryGeometry::TemporaryGeometry ( const ME0Geometry geometry,
const unsigned int  numberOfStrips,
const unsigned int  numberOfPartitions 
)

Definition at line 126 of file ME0ReDigiProducer.cc.

128  {
129  //First test geometry to make sure that it is compatible with our assumptions
130  const auto& chambers = geometry->chambers();
131  if (chambers.empty())
132  throw cms::Exception("Setup")
133  << "ME0ReDigiProducer::TemporaryGeometry::TemporaryGeometry() - No ME0Chambers in geometry.";
134  const auto* mainChamber = chambers.front();
135  const unsigned int nLayers = chambers.front()->nLayers();
136  if (!nLayers)
137  throw cms::Exception("Setup")
138  << "ME0ReDigiProducer::TemporaryGeometry::TemporaryGeometry() - ME0Chamber has no layers.";
139  const auto* mainLayer = mainChamber->layers()[0];
140  if (!mainLayer->nEtaPartitions())
141  throw cms::Exception("Setup")
142  << "ME0ReDigiProducer::TemporaryGeometry::TemporaryGeometry() - ME0Layer has no partitions.";
143  if (mainLayer->nEtaPartitions() != 1)
144  throw cms::Exception("Setup") << "ME0ReDigiProducer::TemporaryGeometry::TemporaryGeometry() - This module is only "
145  "compatitble with geometries that contain only one partition per ME0Layer.";
146 
147  const auto* mainPartition = mainLayer->etaPartitions()[0];
148  const TrapezoidalStripTopology* mainTopo = dynamic_cast<const TrapezoidalStripTopology*>(&mainPartition->topology());
149  if (!mainTopo)
150  throw cms::Exception("Setup") << "ME0ReDigiProducer::TemporaryGeometry::TemporaryGeometry() - ME0 strip topology "
151  "must be of type TrapezoidalStripTopology. This module cannot be used";
152 
153  for (const auto& chamber : geometry->chambers()) {
154  if (chamber->nLayers() != int(nLayers))
155  throw cms::Exception("Setup") << "ME0ReDigiProducer::TemporaryGeometry::TemporaryGeometry() - Not all "
156  "ME0Chambers have the same number of layers. This module cannot be used.";
157  for (unsigned int iL = 0; iL < nLayers; ++iL) {
158  if (chamber->layers()[iL]->nEtaPartitions() != mainLayer->nEtaPartitions())
159  throw cms::Exception("Setup") << "ME0ReDigiProducer::TemporaryGeometry::TemporaryGeometry() - Not all "
160  "ME0Layers have the same number of partitions. This module cannot be used.";
161  if (chamber->layers()[iL]->etaPartitions()[0]->specs()->parameters() != mainPartition->specs()->parameters())
162  throw cms::Exception("Setup") << "ME0ReDigiProducer::TemporaryGeometry::TemporaryGeometry() - Not all ME0 ETA "
163  "partitions have the same properties. This module cannot be used.";
164  if (std::fabs(chamber->layers()[iL]->etaPartitions()[0]->position().z()) !=
165  std::fabs(mainChamber->layers()[iL]->etaPartitions()[0]->position().z()))
166  throw cms::Exception("Setup")
167  << "ME0ReDigiProducer::TemporaryGeometry::TemporaryGeometry() - Not all ME0 ETA partitions in a single "
168  "layer have the same Z position. This module cannot be used.";
169  }
170  }
171 
172  //Calculate radius to center of partition
173  middleDistanceFromBeam = mainTopo->radius();
174 
175  //calculate the top of each eta partition, assuming equal distance in eta between partitions
176  const auto localTop = LocalPoint(0, mainTopo->stripLength() / 2);
177  const auto localBottom = LocalPoint(0, -1 * mainTopo->stripLength() / 2);
178  const auto globalTop = mainPartition->toGlobal(localTop);
179  const auto globalBottom = mainPartition->toGlobal(localBottom);
180  const double etaTop = globalTop.eta();
181  const double etaBottom = globalBottom.eta();
182  const double zBottom = globalBottom.z();
183 
184  //Build topologies
187  const auto& mainPars = mainPartition->specs()->parameters();
188  for (unsigned int iP = 0; iP < numberOfPartitions; ++iP) {
189  const double eta = (etaTop - etaBottom) * double(iP + 1) / double(numberOfPartitions) + etaBottom;
190  const double distFromBeam = std::fabs(zBottom / std::sinh(eta));
191  partitionTops.push_back(distFromBeam - middleDistanceFromBeam);
192  LogDebug("ME0ReDigiProducer::TemporaryGeometry") << "Top of new partition: " << partitionTops.back() << std::endl;
193 
194  std::vector<float> params(4, 0);
195 
196  //half width of trapezoid at local coordinate Y
197  auto getWidth = [&](float locY) -> float {
198  return (mainPars[2] * (mainPars[1] + mainPars[0]) + locY * (mainPars[1] - mainPars[0])) / (2 * mainPars[2]);
199  };
200 
201  params[0] = iP == 0 ? mainPars[0] : getWidth(partitionTops[iP - 1]); // Half width of bottom of chamber
202  params[1] =
203  iP + 1 == numberOfPartitions ? mainPars[1] : getWidth(partitionTops[iP]); // Half width of top of chamber
204  params[2] = ((iP + 1 == numberOfPartitions ? localTop.y() : partitionTops[iP]) -
205  (iP == 0 ? localBottom.y() : partitionTops[iP - 1])) /
206  2; // Half width of height of chamber
207  params[3] = numberOfStrips;
208 
209  stripTopos.push_back(buildTopo(params));
210  }
211 
212  //Get TOF at center of each partition
213  tofs.resize(nLayers);
214  LogDebug("ME0ReDigiProducer::TemporaryGeometry") << "TOF numbers [layer][partition]: ";
215  for (unsigned int iL = 0; iL < nLayers; ++iL) {
216  tofs[iL].resize(numberOfPartitions);
217  for (unsigned int iP = 0; iP < numberOfPartitions; ++iP) {
218  const LocalPoint partCenter(0., getPartCenter(iP), 0.);
219  const GlobalPoint centralGP(mainChamber->layers()[iL]->etaPartitions()[0]->toGlobal(partCenter));
220  tofs[iL][iP] = (centralGP.mag() / (CLHEP::c_light / CLHEP::cm)); //speed of light [cm/ns]
221  LogDebug("ME0ReDigiProducer::TemporaryGeometry")
222  << "[" << iL << "][" << iP << "]=" << tofs[iL][iP] << " " << std::endl;
223  }
224  }
225 }

References buildTopo(), relativeConstraints::chamber, chambers, PVValHelper::eta, PV3DBase< T, PVType, FrameType >::eta(), Exception, getPartCenter(), createfilelist::int, LogDebug, middleDistanceFromBeam, MuonTCMETValueMapProducer_cff::nLayers, ME0ReDigiProducer::numberOfPartitions, ME0ReDigiProducer::numberOfStrips, CalibrationSummaryClient_cfi::params, partitionTops, TrapezoidalStripTopology::radius(), TrapezoidalStripTopology::stripLength(), stripTopos, tofs, and PV3DBase< T, PVType, FrameType >::y().

◆ ~TemporaryGeometry()

ME0ReDigiProducer::TemporaryGeometry::~TemporaryGeometry ( )

Definition at line 242 of file ME0ReDigiProducer.cc.

242  {
243  for (auto* p : stripTopos) {
244  delete p;
245  }
246 }

References AlCaHLTBitMon_ParallelJobs::p.

Member Function Documentation

◆ buildTopo()

TrapezoidalStripTopology * ME0ReDigiProducer::TemporaryGeometry::buildTopo ( const std::vector< float > &  _p) const
private

Definition at line 248 of file ME0ReDigiProducer.cc.

248  {
249  float b = _p[0];
250  float B = _p[1];
251  float h = _p[2];
252  float r0 = h * (B + b) / (B - b);
253  float striplength = h * 2;
254  float strips = _p[3];
255  float pitch = (b + B) / strips;
256  int nstrip = static_cast<int>(strips);
257 
258  LogDebug("ME0ReDigiProducer::TemporaryGeometry")
259  << "New partition parameters: "
260  << "bottom width(" << 2 * b << ") top width(" << 2 * B << ") height(" << 2 * h << ") radius to center(" << r0
261  << ") nStrips(" << strips << ") pitch(" << pitch << ")" << std::endl;
262 
263  return new TrapezoidalStripTopology(nstrip, pitch, striplength, r0);
264 }

References TtFullHadDaughter::B, b, LogDebug, and DigiDM_cff::strips.

Referenced by TemporaryGeometry().

◆ findEtaPartition()

unsigned int ME0ReDigiProducer::TemporaryGeometry::findEtaPartition ( float  locY) const

Definition at line 227 of file ME0ReDigiProducer.cc.

227  {
228  unsigned int etaPart = stripTopos.size() - 1;
229  for (unsigned int iP = 0; iP < stripTopos.size(); ++iP) {
230  if (locY < partitionTops[iP]) {
231  etaPart = iP;
232  break;
233  }
234  }
235  return etaPart;
236 }

Referenced by ME0ReDigiProducer::getCustomStripProperties().

◆ getCentralTOF()

float ME0ReDigiProducer::TemporaryGeometry::getCentralTOF ( const ME0DetId me0Id,
unsigned int  partIdx 
) const
inline

Definition at line 56 of file ME0ReDigiProducer.cc.

56  {
57  return tofs[me0Id.layer() - 1][partIdx];
58  } //in detId layer numbers stat at 1

References ME0DetId::layer(), partIdx(), and tofs.

Referenced by ME0ReDigiProducer::getCustomStripProperties().

◆ getPartCenter()

float ME0ReDigiProducer::TemporaryGeometry::getPartCenter ( const unsigned int  partIdx) const

Definition at line 238 of file ME0ReDigiProducer.cc.

238  {
239  return stripTopos[partIdx]->radius() - middleDistanceFromBeam;
240 }

References partIdx().

Referenced by ME0ReDigiProducer::getCustomStripProperties(), and TemporaryGeometry().

◆ getTopo()

const TrapezoidalStripTopology* ME0ReDigiProducer::TemporaryGeometry::getTopo ( const unsigned int  partIdx) const
inline

Definition at line 54 of file ME0ReDigiProducer.cc.

54 { return stripTopos[partIdx]; }

References partIdx(), and stripTopos.

Referenced by ME0ReDigiProducer::getCustomStripProperties().

◆ numLayers()

unsigned int ME0ReDigiProducer::TemporaryGeometry::numLayers ( ) const
inline

Definition at line 59 of file ME0ReDigiProducer.cc.

59 { return tofs.size(); }

References tofs.

Referenced by ME0ReDigiProducer::beginRun().

Member Data Documentation

◆ middleDistanceFromBeam

float ME0ReDigiProducer::TemporaryGeometry::middleDistanceFromBeam
private

Definition at line 65 of file ME0ReDigiProducer.cc.

Referenced by TemporaryGeometry().

◆ partitionTops

std::vector<float> ME0ReDigiProducer::TemporaryGeometry::partitionTops
private

Definition at line 68 of file ME0ReDigiProducer.cc.

Referenced by TemporaryGeometry().

◆ stripTopos

std::vector<TrapezoidalStripTopology*> ME0ReDigiProducer::TemporaryGeometry::stripTopos
private

Definition at line 66 of file ME0ReDigiProducer.cc.

Referenced by getTopo(), and TemporaryGeometry().

◆ tofs

std::vector<std::vector<double> > ME0ReDigiProducer::TemporaryGeometry::tofs
private

Definition at line 67 of file ME0ReDigiProducer.cc.

Referenced by getCentralTOF(), numLayers(), and TemporaryGeometry().

TrapezoidalStripTopology::stripLength
float stripLength() const override
det heigth (strip length in the middle)
Definition: TrapezoidalStripTopology.h:63
ME0ReDigiProducer::TemporaryGeometry::partitionTops
std::vector< float > partitionTops
Definition: ME0ReDigiProducer.cc:68
CalibrationSummaryClient_cfi.params
params
Definition: CalibrationSummaryClient_cfi.py:14
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
geometry
Definition: geometry.py:1
ME0ReDigiProducer::TemporaryGeometry::buildTopo
TrapezoidalStripTopology * buildTopo(const std::vector< float > &_p) const
Definition: ME0ReDigiProducer.cc:248
partIdx
static unsigned int partIdx(const InputGenJetsParticleSelector::ParticleVector &p, const reco::Candidate *particle)
Definition: InputGenJetsParticleSelector.cc:120
LocalPoint
class Point3DBase< float, LocalTag > LocalPoint
Definition: ME0ReDigiProducer.cc:38
TrapezoidalStripTopology
Definition: TrapezoidalStripTopology.h:21
PVValHelper::eta
Definition: PVValidationHelpers.h:69
h
Point3DBase< float, LocalTag >
b
double b
Definition: hdecay.h:118
MuonTCMETValueMapProducer_cff.nLayers
nLayers
Definition: MuonTCMETValueMapProducer_cff.py:38
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
ME0ReDigiProducer::numberOfPartitions
unsigned int numberOfPartitions
Definition: ME0ReDigiProducer.cc:111
ME0ReDigiProducer::TemporaryGeometry::getPartCenter
float getPartCenter(const unsigned int partIdx) const
Definition: ME0ReDigiProducer.cc:238
PV3DBase::eta
T eta() const
Definition: PV3DBase.h:73
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
createfilelist.int
int
Definition: createfilelist.py:10
chambers
static char chambers[264][20]
Definition: ReadPGInfo.cc:243
TrapezoidalStripTopology::radius
float radius() const
Definition: TrapezoidalStripTopology.h:69
ME0ReDigiProducer::TemporaryGeometry::stripTopos
std::vector< TrapezoidalStripTopology * > stripTopos
Definition: ME0ReDigiProducer.cc:66
TtFullHadDaughter::B
static const std::string B
Definition: TtFullHadronicEvent.h:9
Exception
Definition: hltDiff.cc:246
relativeConstraints.chamber
chamber
Definition: relativeConstraints.py:53
ME0ReDigiProducer::numberOfStrips
unsigned int numberOfStrips
Definition: ME0ReDigiProducer.cc:110
cms::Exception
Definition: Exception.h:70
ME0ReDigiProducer::TemporaryGeometry::tofs
std::vector< std::vector< double > > tofs
Definition: ME0ReDigiProducer.cc:67
ME0ReDigiProducer::TemporaryGeometry::middleDistanceFromBeam
float middleDistanceFromBeam
Definition: ME0ReDigiProducer.cc:65
ME0DetId::layer
int layer() const
Layer id: each chamber has six layers of chambers: layer 1 is the inner layer and layer 6 is the oute...
Definition: ME0DetId.h:44
DigiDM_cff.strips
strips
#turn off noise in all subdetectors simHcalUnsuppressedDigis.doNoise = False mix.digitizers....
Definition: DigiDM_cff.py:32