test
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 Member Functions | Private Attributes | Static Private Attributes
HcalDDDSimConstants Class Reference

#include <HcalDDDSimConstants.h>

Public Member Functions

HcalCellType::HcalCell cell (int det, int zside, int depth, int etaR, int iphi) const
 
unsigned int findLayer (int layer, const std::vector< HcalParameters::LayerItem > &layerGroup) const
 
std::vector< std::pair< double,
double > > 
getConstHBHE (const int type) const
 
int getDepthEta16 (int i) const
 
int getDepthEta29 (int i) const
 
std::pair< int, double > getDetEta (double eta, int depth)
 
int getEta (int det, int lay, double hetaR)
 
std::pair< int, int > getEtaDepth (int det, int etaR, int phi, int depth, int lay)
 
double getEtaHO (double &etaR, double &x, double &y, double &z) const
 
const std::vector< double > & getEtaTableHF () const
 
const std::vector< double > & getGparHF () const
 
const std::vector< HcalDetId > & getIdHF2QIE () const
 
std::pair< int, int > getiEtaRange (const int i) const
 
const std::vector< double > & getLayer0Wt () const
 
int getMaxDepth (const int type) const
 
std::pair< int, int > getModHalfHBHE (const int type) const
 
std::pair< double, double > getPhiCons (int det, int ieta)
 
const std::vector< double > & getPhiTableHF () const
 
const std::vector< double > & getRTableHF () const
 
std::vector< HcalCellTypeHcalCellTypes () const
 
std::vector< HcalCellTypeHcalCellTypes (HcalSubdetector, int ieta=-1, int depth=-1) const
 
 HcalDDDSimConstants (const HcalParameters *hp)
 
bool isBH () const
 
int maxHFDepth (int ieta, int iphi) const
 
unsigned int numberOfCells (HcalSubdetector) const
 
int phiNumber (int phi, int unit) const
 
void printTiles () const
 
int unitPhi (int det, int etaR) const
 
int unitPhi (double dphi) const
 
 ~HcalDDDSimConstants ()
 

Private Member Functions

double deltaEta (int det, int eta, int depth) const
 
double getEta (int det, int etaR, int zside, int depth=1) const
 
double getEta (double r, double z) const
 
double getGain (HcalSubdetector subdet, int depth) const
 
int getShift (HcalSubdetector subdet, int depth) const
 
void initialize ()
 
unsigned int layerGroup (unsigned int eta, unsigned int i) const
 
unsigned int layerGroupSize (unsigned int eta) const
 
void printTileHB (int eta, int depth) const
 
void printTileHE (int eta, int depth) const
 

Private Attributes

int depthEta16 [2]
 
int depthEta29 [2]
 
std::vector< int > depths [nDepthMax]
 
double dlShort
 
double dzVcal
 
double etaHO [4]
 
const HcalParametershpar
 
std::vector< HcalDetIdidHF2QIE
 
bool isBH_
 
std::vector< int > maxDepth
 
int nDepth
 
int nEta
 
int nmodHB
 
int nmodHE
 
int nPhiF
 
int nR
 
int nzHB
 
int nzHE
 
double rminHO
 
double zVcal
 

Static Private Attributes

static const int nDepthMax =9
 

Detailed Description

this class reads the constant section of the hcal-sim-numbering xml-file

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 23 of file HcalDDDSimConstants.h.

Constructor & Destructor Documentation

HcalDDDSimConstants::HcalDDDSimConstants ( const HcalParameters hp)

Definition at line 11 of file HcalDDDSimConstants.cc.

References gather_cfg::cout, HcalCellTypes(), and initialize().

11  : hpar(hp) {
12 
13 #ifdef EDM_ML_DEBUG
14  edm::LogInfo("HCalGeom") << "HcalDDDSimConstants::HcalDDDSimConstants (const HcalParameter* hp) constructor\n";
15 #endif
16 
17  initialize();
18 #ifdef EDM_ML_DEBUG
19  std::vector<HcalCellType> cellTypes = HcalCellTypes();
20  std::cout << "HcalDDDSimConstants: " << cellTypes.size()
21  << " cells of type HCal (All)\n";
22 #endif
23 }
std::vector< HcalCellType > HcalCellTypes() const
tuple cout
Definition: gather_cfg.py:145
const HcalParameters * hpar
HcalDDDSimConstants::~HcalDDDSimConstants ( )

Definition at line 26 of file HcalDDDSimConstants.cc.

26  {
27 #ifdef EDM_ML_DEBUG
28  edm::LogInfo ("HCalGeom") << "HcalDDDSimConstants::destructed!!!\n";
29 #endif
30 }

Member Function Documentation

HcalCellType::HcalCell HcalDDDSimConstants::cell ( int  det,
int  zside,
int  depth,
int  etaR,
int  iphi 
) const

Definition at line 32 of file HcalDDDSimConstants.cc.

References gather_cfg::cout, deltaEta(), HcalCellType::HcalCell::deta, HcalCellType::HcalCell::dphi, HcalParameters::drHB, HcalCellType::HcalCell::drz, HcalParameters::dzHE, HcalCellType::HcalCell::eta, eta, HcalParameters::etaMax, HcalParameters::etaMin, HcalCellType::HcalCell::flagrz, getEta(), HcalBarrel, HcalEndcap, HcalForward, HcalOuter, hpar, maxDepth, nEta, HcalParameters::noff, nR, HcalCellType::HcalCell::ok, convertSQLiteXML::ok, phi, HcalCellType::HcalCell::phi, HcalParameters::phibin, HcalParameters::phioff, HcalParameters::phitable, HcalParameters::rHB, HcalParameters::rTable, HcalCellType::HcalCell::rz, tmp, unitPhi(), and HcalParameters::zHE.

Referenced by HGCGeometryValidation::analyze(), HGCalHitValidation::analyze(), HcalCellTypes(), and HcalTestAnalysis::update().

34  {
35 
36  double etaMn = hpar->etaMin[0];
37  double etaMx = hpar->etaMax[0];
38  if (idet==static_cast<int>(HcalEndcap)) {
39  etaMn = hpar->etaMin[1]; etaMx = hpar->etaMax[1];
40  } else if (idet==static_cast<int>(HcalForward)) {
41  etaMn = hpar->etaMin[2]; etaMx = hpar->etaMax[2];
42  }
43  double eta = 0, deta = 0, phi = 0, dphi = 0, rz = 0, drz = 0;
44  bool ok = false, flagrz = true;
45  if ((idet==static_cast<int>(HcalBarrel)||idet==static_cast<int>(HcalEndcap)||
46  idet==static_cast<int>(HcalOuter)||idet==static_cast<int>(HcalForward))
47  && etaR >=etaMn && etaR <= etaMx && depth > 0) ok = true;
48  if (idet == static_cast<int>(HcalEndcap) && depth>(int)(hpar->zHE.size()))ok=false;
49  else if (idet == static_cast<int>(HcalBarrel) && depth > 17) ok=false;
50  else if (idet == static_cast<int>(HcalOuter) && depth != 4) ok=false;
51  else if (idet == static_cast<int>(HcalForward) && depth > maxDepth[2]) ok=false;
52  if (ok) {
53  eta = getEta(idet, etaR, zside, depth);
54  deta = deltaEta(idet, etaR, depth);
55  double fibin, fioff;
56  if (idet == static_cast<int>(HcalBarrel)||
57  idet == static_cast<int>(HcalOuter)) {
58  fioff = hpar->phioff[0];
59  fibin = hpar->phibin[etaR-1];
60  } else if (idet == static_cast<int>(HcalEndcap)) {
61  fioff = hpar->phioff[1];
62  fibin = hpar->phibin[etaR-1];
63  } else {
64  fioff = hpar->phioff[2];
65  fibin = hpar->phitable[etaR-hpar->etaMin[2]];
66  if (unitPhi(fibin) > 2) fioff = hpar->phioff[4];
67  }
68  phi = fioff + (iphi - 0.5)*fibin;
69  dphi = 0.5*fibin;
70  if (idet == static_cast<int>(HcalForward)) {
71  int ir = nR + hpar->etaMin[2] - etaR - 1;
72  if (ir > 0 && ir < nR) {
73  rz = 0.5*(hpar->rTable[ir]+hpar->rTable[ir-1]);
74  drz = 0.5*(hpar->rTable[ir]-hpar->rTable[ir-1]);
75  } else {
76  ok = false;
77 #ifdef EDM_ML_DEBUG
78  edm::LogInfo("HCalGeom") << "HcalDDDSimConstants: wrong eta " << etaR
79  << " (" << ir << "/" << nR << ") Detector "
80  << idet << std::endl;
81 #endif
82  }
83  } else if (etaR <= nEta) {
84  int laymin(depth), laymax(depth);
85  if (idet == static_cast<int>(HcalOuter)) {
86  laymin = (etaR > hpar->noff[2]) ? ((int)(hpar->zHE.size())) : ((int)(hpar->zHE.size()))-1;
87  laymax = ((int)(hpar->zHE.size()));
88  }
89  double d1=0, d2=0;
90  if (idet == static_cast<int>(HcalEndcap)) {
91  flagrz = false;
92  d1 = hpar->zHE[laymin-1] - hpar->dzHE[laymin-1];
93  d2 = hpar->zHE[laymax-1] + hpar->dzHE[laymax-1];
94  } else {
95  d1 = hpar->rHB[laymin-1] - hpar->drHB[laymin-1];
96  d2 = hpar->rHB[laymax-1] + hpar->drHB[laymax-1];
97  }
98  rz = 0.5*(d2+d1);
99  drz = 0.5*(d2-d1);
100  } else {
101  ok = false;
102  edm::LogWarning("HCalGeom") << "HcalDDDSimConstants: wrong depth "
103  << depth << " or etaR " << etaR
104  << " for detector " << idet;
105  }
106  } else {
107  ok = false;
108  edm::LogWarning("HCalGeom") << "HcalDDDSimConstants: wrong depth " << depth
109  << " det " << idet;
110  }
111  HcalCellType::HcalCell tmp(ok,eta,deta,phi,dphi,rz,drz,flagrz);
112 
113 #ifdef EDM_ML_DEBUG
114  std::cout << "HcalDDDSimConstants: det/side/depth/etaR/phi "
115  << idet << "/" << zside << "/" << depth << "/"
116  << etaR << "/" << iphi << " Cell Flag " << tmp.ok
117  << " " << tmp.eta << " " << tmp.deta << " phi "
118  << tmp.phi << " " << tmp.dphi << " r(z) " << tmp.rz
119  << " " << tmp.drz << " " << tmp.flagrz << std::endl;
120 #endif
121  return tmp;
122 }
int unitPhi(int det, int etaR) const
std::vector< int > maxDepth
std::vector< double > rHB
int getEta(int det, int lay, double hetaR)
int zside(DetId const &)
std::vector< int > etaMax
std::vector< double > zHE
std::vector< double > dzHE
std::vector< double > phioff
double deltaEta(int det, int eta, int depth) const
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
std::vector< double > rTable
std::vector< double > phitable
std::vector< double > phibin
std::vector< double > drHB
std::vector< int > noff
tuple cout
Definition: gather_cfg.py:145
const HcalParameters * hpar
std::vector< int > etaMin
double HcalDDDSimConstants::deltaEta ( int  det,
int  eta,
int  depth 
) const
private

Definition at line 634 of file HcalDDDSimConstants.cc.

References gather_cfg::cout, dlShort, etaHO, HcalParameters::etaMin, HcalParameters::etaTable, getEta(), HcalForward, HcalOuter, hpar, nEta, HcalParameters::noff, nR, HcalParameters::rTable, tmp, z, and zVcal.

Referenced by cell().

634  {
635 
636  double tmp = 0;
637  if (det == static_cast<int>(HcalForward)) {
638  int ir = nR + hpar->etaMin[2] - etaR - 1;
639  if (ir > 0 && ir < nR) {
640  double z = zVcal;
641  if (depth%2 != 1) z += dlShort;
642  tmp = 0.5*(getEta(hpar->rTable[ir-1],z)-getEta(hpar->rTable[ir],z));
643  }
644  } else {
645  if (etaR > 0 && etaR < nEta) {
646  if (etaR == hpar->noff[1]-1 && depth > 2) {
647  tmp = 0.5*(hpar->etaTable[etaR+1]-hpar->etaTable[etaR-1]);
648  } else if (det == static_cast<int>(HcalOuter)) {
649  if (etaR == hpar->noff[2]) {
650  tmp = 0.5*(etaHO[0]-hpar->etaTable[etaR-1]);
651  } else if (etaR == hpar->noff[2]+1) {
652  tmp = 0.5*(hpar->etaTable[etaR]-etaHO[1]);
653  } else if (etaR == hpar->noff[3]) {
654  tmp = 0.5*(etaHO[2]-hpar->etaTable[etaR-1]);
655  } else if (etaR == hpar->noff[3]+1) {
656  tmp = 0.5*(hpar->etaTable[etaR]-etaHO[3]);
657  } else {
658  tmp = 0.5*(hpar->etaTable[etaR]-hpar->etaTable[etaR-1]);
659  }
660  } else {
661  tmp = 0.5*(hpar->etaTable[etaR]-hpar->etaTable[etaR-1]);
662  }
663  }
664  }
665 #ifdef EDM_ML_DEBUG
666  std::cout << "HcalDDDSimConstants::deltaEta " << etaR << " "
667  << depth << " ==> " << tmp << std::endl;
668 #endif
669  return tmp;
670 }
std::vector< double > etaTable
int getEta(int det, int lay, double hetaR)
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
std::vector< double > rTable
std::vector< int > noff
tuple cout
Definition: gather_cfg.py:145
const HcalParameters * hpar
std::vector< int > etaMin
unsigned int HcalDDDSimConstants::findLayer ( int  layer,
const std::vector< HcalParameters::LayerItem > &  layerGroup 
) const

Definition at line 245 of file HcalDDDSimConstants.cc.

References i.

245  {
246 
247  unsigned int id = layerGroup.size();
248  for (unsigned int i = 0; i < layerGroup.size(); i++) {
249  if (layer == (int)(layerGroup[i].layer)) {
250  id = i;
251  break;
252  }
253  }
254  return id;
255 }
int i
Definition: DBlmapReader.cc:9
unsigned int layerGroup(unsigned int eta, unsigned int i) const
std::vector< std::pair< double, double > > HcalDDDSimConstants::getConstHBHE ( const int  type) const

Definition at line 124 of file HcalDDDSimConstants.cc.

References HcalParameters::drHB, HcalParameters::dzHE, hpar, i, HcalParameters::rHB, and HcalParameters::zHE.

124  {
125 
126  std::vector<std::pair<double,double> > gcons;
127  if (type == 0) {
128  for (unsigned int i=0; i<hpar->rHB.size(); ++i) {
129  gcons.push_back(std::pair<double,double>(hpar->rHB[i],hpar->drHB[i]));
130  }
131  } else {
132  for (unsigned int i=0; i<hpar->zHE.size(); ++i) {
133  gcons.push_back(std::pair<double,double>(hpar->zHE[i],hpar->dzHE[i]));
134  }
135  }
136  return gcons;
137 }
type
Definition: HCALResponse.h:21
int i
Definition: DBlmapReader.cc:9
std::vector< double > rHB
std::vector< double > zHE
std::vector< double > dzHE
std::vector< double > drHB
const HcalParameters * hpar
int HcalDDDSimConstants::getDepthEta16 ( int  i) const
inline
int HcalDDDSimConstants::getDepthEta29 ( int  i) const
inline

Definition at line 34 of file HcalDDDSimConstants.h.

References depthEta29.

Referenced by HcalDDDRecConstants::getEtaBins(), and HcalDDDRecConstants::getMaxDepth().

34 {return ((i==1) ? depthEta29[1] : depthEta29[0]);}
int i
Definition: DBlmapReader.cc:9
std::pair< int, double > HcalDDDSimConstants::getDetEta ( double  eta,
int  depth 
)

Definition at line 140 of file HcalDDDSimConstants.cc.

References eta, HcalParameters::etaMax, HLT_25ns10e33_v2_cff::etaMin, MuonErrorMatrixValues_cff::etaRange, HcalParameters::etaTable, create_public_lumi_plots::exp, HcalBarrel, HcalEndcap, HcalForward, hpar, i, nEta, funct::tan(), theta(), and zVcal.

Referenced by HcalNumberingFromDDD::unitID().

140  {
141 
142  int hsubdet(0), ieta(0);
143  double etaR(0);
144  double heta = fabs(eta);
145  for (int i = 0; i < nEta; i++)
146  if (heta > hpar->etaTable[i]) ieta = i + 1;
147  if (heta <= hpar->etaRange[1]) {
148  if ((ieta <= hpar->etaMin[1] && depth==3) || ieta > hpar->etaMax[0]) {
149  hsubdet = static_cast<int>(HcalEndcap);
150  } else {
151  hsubdet = static_cast<int>(HcalBarrel);
152  }
153  etaR = eta;
154  } else {
155  hsubdet = static_cast<int>(HcalForward);
156  double theta = 2.*atan(exp(-heta));
157  double hR = zVcal*tan(theta);
158  etaR = (eta >= 0. ? hR : -hR);
159  }
160  return std::pair<int,double>(hsubdet,etaR);
161 }
int i
Definition: DBlmapReader.cc:9
std::vector< double > etaTable
Geom::Theta< T > theta() const
std::vector< int > etaMax
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
const HcalParameters * hpar
int HcalDDDSimConstants::getEta ( int  det,
int  lay,
double  hetaR 
)

Definition at line 163 of file HcalDDDSimConstants.cc.

References etaHO, HcalParameters::etaMax, HcalParameters::etaMin, HLT_25ns10e33_v2_cff::etaMin, HcalParameters::etaTable, HcalBarrel, HcalEndcap, HcalForward, hpar, i, nEta, HcalParameters::noff, and nR.

Referenced by cell(), deltaEta(), getEta(), and HcalNumberingFromDDD::unitID().

163  {
164 
165  int ieta(0);
166  if (det == static_cast<int>(HcalForward)) { // Forward HCal
167  ieta = hpar->etaMax[2];
168  for (int i = nR-1; i > 0; i--)
169  if (hetaR < hpar->rTable[i]) ieta = hpar->etaMin[2] + nR - i - 1;
170  } else { // Barrel or Endcap
171  ieta = 1;
172  for (int i = 0; i < nEta-1; i++)
173  if (hetaR > hpar->etaTable[i]) ieta = i + 1;
174  if (det == static_cast<int>(HcalBarrel)) {
175  if (ieta > hpar->etaMax[0]) ieta = hpar->etaMax[0];
176  if (lay == 18) {
177  if (hetaR > etaHO[1] && ieta == hpar->noff[2]) ieta++;
178  }
179  } else if (det == static_cast<int>(HcalEndcap)) {
180  if (ieta <= hpar->etaMin[1]) ieta = hpar->etaMin[1];
181  }
182  }
183  return ieta;
184 }
int i
Definition: DBlmapReader.cc:9
std::vector< double > etaTable
std::vector< int > etaMax
std::vector< int > noff
const HcalParameters * hpar
std::vector< int > etaMin
double HcalDDDSimConstants::getEta ( int  det,
int  etaR,
int  zside,
int  depth = 1 
) const
private

Definition at line 672 of file HcalDDDSimConstants.cc.

References gather_cfg::cout, dlShort, etaHO, HcalParameters::etaMin, HcalParameters::etaTable, getEta(), HcalForward, HcalOuter, hpar, nEta, HcalParameters::noff, nR, HcalParameters::rTable, tmp, z, and zVcal.

673  {
674 
675  double tmp = 0;
676  if (det == static_cast<int>(HcalForward)) {
677  int ir = nR + hpar->etaMin[2] - etaR - 1;
678  if (ir > 0 && ir < nR) {
679  double z = zVcal;
680  if (depth%2 != 1) z += dlShort;
681  tmp = 0.5*(getEta(hpar->rTable[ir-1],z)+getEta(hpar->rTable[ir],z));
682  }
683  } else {
684  if (etaR > 0 && etaR < nEta) {
685  if (etaR == hpar->noff[1]-1 && depth > 2) {
686  tmp = 0.5*(hpar->etaTable[etaR+1]+hpar->etaTable[etaR-1]);
687  } else if (det == static_cast<int>(HcalOuter)) {
688  if (etaR == hpar->noff[2]) {
689  tmp = 0.5*(etaHO[0]+hpar->etaTable[etaR-1]);
690  } else if (etaR == hpar->noff[2]+1) {
691  tmp = 0.5*(hpar->etaTable[etaR]+etaHO[1]);
692  } else if (etaR == hpar->noff[3]) {
693  tmp = 0.5*(etaHO[2]+hpar->etaTable[etaR-1]);
694  } else if (etaR == hpar->noff[3]+1) {
695  tmp = 0.5*(hpar->etaTable[etaR]+etaHO[3]);
696  } else {
697  tmp = 0.5*(hpar->etaTable[etaR]+hpar->etaTable[etaR-1]);
698  }
699  } else {
700  tmp = 0.5*(hpar->etaTable[etaR]+hpar->etaTable[etaR-1]);
701  }
702  }
703  }
704  if (zside == 0) tmp = -tmp;
705 #ifdef EDM_ML_DEBUG
706  std::cout << "HcalDDDSimConstants::getEta " << etaR << " "
707  << zside << " " << depth << " ==> " << tmp << "\n";
708 #endif
709  return tmp;
710 }
std::vector< double > etaTable
int getEta(int det, int lay, double hetaR)
int zside(DetId const &)
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
std::vector< double > rTable
std::vector< int > noff
tuple cout
Definition: gather_cfg.py:145
const HcalParameters * hpar
std::vector< int > etaMin
double HcalDDDSimConstants::getEta ( double  r,
double  z 
) const
private

Definition at line 712 of file HcalDDDSimConstants.cc.

References gather_cfg::cout, dqm-mbProfile::log, funct::tan(), and tmp.

712  {
713 
714  double tmp = 0;
715  if (z != 0) tmp = -log(tan(0.5*atan(r/z)));
716 #ifdef EDM_ML_DEBUG
717  std::cout << "HcalDDDSimConstants::getEta " << r << " " << z
718  << " ==> " << tmp << std::endl;
719 #endif
720  return tmp;
721 }
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
tuple cout
Definition: gather_cfg.py:145
std::pair< int, int > HcalDDDSimConstants::getEtaDepth ( int  det,
int  etaR,
int  phi,
int  depth,
int  lay 
)

Definition at line 186 of file HcalDDDSimConstants.cc.

References HLT_25ns10e33_v2_cff::depth, depthEta16, depthEta29, HcalParameters::etaMin, HcalBarrel, HcalEndcap, HcalForward, HcalOuter, hpar, layerGroup(), maxDepth, HcalParameters::noff, HcalParameters::phibin, and HcalParameters::phioff.

Referenced by HcalNumberingFromDDD::unitID().

187  {
188 
189  //Modify the depth index
190  if (det == static_cast<int>(HcalForward)) { // Forward HCal
191  } else if (det == static_cast<int>(HcalOuter)) {
192  depth = 4;
193  } else {
194  if (lay >= 0) {
195  depth= layerGroup( etaR-1, lay-1 );
196  if (etaR == hpar->noff[0] && lay > 1) {
197  int kphi = phi + int((hpar->phioff[3]+0.1)/hpar->phibin[etaR-1]);
198  kphi = (kphi-1)%4 + 1;
199  if (kphi == 2 || kphi == 3) depth = layerGroup( etaR-1, lay-2 );
200  }
201  } else if (det == static_cast<int>(HcalBarrel)) {
202  if (depth>maxDepth[0]) depth = maxDepth[0];
203  }
204  if (etaR >= hpar->noff[1] && depth > depthEta29[0]) {
205  etaR -= depthEta29[1];
206  } else if (etaR == hpar->etaMin[1]) {
207  if (det == static_cast<int>(HcalBarrel)) {
208  if (depth > depthEta16[0]) depth = depthEta16[0];
209  } else {
210  if (depth < depthEta16[1]) depth = depthEta16[1];
211  }
212  }
213  }
214  if ((det == static_cast<int>(HcalEndcap)) && (etaR == 17) && (lay == 1))
215  etaR = 18;
216  return std::pair<int,int>(etaR,depth);
217 }
std::vector< int > maxDepth
std::vector< double > phioff
std::vector< double > phibin
std::vector< int > noff
const HcalParameters * hpar
unsigned int layerGroup(unsigned int eta, unsigned int i) const
std::vector< int > etaMin
double HcalDDDSimConstants::getEtaHO ( double &  etaR,
double &  x,
double &  y,
double &  z 
) const

Definition at line 219 of file HcalDDDSimConstants.cc.

References gather_cfg::cout, eta, HcalParameters::etaTable, hpar, alignCSCRings::r, rminHO, mathSSE::sqrt(), and HcalParameters::zHO.

Referenced by HcalNumberingFromDDD::unitID().

220  {
221 
222  if (hpar->zHO.size() > 4) {
223  double eta = fabs(etaR);
224  double r = std::sqrt(x*x+y*y);
225  if (r > rminHO) {
226  double zz = fabs(z);
227  if (zz > hpar->zHO[3]) {
228  if (eta <= hpar->etaTable[10]) eta = hpar->etaTable[10]+0.001;
229  } else if (zz > hpar->zHO[1]) {
230  if (eta <= hpar->etaTable[4]) eta = hpar->etaTable[4]+0.001;
231  }
232  }
233  eta = (z >= 0. ? eta : -eta);
234 #ifdef EDM_ML_DEBUG
235  std::cout << "R " << r << " Z " << z << " eta " << etaR
236  << ":" << eta << std::endl;
237  if (eta != etaR) edm::LogInfo ("HCalGeom") << "**** Check *****";
238 #endif
239  return eta;
240  } else {
241  return etaR;
242  }
243 }
std::vector< double > zHO
std::vector< double > etaTable
T sqrt(T t)
Definition: SSEVec.h:18
tuple cout
Definition: gather_cfg.py:145
const HcalParameters * hpar
const std::vector<double>& HcalDDDSimConstants::getEtaTableHF ( ) const
inline

Definition at line 42 of file HcalDDDSimConstants.h.

References HcalParameters::etaTableHF, and hpar.

42 {return hpar->etaTableHF;}
std::vector< double > etaTableHF
const HcalParameters * hpar
double HcalDDDSimConstants::getGain ( HcalSubdetector  subdet,
int  depth 
) const
private

Definition at line 743 of file HcalDDDSimConstants.cc.

References HcalParameters::HBGains, HcalEndcap, HcalForward, HcalOuter, HcalParameters::HEGains, HcalParameters::HFGains, and hpar.

Referenced by HcalCellTypes().

743  {
744 
745  double gain;
746  switch(subdet) {
747  case HcalEndcap:
748  gain = hpar->HEGains[0];
749  break;
750  case HcalForward:
751  gain = hpar->HFGains[(depth-1)%2];
752  break;
753  case HcalOuter:
754  gain = hpar->HBGains[3];
755  break;
756  default:
757  gain = hpar->HBGains[0];
758  break;
759  }
760  return gain;
761 }
std::vector< double > HBGains
std::vector< double > HEGains
std::vector< double > HFGains
const HcalParameters * hpar
const std::vector<double>& HcalDDDSimConstants::getGparHF ( ) const
inline

Definition at line 44 of file HcalDDDSimConstants.h.

References HcalParameters::gparHF, and hpar.

Referenced by HFFibre::initRun(), HFShower::initRun(), HFShowerParam::initRun(), HFShowerLibrary::initRun(), and HCalSD::update().

44 {return hpar->gparHF;}
std::vector< double > gparHF
const HcalParameters * hpar
const std::vector<HcalDetId>& HcalDDDSimConstants::getIdHF2QIE ( ) const
inline

Definition at line 49 of file HcalDDDSimConstants.h.

References idHF2QIE.

Referenced by HcalDDDRecConstants::getHFCellParameters().

49 {return idHF2QIE;}
std::vector< HcalDetId > idHF2QIE
std::pair<int,int> HcalDDDSimConstants::getiEtaRange ( const int  i) const
inline

Definition at line 41 of file HcalDDDSimConstants.h.

References HcalParameters::etaMax, HcalParameters::etaMin, hpar, and i.

41 {return std::pair<int,int>(hpar->etaMin[i],hpar->etaMax[i]);}
int i
Definition: DBlmapReader.cc:9
std::vector< int > etaMax
const HcalParameters * hpar
std::vector< int > etaMin
const std::vector<double>& HcalDDDSimConstants::getLayer0Wt ( ) const
inline

Definition at line 45 of file HcalDDDSimConstants.h.

References hpar, and HcalParameters::Layer0Wt.

Referenced by HCalSD::update().

45 {return hpar->Layer0Wt;}
std::vector< double > Layer0Wt
const HcalParameters * hpar
int HcalDDDSimConstants::getMaxDepth ( const int  type) const
inline

Definition at line 46 of file HcalDDDSimConstants.h.

References maxDepth.

Referenced by HCalSD::update().

46 {return maxDepth[type];}
type
Definition: HCALResponse.h:21
std::vector< int > maxDepth
std::pair< int, int > HcalDDDSimConstants::getModHalfHBHE ( const int  type) const

Definition at line 257 of file HcalDDDSimConstants.cc.

References nmodHB, nmodHE, nzHB, and nzHE.

257  {
258 
259  if (type == 0) {
260  return std::pair<int,int>(nmodHB,nzHB);
261  } else {
262  return std::pair<int,int>(nmodHE,nzHE);
263  }
264 }
type
Definition: HCALResponse.h:21
std::pair< double, double > HcalDDDSimConstants::getPhiCons ( int  det,
int  ieta 
)

Definition at line 266 of file HcalDDDSimConstants.cc.

References HcalParameters::etaMin, HcalBarrel, HcalForward, hpar, HcalParameters::phibin, HcalParameters::phioff, HcalParameters::phitable, and unitPhi().

Referenced by HcalNumberingFromDDD::unitID().

266  {
267 
268  double fioff(0), fibin(0);
269  if (det == static_cast<int>(HcalForward)) { // Forward HCal
270  fioff = hpar->phioff[2];
271  fibin = hpar->phitable[ieta-hpar->etaMin[2]];
272  if (unitPhi(fibin) > 2) { // HF double-phi
273  fioff = hpar->phioff[4];
274  }
275  } else { // Barrel or Endcap
276  if (det == static_cast<int>(HcalBarrel)) {
277  fioff = hpar->phioff[0];
278  } else {
279  fioff = hpar->phioff[1];
280  }
281  fibin = hpar->phibin[ieta-1];
282  }
283  return std::pair<double,double>(fioff,fibin);
284 }
int unitPhi(int det, int etaR) const
std::vector< double > phioff
std::vector< double > phitable
std::vector< double > phibin
const HcalParameters * hpar
std::vector< int > etaMin
const std::vector<double>& HcalDDDSimConstants::getPhiTableHF ( ) const
inline

Definition at line 50 of file HcalDDDSimConstants.h.

References hpar, and HcalParameters::phitable.

Referenced by HcalDDDRecConstants::getHFCellParameters(), and HFShowerLibrary::initRun().

50 {return hpar->phitable;}
std::vector< double > phitable
const HcalParameters * hpar
const std::vector<double>& HcalDDDSimConstants::getRTableHF ( ) const
inline
int HcalDDDSimConstants::getShift ( HcalSubdetector  subdet,
int  depth 
) const
private

Definition at line 723 of file HcalDDDSimConstants.cc.

References HcalParameters::HBShift, HcalEndcap, HcalForward, HcalOuter, HcalParameters::HEShift, HcalParameters::HFShift, hpar, and edm::shift.

Referenced by HcalCellTypes().

723  {
724 
725  int shift;
726  switch(subdet) {
727  case HcalEndcap:
728  shift = hpar->HEShift[0];
729  break;
730  case HcalForward:
731  shift = hpar->HFShift[(depth-1)%2];
732  break;
733  case HcalOuter:
734  shift = hpar->HBShift[3];
735  break;
736  default:
737  shift = hpar->HBShift[0];
738  break;
739  }
740  return shift;
741 }
std::vector< int > HEShift
std::vector< int > HFShift
static unsigned int const shift
std::vector< int > HBShift
const HcalParameters * hpar
std::vector< HcalCellType > HcalDDDSimConstants::HcalCellTypes ( ) const

Definition at line 286 of file HcalDDDSimConstants.cc.

References HcalBarrel, HcalEndcap, HcalForward, HcalOuter, and i.

Referenced by HcalDDDRecConstants::HcalCellTypes(), HcalDDDSimConstants(), and numberOfCells().

286  {
287 
288  std::vector<HcalCellType> cellTypes = HcalCellTypes(HcalBarrel);
289 #ifdef EDM_ML_DEBUG
290  edm::LogInfo ("HCalGeom") << "HcalDDDSimConstants: " << cellTypes.size()
291  << " cells of type HCal Barrel\n";
292  for (unsigned int i=0; i<cellTypes.size(); i++)
293  edm::LogInfo ("HCalGeom") << "Cell " << i << " " << cellTypes[i] << "\n";
294 #endif
295 
296  std::vector<HcalCellType> hoCells = HcalCellTypes(HcalOuter);
297 #ifdef EDM_ML_DEBUG
298  edm::LogInfo ("HCalGeom") << "HcalDDDSimConstants: " << hoCells.size()
299  << " cells of type HCal Outer\n";
300  for (unsigned int i=0; i<hoCells.size(); i++)
301  edm::LogInfo ("HCalGeom") << "Cell " << i << " " << hoCells[i] << "\n";
302 #endif
303  cellTypes.insert(cellTypes.end(), hoCells.begin(), hoCells.end());
304 
305  std::vector<HcalCellType> heCells = HcalCellTypes(HcalEndcap);
306 #ifdef EDM_ML_DEBUG
307  edm::LogInfo ("HCalGeom") << "HcalDDDSimConstants: " << heCells.size()
308  << " cells of type HCal Endcap\n";
309  for (unsigned int i=0; i<heCells.size(); i++)
310  edm::LogInfo ("HCalGeom") << "Cell " << i << " " << heCells[i] << "\n";
311 #endif
312  cellTypes.insert(cellTypes.end(), heCells.begin(), heCells.end());
313 
314  std::vector<HcalCellType> hfCells = HcalCellTypes(HcalForward);
315 #ifdef EDM_ML_DEBUG
316  edm::LogInfo ("HCalGeom") << "HcalDDDSimConstants: " << hfCells.size()
317  << " cells of type HCal Forward\n";
318  for (unsigned int i=0; i<hfCells.size(); i++)
319  edm::LogInfo ("HCalGeom") << "Cell " << i << " " << hfCells[i] << "\n";
320 #endif
321  cellTypes.insert(cellTypes.end(), hfCells.begin(), hfCells.end());
322 
323  return cellTypes;
324 }
int i
Definition: DBlmapReader.cc:9
std::vector< HcalCellType > HcalCellTypes() const
std::vector< HcalCellType > HcalDDDSimConstants::HcalCellTypes ( HcalSubdetector  subdet,
int  ieta = -1,
int  depth = -1 
) const

Definition at line 326 of file HcalDDDSimConstants.cc.

References cell(), HLT_25ns10e33_v2_cff::depth, dlShort, dzVcal, eta, HcalParameters::etaMax, HcalParameters::etaMin, getGain(), getShift(), HcalEndcap, HcalForward, HcalOuter, hpar, idHF2QIE, relval_2017::k, GetRecoTauVFromDQM_MC_cff::kk, cmsLHEtoEOSManager::l, maxDepth, nmodHB, nmodHE, HcalParameters::noff, HcalCellType::nPhiBins(), HcalCellType::nPhiModule(), nzHB, nzHE, HcalCellType::HcalCell::ok, phi, HcalCellType::setMissingPhi(), edm::shift, HcalCellType::unitPhi(), unitPhi(), units(), and ecaldqm::zside().

327  {
328 
329  std::vector<HcalCellType> cellTypes;
330  if (subdet == HcalForward) {
331  if (dzVcal < 0) return cellTypes;
332  }
333 
334  int dmin, dmax, indx, nz, nmod;
335  double hsize = 0;
336  switch(subdet) {
337  case HcalEndcap:
338  dmin = 1; dmax = 19; indx = 1; nz = nzHE; nmod = nmodHE;
339  break;
340  case HcalForward:
341  dmin = 1; dmax = maxDepth[2]; indx = 2; nz = 2; nmod = 18;
342  break;
343  case HcalOuter:
344  dmin = 4; dmax = 4; indx = 0; nz = nzHB; nmod = nmodHB;
345  break;
346  default:
347  dmin = 1; dmax = 17; indx = 0; nz = nzHB; nmod = nmodHB;
348  break;
349  }
350  if (depthl > 0) dmin = dmax = depthl;
351  int ietamin = (ieta>0) ? ieta : hpar->etaMin[indx];
352  int ietamax = (ieta>0) ? ieta : hpar->etaMax[indx];
353  int phi = 1, zside = 1;
354 
355  // Get the Cells
356  int subdet0 = static_cast<int>(subdet);
357  for (int depth=dmin; depth<=dmax; depth++) {
358  int shift = getShift(subdet, depth);
359  double gain = getGain (subdet, depth);
360  if (subdet == HcalForward) {
361  if (depth%2 == 1) hsize = dzVcal;
362  else hsize = dzVcal-0.5*dlShort;
363  }
364  for (int eta=ietamin; eta<= ietamax; eta++) {
365  HcalCellType::HcalCell temp1 = cell(subdet0,zside,depth,eta,phi);
366  if (temp1.ok) {
367  int units = unitPhi (subdet0, eta);
368  HcalCellType temp2(subdet, eta, phi, depth, temp1,
369  shift, gain, nz, nmod, hsize, units);
370  if (subdet == HcalOuter) {
371  if (eta == hpar->noff[4]) {
372  std::vector<int> missPlus, missMinus;
373  int kk = 7;
374  for (int miss=0; miss<hpar->noff[5]; miss++) {
375  missPlus.push_back(hpar->noff[kk]);
376  kk++;
377  }
378  for (int miss=0; miss<hpar->noff[6]; miss++) {
379  missMinus.push_back(hpar->noff[kk]);
380  kk++;
381  }
382  temp2.setMissingPhi(missPlus, missMinus);
383  }
384  } else if (subdet == HcalForward) {
385  if (idHF2QIE.size() > 0 && depth > 2) {
386  int phiInc = 4/temp2.nPhiModule();
387  int iphi = 1;
388  if (temp2.unitPhi() == 4) iphi = 3;
389  std::vector<int> missPlus, missMinus;
390  for (int k=0; k<temp2.nPhiBins(); ++k) {
391  bool okp(true), okn(true);
392  for (unsigned int l=0; l<idHF2QIE.size(); ++l) {
393  if ((eta == idHF2QIE[l].ietaAbs()) &&
394  (iphi == idHF2QIE[l].iphi())) {
395  if (idHF2QIE[l].zside() == 1) okp = false;
396  else okn = false;
397  }
398  }
399  if (okp) missPlus.push_back(iphi);
400  if (okn) missMinus.push_back(iphi);
401  iphi += phiInc;
402  }
403  temp2.setMissingPhi(missPlus, missMinus);
404  }
405  }
406  cellTypes.push_back(temp2);
407  }
408  }
409  }
410  return cellTypes;
411 }
int unitPhi(int det, int etaR) const
std::vector< int > maxDepth
int zside(DetId const &)
std::vector< int > etaMax
int getShift(HcalSubdetector subdet, int depth) const
double getGain(HcalSubdetector subdet, int depth) const
std::vector< HcalDetId > idHF2QIE
TString units(TString variable, Char_t axis)
HcalCellType::HcalCell cell(int det, int zside, int depth, int etaR, int iphi) const
static unsigned int const shift
std::vector< int > noff
const HcalParameters * hpar
std::vector< int > etaMin
void HcalDDDSimConstants::initialize ( void  )
private

Definition at line 497 of file HcalDDDSimConstants.cc.

References gather_cfg::cout, depthEta16, depthEta29, depths, dlShort, HcalParameters::dzVcal, dzVcal, etaHO, HcalParameters::etaMax, HLT_25ns10e33_v2_cff::etaMax, HcalParameters::etaMin, HcalParameters::etaTable, HcalParameters::gparHF, HcalForward, hpar, i, idHF2QIE, isBH_, relval_2017::k, GetRecoTauVFromDQM_MC_cff::kk, cmsLHEtoEOSManager::l, layerGroup(), layerGroupSize(), HcalParameters::maxDepth, maxDepth, HcalParameters::modHB, HcalParameters::modHE, nEta, nmodHB, nmodHE, HcalParameters::noff, nPhiF, nR, nzHB, nzHE, HcalParameters::rHB, HcalParameters::rHO, rminHO, HcalParameters::rTable, HcalParameters::zHO, and zVcal.

Referenced by HcalDDDSimConstants().

497  {
498 
499  nEta = hpar->etaTable.size();
500  nR = hpar->rTable.size();
501  nPhiF = nR - 1;
502  isBH_ = false;
503 
504 #ifdef EDM_ML_DEBUG
505  for (int i=0; i<nEta-1; ++i) {
506  std::cout << "HcalDDDSimConstants:Read LayerGroup" << i << ":";
507  for (unsigned int k=0; k<layerGroupSize( i ); k++)
508  std::cout << " [" << k << "] = " << layerGroup( i, k );
509  std::cout << std::endl;
510  }
511 #endif
512 
513  // Geometry parameters for HF
514  dlShort = hpar->gparHF[0];
515  zVcal = hpar->gparHF[4];
516  dzVcal = hpar->dzVcal;
517 #ifdef EDM_ML_DEBUG
518  std::cout << "HcalDDDSimConstants: dlShort " << dlShort << " zVcal " << zVcal
519  << " and dzVcal " << dzVcal << std::endl;
520 #endif
521 
522  //Transform some of the parameters
524  maxDepth[0] = maxDepth[1] = 0;
525  for (int i=0; i<nEta-1; ++i) {
526  unsigned int imx = layerGroupSize( i );
527  int laymax = (imx > 0) ? layerGroup( i, imx-1 ) : 0;
528  if (i < hpar->etaMax[0]) {
529  int laymax0 = (imx > 16) ? layerGroup( i, 16 ) : laymax;
530  if (i+1 == hpar->etaMax[0] && laymax0 > 2) laymax0 = 2;
531  if (maxDepth[0] < laymax0) maxDepth[0] = laymax0;
532  }
533  if (i >= hpar->etaMin[1]-1 && i < hpar->etaMax[1]) {
534  if (maxDepth[1] < laymax) maxDepth[1] = laymax;
535  }
536  }
537 #ifdef EDM_ML_DEBUG
538  for (int i=0; i<4; ++i)
539  std::cout << "Detector Type [" << i << "] iEta " << hpar->etaMin[i] << ":"
540  << hpar->etaMax[i] << " MaxDepth " << maxDepth[i] << std::endl;
541 #endif
542 
543  int maxdepth = (maxDepth[1]>maxDepth[0]) ? maxDepth[1] : maxDepth[0];
544  for (int i=0; i<maxdepth; ++i) {
545  for (int k=0; k<nEta-1; ++k) {
546  int layermx = ((k+1 < hpar->etaMin[1]) && i < maxDepth[0]) ? 17 : (int)layerGroupSize( k );
547  int ll = layermx;
548  for (int l=layermx-1; l >= 0; --l) {
549  if ((int)layerGroup( k, l ) == i+1) {
550  ll = l+1; break;
551  }
552  }
553  depths[i].push_back(ll);
554  }
555 
556 #ifdef EDM_ML_DEBUG
557  std::cout << "Depth " << i << " with " << depths[i].size() << " etas:";
558  for (int k=0; k<nEta-1; ++k) std::cout << " " << depths[i][k];
559  std::cout << std::endl;
560 #endif
561  }
562 
563  nzHB = hpar->modHB[0];
564  nmodHB = hpar->modHB[1];
565  nzHE = hpar->modHE[0];
566  nmodHE = hpar->modHE[1];
567 #ifdef EDM_ML_DEBUG
568  std::cout << "HcalDDDSimConstants:: " << nzHB << ":" << nmodHB
569  << " barrel and " << nzHE << ":" << nmodHE
570  << " endcap half-sectors" << std::endl;
571 #endif
572 
573  if (hpar->rHB.size() > 17 && hpar->zHO.size() > 4) {
574  rminHO = hpar->rHO[0];
575  for (int k=0; k<4; ++k) etaHO[k] = hpar->rHO[k+1];
576  } else {
577  rminHO =-1.0;
578  etaHO[0] = hpar->etaTable[4];
579  etaHO[1] = hpar->etaTable[4];
580  etaHO[2] = hpar->etaTable[10];
581  etaHO[3] = hpar->etaTable[10];
582  }
583 #ifdef EDM_ML_DEBUG
584  std::cout << "HO Eta boundaries " << etaHO[0] << " " << etaHO[1]
585  << " " << etaHO[2] << " " << etaHO[3] << std::endl;
586  std::cout << "HO Parameters " << rminHO << " " << hpar->zHO.size();
587  for (int i=0; i<4; ++i) std::cout << " eta[" << i << "] = " << etaHO[i];
588  for (unsigned int i=0; i<hpar->zHO.size(); ++i)
589  std::cout << " zHO[" << i << "] = " << hpar->zHO[i];
590  std::cout << std::endl;
591 #endif
592 
593  int noffsize = 7 + hpar->noff[5] + hpar->noff[6];
594  int noffl(noffsize+5);
595  if ((int)(hpar->noff.size()) > (noffsize+3)) {
596  depthEta16[0] = hpar->noff[noffsize];
597  depthEta16[1] = hpar->noff[noffsize+1];
598  depthEta29[0] = hpar->noff[noffsize+2];
599  depthEta29[1] = hpar->noff[noffsize+3];
600  if ((int)(hpar->noff.size()) > (noffsize+4)) {
601  noffl += (2*hpar->noff[noffsize+4]);
602  if ((int)(hpar->noff.size()) > noffl) isBH_ = (hpar->noff[noffl] > 0);
603  }
604  } else {
605  depthEta16[0] = 2;
606  depthEta16[1] = 3;
607  depthEta29[0] = 2;
608  depthEta29[1] = 1;
609  }
610 #ifdef EDM_ML_DEBUG
611  std::cout << "isBH_ " << hpar->noff.size() << ":" << noffsize << ":"
612  << noffl << ":" << isBH_ << std::endl;
613  std::cout << "Depth index at ieta = 16 for HB (max) " << depthEta16[0]
614  << " HE (min) " << depthEta16[1] << "; max depth for itea = 29 : ("
615  << depthEta29[0] << ":" << depthEta29[1] << ")" << std::endl;
616 #endif
617 
618  if ((int)(hpar->noff.size()) > (noffsize+4)) {
619  int npair = hpar->noff[noffsize+4];
620  int kk = noffsize+4;
621  for (int k=0; k<npair; ++k) {
622  idHF2QIE.push_back(HcalDetId(HcalForward,hpar->noff[kk+1],hpar->noff[kk+2],1));
623  kk += 2;
624  }
625  }
626 #ifdef EDM_ML_DEBUG
627  std::cout << idHF2QIE.size() << " detector channels having 2 QIE cards:"
628  << std::endl;
629  for (unsigned int k=0; k<idHF2QIE.size(); ++k)
630  std::cout << " [" << k << "] " << idHF2QIE[k] << std::endl;
631 #endif
632 }
std::vector< double > zHO
int i
Definition: DBlmapReader.cc:9
std::vector< double > etaTable
std::vector< int > maxDepth
std::vector< double > rHB
std::vector< int > etaMax
std::vector< int > depths[nDepthMax]
std::vector< int > modHB
std::vector< double > rHO
std::vector< int > modHE
std::vector< HcalDetId > idHF2QIE
std::vector< double > gparHF
std::vector< double > rTable
std::vector< int > noff
tuple cout
Definition: gather_cfg.py:145
const HcalParameters * hpar
std::vector< int > maxDepth
unsigned int layerGroup(unsigned int eta, unsigned int i) const
std::vector< int > etaMin
unsigned int layerGroupSize(unsigned int eta) const
bool HcalDDDSimConstants::isBH ( ) const
inline

Definition at line 55 of file HcalDDDSimConstants.h.

References isBH_.

Referenced by HcalDDDRecConstants::isBH().

55 {return isBH_;}
unsigned int HcalDDDSimConstants::layerGroup ( unsigned int  eta,
unsigned int  i 
) const
private

Definition at line 871 of file HcalDDDSimConstants.cc.

References hpar, relval_2017::k, and HcalParameters::layerGroupEtaSim.

Referenced by getEtaDepth(), and initialize().

872  {
873  unsigned int k = 0;
874  for( auto const & it : hpar->layerGroupEtaSim ) {
875  if( it.layer == eta + 1 ) {
876  return it.layerGroup.at( i );
877  }
878  if( it.layer > eta + 1 ) break;
879  k = it.layerGroup.at( i );
880  }
881  return k;
882 }
int i
Definition: DBlmapReader.cc:9
std::vector< LayerItem > layerGroupEtaSim
const HcalParameters * hpar
unsigned int HcalDDDSimConstants::layerGroupSize ( unsigned int  eta) const
private

Definition at line 859 of file HcalDDDSimConstants.cc.

References hpar, relval_2017::k, and HcalParameters::layerGroupEtaSim.

Referenced by initialize().

859  {
860  unsigned int k = 0;
861  for( auto const & it : hpar->layerGroupEtaSim ) {
862  if( it.layer == eta + 1 ) {
863  return it.layerGroup.size();
864  }
865  if( it.layer > eta + 1 ) break;
866  k = it.layerGroup.size();
867  }
868  return k;
869 }
std::vector< LayerItem > layerGroupEtaSim
const HcalParameters * hpar
int HcalDDDSimConstants::maxHFDepth ( int  ieta,
int  iphi 
) const

Definition at line 413 of file HcalDDDSimConstants.cc.

References idHF2QIE, relval_2017::k, maxDepth, and convertSQLiteXML::ok.

Referenced by HcalDDDRecConstants::maxHFDepth(), FastHFShowerLibrary::modifyDepth(), and HCalSD::modifyDepth().

413  {
414  int mxdepth = maxDepth[2];
415  if (idHF2QIE.size() > 0) {
416  bool ok(false);
417  for (unsigned int k=0; k<idHF2QIE.size(); ++k) {
418  if ((eta == idHF2QIE[k].ieta()) && (iphi == idHF2QIE[k].iphi())) {
419  ok = true; break;
420  }
421  }
422  if (!ok) mxdepth = 2;
423  }
424  return mxdepth;
425 }
std::vector< int > maxDepth
std::vector< HcalDetId > idHF2QIE
unsigned int HcalDDDSimConstants::numberOfCells ( HcalSubdetector  subdet) const

Definition at line 427 of file HcalDDDSimConstants.cc.

References gather_cfg::cout, HcalCellTypes(), i, ecaldqm::binning::nPhiBins, and pileupDistInMC::num.

Referenced by HcalDDDRecConstants::nCells(), and HcalDDDRecConstants::numberOfCells().

427  {
428 
429  unsigned int num = 0;
430  std::vector<HcalCellType> cellTypes = HcalCellTypes(subdet);
431  for (unsigned int i=0; i<cellTypes.size(); i++) {
432  int ncur = (cellTypes[i].nHalves() > 1) ? 2*cellTypes[i].nPhiBins() :
433  cellTypes[i].nPhiBins();
434  num += (unsigned int)(ncur);
435  num -= (unsigned int)(cellTypes[i].nPhiMissingBins());
436  }
437 #ifdef EDM_ML_DEBUG
438  std::cout << "HcalDDDSimConstants:numberOfCells "
439  << cellTypes.size() << " " << num
440  << " for subdetector " << subdet << std::endl;
441 #endif
442  return num;
443 }
int i
Definition: DBlmapReader.cc:9
std::vector< HcalCellType > HcalCellTypes() const
tuple cout
Definition: gather_cfg.py:145
int HcalDDDSimConstants::phiNumber ( int  phi,
int  unit 
) const

Definition at line 445 of file HcalDDDSimConstants.cc.

References phi.

Referenced by HcalDDDRecConstants::getHCID(), and HcalNumberingFromDDD::unitID().

445  {
446 
447  int iphi_skip = phi;
448  if (units==2) iphi_skip = (phi-1)*2+1;
449  else if (units==4) iphi_skip = (phi-1)*4-1;
450  if (iphi_skip < 0) iphi_skip += 72;
451  return iphi_skip;
452 }
TString units(TString variable, Char_t axis)
void HcalDDDSimConstants::printTileHB ( int  eta,
int  depth 
) const
private

Definition at line 763 of file HcalDDDSimConstants.cc.

References funct::cos(), gather_cfg::cout, depths, HcalParameters::dxHB, HcalParameters::dyHB, HcalParameters::etaTable, create_public_lumi_plots::exp, hpar, relval_2017::k, GetRecoTauVFromDQM_MC_cff::kk, HcalParameters::layHB, min(), HcalParameters::rhoxHB, funct::sin(), SiStripMonitorClusterAlca_cfi::zmax, and SiStripMonitorClusterAlca_cfi::zmin.

Referenced by printTiles().

763  {
764  std::cout << "HcalDDDSimConstants::printTileHB for eta " << eta << " and depth " << depth << "\n";
765 
766  double etaL = hpar->etaTable.at(eta-1);
767  double thetaL = 2.*atan(exp(-etaL));
768  double etaH = hpar->etaTable.at(eta);
769  double thetaH = 2.*atan(exp(-etaH));
770  int layL=0, layH=0;
771  if (depth == 1) {
772  layH = depths[0][eta-1];
773  } else {
774  layL = depths[0][eta-1];
775  layH = depths[1][eta-1];
776  }
777  std::cout << "\ntileHB:: eta|depth " << eta << "|" << depth << " theta " << thetaH/CLHEP::deg << ":" << thetaL/CLHEP::deg << " Layer " << layL << ":" << layH-1 << "\n";
778  for (int lay=layL; lay<layH; ++lay) {
779  std::vector<double> area(2,0);
780  int kk=0;
781  for (unsigned int k=0; k<hpar->layHB.size(); ++k) {
782  if (lay == hpar->layHB[k]) {
783  double zmin = hpar->rhoxHB[k]*std::cos(thetaL)/std::sin(thetaL);
784  double zmax = hpar->rhoxHB[k]*std::cos(thetaH)/std::sin(thetaH);
785  double dz = (std::min(zmax,hpar->dxHB[k]) - zmin);
786  if (dz > 0) {
787  area[kk] = dz*hpar->dyHB[k];
788  kk++;
789  }
790  }
791  }
792  if (area[0] > 0) std::cout << std::setw(2) << lay << " Area " << std::setw(8) << area[0] << " " << std::setw(8) << area[1] << "\n";
793  }
794 }
std::vector< double > etaTable
std::vector< double > rhoxHB
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
std::vector< int > depths[nDepthMax]
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
T min(T a, T b)
Definition: MathUtil.h:58
std::vector< double > dyHB
std::vector< double > dxHB
tuple cout
Definition: gather_cfg.py:145
const HcalParameters * hpar
std::vector< int > layHB
void HcalDDDSimConstants::printTileHE ( int  eta,
int  depth 
) const
private

Definition at line 796 of file HcalDDDSimConstants.cc.

References gather_cfg::cout, depths, HcalParameters::dx1HE, HcalParameters::dyHE, eta, HcalParameters::etaTable, create_public_lumi_plots::exp, hpar, relval_2017::k, GetRecoTauVFromDQM_MC_cff::kk, HcalParameters::layHE, bookConverter::max, min(), HcalParameters::phibin, HcalParameters::rhoxHE, funct::tan(), and HcalParameters::zxHE.

Referenced by printTiles().

796  {
797 
798  double etaL = hpar->etaTable[eta-1];
799  double thetaL = 2.*atan(exp(-etaL));
800  double etaH = hpar->etaTable[eta];
801  double thetaH = 2.*atan(exp(-etaH));
802  int layL=0, layH=0;
803  if (eta == 16) {
804  layH = depths[2][eta-1];
805  } else if (depth == 1) {
806  layH = depths[0][eta-1];
807  } else if (depth == 2) {
808  layL = depths[0][eta-1];
809  layH = depths[1][eta-1];
810  } else {
811  layL = depths[1][eta-1];
812  layH = depths[2][eta-1];
813  }
814  double phib = hpar->phibin[eta-1];
815  int nphi = 2;
816  if (phib > 6*CLHEP::deg) nphi = 1;
817  std::cout << "\ntileHE:: Eta/depth " << eta << "|" << depth << " theta " << thetaH/CLHEP::deg << ":" << thetaL/CLHEP::deg << " Layer " << layL << ":" << layH-1 << " phi " << nphi << "\n";
818  for (int lay=layL; lay<layH; ++lay) {
819  std::vector<double> area(4,0);
820  int kk=0;
821  for (unsigned int k=0; k<hpar->layHE.size(); ++k) {
822  if (lay == hpar->layHE[k]) {
823  double rmin = hpar->zxHE[k]*std::tan(thetaH);
824  double rmax = hpar->zxHE[k]*std::tan(thetaL);
825  if ((lay != 0 || eta == 18) &&
826  (lay != 1 || (eta == 18 && hpar->rhoxHE[k]-hpar->dyHE[k] > 1000) ||
827  (eta != 18 && hpar->rhoxHE[k]-hpar->dyHE[k] < 1000)) &&
828  rmin+30 < hpar->rhoxHE[k]+hpar->dyHE[k] &&
829  rmax > hpar->rhoxHE[k]-hpar->dyHE[k]) {
830  rmin = std::max(rmin,hpar->rhoxHE[k]-hpar->dyHE[k]);
831  rmax = std::min(rmax,hpar->rhoxHE[k]+hpar->dyHE[k]);
832  double dx1 = rmin*std::tan(phib);
833  double dx2 = rmax*std::tan(phib);
834  double ar1=0, ar2=0;
835  if (nphi == 1) {
836  ar1 = 0.5*(rmax-rmin)*(dx1+dx2-4.*hpar->dx1HE[k]);
837  } else {
838  ar1 = 0.5*(rmax-rmin)*(dx1+dx2-2.*hpar->dx1HE[k]);
839  ar2 = 0.5*(rmax-rmin)*((rmax+rmin)*tan(10.*CLHEP::deg)-4*hpar->dx1HE[k])-ar1;
840  }
841  area[kk] = ar1;
842  area[kk+2] = ar2;
843  kk++;
844  }
845  }
846  }
847  if (area[0] > 0 && area[1] > 0) {
848  int lay0 = lay-1;
849  if (eta == 18) lay0++;
850  if (nphi == 1) {
851  std::cout << std::setw(2) << lay0 << " Area " << std::setw(8) << area[0] << " " << std::setw(8) << area[1] << "\n";
852  } else {
853  std::cout << std::setw(2) << lay0 << " Area " << std::setw(8) << area[0] << " " << std::setw(8) << area[1] << ":" << std::setw(8) << area[2] << " " << std::setw(8) << area[3] << "\n";
854  }
855  }
856  }
857 }
std::vector< double > etaTable
std::vector< int > layHE
std::vector< int > depths[nDepthMax]
std::vector< double > rhoxHE
std::vector< double > zxHE
std::vector< double > dyHE
std::vector< double > dx1HE
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
T min(T a, T b)
Definition: MathUtil.h:58
std::vector< double > phibin
tuple cout
Definition: gather_cfg.py:145
const HcalParameters * hpar
void HcalDDDSimConstants::printTiles ( ) const

Definition at line 454 of file HcalDDDSimConstants.cc.

References gather_cfg::cout, HLT_25ns10e33_v2_cff::depth, depthEta16, depths, eta, HcalParameters::etaMax, HLT_25ns10e33_v2_cff::etaMax, HcalParameters::etaMin, hpar, maxDepth, printTileHB(), and printTileHE().

454  {
455 
456  std::cout << "Tile Information for HB from " << hpar->etaMin[0] << " to " << hpar->etaMax[0] << "\n\n";
457  for (int eta=hpar->etaMin[0]; eta<= hpar->etaMax[0]; eta++) {
458  int dmax = 1;
459  if (depths[0][eta-1] < 17) dmax = 2;
460  if (maxDepth[0] > 2) {
461  if (eta == hpar->etaMin[1]) dmax = depthEta16[0];
462  else dmax = maxDepth[0];
463  }
464  for (int depth=1; depth<=dmax; depth++)
466  }
467 
468  std::cout << "\nTile Information for HE from " << hpar->etaMin[1] << " to " << hpar->etaMax[1] << "\n\n";
469  for (int eta=hpar->etaMin[1]; eta<= hpar->etaMax[1]; eta++) {
470  int dmin=1, dmax=3;
471  if (eta == hpar->etaMin[1]) {
472  dmax = dmin = depthEta16[1];
473  } else if (depths[0][eta-1] > 18) {
474  dmax = 1;
475  } else if (depths[1][eta-1] > 18) {
476  dmax = 2;
477  }
478  for (int depth=dmin; depth<=dmax; depth++)
480  }
481 }
void printTileHB(int eta, int depth) const
std::vector< int > maxDepth
std::vector< int > etaMax
std::vector< int > depths[nDepthMax]
void printTileHE(int eta, int depth) const
tuple cout
Definition: gather_cfg.py:145
const HcalParameters * hpar
std::vector< int > etaMin
int HcalDDDSimConstants::unitPhi ( int  det,
int  etaR 
) const

Definition at line 483 of file HcalDDDSimConstants.cc.

References HcalParameters::etaMin, HcalForward, hpar, HcalParameters::phibin, and HcalParameters::phitable.

Referenced by cell(), HcalDDDRecConstants::getEtaPhi(), HcalDDDRecConstants::getHCID(), getPhiCons(), HcalCellTypes(), HcalDDDRecConstants::HcalCellTypes(), HcalDDDRecConstants::initialize(), and HcalNumberingFromDDD::unitID().

483  {
484 
485  double dphi = (det == static_cast<int>(HcalForward)) ? hpar->phitable[etaR-hpar->etaMin[2]] : hpar->phibin[etaR-1];
486  return unitPhi(dphi);
487 }
int unitPhi(int det, int etaR) const
std::vector< double > phitable
std::vector< double > phibin
const HcalParameters * hpar
std::vector< int > etaMin
int HcalDDDSimConstants::unitPhi ( double  dphi) const

Definition at line 489 of file HcalDDDSimConstants.cc.

References M_PI, and units().

489  {
490 
491  const double fiveDegInRad = 2*M_PI/72;
492  int units = int(dphi/fiveDegInRad+0.5);
493  if (units < 1) units = 1;
494  return units;
495 }
#define M_PI
TString units(TString variable, Char_t axis)

Member Data Documentation

int HcalDDDSimConstants::depthEta16[2]
private

Definition at line 90 of file HcalDDDSimConstants.h.

Referenced by getDepthEta16(), getEtaDepth(), initialize(), and printTiles().

int HcalDDDSimConstants::depthEta29[2]
private

Definition at line 91 of file HcalDDDSimConstants.h.

Referenced by getDepthEta29(), getEtaDepth(), and initialize().

std::vector<int> HcalDDDSimConstants::depths[nDepthMax]
private

Definition at line 82 of file HcalDDDSimConstants.h.

Referenced by initialize(), printTileHB(), printTileHE(), and printTiles().

double HcalDDDSimConstants::dlShort
private

Definition at line 89 of file HcalDDDSimConstants.h.

Referenced by deltaEta(), getEta(), HcalCellTypes(), and initialize().

double HcalDDDSimConstants::dzVcal
private

Definition at line 88 of file HcalDDDSimConstants.h.

Referenced by HcalCellTypes(), and initialize().

double HcalDDDSimConstants::etaHO[4]
private

Definition at line 86 of file HcalDDDSimConstants.h.

Referenced by deltaEta(), getEta(), and initialize().

const HcalParameters* HcalDDDSimConstants::hpar
private
std::vector<HcalDetId> HcalDDDSimConstants::idHF2QIE
private

Definition at line 93 of file HcalDDDSimConstants.h.

Referenced by getIdHF2QIE(), HcalCellTypes(), initialize(), and maxHFDepth().

bool HcalDDDSimConstants::isBH_
private

Definition at line 92 of file HcalDDDSimConstants.h.

Referenced by initialize(), and isBH().

std::vector<int> HcalDDDSimConstants::maxDepth
private
int HcalDDDSimConstants::nDepth
private

Definition at line 83 of file HcalDDDSimConstants.h.

const int HcalDDDSimConstants::nDepthMax =9
staticprivate

Definition at line 77 of file HcalDDDSimConstants.h.

int HcalDDDSimConstants::nEta
private

Definition at line 79 of file HcalDDDSimConstants.h.

Referenced by cell(), deltaEta(), getDetEta(), getEta(), and initialize().

int HcalDDDSimConstants::nmodHB
private

Definition at line 84 of file HcalDDDSimConstants.h.

Referenced by getModHalfHBHE(), HcalCellTypes(), and initialize().

int HcalDDDSimConstants::nmodHE
private

Definition at line 85 of file HcalDDDSimConstants.h.

Referenced by getModHalfHBHE(), HcalCellTypes(), and initialize().

int HcalDDDSimConstants::nPhiF
private

Definition at line 81 of file HcalDDDSimConstants.h.

Referenced by initialize().

int HcalDDDSimConstants::nR
private

Definition at line 80 of file HcalDDDSimConstants.h.

Referenced by cell(), deltaEta(), getEta(), and initialize().

int HcalDDDSimConstants::nzHB
private

Definition at line 84 of file HcalDDDSimConstants.h.

Referenced by getModHalfHBHE(), HcalCellTypes(), and initialize().

int HcalDDDSimConstants::nzHE
private

Definition at line 85 of file HcalDDDSimConstants.h.

Referenced by getModHalfHBHE(), HcalCellTypes(), and initialize().

double HcalDDDSimConstants::rminHO
private

Definition at line 86 of file HcalDDDSimConstants.h.

Referenced by getEtaHO(), and initialize().

double HcalDDDSimConstants::zVcal
private

Definition at line 87 of file HcalDDDSimConstants.h.

Referenced by deltaEta(), getDetEta(), getEta(), and initialize().