CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Member Functions | Private Member Functions | Private Attributes
HcalDDDRecConstants Class Reference

#include <HcalDDDRecConstants.h>

Classes

struct  HcalActiveLength
 
struct  HcalEtaBin
 
struct  HcalID
 

Public Member Functions

std::vector< std::pair< double,
double > > 
getConstHBHE (const int type) const
 
const std::vector< int > & getDepth (const unsigned int i) const
 
std::vector< HcalEtaBingetEtaBins (const int itype) const
 
std::pair< double, double > getEtaLimit (const int i) const
 
std::pair< double, double > getEtaPhi (int subdet, int ieta, int iphi) const
 
std::pair< int, int > getEtaRange (const int i) const
 
const std::vector< double > & getEtaTable () const
 
const std::vector< double > & getEtaTableHF () const
 
HcalID getHCID (int subdet, int ieta, int iphi, int lay, int idepth) const
 
int getMaxDepth (const int type) const
 
int getNEta () const
 
double getPhiBin (const int i) const
 
double getPhiOff (const int i) const
 
const std::vector< double > & getPhiOffs () const
 
const std::vector< double > & getPhiTable () const
 
const std::vector< double > & getPhiTableHF () const
 
double getRZ (int subdet, int ieta, int depth) const
 
std::vector< HcalActiveLengthgetThickActive (const int type) const
 
int getTopoMode () const
 
std::vector< HcalCellTypeHcalCellTypes (HcalSubdetector) const
 
 HcalDDDRecConstants (const HcalParameters *hp, const HcalDDDSimConstants &hc)
 
unsigned int nCells (HcalSubdetector) const
 
unsigned int nCells () const
 
unsigned int numberOfCells (HcalSubdetector) const
 
 ~HcalDDDRecConstants ()
 

Private Member Functions

void initialize (void)
 
unsigned int layerGroup (unsigned int eta, unsigned int i) const
 
unsigned int layerGroupSize (unsigned int eta) const
 

Private Attributes

std::vector< std::pair< int,
int > > 
etaSimValu
 
std::vector< double > etaTable
 
std::vector< std::pair< double,
double > > 
gconsHB
 
std::vector< std::pair< double,
double > > 
gconsHE
 
const HcalDDDSimConstantshcons
 
const HcalParametershpar
 
std::vector< int > ietaMap
 
std::vector< int > iEtaMax
 
std::vector< int > iEtaMin
 
std::vector< int > maxDepth
 
int nHalves [2]
 
int nModule [2]
 
std::vector< double > phibin
 
std::vector< int > phiUnitS
 

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 HcalDDDRecConstants.h.

Constructor & Destructor Documentation

HcalDDDRecConstants::HcalDDDRecConstants ( const HcalParameters hp,
const HcalDDDSimConstants hc 
)

Definition at line 12 of file HcalDDDRecConstants.cc.

References gather_cfg::cout, and initialize().

13  :
14  hpar(hp), hcons(hc) {
15 
16 #ifdef DebugLog
17  std::cout << "HcalDDDRecConstants::HcalDDDRecConstants (const HcalParameters* hp) constructor" << std::endl;
18 #endif
19  initialize();
20 }
const HcalParameters * hpar
const HcalDDDSimConstants & hcons
tuple cout
Definition: gather_cfg.py:121
HcalDDDRecConstants::~HcalDDDRecConstants ( )

Definition at line 22 of file HcalDDDRecConstants.cc.

References gather_cfg::cout.

22  {
23 #ifdef DebugLog
24  std::cout << "HcalDDDRecConstants::destructed!!!" << std::endl;
25 #endif
26 }
tuple cout
Definition: gather_cfg.py:121

Member Function Documentation

std::vector<std::pair<double,double> > HcalDDDRecConstants::getConstHBHE ( const int  type) const
inline

Definition at line 49 of file HcalDDDRecConstants.h.

References gconsHB, and gconsHE.

Referenced by HcalFlexiHardcodeGeometryLoader::makeHBCells(), and HcalFlexiHardcodeGeometryLoader::makeHECells().

49  {
50  if (type == 0) return gconsHB;
51  else if (type == 1) return gconsHE;
52  else {std::vector<std::pair<double,double> > gcons; return gcons;}
53  }
type
Definition: HCALResponse.h:21
std::vector< std::pair< double, double > > gconsHE
std::vector< std::pair< double, double > > gconsHB
const std::vector< int > & HcalDDDRecConstants::getDepth ( const unsigned int  i) const

Definition at line 500 of file HcalDDDRecConstants.cc.

References hpar, prof2calltree::last, and HcalParameters::layerGroupEtaRec.

Referenced by HcalTopology::HcalTopology().

501 {
502  std::vector<HcalParameters::LayerItem>::const_iterator last = hpar->layerGroupEtaRec.begin();
503  for( std::vector<HcalParameters::LayerItem>::const_iterator it = hpar->layerGroupEtaRec.begin(); it != hpar->layerGroupEtaRec.end(); ++it ) {
504  if( it->layer == i + 1 )
505  return it->layerGroup;
506  if( it->layer > i + 1 )
507  return last->layerGroup;
508  last = it;
509  }
510  return last->layerGroup;
511 }
int i
Definition: DBlmapReader.cc:9
const HcalParameters * hpar
std::vector< LayerItem > layerGroupEtaRec
std::vector< HcalDDDRecConstants::HcalEtaBin > HcalDDDRecConstants::getEtaBins ( const int  itype) const

Definition at line 29 of file HcalDDDRecConstants.cc.

References gather_cfg::cout, HcalDDDRecConstants::HcalEtaBin::depthStart, etaTable, plotBeamSpotDB::first, hpar, i, iEtaMax, iEtaMin, relval_steps::k, prof2calltree::l, HcalDDDRecConstants::HcalEtaBin::layer, layerGroup(), layerGroupSize(), nModule, HcalParameters::noff, phibin, HcalParameters::phioff, and edm::second().

Referenced by getThickActive(), HcalCellTypes(), HcalTopology::HcalTopology(), HcalFlexiHardcodeGeometryLoader::makeHBCells(), HcalFlexiHardcodeGeometryLoader::makeHECells(), and nCells().

29  {
30 
31  std::vector<HcalDDDRecConstants::HcalEtaBin> bins;
32  unsigned int type = (itype == 0) ? 0 : 1;
33  unsigned int lymax = (type == 0) ? 17 : 19;
34  for (int ieta = iEtaMin[type]; ieta <= iEtaMax[type]; ++ieta) {
35  int nfi = (int)((20.001*nModule[itype]*CLHEP::deg)/phibin[ieta-1]);
36  HcalDDDRecConstants::HcalEtaBin etabin = HcalDDDRecConstants::HcalEtaBin(ieta, etaTable[ieta-1], etaTable[ieta], nfi, hpar->phioff[type], phibin[ieta-1]);
37  int dstart = -1;
38  if (layerGroupSize( ieta-1 ) > 0) {
39  int lmin(0), lmax(0);
40  int dep = layerGroup( ieta-1, 0 );
41  if (type == 1 && ieta == iEtaMin[type]) dep = 3;
42  unsigned lymx0 = (layerGroupSize( ieta-1 ) > lymax) ? lymax : layerGroupSize( ieta-1 );
43  for (unsigned int l=0; l<lymx0; ++l) {
44  if ((int)layerGroup( ieta-1, l ) == dep) {
45  if (lmin == 0) lmin = l + 1;
46  lmax = l + 1;
47  } else if ((int)layerGroup( ieta-1, l ) > dep) {
48  if (dstart < 0) dstart = dep;
49  etabin.layer.push_back(std::pair<int,int>(lmin,lmax));
50  lmin = (l + 1);
51  lmax = l;
52  dep = layerGroup( ieta-1, l );
53  }
54  if (type == 0 && ieta == iEtaMax[type] && dep > 2) break;
55  }
56  if (lmax >= lmin) {
57  if (ieta+1 == hpar->noff[1]) {
58  } else if (ieta == hpar->noff[1]) {
59  HcalDDDRecConstants::HcalEtaBin etabin0 = HcalDDDRecConstants::HcalEtaBin(ieta-1, etaTable[ieta-2], etaTable[ieta], nfi, hpar->phioff[type], phibin[ieta-1]);
60  etabin0.depthStart = dep;
61  etabin0.layer.push_back(std::pair<int,int>(lmin,lmax));
62  bins.push_back(etabin0);
63  } else {
64  etabin.layer.push_back(std::pair<int,int>(lmin,lmax));
65  if (dstart < 0) dstart = dep;
66  }
67  }
68  }
69  etabin.depthStart = dstart;
70  bins.push_back(etabin);
71  }
72 #ifdef DebugLog
73  std::cout << "Prepares " << bins.size() << " eta bins for type " << type
74  << std::endl;
75  for (unsigned int i=0; i<bins.size(); ++i) {
76  std::cout << "Bin[" << i << "]: Eta = (" << bins[i].ieta << ":"
77  << bins[i].etaMin << ":" << bins[i].etaMax << ") Phi = ("
78  << bins[i].nPhi << ":" << bins[i].phi0 << ":" << bins[i].dphi
79  << ") and " << bins[i].layer.size() << " depths (start) "
80  << bins[i].depthStart << " :";
81  for (unsigned int k=0; k<bins[i].layer.size(); ++k)
82  std::cout << " [" << k << "] " << bins[i].layer[k].first << ":"
83  << bins[i].layer[k].second;
84  std::cout << std::endl;
85  }
86 #endif
87  return bins;
88 }
type
Definition: HCALResponse.h:21
int i
Definition: DBlmapReader.cc:9
std::vector< int > iEtaMin
U second(std::pair< T, U > const &p)
const HcalParameters * hpar
std::vector< double > phibin
unsigned int layerGroup(unsigned int eta, unsigned int i) const
std::vector< int > iEtaMax
std::vector< std::pair< int, int > > layer
unsigned int layerGroupSize(unsigned int eta) const
std::vector< double > phioff
std::vector< double > etaTable
std::vector< int > noff
tuple cout
Definition: gather_cfg.py:121
std::pair<double,double> HcalDDDRecConstants::getEtaLimit ( const int  i) const
inline

Definition at line 61 of file HcalDDDRecConstants.h.

References etaTable, and i.

62  {return std::pair<double,double>(etaTable[i],etaTable[i+1]);}
int i
Definition: DBlmapReader.cc:9
std::vector< double > etaTable
std::pair< double, double > HcalDDDRecConstants::getEtaPhi ( int  subdet,
int  ieta,
int  iphi 
) const

Definition at line 91 of file HcalDDDRecConstants.cc.

References gather_cfg::cout, eta, etaTable, HcalParameters::etaTableHF, HcalBarrel, HcalEndcap, HcalOuter, hpar, iEtaMax, iEtaMin, M_PI, phi, phibin, HcalParameters::phioff, HcalParameters::phitable, and csvLumiCalc::unit.

91  {
92  int ietaAbs = (ieta > 0) ? ieta : -ieta;
93  const double fiveDegInRad = 2*M_PI/72;
94  double eta(0), phi(0);
95  if ((subdet == static_cast<int>(HcalBarrel)) ||
96  (subdet == static_cast<int>(HcalEndcap)) ||
97  (subdet == static_cast<int>(HcalOuter))) { // Use Eta Table
98  int unit = (int)(phibin[ietaAbs-1]/fiveDegInRad+0.5);
99  int kphi = (unit == 2) ? ((iphi-1)/2 + 1) : iphi;
100  double foff = (ietaAbs <= iEtaMax[0]) ? hpar->phioff[0] : hpar->phioff[1];
101  eta = 0.5*(etaTable[ietaAbs-1]+etaTable[ietaAbs]);
102  phi = foff + (kphi-0.5)*phibin[ietaAbs-1];
103  } else {
104  ietaAbs -= iEtaMin[3];
105  int unit = (int)(hpar->phitable[ietaAbs-1]/fiveDegInRad+0.5);
106  int kphi = (unit == 4) ? ((iphi-3)/4 + 1) : ((iphi-1)/2 + 1);
107  double foff = (unit > 2) ? hpar->phioff[4] : hpar->phioff[2];
108  eta = 0.5*(hpar->etaTableHF[ietaAbs-1]+hpar->etaTableHF[ietaAbs]);
109  phi = foff + (kphi-0.5)*hpar->phitable[ietaAbs-1];
110  }
111  if (ieta < 0) eta = -eta;
112  if (phi > M_PI) phi -= (2*M_PI);
113 #ifdef DebugLog
114  std::cout << "getEtaPhi: subdet|ieta|iphi " << subdet << "|" << ieta << "|"
115  << iphi << " eta|phi " << eta << "|" << phi << std::endl;
116 #endif
117  return std::pair<double,double>(eta,phi);
118 }
std::vector< int > iEtaMin
std::vector< double > etaTableHF
const HcalParameters * hpar
std::vector< double > phibin
string unit
Definition: csvLumiCalc.py:46
std::vector< int > iEtaMax
#define M_PI
std::vector< double > phioff
std::vector< double > etaTable
std::vector< double > phitable
tuple cout
Definition: gather_cfg.py:121
std::pair<int,int> HcalDDDRecConstants::getEtaRange ( const int  i) const
inline

Definition at line 57 of file HcalDDDRecConstants.h.

References i, iEtaMax, and iEtaMin.

Referenced by SimHitsValidationHcal::getLimits(), and HcalTopology::HcalTopology().

58  {return std::pair<int,int>(iEtaMin[i],iEtaMax[i]);}
int i
Definition: DBlmapReader.cc:9
std::vector< int > iEtaMin
std::vector< int > iEtaMax
const std::vector<double>& HcalDDDRecConstants::getEtaTable ( ) const
inline

Definition at line 59 of file HcalDDDRecConstants.h.

References etaTable.

Referenced by HcalTopology::HcalTopology(), and CaloTowerHardcodeGeometryLoader::load().

59 {return etaTable;}
std::vector< double > etaTable
const std::vector<double>& HcalDDDRecConstants::getEtaTableHF ( ) const
inline

Definition at line 60 of file HcalDDDRecConstants.h.

References HcalParameters::etaTableHF, and hpar.

Referenced by HcalTopology::HcalTopology(), and CaloTowerHardcodeGeometryLoader::load().

60 {return hpar->etaTableHF;}
std::vector< double > etaTableHF
const HcalParameters * hpar
HcalDDDRecConstants::HcalID HcalDDDRecConstants::getHCID ( int  subdet,
int  ieta,
int  iphi,
int  lay,
int  idepth 
) const

Definition at line 121 of file HcalDDDRecConstants.cc.

References gather_cfg::cout, HLT_25ns14e33_v1_cff::depth, eta, HcalBarrel, HcalEndcap, HcalOuter, hcons, hpar, ietaMap, iEtaMin, layerGroup(), HcalParameters::noff, phi, phibin, HcalParameters::phigroup, HcalDDDSimConstants::phiNumber(), HcalParameters::phioff, phiUnitS, csvLumiCalc::unit, and HcalDDDSimConstants::unitPhi().

Referenced by SimHitsValidationHcal::analyze(), and HcalHitRelabeller::relabel().

122  {
123 
124  int eta(ieta), phi(iphi), depth(idepth);
125  if ((subdet == static_cast<int>(HcalOuter)) ||
126  ((subdet == static_cast<int>(HcalBarrel)) && (lay > 17))) {
127  subdet= static_cast<int>(HcalOuter);
128  depth = 4;
129  } else if (subdet == static_cast<int>(HcalBarrel) ||
130  subdet == static_cast<int>(HcalEndcap)) {
131  eta = ietaMap[ieta-1];
132  int unit = phiUnitS[ieta-1];
133  int phi0 = (iphi-1)/(hpar->phigroup[eta-1]);
134  if (unit == 2) {
135  phi0 = (iphi+1)/2;
136  phi0 = (phi0-1)/(hpar->phigroup[eta-1]);
137  } else if (unit == 4) {
138  phi0 = (iphi+5)/4;
139  phi0 = (phi0-1)/(hpar->phigroup[eta-1]);
140  }
141  ++phi0;
142  unit = hcons.unitPhi(phibin[eta-1]);
143  phi = hcons.phiNumber(phi0,unit);
144  depth = layerGroup( eta-1, lay-1 );
145  if (eta == iEtaMin[1]) {
146  if (subdet == static_cast<int>(HcalBarrel)) {
147  if (depth > 2) depth = 2;
148  } else {
149  if (depth < 3) depth = 3;
150  }
151  } else if (eta == hpar->noff[0] && lay > 1) {
152  int kphi = phi + int((hpar->phioff[3]+0.1)/phibin[eta-1]);
153  kphi = (kphi-1)%4 + 1;
154  if (kphi == 2 || kphi == 3) depth = layerGroup( eta-1, lay-2 );
155  } else if (eta == hpar->noff[1] && depth > 2) {
156  eta = hpar->noff[1]-1;
157  }
158  }
159 #ifdef DebugLog
160  std::cout << "getHCID: input " << subdet << ":" << ieta << ":" << iphi
161  << ":" << idepth << ":" << lay << " output " << eta << ":" << phi
162  << ":" << depth << std::endl;
163 #endif
164  return HcalDDDRecConstants::HcalID(subdet,eta,phi,depth);
165 }
std::vector< int > iEtaMin
int unitPhi(int det, int etaR) const
std::vector< int > phiUnitS
const HcalParameters * hpar
std::vector< double > phibin
unsigned int layerGroup(unsigned int eta, unsigned int i) const
string unit
Definition: csvLumiCalc.py:46
std::vector< int > ietaMap
std::vector< double > phioff
int phiNumber(int phi, int unit) const
const HcalDDDSimConstants & hcons
std::vector< int > noff
tuple cout
Definition: gather_cfg.py:121
std::vector< int > phigroup
int HcalDDDRecConstants::getMaxDepth ( const int  type) const
inline
int HcalDDDRecConstants::getNEta ( ) const
inline

Definition at line 66 of file HcalDDDRecConstants.h.

References HcalParameters::etagroup, and hpar.

Referenced by HcalTopology::HcalTopology().

66 {return hpar->etagroup.size();}
std::vector< int > etagroup
const HcalParameters * hpar
double HcalDDDRecConstants::getPhiBin ( const int  i) const
inline

Definition at line 67 of file HcalDDDRecConstants.h.

References i, and phibin.

67 {return phibin[i];}
int i
Definition: DBlmapReader.cc:9
std::vector< double > phibin
double HcalDDDRecConstants::getPhiOff ( const int  i) const
inline

Definition at line 68 of file HcalDDDRecConstants.h.

References hpar, i, and HcalParameters::phioff.

68 {return hpar->phioff[i];}
int i
Definition: DBlmapReader.cc:9
const HcalParameters * hpar
std::vector< double > phioff
const std::vector<double>& HcalDDDRecConstants::getPhiOffs ( ) const
inline

Definition at line 69 of file HcalDDDRecConstants.h.

References hpar, and HcalParameters::phioff.

Referenced by HcalTopology::HcalTopology().

69 {return hpar->phioff;}
const HcalParameters * hpar
std::vector< double > phioff
const std::vector<double>& HcalDDDRecConstants::getPhiTable ( ) const
inline

Definition at line 70 of file HcalDDDRecConstants.h.

References phibin.

Referenced by HcalTopology::HcalTopology().

70 {return phibin;}
std::vector< double > phibin
const std::vector<double>& HcalDDDRecConstants::getPhiTableHF ( ) const
inline

Definition at line 71 of file HcalDDDRecConstants.h.

References hpar, and HcalParameters::phitable.

Referenced by HcalTopology::HcalTopology().

71 {return hpar->phitable;}
const HcalParameters * hpar
std::vector< double > phitable
double HcalDDDRecConstants::getRZ ( int  subdet,
int  ieta,
int  depth 
) const

Definition at line 168 of file HcalDDDRecConstants.cc.

References gather_cfg::cout, HLT_25ns14e33_v1_cff::etaMax, plotBeamSpotDB::first, gconsHB, gconsHE, HcalBarrel, relval_steps::k, layerGroup(), and layerGroupSize().

168  {
169 
170  int ietaAbs = (ieta > 0) ? ieta : -ieta;
171  double rz(0);
172 #ifdef DebugLog
173  int lay(0);
174 #endif
175  if (ietaAbs < hpar->etaMax[1]) {
176  for (unsigned int k=0; k< layerGroupSize( ietaAbs-1 ); ++k) {
177  if (depth == (int)layerGroup( ietaAbs-1, k )) {
178  rz = ((subdet == static_cast<int>(HcalBarrel)) ? (gconsHB[k].first) :
179  (gconsHE[k].first));
180  if (rz > 10.) {
181 #ifdef DebugLog
182  lay = k;
183 #endif
184  break;
185  }
186  }
187  }
188  }
189 #ifdef DebugLog
190  std::cout << "getRZ: subdet|ieta|depth " << subdet << "|" << ieta << "|"
191  << depth << " lay|rz " << lay << "|" << rz << std::endl;
192 #endif
193  return rz;
194 }
std::vector< std::pair< double, double > > gconsHE
unsigned int layerGroup(unsigned int eta, unsigned int i) const
unsigned int layerGroupSize(unsigned int eta) const
tuple cout
Definition: gather_cfg.py:121
std::vector< std::pair< double, double > > gconsHB
std::vector< HcalDDDRecConstants::HcalActiveLength > HcalDDDRecConstants::getThickActive ( const int  type) const

Definition at line 197 of file HcalDDDRecConstants.cc.

References funct::cos(), gather_cfg::cout, HcalDDDRecConstants::HcalActiveLength::depth, HLT_25ns14e33_v1_cff::depth, eta, HcalDDDRecConstants::HcalActiveLength::eta, create_public_lumi_plots::exp, plotBeamSpotDB::first, gconsHB, gconsHE, getEtaBins(), i, HcalDDDRecConstants::HcalActiveLength::ieta, j, relval_steps::k, pileupReCalc_HLTpaths::scale, edm::second(), funct::sin(), theta(), and HcalDDDRecConstants::HcalActiveLength::thick.

Referenced by HcalRaddamMuon::beginRun().

197  {
198 
199  std::vector<HcalDDDRecConstants::HcalActiveLength> actives;
200  std::vector<HcalDDDRecConstants::HcalEtaBin> bins = getEtaBins(type);
201 #ifdef DebugLog
202  unsigned int kount(0);
203 #endif
204  for (unsigned int k=0; k<bins.size(); ++k) {
205  int ieta = bins[k].ieta;
206  double eta = 0.5*(bins[k].etaMin+bins[k].etaMax);
207  double theta = 2*atan(exp(-eta));
208  double scale = 1.0/((type == 0) ? sin(theta) : cos(theta));
209  int depth = bins[k].depthStart;
210  for (unsigned int i = 0; i < bins[k].layer.size(); ++i) {
211  double thick(0);
212  for (int j = bins[k].layer[i].first; j <= bins[k].layer[i].second; ++j) {
213  if (type == 0 || j > 1)
214  thick += ((type == 0) ? gconsHB[j-1].second : gconsHE[j-1].second);
215  }
216  thick *= (2.*scale);
217  HcalDDDRecConstants::HcalActiveLength active(ieta,depth,eta,thick);
218  actives.push_back(active);
219  ++depth;
220 #ifdef DebugLog
221  kount++;
222  std::cout << "getThickActive: [" << kount << "] eta:" << active.ieta
223  << ":" << active.eta << " depth " << active.depth << " thick "
224  << active.thick << std::endl;
225 #endif
226  }
227  }
228  return actives;
229 }
type
Definition: HCALResponse.h:21
int i
Definition: DBlmapReader.cc:9
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Geom::Theta< T > theta() const
U second(std::pair< T, U > const &p)
std::vector< std::pair< double, double > > gconsHE
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
int j
Definition: DBlmapReader.cc:9
tuple cout
Definition: gather_cfg.py:121
std::vector< std::pair< double, double > > gconsHB
std::vector< HcalEtaBin > getEtaBins(const int itype) const
int HcalDDDRecConstants::getTopoMode ( ) const
inline

Definition at line 74 of file HcalDDDRecConstants.h.

References hpar, and HcalParameters::topologyMode.

Referenced by HcalTopology::HcalTopology(), and HcalTopologyIdealEP::produce().

74 {return hpar->topologyMode;}
const HcalParameters * hpar
std::vector< HcalCellType > HcalDDDRecConstants::HcalCellTypes ( HcalSubdetector  subdet) const

Definition at line 232 of file HcalDDDRecConstants.cc.

References newFWLiteAna::bin, prof2calltree::count, gather_cfg::cout, HLT_25ns14e33_v1_cff::depth, HLT_25ns14e33_v1_cff::etaMax, HLT_25ns14e33_v1_cff::etaMin, etaSimValu, plotBeamSpotDB::first, getEtaBins(), HcalBarrel, HcalDDDSimConstants::HcalCellTypes(), HcalEndcap, hcons, hpar, HLT_25ns14e33_v1_cff::nPhi, HcalParameters::phioff, groupFilesInBlocks::temp, csvLumiCalc::unit, and HcalDDDSimConstants::unitPhi().

Referenced by HcalDDDGeometryLoader::fill(), and numberOfCells().

232  {
233 
234  if (subdet == HcalBarrel || subdet == HcalEndcap) {
235  std::vector<HcalCellType> cells;
236  int isub = (subdet == HcalBarrel) ? 0 : 1;
237  std::vector<HcalDDDRecConstants::HcalEtaBin> etabins = getEtaBins(isub);
238  for (unsigned int bin=0; bin<etabins.size(); ++bin) {
239  std::vector<HcalCellType> temp;
240  std::vector<int> count;
241  std::vector<double> dmin, dmax;
242  for (unsigned int il=0; il<etabins[bin].layer.size(); ++il) {
243  HcalCellType cell(subdet, 0, 0, 0, HcalCellType::HcalCell());
244  temp.push_back(cell);
245  count.push_back(0);
246  dmin.push_back(0);
247  dmax.push_back(0);
248  }
249  int ieta = etabins[bin].ieta;
250  for (int keta=etaSimValu[ieta-1].first; keta<=etaSimValu[ieta-1].second;
251  ++keta) {
252  std::vector<HcalCellType> cells = hcons.HcalCellTypes(subdet,keta,-1);
253  for (unsigned int ic=0; ic<cells.size(); ++ic) {
254  for (unsigned int il=0; il<etabins[bin].layer.size(); ++il) {
255  if (cells[ic].depthSegment() >= etabins[bin].layer[il].first &&
256  cells[ic].depthSegment() <= etabins[bin].layer[il].second) {
257  if (count[il] == 0) {
258  temp[il] = cells[ic];
259  dmin[il] = cells[ic].depthMin();
260  dmax[il] = cells[ic].depthMax();
261  }
262  ++count[il];
263  if (cells[ic].depthMin() < dmin[il]) dmin[il] = cells[ic].depthMin();
264  if (cells[ic].depthMax() > dmax[il]) dmax[il] = cells[ic].depthMax();
265  break;
266  }
267  }
268  }
269  }
270  int unit = hcons.unitPhi(etabins[bin].dphi);
271  for (unsigned int il=0; il<etabins[bin].layer.size(); ++il) {
272  int depth = etabins[bin].depthStart + (int)(il);
273  temp[il].setEta(ieta,etabins[bin].etaMin,etabins[bin].etaMax);
274  temp[il].setPhi(etabins[bin].nPhi,unit,etabins[bin].dphi/CLHEP::deg,
275  hpar->phioff[isub]/CLHEP::deg);
276  temp[il].setDepth(depth,dmin[il],dmax[il]);
277  cells.push_back(temp[il]);
278  }
279  }
280 #ifdef DebugLog
281  std::cout << "HcalDDDRecConstants: found " << cells.size() << " cells for sub-detector type " << isub << std::endl;
282  for (unsigned int ic=0; ic<cells.size(); ++ic)
283  std::cout << "Cell[" << ic << "] " << cells[ic] << std::endl;
284 #endif
285  return cells;
286  } else {
287  return hcons.HcalCellTypes(subdet,-1,-1);
288  }
289 }
int unitPhi(int det, int etaR) const
std::vector< std::pair< int, int > > etaSimValu
const HcalParameters * hpar
string unit
Definition: csvLumiCalc.py:46
std::vector< HcalCellType > HcalCellTypes() const
std::vector< double > phioff
const HcalDDDSimConstants & hcons
tuple cout
Definition: gather_cfg.py:121
std::vector< HcalEtaBin > getEtaBins(const int itype) const
void HcalDDDRecConstants::initialize ( void  )
private

Definition at line 336 of file HcalDDDRecConstants.cc.

References gather_cfg::cout, HcalParameters::drHB, HcalParameters::dzHE, HcalParameters::etagroup, HcalParameters::etaMax, HLT_25ns14e33_v1_cff::etaMax, HcalParameters::etaMin, HLT_25ns14e33_v1_cff::etaMin, etaSimValu, HcalParameters::etaTable, etaTable, HcalParameters::etaTableHF, Exception, plotBeamSpotDB::first, citk::for(), gconsHB, gconsHE, hcons, hpar, i, ietaMap, iEtaMax, iEtaMin, relval_steps::k, layerGroup(), layerGroupSize(), HcalParameters::maxDepth, maxDepth, HcalParameters::modHB, HcalParameters::modHE, HLT_25ns14e33_v1_cff::nEta, nHalves, nModule, HcalParameters::phibin, phibin, HcalParameters::phigroup, HcalParameters::phitable, phiUnitS, HcalParameters::rHB, edm::second(), csvLumiCalc::unit, HcalDDDSimConstants::unitPhi(), and HcalParameters::zHE.

Referenced by HcalDDDRecConstants().

336  {
337 
338  //Eta grouping
339  int nEta = (int)(hpar->etagroup.size());
340  if (nEta != (int)(hpar->phigroup.size())) {
341  edm::LogError("HCalGeom") << "HcalDDDRecConstants: sizes of the vectors "
342  << " etaGroup (" << nEta << ") and phiGroup ("
343  << hpar->phigroup.size() << ") do not match";
344  throw cms::Exception("DDException") << "HcalDDDRecConstants: inconsistent array sizes" << nEta << ":" << hpar->phigroup.size();
345  }
346 
347  // First eta table
348  iEtaMin = hpar->etaMin;
349  iEtaMax = hpar->etaMax;
350  etaTable.clear(); ietaMap.clear(); etaSimValu.clear();
351  int ieta(0), ietaHB(0), ietaHE(0);
352  etaTable.push_back(hpar->etaTable[ieta]);
353  for (int i=0; i<nEta; ++i) {
354  int ef = ieta+1;
355  ieta += (hpar->etagroup[i]);
356  if (ieta >= (int)(hpar->etaTable.size())) {
357  edm::LogError("HCalGeom") << "Going beyond the array boundary "
358  << hpar->etaTable.size() << " at index " << i
359  << " of etaTable from SimConstant";
360  throw cms::Exception("DDException") << "Going beyond the array boundary "
361  << hpar->etaTable.size()
362  << " at index " << i
363  << " of etaTable from SimConstant";
364  } else {
365  etaTable.push_back(hpar->etaTable[ieta]);
366  etaSimValu.push_back(std::pair<int,int>(ef,ieta));
367  }
368  for (int k=0; k<(hpar->etagroup[i]); ++k) ietaMap.push_back(i+1);
369  if (ieta <= hpar->etaMax[0]) ietaHB = i+1;
370  if (ieta <= hpar->etaMin[1]) ietaHE = i+1;
371  }
372  iEtaMin[1] = ietaHE;
373  iEtaMax[0] = ietaHB;
374 
375  // Then Phi bins
376  ieta = 0;
377  phibin.clear(); phiUnitS.clear();
378  for (int i=0; i<nEta; ++i) {
379  double dphi = (hpar->phigroup[i])*(hpar->phibin[ieta]);
380  phibin.push_back(dphi);
381  ieta += (hpar->etagroup[i]);
382  }
383  for (unsigned int i=1; i<hpar->etaTable.size(); ++i) {
384  int unit = hcons.unitPhi(hpar->phibin[i-1]);
385  phiUnitS.push_back(unit);
386  }
387 
388 #ifdef DebugLog
389  std::cout << "Modified eta/deltaphi table for " << nEta << " bins" << std::endl;
390  for (int i=0; i<nEta; ++i)
391  std::cout << "Eta[" << i << "] = " << etaTable[i] << ":" << etaTable[i+1]
392  << ":" << etaSimValu[i].first << ":" << etaSimValu[i].second
393  << " PhiBin[" << i << "] = " << phibin[i]/CLHEP::deg <<std::endl;
394  std::cout << "PhiUnitS";
395  for (unsigned int i=0; i<phiUnitS.size(); ++i)
396  std::cout << " [" << i << "] = " << phiUnitS[i];
397  std::cout << std::endl;
398  std::cout << "EtaTableHF";
399  for (unsigned int i=0; i<hpar->etaTableHF.size(); ++i)
400  std::cout << " [" << i << "] = " << hpar->etaTableHF[i];
401  std::cout << std::endl;
402  std::cout << "PhiBinHF";
403  for (unsigned int i=0; i<hpar->phitable.size(); ++i)
404  std::cout << " [" << i << "] = " << hpar->phitable[i];
405  std::cout << std::endl;
406 #endif
407 
408  //Now the depths
410  maxDepth[0] = maxDepth[1] = 0;
411  for (int i=0; i<nEta; ++i) {
412  unsigned int imx = layerGroupSize(i);
413  int laymax = (imx > 0) ? layerGroup(i,imx-1) : 0;
414  if (i < iEtaMax[0]) {
415  int laymax0 = (imx > 16) ? layerGroup(i,16) : laymax;
416  if (i+1 == iEtaMax[0] && laymax0 > 2) laymax0 = 2;
417 #ifdef DebugLog
418  std::cout << "HB " << i << " " << imx << " " << laymax << " " << laymax0 << std::endl;
419 #endif
420  if (maxDepth[0] < laymax0) maxDepth[0] = laymax0;
421  }
422  if (i >= iEtaMin[1]-1 && i < iEtaMax[1]) {
423 #ifdef DebugLog
424  std::cout << "HE " << i << " " << imx << " " << laymax << std::endl;
425 #endif
426  if (maxDepth[1] < laymax) maxDepth[1] = laymax;
427  }
428  }
429 #ifdef DebugLog
430  for (int i=0; i<4; ++i)
431  std::cout << "Detector Type[" << i << "] iEta " << iEtaMin[i] << ":"
432  << iEtaMax[i] << " MaxDepth " << maxDepth[i] << std::endl;
433 #endif
434 
435  //Now the geometry constants
436  nModule[0] = hpar->modHB[0];
437  nHalves[0] = hpar->modHB[1];
438  for (unsigned int i=0; i<hpar->rHB.size(); ++i) {
439  gconsHB.push_back(std::pair<double,double>(hpar->rHB[i]/CLHEP::cm,
440  hpar->drHB[i]/CLHEP::cm));
441  }
442 #ifdef DebugLog
443  std::cout << "HB with " << nModule[0] << " modules and " << nHalves[0]
444  <<" halves and " << gconsHB.size() << " layers" << std::endl;
445  for (unsigned int i=0; i<gconsHB.size(); ++i)
446  std::cout << "rHB[" << i << "] = " << gconsHB[i].first << " +- "
447  << gconsHB[i].second << std::endl;
448 #endif
449  nModule[1] = hpar->modHE[0];
450  nHalves[1] = hpar->modHE[1];
451  for (unsigned int i=0; i<hpar->zHE.size(); ++i) {
452  gconsHE.push_back(std::pair<double,double>(hpar->zHE[i]/CLHEP::cm,
453  hpar->dzHE[i]/CLHEP::cm));
454  }
455 #ifdef DebugLog
456  std::cout << "HE with " << nModule[1] << " modules and " << nHalves[1]
457  <<" halves and " << gconsHE.size() << " layers" << std::endl;
458  for (unsigned int i=0; i<gconsHE.size(); ++i)
459  std::cout << "zHE[" << i << "] = " << gconsHE[i].first << " +- "
460  << gconsHE[i].second << std::endl;
461 #endif
462 }
int i
Definition: DBlmapReader.cc:9
std::vector< double > etaTable
std::vector< int > iEtaMin
std::vector< int > etagroup
int unitPhi(int det, int etaR) const
std::vector< double > rHB
std::vector< std::pair< int, int > > etaSimValu
std::vector< int > maxDepth
std::vector< double > etaTableHF
std::vector< int > etaMax
std::vector< int > phiUnitS
std::vector< int > modHB
U second(std::pair< T, U > const &p)
const HcalParameters * hpar
std::vector< std::pair< double, double > > gconsHE
std::vector< double > zHE
std::vector< double > phibin
unsigned int layerGroup(unsigned int eta, unsigned int i) const
string unit
Definition: csvLumiCalc.py:46
std::vector< double > dzHE
std::vector< int > iEtaMax
std::vector< int > ietaMap
std::vector< int > modHE
unsigned int layerGroupSize(unsigned int eta) const
std::vector< double > etaTable
std::vector< double > phitable
std::vector< double > phibin
std::vector< double > drHB
const HcalDDDSimConstants & hcons
tuple cout
Definition: gather_cfg.py:121
std::vector< std::pair< double, double > > gconsHB
std::vector< int > maxDepth
std::vector< int > phigroup
for(const auto &isodef:isoDefs)
std::vector< int > etaMin
unsigned int HcalDDDRecConstants::layerGroup ( unsigned int  eta,
unsigned int  i 
) const
private

Definition at line 482 of file HcalDDDRecConstants.cc.

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

Referenced by getEtaBins(), getHCID(), getRZ(), and initialize().

483 {
484  unsigned int k = 0;
485  for( auto const & it : hpar->layerGroupEtaRec )
486  {
487  if( it.layer == eta + 1 )
488  {
489  return it.layerGroup.at( i );
490  }
491  if( it.layer > eta + 1 )
492  break;
493 
494  k = it.layerGroup.at( i );
495  }
496  return k;
497 }
int i
Definition: DBlmapReader.cc:9
const HcalParameters * hpar
std::vector< LayerItem > layerGroupEtaRec
unsigned int HcalDDDRecConstants::layerGroupSize ( unsigned int  eta) const
private

Definition at line 465 of file HcalDDDRecConstants.cc.

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

Referenced by getEtaBins(), getRZ(), and initialize().

466 {
467  unsigned int k = 0;
468  for( auto const & it : hpar->layerGroupEtaRec )
469  {
470  if( it.layer == eta + 1 )
471  {
472  return it.layerGroup.size();
473  }
474  if( it.layer > eta + 1 )
475  break;
476  k = it.layerGroup.size();
477  }
478  return k;
479 }
const HcalParameters * hpar
std::vector< LayerItem > layerGroupEtaRec
unsigned int HcalDDDRecConstants::nCells ( HcalSubdetector  subdet) const

Definition at line 313 of file HcalDDDRecConstants.cc.

References getEtaBins(), HcalBarrel, HcalEndcap, HcalForward, HcalOuter, i, kHFSizePreLS1, kHOSizePreLS1, and HLT_25ns14e33_v1_cff::nPhi.

313  {
314 
315  if (subdet == HcalBarrel || subdet == HcalEndcap) {
316  int isub = (subdet == HcalBarrel) ? 0 : 1;
317  std::vector<HcalDDDRecConstants::HcalEtaBin> etabins = getEtaBins(isub);
318  unsigned int ncell(0);
319  for (unsigned int i=0; i<etabins.size(); ++i) {
320  ncell += (((unsigned int)(etabins[i].nPhi))*(etabins[i].layer.size()));
321  }
322  return ncell;
323  } else if (subdet == HcalOuter) {
324  return kHOSizePreLS1;
325  } else if (subdet == HcalForward) {
326  return kHFSizePreLS1;
327  } else {
328  return 0;
329  }
330 }
int i
Definition: DBlmapReader.cc:9
std::vector< HcalEtaBin > getEtaBins(const int itype) const
unsigned int HcalDDDRecConstants::nCells ( ) const
unsigned int HcalDDDRecConstants::numberOfCells ( HcalSubdetector  subdet) const

Definition at line 291 of file HcalDDDRecConstants.cc.

References HcalBarrel, HcalCellTypes(), HcalEndcap, hcons, i, nHalves, ecaldqm::binning::nPhiBins, pileupDistInMC::num, and HcalDDDSimConstants::numberOfCells().

Referenced by HcalDDDGeometryLoader::load().

291  {
292 
293  if (subdet == HcalBarrel || subdet == HcalEndcap) {
294  unsigned int num = 0;
295  std::vector<HcalCellType> cellTypes = HcalCellTypes(subdet);
296  for (unsigned int i=0; i<cellTypes.size(); i++) {
297  num += (unsigned int)(cellTypes[i].nPhiBins());
298  if (cellTypes[i].nHalves() > 1)
299  num += (unsigned int)(cellTypes[i].nPhiBins());
300  num -= (unsigned int)(cellTypes[i].nPhiMissingBins());
301  }
302 #ifdef DebugLog
303  edm::LogInfo ("HCalGeom") << "HcalDDDRecConstants:numberOfCells "
304  << cellTypes.size() << " " << num
305  << " for subdetector " << subdet;
306 #endif
307  return num;
308  } else {
309  return hcons.numberOfCells(subdet);
310  }
311 }
int i
Definition: DBlmapReader.cc:9
unsigned int numberOfCells(HcalSubdetector) const
std::vector< HcalCellType > HcalCellTypes(HcalSubdetector) const
const HcalDDDSimConstants & hcons

Member Data Documentation

std::vector<std::pair<int,int> > HcalDDDRecConstants::etaSimValu
private

Definition at line 87 of file HcalDDDRecConstants.h.

Referenced by HcalCellTypes(), and initialize().

std::vector<double> HcalDDDRecConstants::etaTable
private

Definition at line 88 of file HcalDDDRecConstants.h.

Referenced by getEtaBins(), getEtaLimit(), getEtaPhi(), getEtaTable(), and initialize().

std::vector<std::pair<double,double> > HcalDDDRecConstants::gconsHB
private

Definition at line 94 of file HcalDDDRecConstants.h.

Referenced by getConstHBHE(), getRZ(), getThickActive(), and initialize().

std::vector<std::pair<double,double> > HcalDDDRecConstants::gconsHE
private

Definition at line 95 of file HcalDDDRecConstants.h.

Referenced by getConstHBHE(), getRZ(), getThickActive(), and initialize().

const HcalDDDSimConstants& HcalDDDRecConstants::hcons
private

Definition at line 86 of file HcalDDDRecConstants.h.

Referenced by getHCID(), HcalCellTypes(), initialize(), and numberOfCells().

const HcalParameters* HcalDDDRecConstants::hpar
private
std::vector<int> HcalDDDRecConstants::ietaMap
private

Definition at line 89 of file HcalDDDRecConstants.h.

Referenced by getHCID(), and initialize().

std::vector<int> HcalDDDRecConstants::iEtaMax
private

Definition at line 90 of file HcalDDDRecConstants.h.

Referenced by getEtaBins(), getEtaPhi(), getEtaRange(), and initialize().

std::vector<int> HcalDDDRecConstants::iEtaMin
private

Definition at line 90 of file HcalDDDRecConstants.h.

Referenced by getEtaBins(), getEtaPhi(), getEtaRange(), getHCID(), and initialize().

std::vector<int> HcalDDDRecConstants::maxDepth
private

Definition at line 91 of file HcalDDDRecConstants.h.

Referenced by getMaxDepth(), and initialize().

int HcalDDDRecConstants::nHalves[2]
private

Definition at line 96 of file HcalDDDRecConstants.h.

Referenced by initialize(), and numberOfCells().

int HcalDDDRecConstants::nModule[2]
private

Definition at line 96 of file HcalDDDRecConstants.h.

Referenced by getEtaBins(), and initialize().

std::vector<double> HcalDDDRecConstants::phibin
private

Definition at line 92 of file HcalDDDRecConstants.h.

Referenced by getEtaBins(), getEtaPhi(), getHCID(), getPhiBin(), getPhiTable(), and initialize().

std::vector<int> HcalDDDRecConstants::phiUnitS
private

Definition at line 93 of file HcalDDDRecConstants.h.

Referenced by getHCID(), and initialize().