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 110 of file HcalLayerDepthMap.cc.

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

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

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

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

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

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

Definition at line 146 of file HcalLayerDepthMap.cc.

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

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

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

Definition at line 156 of file HcalLayerDepthMap.cc.

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

157  {
158  int depth = (isValid(subdet,iphi,zside)) ? getDepth(subdet,ieta,iphi,zside,maxLayers_) : -1;
159 #ifdef EDM_ML_DEBUG
160  std::cout << "getDepthMax::Input " << subdet << ":" << iphi << ":" << zside
161  << " Output " << depth << std::endl;
162 #endif
163  return depth;
164 }
bool isValid(const int det, const int phi, const int zside) 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 136 of file HcalLayerDepthMap.cc.

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

Referenced by getSubdet().

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

Definition at line 166 of file HcalLayerDepthMap.cc.

References depthsEta_.

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

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

Definition at line 254 of file HcalLayerDepthMap.cc.

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

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

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

Definition at line 188 of file HcalLayerDepthMap.cc.

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

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

190  {
191  int layer(-1);
192  if (isValid(subdet,iphi,zside)) {
193  std::map<std::pair<int,int>,int>::const_iterator itr = depth2LayerB_.find(std::pair<int,int>(ieta,depth));
194  if (itr != depth2LayerB_.end()) layer = itr->second;
195  }
196 #ifdef EDM_ML_DEBUG
197  std::cout << "getLayerBack::Input " << subdet << ":" << ieta << ":" << iphi
198  << ":" << zside << ":" << depth << " Output " << layer <<std::endl;
199 #endif
200  return layer;
201 }
bool isValid(const int det, const int phi, const int zside) 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 203 of file HcalLayerDepthMap.cc.

References gather_cfg::cout, stringResolutionProvider_cfi::eta, isValid(), layer2Depth_, genParticles_cff::map, and edm::second().

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

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

References gather_cfg::cout, stringResolutionProvider_cfi::eta, layer2Depth_, genParticles_cff::map, edm::second(), and subdet_.

225  {
226  layers.clear();
227  if (subdet_ > 0) {
228  for (std::map<std::pair<int,int>,int>::const_iterator itr=layer2Depth_.begin();
229  itr != layer2Depth_.end(); ++itr) {
230  if ((itr->first).first == eta) {
231  layers[((itr->first).second)+1] = (itr->second);
232  }
233  }
234  }
235 #ifdef EDM_ML_DEBUG
236  std::cout << "getLayerDepth::Input " << eta << " Output " << layers.size()
237  << " entries\n";
238  for (std::map<int,int>::iterator itr=layers.begin(); itr != layers.end();
239  ++itr) std::cout << " [" << itr->first << "] " << itr->second;
240  std::cout << std::endl;
241 #endif
242 }
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 173 of file HcalLayerDepthMap.cc.

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

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

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

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

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

245  {
246  int depth = isValid(subdet,iphi,zside) ? dep29C_ : -1;
247 #ifdef EDM_ML_DEBUG
248  std::cout << "getMaxDepthLastHE::Input " << subdet << ":" << iphi << ":"
249  << zside << " Output " << depth << std::endl;
250 #endif
251  return depth;
252 }
bool isValid(const int det, const int phi, const int zside) 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_, stringResolutionProvider_cfi::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 (std::map<std::pair<int,int>,int>::iterator itr=layer2Depth_.begin();
65  itr != layer2Depth_.end(); ++itr) {
66  if ((itr->first).first == eta) {
67  if ((itr->second) < dmin) dmin = (itr->second);
68  if ((itr->second) > dmax) dmax = (itr->second);
69  }
70  }
71  if (subdet == 2) {
72  if (eta == ietaMin_) dmin = dep16C_;
73  else if (eta == ietaMax_) dmax = dep29C_;
74  }
75  depthsEta_[eta] = std::pair<int,int>(dmin,dmax);
76  }
77 #ifdef EDM_ML_DEBUG
78  std::cout << "HcalLayerDepthMap: Subdet " << subdet_ << " iEta " << ietaMin_
79  << ":" << ietaMax_ << " depth " << depthMin_ << ":" << depthMax_
80  << "\nMaximum Depth for last HE towers " << dep29C_
81  << " Layer 0 Weight " << wtl0C_ << " iPhi";
82  for (unsigned int k=0; k<iphi_.size(); ++k) std::cout << ":" << iphi_[k];
83  std::cout << std::endl << "Layer2Depth_ with " << layer2Depth_.size()
84  << " elements" << std::endl;
85  for (std::map<std::pair<int,int>,int>::iterator itr=layer2Depth_.begin();
86  itr != layer2Depth_.end(); ++itr)
87  std::cout << "iEta " << (itr->first).first << " Layer "
88  << (itr->first).second << " Depth " << itr->second << std::endl;
89  std::cout << "Depth2LayerFront with " << depth2LayerF_.size()
90  << " elemsts" << std::endl;
91  for (std::map<std::pair<int,int>,int>::iterator itr=depth2LayerF_.begin();
92  itr != depth2LayerF_.end(); ++itr)
93  std::cout << "iEta " << (itr->first).first << " Depth "
94  << (itr->first).second << " Layer " << itr->second << std::endl;
95  std::cout << "Depth2LayerBack with " << depth2LayerB_.size()
96  << " elemets" << std::endl;
97  for (std::map<std::pair<int,int>,int>::iterator itr=depth2LayerB_.begin();
98  itr != depth2LayerB_.end(); ++itr)
99  std::cout << "iEta " << (itr->first).first << " Depth "
100  << (itr->first).second << " Layer " << itr->second << std::endl;
101  std::cout << "DepthsEta_ with " << depthsEta_.size() << " elements\n";
102  for (std::map<int,std::pair<int,int> >::iterator itr=depthsEta_.begin();
103  itr != depthsEta_.end(); ++itr)
104  std::cout << "iEta " << itr->first << " Depths "
105  << (itr->second).first << ":" << (itr->second).second
106  << std::endl;
107 #endif
108 }
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 264 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().

265  {
266  bool flag(false);
267  int kphi = (zside > 0) ? iphi : -iphi;
268  if (subdet == subdet_)
269  flag = (std::find(iphi_.begin(),iphi_.end(),kphi) != iphi_.end());
270  return flag;
271 }
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().