CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
FastTimeDDDConstants Class Reference

#include <FastTimeDDDConstants.h>

Public Member Functions

 FastTimeDDDConstants (const FastTimeParameters *ftp)
 
int getCells (int type) const
 
std::vector< GlobalPointgetCorners (int type, int izeta, int iphi, int zside) const
 
std::pair< int, int > getEtaPhi (double r, double phi) const
 
GlobalPoint getPosition (int type, int izeta, int iphi, int zside) const
 
double getRin (int type) const
 
double getRout (int type) const
 
double getZHalf (int type) const
 
std::pair< int, int > getZPhi (double z, double phi) const
 
double getZPos (int type) const
 
bool isValidXY (int type, int izeta, int iphi) const
 
int numberEtaZ (int type) const
 
int numberPhi (int type) const
 
 ~FastTimeDDDConstants ()
 

Private Member Functions

void initialize ()
 

Private Attributes

double dEta_
 
double dPhiBarrel_
 
double dPhiEndcap_
 
double dZBarrel_
 
double etaMax_
 
double etaMin_
 
const FastTimeParametersftpar_
 
std::vector< double > rLimits_
 

Detailed Description

this class reads the constant section of the numbering xml-file for fast timer device

Author
Sunanda Banerjee, SINP sunan.nosp@m.da.b.nosp@m.anerj.nosp@m.ee@c.nosp@m.ern.c.nosp@m.h

Definition at line 19 of file FastTimeDDDConstants.h.

Constructor & Destructor Documentation

◆ FastTimeDDDConstants()

FastTimeDDDConstants::FastTimeDDDConstants ( const FastTimeParameters ftp)

Definition at line 10 of file FastTimeDDDConstants.cc.

10  : ftpar_(ft) {
11 #ifdef EDM_ML_DEBUG
12  edm::LogVerbatim("HGCalGeom") << "FastTimeDDDConstants::FastTimeDDDConstants "
13  << "( const FastTimeParameters* ft ) constructor";
14 #endif
15  initialize();
16 }

References initialize().

◆ ~FastTimeDDDConstants()

FastTimeDDDConstants::~FastTimeDDDConstants ( )

Definition at line 18 of file FastTimeDDDConstants.cc.

18  {
19 #ifdef EDM_ML_DEBUG
20  edm::LogVerbatim("HGCalGeom") << "FastTimeDDDConstants:destructed!!!";
21 #endif
22 }

Member Function Documentation

◆ getCells()

int FastTimeDDDConstants::getCells ( int  type) const

Definition at line 114 of file FastTimeDDDConstants.cc.

114  {
115  int numb(0);
116  if (type == 1) {
117  numb = (ftpar_->nZBarrel_) * (ftpar_->nPhiBarrel_);
118  } else if (type == 2) {
119  numb = (ftpar_->nEtaEndcap_) * (ftpar_->nPhiEndcap_);
120  }
121  return numb;
122 }

References ftpar_, FastTimeParameters::nEtaEndcap_, FastTimeParameters::nPhiBarrel_, FastTimeParameters::nPhiEndcap_, and FastTimeParameters::nZBarrel_.

Referenced by initialize().

◆ getCorners()

std::vector< GlobalPoint > FastTimeDDDConstants::getCorners ( int  type,
int  izeta,
int  iphi,
int  zside 
) const

Definition at line 80 of file FastTimeDDDConstants.cc.

80  {
81  double x(0), y(0), z(0), dx(0), dz(0), r(0), phi(0);
82  if (type == 1) {
83  phi = (iphi - 0.5) * dPhiBarrel_;
84  r = ftpar_->geomParBarrel_[2];
85  x = r * cos(phi);
86  y = r * sin(phi);
87  z = ftpar_->geomParBarrel_[0] + (izeta - 0.5) * dZBarrel_;
88  dx = 0.5 * ftpar_->geomParBarrel_[3];
89  dz = 0.5 * dZBarrel_;
90  } else if (type == 2) {
91  phi = (iphi - 0.5) * dPhiEndcap_;
92  r = (izeta <= 0 || izeta >= (int)(rLimits_.size())) ? 0 : 0.5 * (rLimits_[izeta - 1] + rLimits_[izeta]);
93  x = (zside < 0) ? -r * cos(phi) : r * cos(phi);
94  y = r * sin(phi);
95  z = ftpar_->geomParEndcap_[2];
96  dx = 0.5 * r * dPhiEndcap_;
97  dz = 0.5 * ftpar_->geomParEndcap_[3];
98  }
99  if (zside < 0) {
100  z = -z;
101  dz = -dz;
102  }
103  static constexpr int signx[8] = {-1, -1, 1, 1, -1, -1, 1, 1};
104  static constexpr int signy[8] = {-1, 1, 1, -1, -1, 1, 1, -1};
105  static constexpr int signz[8] = {-1, -1, -1, -1, 1, 1, 1, 1};
106  std::vector<GlobalPoint> pts;
107  for (unsigned int i = 0; i != 8; ++i) {
108  GlobalPoint p(x + signx[i] * dx, y + signy[i] * dx, z + signz[i] * dz);
109  pts.emplace_back(p);
110  }
111  return pts;
112 }

References funct::cos(), dPhiBarrel_, dPhiEndcap_, PVValHelper::dx, PVValHelper::dz, dZBarrel_, ftpar_, FastTimeParameters::geomParBarrel_, FastTimeParameters::geomParEndcap_, mps_fire::i, createfilelist::int, LEDCalibrationChannels::iphi, AlCaHLTBitMon_ParallelJobs::p, phi, RPCpg::pts, alignCSCRings::r, rLimits_, funct::sin(), x, y, z, and ecaldqm::zside().

Referenced by FastTimeGeometryLoader::buildGeom(), and FastTimeGeometry::getCorners().

◆ getEtaPhi()

std::pair< int, int > FastTimeDDDConstants::getEtaPhi ( double  r,
double  phi 
) const

Definition at line 40 of file FastTimeDDDConstants.cc.

40  {
41  if (phi < 0)
42  phi += (2 * geant_units::piRadians);
43  int ir(ftpar_->nEtaEndcap_);
44  for (unsigned int k = 1; k < rLimits_.size(); ++k) {
45  if (r > rLimits_[k]) {
46  ir = k;
47  break;
48  }
49  }
50  int iphi = (int)(phi / dPhiEndcap_) + 1;
51  if (iphi > ftpar_->nPhiEndcap_)
52  iphi = 1;
53 #ifdef EDM_ML_DEBUG
54  edm::LogVerbatim("HGCalGeom") << "FastTimeDDDConstants:Endcap r|phi " << r << " " << convertRadToDeg(phi)
55  << " ir|iphi " << ir << " " << iphi;
56 #endif
57  return std::pair<int, int>(ir, iphi);
58 }

References angle_units::operators::convertRadToDeg(), dPhiEndcap_, ftpar_, createfilelist::int, LEDCalibrationChannels::iphi, dqmdumpme::k, FastTimeParameters::nEtaEndcap_, FastTimeParameters::nPhiEndcap_, phi, angle_units::piRadians(), alignCSCRings::r, and rLimits_.

Referenced by FastTimeGeometry::getClosestCell().

◆ getPosition()

GlobalPoint FastTimeDDDConstants::getPosition ( int  type,
int  izeta,
int  iphi,
int  zside 
) const

Definition at line 60 of file FastTimeDDDConstants.cc.

60  {
61  double x(0), y(0), z(0);
62  if (type == 1) {
63  double phi = (iphi - 0.5) * dPhiBarrel_;
64  x = ftpar_->geomParBarrel_[2] * cos(phi);
65  y = ftpar_->geomParBarrel_[2] * sin(phi);
66  z = ftpar_->geomParBarrel_[0] + (izeta - 0.5) * dZBarrel_;
67  } else if (type == 2) {
68  double phi = (iphi - 0.5) * dPhiEndcap_;
69  double r = (izeta <= 0 || izeta >= (int)(rLimits_.size())) ? 0 : 0.5 * (rLimits_[izeta - 1] + rLimits_[izeta]);
70  x = (zside < 0) ? -r * cos(phi) : r * cos(phi);
71  y = r * sin(phi);
72  z = ftpar_->geomParEndcap_[2];
73  }
74  if (zside < 0)
75  z = -z;
76  GlobalPoint p(x, y, z);
77  return p;
78 }

References funct::cos(), dPhiBarrel_, dPhiEndcap_, dZBarrel_, ftpar_, FastTimeParameters::geomParBarrel_, FastTimeParameters::geomParEndcap_, createfilelist::int, LEDCalibrationChannels::iphi, AlCaHLTBitMon_ParallelJobs::p, phi, alignCSCRings::r, rLimits_, funct::sin(), x, y, z, and ecaldqm::zside().

Referenced by FastTimeGeometry::getPosition().

◆ getRin()

double FastTimeDDDConstants::getRin ( int  type) const

Definition at line 124 of file FastTimeDDDConstants.cc.

124  {
125  double value(0);
126  if (type == 1) {
127  value = (ftpar_->geomParBarrel_[2]);
128  } else if (type == 2) {
129  value = (ftpar_->geomParEndcap_[0]);
130  }
131  return value;
132 }

References ftpar_, FastTimeParameters::geomParBarrel_, FastTimeParameters::geomParEndcap_, and relativeConstraints::value.

Referenced by FastTimeGeometryLoader::build(), and FastTimeGeometry::getSummary().

◆ getRout()

double FastTimeDDDConstants::getRout ( int  type) const

Definition at line 134 of file FastTimeDDDConstants.cc.

134  {
135  double value(0);
136  if (type == 1) {
138  } else if (type == 2) {
139  value = (ftpar_->geomParEndcap_[1]);
140  }
141  return value;
142 }

References ftpar_, FastTimeParameters::geomParBarrel_, FastTimeParameters::geomParEndcap_, and relativeConstraints::value.

Referenced by FastTimeGeometryLoader::build(), and FastTimeGeometry::getSummary().

◆ getZHalf()

double FastTimeDDDConstants::getZHalf ( int  type) const

Definition at line 144 of file FastTimeDDDConstants.cc.

144  {
145  double value(0);
146  if (type == 1) {
147  value = 0.5 * (ftpar_->geomParBarrel_[1] - ftpar_->geomParBarrel_[0]);
148  } else if (type == 2) {
149  value = (ftpar_->geomParEndcap_[3]);
150  }
151  return value;
152 }

References ftpar_, FastTimeParameters::geomParBarrel_, FastTimeParameters::geomParEndcap_, and relativeConstraints::value.

Referenced by FastTimeGeometryLoader::build(), and FastTimeGeometry::getSummary().

◆ getZPhi()

std::pair< int, int > FastTimeDDDConstants::getZPhi ( double  z,
double  phi 
) const

Definition at line 24 of file FastTimeDDDConstants.cc.

24  {
25  if (phi < 0)
26  phi += (2 * geant_units::piRadians);
27  int iz = (int)(z / dZBarrel_) + 1;
28  if (iz > ftpar_->nZBarrel_)
29  iz = ftpar_->nZBarrel_;
30  int iphi = (int)(phi / dPhiBarrel_) + 1;
31  if (iphi > ftpar_->nPhiBarrel_)
32  iphi = 1;
33 #ifdef EDM_ML_DEBUG
34  edm::LogVerbatim("HGCalGeom") << "FastTimeDDDConstants:Barrel z|phi " << z << " " << convertRadToDeg(phi)
35  << " iz|iphi " << iz << " " << iphi;
36 #endif
37  return std::pair<int, int>(iz, iphi);
38 }

References angle_units::operators::convertRadToDeg(), dPhiBarrel_, dZBarrel_, ftpar_, createfilelist::int, LEDCalibrationChannels::iphi, FastTimeParameters::nPhiBarrel_, FastTimeParameters::nZBarrel_, phi, angle_units::piRadians(), and z.

Referenced by FastTimeGeometry::getClosestCell().

◆ getZPos()

double FastTimeDDDConstants::getZPos ( int  type) const

Definition at line 154 of file FastTimeDDDConstants.cc.

154  {
155  double value(0);
156  if (type == 1) {
157  value = 0.5 * (ftpar_->geomParBarrel_[1] + ftpar_->geomParBarrel_[0]);
158  } else if (type == 2) {
159  value = (ftpar_->geomParEndcap_[2]);
160  }
161  return value;
162 }

References ftpar_, FastTimeParameters::geomParBarrel_, FastTimeParameters::geomParEndcap_, and relativeConstraints::value.

Referenced by FastTimeGeometryLoader::build().

◆ initialize()

void FastTimeDDDConstants::initialize ( void  )
private

Definition at line 194 of file FastTimeDDDConstants.cc.

194  {
195  double thmin = atan(ftpar_->geomParEndcap_[0] / ftpar_->geomParEndcap_[2]);
196  etaMax_ = -log(0.5 * thmin);
197  double thmax = atan(ftpar_->geomParEndcap_[1] / ftpar_->geomParEndcap_[2]);
198  etaMin_ = -log(0.5 * thmax);
200 #ifdef EDM_ML_DEBUG
201  edm::LogVerbatim("HGCalGeom") << "Theta range " << convertRadToDeg(thmin) << ":" << convertRadToDeg(thmax)
202  << " Eta range " << etaMin_ << ":" << etaMax_ << ":" << dEta_;
203 #endif
204  for (int k = 0; k <= ftpar_->nEtaEndcap_; ++k) {
205  double eta = etaMin_ + k * dEta_;
206  double theta = 2.0 * atan(exp(-eta));
207  double rval = (ftpar_->geomParEndcap_[2]) * tan(theta);
208  rLimits_.emplace_back(rval);
209  }
213 #ifdef EDM_ML_DEBUG
214  edm::LogVerbatim("HGCalGeom") << "FastTimeDDDConstants initialized with " << ftpar_->nZBarrel_ << ":"
215  << ftpar_->nPhiBarrel_ << ":" << getCells(1) << " cells for barrel; dz|dphi "
216  << dZBarrel_ << "|" << dPhiBarrel_ << " and " << ftpar_->nEtaEndcap_ << ":"
217  << ftpar_->nPhiEndcap_ << ":" << getCells(2) << " cells for endcap; dphi "
218  << dPhiEndcap_ << " The Limits in R are";
219  for (unsigned int k = 0; k < rLimits_.size(); ++k)
220  edm::LogVerbatim("HGCalGeom") << "[" << k << "] " << rLimits_[k] << " ";
221 #endif
222 }

References angle_units::operators::convertRadToDeg(), dEta_, dPhiBarrel_, dPhiEndcap_, dZBarrel_, EDM_ML_DEBUG, PVValHelper::eta, etaMax_, etaMin_, JetChargeProducer_cfi::exp, ftpar_, FastTimeParameters::geomParBarrel_, FastTimeParameters::geomParEndcap_, getCells(), dqmdumpme::k, dqm-mbProfile::log, FastTimeParameters::nEtaEndcap_, FastTimeParameters::nPhiBarrel_, FastTimeParameters::nPhiEndcap_, FastTimeParameters::nZBarrel_, angle_units::piRadians(), rLimits_, funct::tan(), and theta().

Referenced by FastTimeDDDConstants().

◆ isValidXY()

bool FastTimeDDDConstants::isValidXY ( int  type,
int  izeta,
int  iphi 
) const

Definition at line 164 of file FastTimeDDDConstants.cc.

164  {
165  bool ok(false);
166  if (type == 1) {
167  ok = ((izeta > 0) && (izeta <= ftpar_->nZBarrel_) && (iphi > 0) && (iphi <= ftpar_->nPhiBarrel_));
168  } else if (type == 2) {
169  ok = ((izeta > 0) && (izeta <= ftpar_->nEtaEndcap_) && (iphi > 0) && (iphi <= ftpar_->nPhiEndcap_));
170  }
171  return ok;
172 }

References LEDCalibrationChannels::iphi, and convertSQLiteXML::ok.

Referenced by FastTimeTopology::valid().

◆ numberEtaZ()

int FastTimeDDDConstants::numberEtaZ ( int  type) const

Definition at line 174 of file FastTimeDDDConstants.cc.

174  {
175  int numb(0);
176  if (type == 1) {
177  numb = (ftpar_->nZBarrel_);
178  } else if (type == 2) {
179  numb = (ftpar_->nEtaEndcap_);
180  }
181  return numb;
182 }

References ftpar_, FastTimeParameters::nEtaEndcap_, and FastTimeParameters::nZBarrel_.

Referenced by FastTimeTopology::FastTimeTopology(), and FastTimeGeometry::newCell().

◆ numberPhi()

int FastTimeDDDConstants::numberPhi ( int  type) const

Definition at line 184 of file FastTimeDDDConstants.cc.

184  {
185  int numb(0);
186  if (type == 1) {
187  numb = (ftpar_->nPhiBarrel_);
188  } else if (type == 2) {
189  numb = (ftpar_->nPhiEndcap_);
190  }
191  return numb;
192 }

References ftpar_, FastTimeParameters::nPhiBarrel_, and FastTimeParameters::nPhiEndcap_.

Referenced by FastTimeTopology::FastTimeTopology(), and FastTimeGeometry::newCell().

Member Data Documentation

◆ dEta_

double FastTimeDDDConstants::dEta_
private

Definition at line 41 of file FastTimeDDDConstants.h.

Referenced by initialize().

◆ dPhiBarrel_

double FastTimeDDDConstants::dPhiBarrel_
private

Definition at line 42 of file FastTimeDDDConstants.h.

Referenced by getCorners(), getPosition(), getZPhi(), and initialize().

◆ dPhiEndcap_

double FastTimeDDDConstants::dPhiEndcap_
private

Definition at line 42 of file FastTimeDDDConstants.h.

Referenced by getCorners(), getEtaPhi(), getPosition(), and initialize().

◆ dZBarrel_

double FastTimeDDDConstants::dZBarrel_
private

Definition at line 42 of file FastTimeDDDConstants.h.

Referenced by getCorners(), getPosition(), getZPhi(), and initialize().

◆ etaMax_

double FastTimeDDDConstants::etaMax_
private

Definition at line 41 of file FastTimeDDDConstants.h.

Referenced by initialize().

◆ etaMin_

double FastTimeDDDConstants::etaMin_
private

Definition at line 41 of file FastTimeDDDConstants.h.

Referenced by initialize().

◆ ftpar_

const FastTimeParameters* FastTimeDDDConstants::ftpar_
private

◆ rLimits_

std::vector<double> FastTimeDDDConstants::rLimits_
private

Definition at line 43 of file FastTimeDDDConstants.h.

Referenced by getCorners(), getEtaPhi(), getPosition(), and initialize().

DDAxes::y
FastTimeDDDConstants::rLimits_
std::vector< double > rLimits_
Definition: FastTimeDDDConstants.h:43
mps_fire.i
i
Definition: mps_fire.py:428
FastTimeDDDConstants::etaMax_
double etaMax_
Definition: FastTimeDDDConstants.h:41
ecaldqm::zside
int zside(DetId const &)
Definition: EcalDQMCommonUtils.cc:189
angle_units::operators::convertRadToDeg
constexpr NumType convertRadToDeg(NumType radians)
Definition: angle_units.h:21
FastTimeParameters::geomParBarrel_
std::vector< double > geomParBarrel_
Definition: FastTimeParameters.h:18
FastTimeDDDConstants::initialize
void initialize()
Definition: FastTimeDDDConstants.cc:194
FastTimeDDDConstants::dZBarrel_
double dZBarrel_
Definition: FastTimeDDDConstants.h:42
DDAxes::x
convertSQLiteXML.ok
bool ok
Definition: convertSQLiteXML.py:98
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
LEDCalibrationChannels.iphi
iphi
Definition: LEDCalibrationChannels.py:64
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
EDM_ML_DEBUG
#define EDM_ML_DEBUG
Definition: MPUnpacker.cc:1
PVValHelper::eta
Definition: PVValidationHelpers.h:70
DDAxes::z
theta
Geom::Theta< T > theta() const
Definition: Basic3DVectorLD.h:150
FastTimeDDDConstants::dEta_
double dEta_
Definition: FastTimeDDDConstants.h:41
dqmdumpme.k
k
Definition: dqmdumpme.py:60
Point3DBase< float, GlobalTag >
FastTimeDDDConstants::getCells
int getCells(int type) const
Definition: FastTimeDDDConstants.cc:114
FastTimeParameters::nPhiBarrel_
int nPhiBarrel_
Definition: FastTimeParameters.h:15
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
FastTimeParameters::nEtaEndcap_
int nEtaEndcap_
Definition: FastTimeParameters.h:16
type
type
Definition: SiPixelVCal_PayloadInspector.cc:39
FastTimeParameters::nZBarrel_
int nZBarrel_
Definition: FastTimeParameters.h:14
funct::tan
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
FastTimeDDDConstants::etaMin_
double etaMin_
Definition: FastTimeDDDConstants.h:41
createfilelist.int
int
Definition: createfilelist.py:10
value
Definition: value.py:1
RPCpg::pts
static const double pts[33]
Definition: Constants.h:30
alignCSCRings.r
r
Definition: alignCSCRings.py:93
DDAxes::phi
PVValHelper::dz
Definition: PVValidationHelpers.h:51
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
relativeConstraints.value
value
Definition: relativeConstraints.py:53
FastTimeDDDConstants::dPhiBarrel_
double dPhiBarrel_
Definition: FastTimeDDDConstants.h:42
angle_units::piRadians
constexpr double piRadians(M_PI)
FastTimeParameters::geomParEndcap_
std::vector< double > geomParEndcap_
Definition: FastTimeParameters.h:19
FastTimeDDDConstants::ftpar_
const FastTimeParameters * ftpar_
Definition: FastTimeDDDConstants.h:40
dqm-mbProfile.log
log
Definition: dqm-mbProfile.py:17
FastTimeDDDConstants::dPhiEndcap_
double dPhiEndcap_
Definition: FastTimeDDDConstants.h:42
JetChargeProducer_cfi.exp
exp
Definition: JetChargeProducer_cfi.py:6
edm::Log
Definition: MessageLogger.h:70
PVValHelper::dx
Definition: PVValidationHelpers.h:49
FastTimeParameters::nPhiEndcap_
int nPhiEndcap_
Definition: FastTimeParameters.h:17