CMS 3D CMS Logo

Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes

EcalIndexingTools Class Reference

#include <EcalIndexingTools.h>

List of all members.

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 11 of file EcalIndexingTools.h.


Constructor & Destructor Documentation

EcalIndexingTools::EcalIndexingTools ( ) [inline, private]

Definition at line 16 of file EcalIndexingTools.h.

Referenced by getInstance().

:totNumberOfBins_(-1), nBinsEt_(-1),  nBinsEta_(-1), maxEta_(-1.), maxEt_(-1.), minEta_(-1.), minEt_(-1.){}; 
EcalIndexingTools::~EcalIndexingTools ( ) [inline]

Definition at line 26 of file EcalIndexingTools.h.

{};

Member Function Documentation

double EcalIndexingTools::getEtaMax ( ) [inline]

Definition at line 41 of file EcalIndexingTools.h.

References maxEta_.

{return maxEta_;};
static EcalIndexingTools* EcalIndexingTools::getInstance ( ) [inline, static]

Definition at line 28 of file EcalIndexingTools.h.

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

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

                                           {
    if (instance_ == 0 ){
      instance_ = new EcalIndexingTools();

      std::cout<< "[EcalIndexingTools* getInstance ()] new EcalIndexingTools created "<< std::endl;
     
    }
    return instance_;
  }
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, i, recoMuon::in, maxEt_, maxEta_, minEt_, minEta_, nBinsEt_, and nBinsEta_.

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

                                                                   {
  

  std::cout << "minEt_ " << minEt_ <<std::endl;
  std::cout << "minEta_ " << minEta_ <<std::endl;
  std::cout << "maxEt_ " << maxEt_ <<std::endl;
  std::cout << "maxEta_ " << maxEta_ <<std::endl;
  
  
  double BoundaryEt[100] = {-99.};
  double BoundaryEta[100] = {-99.};
  
  for( int i = 0; i < ( nBinsEt_ + 1 ); i++ ){
    
    BoundaryEt[i] = minEt_ +  i * ( (maxEt_ - minEt_)/ (double)nBinsEt_ );
    //    std::cout << "i " << i << " BoundaryEt[i] "<< BoundaryEt[i] <<std::endl;

  }
  
  for( int i = 0; i < ( nBinsEta_ + 1 ); i++ ){
    
    BoundaryEta[i] = minEta_ +  i * ( (maxEta_ - minEta_)/ (double)nBinsEta_ );
    //std::cout << "i " << i << " BoundaryEta[i] "<< BoundaryEta[i] <<std::endl;
  
  }
  
  int etBin(-1);
  int etaBin(-1);
  
  for( int i = 0; i <  nBinsEta_ ; i++ ){
    if( myEta > BoundaryEta[i] && 
        myEta <= BoundaryEta[i+1] )
      etaBin=i;
  }
  
  for( int i = 0; i <  nBinsEt_ ; i++ ){
    if( myEt > BoundaryEt[i] && 
        myEt <= BoundaryEt[i+1] )
      etBin=i;
  }

  // std::cout << " myEta "<< myEta << " myEt "<< myEt << " etaBin "<< etaBin << " etBin "<< etBin << std::endl;
  
  
  int in =  etaBin * nBinsEta_ + etBin;
  
  //std::cout << "Progressive index " << in << std::endl;

  return in;
  
}
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_, benchmark_cfg::minEta, minEta_, nBinsEt_, nBinsEta_, and totNumberOfBins_.

Referenced by ZeeCalibration::ZeeCalibration().

                                                                                                                      {
  
  //  std::cout<< "[EcalIndexingTools::setBinRange] setting values "<< nBinsEta << " " << minEta << " " << maxEta << std::endl; 

  totNumberOfBins_ = nBinsEta*nBinsEt;
  
  nBinsEt_ = nBinsEt;
  nBinsEta_ = nBinsEta;
  
  minEt_ = minEt;
  minEta_ = minEta;
  maxEt_ = maxEt;
  maxEta_ = maxEta;
  
  //  std::cout<< "[EcalIndexingTools::setBinRange] read back values: "<< nBinsEta_ << " " << minEta_ << " " << maxEta_ << std::endl; 
  
  return;
  
}

Member Data Documentation

Definition at line 16 of file EcalIndexingTools.h.

Referenced by getInstance().

double EcalIndexingTools::maxEt_ [private]

Definition at line 22 of file EcalIndexingTools.h.

Referenced by getProgressiveIndex(), and setBinRange().

double EcalIndexingTools::maxEta_ [private]

Definition at line 22 of file EcalIndexingTools.h.

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

double EcalIndexingTools::minEt_ [private]

Definition at line 22 of file EcalIndexingTools.h.

Referenced by getProgressiveIndex(), and setBinRange().

double EcalIndexingTools::minEta_ [private]

Definition at line 22 of file EcalIndexingTools.h.

Referenced by getProgressiveIndex(), and setBinRange().

Definition at line 20 of file EcalIndexingTools.h.

Referenced by getProgressiveIndex(), and setBinRange().

Definition at line 20 of file EcalIndexingTools.h.

Referenced by getProgressiveIndex(), and setBinRange().

Definition at line 20 of file EcalIndexingTools.h.

Referenced by getNumberOfChannels(), and setBinRange().