CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
EcalIndexingTools Class Reference

#include <EcalIndexingTools.h>

Public Member Functions

double getEtaMax ()
 
int getNumberOfChannels ()
 
int getProgressiveIndex (double, double)
 
void setBinRange (int, double, double, int, double, double)
 
 ~EcalIndexingTools ()
 

Static Public Member Functions

static EcalIndexingToolsgetInstance ()
 

Private Member Functions

 EcalIndexingTools ()
 

Private Attributes

double maxEt_
 
double maxEta_
 
double minEt_
 
double minEta_
 
int nBinsEt_
 
int nBinsEta_
 
int totNumberOfBins_
 

Static Private Attributes

static EcalIndexingToolsinstance_ = nullptr
 

Detailed Description

Definition at line 9 of file EcalIndexingTools.h.

Constructor & Destructor Documentation

EcalIndexingTools::EcalIndexingTools ( )
inlineprivate
EcalIndexingTools::~EcalIndexingTools ( )
inline

Definition at line 21 of file EcalIndexingTools.h.

21 {};

Member Function Documentation

double EcalIndexingTools::getEtaMax ( )
inline

Definition at line 34 of file EcalIndexingTools.h.

References maxEta_.

34 { return maxEta_; };
static EcalIndexingTools* EcalIndexingTools::getInstance ( )
inlinestatic

Definition at line 23 of file EcalIndexingTools.h.

References gather_cfg::cout, EcalIndexingTools(), and instance_.

Referenced by calib::CalibElectron::getCalibModulesWeights(), ZeeCalibration::ZeeCalibration(), and ZIterativeAlgorithmWithFit::ZIterativeAlgorithmWithFit().

23  {
24  if (instance_ == nullptr) {
26 
27  std::cout << "[EcalIndexingTools* getInstance ()] new EcalIndexingTools created " << std::endl;
28  }
29  return instance_;
30  }
static EcalIndexingTools * instance_
tuple cout
Definition: gather_cfg.py:144
int EcalIndexingTools::getNumberOfChannels ( )
inline
int EcalIndexingTools::getProgressiveIndex ( double  myEta,
double  myEt 
)

INITIALIZE BOUNDARIES

Definition at line 27 of file EcalIndexingTools.cc.

References gather_cfg::cout, etaBin(), mps_fire::i, recoMuon::in, maxEt_, maxEta_, minEt_, minEta_, nBinsEt_, and nBinsEta_.

Referenced by calib::CalibElectron::getCalibModulesWeights().

27  {
28  std::cout << "minEt_ " << minEt_ << std::endl;
29  std::cout << "minEta_ " << minEta_ << std::endl;
30  std::cout << "maxEt_ " << maxEt_ << std::endl;
31  std::cout << "maxEta_ " << maxEta_ << std::endl;
32 
34 
35  double BoundaryEt[100] = {-99.};
36  double BoundaryEta[100] = {-99.};
37 
38  for (int i = 0; i < (nBinsEt_ + 1); i++) {
39  BoundaryEt[i] = minEt_ + i * ((maxEt_ - minEt_) / (double)nBinsEt_);
40  // std::cout << "i " << i << " BoundaryEt[i] "<< BoundaryEt[i] <<std::endl;
41  }
42 
43  for (int i = 0; i < (nBinsEta_ + 1); i++) {
44  BoundaryEta[i] = minEta_ + i * ((maxEta_ - minEta_) / (double)nBinsEta_);
45  //std::cout << "i " << i << " BoundaryEta[i] "<< BoundaryEta[i] <<std::endl;
46  }
47 
49  int etBin(-1);
50  int etaBin(-1);
51 
52  for (int i = 0; i < nBinsEta_; i++) {
53  if (myEta > BoundaryEta[i] && myEta <= BoundaryEta[i + 1])
54  etaBin = i;
55  }
56 
57  for (int i = 0; i < nBinsEt_; i++) {
58  if (myEt > BoundaryEt[i] && myEt <= BoundaryEt[i + 1])
59  etBin = i;
60  }
61 
62  // std::cout << " myEta "<< myEta << " myEt "<< myEt << " etaBin "<< etaBin << " etBin "<< etBin << std::endl;
63 
65 
66  int in = etaBin * nBinsEta_ + etBin;
67 
68  //std::cout << "Progressive index " << in << std::endl;
69 
70  return in;
71 }
for(Iditer=Id.begin();Iditer!=Id.end();Iditer++)
tuple cout
Definition: gather_cfg.py:144
int etaBin(const l1t::HGCalMulticluster *cl)
void EcalIndexingTools::setBinRange ( int  nBinsEta,
double  minEta,
double  maxEta,
int  nBinsEt,
double  minEt,
double  maxEt 
)

Definition at line 8 of file EcalIndexingTools.cc.

References maxEt_, maxEta, maxEta_, minEt_, minEta_, nBinsEt_, nBinsEta_, and totNumberOfBins_.

Referenced by ZeeCalibration::ZeeCalibration().

9  {
10  // std::cout<< "[EcalIndexingTools::setBinRange] setting values "<< nBinsEta << " " << minEta << " " << maxEta << std::endl;
11 
12  totNumberOfBins_ = nBinsEta * nBinsEt;
13 
14  nBinsEt_ = nBinsEt;
15  nBinsEta_ = nBinsEta;
16 
17  minEt_ = minEt;
18  minEta_ = minEta;
19  maxEt_ = maxEt;
20  maxEta_ = maxEta;
21 
22  // std::cout<< "[EcalIndexingTools::setBinRange] read back values: "<< nBinsEta_ << " " << minEta_ << " " << maxEta_ << std::endl;
23 
24  return;
25 }
double maxEta

Member Data Documentation

EcalIndexingTools * EcalIndexingTools::instance_ = nullptr
staticprivate

Definition at line 12 of file EcalIndexingTools.h.

Referenced by getInstance().

double EcalIndexingTools::maxEt_
private

Definition at line 18 of file EcalIndexingTools.h.

Referenced by getProgressiveIndex(), and setBinRange().

double EcalIndexingTools::maxEta_
private

Definition at line 18 of file EcalIndexingTools.h.

Referenced by getEtaMax(), getProgressiveIndex(), and setBinRange().

double EcalIndexingTools::minEt_
private

Definition at line 18 of file EcalIndexingTools.h.

Referenced by getProgressiveIndex(), and setBinRange().

double EcalIndexingTools::minEta_
private

Definition at line 18 of file EcalIndexingTools.h.

Referenced by getProgressiveIndex(), and setBinRange().

int EcalIndexingTools::nBinsEt_
private

Definition at line 16 of file EcalIndexingTools.h.

Referenced by getProgressiveIndex(), and setBinRange().

int EcalIndexingTools::nBinsEta_
private

Definition at line 16 of file EcalIndexingTools.h.

Referenced by getProgressiveIndex(), and setBinRange().

int EcalIndexingTools::totNumberOfBins_
private

Definition at line 16 of file EcalIndexingTools.h.

Referenced by getNumberOfChannels(), and setBinRange().