#include <testEcalTPGScale.h>
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 CaloSubdetectorGeometry * | theBarrelGeometry_ |
const CaloSubdetectorGeometry * | theEndcapGeometry_ |
Definition at line 23 of file testEcalTPGScale.h.
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 ; }
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; }
Definition at line 33 of file testEcalTPGScale.h.
Referenced by analyze().
const CaloSubdetectorGeometry* testEcalTPGScale::theBarrelGeometry_ [private] |
Definition at line 32 of file testEcalTPGScale.h.
Referenced by analyze().
const CaloSubdetectorGeometry* testEcalTPGScale::theEndcapGeometry_ [private] |
Definition at line 31 of file testEcalTPGScale.h.
Referenced by analyze().