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
 
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
 
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)
 
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

std::vector< int > depths [nDepthMax]
 
double dlShort
 
double dzVcal
 
double etaHO [4]
 
const HcalParametershpar
 
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 22 of file HcalDDDSimConstants.h.

Constructor & Destructor Documentation

HcalDDDSimConstants::HcalDDDSimConstants ( const HcalParameters hp)

Definition at line 46 of file HcalDDDSimConstants.cc.

References HcalCellTypes(), and initialize().

46  : hpar(hp) {
47 
48 #ifdef DebugLog
49  edm::LogInfo("HCalGeom") << "HcalDDDSimConstants::HcalDDDSimConstants (const HcalParameter* hp) constructor";
50 #endif
51 
52  initialize();
53 #ifdef DebugLog
54  std::vector<HcalCellType> cellTypes = HcalCellTypes();
55  edm::LogInfo ("HCalGeom") << "HcalDDDSimConstants: " << cellTypes.size()
56  << " cells of type HCal (All)";
57 #endif
58 }
std::vector< HcalCellType > HcalCellTypes() const
const HcalParameters * hpar
HcalDDDSimConstants::~HcalDDDSimConstants ( )

Definition at line 61 of file HcalDDDSimConstants.cc.

61  {
62 #ifdef DebugLog
63  edm::LogInfo ("HCalGeom") << "HcalDDDSimConstants::destructed!!!";
64 #endif
65 }

Member Function Documentation

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

Definition at line 67 of file HcalDDDSimConstants.cc.

References 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 HcalCellTypes(), and HcalTestAnalysis::update().

69  {
70 
71  double etaMn = hpar->etaMin[0];
72  double etaMx = hpar->etaMax[0];
73  if (idet==static_cast<int>(HcalEndcap)) {
74  etaMn = hpar->etaMin[1]; etaMx = hpar->etaMax[1];
75  } else if (idet==static_cast<int>(HcalForward)) {
76  etaMn = hpar->etaMin[2]; etaMx = hpar->etaMax[2];
77  }
78  double eta = 0, deta = 0, phi = 0, dphi = 0, rz = 0, drz = 0;
79  bool ok = false, flagrz = true;
80  if ((idet==static_cast<int>(HcalBarrel)||idet==static_cast<int>(HcalEndcap)||
81  idet==static_cast<int>(HcalOuter)||idet==static_cast<int>(HcalForward))
82  && etaR >=etaMn && etaR <= etaMx && depth > 0) ok = true;
83  if (idet == static_cast<int>(HcalEndcap) && depth>(int)(hpar->zHE.size()))ok=false;
84  else if (idet == static_cast<int>(HcalBarrel) && depth > 17) ok=false;
85  else if (idet == static_cast<int>(HcalOuter) && depth != 4) ok=false;
86  else if (idet == static_cast<int>(HcalForward) && depth > maxDepth[2]) ok=false;
87  if (ok) {
88  eta = getEta(idet, etaR, zside, depth);
89  deta = deltaEta(idet, etaR, depth);
90  double fibin, fioff;
91  if (idet == static_cast<int>(HcalBarrel)||
92  idet == static_cast<int>(HcalOuter)) {
93  fioff = hpar->phioff[0];
94  fibin = hpar->phibin[etaR-1];
95  } else if (idet == static_cast<int>(HcalEndcap)) {
96  fioff = hpar->phioff[1];
97  fibin = hpar->phibin[etaR-1];
98  } else {
99  fioff = hpar->phioff[2];
100  fibin = hpar->phitable[etaR-hpar->etaMin[2]];
101  if (unitPhi(fibin) > 2) fioff = hpar->phioff[4];
102  }
103  phi = fioff + (iphi - 0.5)*fibin;
104  dphi = 0.5*fibin;
105  if (idet == static_cast<int>(HcalForward)) {
106  int ir = nR + hpar->etaMin[2] - etaR - 1;
107  if (ir > 0 && ir < nR) {
108  rz = 0.5*(hpar->rTable[ir]+hpar->rTable[ir-1]);
109  drz = 0.5*(hpar->rTable[ir]-hpar->rTable[ir-1]);
110  } else {
111  ok = false;
112 #ifdef DebugLog
113  edm::LogInfo("HCalGeom") << "HcalDDDSimConstants: wrong eta " << etaR
114  << " (" << ir << "/" << nR << ") Detector "
115  << idet;
116 #endif
117  }
118  } else if (etaR <= nEta) {
119  int laymin(depth), laymax(depth);
120  if (idet == static_cast<int>(HcalOuter)) {
121  laymin = (etaR > hpar->noff[2]) ? ((int)(hpar->zHE.size())) : ((int)(hpar->zHE.size()))-1;
122  laymax = ((int)(hpar->zHE.size()));
123  }
124  double d1=0, d2=0;
125  if (idet == static_cast<int>(HcalEndcap)) {
126  flagrz = false;
127  d1 = hpar->zHE[laymin-1] - hpar->dzHE[laymin-1];
128  d2 = hpar->zHE[laymax-1] + hpar->dzHE[laymax-1];
129  } else {
130  d1 = hpar->rHB[laymin-1] - hpar->drHB[laymin-1];
131  d2 = hpar->rHB[laymax-1] + hpar->drHB[laymax-1];
132  }
133  rz = 0.5*(d2+d1);
134  drz = 0.5*(d2-d1);
135  } else {
136  ok = false;
137 #ifdef DebugLog
138  edm::LogInfo("HCalGeom") << "HcalDDDSimConstants: wrong depth " << depth
139  << " or etaR " << etaR << " for detector "
140  << idet;
141 #endif
142  }
143  } else {
144  ok = false;
145 #ifdef DebugLog
146  edm::LogInfo("HCalGeom") << "HcalDDDSimConstants: wrong depth " << depth
147  << " det " << idet;
148 #endif
149  }
150  HcalCellType::HcalCell tmp(ok,eta,deta,phi,dphi,rz,drz,flagrz);
151 
152 #ifdef DebugLog
153  edm::LogInfo("HCalGeom") << "HcalDDDSimConstants: det/side/depth/etaR/phi "
154  << idet << "/" << zside << "/" << depth << "/"
155  << etaR << "/" << iphi << " Cell Flag " << tmp.ok
156  << " " << tmp.eta << " " << tmp.deta << " phi "
157  << tmp.phi << " " << tmp.dphi << " r(z) " << tmp.rz
158  << " " << tmp.drz << " " << tmp.flagrz;
159 #endif
160  return tmp;
161 }
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
const HcalParameters * hpar
std::vector< int > etaMin
double HcalDDDSimConstants::deltaEta ( int  det,
int  eta,
int  depth 
) const
private

Definition at line 591 of file HcalDDDSimConstants.cc.

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

Referenced by cell().

591  {
592 
593  double tmp = 0;
594  if (det == static_cast<int>(HcalForward)) {
595  int ir = nR + hpar->etaMin[2] - etaR - 1;
596  if (ir > 0 && ir < nR) {
597  double z = zVcal;
598  if (depth%2 != 1) z += dlShort;
599  tmp = 0.5*(getEta(hpar->rTable[ir-1],z)-getEta(hpar->rTable[ir],z));
600  }
601  } else {
602  if (etaR > 0 && etaR < nEta) {
603  if (etaR == hpar->noff[1]-1 && depth > 2) {
604  tmp = 0.5*(hpar->etaTable[etaR+1]-hpar->etaTable[etaR-1]);
605  } else if (det == static_cast<int>(HcalOuter)) {
606  if (etaR == hpar->noff[2]) {
607  tmp = 0.5*(etaHO[0]-hpar->etaTable[etaR-1]);
608  } else if (etaR == hpar->noff[2]+1) {
609  tmp = 0.5*(hpar->etaTable[etaR]-etaHO[1]);
610  } else if (etaR == hpar->noff[3]) {
611  tmp = 0.5*(etaHO[2]-hpar->etaTable[etaR-1]);
612  } else if (etaR == hpar->noff[3]+1) {
613  tmp = 0.5*(hpar->etaTable[etaR]-etaHO[3]);
614  } else {
615  tmp = 0.5*(hpar->etaTable[etaR]-hpar->etaTable[etaR-1]);
616  }
617  } else {
618  tmp = 0.5*(hpar->etaTable[etaR]-hpar->etaTable[etaR-1]);
619  }
620  }
621  }
622 #ifdef DebugLog
623  edm::LogInfo("HCalGeom") << "HcalDDDSimConstants::deltaEta " << etaR << " "
624  << depth << " ==> " << tmp;
625 #endif
626  return tmp;
627 }
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
const HcalParameters * hpar
std::vector< int > etaMin
unsigned int HcalDDDSimConstants::findLayer ( int  layer,
const std::vector< HcalParameters::LayerItem > &  layerGroup 
) const

Definition at line 282 of file HcalDDDSimConstants.cc.

References i.

282  {
283 
284  unsigned int id = layerGroup.size();
285  for (unsigned int i = 0; i < layerGroup.size(); i++) {
286  if (layer == (int)(layerGroup[i].layer)) {
287  id = i;
288  break;
289  }
290  }
291  return id;
292 }
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 163 of file HcalDDDSimConstants.cc.

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

163  {
164 
165  std::vector<std::pair<double,double> > gcons;
166  if (type == 0) {
167  for (unsigned int i=0; i<hpar->rHB.size(); ++i) {
168  gcons.push_back(std::pair<double,double>(hpar->rHB[i],hpar->drHB[i]));
169  }
170  } else {
171  for (unsigned int i=0; i<hpar->zHE.size(); ++i) {
172  gcons.push_back(std::pair<double,double>(hpar->zHE[i],hpar->dzHE[i]));
173  }
174  }
175  return gcons;
176 }
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
std::pair< int, double > HcalDDDSimConstants::getDetEta ( double  eta,
int  depth 
)

Definition at line 179 of file HcalDDDSimConstants.cc.

References eta, HcalParameters::etaMax, HLT_25ns14e33_v1_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().

179  {
180 
181  int hsubdet(0), ieta(0);
182  double etaR(0);
183  double heta = fabs(eta);
184  for (int i = 0; i < nEta; i++)
185  if (heta > hpar->etaTable[i]) ieta = i + 1;
186  if (heta <= hpar->etaRange[1]) {
187  if ((ieta <= hpar->etaMin[1] && depth==3) || ieta > hpar->etaMax[0]) {
188  hsubdet = static_cast<int>(HcalEndcap);
189  } else {
190  hsubdet = static_cast<int>(HcalBarrel);
191  }
192  etaR = eta;
193  } else {
194  hsubdet = static_cast<int>(HcalForward);
195  double theta = 2.*atan(exp(-heta));
196  double hR = zVcal*tan(theta);
197  etaR = (eta >= 0. ? hR : -hR);
198  }
199  return std::pair<int,double>(hsubdet,etaR);
200 }
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 202 of file HcalDDDSimConstants.cc.

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

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

202  {
203 
204  int ieta(0);
205  if (det == static_cast<int>(HcalForward)) { // Forward HCal
206  ieta = hpar->etaMax[2];
207  for (int i = nR-1; i > 0; i--)
208  if (hetaR < hpar->rTable[i]) ieta = hpar->etaMin[2] + nR - i - 1;
209  } else { // Barrel or Endcap
210  ieta = 1;
211  for (int i = 0; i < nEta-1; i++)
212  if (hetaR > hpar->etaTable[i]) ieta = i + 1;
213  if (det == static_cast<int>(HcalBarrel)) {
214  if (ieta > hpar->etaMax[0]) ieta = hpar->etaMax[0];
215  if (lay == 18) {
216  if (hetaR > etaHO[1] && ieta == hpar->noff[2]) ieta++;
217  }
218  } else {
219  if (ieta <= hpar->etaMin[1]) ieta = hpar->etaMin[1];
220  }
221  }
222  return ieta;
223 }
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 629 of file HcalDDDSimConstants.cc.

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

630  {
631 
632  double tmp = 0;
633  if (det == static_cast<int>(HcalForward)) {
634  int ir = nR + hpar->etaMin[2] - etaR - 1;
635  if (ir > 0 && ir < nR) {
636  double z = zVcal;
637  if (depth%2 != 1) z += dlShort;
638  tmp = 0.5*(getEta(hpar->rTable[ir-1],z)+getEta(hpar->rTable[ir],z));
639  }
640  } else {
641  if (etaR > 0 && etaR < nEta) {
642  if (etaR == hpar->noff[1]-1 && depth > 2) {
643  tmp = 0.5*(hpar->etaTable[etaR+1]+hpar->etaTable[etaR-1]);
644  } else if (det == static_cast<int>(HcalOuter)) {
645  if (etaR == hpar->noff[2]) {
646  tmp = 0.5*(etaHO[0]+hpar->etaTable[etaR-1]);
647  } else if (etaR == hpar->noff[2]+1) {
648  tmp = 0.5*(hpar->etaTable[etaR]+etaHO[1]);
649  } else if (etaR == hpar->noff[3]) {
650  tmp = 0.5*(etaHO[2]+hpar->etaTable[etaR-1]);
651  } else if (etaR == hpar->noff[3]+1) {
652  tmp = 0.5*(hpar->etaTable[etaR]+etaHO[3]);
653  } else {
654  tmp = 0.5*(hpar->etaTable[etaR]+hpar->etaTable[etaR-1]);
655  }
656  } else {
657  tmp = 0.5*(hpar->etaTable[etaR]+hpar->etaTable[etaR-1]);
658  }
659  }
660  }
661  if (zside == 0) tmp = -tmp;
662 #ifdef DebugLog
663  edm::LogInfo("HCalGeom") << "HcalDDDSimConstants::getEta " << etaR << " "
664  << zside << " " << depth << " ==> " << tmp;
665 #endif
666  return tmp;
667 }
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
const HcalParameters * hpar
std::vector< int > etaMin
double HcalDDDSimConstants::getEta ( double  r,
double  z 
) const
private

Definition at line 669 of file HcalDDDSimConstants.cc.

References create_public_lumi_plots::log, funct::tan(), and tmp.

669  {
670 
671  double tmp = 0;
672  if (z != 0) tmp = -log(tan(0.5*atan(r/z)));
673 #ifdef DebugLog
674  edm::LogInfo("HCalGeom") << "HcalDDDSimConstants::getEta " << r << " " << z
675  << " ==> " << tmp;
676 #endif
677  return tmp;
678 }
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
std::pair< int, int > HcalDDDSimConstants::getEtaDepth ( int  det,
int  etaR,
int  phi,
int  depth,
int  lay 
)

Definition at line 225 of file HcalDDDSimConstants.cc.

References HLT_25ns14e33_v1_cff::depth, HcalParameters::etaMin, HcalBarrel, HcalForward, HcalOuter, hpar, layerGroup(), HcalParameters::noff, HcalParameters::phibin, and HcalParameters::phioff.

Referenced by HcalNumberingFromDDD::unitID().

226  {
227 
228  //Modify the depth index
229  if (det == static_cast<int>(HcalForward)) { // Forward HCal
230  } else if (det == static_cast<int>(HcalOuter)) {
231  depth = 4;
232  } else {
233  if (lay >= 0) {
234  depth= layerGroup( etaR-1, lay-1 );
235  if (etaR == hpar->noff[0] && lay > 1) {
236  int kphi = phi + int((hpar->phioff[3]+0.1)/hpar->phibin[etaR-1]);
237  kphi = (kphi-1)%4 + 1;
238  if (kphi == 2 || kphi == 3) depth = layerGroup( etaR-1, lay-2 );
239  }
240  } else if (det == static_cast<int>(HcalBarrel)) {
241  if (depth==3) depth = 2;
242  }
243  if (etaR == hpar->noff[1] && depth > 2) {
244  etaR = hpar->noff[1]-1;
245  } else if (etaR == hpar->etaMin[1]) {
246  if (det == static_cast<int>(HcalBarrel)) {
247  if (depth > 2) depth = 2;
248  } else {
249  if (depth < 3) depth = 3;
250  }
251  }
252  }
253  return std::pair<int,int>(etaR,depth);
254 }
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 256 of file HcalDDDSimConstants.cc.

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

Referenced by HcalNumberingFromDDD::unitID().

257  {
258 
259  if (hpar->zHO.size() > 4) {
260  double eta = fabs(etaR);
261  double r = std::sqrt(x*x+y*y);
262  if (r > rminHO) {
263  double zz = fabs(z);
264  if (zz > hpar->zHO[3]) {
265  if (eta <= hpar->etaTable[10]) eta = hpar->etaTable[10]+0.001;
266  } else if (zz > hpar->zHO[1]) {
267  if (eta <= hpar->etaTable[4]) eta = hpar->etaTable[4]+0.001;
268  }
269  }
270  eta = (z >= 0. ? eta : -eta);
271 #ifdef DebugLog
272  edm::LogInfo ("HCalGeom") << "R " << r << " Z " << z << " eta " << etaR
273  << ":" << eta;
274  if (eta != etaR) edm::LogInfo ("HCalGeom") << "**** Check *****";
275 #endif
276  return eta;
277  } else {
278  return etaR;
279  }
280 }
std::vector< double > zHO
std::vector< double > etaTable
T sqrt(T t)
Definition: SSEVec.h:48
const HcalParameters * hpar
const std::vector<double>& HcalDDDSimConstants::getEtaTableHF ( ) const
inline

Definition at line 39 of file HcalDDDSimConstants.h.

References HcalParameters::etaTableHF, and hpar.

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

Definition at line 700 of file HcalDDDSimConstants.cc.

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

Referenced by HcalCellTypes().

700  {
701 
702  double gain;
703  switch(subdet) {
704  case HcalEndcap:
705  gain = hpar->HEGains[0];
706  break;
707  case HcalForward:
708  gain = hpar->HFGains[depth-1];
709  break;
710  case HcalOuter:
711  gain = hpar->HBGains[3];
712  break;
713  default:
714  gain = hpar->HBGains[0];
715  break;
716  }
717  return gain;
718 }
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 41 of file HcalDDDSimConstants.h.

References HcalParameters::gparHF, and hpar.

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

41 {return hpar->gparHF;}
std::vector< double > gparHF
const HcalParameters * hpar
std::pair<int,int> HcalDDDSimConstants::getiEtaRange ( const int  i) const
inline

Definition at line 38 of file HcalDDDSimConstants.h.

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

38 {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 42 of file HcalDDDSimConstants.h.

References hpar, and HcalParameters::Layer0Wt.

Referenced by HCalSD::update().

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

Definition at line 50 of file HcalDDDSimConstants.h.

References maxDepth.

Referenced by HCalSD::update().

50 {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 294 of file HcalDDDSimConstants.cc.

References nmodHB, nmodHE, nzHB, and nzHE.

294  {
295 
296  if (type == 0) {
297  return std::pair<int,int>(nmodHB,nzHB);
298  } else {
299  return std::pair<int,int>(nmodHE,nzHE);
300  }
301 }
type
Definition: HCALResponse.h:21
std::pair< double, double > HcalDDDSimConstants::getPhiCons ( int  det,
int  ieta 
)

Definition at line 303 of file HcalDDDSimConstants.cc.

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

Referenced by HcalNumberingFromDDD::unitID().

303  {
304 
305  double fioff(0), fibin(0);
306  if (det == static_cast<int>(HcalForward)) { // Forward HCal
307  fioff = hpar->phioff[2];
308  fibin = hpar->phitable[ieta-hpar->etaMin[2]];
309  if (unitPhi(fibin) > 2) { // HF double-phi
310  fioff = hpar->phioff[4];
311  }
312  } else { // Barrel or Endcap
313  if (det == static_cast<int>(HcalBarrel)) {
314  fioff = hpar->phioff[0];
315  } else {
316  fioff = hpar->phioff[1];
317  }
318  fibin = hpar->phibin[ieta-1];
319  }
320  return std::pair<double,double>(fioff,fibin);
321 }
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 45 of file HcalDDDSimConstants.h.

References hpar, and HcalParameters::phitable.

Referenced by HFShowerLibrary::initRun().

45 {return hpar->phitable;}
std::vector< double > phitable
const HcalParameters * hpar
const std::vector<double>& HcalDDDSimConstants::getRTableHF ( ) const
inline

Definition at line 46 of file HcalDDDSimConstants.h.

References hpar, and HcalParameters::rTable.

Referenced by HFFibre::initRun(), HFShowerPMT::initRun(), HFShowerFibreBundle::initRun(), and HFShowerLibrary::initRun().

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

Definition at line 680 of file HcalDDDSimConstants.cc.

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

Referenced by HcalCellTypes().

680  {
681 
682  int shift;
683  switch(subdet) {
684  case HcalEndcap:
685  shift = hpar->HEShift[0];
686  break;
687  case HcalForward:
688  shift = hpar->HFShift[depth-1];
689  break;
690  case HcalOuter:
691  shift = hpar->HBShift[3];
692  break;
693  default:
694  shift = hpar->HBShift[0];
695  break;
696  }
697  return shift;
698 }
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 323 of file HcalDDDSimConstants.cc.

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

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

323  {
324 
325  std::vector<HcalCellType> cellTypes =HcalCellTypes(HcalBarrel);
326 #ifdef DebugLog
327  edm::LogInfo ("HCalGeom") << "HcalDDDSimConstants: " << cellTypes.size()
328  << " cells of type HCal Barrel";
329  for (unsigned int i=0; i<cellTypes.size(); i++)
330  edm::LogInfo ("HCalGeom") << "Cell " << i << " " << cellTypes[i];
331 #endif
332 
333  std::vector<HcalCellType> hoCells =HcalCellTypes(HcalOuter);
334 #ifdef DebugLog
335  edm::LogInfo ("HCalGeom") << "HcalDDDSimConstants: " << hoCells.size()
336  << " cells of type HCal Outer";
337  for (unsigned int i=0; i<hoCells.size(); i++)
338  edm::LogInfo ("HCalGeom") << "Cell " << i << " " << hoCells[i];
339 #endif
340  cellTypes.insert(cellTypes.end(), hoCells.begin(), hoCells.end());
341 
342  std::vector<HcalCellType> heCells =HcalCellTypes(HcalEndcap);
343 #ifdef DebugLog
344  edm::LogInfo ("HCalGeom") << "HcalDDDSimConstants: " << heCells.size()
345  << " cells of type HCal Endcap";
346  for (unsigned int i=0; i<heCells.size(); i++)
347  edm::LogInfo ("HCalGeom") << "Cell " << i << " " << heCells[i];
348 #endif
349  cellTypes.insert(cellTypes.end(), heCells.begin(), heCells.end());
350 
351  std::vector<HcalCellType> hfCells =HcalCellTypes(HcalForward);
352 #ifdef DebugLog
353  edm::LogInfo ("HCalGeom") << "HcalDDDSimConstants: " << hfCells.size()
354  << " cells of type HCal Forward";
355  for (unsigned int i=0; i<hfCells.size(); i++)
356  edm::LogInfo ("HCalGeom") << "Cell " << i << " " << hfCells[i];
357 #endif
358  cellTypes.insert(cellTypes.end(), hfCells.begin(), hfCells.end());
359 
360  return cellTypes;
361 }
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 363 of file HcalDDDSimConstants.cc.

References cell(), HLT_25ns14e33_v1_cff::depth, dlShort, dzVcal, eta, HcalParameters::etaMax, HcalParameters::etaMin, getGain(), getShift(), HcalEndcap, HcalForward, HcalOuter, hpar, GetRecoTauVFromDQM_MC_cff::kk, nmodHB, nmodHE, HcalParameters::noff, nzHB, nzHE, HcalCellType::HcalCell::ok, phi, HcalCellType::setMissingPhi(), edm::shift, unitPhi(), units(), and ecaldqm::zside().

364  {
365 
366  std::vector<HcalCellType> cellTypes;
367  if (subdet == HcalForward) {
368  if (dzVcal < 0) return cellTypes;
369  }
370 
371  int dmin, dmax, indx, nz, nmod;
372  double hsize = 0;
373  switch(subdet) {
374  case HcalEndcap:
375  dmin = 1; dmax = 19; indx = 1; nz = nzHE; nmod = nmodHE;
376  break;
377  case HcalForward:
378  dmin = 1; dmax = 2; indx = 2; nz = 2; nmod = 18;
379  break;
380  case HcalOuter:
381  dmin = 4; dmax = 4; indx = 0; nz = nzHB; nmod = nmodHB;
382  break;
383  default:
384  dmin = 1; dmax = 17; indx = 0; nz = nzHB; nmod = nmodHB;
385  break;
386  }
387  if (depthl > 0) dmin = dmax = depthl;
388  int ietamin = (ieta>0) ? ieta : hpar->etaMin[indx];
389  int ietamax = (ieta>0) ? ieta : hpar->etaMax[indx];
390 
391  int phi = 1, zside = 1;
392 
393  // Get the Cells
394  int subdet0 = static_cast<int>(subdet);
395  for (int depth=dmin; depth<=dmax; depth++) {
396  int shift = getShift(subdet, depth);
397  double gain = getGain (subdet, depth);
398  if (subdet == HcalForward) {
399  if (depth%2 == 1) hsize = dzVcal;
400  else hsize = dzVcal-0.5*dlShort;
401  }
402  for (int eta=ietamin; eta<= ietamax; eta++) {
403  HcalCellType::HcalCell temp1 = cell(subdet0,zside,depth,eta,phi);
404  if (temp1.ok) {
405  int units = unitPhi (subdet0, eta);
406  HcalCellType temp2(subdet, eta, phi, depth, temp1,
407  shift, gain, nz, nmod, hsize, units);
408  if (subdet == HcalOuter) {
409  if (eta == hpar->noff[4]) {
410  std::vector<int> missPlus, missMinus;
411  int kk = 7;
412  for (int miss=0; miss<hpar->noff[5]; miss++) {
413  missPlus.push_back(hpar->noff[kk]);
414  kk++;
415  }
416  for (int miss=0; miss<hpar->noff[6]; miss++) {
417  missMinus.push_back(hpar->noff[kk]);
418  kk++;
419  }
420  temp2.setMissingPhi(missPlus, missMinus);
421  }
422  }
423  cellTypes.push_back(temp2);
424  }
425  }
426  }
427  return cellTypes;
428 }
int unitPhi(int det, int etaR) const
int zside(DetId const &)
std::vector< int > etaMax
int getShift(HcalSubdetector subdet, int depth) const
double getGain(HcalSubdetector subdet, int depth) const
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 495 of file HcalDDDSimConstants.cc.

References gather_cfg::cout, depths, dlShort, HcalParameters::dzVcal, dzVcal, etaHO, HcalParameters::etaMax, HLT_25ns14e33_v1_cff::etaMax, HcalParameters::etaMin, HcalParameters::etaTable, HcalParameters::gparHF, hpar, i, relval_steps::k, prof2calltree::l, layerGroup(), layerGroupSize(), HcalParameters::maxDepth, maxDepth, HcalParameters::modHB, HcalParameters::modHE, nEta, nmodHB, nmodHE, nPhiF, nR, nzHB, nzHE, HcalParameters::rHB, HcalParameters::rHO, rminHO, HcalParameters::rTable, HcalParameters::zHO, and zVcal.

Referenced by HcalDDDSimConstants().

495  {
496 
497  nEta = hpar->etaTable.size();
498  nR = hpar->rTable.size();
499  nPhiF = nR - 1;
500 
501 #ifdef DebugLog
502  for (int i=0; i<nEta-1; ++i) {
503  std::cout << "HcalDDDSimConstants:Read LayerGroup" << i << ":";
504  for (unsigned int k=0; k<layerGroupSize( i ); k++)
505  std::cout << " [" << k << "] = " << layerGroup( i, k );
506  std::cout << std::endl;
507  }
508 #endif
509 
510  // Geometry parameters for HF
511  dlShort = hpar->gparHF[0];
512  zVcal = hpar->gparHF[4];
513  dzVcal = hpar->dzVcal;
514 #ifdef DebugLog
515  std::cout << "HcalDDDSimConstants: dlShort " << dlShort << " zVcal " << zVcal
516  << " and dzVcal " << dzVcal << std::endl;
517 #endif
518 
519  //Transform some of the parameters
521  maxDepth[0] = maxDepth[1] = 0;
522  for (int i=0; i<nEta-1; ++i) {
523  unsigned int imx = layerGroupSize( i );
524  int laymax = (imx > 0) ? layerGroup( i, imx-1 ) : 0;
525  if (i < hpar->etaMax[0]) {
526  int laymax0 = (imx > 16) ? layerGroup( i, 16 ) : laymax;
527  if (i+1 == hpar->etaMax[0] && laymax0 > 2) laymax0 = 2;
528  if (maxDepth[0] < laymax0) maxDepth[0] = laymax0;
529  }
530  if (i >= hpar->etaMin[1]-1 && i < hpar->etaMax[1]) {
531  if (maxDepth[1] < laymax) maxDepth[1] = laymax;
532  }
533  }
534 #ifdef DebugLog
535  for (int i=0; i<4; ++i)
536  std::cout << "Detector Type [" << i << "] iEta " << hpar->etaMin[i] << ":"
537  << hpar->etaMax[i] << " MaxDepth " << maxDepth[i] << std::endl;
538 #endif
539 
540  int maxdepth = (maxDepth[1]>maxDepth[0]) ? maxDepth[1] : maxDepth[0];
541  for (int i=0; i<maxdepth; ++i) {
542  for (int k=0; k<nEta-1; ++k) {
543  int layermx = ((k+1 < hpar->etaMin[1]) && i < maxDepth[0]) ? 17 : (int)layerGroupSize( k );
544  int ll = layermx;
545  for (int l=layermx-1; l >= 0; --l) {
546  if ((int)layerGroup( k, l ) == i+1) {
547  ll = l+1; break;
548  }
549  }
550  depths[i].push_back(ll);
551  }
552 
553 #ifdef DebugLog
554  std::cout << "Depth " << i << " with " << depths[i].size() << " etas:";
555  for (int k=0; k<nEta-1; ++k) std::cout << " " << depths[i][k];
556  std::cout << std::endl;
557 #endif
558  }
559 
560  nzHB = hpar->modHB[0];
561  nmodHB = hpar->modHB[1];
562  nzHE = hpar->modHE[0];
563  nmodHE = hpar->modHE[1];
564 #ifdef DebugLog
565  std::cout << "HcalDDDSimConstants:: " << nzHB << ":" << nmodHB
566  << " barrel and " << nzHE << ":" << nmodHE
567  << " endcap half-sectors" << std::endl;
568 #endif
569 
570  if (hpar->rHB.size() > 17 && hpar->zHO.size() > 4) {
571  rminHO = hpar->rHO[0];
572  for (int k=0; k<4; ++k) etaHO[k] = hpar->rHO[k+1];
573  } else {
574  rminHO =-1.0;
575  etaHO[0] = hpar->etaTable[4];
576  etaHO[1] = hpar->etaTable[4];
577  etaHO[2] = hpar->etaTable[10];
578  etaHO[3] = hpar->etaTable[10];
579  }
580 #ifdef DebugLog
581  std::cout << "HO Eta boundaries " << etaHO[0] << " " << etaHO[1]
582  << " " << etaHO[2] << " " << etaHO[3] << std::endl;
583  std::cout << "HO Parameters " << rminHO << " " << hpar->zHO.size();
584  for (int i=0; i<4; ++i) std::cout << " eta[" << i << "] = " << etaHO[i];
585  for (unsigned int i=0; i<hpar->zHO.size(); ++i)
586  std::cout << " zHO[" << i << "] = " << hpar->zHO[i];
587  std::cout << std::endl;
588 #endif
589 }
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< double > gparHF
std::vector< double > rTable
tuple cout
Definition: gather_cfg.py:121
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
unsigned int HcalDDDSimConstants::layerGroup ( unsigned int  eta,
unsigned int  i 
) const
private

Definition at line 29 of file HcalDDDSimConstants.cc.

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

Referenced by getEtaDepth(), and initialize().

30 {
31  unsigned int k = 0;
32  for( auto const & it : hpar->layerGroupEtaSim )
33  {
34  if( it.layer == eta + 1 )
35  {
36  return it.layerGroup.at( i );
37  }
38  if( it.layer > eta + 1 )
39  break;
40 
41  k = it.layerGroup.at( i );
42  }
43  return k;
44 }
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 12 of file HcalDDDSimConstants.cc.

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

Referenced by initialize().

13 {
14  unsigned int k = 0;
15  for( auto const & it : hpar->layerGroupEtaSim )
16  {
17  if( it.layer == eta + 1 )
18  {
19  return it.layerGroup.size();
20  }
21  if( it.layer > eta + 1 )
22  break;
23  k = it.layerGroup.size();
24  }
25  return k;
26 }
std::vector< LayerItem > layerGroupEtaSim
const HcalParameters * hpar
unsigned int HcalDDDSimConstants::numberOfCells ( HcalSubdetector  subdet) const

Definition at line 430 of file HcalDDDSimConstants.cc.

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

Referenced by HcalDDDRecConstants::numberOfCells().

430  {
431 
432  unsigned int num = 0;
433  std::vector<HcalCellType> cellTypes = HcalCellTypes(subdet);
434  for (unsigned int i=0; i<cellTypes.size(); i++) {
435  num += (unsigned int)(cellTypes[i].nPhiBins());
436  if (cellTypes[i].nHalves() > 1)
437  num += (unsigned int)(cellTypes[i].nPhiBins());
438  num -= (unsigned int)(cellTypes[i].nPhiMissingBins());
439  }
440 #ifdef DebugLog
441  edm::LogInfo ("HCalGeom") << "HcalDDDSimConstants:numberOfCells "
442  << cellTypes.size() << " " << num
443  << " for subdetector " << subdet;
444 #endif
445  return num;
446 }
int i
Definition: DBlmapReader.cc:9
std::vector< HcalCellType > HcalCellTypes() const
int HcalDDDSimConstants::phiNumber ( int  phi,
int  unit 
) const

Definition at line 448 of file HcalDDDSimConstants.cc.

References phi.

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

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

Definition at line 720 of file HcalDDDSimConstants.cc.

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

Referenced by printTiles().

720  {
721  std::cout << "HcalDDDSimConstants::printTileHB for eta " << eta << " and depth " << depth << "\n";
722 
723  double etaL = hpar->etaTable.at(eta-1);
724  double thetaL = 2.*atan(exp(-etaL));
725  double etaH = hpar->etaTable.at(eta);
726  double thetaH = 2.*atan(exp(-etaH));
727  int layL=0, layH=0;
728  if (depth == 1) {
729  layH = depths[0][eta-1];
730  } else {
731  layL = depths[0][eta-1];
732  layH = depths[1][eta-1];
733  }
734  std::cout << "\ntileHB:: eta|depth " << eta << "|" << depth << " theta " << thetaH/CLHEP::deg << ":" << thetaL/CLHEP::deg << " Layer " << layL << ":" << layH-1 << "\n";
735  for (int lay=layL; lay<layH; ++lay) {
736  std::vector<double> area(2,0);
737  int kk=0;
738  for (unsigned int k=0; k<hpar->layHB.size(); ++k) {
739  if (lay == hpar->layHB[k]) {
740  double zmin = hpar->rhoxHB[k]*std::cos(thetaL)/std::sin(thetaL);
741  double zmax = hpar->rhoxHB[k]*std::cos(thetaH)/std::sin(thetaH);
742  double dz = (std::min(zmax,hpar->dxHB[k]) - zmin);
743  if (dz > 0) {
744  area[kk] = dz*hpar->dyHB[k];
745  kk++;
746  }
747  }
748  }
749  if (area[0] > 0) std::cout << std::setw(2) << lay << " Area " << std::setw(8) << area[0] << " " << std::setw(8) << area[1] << "\n";
750  }
751 }
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:121
const HcalParameters * hpar
std::vector< int > layHB
void HcalDDDSimConstants::printTileHE ( int  eta,
int  depth 
) const
private

Definition at line 753 of file HcalDDDSimConstants.cc.

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

Referenced by printTiles().

753  {
754 
755  double etaL = hpar->etaTable[eta-1];
756  double thetaL = 2.*atan(exp(-etaL));
757  double etaH = hpar->etaTable[eta];
758  double thetaH = 2.*atan(exp(-etaH));
759  int layL=0, layH=0;
760  if (eta == 16) {
761  layH = depths[2][eta-1];
762  } else if (depth == 1) {
763  layH = depths[0][eta-1];
764  } else if (depth == 2) {
765  layL = depths[0][eta-1];
766  layH = depths[1][eta-1];
767  } else {
768  layL = depths[1][eta-1];
769  layH = depths[2][eta-1];
770  }
771  double phib = hpar->phibin[eta-1];
772  int nphi = 2;
773  if (phib > 6*CLHEP::deg) nphi = 1;
774  std::cout << "\ntileHE:: Eta/depth " << eta << "|" << depth << " theta " << thetaH/CLHEP::deg << ":" << thetaL/CLHEP::deg << " Layer " << layL << ":" << layH-1 << " phi " << nphi << "\n";
775  for (int lay=layL; lay<layH; ++lay) {
776  std::vector<double> area(4,0);
777  int kk=0;
778  for (unsigned int k=0; k<hpar->layHE.size(); ++k) {
779  if (lay == hpar->layHE[k]) {
780  double rmin = hpar->zxHE[k]*std::tan(thetaH);
781  double rmax = hpar->zxHE[k]*std::tan(thetaL);
782  if ((lay != 0 || eta == 18) &&
783  (lay != 1 || (eta == 18 && hpar->rhoxHE[k]-hpar->dyHE[k] > 1000) ||
784  (eta != 18 && hpar->rhoxHE[k]-hpar->dyHE[k] < 1000)) &&
785  rmin+30 < hpar->rhoxHE[k]+hpar->dyHE[k] &&
786  rmax > hpar->rhoxHE[k]-hpar->dyHE[k]) {
787  rmin = std::max(rmin,hpar->rhoxHE[k]-hpar->dyHE[k]);
788  rmax = std::min(rmax,hpar->rhoxHE[k]+hpar->dyHE[k]);
789  double dx1 = rmin*std::tan(phib);
790  double dx2 = rmax*std::tan(phib);
791  double ar1=0, ar2=0;
792  if (nphi == 1) {
793  ar1 = 0.5*(rmax-rmin)*(dx1+dx2-4.*hpar->dx1HE[k]);
794  } else {
795  ar1 = 0.5*(rmax-rmin)*(dx1+dx2-2.*hpar->dx1HE[k]);
796  ar2 = 0.5*(rmax-rmin)*((rmax+rmin)*tan(10.*CLHEP::deg)-4*hpar->dx1HE[k])-ar1;
797  }
798  area[kk] = ar1;
799  area[kk+2] = ar2;
800  kk++;
801  }
802  }
803  }
804  if (area[0] > 0 && area[1] > 0) {
805  int lay0 = lay-1;
806  if (eta == 18) lay0++;
807  if (nphi == 1) {
808  std::cout << std::setw(2) << lay0 << " Area " << std::setw(8) << area[0] << " " << std::setw(8) << area[1] << "\n";
809  } else {
810  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";
811  }
812  }
813  }
814 }
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:121
const HcalParameters * hpar
void HcalDDDSimConstants::printTiles ( ) const

Definition at line 457 of file HcalDDDSimConstants.cc.

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

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

Definition at line 482 of file HcalDDDSimConstants.cc.

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

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

482  {
483 
484  double dphi = (det == static_cast<int>(HcalForward)) ? hpar->phitable[etaR-hpar->etaMin[2]] : hpar->phibin[etaR-1];
485  return unitPhi(dphi);
486 }
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 488 of file HcalDDDSimConstants.cc.

References M_PI, and units().

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

Member Data Documentation

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

Definition at line 76 of file HcalDDDSimConstants.h.

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

double HcalDDDSimConstants::dlShort
private

Definition at line 83 of file HcalDDDSimConstants.h.

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

double HcalDDDSimConstants::dzVcal
private

Definition at line 82 of file HcalDDDSimConstants.h.

Referenced by HcalCellTypes(), and initialize().

double HcalDDDSimConstants::etaHO[4]
private

Definition at line 80 of file HcalDDDSimConstants.h.

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

const HcalParameters* HcalDDDSimConstants::hpar
private
std::vector<int> HcalDDDSimConstants::maxDepth
private

Definition at line 72 of file HcalDDDSimConstants.h.

Referenced by cell(), getMaxDepth(), and initialize().

int HcalDDDSimConstants::nDepth
private

Definition at line 77 of file HcalDDDSimConstants.h.

const int HcalDDDSimConstants::nDepthMax =9
staticprivate

Definition at line 71 of file HcalDDDSimConstants.h.

int HcalDDDSimConstants::nEta
private

Definition at line 73 of file HcalDDDSimConstants.h.

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

int HcalDDDSimConstants::nmodHB
private

Definition at line 78 of file HcalDDDSimConstants.h.

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

int HcalDDDSimConstants::nmodHE
private

Definition at line 79 of file HcalDDDSimConstants.h.

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

int HcalDDDSimConstants::nPhiF
private

Definition at line 75 of file HcalDDDSimConstants.h.

Referenced by initialize().

int HcalDDDSimConstants::nR
private

Definition at line 74 of file HcalDDDSimConstants.h.

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

int HcalDDDSimConstants::nzHB
private

Definition at line 78 of file HcalDDDSimConstants.h.

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

int HcalDDDSimConstants::nzHE
private

Definition at line 79 of file HcalDDDSimConstants.h.

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

double HcalDDDSimConstants::rminHO
private

Definition at line 80 of file HcalDDDSimConstants.h.

Referenced by getEtaHO(), and initialize().

double HcalDDDSimConstants::zVcal
private

Definition at line 81 of file HcalDDDSimConstants.h.

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