21 const int dep16C,
const int dep29C,
23 std::vector<int>
const& iphi,
24 std::vector<int>
const& ieta,
25 std::vector<int>
const& layer,
26 std::vector<int>
const&
depth) {
33 iphi_.insert(
iphi_.end(),iphi.begin(),iphi.end());
37 for (
unsigned int k=0;
k<ieta.size(); ++
k) {
43 for (
unsigned int k1=0; k1<ieta.size(); ++k1) {
44 int ietaMin = ieta[k1];
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;
55 for (
int eta=ietaMin;
eta<=ietaMax; ++
eta) {
58 for (
int lay=layMin; lay<=layMax; ++lay)
63 int dmin(99), dmax(-1);
66 if ((itr->first).first ==
eta) {
67 if ((itr->second) < dmin) dmin = (itr->second);
68 if ((itr->second) > dmax) dmax = (itr->second);
80 <<
"\nMaximum Depth for last HE towers " <<
dep29C_ 81 <<
" Layer 0 Weight " <<
wtl0C_ <<
" iPhi";
84 <<
" elements" << std::endl;
87 std::cout <<
"iEta " << (itr->first).first <<
" Layer " 88 << (itr->first).
second <<
" Depth " << itr->second << std::endl;
90 <<
" elemsts" << std::endl;
93 std::cout <<
"iEta " << (itr->first).first <<
" Depth " 94 << (itr->first).
second <<
" Layer " << itr->second << std::endl;
96 <<
" elemets" << std::endl;
99 std::cout <<
"iEta " << (itr->first).first <<
" Depth " 100 << (itr->first).
second <<
" Layer " << itr->second << std::endl;
104 std::cout <<
"iEta " << itr->first <<
" Depths " 105 << (itr->second).first <<
":" << (itr->second).
second 111 const int iphi,
const int zside,
112 const int layer)
const {
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));
119 std::cout <<
"getDepth::Input " << subdet <<
":" << ieta <<
":" << iphi
120 <<
":" << zside <<
":" << layer <<
" Output " << depth <<std::endl;
126 const int zside)
const {
130 std::cout <<
"getDepth16::Input " << subdet <<
":" << iphi <<
":" << zside
131 <<
" Output " << depth << std::endl;
137 const int zside)
const {
140 std::cout <<
"getDepthMin::Input " << subdet <<
":" << iphi <<
":" << zside
141 <<
" Output " << depth << std::endl;
147 const int zside)
const {
150 std::cout <<
"getDepthMax::Input " << subdet <<
":" << iphi <<
":" << zside
151 <<
" Output " << depth << std::endl;
157 const int iphi,
const int zside)
const {
160 std::cout <<
"getDepthMax::Input " << subdet <<
":" << iphi <<
":" << zside
161 <<
" Output " << depth << std::endl;
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;
174 const int iphi,
const int zside,
175 const int depth)
const {
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));
182 std::cout <<
"getLayerFront::Input " << subdet <<
":" << ieta <<
":" << iphi
183 <<
":" << zside <<
":" << depth <<
" Output " << layer <<std::endl;
189 const int iphi,
const int zside,
190 const int depth)
const {
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));
197 std::cout <<
"getLayerBack::Input " << subdet <<
":" << ieta <<
":" << iphi
198 <<
":" << zside <<
":" << depth <<
" Output " << layer <<std::endl;
205 std::map<int,int>&
layers)
const {
207 if (
isValid(subdet,phi,zside)) {
210 if ((itr->first).first ==
eta) {
211 layers[((itr->first).
second)+1] = (itr->second);
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;
225 std::map<int,int>&
layers)
const {
230 if ((itr->first).first ==
eta) {
231 layers[((itr->first).
second)+1] = (itr->second);
236 std::cout <<
"getLayerDepth::Input " << eta <<
" Output " << layers.size()
238 for (std::map<int,int>::iterator itr=layers.begin(); itr != layers.end();
239 ++itr)
std::cout <<
" [" << itr->first <<
"] " << itr->second;
245 const int zside)
const {
248 std::cout <<
"getMaxDepthLastHE::Input " << subdet <<
":" << iphi <<
":" 249 << zside <<
" Output " << depth << std::endl;
255 const int zside)
const {
258 std::cout <<
"getLayer0Wt::Input " << subdet <<
":" << iphi <<
":" << zside
259 <<
" Output " << wt << std::endl;
265 const int zside)
const {
267 int kphi = (zside > 0) ? iphi : -iphi;
275 phi.insert(phi.end(),
iphi_.begin(),
iphi_.end());
std::vector< LayerSetAndLayers > layers(const SeedingLayerSetsHits &sets)
void getLayerDepth(const int subdet, const int ieta, const int iphi, const int zside, std::map< int, int > &layers) const
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
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
int getLayerBack(const int subdet, const int ieta, const int iphi, const int zside, const int depth) const
int getLayerFront(const int subdet, const int ieta, const int iphi, const int zside, const int depth) const
U second(std::pair< T, U > const &p)
std::pair< int, int > getDepths(const int eta) const
std::map< int, std::pair< int, int > > depthsEta_
int validDet(std::vector< int > &phis) const
std::map< std::pair< int, int >, int > depth2LayerF_
int getMaxDepthLastHE(const int subdet, const int iphi, const int zside) const
int getDepth(const int subdet, const int ieta, const int iphi, const int zside, const int layer) const
int getDepthMin(const int subdet, const int iphi, const int zside) const
double getLayer0Wt(const int subdet, const int iphi, const int zside) const
int getDepth16(const int subdet, const int iphi, const int zside) const
std::map< std::pair< int, int >, int > layer2Depth_
std::map< std::pair< int, int >, int > depth2LayerB_
static const int maxLayers_
int getDepthMax(const int subdet, const int iphi, const int zside) const