CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
HcalDDDRecConstants Class Reference

#include <HcalDDDRecConstants.h>

Classes

struct  HcalActiveLength
 
struct  HcalEtaBin
 
struct  HcalID
 
struct  HFCellParameters
 

Public Member Functions

const HcalDDDSimConstantsdddConstants () const
 
std::vector< std::pair< double, double > > getConstHBHE (const int type) const
 
std::vector< int > getDepth (const int det, const int phi, const int zside, const unsigned int eta) const
 
std::vector< int > getDepth (const unsigned int eta, const bool extra) const
 
int getDepthEta16 (const int det, const int iphi, const int zside) 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
 
std::vector< HFCellParametersgetHFCellParameters () const
 
double getLayer0Wt (int det, int phi, int zside) const
 
void getLayerDepth (int ieta, std::map< int, int > &layers) const
 
int getMaxDepth (const int type) const
 
int getMaxDepth (const int itype, const int ieta, const int iphi, const int zside) const
 
int getMinDepth (const int itype, const int ieta, const int iphi, const int zside) const
 
int getNEta () const
 
int getNoff (const int i) const
 
int getNPhi (const int type) const
 
double getPhiBin (const int i) const
 
double getPhiOff (const int i) const
 
const std::vector< double > & getPhiOffs () const
 
std::vector< std::pair< int, double > > getPhis (int subdet, int ieta) const
 
const std::vector< double > & getPhiTable () const
 
const std::vector< double > & getPhiTableHF () const
 
int getPhiZOne (std::vector< std::pair< int, int > > &phiz) const
 
double getRZ (int subdet, int ieta, int depth) const
 
std::vector< HcalActiveLengthgetThickActive (const int type) const
 
int getTopoMode () const
 
int getTriggerMode () const
 
std::vector< HcalCellTypeHcalCellTypes (HcalSubdetector) const
 
 HcalDDDRecConstants (const HcalParameters *hp, const HcalDDDSimConstants &hc)
 
HcalDetId idBack (const HcalDetId &id) const
 
HcalDetId idFront (const HcalDetId &id) const
 
bool isBH () const
 
bool isPlan1 (const HcalDetId &id) const
 
bool isPlan1MergedId (const HcalDetId &id) const
 
bool isPlan1ToBeMergedId (const HcalDetId &id) const
 
int maxHFDepth (int ieta, int iphi) const
 
HcalDetId mergedDepthDetId (const HcalDetId &id) const
 
unsigned int nCells (HcalSubdetector) const
 
unsigned int nCells () const
 
unsigned int numberOfCells (HcalSubdetector) const
 
void specialRBXHBHE (const std::vector< HcalDetId > &, std::vector< HcalDetId > &) const
 
bool specialRBXHBHE (const bool flag, std::vector< HcalDetId > &) const
 
void unmergeDepthDetId (const HcalDetId &id, std::vector< HcalDetId > &ids) const
 
bool withSpecialRBXHBHE () const
 
 ~HcalDDDRecConstants ()
 

Private Member Functions

void getOneEtaBin (HcalSubdetector subdet, int ieta, int zside, std::vector< std::pair< int, double >> &phis, std::map< int, int > &layers, bool planOne, std::vector< HcalDDDRecConstants::HcalEtaBin > &bins) const
 
void initialize (void)
 
unsigned int layerGroup (int eta, int i) const
 
unsigned int layerGroupSize (int eta) const
 

Private Attributes

std::pair< int, int > depthMaxDf_
 
std::pair< int, int > depthMaxSp_
 
std::map< HcalDetId, HcalDetIddetIdSp_
 
std::map< HcalDetId, std::vector< HcalDetId > > detIdSpR_
 
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< int > nPhiBins
 
std::vector< double > phibin
 
std::vector< int > phiUnitS
 

Static Private Attributes

static const int maxLayer_ =18
 
static const int maxLayerHB_ =16
 

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

Constructor & Destructor Documentation

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

Definition at line 13 of file HcalDDDRecConstants.cc.

References gather_cfg::cout, and initialize().

14  :
15  hpar(hp), hcons(hc) {
16 
17 #ifdef EDM_ML_DEBUG
18  std::cout << "HcalDDDRecConstants::HcalDDDRecConstants (const HcalParameters* hp) constructor" << std::endl;
19 #endif
20  initialize();
21 }
const HcalParameters * hpar
const HcalDDDSimConstants & hcons
HcalDDDRecConstants::~HcalDDDRecConstants ( )

Definition at line 23 of file HcalDDDRecConstants.cc.

References gather_cfg::cout.

23  {
24 #ifdef EDM_ML_DEBUG
25  std::cout << "HcalDDDRecConstants::destructed!!!" << std::endl;
26 #endif
27 }

Member Function Documentation

const HcalDDDSimConstants* HcalDDDRecConstants::dddConstants ( ) const
inline

Definition at line 120 of file HcalDDDRecConstants.h.

References create_public_pileup_plots::bins, getOneEtaBin(), hcons, mps_fire::i, initialize(), layerGroup(), and layerGroupSize().

120 {return &hcons;}
const HcalDDDSimConstants & hcons
std::vector<std::pair<double,double> > HcalDDDRecConstants::getConstHBHE ( const int  type) const
inline

Definition at line 59 of file HcalDDDRecConstants.h.

References HcalDDDRecConstants::HcalID::eta, gconsHB, gconsHE, getDepth(), HcalDDDRecConstants::HcalID::phi, and HcalDigiParam_cfi::zside.

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

59  {
60  if (type == 0) return gconsHB;
61  else if (type == 1) return gconsHE;
62  else {std::vector<std::pair<double,double> > gcons; return gcons;}
63  }
type
Definition: HCALResponse.h:21
std::vector< std::pair< double, double > > gconsHE
std::vector< std::pair< double, double > > gconsHB
std::vector< int > HcalDDDRecConstants::getDepth ( const int  det,
const int  phi,
const int  zside,
const unsigned int  eta 
) const

Definition at line 50 of file HcalDDDRecConstants.cc.

References HcalLayerDepthMap::getLayerDepth(), hcons, LayerTriplets::layers(), and HcalDDDSimConstants::ldMap().

Referenced by getConstHBHE(), and HcalTopology::HcalTopology().

50  {
51  std::map<int,int> layers;
52  hcons.ldMap()->getLayerDepth(det, eta+1, phi, zside, layers);
53  if (layers.size() == 0) {
54  return getDepth(eta, false);
55  } else {
56  std::vector<int> depths;
57  for (unsigned int lay=0; lay < layers.size(); ++lay)
58  depths.push_back(layers[lay+1]);
59  return depths;
60  }
61 }
std::vector< LayerSetAndLayers > layers(const SeedingLayerSetsHits &sets)
Definition: LayerTriplets.cc:4
std::vector< int > getDepth(const int det, const int phi, const int zside, const unsigned int eta) const
void getLayerDepth(const int subdet, const int ieta, const int iphi, const int zside, std::map< int, int > &layers) const
const HcalDDDSimConstants & hcons
const HcalLayerDepthMap * ldMap() const
std::vector< int > HcalDDDRecConstants::getDepth ( const unsigned int  eta,
const bool  extra 
) const

Definition at line 29 of file HcalDDDRecConstants.cc.

References HcalLayerDepthMap::getLayerDepth(), hcons, hpar, plotBeamSpotDB::last, HcalParameters::layerGroupEtaRec, LayerTriplets::layers(), and HcalDDDSimConstants::ldMap().

30  {
31 
32  if (!extra) {
33  std::vector<HcalParameters::LayerItem>::const_iterator last = hpar->layerGroupEtaRec.begin();
34  for (std::vector<HcalParameters::LayerItem>::const_iterator it = hpar->layerGroupEtaRec.begin(); it != hpar->layerGroupEtaRec.end(); ++it) {
35  if (it->layer == eta + 1) return it->layerGroup;
36  if (it->layer > eta + 1 ) return last->layerGroup;
37  last = it;
38  }
39  return last->layerGroup;
40  } else {
41  std::map<int,int> layers;
42  hcons.ldMap()->getLayerDepth(eta+1, layers);
43  std::vector<int> depths;
44  for (unsigned int lay=0; lay < layers.size(); ++lay)
45  depths.push_back(layers[lay+1]);
46  return depths;
47  }
48 }
std::vector< LayerSetAndLayers > layers(const SeedingLayerSetsHits &sets)
Definition: LayerTriplets.cc:4
void getLayerDepth(const int subdet, const int ieta, const int iphi, const int zside, std::map< int, int > &layers) const
const HcalParameters * hpar
std::vector< LayerItem > layerGroupEtaRec
const HcalDDDSimConstants & hcons
const HcalLayerDepthMap * ldMap() const
int HcalDDDRecConstants::getDepthEta16 ( const int  det,
const int  iphi,
const int  zside 
) const
inline

Definition at line 67 of file HcalDDDRecConstants.h.

References HcalDDDSimConstants::getDepthEta16(), getEtaBins(), getEtaPhi(), hcons, and HcalDDDRecConstants::HcalID::subdet.

Referenced by HcalTopology::depthBinInformation(), and HcalTopology::validRaw().

68  {return hcons.getDepthEta16(det,iphi,zside);}
int getDepthEta16(const int det, const int phi, const int zside) const
const HcalDDDSimConstants & hcons
std::vector< HcalDDDRecConstants::HcalEtaBin > HcalDDDRecConstants::getEtaBins ( const int  itype) const

Definition at line 64 of file HcalDDDRecConstants.cc.

References create_public_pileup_plots::bins, gather_cfg::cout, spr::find(), plotBeamSpotDB::first, HcalLayerDepthMap::getLayerDepth(), getLayerDepth(), getOneEtaBin(), getPhis(), hcons, mps_fire::i, iEtaMax, iEtaMin, gen::k, LayerTriplets::layers(), HcalDDDSimConstants::ldMap(), edm::second(), HcalLayerDepthMap::validDet(), and HcalDigiParam_cfi::zside.

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

64  {
65 
66  std::vector<HcalDDDRecConstants::HcalEtaBin> bins;
67  unsigned int type = (itype == 0) ? 0 : 1;
68  HcalSubdetector subdet = HcalSubdetector(type+1);
69  std::vector<int> phiSp;
70  HcalSubdetector subdetSp = HcalSubdetector(hcons.ldMap()->validDet(phiSp));
71  std::map<int,int> layers;
72  for (int iz=0; iz<2; ++iz) {
73  int zside = 2*iz - 1;
74  for (int ieta = iEtaMin[type]; ieta <= iEtaMax[type]; ++ieta) {
75  std::vector<std::pair<int,double> > phis = getPhis(subdet,ieta);
76  std::vector<std::pair<int,double> > phiUse;
77  getLayerDepth(ieta,layers);
78  if (subdet == subdetSp) {
79  for (unsigned k=0; k<phis.size(); ++k) {
80  if (std::find(phiSp.begin(),phiSp.end(),(zside*phis[k].first)) ==
81  phiSp.end()){
82  phiUse.push_back(phis[k]);
83  }
84  }
85  } else {
86  phiUse.insert(phiUse.end(),phis.begin(),phis.end());
87  }
88  getOneEtaBin(subdet,ieta,zside,phiUse,layers,false,bins);
89  }
90  }
91  if (subdetSp == subdet) {
92  for (int ieta = iEtaMin[type]; ieta <= iEtaMax[type]; ++ieta) {
93  std::vector<std::pair<int,double> > phis = getPhis(subdet,ieta);
94  for (int iz=0; iz<2; ++iz) {
95  int zside = 2*iz - 1;
96  std::vector<std::pair<int,double> > phiUse;
97  for (unsigned i=0; i<phiSp.size(); ++i) {
98  for (unsigned k=0; k<phis.size(); ++k) {
99  if (phiSp[i] == zside*phis[k].first) {
100  phiUse.push_back(phis[k]);
101  break;
102  }
103  }
104  }
105  if (phiUse.size() > 0) {
106  hcons.ldMap()->getLayerDepth(subdet,ieta,phiUse[0].first,zside,layers);
107  getOneEtaBin(subdet,ieta,zside,phiUse,layers,true,bins);
108  }
109  }
110  }
111  }
112 #ifdef EDM_ML_DEBUG
113  std::cout << "Prepares " << bins.size() << " eta bins for type " << type
114  << std::endl;
115  for (unsigned int i=0; i<bins.size(); ++i) {
116  std::cout << "Bin[" << i << "]: Eta = (" << bins[i].ieta << ":"
117  << bins[i].etaMin << ":" << bins[i].etaMax << "), Zside = "
118  << bins[i].zside << ", phis = (" << bins[i].phis.size() << ":"
119  << bins[i].dphi << ") and " << bins[i].layer.size()
120  << " depths (start) " << bins[i].depthStart << " :";
121  for (unsigned int k=0; k<bins[i].layer.size(); ++k)
122  std::cout << " [" << k << "] " << bins[i].layer[k].first << ":"
123  << bins[i].layer[k].second;
124  std::cout << std::endl << " and Phi sets";
125  for (unsigned int k=0; k<bins[i].phis.size(); ++k)
126  std::cout << " " << bins[i].phis[k].first << ":" <<bins[i].phis[k].second;
127  std::cout << std::endl;
128  }
129 #endif
130  return bins;
131 }
type
Definition: HCALResponse.h:21
std::vector< int > iEtaMin
std::vector< LayerSetAndLayers > layers(const SeedingLayerSetsHits &sets)
Definition: LayerTriplets.cc:4
void getLayerDepth(const int subdet, const int ieta, const int iphi, const int zside, std::map< int, int > &layers) const
void getOneEtaBin(HcalSubdetector subdet, int ieta, int zside, std::vector< std::pair< int, double >> &phis, std::map< int, int > &layers, bool planOne, std::vector< HcalDDDRecConstants::HcalEtaBin > &bins) const
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
void getLayerDepth(int ieta, std::map< int, int > &layers) const
U second(std::pair< T, U > const &p)
int validDet(std::vector< int > &phis) const
std::vector< std::pair< int, double > > getPhis(int subdet, int ieta) const
std::vector< int > iEtaMax
HcalSubdetector
Definition: HcalAssistant.h:31
int k[5][pyjets_maxn]
const HcalDDDSimConstants & hcons
const HcalLayerDepthMap * ldMap() const
std::pair<double,double> HcalDDDRecConstants::getEtaLimit ( const int  i) const
inline

Definition at line 75 of file HcalDDDRecConstants.h.

References etaTable, getHCID(), getHFCellParameters(), getLayerDepth(), mps_fire::i, and LayerTriplets::layers().

76  {return std::pair<double,double>(etaTable[i],etaTable[i+1]);}
std::vector< double > etaTable
std::pair< double, double > HcalDDDRecConstants::getEtaPhi ( int  subdet,
int  ieta,
int  iphi 
) const

Definition at line 134 of file HcalDDDRecConstants.cc.

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

Referenced by HGCalSimHitValidation::analyzeHits(), and getDepthEta16().

134  {
135  int ietaAbs = (ieta > 0) ? ieta : -ieta;
136  double eta(0), phi(0);
137  if ((subdet == static_cast<int>(HcalBarrel)) ||
138  (subdet == static_cast<int>(HcalEndcap)) ||
139  (subdet == static_cast<int>(HcalOuter))) { // Use Eta Table
140  int unit = hcons.unitPhi(phibin[ietaAbs-1]);
141  int kphi = (unit == 2) ? ((iphi-1)/2 + 1) : iphi;
142  double foff = (ietaAbs <= iEtaMax[0]) ? hpar->phioff[0] : hpar->phioff[1];
143  eta = 0.5*(etaTable[ietaAbs-1]+etaTable[ietaAbs]);
144  phi = foff + (kphi-0.5)*phibin[ietaAbs-1];
145  } else {
146  ietaAbs -= iEtaMin[2];
147  int unit = hcons.unitPhi(hpar->phitable[ietaAbs-1]);
148  int kphi = (unit == 4) ? ((iphi-3)/4 + 1) : ((iphi-1)/2 + 1);
149  double foff = (unit > 2) ? hpar->phioff[4] : hpar->phioff[2];
150  eta = 0.5*(hpar->etaTableHF[ietaAbs-1]+hpar->etaTableHF[ietaAbs]);
151  phi = foff + (kphi-0.5)*hpar->phitable[ietaAbs-1];
152  }
153  if (ieta < 0) eta = -eta;
154  if (phi > M_PI) phi -= (2*M_PI);
155 #ifdef EDM_ML_DEBUG
156  std::cout << "getEtaPhi: subdet|ieta|iphi " << subdet << "|" << ieta << "|"
157  << iphi << " eta|phi " << eta << "|" << phi << std::endl;
158 #endif
159  return std::pair<double,double>(eta,phi);
160 }
std::vector< int > iEtaMin
std::vector< double > etaTableHF
const HcalParameters * hpar
std::vector< double > phibin
std::vector< int > iEtaMax
#define M_PI
std::vector< double > phioff
std::vector< double > etaTable
std::vector< double > phitable
int unitPhi(const int det, const int etaR) const
const HcalDDDSimConstants & hcons
std::pair<int,int> HcalDDDRecConstants::getEtaRange ( const int  i) const
inline
const std::vector<double>& HcalDDDRecConstants::getEtaTable ( ) const
inline

Definition at line 73 of file HcalDDDRecConstants.h.

References etaTable.

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

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

Definition at line 74 of file HcalDDDRecConstants.h.

References HcalParameters::etaTableHF, and hpar.

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

74 {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 163 of file HcalDDDRecConstants.cc.

References gather_cfg::cout, particleFlowClusterECALTimeSelected_cfi::depth, stringResolutionProvider_cfi::eta, HcalDDDSimConstants::findDepth(), HcalDDDSimConstants::getDepthEta16(), HcalDDDSimConstants::getDepthEta29(), HcalBarrel, HcalEndcap, HcalOuter, hcons, hpar, ietaMap, iEtaMin, createfilelist::int, layerGroup(), maxLayerHB_, HcalParameters::noff, phi, phibin, HcalParameters::phigroup, HcalDDDSimConstants::phiNumber(), HcalParameters::phioff, phiUnitS, csvLumiCalc::unit, HcalDDDSimConstants::unitPhi(), and HcalDigiParam_cfi::zside.

Referenced by HGCalHitValidation::analyze(), CaloTruthAccumulator::fillSimHits(), getEtaLimit(), and HcalHitRelabeller::relabel().

164  {
165 
166  int ieta = (keta > 0) ? keta : -keta;
167  int zside= (keta > 0) ? 1 : -1;
168  int eta(ieta), phi(iphi), depth(idepth);
169  if ((subdet == static_cast<int>(HcalOuter)) ||
170  ((subdet == static_cast<int>(HcalBarrel)) && (lay > maxLayerHB_+1))) {
171  subdet= static_cast<int>(HcalOuter);
172  depth = 4;
173  } else if (subdet == static_cast<int>(HcalBarrel) ||
174  subdet == static_cast<int>(HcalEndcap)) {
175  eta = ietaMap[ieta-1];
176  int unit = phiUnitS[ieta-1];
177  int phi0 = (iphi-1)/(hpar->phigroup[eta-1]);
178  if (unit == 2) {
179  phi0 = (iphi+1)/2;
180  phi0 = (phi0-1)/(hpar->phigroup[eta-1]);
181  } else if (unit == 4) {
182  phi0 = (iphi+1)/4;
183  phi0 = (phi0-1)/(hpar->phigroup[eta-1]);
184  }
185  ++phi0;
186  unit = hcons.unitPhi(phibin[eta-1]);
187  phi = hcons.phiNumber(phi0,unit);
188  depth = hcons.findDepth(subdet,eta,phi,zside,lay-1);
189  if (depth <= 0) depth = layerGroup(eta-1, lay-1);
190  if (eta == iEtaMin[1]) {
191  if (subdet == static_cast<int>(HcalBarrel)) {
192  if (depth > hcons.getDepthEta16(subdet,phi,zside))
193  depth = hcons.getDepthEta16(subdet,phi,zside);
194  } else {
195  if (depth < hcons.getDepthEta16(subdet,phi,zside))
196  depth = hcons.getDepthEta16(subdet,phi,zside);
197  }
198  } else if (eta == hpar->noff[0] && lay > 1) {
199  int kphi = phi + int((hpar->phioff[3]+0.1)/phibin[eta-1]);
200  kphi = (kphi-1)%4 + 1;
201  if (kphi == 2 || kphi == 3) depth = layerGroup(eta-1, lay-2);
202  } else if (eta == hpar->noff[1] &&
203  depth > hcons.getDepthEta29(phi,zside,0)) {
204  eta -= hcons.getDepthEta29(phi,zside,1);
205  }
206  }
207 #ifdef EDM_ML_DEBUG
208  std::cout << "getHCID: input " << subdet << ":" << ieta << ":" << iphi
209  << ":" << idepth << ":" << lay << " output " << eta << ":" << phi
210  << ":" << depth << std::endl;
211 #endif
212  return HcalDDDRecConstants::HcalID(subdet,eta,phi,depth);
213 }
int findDepth(const int det, const int eta, const int phi, const int zside, const int lay) const
std::vector< int > iEtaMin
unsigned int layerGroup(int eta, int i) const
std::vector< int > phiUnitS
const HcalParameters * hpar
std::vector< double > phibin
int getDepthEta29(const int phi, int zside, int i) const
std::vector< int > ietaMap
int getDepthEta16(const int det, const int phi, const int zside) const
std::vector< double > phioff
int phiNumber(const int phi, const int unit) const
int unitPhi(const int det, const int etaR) const
const HcalDDDSimConstants & hcons
std::vector< int > noff
std::vector< int > phigroup
static const int maxLayerHB_
std::vector< HcalDDDRecConstants::HFCellParameters > HcalDDDRecConstants::getHFCellParameters ( ) const

Definition at line 216 of file HcalDDDRecConstants.cc.

References funct::abs(), gather_cfg::cout, particleFlowClusterECALTimeSelected_cfi::depth, HcalDDDSimConstants::getIdHF2QIE(), HcalDDDSimConstants::getPhiTableHF(), HcalDDDSimConstants::getRTableHF(), hcons, iEtaMin, createfilelist::int, gen::k, maxDepth, DetIdAssociatorESProducer_cff::nEta, DetIdAssociatorESProducer_cff::nPhi, conversionPostprocessing_cfi::rMax, and conversionPostprocessing_cfi::rMin.

Referenced by getEtaLimit(), and HcalFlexiHardcodeGeometryLoader::makeHFCells().

216  {
217 
218  std::vector<HcalDDDRecConstants::HFCellParameters> cells;
219  unsigned int nEta = hcons.getPhiTableHF().size();
220  if (maxDepth[2] > 0) {
221  for (unsigned int k=0; k<nEta; ++k) {
222  int ieta = iEtaMin[2] + k;
223  int dphi = (int)(0.001 + hcons.getPhiTableHF()[k]/(5.0*CLHEP::deg));
224  int iphi = (dphi == 4) ? 3 : 1;
225  int nphi = 72/dphi;
226  double rMin = hcons.getRTableHF()[nEta-k-1]/CLHEP::cm;
227  double rMax = hcons.getRTableHF()[nEta-k]/CLHEP::cm;
228  HcalDDDRecConstants::HFCellParameters cell1( ieta,1,iphi,dphi,nphi,rMin,rMax);
229  cells.push_back(cell1);
230  HcalDDDRecConstants::HFCellParameters cell2(-ieta,1,iphi,dphi,nphi,rMin,rMax);
231  cells.push_back(cell2);
232  }
233  }
234  if (maxDepth[2] > 2) {
235  if (hcons.getIdHF2QIE().size() > 0) {
236  for (unsigned int k=0; k<hcons.getIdHF2QIE().size(); ++k) {
237  int ieta = hcons.getIdHF2QIE()[k].ieta();
238  int ind = std::abs(ieta) - iEtaMin[2];
239  int dphi = (int)(0.001 + hcons.getPhiTableHF()[ind]/(5.0*CLHEP::deg));
240  int iphi = hcons.getIdHF2QIE()[k].iphi();
241  double rMin = hcons.getRTableHF()[nEta-ind-1]/CLHEP::cm;
242  double rMax = hcons.getRTableHF()[nEta-ind]/CLHEP::cm;
243  HcalDDDRecConstants::HFCellParameters cell1( ieta,3,iphi,dphi,1,rMin,rMax);
244  cells.push_back(cell1);
245  }
246  } else {
247  for (unsigned int k=0; k<nEta; ++k) {
248  int ieta = iEtaMin[2] + k;
249  int dphi = (int)(0.001 + hcons.getPhiTableHF()[k]/(5.0*CLHEP::deg));
250  int iphi = (dphi == 4) ? 3 : 1;
251  int nphi = 72/dphi;
252  double rMin = hcons.getRTableHF()[nEta-k-1]/CLHEP::cm;
253  double rMax = hcons.getRTableHF()[nEta-k]/CLHEP::cm;
254  HcalDDDRecConstants::HFCellParameters cell1( ieta,3,iphi,dphi,nphi,rMin,rMax);
255  cells.push_back(cell1);
256  HcalDDDRecConstants::HFCellParameters cell2(-ieta,3,iphi,dphi,nphi,rMin,rMax);
257  cells.push_back(cell2);
258  }
259  }
260  }
261 #ifdef EDM_ML_DEBUG
262  std::cout << "HcalDDDRecConstants returns " << cells.size()
263  << " HF cell parameters" << std::endl;
264  for (unsigned int k=0; k<cells.size(); ++k)
265  std::cout << "Cell[" << k <<"] : (" << cells[k].ieta <<", "<< cells[k].depth
266  << ", " << cells[k].firstPhi << ", " << cells[k].stepPhi << ", "
267  << cells[k].nPhi << ", " << cells[k].rMin << ", "
268  << cells[k].rMax << ")" << std::endl;
269 #endif
270  return cells;
271 }
std::vector< int > iEtaMin
std::vector< int > maxDepth
const std::vector< double > & getRTableHF() const
const std::vector< double > & getPhiTableHF() const
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int k[5][pyjets_maxn]
const HcalDDDSimConstants & hcons
const std::vector< HcalDetId > & getIdHF2QIE() const
double HcalDDDRecConstants::getLayer0Wt ( int  det,
int  phi,
int  zside 
) const
inline

Definition at line 81 of file HcalDDDRecConstants.h.

References HcalDDDSimConstants::getLayer0Wt(), and hcons.

Referenced by HcalHitRelabeller::energyWt().

81 {return hcons.getLayer0Wt(det,phi,zside);}
double getLayer0Wt(const int det, const int phi, const int zside) const
const HcalDDDSimConstants & hcons
void HcalDDDRecConstants::getLayerDepth ( int  ieta,
std::map< int, int > &  layers 
) const

Definition at line 273 of file HcalDDDRecConstants.cc.

References gather_cfg::cout, checklumidiff::l, layerGroup(), and layerGroupSize().

Referenced by getEtaBins(), and getEtaLimit().

274  {
275 
276  layers.clear();
277  for (unsigned int l=0; l<layerGroupSize(ieta-1); ++l) {
278  int lay = l + 1;
279  layers[lay] = layerGroup(ieta-1,l);
280  }
281 #ifdef EDM_ML_DEBUG
282  std::cout << "getLayerDepth::Input " << ieta << " Output "
283  << layers.size() << " entries" << std::endl;
284  for (std::map<int,int>::iterator itr=layers.begin(); itr != layers.end();
285  ++itr) std::cout << " [" << itr->first << "] " << itr->second;
286  std::cout << std::endl;
287 #endif
288 }
std::vector< LayerSetAndLayers > layers(const SeedingLayerSetsHits &sets)
Definition: LayerTriplets.cc:4
unsigned int layerGroup(int eta, int i) const
unsigned int layerGroupSize(int eta) const
int HcalDDDRecConstants::getMaxDepth ( const int  type) const
inline
int HcalDDDRecConstants::getMaxDepth ( const int  itype,
const int  ieta,
const int  iphi,
const int  zside 
) const

Definition at line 290 of file HcalDDDRecConstants.cc.

References HcalDDDSimConstants::getDepthEta16M(), HcalDDDSimConstants::getDepthEta29M(), HcalDDDSimConstants::getMaxDepth(), hcons, hpar, iEtaMax, createfilelist::int, layerGroup(), layerGroupSize(), maxLayer_, maxLayerHB_, and HcalParameters::noff.

291  {
292 
293  unsigned int type = (itype == 0) ? 0 : 1;
294  int lmax = hcons.getMaxDepth(type+1, ieta, iphi, zside, true);
295  if (lmax < 0) {
296  unsigned int lymax = (type == 0) ? maxLayerHB_+1 : maxLayer_+1;
297  lmax = 0;
298  if (layerGroupSize(ieta-1) > 0) {
299  if (layerGroupSize(ieta-1) < lymax) lymax = layerGroupSize(ieta-1);
300  lmax = (int)(layerGroup(ieta-1, lymax-1));
301  if (type == 0 && ieta == iEtaMax[type]) lmax = hcons.getDepthEta16M(1);
302  if (type == 1 && ieta >= hpar->noff[1]) lmax = hcons.getDepthEta29M(0,false);
303  }
304  }
305  return lmax;
306 }
type
Definition: HCALResponse.h:21
int getMaxDepth(const int type) const
unsigned int layerGroup(int eta, int i) const
static const int maxLayer_
int getDepthEta29M(const int i, const bool planOne) const
const HcalParameters * hpar
std::vector< int > iEtaMax
unsigned int layerGroupSize(int eta) const
int getDepthEta16M(const int det) const
const HcalDDDSimConstants & hcons
std::vector< int > noff
static const int maxLayerHB_
int HcalDDDRecConstants::getMinDepth ( const int  itype,
const int  ieta,
const int  iphi,
const int  zside 
) const

Definition at line 308 of file HcalDDDRecConstants.cc.

References HcalDDDSimConstants::getDepthEta16M(), HcalDDDSimConstants::getMinDepth(), hcons, iEtaMin, createfilelist::int, layerGroup(), layerGroupSize(), and maxDepth.

Referenced by HcalTopology::depthBinInformation(), HcalGeometry::getClosestCell(), and getMaxDepth().

309  {
310 
311  int lmin = hcons.getMinDepth(itype+1, ieta, iphi, zside, true);
312  if (lmin < 0) {
313  if (itype == 2) { // HFn
314  lmin = 1;
315  } else if (itype == 3) { //HO
316  lmin = maxDepth[3];
317  } else {
318  unsigned int type = (itype == 0) ? 0 : 1;
319  if (layerGroupSize(ieta-1) > 0) {
320  if (type == 1 && ieta == iEtaMin[type])
321  lmin = hcons.getDepthEta16M(2);
322  else
323  lmin = (int)(layerGroup(ieta-1, 0));
324  }
325  }
326  }
327  return lmin;
328 }
type
Definition: HCALResponse.h:21
std::vector< int > iEtaMin
unsigned int layerGroup(int eta, int i) const
std::vector< int > maxDepth
int getMinDepth(const int det, const int eta, const int phi, const int zside, bool partialOnly) const
unsigned int layerGroupSize(int eta) const
int getDepthEta16M(const int det) const
const HcalDDDSimConstants & hcons
int HcalDDDRecConstants::getNEta ( ) const
inline

Definition at line 87 of file HcalDDDRecConstants.h.

References HcalParameters::etagroup, and hpar.

Referenced by HcalTopology::HcalTopology().

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

Definition at line 88 of file HcalDDDRecConstants.h.

References hpar, mps_fire::i, and HcalParameters::noff.

Referenced by HcalTopology::validRaw().

88 {return hpar->noff[i];}
const HcalParameters * hpar
std::vector< int > noff
int HcalDDDRecConstants::getNPhi ( const int  type) const
inline
void HcalDDDRecConstants::getOneEtaBin ( HcalSubdetector  subdet,
int  ieta,
int  zside,
std::vector< std::pair< int, double >> &  phis,
std::map< int, int > &  layers,
bool  planOne,
std::vector< HcalDDDRecConstants::HcalEtaBin > &  bins 
) const
private

Definition at line 612 of file HcalDDDRecConstants.cc.

References gather_cfg::cout, HcalDDDRecConstants::HcalEtaBin::depthStart, etaTable, plotBeamSpotDB::first, HcalDDDSimConstants::getDepthEta16(), HcalDDDSimConstants::getDepthEta16M(), HcalDDDSimConstants::getDepthEta29(), HcalDDDSimConstants::getDepthEta29M(), HcalBarrel, HcalEndcap, hcons, hpar, iEtaMax, iEtaMin, gen::k, checklumidiff::l, HcalDDDRecConstants::HcalEtaBin::layer, maxLayer_, maxLayerHB_, gen::n, HcalParameters::noff, phibin, HcalDDDRecConstants::HcalEtaBin::phis, and edm::second().

Referenced by dddConstants(), and getEtaBins().

615  {
616 
617  unsigned int lymax = (subdet == HcalBarrel) ? maxLayerHB_+1 : maxLayer_+1;
618  int type = (subdet == HcalBarrel) ? 0 : 1;
619  double dphi = phibin[ieta-1];
621  etabin.phis.insert(etabin.phis.end(),phis.begin(),phis.end());
622  int n = (ieta == iEtaMax[type]) ? 0 : 1;
624  etabin0.depthStart = hcons.getDepthEta29(phis[0].first,zside,0)+1;
625  int dstart = -1;
626  int lmin(0), lmax(0);
627  std::map<int,int>::iterator itr=layers.begin();
628  if (layers.size() > 0) {
629  int dep = itr->second;
630  if (subdet == HcalEndcap && ieta == iEtaMin[type])
631  dep = hcons.getDepthEta16(subdet,phis[0].first,zside);
632  unsigned lymx0 = (layers.size() > lymax) ? lymax : layers.size();
633 #ifdef EDM_ML_DEBUG
634  std::cout << "Eta " << ieta << ":" << hpar->noff[1] << " zside " << zside
635  << " lymax " << lymx0 << ":" << lymax << " Depth " << dep << ":"
636  << itr->second;
637  unsigned int l(0);
638  for (itr = layers.begin(); itr != layers.end(); ++itr,++l)
639  std::cout << " [" << l << "] " << itr->first << ":" << itr->second;
640  std::cout << std::endl << " with " << phis.size() << " phis";
641  for (unsigned int l=0; l<phis.size(); ++l)
642  std::cout << " " << phis[l].first << ":" << phis[l].second;
643  std::cout << std::endl;
644 #endif
645  for (itr = layers.begin(); itr != layers.end(); ++itr) {
646  if (itr->first <= (int)(lymx0)) {
647  if (itr->second == dep) {
648  if (lmin == 0) lmin = itr->first;
649  lmax = itr->first;
650  } else if (itr->second > dep) {
651  if (dstart < 0) dstart = dep;
652  int lmax0 = (lmax >= lmin) ? lmax : lmin;
653  if (subdet == HcalEndcap && ieta+1 == hpar->noff[1] &&
654  dep > hcons.getDepthEta29(phis[0].first,zside,0)) {
655  etabin0.layer.push_back(std::pair<int,int>(lmin,lmax0));
656  } else {
657  etabin.layer.push_back(std::pair<int,int>(lmin,lmax0));
658  }
659  lmin = itr->first;
660  lmax = lmin-1;
661  dep = itr->second;
662  }
663  if (subdet == HcalBarrel && ieta == iEtaMax[type] &&
664  dep > hcons.getDepthEta16M(1)) break;
665  if (subdet == HcalEndcap && ieta == hpar->noff[1] &&
666  dep > hcons.getDepthEta29M(0,planOne)) {
667  lmax = lymx0;
668  break;
669  }
670  if (itr->first == (int)(lymx0)) lmax = lymx0;
671  }
672  }
673  if (lmax >= lmin) {
674  if (ieta+1 == hpar->noff[1]) {
675  etabin0.layer.push_back(std::pair<int,int>(lmin,lmax));
676  etabin0.phis.insert(etabin0.phis.end(),phis.begin(),phis.end());
677  bins.push_back(etabin0);
678 #ifdef EDM_ML_DEBUG
679  std::cout << "etabin0: dStatrt " << etabin0.depthStart << " layers "
680  << etabin0.layer.size() << ":" << lmin << ":" << lmax
681  << " phis " << phis.size() << std::endl;
682  for (unsigned int k=0; k<etabin0.layer.size(); ++k)
683  std::cout << " [" << k << "] " << etabin0.layer[k].first << ":"
684  << etabin0.layer[k].second;
685  std::cout << std::endl;
686 #endif
687  } else if (ieta == hpar->noff[1]) {
688  } else {
689  etabin.layer.push_back(std::pair<int,int>(lmin,lmax));
690  if (dstart < 0) dstart = dep;
691  }
692  }
693  }
694  etabin.depthStart = dstart;
695  bins.push_back(etabin);
696 #ifdef EDM_ML_DEBUG
697  std::cout << "etabin: dStatrt " << etabin.depthStart << " layers "
698  << etabin.layer.size() << ":" << lmin << ":" << lmax
699  << " phis " << etabin.phis.size() << std::endl;
700  for (unsigned int k=0; k<etabin.layer.size(); ++k)
701  std::cout << " [" << k << "] " << etabin.layer[k].first << ":"
702  << etabin.layer[k].second;
703  std::cout << std::endl;
704 #endif
705 }
type
Definition: HCALResponse.h:21
std::vector< int > iEtaMin
std::vector< LayerSetAndLayers > layers(const SeedingLayerSetsHits &sets)
Definition: LayerTriplets.cc:4
static const int maxLayer_
int getDepthEta29M(const int i, const bool planOne) const
U second(std::pair< T, U > const &p)
const HcalParameters * hpar
std::vector< double > phibin
int getDepthEta29(const int phi, int zside, int i) const
std::vector< int > iEtaMax
std::vector< std::pair< int, int > > layer
int getDepthEta16(const int det, const int phi, const int zside) const
int k[5][pyjets_maxn]
std::vector< double > etaTable
int getDepthEta16M(const int det) const
const HcalDDDSimConstants & hcons
std::vector< int > noff
static const int maxLayerHB_
std::vector< std::pair< int, double > > phis
double HcalDDDRecConstants::getPhiBin ( const int  i) const
inline

Definition at line 90 of file HcalDDDRecConstants.h.

References mps_fire::i, and phibin.

90 {return phibin[i];}
std::vector< double > phibin
double HcalDDDRecConstants::getPhiOff ( const int  i) const
inline

Definition at line 91 of file HcalDDDRecConstants.h.

References hpar, mps_fire::i, and HcalParameters::phioff.

91 {return hpar->phioff[i];}
const HcalParameters * hpar
std::vector< double > phioff
const std::vector<double>& HcalDDDRecConstants::getPhiOffs ( ) const
inline

Definition at line 92 of file HcalDDDRecConstants.h.

References getPhis(), hpar, and HcalParameters::phioff.

Referenced by HcalTopology::HcalTopology().

92 {return hpar->phioff;}
const HcalParameters * hpar
std::vector< double > phioff
std::vector< std::pair< int, double > > HcalDDDRecConstants::getPhis ( int  subdet,
int  ieta 
) const

Definition at line 331 of file HcalDDDRecConstants.cc.

References gather_cfg::cout, etaSimValu, plotBeamSpotDB::first, HcalDDDSimConstants::getPhiCons(), HcalForward, hcons, gen::k, phi, phibin, HcalDDDSimConstants::phiNumber(), edm::second(), HcalDDDSimConstants::unitPhi(), and units().

Referenced by getEtaBins(), and getPhiOffs().

331  {
332 
333  std::vector<std::pair<int,double> > phis;
334  int ietaAbs = (ieta > 0) ? ieta : -ieta;
335  int keta = (subdet != HcalForward) ? etaSimValu[ietaAbs-1].first : ietaAbs;
336  std::pair<double,double> ficons = hcons.getPhiCons(subdet, keta);
337  double fioff = ficons.first;
338  double dphi = (subdet != HcalForward) ? phibin[ietaAbs-1] : ficons.second;
339  int nphi = int((CLHEP::twopi+0.1*dphi)/dphi);
340  int units = hcons.unitPhi(subdet, keta);
341  for (int ifi = 0; ifi < nphi; ++ifi) {
342  double phi =-fioff + (ifi+0.5)*dphi;
343  int iphi = hcons.phiNumber(ifi+1,units);
344  phis.push_back(std::pair<int,double>(iphi,phi));
345  }
346 #ifdef EDM_ML_DEBUG
347  std::cout << "getEtaPhi: subdet|ieta|iphi " << subdet << "|" << ieta
348  << " with " << phis.size() << " phi bins" << std::endl;
349  for (unsigned int k=0; k<phis.size(); ++k)
350  std::cout << "[" << k << "] iphi " << phis[k].first << " phi "
351  << phis[k].second/CLHEP::deg << std::endl;
352 #endif
353  return phis;
354 }
std::vector< std::pair< int, int > > etaSimValu
std::pair< double, double > getPhiCons(const int det, const int ieta) const
U second(std::pair< T, U > const &p)
std::vector< double > phibin
int k[5][pyjets_maxn]
int phiNumber(const int phi, const int unit) const
TString units(TString variable, Char_t axis)
int unitPhi(const int det, const int etaR) const
const HcalDDDSimConstants & hcons
const std::vector<double>& HcalDDDRecConstants::getPhiTable ( ) const
inline

Definition at line 94 of file HcalDDDRecConstants.h.

References phibin.

Referenced by HcalTopology::HcalTopology().

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

Definition at line 95 of file HcalDDDRecConstants.h.

References HcalDDDRecConstants::HcalID::depth, getPhiZOne(), getRZ(), getThickActive(), hpar, and HcalParameters::phitable.

Referenced by HcalTopology::HcalTopology().

95 {return hpar->phitable;}
const HcalParameters * hpar
std::vector< double > phitable
int HcalDDDRecConstants::getPhiZOne ( std::vector< std::pair< int, int > > &  phiz) const

Definition at line 356 of file HcalDDDRecConstants.cc.

References gather_cfg::cout, plotBeamSpotDB::first, HcalLayerDepthMap::getPhis(), HcalLayerDepthMap::getSubdet(), hcons, gen::k, HcalDDDSimConstants::ldMap(), phi, edm::second(), and HcalDigiParam_cfi::zside.

Referenced by getPhiTableHF(), and HcalTopology::getPhiZOne().

356  {
357 
358  phiz.clear();
359  int subdet = hcons.ldMap()->getSubdet();
360  if (subdet > 0) {
361  std::vector<int> phis = hcons.ldMap()->getPhis();
362  for (unsigned int k=0; k<phis.size(); ++k) {
363  int zside = (phis[k] > 0) ? 1 : -1;
364  int phi = (phis[k] > 0) ? phis[k] : -phis[k];
365  phiz.push_back(std::pair<int,int>(phi,zside));
366  }
367  }
368 #ifdef EDM_ML_DEBUG
369  std::cout << "Special RBX for detector " << subdet << " with " << phiz.size()
370  << " phi/z bins";
371  for (unsigned int k=0; k<phiz.size(); ++k)
372  std::cout << " [" << k << "] " << phiz[k].first << ":" << phiz[k].second;
373  std::cout << std::endl;
374 #endif
375  return subdet;
376 }
int getSubdet() const
U second(std::pair< T, U > const &p)
const std::vector< int > & getPhis() const
int k[5][pyjets_maxn]
const HcalDDDSimConstants & hcons
const HcalLayerDepthMap * ldMap() const
double HcalDDDRecConstants::getRZ ( int  subdet,
int  ieta,
int  depth 
) const

Definition at line 378 of file HcalDDDRecConstants.cc.

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

Referenced by HGCalSimHitValidation::analyzeHits(), and getPhiTableHF().

378  {
379 
380  int ietaAbs = (ieta > 0) ? ieta : -ieta;
381  double rz(0);
382 #ifdef EDM_ML_DEBUG
383  int lay(0);
384 #endif
385  if (ietaAbs < hpar->etaMax[1]) {
386  for (unsigned int k=0; k< layerGroupSize(ietaAbs-1); ++k) {
387  if (depth == (int)layerGroup(ietaAbs-1, k)) {
388  rz = ((subdet == static_cast<int>(HcalBarrel)) ? (gconsHB[k].first) :
389  (gconsHE[k].first));
390  if (rz > 10.) {
391 #ifdef EDM_ML_DEBUG
392  lay = k;
393 #endif
394  break;
395  }
396  }
397  }
398  }
399 #ifdef EDM_ML_DEBUG
400  std::cout << "getRZ: subdet|ieta|depth " << subdet << "|" << ieta << "|"
401  << depth << " lay|rz " << lay << "|" << rz << std::endl;
402 #endif
403  return rz;
404 }
unsigned int layerGroup(int eta, int i) const
std::vector< std::pair< double, double > > gconsHE
int k[5][pyjets_maxn]
unsigned int layerGroupSize(int eta) const
std::vector< std::pair< double, double > > gconsHB
std::vector< HcalDDDRecConstants::HcalActiveLength > HcalDDDRecConstants::getThickActive ( const int  type) const

Definition at line 407 of file HcalDDDRecConstants.cc.

References create_public_pileup_plots::bins, funct::cos(), gather_cfg::cout, particleFlowClusterECALTimeSelected_cfi::depth, HcalDDDRecConstants::HcalActiveLength::depth, stringResolutionProvider_cfi::eta, HcalDDDRecConstants::HcalActiveLength::eta, JetChargeProducer_cfi::exp, plotBeamSpotDB::first, gconsHB, gconsHE, getEtaBins(), mps_fire::i, HcalDDDRecConstants::HcalActiveLength::ieta, gen::k, Scenarios_cff::scale, edm::second(), funct::sin(), lumiQTWidget::t, theta(), and HcalDDDRecConstants::HcalActiveLength::thick.

Referenced by HcalHBHEMuonSimAnalyzer::beginRun(), HcalRaddamMuon::beginRun(), HcalHBHEMuonAnalyzer::beginRun(), and getPhiTableHF().

407  {
408 
409  std::vector<HcalDDDRecConstants::HcalActiveLength> actives;
410  std::vector<HcalDDDRecConstants::HcalEtaBin> bins = getEtaBins(type);
411 #ifdef EDM_ML_DEBUG
412  unsigned int kount(0);
413 #endif
414  for (unsigned int k=0; k<bins.size(); ++k) {
415  int ieta = bins[k].ieta;
416  double eta = 0.5*(bins[k].etaMin+bins[k].etaMax);
417  double theta = 2*atan(exp(-eta));
418  double scale = 1.0/((type == 0) ? sin(theta) : cos(theta));
419  int depth = bins[k].depthStart;
420  for (unsigned int i = 0; i < bins[k].layer.size(); ++i) {
421  double thick(0);
422  for (int j = bins[k].layer[i].first; j <= bins[k].layer[i].second; ++j) {
423  if (type == 0 || j > 1) {
424  double t = ((type == 0) ? gconsHB[j-1].second : gconsHE[j-1].second);
425  if (t > 0) thick += t;
426  }
427  }
428  thick *= (2.*scale);
429  HcalDDDRecConstants::HcalActiveLength active(ieta,depth,eta,thick);
430  actives.push_back(active);
431  ++depth;
432 #ifdef EDM_ML_DEBUG
433  kount++;
434  std::cout << "getThickActive: [" << kount << "] eta:" << active.ieta
435  << ":" << active.eta << " depth " << active.depth << " thick "
436  << active.thick << std::endl;
437 #endif
438  }
439  }
440  return actives;
441 }
type
Definition: HCALResponse.h:21
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 k[5][pyjets_maxn]
std::vector< std::pair< double, double > > gconsHB
std::vector< HcalEtaBin > getEtaBins(const int itype) const
int HcalDDDRecConstants::getTopoMode ( ) const
inline

Definition at line 99 of file HcalDDDRecConstants.h.

References hpar, and HcalParameters::topologyMode.

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

99 {return ((hpar->topologyMode)&0xFF);}
const HcalParameters * hpar
int HcalDDDRecConstants::getTriggerMode ( ) const
inline

Definition at line 100 of file HcalDDDRecConstants.h.

References HcalCellTypes(), hpar, and HcalParameters::topologyMode.

Referenced by HcalTopology::HcalTopology().

100 {return (((hpar->topologyMode)>>8)&0xFF);}
const HcalParameters * hpar
std::vector< HcalCellType > HcalDDDRecConstants::HcalCellTypes ( HcalSubdetector  subdet) const

Definition at line 444 of file HcalDDDRecConstants.cc.

References stringResolutionProvider_cfi::bin, KineDebug3::count(), gather_cfg::cout, particleFlowClusterECALTimeSelected_cfi::depth, ALCARECOTkAlBeamHalo_cff::etaMax, ALCARECOTkAlBeamHalo_cff::etaMin, etaSimValu, plotBeamSpotDB::first, getEtaBins(), HcalBarrel, HcalDDDSimConstants::HcalCellTypes(), HcalEndcap, hcons, hpar, iEtaMax, createfilelist::int, HcalParameters::phioff, HcalCellType::setPhi(), groupFilesInBlocks::temp, csvLumiCalc::unit, HcalDDDSimConstants::unitPhi(), and HcalDigiParam_cfi::zside.

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

444  {
445 
446  if (subdet == HcalBarrel || subdet == HcalEndcap) {
447  std::vector<HcalCellType> cells;
448  int isub = (subdet == HcalBarrel) ? 0 : 1;
449  std::vector<HcalDDDRecConstants::HcalEtaBin> etabins = getEtaBins(isub);
450  std::vector<int> missPhi;
451  for (unsigned int bin=0; bin<etabins.size(); ++bin) {
452  std::vector<HcalCellType> temp;
453  std::vector<int> count;
454  std::vector<double> dmin, dmax;
455  for (unsigned int il=0; il<etabins[bin].layer.size(); ++il) {
456  HcalCellType cell(subdet, etabins[bin].ieta, etabins[bin].zside, 0,
458  double foff = (etabins[bin].ieta <= iEtaMax[0]) ? hpar->phioff[0] : hpar->phioff[1];
459  int unit = hcons.unitPhi(etabins[bin].dphi);
460  cell.setPhi(etabins[bin].phis, missPhi, foff, etabins[bin].dphi, unit);
461  temp.push_back(cell);
462  count.push_back(0);
463  dmin.push_back(0);
464  dmax.push_back(0);
465  }
466  int ieta = etabins[bin].ieta;
467  for (int keta=etaSimValu[ieta-1].first; keta<=etaSimValu[ieta-1].second;
468  ++keta) {
469  std::vector<HcalCellType> cellsm = hcons.HcalCellTypes(subdet,keta,-1);
470  for (unsigned int ic=0; ic<cellsm.size(); ++ic) {
471  for (unsigned int il=0; il<etabins[bin].layer.size(); ++il) {
472  if (cellsm[ic].depthSegment() >= etabins[bin].layer[il].first &&
473  cellsm[ic].depthSegment() <= etabins[bin].layer[il].second) {
474  if (count[il] == 0) {
475  temp[il] = cellsm[ic];
476  dmin[il] = cellsm[ic].depthMin();
477  dmax[il] = cellsm[ic].depthMax();
478  }
479  ++count[il];
480  if (cellsm[ic].depthMin() < dmin[il])
481  dmin[il] = cellsm[ic].depthMin();
482  if (cellsm[ic].depthMax() > dmax[il])
483  dmax[il] = cellsm[ic].depthMax();
484  break;
485  }
486  }
487  }
488  }
489  for (unsigned int il=0; il<etabins[bin].layer.size(); ++il) {
490  int depth = etabins[bin].depthStart + (int)(il);
491  temp[il].setEta(ieta,etabins[bin].etaMin,etabins[bin].etaMax);
492  temp[il].setDepth(depth,dmin[il],dmax[il]);
493  cells.push_back(temp[il]);
494  }
495  }
496 #ifdef EDM_ML_DEBUG
497  std::cout << "HcalDDDRecConstants: found " << cells.size() << " cells for sub-detector type " << isub << std::endl;
498  for (unsigned int ic=0; ic<cells.size(); ++ic)
499  std::cout << "Cell[" << ic << "] " << cells[ic] << std::endl;
500 #endif
501  return cells;
502  } else {
503  return hcons.HcalCellTypes(subdet,-1,-1);
504  }
505 }
std::vector< std::pair< int, int > > etaSimValu
const HcalParameters * hpar
std::vector< int > iEtaMax
std::vector< HcalCellType > HcalCellTypes() const
bin
set the eta bin as selection string.
std::vector< double > phioff
int unitPhi(const int det, const int etaR) const
const HcalDDDSimConstants & hcons
std::vector< HcalEtaBin > getEtaBins(const int itype) const
HcalDetId HcalDDDRecConstants::idBack ( const HcalDetId id) const

Definition at line 565 of file HcalDDDRecConstants.cc.

References detIdSpR_.

Referenced by HcalTopology::idBack(), and maxHFDepth().

565  {
566 
567  HcalDetId hid(id);
568  std::map<HcalDetId,std::vector<HcalDetId>>::const_iterator itr = detIdSpR_.find(id);
569  if (itr != detIdSpR_.end())
570  hid = HcalDetId(id.subdet(),id.ieta(),id.iphi(),(itr->second).back().depth());
571  return hid;
572 }
std::map< HcalDetId, std::vector< HcalDetId > > detIdSpR_
HcalDetId HcalDDDRecConstants::idFront ( const HcalDetId id) const

Definition at line 556 of file HcalDDDRecConstants.cc.

References particleFlowClusterECALTimeSelected_cfi::depth, and detIdSpR_.

Referenced by HcalTopology::idFront(), and maxHFDepth().

556  {
557 
558  HcalDetId hid(id);
559  std::map<HcalDetId,std::vector<HcalDetId>>::const_iterator itr = detIdSpR_.find(id);
560  if (itr != detIdSpR_.end())
561  hid = HcalDetId(id.subdet(),id.ieta(),id.iphi(),(itr->second)[0].depth());
562  return hid;
563 }
std::map< HcalDetId, std::vector< HcalDetId > > detIdSpR_
void HcalDDDRecConstants::initialize ( void  )
private

Definition at line 707 of file HcalDDDRecConstants.cc.

References KineDebug3::count(), gather_cfg::cout, particleFlowClusterECALTimeSelected_cfi::depth, depthMaxDf_, depthMaxSp_, detIdSp_, detIdSpR_, HcalParameters::drHB, HcalParameters::dzHE, stringResolutionProvider_cfi::eta, HcalParameters::etagroup, ALCARECOTkAlBeamHalo_cff::etaMax, HcalParameters::etaMax, ALCARECOTkAlBeamHalo_cff::etaMin, HcalParameters::etaMin, EnergyCorrector::etas, etaSimValu, HcalParameters::etaTable, etaTable, HcalParameters::etaTableHF, Exception, plotBeamSpotDB::first, RemoveAddSevLevel::flag, gconsHB, gconsHE, HcalDDDSimConstants::getDepthEta16(), HcalDDDSimConstants::getDepthEta16M(), HcalDDDSimConstants::getDepthEta29M(), HcalLayerDepthMap::getDepths(), HcalLayerDepthMap::getLayerBack(), HcalLayerDepthMap::getLayerFront(), HcalDDDSimConstants::getMaxDepthDet(), HcalBarrel, HcalEndcap, hcons, hpar, mps_fire::i, ietaMap, iEtaMax, iEtaMin, createfilelist::int, gen::k, GetRecoTauVFromDQM_MC_cff::kk, checklumidiff::l, layerGroup(), layerGroupSize(), HcalDDDSimConstants::ldMap(), genParticles_cff::map, HcalParameters::maxDepth, maxDepth, maxLayer_, maxLayerHB_, HcalParameters::modHB, HcalParameters::modHE, DetIdAssociatorESProducer_cff::nEta, nHalves, nModule, HcalParameters::noff, nPhiBins, phi, HcalParameters::phibin, phibin, HcalParameters::phigroup, HcalParameters::phitable, phiUnitS, HcalParameters::rHB, edm::second(), csvLumiCalc::unit, HcalDDDSimConstants::unitPhi(), HcalLayerDepthMap::validDet(), HcalLayerDepthMap::validEta(), HcalParameters::zHE, and HcalDigiParam_cfi::zside.

Referenced by dddConstants(), and HcalDDDRecConstants().

707  {
708 
709  //Eta grouping
710  int nEta = (int)(hpar->etagroup.size());
711  if (nEta != (int)(hpar->phigroup.size())) {
712  edm::LogError("HCalGeom") << "HcalDDDRecConstants: sizes of the vectors "
713  << " etaGroup (" << nEta << ") and phiGroup ("
714  << hpar->phigroup.size() << ") do not match";
715  throw cms::Exception("DDException") << "HcalDDDRecConstants: inconsistent array sizes" << nEta << ":" << hpar->phigroup.size();
716  }
717 
718  // First eta table
719  iEtaMin = hpar->etaMin;
720  iEtaMax = hpar->etaMax;
721  etaTable.clear(); ietaMap.clear(); etaSimValu.clear();
722  int ieta(0), ietaHB(0), ietaHE(0), ietaHEM(0);
723  etaTable.push_back(hpar->etaTable[ieta]);
724  for (int i=0; i<nEta; ++i) {
725  int ef = ieta+1;
726  ieta += (hpar->etagroup[i]);
727  if (ieta >= (int)(hpar->etaTable.size())) {
728  edm::LogError("HCalGeom") << "Going beyond the array boundary "
729  << hpar->etaTable.size() << " at index " << i
730  << " of etaTable from SimConstant";
731  throw cms::Exception("DDException") << "Going beyond the array boundary "
732  << hpar->etaTable.size()
733  << " at index " << i
734  << " of etaTable from SimConstant";
735  } else {
736  etaTable.push_back(hpar->etaTable[ieta]);
737  etaSimValu.push_back(std::pair<int,int>(ef,ieta));
738  }
739  for (int k=0; k<(hpar->etagroup[i]); ++k) ietaMap.push_back(i+1);
740  if (ieta <= hpar->etaMax[0]) ietaHB = i+1;
741  if (ieta <= hpar->etaMin[1]) ietaHE = i+1;
742  if (ieta <= hpar->etaMax[1]) ietaHEM= i+1;
743  }
744  iEtaMin[1] = ietaHE;
745  iEtaMax[0] = ietaHB;
746  iEtaMax[1] = ietaHEM;
747 
748  // Then Phi bins
749  nPhiBins.clear();
750  for (unsigned int k=0; k<4; ++k) nPhiBins.push_back(0);
751  ieta = 0;
752  phibin.clear(); phiUnitS.clear();
753  for (int i=0; i<nEta; ++i) {
754  double dphi = (hpar->phigroup[i])*(hpar->phibin[ieta]);
755  phibin.push_back(dphi);
756  int nphi = (int)((CLHEP::twopi + 0.001)/dphi);
757  if (ieta <= iEtaMax[0]) {
758  if (nphi > nPhiBins[0]) nPhiBins[3] = nPhiBins[0] = nphi;
759  }
760  if (ieta >= iEtaMin[1]) {
761  if (nphi > nPhiBins[1]) nPhiBins[1] = nphi;
762  }
763  ieta += (hpar->etagroup[i]);
764  }
765  for (unsigned int i=1; i<hpar->etaTable.size(); ++i) {
766  int unit = hcons.unitPhi(hpar->phibin[i-1]);
767  phiUnitS.push_back(unit);
768  }
769  for (unsigned int i=0; i<hpar->phitable.size(); ++i) {
770  int nphi = (int)((CLHEP::twopi + 0.001)/hpar->phitable[i]);
771  if (nphi > nPhiBins[2]) nPhiBins[2] = nphi;
772  }
773 #ifdef EDM_ML_DEBUG
774  std::cout << "Modified eta/deltaphi table for " << nEta << " bins" << std::endl;
775  for (int i=0; i<nEta; ++i)
776  std::cout << "Eta[" << i << "] = " << etaTable[i] << ":" << etaTable[i+1]
777  << ":" << etaSimValu[i].first << ":" << etaSimValu[i].second
778  << " PhiBin[" << i << "] = " << phibin[i]/CLHEP::deg <<std::endl;
779  std::cout << "PhiUnitS";
780  for (unsigned int i=0; i<phiUnitS.size(); ++i)
781  std::cout << " [" << i << "] = " << phiUnitS[i];
782  std::cout << std::endl;
783  std::cout << "nPhiBins";
784  for (unsigned int i=0; i<nPhiBins.size(); ++i)
785  std::cout << " [" << i << "] = " << nPhiBins[i];
786  std::cout << std::endl;
787  std::cout << "EtaTableHF";
788  for (unsigned int i=0; i<hpar->etaTableHF.size(); ++i)
789  std::cout << " [" << i << "] = " << hpar->etaTableHF[i];
790  std::cout << std::endl;
791  std::cout << "PhiBinHF";
792  for (unsigned int i=0; i<hpar->phitable.size(); ++i)
793  std::cout << " [" << i << "] = " << hpar->phitable[i];
794  std::cout << std::endl;
795 #endif
796 
797  //Now the depths
799  maxDepth[0] = maxDepth[1] = 0;
800  for (int i=0; i<nEta; ++i) {
801  unsigned int imx = layerGroupSize(i);
802  int laymax = (imx > 0) ? layerGroup(i,imx-1) : 0;
803  if (i < iEtaMax[0]) {
804  int laymax0 = (imx > 16) ? layerGroup(i,16) : laymax;
805  if (i+1 == iEtaMax[0]) laymax0 = hcons.getDepthEta16M(1);
806 #ifdef EDM_ML_DEBUG
807  std::cout << "HB " << i << " " << imx << " " << laymax << " " << laymax0 << std::endl;
808 #endif
809  if (maxDepth[0] < laymax0) maxDepth[0] = laymax0;
810  }
811  if (i >= iEtaMin[1]-1 && i < iEtaMax[1]) {
812 #ifdef EDM_ML_DEBUG
813  std::cout << "HE " << i << " " << imx << " " << laymax << std::endl;
814 #endif
815  if (maxDepth[1] < laymax) maxDepth[1] = laymax;
816  }
817  }
818 #ifdef EDM_ML_DEBUG
819  for (int i=0; i<4; ++i)
820  std::cout << "Detector Type[" << i << "] iEta " << iEtaMin[i] << ":"
821  << iEtaMax[i] << " MaxDepth " << maxDepth[i] << std::endl;
822 #endif
823 
824  //Now the geometry constants
825  nModule[0] = hpar->modHB[0];
826  nHalves[0] = hpar->modHB[1];
827  for (unsigned int i=0; i<hpar->rHB.size(); ++i) {
828  gconsHB.push_back(std::pair<double,double>(hpar->rHB[i]/CLHEP::cm,
829  hpar->drHB[i]/CLHEP::cm));
830  }
831 #ifdef EDM_ML_DEBUG
832  std::cout << "HB with " << nModule[0] << " modules and " << nHalves[0]
833  <<" halves and " << gconsHB.size() << " layers" << std::endl;
834  for (unsigned int i=0; i<gconsHB.size(); ++i)
835  std::cout << "rHB[" << i << "] = " << gconsHB[i].first << " +- "
836  << gconsHB[i].second << std::endl;
837 #endif
838  nModule[1] = hpar->modHE[0];
839  nHalves[1] = hpar->modHE[1];
840  for (unsigned int i=0; i<hpar->zHE.size(); ++i) {
841  gconsHE.push_back(std::pair<double,double>(hpar->zHE[i]/CLHEP::cm,
842  hpar->dzHE[i]/CLHEP::cm));
843  }
844 #ifdef EDM_ML_DEBUG
845  std::cout << "HE with " << nModule[1] << " modules and " << nHalves[1]
846  <<" halves and " << gconsHE.size() << " layers" << std::endl;
847  for (unsigned int i=0; i<gconsHE.size(); ++i)
848  std::cout << "zHE[" << i << "] = " << gconsHE[i].first << " +- "
849  << gconsHE[i].second << std::endl;
850 #endif
851 
852  //Special RBX
854  if (depthMaxSp_.first == 0) {
855  depthMaxSp_ = depthMaxDf_ = std::pair<int,int>(2,maxDepth[1]);
856  } else if (depthMaxSp_.first == 1) {
857  depthMaxDf_ = std::pair<int,int>(1,maxDepth[0]);
858  if (depthMaxSp_.second > maxDepth[0]) maxDepth[0] = depthMaxSp_.second;
859  } else {
860  depthMaxDf_ = std::pair<int,int>(2,maxDepth[1]);
861  if (depthMaxSp_.second > maxDepth[1]) maxDepth[1] = depthMaxSp_.second;
862  }
863 #ifdef EDM_ML_DEBUG
864  std::cout << "Detector type and maximum depth for all RBX "
865  << depthMaxDf_.first << ":" << depthMaxDf_.second
866  << " and for special RBX " << depthMaxSp_.first << ":"
867  << depthMaxSp_.second << std::endl;
868 #endif
869 
870  //Map of special DetId's
871  std::vector<int> phis;
873  detIdSp_.clear(); detIdSpR_.clear();
874  if ((subdet == HcalBarrel) || (subdet == HcalEndcap)) {
875  int phi = (phis[0] > 0) ? phis[0] : -phis[0];
876  int zside = (phis[0] > 0) ? 1 : -1;
877  int lymax = (subdet == HcalBarrel) ? maxLayerHB_+1 : maxLayer_+1;
878  std::pair<int,int>etas = hcons.ldMap()->validEta();
879  for (int eta=etas.first; eta<=etas.second; ++eta) {
880  std::map<int,std::pair<int,int> > oldDep;
881  int depth(0);
882  int lmin = layerGroup(eta-1,0);
883  for (int lay=0; lay<lymax; ++lay) {
884  int depc = layerGroup(eta-1,lay);
885  if (depth != depc) {
886  if (depth != 0) oldDep[depth] = std::pair<int,int>(lmin,lay-1);
887  depth = depc;
888  lmin = lay;
889  }
890  }
891  if (depth != 0) oldDep[depth] = std::pair<int,int>(lmin,lymax-1);
892 #ifdef EDM_ML_DEBUG
893  std::cout << "Eta|Phi|Zside " << eta << ":" << phi << ":" << zside
894  << " with " << oldDep.size() << " old Depths" << std::endl;
895  unsigned int kk(0);
896  for (std::map<int,std::pair<int,int> >::const_iterator itr=oldDep.begin(); itr != oldDep.end(); ++itr,++kk)
897  std::cout << "[" << kk << "] " << itr->first << " --> "
898  << itr->second.first << ":" << itr->second.second << "\n";
899 #endif
900  std::pair<int,int> depths = hcons.ldMap()->getDepths(eta);
901  for (int ndepth=depths.first; ndepth<=depths.second; ++ndepth) {
902  bool flag = ((subdet == HcalBarrel && eta == iEtaMax[0] &&
903  ndepth > hcons.getDepthEta16(subdet,phi,zside)) ||
904  (subdet == HcalEndcap && eta == iEtaMin[1] &&
905  ndepth < hcons.getDepthEta16(subdet,phi,zside)));
906  if (!flag) {
907  std::vector<int> count(oldDep.size(),0);
908  int layFront = hcons.ldMap()->getLayerFront(subdet,eta,phi,zside,ndepth);
909  int layBack = hcons.ldMap()->getLayerBack(subdet,eta,phi,zside,ndepth);
910  for (int lay=layFront; lay<=layBack; ++lay) {
911  unsigned int l(0);
912  for (std::map<int,std::pair<int,int> >::iterator itr=oldDep.begin();
913  itr != oldDep.end(); ++itr,++l) {
914  if (lay >= (itr->second).first && lay <= (itr->second).second) {
915  ++count[l]; break;
916  }
917  }
918  }
919  int odepth(0), maxlay(0);
920  unsigned int l(0);
921  for (std::map<int,std::pair<int,int> >::iterator itr=oldDep.begin();
922  itr != oldDep.end(); ++itr,++l) {
923  if (count[l] > maxlay) {
924  odepth = itr->first;
925  maxlay = count[l];
926  }
927  }
928 #ifdef EDM_ML_DEBUG
929  std::cout << "New Depth " << ndepth << " old Depth " << odepth
930  << " max " << maxlay << std::endl;
931 #endif
932  for (unsigned int k=0; k<phis.size(); ++k) {
933  zside = (phis[k] > 0) ? 1 : -1;
934  phi = (phis[k] > 0) ? phis[k] : -phis[k];
935  if (subdet == HcalEndcap && eta == hpar->noff[1] &&
936  ndepth > hcons.getDepthEta29M(0,true)) break;
937  HcalDetId newId(subdet,zside*eta,phi,ndepth);
938  HcalDetId oldId(subdet,zside*eta,phi,odepth);
939  detIdSp_[newId] = oldId;
940  std::vector<HcalDetId> ids;
941  std::map<HcalDetId,std::vector<HcalDetId>>::iterator itr = detIdSpR_.find(oldId);
942  if (itr != detIdSpR_.end()) ids = itr->second;
943  ids.push_back(newId);
944  detIdSpR_[oldId] = ids;
945  }
946  }
947  }
948  }
949 #ifdef EDM_ML_DEBUG
950  std::cout << "Map for merging new channels to old channel IDs with "
951  << detIdSp_.size() << " entries" << std::endl;
952  int l(0);
953  for (std::map<HcalDetId,HcalDetId>::const_iterator itr=detIdSp_.begin();
954  itr != detIdSp_.end(); ++itr,++l) {
955  std::cout << "[" << l << "] Special " << itr->first << " Standard "
956  << itr->second << std::endl;
957  }
958  std::cout << "Reverse Map for mapping old to new IDs with "
959  << detIdSpR_.size() << " entries" << std::endl;
960  l = 0;
961  for (std::map<HcalDetId,std::vector<HcalDetId> >::const_iterator itr=detIdSpR_.begin();
962  itr != detIdSpR_.end(); ++itr,++l) {
963  std::cout << "[" << l << "] Standard " << itr->first << " Special";
964  for (unsigned int k=0; k < itr->second.size(); ++k)
965  std::cout << " " << (itr->second)[k];
966  std::cout << std::endl;
967  }
968 #endif
969  }
970 
971 }
std::pair< int, int > getMaxDepthDet(const int i) const
std::vector< double > etaTable
std::vector< int > iEtaMin
std::vector< int > etagroup
std::pair< int, int > depthMaxSp_
std::map< HcalDetId, std::vector< HcalDetId > > detIdSpR_
std::vector< double > rHB
std::vector< std::pair< int, int > > etaSimValu
unsigned int layerGroup(int eta, int i) const
static const int maxLayer_
std::vector< int > maxDepth
std::vector< double > etaTableHF
int getLayerBack(const int subdet, const int ieta, const int iphi, const int zside, const int depth) const
std::vector< int > etaMax
std::vector< int > phiUnitS
std::vector< int > modHB
int getDepthEta29M(const int i, const bool planOne) const
int getLayerFront(const int subdet, const int ieta, const int iphi, const int zside, const int depth) const
U second(std::pair< T, U > const &p)
const HcalParameters * hpar
std::pair< int, int > getDepths(const int eta) const
int validDet(std::vector< int > &phis) const
std::vector< std::pair< double, double > > gconsHE
std::vector< double > zHE
std::vector< double > phibin
std::vector< double > dzHE
std::vector< int > iEtaMax
HcalSubdetector
Definition: HcalAssistant.h:31
std::map< HcalDetId, HcalDetId > detIdSp_
std::vector< int > ietaMap
std::vector< int > nPhiBins
std::vector< int > modHE
std::pair< int, int > validEta() const
int getDepthEta16(const int det, const int phi, const int zside) const
int k[5][pyjets_maxn]
unsigned int layerGroupSize(int eta) const
std::vector< double > etaTable
std::vector< double > phitable
int getDepthEta16M(const int det) const
std::vector< double > phibin
int unitPhi(const int det, const int etaR) const
std::vector< double > drHB
const HcalDDDSimConstants & hcons
std::pair< int, int > depthMaxDf_
std::vector< int > noff
std::vector< std::pair< double, double > > gconsHB
std::vector< int > maxDepth
std::vector< int > phigroup
static const int maxLayerHB_
std::vector< int > etaMin
const HcalLayerDepthMap * ldMap() const
bool HcalDDDRecConstants::isBH ( ) const
inline
bool HcalDDDRecConstants::isPlan1 ( const HcalDetId id) const
inline

Definition at line 103 of file HcalDDDRecConstants.h.

References detIdSp_.

Referenced by CaloTPGTranscoderULUT::setup(), and HcaluLUTTPGCoder::update().

103 { return detIdSp_.find(id) != detIdSp_.end(); };
std::map< HcalDetId, HcalDetId > detIdSp_
bool HcalDDDRecConstants::isPlan1MergedId ( const HcalDetId id) const
inline

Definition at line 119 of file HcalDDDRecConstants.h.

References detIdSpR_.

Referenced by HcalTopology::validHcal().

119 { return detIdSpR_.find(id) != detIdSpR_.end(); };
std::map< HcalDetId, std::vector< HcalDetId > > detIdSpR_
bool HcalDDDRecConstants::isPlan1ToBeMergedId ( const HcalDetId id) const
inline

Definition at line 118 of file HcalDDDRecConstants.h.

References detIdSp_.

Referenced by HcalTopology::validHcal().

118 { return detIdSp_.find(id) != detIdSp_.end(); };
std::map< HcalDetId, HcalDetId > detIdSp_
unsigned int HcalDDDRecConstants::layerGroup ( int  eta,
int  i 
) const
private

Definition at line 985 of file HcalDDDRecConstants.cc.

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

Referenced by dddConstants(), getHCID(), getLayerDepth(), getMaxDepth(), getMinDepth(), getRZ(), and initialize().

986  {
987  unsigned int k = 0;
988  for (auto const & it : hpar->layerGroupEtaRec) {
989  if (it.layer == (unsigned int)(eta + 1)) {
990  return it.layerGroup.at(i);
991  }
992  if (it.layer > (unsigned int)(eta + 1)) break;
993  k = it.layerGroup.at(i);
994  }
995  return k;
996 }
const HcalParameters * hpar
int k[5][pyjets_maxn]
std::vector< LayerItem > layerGroupEtaRec
unsigned int HcalDDDRecConstants::layerGroupSize ( int  eta) const
private

Definition at line 973 of file HcalDDDRecConstants.cc.

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

Referenced by dddConstants(), getLayerDepth(), getMaxDepth(), getMinDepth(), getRZ(), and initialize().

973  {
974  unsigned int k = 0;
975  for (auto const & it : hpar->layerGroupEtaRec) {
976  if (it.layer == (unsigned int)(eta + 1)) {
977  return it.layerGroup.size();
978  }
979  if (it.layer > (unsigned int)(eta + 1)) break;
980  k = it.layerGroup.size();
981  }
982  return k;
983 }
const HcalParameters * hpar
int k[5][pyjets_maxn]
std::vector< LayerItem > layerGroupEtaRec
int HcalDDDRecConstants::maxHFDepth ( int  ieta,
int  iphi 
) const
inline

Definition at line 104 of file HcalDDDRecConstants.h.

References RemoveAddSevLevel::flag, hcons, idBack(), idFront(), HcalDDDSimConstants::maxHFDepth(), mergedDepthDetId(), nCells(), numberOfCells(), specialRBXHBHE(), and unmergeDepthDetId().

Referenced by HcalTopology::validRaw().

104 {return hcons.maxHFDepth(ieta,iphi);}
int maxHFDepth(const int ieta, const int iphi) const
const HcalDDDSimConstants & hcons
HcalDetId HcalDDDRecConstants::mergedDepthDetId ( const HcalDetId id) const

Definition at line 549 of file HcalDDDRecConstants.cc.

References detIdSp_.

Referenced by maxHFDepth(), and HcalTopology::mergedDepthDetId().

549  {
550 
551  std::map<HcalDetId,HcalDetId>::const_iterator itr = detIdSp_.find(id);
552  if (itr == detIdSp_.end()) return id;
553  else return itr->second;
554 }
std::map< HcalDetId, HcalDetId > detIdSp_
unsigned int HcalDDDRecConstants::nCells ( HcalSubdetector  subdet) const

Definition at line 526 of file HcalDDDRecConstants.cc.

References getEtaBins(), HcalBarrel, HcalEndcap, HcalForward, HcalOuter, hcons, mps_fire::i, kHOSizePreLS1, and HcalDDDSimConstants::numberOfCells().

526  {
527 
528  if (subdet == HcalBarrel || subdet == HcalEndcap) {
529  int isub = (subdet == HcalBarrel) ? 0 : 1;
530  std::vector<HcalDDDRecConstants::HcalEtaBin> etabins = getEtaBins(isub);
531  unsigned int ncell(0);
532  for (unsigned int i=0; i<etabins.size(); ++i) {
533  ncell += ((etabins[i].phis.size())*(etabins[i].layer.size()));
534  }
535  return ncell;
536  } else if (subdet == HcalOuter) {
537  return kHOSizePreLS1;
538  } else if (subdet == HcalForward) {
539  return (unsigned int)(hcons.numberOfCells(subdet));
540  } else {
541  return 0;
542  }
543 }
unsigned int numberOfCells(HcalSubdetector) const
const HcalDDDSimConstants & hcons
std::vector< HcalEtaBin > getEtaBins(const int itype) const
unsigned int HcalDDDRecConstants::nCells ( ) const

Definition at line 545 of file HcalDDDRecConstants.cc.

References HcalBarrel, HcalEndcap, HcalForward, and HcalOuter.

Referenced by maxHFDepth().

unsigned int HcalDDDRecConstants::numberOfCells ( HcalSubdetector  subdet) const

Definition at line 507 of file HcalDDDRecConstants.cc.

References HcalBarrel, HcalCellTypes(), HcalEndcap, hcons, mps_fire::i, createfilelist::int, nPhiBins, pileupDistInMC::num, and HcalDDDSimConstants::numberOfCells().

Referenced by HcalDDDGeometryLoader::load(), and maxHFDepth().

507  {
508 
509  if (subdet == HcalBarrel || subdet == HcalEndcap) {
510  unsigned int num = 0;
511  std::vector<HcalCellType> cellTypes = HcalCellTypes(subdet);
512  for (unsigned int i=0; i<cellTypes.size(); i++) {
513  num += (unsigned int)(cellTypes[i].nPhiBins());
514  }
515 #ifdef EDM_ML_DEBUG
516  edm::LogInfo ("HCalGeom") << "HcalDDDRecConstants:numberOfCells "
517  << cellTypes.size() << " " << num
518  << " for subdetector " << subdet;
519 #endif
520  return num;
521  } else {
522  return hcons.numberOfCells(subdet);
523  }
524 }
unsigned int numberOfCells(HcalSubdetector) const
std::vector< int > nPhiBins
std::vector< HcalCellType > HcalCellTypes(HcalSubdetector) const
const HcalDDDSimConstants & hcons
void HcalDDDRecConstants::specialRBXHBHE ( const std::vector< HcalDetId > &  idsOld,
std::vector< HcalDetId > &  idsNew 
) const

Definition at line 589 of file HcalDDDRecConstants.cc.

References detIdSp_, and gen::k.

Referenced by maxHFDepth().

590  {
591  for (unsigned int k=0; k<idsOld.size(); ++k) {
592  std::map<HcalDetId,HcalDetId>::const_iterator itr = detIdSp_.find(idsOld[k]);
593  if (itr == detIdSp_.end()) idsNew.push_back(idsOld[k]);
594  else idsNew.push_back(itr->second);
595  }
596 }
std::map< HcalDetId, HcalDetId > detIdSp_
int k[5][pyjets_maxn]
bool HcalDDDRecConstants::specialRBXHBHE ( const bool  flag,
std::vector< HcalDetId > &  ids 
) const

Definition at line 598 of file HcalDDDRecConstants.cc.

References detIdSp_, and detIdSpR_.

599  {
600  if (tobemerged) {
601  std::map<HcalDetId,HcalDetId>::const_iterator itr;
602  for (itr = detIdSp_.begin(); itr != detIdSp_.end(); ++itr)
603  ids.push_back(itr->first);
604  } else{
605  std::map<HcalDetId,std::vector<HcalDetId>>::const_iterator itr;
606  for (itr = detIdSpR_.begin(); itr != detIdSpR_.end(); ++itr)
607  ids.push_back(itr->first);
608  }
609  return (ids.size() > 0);
610 }
std::map< HcalDetId, std::vector< HcalDetId > > detIdSpR_
std::map< HcalDetId, HcalDetId > detIdSp_
void HcalDDDRecConstants::unmergeDepthDetId ( const HcalDetId id,
std::vector< HcalDetId > &  ids 
) const

Definition at line 574 of file HcalDDDRecConstants.cc.

References detIdSpR_, and gen::k.

Referenced by maxHFDepth(), and HcalTopology::unmergeDepthDetId().

575  {
576 
577  ids.clear();
578  std::map<HcalDetId,std::vector<HcalDetId>>::const_iterator itr = detIdSpR_.find(id);
579  if (itr == detIdSpR_.end()) {
580  ids.push_back(id);
581  } else {
582  for (unsigned k=0; k<itr->second.size(); ++k) {
583  HcalDetId hid(id.subdet(),id.ieta(),id.iphi(),(itr->second)[k].depth());
584  ids.push_back(hid);
585  }
586  }
587 }
std::map< HcalDetId, std::vector< HcalDetId > > detIdSpR_
int k[5][pyjets_maxn]
bool HcalDDDRecConstants::withSpecialRBXHBHE ( ) const
inline

Definition at line 117 of file HcalDDDRecConstants.h.

References HcalLayerDepthMap::getSubdet(), hcons, and HcalDDDSimConstants::ldMap().

Referenced by HcalTopology::withSpecialRBXHBHE().

117 {return (hcons.ldMap()->getSubdet() != 0);}
int getSubdet() const
const HcalDDDSimConstants & hcons
const HcalLayerDepthMap * ldMap() const

Member Data Documentation

std::pair<int,int> HcalDDDRecConstants::depthMaxDf_
private

Definition at line 147 of file HcalDDDRecConstants.h.

Referenced by initialize().

std::pair<int,int> HcalDDDRecConstants::depthMaxSp_
private

Definition at line 147 of file HcalDDDRecConstants.h.

Referenced by initialize().

std::map<HcalDetId,HcalDetId> HcalDDDRecConstants::detIdSp_
private
std::map<HcalDetId,std::vector<HcalDetId> > HcalDDDRecConstants::detIdSpR_
private
std::vector<std::pair<int,int> > HcalDDDRecConstants::etaSimValu
private

Definition at line 136 of file HcalDDDRecConstants.h.

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

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

Definition at line 137 of file HcalDDDRecConstants.h.

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

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

Definition at line 144 of file HcalDDDRecConstants.h.

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

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

Definition at line 145 of file HcalDDDRecConstants.h.

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

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

Definition at line 138 of file HcalDDDRecConstants.h.

Referenced by getHCID(), and initialize().

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

Definition at line 140 of file HcalDDDRecConstants.h.

Referenced by getHFCellParameters(), getMaxDepth(), getMinDepth(), and initialize().

const int HcalDDDRecConstants::maxLayer_ =18
staticprivate

Definition at line 132 of file HcalDDDRecConstants.h.

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

const int HcalDDDRecConstants::maxLayerHB_ =16
staticprivate

Definition at line 133 of file HcalDDDRecConstants.h.

Referenced by getHCID(), getMaxDepth(), getOneEtaBin(), and initialize().

int HcalDDDRecConstants::nHalves[2]
private

Definition at line 146 of file HcalDDDRecConstants.h.

Referenced by initialize().

int HcalDDDRecConstants::nModule[2]
private

Definition at line 146 of file HcalDDDRecConstants.h.

Referenced by initialize().

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

Definition at line 141 of file HcalDDDRecConstants.h.

Referenced by getNPhi(), initialize(), and numberOfCells().

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

Definition at line 143 of file HcalDDDRecConstants.h.

Referenced by getHCID(), and initialize().