#include <CalibCalorimetry/EcalTPGTools/plugins/testEcalTPGScale.h>
Public Member Functions | |
virtual void | analyze (const edm::Event &evt, const edm::EventSetup &evtSetup) |
virtual void | beginJob (const edm::EventSetup &evtSetup) |
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 GenMuonPlsPt100GeV_cfg::cout, and lat::endl().
00015 { 00016 std::cout<<"I'm going to check the internal consistancy of EcalTPGScale transformation..."<<std::endl ; 00017 }
void testEcalTPGScale::analyze | ( | const edm::Event & | evt, | |
const edm::EventSetup & | evtSetup | |||
) | [virtual] |
Implements edm::EDAnalyzer.
Definition at line 19 of file testEcalTPGScale.cc.
References GenMuonPlsPt100GeV_cfg::cout, DetId::Ecal, EcalBarrel, EcalEndcap, lat::endl(), error, eTTmap_, edm::EventSetup::get(), EcalTPGScale::getLinearizedTPG(), EcalTPGScale::getTPGInADC(), EcalTPGScale::getTPGInGeV(), CaloSubdetectorGeometry::getValidDetIds(), it, EcalTPGScale::setEventSetup(), std, theBarrelGeometry_, theEndcapGeometry_, EBDetId::tower(), and true.
00020 { 00021 using namespace edm; 00022 using namespace std; 00023 00024 // geometry 00025 ESHandle<CaloGeometry> theGeometry; 00026 ESHandle<CaloSubdetectorGeometry> theEndcapGeometry_handle, theBarrelGeometry_handle; 00027 evtSetup.get<CaloGeometryRecord>().get( theGeometry ); 00028 evtSetup.get<EcalEndcapGeometryRecord>().get("EcalEndcap",theEndcapGeometry_handle); 00029 evtSetup.get<EcalBarrelGeometryRecord>().get("EcalBarrel",theBarrelGeometry_handle); 00030 evtSetup.get<IdealGeometryRecord>().get(eTTmap_); 00031 theEndcapGeometry_ = &(*theEndcapGeometry_handle); 00032 theBarrelGeometry_ = &(*theBarrelGeometry_handle); 00033 00034 EcalTPGScale ecalScale ; 00035 ecalScale.setEventSetup(evtSetup) ; 00036 00037 bool error(false) ; 00038 vector<DetId>::const_iterator it ; 00039 00040 // EB 00041 std::vector<DetId> ebCells = theBarrelGeometry_->getValidDetIds(DetId::Ecal, EcalBarrel); 00042 it = ebCells.begin() ; 00043 const EBDetId idEB(*it) ; 00044 const EcalTrigTowerDetId towidEB = idEB.tower(); 00045 int RCT_LUT_EB[256] ; 00046 for (uint ADC=0 ; ADC<256 ; ADC++) { 00047 double gev = ecalScale.getTPGInGeV(ADC, towidEB) ; 00048 uint tpgADC = ecalScale.getTPGInADC(gev, towidEB) ; 00049 if (tpgADC != ADC) { 00050 error = true ; 00051 cout<<" ERROR : with ADC = "<<ADC<<" getTPGInGeV = "<<gev<<" getTPGInADC = "<<tpgADC<<endl ; 00052 } 00053 RCT_LUT_EB[ADC] = ecalScale.getLinearizedTPG(ADC, towidEB) ; 00054 } 00055 00056 // EE 00057 std::vector<DetId> eeCells = theEndcapGeometry_->getValidDetIds(DetId::Ecal, EcalEndcap); 00058 it = eeCells.begin() ; 00059 const EEDetId idEE(*it); 00060 const EcalTrigTowerDetId towidEE = (*eTTmap_).towerOf(idEE) ; 00061 int RCT_LUT_EE[256] ; 00062 for (uint ADC=0 ; ADC<256 ; ADC++) { 00063 double gev = ecalScale.getTPGInGeV(ADC, towidEE) ; 00064 uint tpgADC = ecalScale.getTPGInADC(gev, towidEE) ; 00065 if (tpgADC != ADC) { 00066 error = true ; 00067 cout<<" ERROR : with ADC = "<<ADC<<" getTPGInGeV = "<<gev<<" getTPGInADC = "<<tpgADC<<endl ; 00068 } 00069 RCT_LUT_EE[ADC] = ecalScale.getLinearizedTPG(ADC, towidEE) ; 00070 } 00071 00072 00073 if (!error) cout<<" there is no error with EcalTPGScale internal consistancy "<<endl ; 00074 00075 }
void testEcalTPGScale::beginJob | ( | const edm::EventSetup & | evtSetup | ) | [virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 77 of file testEcalTPGScale.cc.
References std.
00078 { 00079 using namespace edm; 00080 using namespace std; 00081 00082 }
const CaloSubdetectorGeometry* testEcalTPGScale::theBarrelGeometry_ [private] |
const CaloSubdetectorGeometry* testEcalTPGScale::theEndcapGeometry_ [private] |