test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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_ = 0
 

Detailed Description

Definition at line 10 of file EcalIndexingTools.h.

Constructor & Destructor Documentation

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

Definition at line 25 of file EcalIndexingTools.h.

25 {};

Member Function Documentation

double EcalIndexingTools::getEtaMax ( )
inline

Definition at line 40 of file EcalIndexingTools.h.

References maxEta_.

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

Definition at line 27 of file EcalIndexingTools.h.

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

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

27  {
28  if (instance_ == 0 ){
30 
31  std::cout<< "[EcalIndexingTools* getInstance ()] new EcalIndexingTools created "<< std::endl;
32 
33  }
34  return instance_;
35  }
static EcalIndexingTools * instance_
tuple cout
Definition: gather_cfg.py:145
int EcalIndexingTools::getNumberOfChannels ( )
inline
int EcalIndexingTools::getProgressiveIndex ( double  myEta,
double  myEt 
)

INITIALIZE BOUNDARIES

Definition at line 30 of file EcalIndexingTools.cc.

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

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

30  {
31 
32 
33  std::cout << "minEt_ " << minEt_ <<std::endl;
34  std::cout << "minEta_ " << minEta_ <<std::endl;
35  std::cout << "maxEt_ " << maxEt_ <<std::endl;
36  std::cout << "maxEta_ " << maxEta_ <<std::endl;
37 
39 
40  double BoundaryEt[100] = {-99.};
41  double BoundaryEta[100] = {-99.};
42 
43  for( int i = 0; i < ( nBinsEt_ + 1 ); i++ ){
44 
45  BoundaryEt[i] = minEt_ + i * ( (maxEt_ - minEt_)/ (double)nBinsEt_ );
46  // std::cout << "i " << i << " BoundaryEt[i] "<< BoundaryEt[i] <<std::endl;
47 
48  }
49 
50  for( int i = 0; i < ( nBinsEta_ + 1 ); i++ ){
51 
52  BoundaryEta[i] = minEta_ + i * ( (maxEta_ - minEta_)/ (double)nBinsEta_ );
53  //std::cout << "i " << i << " BoundaryEta[i] "<< BoundaryEta[i] <<std::endl;
54 
55  }
56 
58  int etBin(-1);
59  int etaBin(-1);
60 
61  for( int i = 0; i < nBinsEta_ ; i++ ){
62  if( myEta > BoundaryEta[i] &&
63  myEta <= BoundaryEta[i+1] )
64  etaBin=i;
65  }
66 
67  for( int i = 0; i < nBinsEt_ ; i++ ){
68  if( myEt > BoundaryEt[i] &&
69  myEt <= BoundaryEt[i+1] )
70  etBin=i;
71  }
72 
73  // std::cout << " myEta "<< myEta << " myEt "<< myEt << " etaBin "<< etaBin << " etBin "<< etBin << std::endl;
74 
76 
77  int in = etaBin * nBinsEta_ + etBin;
78 
79  //std::cout << "Progressive index " << in << std::endl;
80 
81  return in;
82 
83 }
int i
Definition: DBlmapReader.cc:9
tuple cout
Definition: gather_cfg.py:145
for(const auto &isodef:isoDefs)
void EcalIndexingTools::setBinRange ( int  nBinsEta,
double  minEta,
double  maxEta,
int  nBinsEt,
double  minEt,
double  maxEt 
)

Definition at line 9 of file EcalIndexingTools.cc.

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

Referenced by ZeeCalibration::ZeeCalibration().

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

Member Data Documentation

EcalIndexingTools * EcalIndexingTools::instance_ = 0
staticprivate

Definition at line 15 of file EcalIndexingTools.h.

Referenced by getInstance().

double EcalIndexingTools::maxEt_
private

Definition at line 21 of file EcalIndexingTools.h.

Referenced by getProgressiveIndex(), and setBinRange().

double EcalIndexingTools::maxEta_
private

Definition at line 21 of file EcalIndexingTools.h.

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

double EcalIndexingTools::minEt_
private

Definition at line 21 of file EcalIndexingTools.h.

Referenced by getProgressiveIndex(), and setBinRange().

double EcalIndexingTools::minEta_
private

Definition at line 21 of file EcalIndexingTools.h.

Referenced by getProgressiveIndex(), and setBinRange().

int EcalIndexingTools::nBinsEt_
private

Definition at line 19 of file EcalIndexingTools.h.

Referenced by getProgressiveIndex(), and setBinRange().

int EcalIndexingTools::nBinsEta_
private

Definition at line 19 of file EcalIndexingTools.h.

Referenced by getProgressiveIndex(), and setBinRange().

int EcalIndexingTools::totNumberOfBins_
private

Definition at line 19 of file EcalIndexingTools.h.

Referenced by getNumberOfChannels(), and setBinRange().