CMS 3D CMS Logo

FindEtaPhi.cc
Go to the documentation of this file.
2 #include <iostream>
3 
4 //#define EDM_ML_DEBUG
5 
6 namespace spr {
7 
9  int iphi,
10  bool
11 #ifdef EDM_ML_DEBUG
12  debug
13 #endif
14  ) {
15 
16  int ietal = (ieta - 1) / 2;
17  int ietar = ieta - ietal - 1;
18  int iphil = (iphi - 1) / 2;
19  int iphir = iphi - iphil - 1;
21  etaphi.ietaE[0] = ietal;
22  etaphi.ietaW[0] = ietar;
23  etaphi.iphiN[0] = iphil;
24  etaphi.iphiS[0] = iphir;
25  if (ietal == ietar && iphil == iphir) {
26  etaphi.ntrys = 1;
27  } else if (ietal == ietar || iphil == iphir) {
28  etaphi.ntrys = 2;
29  etaphi.ietaE[1] = ietar;
30  etaphi.ietaW[1] = ietal;
31  etaphi.iphiN[1] = iphir;
32  etaphi.iphiS[1] = iphil;
33  } else {
34  etaphi.ntrys = 4;
35  etaphi.ietaE[1] = ietar;
36  etaphi.ietaW[1] = ietal;
37  etaphi.iphiN[1] = iphil;
38  etaphi.iphiS[1] = iphir;
39  etaphi.ietaE[2] = ietal;
40  etaphi.ietaW[1] = ietar;
41  etaphi.iphiN[2] = iphir;
42  etaphi.iphiS[1] = iphil;
43  etaphi.ietaE[3] = ietar;
44  etaphi.ietaW[1] = ietal;
45  etaphi.iphiN[3] = iphir;
46  etaphi.iphiS[1] = iphil;
47  }
48 
49 #ifdef EDM_ML_DEBUG
50  if (debug) {
51  std::cout << "getEtaPhi:: Has " << etaphi.ntrys << " possibilites for " << ieta << "X" << iphi << " matrix"
52  << std::endl;
53  for (int itry = 0; itry < etaphi.ntrys; itry++) {
54  std::cout << "Trial " << itry << " with etaE|etaW " << etaphi.ietaE[itry] << "|" << etaphi.ietaW[itry]
55  << " and phiN|PhiS " << etaphi.iphiN[itry] << "|" << etaphi.iphiS[itry] << std::endl;
56  }
57  }
58 #endif
59  return etaphi;
60  }
61 } // namespace spr
spr
Definition: CaloConstants.h:6
FindEtaPhi.h
gather_cfg.cout
cout
Definition: gather_cfg.py:144
LEDCalibrationChannels.iphi
iphi
Definition: LEDCalibrationChannels.py:64
debug
#define debug
Definition: HDRShower.cc:19
spr::getEtaPhi
void getEtaPhi(HBHERecHitCollection::const_iterator hit, std::vector< int > &RH_ieta, std::vector< int > &RH_iphi, std::vector< double > &RH_ene, bool debug=false)
Definition: FindDistCone.cc:119
LEDCalibrationChannels.ieta
ieta
Definition: LEDCalibrationChannels.py:63
spr::EtaPhi
Definition: FindEtaPhi.h:14
EDM_ML_DEBUG
#define EDM_ML_DEBUG
Definition: AnalyzerMinbias.cc:56
fastmath::etaphi
std::pair< T, T > etaphi(T x, T y, T z)
Definition: FastMath.h:162