CMS 3D CMS Logo

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

#include <HcalLayerDepthMap.h>

Public Member Functions

int getDepth (const int subdet, const int ieta, const int iphi, const int zside, const int layer) const
 
int getDepth16 (const int subdet, const int iphi, const int zside) const
 
int getDepthMax (const int subdet, const int iphi, const int zside) const
 
int getDepthMax (const int subdet, const int ieta, const int iphi, const int zside) const
 
int getDepthMin (const int subdet, const int iphi, const int zside) const
 
std::pair< int, int > getDepths (const int eta) const
 
double getLayer0Wt (const int subdet, const int iphi, const int zside) const
 
int getLayerBack (const int subdet, const int ieta, const int iphi, const int zside, const int depth) const
 
void getLayerDepth (const int subdet, const int ieta, const int iphi, const int zside, std::map< int, int > &layers) const
 
void getLayerDepth (const int ieta, std::map< int, int > &layers) const
 
int getLayerFront (const int subdet, const int ieta, const int iphi, const int zside, const int depth) const
 
int getMaxDepthLastHE (const int subdet, const int iphi, const int zside) const
 
const std::vector< int > & getPhis () const
 
int getSubdet () const
 
 HcalLayerDepthMap ()
 
void initialize (const int subdet, const int ietaMax, const int dep16C, const int dep29C, const double wtl0C, std::vector< int > const &iphi, std::vector< int > const &ieta, std::vector< int > const &layer, std::vector< int > const &depth)
 
bool isValid (const int det, const int phi, const int zside) const
 
int validDet (std::vector< int > &phis) const
 
std::pair< int, int > validEta () const
 
 ~HcalLayerDepthMap ()
 

Private Attributes

int dep16C_
 
int dep29C_
 
std::map< std::pair< int, int >, int > depth2LayerB_
 
std::map< std::pair< int, int >, int > depth2LayerF_
 
int depthMax_
 
int depthMin_
 
std::map< int, std::pair< int, int > > depthsEta_
 
int ietaMax_
 
int ietaMin_
 
std::vector< int > iphi_
 
std::map< std::pair< int, int >, int > layer2Depth_
 
int subdet_
 
double wtl0C_
 

Static Private Attributes

static const int maxLayers_ = 18
 

Detailed Description

this class stores the map of layer to depth for special phi sections

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 18 of file HcalLayerDepthMap.h.

Constructor & Destructor Documentation

HcalLayerDepthMap::HcalLayerDepthMap ( )

Definition at line 9 of file HcalLayerDepthMap.cc.

References dep29C_, depthMax_, depthMin_, ietaMax_, ietaMin_, subdet_, and wtl0C_.

HcalLayerDepthMap::~HcalLayerDepthMap ( )

Definition at line 18 of file HcalLayerDepthMap.cc.

18 {}

Member Function Documentation

int HcalLayerDepthMap::getDepth ( const int  subdet,
const int  ieta,
const int  iphi,
const int  zside,
const int  layer 
) const

Definition at line 109 of file HcalLayerDepthMap.cc.

References gather_cfg::cout, egammaForCoreTracking_cff::depth, isValid(), and layer2Depth_.

Referenced by HcalDDDSimConstants::findDepth(), getDepthMax(), and getSubdet().

111  {
112  int depth(-1);
113  if (isValid(subdet,iphi,zside)) {
114  std::map<std::pair<int,int>,int>::const_iterator itr = layer2Depth_.find(std::pair<int,int>(ieta,layer));
115  if (itr != layer2Depth_.end()) depth = itr->second;
116  }
117 #ifdef EDM_ML_DEBUG
118  std::cout << "getDepth::Input " << subdet << ":" << ieta << ":" << iphi
119  << ":" << zside << ":" << layer << " Output " << depth <<std::endl;
120 #endif
121  return depth;
122 }
bool isValid(const int det, const int phi, const int zside) const
int zside(DetId const &)
std::map< std::pair< int, int >, int > layer2Depth_
int HcalLayerDepthMap::getDepth16 ( const int  subdet,
const int  iphi,
const int  zside 
) const

Definition at line 124 of file HcalLayerDepthMap.cc.

References gather_cfg::cout, dep16C_, egammaForCoreTracking_cff::depth, and isValid().

Referenced by HcalDDDSimConstants::getDepthEta16(), HcalDDDSimConstants::getDepthEta16M(), and getSubdet().

125  {
126  int depth(-1);
127  if (isValid(subdet,iphi,zside)) depth = dep16C_;
128 #ifdef EDM_ML_DEBUG
129  std::cout << "getDepth16::Input " << subdet << ":" << iphi << ":" << zside
130  << " Output " << depth << std::endl;
131 #endif
132  return depth;
133 }
bool isValid(const int det, const int phi, const int zside) const
int zside(DetId const &)
int HcalLayerDepthMap::getDepthMax ( const int  subdet,
const int  iphi,
const int  zside 
) const

Definition at line 145 of file HcalLayerDepthMap.cc.

References gather_cfg::cout, egammaForCoreTracking_cff::depth, depthMax_, and isValid().

Referenced by getSubdet(), and HcalDDDSimConstants::initialize().

146  {
147  int depth = (isValid(subdet,iphi,zside)) ? depthMax_ : -1;
148 #ifdef EDM_ML_DEBUG
149  std::cout << "getDepthMax::Input " << subdet << ":" << iphi << ":" << zside
150  << " Output " << depth << std::endl;
151 #endif
152  return depth;
153 }
bool isValid(const int det, const int phi, const int zside) const
int zside(DetId const &)
int HcalLayerDepthMap::getDepthMax ( const int  subdet,
const int  ieta,
const int  iphi,
const int  zside 
) const

Definition at line 155 of file HcalLayerDepthMap.cc.

References gather_cfg::cout, egammaForCoreTracking_cff::depth, getDepth(), isValid(), and maxLayers_.

156  {
157  int depth = (isValid(subdet,iphi,zside)) ? getDepth(subdet,ieta,iphi,zside,maxLayers_) : -1;
158 #ifdef EDM_ML_DEBUG
159  std::cout << "getDepthMax::Input " << subdet << ":" << iphi << ":" << zside
160  << " Output " << depth << std::endl;
161 #endif
162  return depth;
163 }
bool isValid(const int det, const int phi, const int zside) const
int zside(DetId const &)
int getDepth(const int subdet, const int ieta, const int iphi, const int zside, const int layer) const
static const int maxLayers_
int HcalLayerDepthMap::getDepthMin ( const int  subdet,
const int  iphi,
const int  zside 
) const

Definition at line 135 of file HcalLayerDepthMap.cc.

References gather_cfg::cout, egammaForCoreTracking_cff::depth, depthMin_, and isValid().

Referenced by getSubdet().

136  {
137  int depth = (isValid(subdet,iphi,zside)) ? depthMin_ : -1;
138 #ifdef EDM_ML_DEBUG
139  std::cout << "getDepthMin::Input " << subdet << ":" << iphi << ":" << zside
140  << " Output " << depth << std::endl;
141 #endif
142  return depth;
143 }
bool isValid(const int det, const int phi, const int zside) const
int zside(DetId const &)
std::pair< int, int > HcalLayerDepthMap::getDepths ( const int  eta) const

Definition at line 165 of file HcalLayerDepthMap.cc.

References depthsEta_.

Referenced by HcalDDDSimConstants::getMaxDepth(), HcalDDDSimConstants::getMinDepth(), getSubdet(), and HcalDDDRecConstants::initialize().

165  {
166 
167  std::map<int,std::pair<int,int> >::const_iterator itr = depthsEta_.find(eta);
168  if (itr == depthsEta_.end()) return std::pair<int,int>(-1,-1);
169  else return itr->second;
170 }
std::map< int, std::pair< int, int > > depthsEta_
double HcalLayerDepthMap::getLayer0Wt ( const int  subdet,
const int  iphi,
const int  zside 
) const

Definition at line 251 of file HcalLayerDepthMap.cc.

References gather_cfg::cout, isValid(), and wtl0C_.

Referenced by HcalDDDSimConstants::getLayer0Wt(), and getSubdet().

252  {
253  double wt = isValid(subdet,iphi,zside) ? wtl0C_ : -1.0;
254 #ifdef EDM_ML_DEBUG
255  std::cout << "getLayer0Wt::Input " << subdet << ":" << iphi << ":" << zside
256  << " Output " << wt << std::endl;
257 #endif
258  return wt;
259 }
bool isValid(const int det, const int phi, const int zside) const
int zside(DetId const &)
int HcalLayerDepthMap::getLayerBack ( const int  subdet,
const int  ieta,
const int  iphi,
const int  zside,
const int  depth 
) const

Definition at line 187 of file HcalLayerDepthMap.cc.

References gather_cfg::cout, depth2LayerB_, and isValid().

Referenced by HcalDDDSimConstants::getLayerBack(), HcalDDDRecConstants::getLayerBack(), getSubdet(), and HcalDDDRecConstants::initialize().

189  {
190  int layer(-1);
191  if (isValid(subdet,iphi,zside)) {
192  std::map<std::pair<int,int>,int>::const_iterator itr = depth2LayerB_.find(std::pair<int,int>(ieta,depth));
193  if (itr != depth2LayerB_.end()) layer = itr->second;
194  }
195 #ifdef EDM_ML_DEBUG
196  std::cout << "getLayerBack::Input " << subdet << ":" << ieta << ":" << iphi
197  << ":" << zside << ":" << depth << " Output " << layer <<std::endl;
198 #endif
199  return layer;
200 }
bool isValid(const int det, const int phi, const int zside) const
int zside(DetId const &)
std::map< std::pair< int, int >, int > depth2LayerB_
void HcalLayerDepthMap::getLayerDepth ( const int  subdet,
const int  ieta,
const int  iphi,
const int  zside,
std::map< int, int > &  layers 
) const

Definition at line 202 of file HcalLayerDepthMap.cc.

References gather_cfg::cout, isValid(), layer2Depth_, and edm::second().

Referenced by HcalDDDRecConstants::getDepth(), HcalDDDRecConstants::getEtaBins(), and getSubdet().

204  {
205  layers.clear();
206  if (isValid(subdet,phi,zside)) {
207  for (const auto & itr : layer2Depth_) {
208  if ((itr.first).first == eta) {
209  layers[((itr.first).second)+1] = (itr.second);
210  }
211  }
212  }
213 #ifdef EDM_ML_DEBUG
214  std::cout << "getLayerDepth::Input " << subdet << ":" << eta << ":" << phi
215  << ":" << zside << " Output " << layers.size() << " entries\n";
216  for (std::map<int,int>::iterator itr=layers.begin(); itr != layers.end();
217  ++itr) std::cout << " [" << itr->first << "] " << itr->second;
218  std::cout << std::endl;
219 #endif
220 }
std::vector< LayerSetAndLayers > layers(const SeedingLayerSetsHits &sets)
Definition: LayerTriplets.cc:4
bool isValid(const int det, const int phi, const int zside) const
int zside(DetId const &)
U second(std::pair< T, U > const &p)
std::map< std::pair< int, int >, int > layer2Depth_
void HcalLayerDepthMap::getLayerDepth ( const int  ieta,
std::map< int, int > &  layers 
) const

Definition at line 222 of file HcalLayerDepthMap.cc.

References gather_cfg::cout, layer2Depth_, edm::second(), and subdet_.

223  {
224  layers.clear();
225  if (subdet_ > 0) {
226  for (const auto & itr : layer2Depth_) {
227  if ((itr.first).first == eta) {
228  layers[((itr.first).second)+1] = (itr.second);
229  }
230  }
231  }
232 #ifdef EDM_ML_DEBUG
233  std::cout << "getLayerDepth::Input " << eta << " Output " << layers.size()
234  << " entries\n";
235  for (std::map<int,int>::iterator itr=layers.begin(); itr != layers.end();
236  ++itr) std::cout << " [" << itr->first << "] " << itr->second;
237  std::cout << std::endl;
238 #endif
239 }
std::vector< LayerSetAndLayers > layers(const SeedingLayerSetsHits &sets)
Definition: LayerTriplets.cc:4
U second(std::pair< T, U > const &p)
std::map< std::pair< int, int >, int > layer2Depth_
int HcalLayerDepthMap::getLayerFront ( const int  subdet,
const int  ieta,
const int  iphi,
const int  zside,
const int  depth 
) const

Definition at line 172 of file HcalLayerDepthMap.cc.

References gather_cfg::cout, depth2LayerF_, and isValid().

Referenced by HcalDDDSimConstants::getLayerFront(), HcalDDDRecConstants::getLayerFront(), getSubdet(), and HcalDDDRecConstants::initialize().

174  {
175  int layer(-1);
176  if (isValid(subdet,iphi,zside)) {
177  std::map<std::pair<int,int>,int>::const_iterator itr = depth2LayerF_.find(std::pair<int,int>(ieta,depth));
178  if (itr != depth2LayerF_.end()) layer = itr->second;
179  }
180 #ifdef EDM_ML_DEBUG
181  std::cout << "getLayerFront::Input " << subdet << ":" << ieta << ":" << iphi
182  << ":" << zside << ":" << depth << " Output " << layer <<std::endl;
183 #endif
184  return layer;
185 }
bool isValid(const int det, const int phi, const int zside) const
int zside(DetId const &)
std::map< std::pair< int, int >, int > depth2LayerF_
int HcalLayerDepthMap::getMaxDepthLastHE ( const int  subdet,
const int  iphi,
const int  zside 
) const

Definition at line 241 of file HcalLayerDepthMap.cc.

References gather_cfg::cout, dep29C_, egammaForCoreTracking_cff::depth, and isValid().

Referenced by HcalDDDSimConstants::getDepthEta29(), HcalDDDSimConstants::getDepthEta29M(), and getSubdet().

242  {
243  int depth = isValid(subdet,iphi,zside) ? dep29C_ : -1;
244 #ifdef EDM_ML_DEBUG
245  std::cout << "getMaxDepthLastHE::Input " << subdet << ":" << iphi << ":"
246  << zside << " Output " << depth << std::endl;
247 #endif
248  return depth;
249 }
bool isValid(const int det, const int phi, const int zside) const
int zside(DetId const &)
const std::vector<int>& HcalLayerDepthMap::getPhis ( ) const
inline

Definition at line 47 of file HcalLayerDepthMap.h.

References iphi_, isValid(), phi, and validDet().

Referenced by HcalDDDRecConstants::getPhiZOne().

47 {return iphi_;}
std::vector< int > iphi_
int HcalLayerDepthMap::getSubdet ( ) const
inline
void HcalLayerDepthMap::initialize ( const int  subdet,
const int  ietaMax,
const int  dep16C,
const int  dep29C,
const double  wtl0C,
std::vector< int > const &  iphi,
std::vector< int > const &  ieta,
std::vector< int > const &  layer,
std::vector< int > const &  depth 
)

Definition at line 20 of file HcalLayerDepthMap.cc.

References gather_cfg::cout, dep16C_, dep29C_, depth2LayerB_, depth2LayerF_, depthMax_, depthMin_, depthsEta_, PVValHelper::eta, ietaMax_, ietaMin_, iphi_, gen::k, layer2Depth_, genParticles_cff::map, maxLayers_, edm::second(), subdet_, and wtl0C_.

Referenced by HcalDDDSimConstants::initialize().

26  {
27 
28  subdet_ = subdet;
29  ietaMin_ = ietaMax_ = ietaMax;
30  dep16C_ = dep16C;
31  dep29C_ = dep29C;
32  wtl0C_ = wtl0C;
33  iphi_.insert(iphi_.end(),iphi.begin(),iphi.end());
34  layer2Depth_.clear(); depth2LayerF_.clear(); depth2LayerB_.clear();
35  depthMin_= 99;
36  depthMax_=-1;
37  for (unsigned int k=0; k<ieta.size(); ++k) {
38  if (ieta[k] < ietaMin_) ietaMin_ = ieta[k];
39  if (depth[k] < depthMin_) depthMin_ = depth[k];
40  if (depth[k] > depthMax_) depthMax_ = depth[k];
41  }
42  //Assume ieta, layer, depth are in increasing order of ieta and depth
43  for (unsigned int k1=0; k1<ieta.size(); ++k1) {
44  int ietaMin = ieta[k1];
45  int ietaMax = ietaMax_;
46  int layMin = layer[k1];
47  int layMax = (k1+1 < ieta.size()) ? (layer[k1+1]-1) : maxLayers_;
48  for (unsigned int k2=k1+1; k2<ieta.size(); ++k2) {
49  if (ieta[k2] > ieta[k1]) {
50  ietaMax = ieta[k2] - 1;
51  if (k2 == k1+1) layMax = maxLayers_;
52  break;
53  }
54  }
55  for (int eta=ietaMin; eta<=ietaMax; ++eta) {
56  depth2LayerF_[std::pair<int,int>(eta,depth[k1])] = layMin;
57  depth2LayerB_[std::pair<int,int>(eta,depth[k1])] = layMax;
58  for (int lay=layMin; lay<=layMax; ++lay)
59  layer2Depth_[std::pair<int,int>(eta,lay)] = depth[k1];
60  }
61  }
62  for (int eta=ietaMin_; eta<=ietaMax_; ++eta) {
63  int dmin(99), dmax(-1);
64  for (auto & itr : layer2Depth_) {
65  if ((itr.first).first == eta) {
66  if ((itr.second) < dmin) dmin = (itr.second);
67  if ((itr.second) > dmax) dmax = (itr.second);
68  }
69  }
70  if (subdet == 2) {
71  if (eta == ietaMin_) dmin = dep16C_;
72  else if (eta == ietaMax_) dmax = dep29C_;
73  }
74  depthsEta_[eta] = std::pair<int,int>(dmin,dmax);
75  }
76 #ifdef EDM_ML_DEBUG
77  std::cout << "HcalLayerDepthMap: Subdet " << subdet_ << " iEta " << ietaMin_
78  << ":" << ietaMax_ << " depth " << depthMin_ << ":" << depthMax_
79  << "\nMaximum Depth for last HE towers " << dep29C_
80  << " Layer 0 Weight " << wtl0C_ << " iPhi";
81  for (unsigned int k=0; k<iphi_.size(); ++k) std::cout << ":" << iphi_[k];
82  std::cout << std::endl << "Layer2Depth_ with " << layer2Depth_.size()
83  << " elements" << std::endl;
84  for (std::map<std::pair<int,int>,int>::iterator itr=layer2Depth_.begin();
85  itr != layer2Depth_.end(); ++itr)
86  std::cout << "iEta " << (itr->first).first << " Layer "
87  << (itr->first).second << " Depth " << itr->second << std::endl;
88  std::cout << "Depth2LayerFront with " << depth2LayerF_.size()
89  << " elemsts" << std::endl;
90  for (std::map<std::pair<int,int>,int>::iterator itr=depth2LayerF_.begin();
91  itr != depth2LayerF_.end(); ++itr)
92  std::cout << "iEta " << (itr->first).first << " Depth "
93  << (itr->first).second << " Layer " << itr->second << std::endl;
94  std::cout << "Depth2LayerBack with " << depth2LayerB_.size()
95  << " elemets" << std::endl;
96  for (std::map<std::pair<int,int>,int>::iterator itr=depth2LayerB_.begin();
97  itr != depth2LayerB_.end(); ++itr)
98  std::cout << "iEta " << (itr->first).first << " Depth "
99  << (itr->first).second << " Layer " << itr->second << std::endl;
100  std::cout << "DepthsEta_ with " << depthsEta_.size() << " elements\n";
101  for (std::map<int,std::pair<int,int> >::iterator itr=depthsEta_.begin();
102  itr != depthsEta_.end(); ++itr)
103  std::cout << "iEta " << itr->first << " Depths "
104  << (itr->second).first << ":" << (itr->second).second
105  << std::endl;
106 #endif
107 }
U second(std::pair< T, U > const &p)
std::map< int, std::pair< int, int > > depthsEta_
std::map< std::pair< int, int >, int > depth2LayerF_
int k[5][pyjets_maxn]
std::map< std::pair< int, int >, int > layer2Depth_
std::vector< int > iphi_
std::map< std::pair< int, int >, int > depth2LayerB_
static const int maxLayers_
bool HcalLayerDepthMap::isValid ( const int  det,
const int  phi,
const int  zside 
) const

Definition at line 261 of file HcalLayerDepthMap.cc.

References spr::find(), RemoveAddSevLevel::flag, iphi_, and subdet_.

Referenced by ntupleDataFormat._Object::_checkIsValid(), HcalDDDSimConstants::findDepth(), getDepth(), getDepth16(), getDepthMax(), getDepthMin(), getLayer0Wt(), getLayerBack(), getLayerDepth(), getLayerFront(), HcalDDDSimConstants::getMaxDepth(), getMaxDepthLastHE(), HcalDDDSimConstants::getMinDepth(), getPhis(), and core.AutoHandle.AutoHandle::ReallyLoad().

262  {
263  bool flag(false);
264  int kphi = (zside > 0) ? iphi : -iphi;
265  if (subdet == subdet_)
266  flag = (std::find(iphi_.begin(),iphi_.end(),kphi) != iphi_.end());
267  return flag;
268 }
int zside(DetId const &)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
std::vector< int > iphi_
int HcalLayerDepthMap::validDet ( std::vector< int > &  phis) const
std::pair<int,int> HcalLayerDepthMap::validEta ( ) const
inline

Definition at line 50 of file HcalLayerDepthMap.h.

References ietaMax_, and ietaMin_.

Referenced by HcalDDDRecConstants::initialize().

50 {return std::pair<int,int>(ietaMin_,ietaMax_);}

Member Data Documentation

int HcalLayerDepthMap::dep16C_
private

Definition at line 59 of file HcalLayerDepthMap.h.

Referenced by getDepth16(), and initialize().

int HcalLayerDepthMap::dep29C_
private

Definition at line 60 of file HcalLayerDepthMap.h.

Referenced by getMaxDepthLastHE(), HcalLayerDepthMap(), and initialize().

std::map<std::pair<int,int>,int> HcalLayerDepthMap::depth2LayerB_
private

Definition at line 65 of file HcalLayerDepthMap.h.

Referenced by getLayerBack(), and initialize().

std::map<std::pair<int,int>,int> HcalLayerDepthMap::depth2LayerF_
private

Definition at line 64 of file HcalLayerDepthMap.h.

Referenced by getLayerFront(), and initialize().

int HcalLayerDepthMap::depthMax_
private

Definition at line 58 of file HcalLayerDepthMap.h.

Referenced by getDepthMax(), HcalLayerDepthMap(), and initialize().

int HcalLayerDepthMap::depthMin_
private

Definition at line 57 of file HcalLayerDepthMap.h.

Referenced by getDepthMin(), HcalLayerDepthMap(), and initialize().

std::map<int,std::pair<int,int> > HcalLayerDepthMap::depthsEta_
private

Definition at line 66 of file HcalLayerDepthMap.h.

Referenced by getDepths(), and initialize().

int HcalLayerDepthMap::ietaMax_
private

Definition at line 56 of file HcalLayerDepthMap.h.

Referenced by HcalLayerDepthMap(), initialize(), and validEta().

int HcalLayerDepthMap::ietaMin_
private

Definition at line 55 of file HcalLayerDepthMap.h.

Referenced by HcalLayerDepthMap(), initialize(), and validEta().

std::vector<int> HcalLayerDepthMap::iphi_
private

Definition at line 62 of file HcalLayerDepthMap.h.

Referenced by getPhis(), initialize(), isValid(), and validDet().

std::map<std::pair<int,int>,int> HcalLayerDepthMap::layer2Depth_
private

Definition at line 63 of file HcalLayerDepthMap.h.

Referenced by getDepth(), getLayerDepth(), and initialize().

const int HcalLayerDepthMap::maxLayers_ = 18
staticprivate

Definition at line 53 of file HcalLayerDepthMap.h.

Referenced by getDepthMax(), and initialize().

int HcalLayerDepthMap::subdet_
private
double HcalLayerDepthMap::wtl0C_
private

Definition at line 61 of file HcalLayerDepthMap.h.

Referenced by getLayer0Wt(), HcalLayerDepthMap(), and initialize().