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);
65 if ((itr.first).first ==
eta) {
66 if ((itr.second) < dmin) dmin = (itr.second);
67 if ((itr.second) > dmax) dmax = (itr.second);
79 <<
"\nMaximum Depth for last HE towers " <<
dep29C_ 80 <<
" Layer 0 Weight " <<
wtl0C_ <<
" iPhi";
83 <<
" elements" << std::endl;
86 std::cout <<
"iEta " << (itr->first).first <<
" Layer " 87 << (itr->first).
second <<
" Depth " << itr->second << std::endl;
89 <<
" elemsts" << std::endl;
92 std::cout <<
"iEta " << (itr->first).first <<
" Depth " 93 << (itr->first).
second <<
" Layer " << itr->second << std::endl;
95 <<
" elemets" << std::endl;
98 std::cout <<
"iEta " << (itr->first).first <<
" Depth " 99 << (itr->first).
second <<
" Layer " << itr->second << std::endl;
103 std::cout <<
"iEta " << itr->first <<
" Depths " 104 << (itr->second).first <<
":" << (itr->second).
second 110 const int iphi,
const int zside,
111 const int layer)
const {
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));
118 std::cout <<
"getDepth::Input " << subdet <<
":" << ieta <<
":" << iphi
119 <<
":" << zside <<
":" << layer <<
" Output " << depth <<std::endl;
125 const int zside)
const {
129 std::cout <<
"getDepth16::Input " << subdet <<
":" << iphi <<
":" << zside
130 <<
" Output " << depth << std::endl;
136 const int zside)
const {
139 std::cout <<
"getDepthMin::Input " << subdet <<
":" << iphi <<
":" << zside
140 <<
" Output " << depth << std::endl;
146 const int zside)
const {
149 std::cout <<
"getDepthMax::Input " << subdet <<
":" << iphi <<
":" << zside
150 <<
" Output " << depth << std::endl;
156 const int iphi,
const int zside)
const {
159 std::cout <<
"getDepthMax::Input " << subdet <<
":" << iphi <<
":" << zside
160 <<
" Output " << depth << std::endl;
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;
173 const int iphi,
const int zside,
174 const int depth)
const {
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));
181 std::cout <<
"getLayerFront::Input " << subdet <<
":" << ieta <<
":" << iphi
182 <<
":" << zside <<
":" << depth <<
" Output " << layer <<std::endl;
188 const int iphi,
const int zside,
189 const int depth)
const {
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));
196 std::cout <<
"getLayerBack::Input " << subdet <<
":" << ieta <<
":" << iphi
197 <<
":" << zside <<
":" << depth <<
" Output " << layer <<std::endl;
204 std::map<int,int>&
layers)
const {
206 if (
isValid(subdet,phi,zside)) {
208 if ((itr.first).first == eta) {
209 layers[((itr.first).
second)+1] = (itr.second);
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;
223 std::map<int,int>&
layers)
const {
227 if ((itr.first).first == eta) {
228 layers[((itr.first).
second)+1] = (itr.second);
233 std::cout <<
"getLayerDepth::Input " << eta <<
" Output " << layers.size()
235 for (std::map<int,int>::iterator itr=layers.begin(); itr != layers.end();
236 ++itr)
std::cout <<
" [" << itr->first <<
"] " << itr->second;
242 const int zside)
const {
245 std::cout <<
"getMaxDepthLastHE::Input " << subdet <<
":" << iphi <<
":" 246 << zside <<
" Output " << depth << std::endl;
252 const int zside)
const {
255 std::cout <<
"getLayer0Wt::Input " << subdet <<
":" << iphi <<
":" << zside
256 <<
" Output " << wt << std::endl;
262 const int zside)
const {
264 int kphi = (zside > 0) ? iphi : -iphi;
272 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