CMS 3D CMS Logo

Public Member Functions | Private Attributes

testEcalTPGScale Class Reference

#include <testEcalTPGScale.h>

Inheritance diagram for testEcalTPGScale:
edm::EDAnalyzer

List of all members.

Public Member Functions

virtual void analyze (const edm::Event &evt, const edm::EventSetup &evtSetup)
virtual void beginJob ()
 testEcalTPGScale (edm::ParameterSet const &pSet)

Private Attributes

edm::ESHandle
< EcalTrigTowerConstituentsMap
eTTmap_
const CaloSubdetectorGeometrytheBarrelGeometry_
const CaloSubdetectorGeometrytheEndcapGeometry_

Detailed Description

Definition at line 23 of file testEcalTPGScale.h.


Constructor & Destructor Documentation

testEcalTPGScale::testEcalTPGScale ( edm::ParameterSet const &  pSet) [explicit]

Definition at line 14 of file testEcalTPGScale.cc.

References gather_cfg::cout.

{
  std::cout<<"I'm going to check the internal consistancy of EcalTPGScale transformation..."<<std::endl ;
}

Member Function Documentation

void testEcalTPGScale::analyze ( const edm::Event evt,
const edm::EventSetup evtSetup 
) [virtual]

Implements edm::EDAnalyzer.

Definition at line 19 of file testEcalTPGScale.cc.

References gather_cfg::cout, DetId::Ecal, EcalBarrel, EcalEndcap, error, eTTmap_, edm::EventSetup::get(), CaloSubdetectorGeometry::getValidDetIds(), EcalTPGScale::setEventSetup(), theBarrelGeometry_, theEndcapGeometry_, EBDetId::tower(), and funct::true.

{
  using namespace edm;
  using namespace std;

  // geometry
  ESHandle<CaloGeometry> theGeometry;
  ESHandle<CaloSubdetectorGeometry> theEndcapGeometry_handle, theBarrelGeometry_handle;
  evtSetup.get<CaloGeometryRecord>().get( theGeometry );
  evtSetup.get<EcalEndcapGeometryRecord>().get("EcalEndcap",theEndcapGeometry_handle);
  evtSetup.get<EcalBarrelGeometryRecord>().get("EcalBarrel",theBarrelGeometry_handle);
  evtSetup.get<IdealGeometryRecord>().get(eTTmap_);
  theEndcapGeometry_ = &(*theEndcapGeometry_handle);
  theBarrelGeometry_ = &(*theBarrelGeometry_handle);

  EcalTPGScale ecalScale ;
  ecalScale.setEventSetup(evtSetup) ;

  bool error(false) ;
  vector<DetId>::const_iterator it ;

  // EB
  const std::vector<DetId>& ebCells = theBarrelGeometry_->getValidDetIds(DetId::Ecal, EcalBarrel);
  it = ebCells.begin() ;
  const EBDetId idEB(*it) ;
  const EcalTrigTowerDetId towidEB = idEB.tower();
  for (unsigned int ADC=0 ; ADC<256 ; ADC++) {
    double gev = ecalScale.getTPGInGeV(ADC, towidEB) ;
    unsigned int tpgADC = ecalScale.getTPGInADC(gev, towidEB) ;
    if (tpgADC != ADC) {
      error = true ;
      cout<<" ERROR : with ADC = "<<ADC<<" getTPGInGeV = "<<gev<<" getTPGInADC = "<<tpgADC<<endl ;
    }
    ecalScale.getLinearizedTPG(ADC, towidEB) ;
  }

  // EE
  const std::vector<DetId>& eeCells = theEndcapGeometry_->getValidDetIds(DetId::Ecal, EcalEndcap);
  it = eeCells.begin() ;
  const EEDetId idEE(*it);
  const EcalTrigTowerDetId towidEE = (*eTTmap_).towerOf(idEE) ;
  for (unsigned int ADC=0 ; ADC<256 ; ADC++) {
    double gev = ecalScale.getTPGInGeV(ADC, towidEE) ;
    unsigned int tpgADC = ecalScale.getTPGInADC(gev, towidEE) ;
    if (tpgADC != ADC) {
      error = true ;
      cout<<" ERROR : with ADC = "<<ADC<<" getTPGInGeV = "<<gev<<" getTPGInADC = "<<tpgADC<<endl ;
    }
    ecalScale.getLinearizedTPG(ADC, towidEE) ;
  }


  if (!error) cout<<" there is no error with EcalTPGScale internal consistancy "<<endl ;

}
void testEcalTPGScale::beginJob ( void  ) [virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 75 of file testEcalTPGScale.cc.

{
  using namespace edm;
  using namespace std;

}

Member Data Documentation

Definition at line 33 of file testEcalTPGScale.h.

Referenced by analyze().

Definition at line 32 of file testEcalTPGScale.h.

Referenced by analyze().

Definition at line 31 of file testEcalTPGScale.h.

Referenced by analyze().