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
 
int getDepthEta29 (const int &iphi, const int &zside, const int &type) const
 
std::vector< HcalEtaBingetEtaBins (const int &itype) const
 
std::pair< double, double > getEtaLimit (const int &i) const
 
std::pair< double, double > getEtaPhi (const int &subdet, const int &ieta, const 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 (const int &det, const int &phi, const int &zside) const
 
void getLayerDepth (const int &ieta, std::map< int, int > &layers) const
 
int getLayerFront (const int &det, const int &eta, const int &phi, const int &depth) 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 (const int &subdet, const 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 (const int &subdet, const int &ieta, const int &depth) const
 
double getRZ (const int &subdet, const int &ieta, const int &iphi, const int &depth) const
 
double getRZ (const int &subdet, const int &layer) 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 (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 129 of file HcalDDDRecConstants.h.

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

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

Definition at line 61 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().

61  {
62  if (type == 0) return gconsHB;
63  else if (type == 1) return gconsHE;
64  else {std::vector<std::pair<double,double> > gcons; return gcons;}
65  }
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().

51  {
52  std::map<int,int> layers;
53  hcons.ldMap()->getLayerDepth(det, eta+1, phi, zside, layers);
54  if (layers.empty()) {
55  return getDepth(eta, false);
56  } else {
57  std::vector<int> depths;
58  for (unsigned int lay=0; lay < layers.size(); ++lay)
59  depths.emplace_back(layers[lay+1]);
60  return depths;
61  }
62 }
std::vector< int > getDepth(const int &det, const int &phi, const int &zside, const unsigned int &eta) const
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 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.emplace_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 69 of file HcalDDDRecConstants.h.

References HcalDDDSimConstants::getDepthEta16(), and hcons.

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

70  {return hcons.getDepthEta16(det,iphi,zside);}
const HcalDDDSimConstants & hcons
int getDepthEta16(const int &det, const int &phi, const int &zside) const
int HcalDDDRecConstants::getDepthEta29 ( const int &  iphi,
const int &  zside,
const int &  type 
) const
inline

Definition at line 71 of file HcalDDDRecConstants.h.

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

Referenced by HcalTopology::decrementDepth().

72  {return hcons.getDepthEta29(iphi,zside,type);}
type
Definition: HCALResponse.h:21
int getDepthEta29(const int &phi, const int &zside, const int &i) const
const HcalDDDSimConstants & hcons
std::vector< HcalDDDRecConstants::HcalEtaBin > HcalDDDRecConstants::getEtaBins ( const int &  itype) const

Definition at line 65 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(), phi, edm::second(), HcalLayerDepthMap::validDet(), and HcalDigiParam_cfi::zside.

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

65  {
66 
67  std::vector<HcalDDDRecConstants::HcalEtaBin> bins;
68  unsigned int type = (itype == 0) ? 0 : 1;
69  HcalSubdetector subdet = HcalSubdetector(type+1);
70  std::vector<int> phiSp;
71  HcalSubdetector subdetSp = HcalSubdetector(hcons.ldMap()->validDet(phiSp));
72  std::map<int,int> layers;
73  for (int iz=0; iz<2; ++iz) {
74  int zside = 2*iz - 1;
75  for (int ieta = iEtaMin[type]; ieta <= iEtaMax[type]; ++ieta) {
76  std::vector<std::pair<int,double> > phis = getPhis(subdet,ieta);
77  std::vector<std::pair<int,double> > phiUse;
78  getLayerDepth(ieta,layers);
79  if (subdet == subdetSp) {
80  for (auto & phi : phis) {
81  if (std::find(phiSp.begin(),phiSp.end(),(zside*phi.first)) ==
82  phiSp.end()){
83  phiUse.emplace_back(phi);
84  }
85  }
86  } else {
87  phiUse.insert(phiUse.end(),phis.begin(),phis.end());
88  }
89  getOneEtaBin(subdet,ieta,zside,phiUse,layers,false,bins);
90  }
91  }
92  if (subdetSp == subdet) {
93  for (int ieta = iEtaMin[type]; ieta <= iEtaMax[type]; ++ieta) {
94  std::vector<std::pair<int,double> > phis = getPhis(subdet,ieta);
95  for (int iz=0; iz<2; ++iz) {
96  int zside = 2*iz - 1;
97  std::vector<std::pair<int,double> > phiUse;
98  for (int i : phiSp) {
99  for (auto & phi : phis) {
100  if (i == zside*phi.first) {
101  phiUse.emplace_back(phi);
102  break;
103  }
104  }
105  }
106  if (!phiUse.empty()) {
107  hcons.ldMap()->getLayerDepth(subdet,ieta,phiUse[0].first,zside,layers);
108  getOneEtaBin(subdet,ieta,zside,phiUse,layers,true,bins);
109  }
110  }
111  }
112  }
113 #ifdef EDM_ML_DEBUG
114  std::cout << "Prepares " << bins.size() << " eta bins for type " << type
115  << std::endl;
116  for (unsigned int i=0; i<bins.size(); ++i) {
117  std::cout << "Bin[" << i << "]: Eta = (" << bins[i].ieta << ":"
118  << bins[i].etaMin << ":" << bins[i].etaMax << "), Zside = "
119  << bins[i].zside << ", phis = (" << bins[i].phis.size() << ":"
120  << bins[i].dphi << ") and " << bins[i].layer.size()
121  << " depths (start) " << bins[i].depthStart << " :";
122  for (unsigned int k=0; k<bins[i].layer.size(); ++k)
123  std::cout << " [" << k << "] " << bins[i].layer[k].first << ":"
124  << bins[i].layer[k].second;
125  std::cout << std::endl << " and Phi sets";
126  for (unsigned int k=0; k<bins[i].phis.size(); ++k)
127  std::cout << " " << bins[i].phis[k].first << ":" <<bins[i].phis[k].second;
128  std::cout << std::endl;
129  }
130 #endif
131  return bins;
132 }
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
U second(std::pair< T, U > const &p)
int validDet(std::vector< int > &phis) const
std::vector< int > iEtaMax
HcalSubdetector
Definition: HcalAssistant.h:31
void getLayerDepth(const int &ieta, std::map< int, int > &layers) const
std::vector< std::pair< int, double > > getPhis(const int &subdet, const int &ieta) const
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 79 of file HcalDDDRecConstants.h.

References HcalDDDRecConstants::HcalID::depth, etaTable, getHCID(), getHFCellParameters(), getLayerDepth(), getLayerFront(), mps_fire::i, and LayerTriplets::layers().

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

Definition at line 135 of file HcalDDDRecConstants.cc.

References gather_cfg::cout, PVValHelper::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 getDepthEta29().

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

References etaTable.

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

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

Definition at line 78 of file HcalDDDRecConstants.h.

References HcalParameters::etaTableHF, and hpar.

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

78 {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 164 of file HcalDDDRecConstants.cc.

References gather_cfg::cout, particleFlowClusterECALTimeSelected_cfi::depth, PVValHelper::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(), getEtaLimit(), and HcalHitRelabeller::relabel().

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

Definition at line 217 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().

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

Definition at line 86 of file HcalDDDRecConstants.h.

References HcalDDDSimConstants::getLayer0Wt(), and hcons.

Referenced by HcalHitRelabeller::energyWt().

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

Definition at line 274 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::getLayerFront ( const int &  det,
const int &  eta,
const int &  phi,
const int &  depth 
) const

Definition at line 290 of file HcalDDDRecConstants.cc.

References gather_cfg::cout, PVValHelper::eta, ALCARECOTkAlBeamHalo_cff::etaMax, HcalDDDSimConstants::getFrontLayer(), HcalLayerDepthMap::getLayerFront(), HcalEndcap, hcons, gen::k, layerGroup(), layerGroupSize(), HcalDDDSimConstants::ldMap(), and HcalDigiParam_cfi::zside.

Referenced by getEtaLimit(), getRZ(), and getThickActive().

291  {
292  int subdet = (idet == 1) ? 1 : 2;
293  int zside = (ieta > 0) ? 1 : -1;
294  int eta = zside*ieta;
295  int layFront = hcons.ldMap()->getLayerFront(subdet,eta,iphi,zside,depth);
296  int laymin = hcons.getFrontLayer(subdet, ieta);
297  if ((layFront < 0) ||
298  ((subdet == static_cast<int>(HcalEndcap)) && (eta == 16))) {
299  if ((subdet == static_cast<int>(HcalEndcap)) && (eta == 16)) {
300  layFront = laymin;
301  } else if (eta <= hpar->etaMax[1]) {
302  for (unsigned int k=0; k<layerGroupSize(eta-1); ++k) {
303  if (depth == (int)layerGroup(eta-1, k)) {
304  if ((int)(k) >= laymin) {
305  layFront = k;
306  break;
307  }
308  }
309  }
310  }
311  } else {
312  if (layFront < laymin) layFront = laymin;
313  }
314 #ifdef EDM_ML_DEBUG
315  std::cout << "getLayerFront::Input " << idet << ":" << ieta << ":"
316  << iphi << ":" << depth << " Output " << layFront << std::endl;
317 #endif
318  return layFront;
319 }
int getFrontLayer(const int &det, const int &eta) const
unsigned int layerGroup(int eta, int i) const
int getLayerFront(const int subdet, const int ieta, const int iphi, const int zside, const int depth) const
int k[5][pyjets_maxn]
unsigned int layerGroupSize(int eta) const
const HcalDDDSimConstants & hcons
const HcalLayerDepthMap * ldMap() 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 321 of file HcalDDDRecConstants.cc.

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

322  {
323 
324  unsigned int type = (itype == 0) ? 0 : 1;
325  int lmax = hcons.getMaxDepth(type+1, ieta, iphi, zside, true);
326  if (lmax < 0) {
327  unsigned int lymax = (type == 0) ? maxLayerHB_+1 : maxLayer_+1;
328  lmax = 0;
329  if (layerGroupSize(ieta-1) > 0) {
330  if (layerGroupSize(ieta-1) < lymax) lymax = layerGroupSize(ieta-1);
331  lmax = (int)(layerGroup(ieta-1, lymax-1));
332  if (type == 0 && ieta == iEtaMax[type]) lmax = hcons.getDepthEta16M(1);
333  if (type == 1 && ieta >= hpar->noff[1]) lmax = hcons.getDepthEta29M(0,false);
334  }
335  }
336 #ifdef EDM_ML_DEBUG
337  std::cout << "getMaxDepth::Input " << itype << ":" << ieta << ":"
338  << iphi << ":" << zside << " Output " << lmax << std::endl;
339 #endif
340  return lmax;
341 }
type
Definition: HCALResponse.h:21
unsigned int layerGroup(int eta, int i) const
static const int maxLayer_
const HcalParameters * hpar
int getMaxDepth(const int &type) const
std::vector< int > iEtaMax
int getDepthEta16M(const int &det) const
int getDepthEta29M(const int &i, const bool &planOne) const
unsigned int layerGroupSize(int eta) 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 343 of file HcalDDDRecConstants.cc.

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

Referenced by HcalHBHEMuonSimAnalyzer::analyze(), HcalRaddamMuon::analyze(), HcalHBHEMuonAnalyzer::depth16HE(), HcalTopology::depthBinInformation(), HcalGeometry::getClosestCell(), and getMaxDepth().

344  {
345 
346  int lmin = hcons.getMinDepth(itype+1, ieta, iphi, zside, true);
347  if (lmin < 0) {
348  if (itype == 2) { // HFn
349  lmin = 1;
350  } else if (itype == 3) { //HO
351  lmin = maxDepth[3];
352  } else {
353  unsigned int type = (itype == 0) ? 0 : 1;
354  if (layerGroupSize(ieta-1) > 0) {
355  if (type == 1 && ieta == iEtaMin[type])
356  lmin = hcons.getDepthEta16M(2);
357  else
358  lmin = (int)(layerGroup(ieta-1, 0));
359  }
360  }
361  }
362  return lmin;
363 }
type
Definition: HCALResponse.h:21
std::vector< int > iEtaMin
int getMinDepth(const int &det, const int &eta, const int &phi, const int &zside, const bool &partialOnly) const
unsigned int layerGroup(int eta, int i) const
std::vector< int > maxDepth
int getDepthEta16M(const int &det) const
unsigned int layerGroupSize(int eta) const
const HcalDDDSimConstants & hcons
int HcalDDDRecConstants::getNEta ( ) const
inline

Definition at line 93 of file HcalDDDRecConstants.h.

References HcalParameters::etagroup, and hpar.

Referenced by HcalTopology::HcalTopology().

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

Definition at line 94 of file HcalDDDRecConstants.h.

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

Referenced by HcalTopology::validRaw().

94 {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 676 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().

679  {
680 
681  unsigned int lymax = (subdet == HcalBarrel) ? maxLayerHB_+1 : maxLayer_+1;
682  int type = (subdet == HcalBarrel) ? 0 : 1;
683  double dphi = phibin[ieta-1];
685  etabin.phis.insert(etabin.phis.end(),phis.begin(),phis.end());
686  int n = (ieta == iEtaMax[type]) ? 0 : 1;
688  etabin0.depthStart = hcons.getDepthEta29(phis[0].first,zside,0)+1;
689  int dstart = -1;
690  int lmin(0), lmax(0);
691  std::map<int,int>::iterator itr=layers.begin();
692  if (!layers.empty()) {
693  int dep = itr->second;
694  if (subdet == HcalEndcap && ieta == iEtaMin[type])
695  dep = hcons.getDepthEta16(subdet,phis[0].first,zside);
696  unsigned lymx0 = (layers.size() > lymax) ? lymax : layers.size();
697 #ifdef EDM_ML_DEBUG
698  std::cout << "Eta " << ieta << ":" << hpar->noff[1] << " zside " << zside
699  << " lymax " << lymx0 << ":" << lymax << " Depth " << dep << ":"
700  << itr->second;
701  unsigned int l(0);
702  for (itr = layers.begin(); itr != layers.end(); ++itr,++l)
703  std::cout << " [" << l << "] " << itr->first << ":" << itr->second;
704  std::cout << std::endl << " with " << phis.size() << " phis";
705  for (unsigned int l=0; l<phis.size(); ++l)
706  std::cout << " " << phis[l].first << ":" << phis[l].second;
707  std::cout << std::endl;
708 #endif
709  for (itr = layers.begin(); itr != layers.end(); ++itr) {
710  if (itr->first <= (int)(lymx0)) {
711  if (itr->second == dep) {
712  if (lmin == 0) lmin = itr->first;
713  lmax = itr->first;
714  } else if (itr->second > dep) {
715  if (dstart < 0) dstart = dep;
716  int lmax0 = (lmax >= lmin) ? lmax : lmin;
717  if (subdet == HcalEndcap && ieta+1 == hpar->noff[1] &&
718  dep > hcons.getDepthEta29(phis[0].first,zside,0)) {
719  etabin0.layer.emplace_back(std::pair<int,int>(lmin,lmax0));
720  } else {
721  etabin.layer.emplace_back(std::pair<int,int>(lmin,lmax0));
722  }
723  lmin = itr->first;
724  lmax = lmin-1;
725  dep = itr->second;
726  }
727  if (subdet == HcalBarrel && ieta == iEtaMax[type] &&
728  dep > hcons.getDepthEta16M(1)) break;
729  if (subdet == HcalEndcap && ieta == hpar->noff[1] &&
730  dep > hcons.getDepthEta29M(0,planOne)) {
731  lmax = lymx0;
732  break;
733  }
734  if (itr->first == (int)(lymx0)) lmax = lymx0;
735  }
736  }
737  if (lmax >= lmin) {
738  if (ieta+1 == hpar->noff[1]) {
739  etabin0.layer.emplace_back(std::pair<int,int>(lmin,lmax));
740  etabin0.phis.insert(etabin0.phis.end(),phis.begin(),phis.end());
741  bins.emplace_back(etabin0);
742 #ifdef EDM_ML_DEBUG
743  std::cout << "etabin0: dStatrt " << etabin0.depthStart << " layers "
744  << etabin0.layer.size() << ":" << lmin << ":" << lmax
745  << " phis " << phis.size() << std::endl;
746  for (unsigned int k=0; k<etabin0.layer.size(); ++k)
747  std::cout << " [" << k << "] " << etabin0.layer[k].first << ":"
748  << etabin0.layer[k].second;
749  std::cout << std::endl;
750 #endif
751  } else if (ieta == hpar->noff[1]) {
752  } else {
753  etabin.layer.emplace_back(std::pair<int,int>(lmin,lmax));
754  if (dstart < 0) dstart = dep;
755  }
756  }
757  }
758  etabin.depthStart = dstart;
759  bins.emplace_back(etabin);
760 #ifdef EDM_ML_DEBUG
761  std::cout << "etabin: dStatrt " << etabin.depthStart << " layers "
762  << etabin.layer.size() << ":" << lmin << ":" << lmax
763  << " phis " << etabin.phis.size() << std::endl;
764  for (unsigned int k=0; k<etabin.layer.size(); ++k)
765  std::cout << " [" << k << "] " << etabin.layer[k].first << ":"
766  << etabin.layer[k].second;
767  std::cout << std::endl;
768 #endif
769 }
type
Definition: HCALResponse.h:21
std::vector< int > iEtaMin
std::vector< LayerSetAndLayers > layers(const SeedingLayerSetsHits &sets)
Definition: LayerTriplets.cc:4
static const int maxLayer_
U second(std::pair< T, U > const &p)
const HcalParameters * hpar
std::vector< double > phibin
int getDepthEta29(const int &phi, const int &zside, const int &i) const
std::vector< int > iEtaMax
std::vector< std::pair< int, int > > layer
int getDepthEta16M(const int &det) const
int getDepthEta29M(const int &i, const bool &planOne) const
int k[5][pyjets_maxn]
std::vector< double > etaTable
const HcalDDDSimConstants & hcons
std::vector< int > noff
static const int maxLayerHB_
std::vector< std::pair< int, double > > phis
int getDepthEta16(const int &det, const int &phi, const int &zside) const
double HcalDDDRecConstants::getPhiBin ( const int &  i) const
inline

Definition at line 96 of file HcalDDDRecConstants.h.

References mps_fire::i, and phibin.

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

Definition at line 97 of file HcalDDDRecConstants.h.

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

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

Definition at line 98 of file HcalDDDRecConstants.h.

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

Referenced by HcalTopology::HcalTopology().

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

Definition at line 366 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().

366  {
367 
368  std::vector<std::pair<int,double> > phis;
369  int ietaAbs = (ieta > 0) ? ieta : -ieta;
370  int keta = (subdet != HcalForward) ? etaSimValu[ietaAbs-1].first : ietaAbs;
371  std::pair<double,double> ficons = hcons.getPhiCons(subdet, keta);
372  double fioff = ficons.first;
373  double dphi = (subdet != HcalForward) ? phibin[ietaAbs-1] : ficons.second;
374  int nphi = int((CLHEP::twopi+0.1*dphi)/dphi);
375  int units = hcons.unitPhi(subdet, keta);
376  for (int ifi = 0; ifi < nphi; ++ifi) {
377  double phi =-fioff + (ifi+0.5)*dphi;
378  int iphi = hcons.phiNumber(ifi+1,units);
379  phis.emplace_back(std::pair<int,double>(iphi,phi));
380  }
381 #ifdef EDM_ML_DEBUG
382  std::cout << "getEtaPhi: subdet|ieta|iphi " << subdet << "|" << ieta
383  << " with " << phis.size() << " phi bins" << std::endl;
384  for (unsigned int k=0; k<phis.size(); ++k)
385  std::cout << "[" << k << "] iphi " << phis[k].first << " phi "
386  << phis[k].second/CLHEP::deg << std::endl;
387 #endif
388  return phis;
389 }
std::vector< std::pair< int, int > > etaSimValu
int phiNumber(const int &phi, const int &unit) const
U second(std::pair< T, U > const &p)
std::vector< double > phibin
int unitPhi(const int &det, const int &etaR) const
int k[5][pyjets_maxn]
TString units(TString variable, Char_t axis)
const HcalDDDSimConstants & hcons
std::pair< double, double > getPhiCons(const int &det, const int &ieta) const
const std::vector<double>& HcalDDDRecConstants::getPhiTable ( ) const
inline

Definition at line 100 of file HcalDDDRecConstants.h.

References phibin.

Referenced by HcalTopology::HcalTopology().

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

Definition at line 101 of file HcalDDDRecConstants.h.

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

Referenced by HcalTopology::HcalTopology().

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

Definition at line 391 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().

391  {
392 
393  phiz.clear();
394  int subdet = hcons.ldMap()->getSubdet();
395  if (subdet > 0) {
396  std::vector<int> phis = hcons.ldMap()->getPhis();
397  for (int k : phis) {
398  int zside = (k > 0) ? 1 : -1;
399  int phi = (k > 0) ? k : -k;
400  phiz.emplace_back(std::pair<int,int>(phi,zside));
401  }
402  }
403 #ifdef EDM_ML_DEBUG
404  std::cout << "Special RBX for detector " << subdet << " with " << phiz.size()
405  << " phi/z bins";
406  for (unsigned int k=0; k<phiz.size(); ++k)
407  std::cout << " [" << k << "] " << phiz[k].first << ":" << phiz[k].second;
408  std::cout << std::endl;
409 #endif
410  return subdet;
411 }
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 ( const int &  subdet,
const int &  ieta,
const int &  depth 
) const

Definition at line 413 of file HcalDDDRecConstants.cc.

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

414  {
415 
416  return getRZ(subdet, ieta, 1, depth);
417 }
double getRZ(const int &subdet, const int &ieta, const int &depth) const
double HcalDDDRecConstants::getRZ ( const int &  subdet,
const int &  ieta,
const int &  iphi,
const int &  depth 
) const

Definition at line 419 of file HcalDDDRecConstants.cc.

References gather_cfg::cout, plotBeamSpotDB::first, gconsHB, gconsHE, getLayerFront(), and HcalBarrel.

420  {
421  int layf = getLayerFront(subdet,ieta,iphi,depth);
422  double rz = (layf < 0) ? 0.0 :
423  ((subdet == static_cast<int>(HcalBarrel)) ? (gconsHB[layf].first) :
424  (gconsHE[layf].first));
425 #ifdef EDM_ML_DEBUG
426  std::cout << "getRZ: subdet|ieta|ipho|depth " << subdet << "|" << ieta << "|"
427  << iphi << "|" << depth << " lay|rz " << layf << "|" << rz
428  << std::endl;
429 #endif
430  return rz;
431 }
std::vector< std::pair< double, double > > gconsHE
int getLayerFront(const int &det, const int &eta, const int &phi, const int &depth) const
std::vector< std::pair< double, double > > gconsHB
double HcalDDDRecConstants::getRZ ( const int &  subdet,
const int &  layer 
) const

Definition at line 433 of file HcalDDDRecConstants.cc.

References gather_cfg::cout, plotBeamSpotDB::first, gconsHB, gconsHE, HcalBarrel, and layerGroupSize().

433  {
434 
435  double rz(0);
436  if (layer > 0 && layer <= (int)(layerGroupSize(0)))
437  rz = ((subdet == static_cast<int>(HcalBarrel)) ? (gconsHB[layer-1].first) :
438  (gconsHE[layer-1].first));
439 #ifdef EDM_ML_DEBUG
440  std::cout << "getRZ: subdet|layer " << subdet << "|" << layer << " rz "
441  << rz << std::endl;
442 #endif
443  return rz;
444 }
std::vector< std::pair< double, double > > gconsHE
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 448 of file HcalDDDRecConstants.cc.

References stringResolutionProvider_cfi::bin, create_public_pileup_plots::bins, funct::cos(), gather_cfg::cout, particleFlowClusterECALTimeSelected_cfi::depth, HcalDDDRecConstants::HcalActiveLength::depth, HcalDDDRecConstants::HcalActiveLength::eta, PVValHelper::eta, JetChargeProducer_cfi::exp, gconsHB, gconsHE, getEtaBins(), HcalDDDSimConstants::getLastLayer(), getLayerFront(), hcons, mps_fire::i, HcalDDDRecConstants::HcalActiveLength::ieta, iEtaMin, HcalDDDRecConstants::HcalActiveLength::iphis, SiStripPI::max, min(), phi, Scenarios_cff::scale, edm::second(), funct::sin(), HcalDDDRecConstants::HcalActiveLength::stype, lumiQTWidget::t, theta(), HcalDDDRecConstants::HcalActiveLength::thick, HcalDigiParam_cfi::zside, and HcalDDDRecConstants::HcalActiveLength::zside.

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

448  {
449 
450  std::vector<HcalDDDRecConstants::HcalActiveLength> actives;
451  std::vector<HcalDDDRecConstants::HcalEtaBin> bins = getEtaBins(type);
452 #ifdef EDM_ML_DEBUG
453  unsigned int kount(0);
454 #endif
455  for (auto & bin : bins) {
456  int ieta = bin.ieta;
457  int zside = bin.zside;
458  int stype = (bin.phis.size() > 4) ? 0 : 1;
459  int layf = getLayerFront(type+1,zside*ieta,bin.phis[0].first,bin.depthStart) + 1;
460  int layl = hcons.getLastLayer(type+1,zside*ieta) + 1;
461  double eta = 0.5*(bin.etaMin+bin.etaMax);
462  double theta = 2*atan(exp(-eta));
463  double scale = 1.0/((type == 0) ? sin(theta) : cos(theta));
464  int depth = bin.depthStart;
465 #ifdef EDM_ML_DEBUG
466  std::cout << "Eta " << ieta << " zside " << zside << " depth " << depth
467  << " Layers " << layf << ":" << layl << ":" << bin.layer.size();
468  for (auto ll : bin.layer) std::cout << " " << ll.first << ":" << ll.second;
469  std::cout << " phi ";
470  for (auto phi : bin.phis) std::cout << " " << phi.first;
471  std::cout << std::endl;
472 #endif
473  for (unsigned int i = 0; i < bin.layer.size(); ++i) {
474  double thick(0);
475  int lmin = (type == 1 && ieta == iEtaMin[1]) ? layf :
476  std::max(bin.layer[i].first,layf);
477  int lmax = std::min(bin.layer[i].second,layl);
478  for (int j = lmin; j <= lmax; ++j) {
479  double t = ((type == 0) ? gconsHB[j-1].second : gconsHE[j-1].second);
480  if ((type == 1) && (ieta <= 18)) t = gconsHE[j].second;
481  if (t > 0) thick += t;
482  }
483 #ifdef EDM_ML_DEBUG
484  std::cout << "Type " << type << " L " << lmin << ":" << lmax << " T "
485  << thick << std::endl;
486 #endif
487  thick *= (2.*scale);
488  HcalDDDRecConstants::HcalActiveLength active(ieta,depth,zside,stype,zside*eta,thick);
489  for (auto phi : bin.phis)
490  active.iphis.emplace_back(phi.first);
491  actives.emplace_back(active);
492  ++depth;
493 #ifdef EDM_ML_DEBUG
494  kount++;
495  std::cout << "getThickActive: [" << kount << "] eta:" << active.ieta
496  << ":" << active.eta << " zside " << active.zside << " depth "
497  << active.depth << " type " << active.stype << " thick "
498  << active.thick << std::endl;
499 #endif
500  }
501  }
502  return actives;
503 }
type
Definition: HCALResponse.h:21
std::vector< int > iEtaMin
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
std::vector< HcalEtaBin > getEtaBins(const int &itype) const
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
T min(T a, T b)
Definition: MathUtil.h:58
int getLastLayer(const int &det, const int &eta) const
int getLayerFront(const int &det, const int &eta, const int &phi, const int &depth) const
bin
set the eta bin as selection string.
const HcalDDDSimConstants & hcons
std::vector< std::pair< double, double > > gconsHB
int HcalDDDRecConstants::getTopoMode ( ) const
inline

Definition at line 108 of file HcalDDDRecConstants.h.

References hpar, and HcalParameters::topologyMode.

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

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

Definition at line 109 of file HcalDDDRecConstants.h.

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

Referenced by HcalTopology::HcalTopology().

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

Definition at line 506 of file HcalDDDRecConstants.cc.

References KineDebug3::count(), gather_cfg::cout, particleFlowClusterECALTimeSelected_cfi::depth, etaSimValu, plotBeamSpotDB::first, getEtaBins(), HcalBarrel, HcalDDDSimConstants::HcalCellTypes(), HcalEndcap, hcons, hpar, iEtaMax, createfilelist::int, HcalParameters::phioff, groupFilesInBlocks::temp, csvLumiCalc::unit, and HcalDDDSimConstants::unitPhi().

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

506  {
507 
508  if (subdet == HcalBarrel || subdet == HcalEndcap) {
509  std::vector<HcalCellType> cells;
510  int isub = (subdet == HcalBarrel) ? 0 : 1;
511  std::vector<HcalDDDRecConstants::HcalEtaBin> etabins = getEtaBins(isub);
512  std::vector<int> missPhi;
513  for (const auto& etabin : etabins) {
514  std::vector<HcalCellType> temp;
515  std::vector<int> count;
516  std::vector<double> dmin, dmax;
517  for (unsigned int il=0; il<etabin.layer.size(); ++il) {
518  HcalCellType cell(subdet, etabin.ieta, etabin.zside, 0,
520  temp.emplace_back(cell);
521  count.emplace_back(0);
522  dmin.emplace_back(0);
523  dmax.emplace_back(0);
524  }
525  int ieta = etabin.ieta;
526  for (int keta=etaSimValu[ieta-1].first; keta<=etaSimValu[ieta-1].second;
527  ++keta) {
528  std::vector<HcalCellType> cellsm = hcons.HcalCellTypes(subdet,keta,-1);
529  for (unsigned int il=0; il<etabin.layer.size(); ++il) {
530  for (auto & ic : cellsm) {
531  if (ic.depthSegment() >= etabin.layer[il].first &&
532  ic.depthSegment() <= etabin.layer[il].second &&
533  ic.etaBin() == temp[il].etaBin() &&
534  ic.zside() == temp[il].zside()) {
535  if (count[il] == 0) {
536  temp[il] = ic;
537  dmin[il] = ic.depthMin();
538  dmax[il] = ic.depthMax();
539  }
540  ++count[il];
541  if (ic.depthMin() < dmin[il])
542  dmin[il] = ic.depthMin();
543  if (ic.depthMax() > dmax[il])
544  dmax[il] = ic.depthMax();
545  }
546  }
547  }
548  }
549  for (unsigned int il=0; il<etabin.layer.size(); ++il) {
550  int depth = etabin.depthStart + (int)(il);
551  temp[il].setEta(ieta,etabin.etaMin,etabin.etaMax);
552  temp[il].setDepth(depth,dmin[il],dmax[il]);
553  double foff = (etabin.ieta <= iEtaMax[0]) ? hpar->phioff[0] : hpar->phioff[1];
554  int unit = hcons.unitPhi(etabin.dphi);
555  temp[il].setPhi(etabin.phis, missPhi, foff, etabin.dphi, unit);
556  cells.emplace_back(temp[il]);
557  }
558  }
559 #ifdef EDM_ML_DEBUG
560  std::cout << "HcalDDDRecConstants: found " << cells.size()
561  << " cells for sub-detector type " << isub << std::endl;
562  for (unsigned int ic=0; ic<cells.size(); ++ic)
563  std::cout << "Cell[" << ic << "] " << cells[ic] << std::endl;
564 #endif
565  return cells;
566  } else {
567  return hcons.HcalCellTypes(subdet,-1,-1);
568  }
569 }
std::vector< std::pair< int, int > > etaSimValu
const HcalParameters * hpar
std::vector< HcalEtaBin > getEtaBins(const int &itype) const
int unitPhi(const int &det, const int &etaR) const
std::vector< int > iEtaMax
std::vector< HcalCellType > HcalCellTypes() const
std::vector< double > phioff
const HcalDDDSimConstants & hcons
HcalDetId HcalDDDRecConstants::idBack ( const HcalDetId id) const

Definition at line 629 of file HcalDDDRecConstants.cc.

References detIdSpR_.

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

629  {
630 
631  HcalDetId hid(id);
632  std::map<HcalDetId,std::vector<HcalDetId>>::const_iterator itr = detIdSpR_.find(id);
633  if (itr != detIdSpR_.end())
634  hid = HcalDetId(id.subdet(),id.ieta(),id.iphi(),(itr->second).back().depth());
635  return hid;
636 }
std::map< HcalDetId, std::vector< HcalDetId > > detIdSpR_
HcalDetId HcalDDDRecConstants::idFront ( const HcalDetId id) const

Definition at line 620 of file HcalDDDRecConstants.cc.

References particleFlowClusterECALTimeSelected_cfi::depth, and detIdSpR_.

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

620  {
621 
622  HcalDetId hid(id);
623  std::map<HcalDetId,std::vector<HcalDetId>>::const_iterator itr = detIdSpR_.find(id);
624  if (itr != detIdSpR_.end())
625  hid = HcalDetId(id.subdet(),id.ieta(),id.iphi(),(itr->second)[0].depth());
626  return hid;
627 }
std::map< HcalDetId, std::vector< HcalDetId > > detIdSpR_
void HcalDDDRecConstants::initialize ( void  )
private

Definition at line 771 of file HcalDDDRecConstants.cc.

References KineDebug3::count(), gather_cfg::cout, particleFlowClusterECALTimeSelected_cfi::depth, depthMaxDf_, depthMaxSp_, detIdSp_, detIdSpR_, HcalParameters::drHB, HcalParameters::dzHE, PVValHelper::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, electrons_cff::ids, 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().

771  {
772 
773  //Eta grouping
774  int nEta = (int)(hpar->etagroup.size());
775  if (nEta != (int)(hpar->phigroup.size())) {
776  edm::LogError("HCalGeom") << "HcalDDDRecConstants: sizes of the vectors "
777  << " etaGroup (" << nEta << ") and phiGroup ("
778  << hpar->phigroup.size() << ") do not match";
779  throw cms::Exception("DDException") << "HcalDDDRecConstants: inconsistent array sizes" << nEta << ":" << hpar->phigroup.size();
780  }
781 
782  // First eta table
783  iEtaMin = hpar->etaMin;
784  iEtaMax = hpar->etaMax;
785  etaTable.clear(); ietaMap.clear(); etaSimValu.clear();
786  int ieta(0), ietaHB(0), ietaHE(0), ietaHEM(0);
787  etaTable.emplace_back(hpar->etaTable[ieta]);
788  for (int i=0; i<nEta; ++i) {
789  int ef = ieta+1;
790  ieta += (hpar->etagroup[i]);
791  if (ieta >= (int)(hpar->etaTable.size())) {
792  edm::LogError("HCalGeom") << "Going beyond the array boundary "
793  << hpar->etaTable.size() << " at index " << i
794  << " of etaTable from SimConstant";
795  throw cms::Exception("DDException") << "Going beyond the array boundary "
796  << hpar->etaTable.size()
797  << " at index " << i
798  << " of etaTable from SimConstant";
799  } else {
800  etaTable.emplace_back(hpar->etaTable[ieta]);
801  etaSimValu.emplace_back(std::pair<int,int>(ef,ieta));
802  }
803  for (int k=0; k<(hpar->etagroup[i]); ++k) ietaMap.emplace_back(i+1);
804  if (ieta <= hpar->etaMax[0]) ietaHB = i+1;
805  if (ieta <= hpar->etaMin[1]) ietaHE = i+1;
806  if (ieta <= hpar->etaMax[1]) ietaHEM= i+1;
807  }
808  iEtaMin[1] = ietaHE;
809  iEtaMax[0] = ietaHB;
810  iEtaMax[1] = ietaHEM;
811 
812  // Then Phi bins
813  nPhiBins.clear();
814  for (unsigned int k=0; k<4; ++k) nPhiBins.emplace_back(0);
815  ieta = 0;
816  phibin.clear(); phiUnitS.clear();
817  for (int i=0; i<nEta; ++i) {
818  double dphi = (hpar->phigroup[i])*(hpar->phibin[ieta]);
819  phibin.emplace_back(dphi);
820  int nphi = (int)((CLHEP::twopi + 0.001)/dphi);
821  if (ieta <= iEtaMax[0]) {
822  if (nphi > nPhiBins[0]) nPhiBins[3] = nPhiBins[0] = nphi;
823  }
824  if (ieta >= iEtaMin[1]) {
825  if (nphi > nPhiBins[1]) nPhiBins[1] = nphi;
826  }
827  ieta += (hpar->etagroup[i]);
828  }
829  for (unsigned int i=1; i<hpar->etaTable.size(); ++i) {
830  int unit = hcons.unitPhi(hpar->phibin[i-1]);
831  phiUnitS.emplace_back(unit);
832  }
833  for (double i : hpar->phitable) {
834  int nphi = (int)((CLHEP::twopi + 0.001)/i);
835  if (nphi > nPhiBins[2]) nPhiBins[2] = nphi;
836  }
837 #ifdef EDM_ML_DEBUG
838  std::cout << "Modified eta/deltaphi table for " << nEta << " bins" << std::endl;
839  for (int i=0; i<nEta; ++i)
840  std::cout << "Eta[" << i << "] = " << etaTable[i] << ":" << etaTable[i+1]
841  << ":" << etaSimValu[i].first << ":" << etaSimValu[i].second
842  << " PhiBin[" << i << "] = " << phibin[i]/CLHEP::deg <<std::endl;
843  std::cout << "PhiUnitS";
844  for (unsigned int i=0; i<phiUnitS.size(); ++i)
845  std::cout << " [" << i << "] = " << phiUnitS[i];
846  std::cout << std::endl;
847  std::cout << "nPhiBins";
848  for (unsigned int i=0; i<nPhiBins.size(); ++i)
849  std::cout << " [" << i << "] = " << nPhiBins[i];
850  std::cout << std::endl;
851  std::cout << "EtaTableHF";
852  for (unsigned int i=0; i<hpar->etaTableHF.size(); ++i)
853  std::cout << " [" << i << "] = " << hpar->etaTableHF[i];
854  std::cout << std::endl;
855  std::cout << "PhiBinHF";
856  for (unsigned int i=0; i<hpar->phitable.size(); ++i)
857  std::cout << " [" << i << "] = " << hpar->phitable[i];
858  std::cout << std::endl;
859 #endif
860 
861  //Now the depths
863  maxDepth[0] = maxDepth[1] = 0;
864  for (int i=0; i<nEta; ++i) {
865  unsigned int imx = layerGroupSize(i);
866  int laymax = (imx > 0) ? layerGroup(i,imx-1) : 0;
867  if (i < iEtaMax[0]) {
868  int laymax0 = (imx > 16) ? layerGroup(i,16) : laymax;
869  if (i+1 == iEtaMax[0]) laymax0 = hcons.getDepthEta16M(1);
870 #ifdef EDM_ML_DEBUG
871  std::cout << "HB " << i << " " << imx << " " << laymax << " "
872  << laymax0 << std::endl;
873 #endif
874  if (maxDepth[0] < laymax0) maxDepth[0] = laymax0;
875  }
876  if (i >= iEtaMin[1]-1 && i < iEtaMax[1]) {
877 #ifdef EDM_ML_DEBUG
878  std::cout << "HE " << i << " " << imx << " " << laymax << std::endl;
879 #endif
880  if (maxDepth[1] < laymax) maxDepth[1] = laymax;
881  }
882  }
883 #ifdef EDM_ML_DEBUG
884  for (int i=0; i<4; ++i)
885  std::cout << "Detector Type[" << i << "] iEta " << iEtaMin[i] << ":"
886  << iEtaMax[i] << " MaxDepth " << maxDepth[i] << std::endl;
887 #endif
888 
889  //Now the geometry constants
890  nModule[0] = hpar->modHB[0];
891  nHalves[0] = hpar->modHB[1];
892  for (unsigned int i=0; i<hpar->rHB.size(); ++i) {
893  gconsHB.emplace_back(std::pair<double,double>(hpar->rHB[i]/CLHEP::cm,
894  hpar->drHB[i]/CLHEP::cm));
895  }
896 #ifdef EDM_ML_DEBUG
897  std::cout << "HB with " << nModule[0] << " modules and " << nHalves[0]
898  <<" halves and " << gconsHB.size() << " layers" << std::endl;
899  for (unsigned int i=0; i<gconsHB.size(); ++i)
900  std::cout << "rHB[" << i << "] = " << gconsHB[i].first << " +- "
901  << gconsHB[i].second << std::endl;
902 #endif
903  nModule[1] = hpar->modHE[0];
904  nHalves[1] = hpar->modHE[1];
905  for (unsigned int i=0; i<hpar->zHE.size(); ++i) {
906  gconsHE.emplace_back(std::pair<double,double>(hpar->zHE[i]/CLHEP::cm,
907  hpar->dzHE[i]/CLHEP::cm));
908  }
909 #ifdef EDM_ML_DEBUG
910  std::cout << "HE with " << nModule[1] << " modules and " << nHalves[1]
911  <<" halves and " << gconsHE.size() << " layers" << std::endl;
912  for (unsigned int i=0; i<gconsHE.size(); ++i)
913  std::cout << "zHE[" << i << "] = " << gconsHE[i].first << " +- "
914  << gconsHE[i].second << std::endl;
915 #endif
916 
917  //Special RBX
919  if (depthMaxSp_.first == 0) {
920  depthMaxSp_ = depthMaxDf_ = std::pair<int,int>(2,maxDepth[1]);
921  } else if (depthMaxSp_.first == 1) {
922  depthMaxDf_ = std::pair<int,int>(1,maxDepth[0]);
923  if (depthMaxSp_.second > maxDepth[0]) maxDepth[0] = depthMaxSp_.second;
924  } else {
925  depthMaxDf_ = std::pair<int,int>(2,maxDepth[1]);
926  if (depthMaxSp_.second > maxDepth[1]) maxDepth[1] = depthMaxSp_.second;
927  }
928 #ifdef EDM_ML_DEBUG
929  std::cout << "Detector type and maximum depth for all RBX "
930  << depthMaxDf_.first << ":" << depthMaxDf_.second
931  << " and for special RBX " << depthMaxSp_.first << ":"
932  << depthMaxSp_.second << std::endl;
933 #endif
934 
935  //Map of special DetId's
936  std::vector<int> phis;
938  detIdSp_.clear(); detIdSpR_.clear();
939  if ((subdet == HcalBarrel) || (subdet == HcalEndcap)) {
940  int phi = (phis[0] > 0) ? phis[0] : -phis[0];
941  int zside = (phis[0] > 0) ? 1 : -1;
942  int lymax = (subdet == HcalBarrel) ? maxLayerHB_+1 : maxLayer_+1;
943  std::pair<int,int>etas = hcons.ldMap()->validEta();
944  for (int eta=etas.first; eta<=etas.second; ++eta) {
945  std::map<int,std::pair<int,int> > oldDep;
946  int depth(0);
947  int lmin = layerGroup(eta-1,0);
948  for (int lay=0; lay<lymax; ++lay) {
949  int depc = layerGroup(eta-1,lay);
950  if (depth != depc) {
951  if (depth != 0) oldDep[depth] = std::pair<int,int>(lmin,lay-1);
952  depth = depc;
953  lmin = lay;
954  }
955  }
956  if (depth != 0) oldDep[depth] = std::pair<int,int>(lmin,lymax-1);
957 #ifdef EDM_ML_DEBUG
958  std::cout << "Eta|Phi|Zside " << eta << ":" << phi << ":" << zside
959  << " with " << oldDep.size() << " old Depths" << std::endl;
960  unsigned int kk(0);
961  for (std::map<int,std::pair<int,int> >::const_iterator itr=oldDep.begin(); itr != oldDep.end(); ++itr,++kk)
962  std::cout << "[" << kk << "] " << itr->first << " --> "
963  << itr->second.first << ":" << itr->second.second << "\n";
964 #endif
965  std::pair<int,int> depths = hcons.ldMap()->getDepths(eta);
966  for (int ndepth=depths.first; ndepth<=depths.second; ++ndepth) {
967  bool flag = ((subdet == HcalBarrel && eta == iEtaMax[0] &&
968  ndepth > hcons.getDepthEta16(subdet,phi,zside)) ||
969  (subdet == HcalEndcap && eta == iEtaMin[1] &&
970  ndepth < hcons.getDepthEta16(subdet,phi,zside)));
971  if (!flag) {
972  std::vector<int> count(oldDep.size(),0);
973  int layFront = hcons.ldMap()->getLayerFront(subdet,eta,phi,zside,ndepth);
974  int layBack = hcons.ldMap()->getLayerBack(subdet,eta,phi,zside,ndepth);
975  for (int lay=layFront; lay<=layBack; ++lay) {
976  unsigned int l(0);
977  for (std::map<int,std::pair<int,int> >::iterator itr=oldDep.begin();
978  itr != oldDep.end(); ++itr,++l) {
979  if (lay >= (itr->second).first && lay <= (itr->second).second) {
980  ++count[l]; break;
981  }
982  }
983  }
984  int odepth(0), maxlay(0);
985  unsigned int l(0);
986  for (std::map<int,std::pair<int,int> >::iterator itr=oldDep.begin();
987  itr != oldDep.end(); ++itr,++l) {
988  if (count[l] > maxlay) {
989  odepth = itr->first;
990  maxlay = count[l];
991  }
992  }
993 #ifdef EDM_ML_DEBUG
994  std::cout << "New Depth " << ndepth << " old Depth " << odepth
995  << " max " << maxlay << std::endl;
996 #endif
997  for (int k : phis) {
998  zside = (k > 0) ? 1 : -1;
999  phi = (k > 0) ? k : -k;
1000  if (subdet == HcalEndcap && eta == hpar->noff[1] &&
1001  ndepth > hcons.getDepthEta29M(0,true)) break;
1002  HcalDetId newId(subdet,zside*eta,phi,ndepth);
1003  HcalDetId oldId(subdet,zside*eta,phi,odepth);
1004  detIdSp_[newId] = oldId;
1005  std::vector<HcalDetId> ids;
1006  std::map<HcalDetId,std::vector<HcalDetId>>::iterator itr = detIdSpR_.find(oldId);
1007  if (itr != detIdSpR_.end()) ids = itr->second;
1008  ids.emplace_back(newId);
1009  detIdSpR_[oldId] = ids;
1010  }
1011  }
1012  }
1013  }
1014 #ifdef EDM_ML_DEBUG
1015  std::cout << "Map for merging new channels to old channel IDs with "
1016  << detIdSp_.size() << " entries" << std::endl;
1017  int l(0);
1018  for (auto itr : detIdSp_) {
1019  std::cout << "[" << l << "] Special " << itr.first << " Standard "
1020  << itr.second << std::endl;
1021  ++l;
1022  }
1023  std::cout << "Reverse Map for mapping old to new IDs with "
1024  << detIdSpR_.size() << " entries" << std::endl;
1025  l = 0;
1026  for (auto itr : detIdSpR_) {
1027  std::cout << "[" << l << "] Standard " << itr.first << " Special";
1028  for (auto itr1 : itr.second)
1029  std::cout << " " << (itr1);
1030  std::cout << std::endl;
1031  ++l;
1032  }
1033 #endif
1034  }
1035 
1036 }
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 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
int unitPhi(const int &det, const int &etaR) const
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 getDepthEta16M(const int &det) const
int getDepthEta29M(const int &i, const bool &planOne) const
int k[5][pyjets_maxn]
unsigned int layerGroupSize(int eta) const
std::vector< double > etaTable
std::vector< double > phitable
std::vector< double > phibin
std::vector< double > drHB
const HcalDDDSimConstants & hcons
std::pair< int, int > depthMaxDf_
std::vector< int > noff
std::pair< int, int > getMaxDepthDet(const int &i) const
std::vector< std::pair< double, double > > gconsHB
std::vector< int > maxDepth
std::vector< int > phigroup
static const int maxLayerHB_
std::vector< int > etaMin
int getDepthEta16(const int &det, const int &phi, const int &zside) const
const HcalLayerDepthMap * ldMap() const
bool HcalDDDRecConstants::isBH ( ) const
inline
bool HcalDDDRecConstants::isPlan1 ( const HcalDetId id) const
inline

Definition at line 112 of file HcalDDDRecConstants.h.

References detIdSp_.

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

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

Definition at line 128 of file HcalDDDRecConstants.h.

References detIdSpR_.

Referenced by HcalTopology::validHcal().

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

Definition at line 127 of file HcalDDDRecConstants.h.

References detIdSp_.

Referenced by HcalTopology::validHcal().

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

Definition at line 1050 of file HcalDDDRecConstants.cc.

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

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

1050  {
1051  unsigned int k = 0;
1052  for (auto const & it : hpar->layerGroupEtaRec) {
1053  if (it.layer == (unsigned int)(eta + 1)) {
1054  return it.layerGroup.at(i);
1055  }
1056  if (it.layer > (unsigned int)(eta + 1)) break;
1057  k = it.layerGroup.at(i);
1058  }
1059  return k;
1060 }
const HcalParameters * hpar
int k[5][pyjets_maxn]
std::vector< LayerItem > layerGroupEtaRec
unsigned int HcalDDDRecConstants::layerGroupSize ( int  eta) const
private

Definition at line 1038 of file HcalDDDRecConstants.cc.

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

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

1038  {
1039  unsigned int k = 0;
1040  for (auto const & it : hpar->layerGroupEtaRec) {
1041  if (it.layer == (unsigned int)(eta + 1)) {
1042  return it.layerGroup.size();
1043  }
1044  if (it.layer > (unsigned int)(eta + 1)) break;
1045  k = it.layerGroup.size();
1046  }
1047  return k;
1048 }
const HcalParameters * hpar
int k[5][pyjets_maxn]
std::vector< LayerItem > layerGroupEtaRec
int HcalDDDRecConstants::maxHFDepth ( int  ieta,
int  iphi 
) const
inline
HcalDetId HcalDDDRecConstants::mergedDepthDetId ( const HcalDetId id) const

Definition at line 613 of file HcalDDDRecConstants.cc.

References detIdSp_.

Referenced by HcalHBHEMuonAnalyzer::analyze(), HcalHBHEMuonAnalyzer::beginRun(), maxHFDepth(), and HcalTopology::mergedDepthDetId().

613  {
614 
615  std::map<HcalDetId,HcalDetId>::const_iterator itr = detIdSp_.find(id);
616  if (itr == detIdSp_.end()) return id;
617  else return itr->second;
618 }
std::map< HcalDetId, HcalDetId > detIdSp_
unsigned int HcalDDDRecConstants::nCells ( HcalSubdetector  subdet) const

Definition at line 590 of file HcalDDDRecConstants.cc.

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

590  {
591 
592  if (subdet == HcalBarrel || subdet == HcalEndcap) {
593  int isub = (subdet == HcalBarrel) ? 0 : 1;
594  std::vector<HcalDDDRecConstants::HcalEtaBin> etabins = getEtaBins(isub);
595  unsigned int ncell(0);
596  for (auto & etabin : etabins) {
597  ncell += ((etabin.phis.size())*(etabin.layer.size()));
598  }
599  return ncell;
600  } else if (subdet == HcalOuter) {
601  return kHOSizePreLS1;
602  } else if (subdet == HcalForward) {
603  return (unsigned int)(hcons.numberOfCells(subdet));
604  } else {
605  return 0;
606  }
607 }
std::vector< HcalEtaBin > getEtaBins(const int &itype) const
unsigned int numberOfCells(const HcalSubdetector &) const
const HcalDDDSimConstants & hcons
unsigned int HcalDDDRecConstants::nCells ( ) const

Definition at line 609 of file HcalDDDRecConstants.cc.

References HcalBarrel, HcalEndcap, HcalForward, and HcalOuter.

Referenced by maxHFDepth().

unsigned int HcalDDDRecConstants::numberOfCells ( HcalSubdetector  subdet) const

Definition at line 571 of file HcalDDDRecConstants.cc.

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

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

571  {
572 
573  if (subdet == HcalBarrel || subdet == HcalEndcap) {
574  unsigned int num = 0;
575  std::vector<HcalCellType> cellTypes = HcalCellTypes(subdet);
576  for (auto & cellType : cellTypes) {
577  num += (unsigned int)(cellType.nPhiBins());
578  }
579 #ifdef EDM_ML_DEBUG
580  edm::LogInfo ("HCalGeom") << "HcalDDDRecConstants:numberOfCells "
581  << cellTypes.size() << " " << num
582  << " for subdetector " << subdet;
583 #endif
584  return num;
585  } else {
586  return hcons.numberOfCells(subdet);
587  }
588 }
std::vector< HcalCellType > HcalCellTypes(HcalSubdetector) const
unsigned int numberOfCells(const HcalSubdetector &) const
const HcalDDDSimConstants & hcons
void HcalDDDRecConstants::specialRBXHBHE ( const std::vector< HcalDetId > &  idsOld,
std::vector< HcalDetId > &  idsNew 
) const

Definition at line 653 of file HcalDDDRecConstants.cc.

References detIdSp_, and gen::k.

Referenced by maxHFDepth().

654  {
655  for (auto k : idsOld) {
656  std::map<HcalDetId,HcalDetId>::const_iterator itr = detIdSp_.find(k);
657  if (itr == detIdSp_.end()) idsNew.emplace_back(k);
658  else idsNew.emplace_back(itr->second);
659  }
660 }
std::map< HcalDetId, HcalDetId > detIdSp_
int k[5][pyjets_maxn]
bool HcalDDDRecConstants::specialRBXHBHE ( bool  flag,
std::vector< HcalDetId > &  ids 
) const

Definition at line 662 of file HcalDDDRecConstants.cc.

References detIdSp_, and detIdSpR_.

663  {
664  if (tobemerged) {
665  std::map<HcalDetId,HcalDetId>::const_iterator itr;
666  for (itr = detIdSp_.begin(); itr != detIdSp_.end(); ++itr)
667  ids.emplace_back(itr->first);
668  } else{
669  std::map<HcalDetId,std::vector<HcalDetId>>::const_iterator itr;
670  for (itr = detIdSpR_.begin(); itr != detIdSpR_.end(); ++itr)
671  ids.emplace_back(itr->first);
672  }
673  return (!ids.empty());
674 }
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 638 of file HcalDDDRecConstants.cc.

References detIdSpR_, and gen::k.

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

639  {
640 
641  ids.clear();
642  std::map<HcalDetId,std::vector<HcalDetId>>::const_iterator itr = detIdSpR_.find(id);
643  if (itr == detIdSpR_.end()) {
644  ids.emplace_back(id);
645  } else {
646  for (auto k : itr->second) {
647  HcalDetId hid(id.subdet(),id.ieta(),id.iphi(),k.depth());
648  ids.emplace_back(hid);
649  }
650  }
651 }
std::map< HcalDetId, std::vector< HcalDetId > > detIdSpR_
int k[5][pyjets_maxn]
bool HcalDDDRecConstants::withSpecialRBXHBHE ( ) const
inline

Definition at line 126 of file HcalDDDRecConstants.h.

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

Referenced by HcalTopology::withSpecialRBXHBHE().

126 {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 156 of file HcalDDDRecConstants.h.

Referenced by initialize().

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

Definition at line 156 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 145 of file HcalDDDRecConstants.h.

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

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

Definition at line 146 of file HcalDDDRecConstants.h.

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

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

Definition at line 153 of file HcalDDDRecConstants.h.

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

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

Definition at line 154 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 147 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 149 of file HcalDDDRecConstants.h.

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

const int HcalDDDRecConstants::maxLayer_ =18
staticprivate

Definition at line 141 of file HcalDDDRecConstants.h.

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

const int HcalDDDRecConstants::maxLayerHB_ =16
staticprivate

Definition at line 142 of file HcalDDDRecConstants.h.

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

int HcalDDDRecConstants::nHalves[2]
private

Definition at line 155 of file HcalDDDRecConstants.h.

Referenced by initialize().

int HcalDDDRecConstants::nModule[2]
private

Definition at line 155 of file HcalDDDRecConstants.h.

Referenced by initialize().

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

Definition at line 150 of file HcalDDDRecConstants.h.

Referenced by getNPhi(), and initialize().

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

Definition at line 152 of file HcalDDDRecConstants.h.

Referenced by getHCID(), and initialize().