CMS 3D CMS Logo

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::EcalIndexingTools ( )
inlineprivate

Definition at line 11 of file EcalIndexingTools.h.

12  : totNumberOfBins_(-1), nBinsEt_(-1), nBinsEta_(-1), maxEta_(-1.), maxEt_(-1.), minEta_(-1.), minEt_(-1.){};

Referenced by getInstance().

◆ ~EcalIndexingTools()

EcalIndexingTools::~EcalIndexingTools ( )
inline

Definition at line 21 of file EcalIndexingTools.h.

21 {};

Member Function Documentation

◆ getEtaMax()

double EcalIndexingTools::getEtaMax ( )
inline

Definition at line 34 of file EcalIndexingTools.h.

34 { return maxEta_; };

References maxEta_.

◆ getInstance()

static EcalIndexingTools* EcalIndexingTools::getInstance ( )
inlinestatic

Definition at line 23 of file EcalIndexingTools.h.

23  {
24  if (instance_ == nullptr) {
26 
27  std::cout << "[EcalIndexingTools* getInstance ()] new EcalIndexingTools created " << std::endl;
28  }
29  return instance_;
30  }

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

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

◆ getNumberOfChannels()

int EcalIndexingTools::getNumberOfChannels ( )
inline

◆ getProgressiveIndex()

int EcalIndexingTools::getProgressiveIndex ( double  myEta,
double  myEt 
)

INITIALIZE BOUNDARIES

Definition at line 27 of file EcalIndexingTools.cc.

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 }

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

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

◆ setBinRange()

void EcalIndexingTools::setBinRange ( int  nBinsEta,
double  minEta,
double  maxEta,
int  nBinsEt,
double  minEt,
double  maxEt 
)

Definition at line 8 of file EcalIndexingTools.cc.

9  {
10  // std::cout<< "[EcalIndexingTools::setBinRange] setting values "<< nBinsEta << " " << minEta << " " << maxEta << std::endl;
11 
12  totNumberOfBins_ = nBinsEta * nBinsEt;
13 
14  nBinsEt_ = nBinsEt;
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 }

References heavyionUCCDQM_cfi::maxEt, maxEt_, maxEta, maxEta_, EgHLTOffEleSelection_cfi::minEt, minEt_, EgHLTOffEleSelection_cfi::minEta, minEta_, nBinsEt_, hgcalTowerMapProducer_cfi::nBinsEta, nBinsEta_, and totNumberOfBins_.

Referenced by ZeeCalibration::ZeeCalibration().

Member Data Documentation

◆ instance_

EcalIndexingTools * EcalIndexingTools::instance_ = nullptr
staticprivate

Definition at line 12 of file EcalIndexingTools.h.

Referenced by getInstance().

◆ maxEt_

double EcalIndexingTools::maxEt_
private

Definition at line 18 of file EcalIndexingTools.h.

Referenced by getProgressiveIndex(), and setBinRange().

◆ maxEta_

double EcalIndexingTools::maxEta_
private

Definition at line 18 of file EcalIndexingTools.h.

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

◆ minEt_

double EcalIndexingTools::minEt_
private

Definition at line 18 of file EcalIndexingTools.h.

Referenced by getProgressiveIndex(), and setBinRange().

◆ minEta_

double EcalIndexingTools::minEta_
private

Definition at line 18 of file EcalIndexingTools.h.

Referenced by getProgressiveIndex(), and setBinRange().

◆ nBinsEt_

int EcalIndexingTools::nBinsEt_
private

Definition at line 16 of file EcalIndexingTools.h.

Referenced by getProgressiveIndex(), and setBinRange().

◆ nBinsEta_

int EcalIndexingTools::nBinsEta_
private

Definition at line 16 of file EcalIndexingTools.h.

Referenced by getProgressiveIndex(), and setBinRange().

◆ totNumberOfBins_

int EcalIndexingTools::totNumberOfBins_
private

Definition at line 16 of file EcalIndexingTools.h.

Referenced by getNumberOfChannels(), and setBinRange().

EcalIndexingTools::maxEt_
double maxEt_
Definition: EcalIndexingTools.h:18
mps_fire.i
i
Definition: mps_fire.py:428
etaBin
int etaBin(const l1t::HGCalMulticluster *cl)
Definition: L1EGammaEEProducer.cc:19
EcalIndexingTools::minEta_
double minEta_
Definition: EcalIndexingTools.h:18
gather_cfg.cout
cout
Definition: gather_cfg.py:144
EcalIndexingTools::EcalIndexingTools
EcalIndexingTools()
Definition: EcalIndexingTools.h:11
EcalIndexingTools::instance_
static EcalIndexingTools * instance_
Definition: EcalIndexingTools.h:12
EgHLTOffEleSelection_cfi.minEt
minEt
Definition: EgHLTOffEleSelection_cfi.py:10
hgcalTowerMapProducer_cfi.nBinsEta
nBinsEta
Definition: hgcalTowerMapProducer_cfi.py:9
maxEta
double maxEta
Definition: PFJetBenchmarkAnalyzer.cc:76
recoMuon::in
Definition: RecoMuonEnumerators.h:6
EcalIndexingTools::minEt_
double minEt_
Definition: EcalIndexingTools.h:18
heavyionUCCDQM_cfi.maxEt
maxEt
Definition: heavyionUCCDQM_cfi.py:14
EcalIndexingTools::nBinsEt_
int nBinsEt_
Definition: EcalIndexingTools.h:16
EcalIndexingTools::nBinsEta_
int nBinsEta_
Definition: EcalIndexingTools.h:16
photonAnalyzer_cfi.etBin
etBin
Definition: photonAnalyzer_cfi.py:53
EcalIndexingTools::maxEta_
double maxEta_
Definition: EcalIndexingTools.h:18
EgHLTOffEleSelection_cfi.minEta
minEta
Definition: EgHLTOffEleSelection_cfi.py:11
EcalIndexingTools::totNumberOfBins_
int totNumberOfBins_
Definition: EcalIndexingTools.h:16