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

◆ ~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.

References maxEta_.

34 { return maxEta_; };

◆ getInstance()

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_

◆ getNumberOfChannels()

int EcalIndexingTools::getNumberOfChannels ( )
inline

◆ getProgressiveIndex()

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

INITIALIZE BOUNDARIES

Definition at line 27 of file EcalIndexingTools.cc.

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().

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 }
int etaBin(const l1t::HGCalMulticluster *cl)

◆ setBinRange()

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

Definition at line 8 of file EcalIndexingTools.cc.

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().

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 }
double maxEta

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().