CMS 3D CMS Logo

EcalTPGScale Class Reference

To be stored in the CaloTPGRecord. More...

#include <CalibCalorimetry/EcalTPGTools/interface/EcalTPGScale.h>

List of all members.

Public Member Functions

 EcalTPGScale ()
virtual double et_bin_high (const EcalTrigTowerDetId &id, const EcalTriggerPrimitiveSample &s) const =0
 smallest ET value which would not resolve into sample (too big)
virtual double et_bin_low (const EcalTrigTowerDetId &id, const EcalTriggerPrimitiveSample &s) const =0
 smallest ET value which would resolve into this sample
virtual double et_RCT (const EcalTrigTowerDetId &id, const EcalTriggerPrimitiveSample &s) const =0
 nominal ET value of this sample/code as to be used in RCT LUT creation
uint getLinearizedTPG (uint ADC, const EcalTrigTowerDetId &towerId)
uint getTPGInADC (double energy, const EcalTrigTowerDetId &towerId)
double getTPGInGeV (uint ADC, const EcalTrigTowerDetId &towerId)
double getTPGInGeV (const EcalTriggerPrimitiveDigi &tpDigi)
virtual void releaseSetup () const
 Release any objects obtained from the EventSetup.
void setEventSetup (const edm::EventSetup &evtSetup)
virtual void setup (const edm::EventSetup &es) const
 Get any needed information from the event setup.
 ~EcalTPGScale ()

Private Attributes

const edm::EventSetupsetup_


Detailed Description

To be stored in the CaloTPGRecord.

Date
2007/02/19 16:24:20
Revision
1.1
Author:
J. Mans - Minnesota

Definition at line 8 of file EcalTPGScale.h.


Constructor & Destructor Documentation

EcalTPGScale::EcalTPGScale (  ) 

Definition at line 13 of file EcalTPGScale.cc.

00014 { }

EcalTPGScale::~EcalTPGScale (  ) 

Definition at line 16 of file EcalTPGScale.cc.

00017 { }


Member Function Documentation

virtual double EcalTPGScale::et_bin_high ( const EcalTrigTowerDetId id,
const EcalTriggerPrimitiveSample s 
) const [pure virtual]

smallest ET value which would not resolve into sample (too big)

virtual double EcalTPGScale::et_bin_low ( const EcalTrigTowerDetId id,
const EcalTriggerPrimitiveSample s 
) const [pure virtual]

smallest ET value which would resolve into this sample

virtual double EcalTPGScale::et_RCT ( const EcalTrigTowerDetId id,
const EcalTriggerPrimitiveSample s 
) const [pure virtual]

nominal ET value of this sample/code as to be used in RCT LUT creation

uint EcalTPGScale::getLinearizedTPG ( uint  ADC,
const EcalTrigTowerDetId towerId 
)

Definition at line 54 of file EcalTPGScale.cc.

References edm::EventSetup::get(), EcalTPGGroups::getMap(), i, lut, edm::ESHandle< T >::product(), DetId::rawId(), and setup_.

Referenced by testEcalTPGScale::analyze(), and getTPGInGeV().

00055 {
00056   int tpg10bits = 0 ;
00057  
00058   // Get compressed look-up table
00059   edm::ESHandle<EcalTPGLutGroup> lutGrpHandle;
00060   setup_->get<EcalTPGLutGroupRcd>().get( lutGrpHandle );
00061   const EcalTPGGroups::EcalTPGGroupsMap & lutGrpMap = lutGrpHandle.product()->getMap() ;  
00062   EcalTPGGroups::EcalTPGGroupsMapItr itgrp = lutGrpMap.find(towerId.rawId()) ;
00063   uint32_t lutGrp = 999 ;
00064   if (itgrp != lutGrpMap.end()) lutGrp = itgrp->second ;
00065 
00066   edm::ESHandle<EcalTPGLutIdMap> lutMapHandle;
00067   setup_->get<EcalTPGLutIdMapRcd>().get( lutMapHandle );
00068   const EcalTPGLutIdMap::EcalTPGLutMap & lutMap = lutMapHandle.product()->getMap() ;  
00069   EcalTPGLutIdMap::EcalTPGLutMapItr itLut = lutMap.find(lutGrp) ;
00070   if (itLut != lutMap.end()) {
00071     const unsigned int * lut = (itLut->second).getLut() ;
00072     for (uint i=0 ; i<1024 ; i++)
00073       if (ADC == (0xff & lut[i])) {
00074         tpg10bits = i ;
00075         break ;
00076       }
00077   }
00078 
00079   return tpg10bits ;
00080 }

uint EcalTPGScale::getTPGInADC ( double  energy,
const EcalTrigTowerDetId towerId 
)

Definition at line 82 of file EcalTPGScale.cc.

References DetId::Ecal, EcalBarrel, EcalEndcap, EcalTPGPhysicsConst::Item::EtSat, edm::EventSetup::get(), EcalTPGGroups::getMap(), EcalTPGPhysicsConst::getMap(), int, it, lut, edm::ESHandle< T >::product(), setup_, and EcalTrigTowerDetId::subDet().

Referenced by testEcalTPGScale::analyze().

00083 {
00084   uint tpgADC = 0 ;
00085 
00086   // 1. get lsb
00087   edm::ESHandle<EcalTPGPhysicsConst> physHandle;
00088   setup_->get<EcalTPGPhysicsConstRcd>().get( physHandle );
00089   const EcalTPGPhysicsConstMap & physMap = physHandle.product()->getMap() ;
00090 
00091   uint32_t eb = DetId(DetId::Ecal,EcalBarrel).rawId() ;
00092   uint32_t ee = DetId(DetId::Ecal,EcalEndcap).rawId() ;
00093   EcalTPGPhysicsConstMapIterator it = physMap.end() ;
00094   if (towerId.subDet() == EcalBarrel) it = physMap.find(eb) ;
00095   else if (towerId.subDet() == EcalEndcap) it = physMap.find(ee) ;
00096   double lsb10bits = 0. ;
00097   if (it != physMap.end()) {
00098     EcalTPGPhysicsConst::Item item = it->second ;
00099     lsb10bits = item.EtSat/1024. ;
00100   }
00101 
00102   // 2. get compressed look-up table
00103   edm::ESHandle<EcalTPGLutGroup> lutGrpHandle;
00104   setup_->get<EcalTPGLutGroupRcd>().get( lutGrpHandle );
00105   const EcalTPGGroups::EcalTPGGroupsMap & lutGrpMap = lutGrpHandle.product()->getMap() ;  
00106   EcalTPGGroups::EcalTPGGroupsMapItr itgrp = lutGrpMap.find(towerId) ;
00107   uint32_t lutGrp = 0 ;
00108   if (itgrp != lutGrpMap.end()) lutGrp = itgrp->second ;
00109   
00110   edm::ESHandle<EcalTPGLutIdMap> lutMapHandle;
00111   setup_->get<EcalTPGLutIdMapRcd>().get( lutMapHandle );
00112   const EcalTPGLutIdMap::EcalTPGLutMap & lutMap = lutMapHandle.product()->getMap() ;  
00113   EcalTPGLutIdMap::EcalTPGLutMapItr itLut = lutMap.find(lutGrp) ;
00114   if (itLut != lutMap.end()) {
00115     const unsigned int * lut = (itLut->second).getLut() ;
00116     if (lsb10bits>0) {
00117       int tpgADC10b = int(energy/lsb10bits+0.5) ;
00118       if (tpgADC10b>=0 && tpgADC10b<1024) tpgADC = (0xff & lut[tpgADC10b]) ;
00119       if (tpgADC10b>=1024) tpgADC = 0xff ;
00120     }
00121   }
00122 
00123   return tpgADC ;
00124 }

double EcalTPGScale::getTPGInGeV ( uint  ADC,
const EcalTrigTowerDetId towerId 
)

Definition at line 31 of file EcalTPGScale.cc.

References DetId::Ecal, EcalBarrel, EcalEndcap, EcalTPGPhysicsConst::Item::EtSat, edm::EventSetup::get(), getLinearizedTPG(), EcalTPGPhysicsConst::getMap(), it, edm::ESHandle< T >::product(), setup_, and EcalTrigTowerDetId::subDet().

00032 { 
00033   // 1. get lsb
00034   edm::ESHandle<EcalTPGPhysicsConst> physHandle;
00035   setup_->get<EcalTPGPhysicsConstRcd>().get( physHandle );
00036   const EcalTPGPhysicsConstMap & physMap = physHandle.product()->getMap() ;
00037 
00038   uint32_t eb = DetId(DetId::Ecal,EcalBarrel).rawId() ;
00039   uint32_t ee = DetId(DetId::Ecal,EcalEndcap).rawId() ;
00040   EcalTPGPhysicsConstMapIterator it = physMap.end() ;
00041   if (towerId.subDet() == EcalBarrel) it = physMap.find(eb) ;
00042   else if (towerId.subDet() == EcalEndcap) it = physMap.find(ee) ;
00043   double lsb10bits = 0. ;
00044   if (it != physMap.end()) {
00045     EcalTPGPhysicsConst::Item item = it->second ;
00046     lsb10bits = item.EtSat/1024. ;
00047   }
00048 
00049   // 2. linearized TPG
00050   return lsb10bits * getLinearizedTPG(ADC, towerId) ;
00051 
00052 }

double EcalTPGScale::getTPGInGeV ( const EcalTriggerPrimitiveDigi tpDigi  ) 

Definition at line 24 of file EcalTPGScale.cc.

References EcalTriggerPrimitiveDigi::compressedEt(), and EcalTriggerPrimitiveDigi::id().

Referenced by L1RCTLutWriter::analyze(), L1RCTSaveInput::analyze(), testEcalTPGScale::analyze(), L1CaloInputScalesGenerator::analyze(), EcalTrigPrimAnalyzer::analyze(), L1CaloInputScaleTester::analyze(), EcalTrigPrimAnalyzerMIPs::analyze(), EcalSelectiveReadoutValidation::analyzeTP(), and L1RCTProducer::produce().

00025 { 
00026    const EcalTrigTowerDetId & towerId = tpDigi.id() ;
00027    int ADC = tpDigi.compressedEt() ;
00028    return getTPGInGeV(ADC, towerId) ;
00029 }

virtual void EcalTPGScale::releaseSetup (  )  const [inline, virtual]

Release any objects obtained from the EventSetup.

Definition at line 34 of file EcalTPGScale.h.

00034 { }

void EcalTPGScale::setEventSetup ( const edm::EventSetup evtSetup  ) 

Definition at line 19 of file EcalTPGScale.cc.

References setup_.

Referenced by L1RCTLutWriter::analyze(), L1RCTSaveInput::analyze(), testEcalTPGScale::analyze(), L1CaloInputScalesGenerator::analyze(), EcalTrigPrimAnalyzer::analyze(), EcalTrigPrimAnalyzerMIPs::analyze(), L1CaloInputScaleTester::analyze(), EcalSelectiveReadoutValidation::analyzeTP(), and L1RCTProducer::produce().

00020 {
00021   setup_ = &evtSetup ;
00022 }

virtual void EcalTPGScale::setup ( const edm::EventSetup es  )  const [inline, virtual]

Get any needed information from the event setup.

Definition at line 32 of file EcalTPGScale.h.

00032 { }


Member Data Documentation

const edm::EventSetup* EcalTPGScale::setup_ [private]

Definition at line 23 of file EcalTPGScale.h.

Referenced by getLinearizedTPG(), getTPGInADC(), getTPGInGeV(), and setEventSetup().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:20:00 2009 for CMSSW by  doxygen 1.5.4