CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
EcalTPGScale Class Referenceabstract

#include <EcalTPGScale.h>

Public Member Functions

 EcalTPGScale ()
 
virtual double et_bin_high (const EcalTrigTowerDetId &id, const EcalTriggerPrimitiveSample &s) const =0
 
virtual double et_bin_low (const EcalTrigTowerDetId &id, const EcalTriggerPrimitiveSample &s) const =0
 smallest ET value which would resolve into this sample More...
 
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 More...
 
unsigned int getLinearizedTPG (unsigned int ADC, const EcalTrigTowerDetId &towerId)
 
unsigned int getTPGInADC (double energy, const EcalTrigTowerDetId &towerId)
 
double getTPGInGeV (const EcalTriggerPrimitiveDigi &tpDigi)
 
double getTPGInGeV (unsigned int ADC, const EcalTrigTowerDetId &towerId)
 
virtual void releaseSetup () const
 Release any objects obtained from the EventSetup. More...
 
void setEventSetup (const edm::EventSetup &evtSetup)
 
virtual void setup (const edm::EventSetup &es) const
 Get any needed information from the event setup. More...
 
 ~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.

14 { }
EcalTPGScale::~EcalTPGScale ( )

Definition at line 16 of file EcalTPGScale.cc.

17 { }

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

unsigned int EcalTPGScale::getLinearizedTPG ( unsigned int  ADC,
const EcalTrigTowerDetId towerId 
)

Definition at line 54 of file EcalTPGScale.cc.

References edm::EventSetup::get(), edm::eventsetup::EventSetupRecord::get(), i, lumiPlot::lut, edm::ESHandle< class >::product(), DetId::rawId(), and setup_.

Referenced by getTPGInGeV().

55 {
56  int tpg10bits = 0 ;
57 
58  // Get compressed look-up table
59  edm::ESHandle<EcalTPGLutGroup> lutGrpHandle;
60  setup_->get<EcalTPGLutGroupRcd>().get( lutGrpHandle );
61  const EcalTPGGroups::EcalTPGGroupsMap & lutGrpMap = lutGrpHandle.product()->getMap() ;
62  EcalTPGGroups::EcalTPGGroupsMapItr itgrp = lutGrpMap.find(towerId.rawId()) ;
63  uint32_t lutGrp = 999 ;
64  if (itgrp != lutGrpMap.end()) lutGrp = itgrp->second ;
65 
66  edm::ESHandle<EcalTPGLutIdMap> lutMapHandle;
67  setup_->get<EcalTPGLutIdMapRcd>().get( lutMapHandle );
68  const EcalTPGLutIdMap::EcalTPGLutMap & lutMap = lutMapHandle.product()->getMap() ;
69  EcalTPGLutIdMap::EcalTPGLutMapItr itLut = lutMap.find(lutGrp) ;
70  if (itLut != lutMap.end()) {
71  const unsigned int * lut = (itLut->second).getLut() ;
72  for (unsigned int i=0 ; i<1024 ; i++)
73  if (ADC == (0xff & lut[i])) {
74  tpg10bits = i ;
75  break ;
76  }
77  }
78 
79  return tpg10bits ;
80 }
int i
Definition: DBlmapReader.cc:9
const edm::EventSetup * setup_
Definition: EcalTPGScale.h:23
std::map< uint32_t, uint32_t >::const_iterator EcalTPGGroupsMapItr
Definition: EcalTPGGroups.h:21
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
void get(HolderT &iHolder) const
tuple lut
Definition: lumiPlot.py:244
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
std::map< uint32_t, EcalTPGLut > EcalTPGLutMap
std::map< uint32_t, uint32_t > EcalTPGGroupsMap
Definition: EcalTPGGroups.h:20
std::map< uint32_t, EcalTPGLut >::const_iterator EcalTPGLutMapItr
unsigned int 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(), edm::eventsetup::EventSetupRecord::get(), lumiPlot::lut, edm::ESHandle< class >::product(), DetId::rawId(), setup_, and EcalTrigTowerDetId::subDet().

83 {
84  unsigned int tpgADC = 0 ;
85 
86  // 1. get lsb
88  setup_->get<EcalTPGPhysicsConstRcd>().get( physHandle );
89  const EcalTPGPhysicsConstMap & physMap = physHandle.product()->getMap() ;
90 
91  uint32_t eb = DetId(DetId::Ecal,EcalBarrel).rawId() ;
92  uint32_t ee = DetId(DetId::Ecal,EcalEndcap).rawId() ;
93  EcalTPGPhysicsConstMapIterator it = physMap.end() ;
94  if (towerId.subDet() == EcalBarrel) it = physMap.find(eb) ;
95  else if (towerId.subDet() == EcalEndcap) it = physMap.find(ee) ;
96  double lsb10bits = 0. ;
97  if (it != physMap.end()) {
98  EcalTPGPhysicsConst::Item item = it->second ;
99  lsb10bits = item.EtSat/1024. ;
100  }
101 
102  // 2. get compressed look-up table
103  edm::ESHandle<EcalTPGLutGroup> lutGrpHandle;
104  setup_->get<EcalTPGLutGroupRcd>().get( lutGrpHandle );
105  const EcalTPGGroups::EcalTPGGroupsMap & lutGrpMap = lutGrpHandle.product()->getMap() ;
106  EcalTPGGroups::EcalTPGGroupsMapItr itgrp = lutGrpMap.find(towerId) ;
107  uint32_t lutGrp = 0 ;
108  if (itgrp != lutGrpMap.end()) lutGrp = itgrp->second ;
109 
110  edm::ESHandle<EcalTPGLutIdMap> lutMapHandle;
111  setup_->get<EcalTPGLutIdMapRcd>().get( lutMapHandle );
112  const EcalTPGLutIdMap::EcalTPGLutMap & lutMap = lutMapHandle.product()->getMap() ;
113  EcalTPGLutIdMap::EcalTPGLutMapItr itLut = lutMap.find(lutGrp) ;
114  if (itLut != lutMap.end()) {
115  const unsigned int * lut = (itLut->second).getLut() ;
116  if (lsb10bits>0) {
117  int tpgADC10b = int(energy/lsb10bits+0.5) ;
118  if (tpgADC10b>=0 && tpgADC10b<1024) tpgADC = (0xff & lut[tpgADC10b]) ;
119  if (tpgADC10b>=1024) tpgADC = 0xff ;
120  }
121  }
122 
123  return tpgADC ;
124 }
const edm::EventSetup * setup_
Definition: EcalTPGScale.h:23
std::map< uint32_t, uint32_t >::const_iterator EcalTPGGroupsMapItr
Definition: EcalTPGGroups.h:21
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
void get(HolderT &iHolder) const
tuple lut
Definition: lumiPlot.py:244
Definition: DetId.h:20
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
std::map< uint32_t, EcalTPGLut > EcalTPGLutMap
EcalSubdetector subDet() const
get the subDetector associated to the Trigger Tower
std::map< uint32_t, EcalTPGPhysicsConst::Item > EcalTPGPhysicsConstMap
std::map< uint32_t, EcalTPGPhysicsConst::Item >::const_iterator EcalTPGPhysicsConstMapIterator
std::map< uint32_t, uint32_t > EcalTPGGroupsMap
Definition: EcalTPGGroups.h:20
std::map< uint32_t, EcalTPGLut >::const_iterator EcalTPGLutMapItr
double EcalTPGScale::getTPGInGeV ( const EcalTriggerPrimitiveDigi tpDigi)

Definition at line 24 of file EcalTPGScale.cc.

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

Referenced by L1RCTSaveInput::analyze(), L1RCTLutWriter::analyze(), EcalSelectiveReadoutValidation::analyzeTP(), EcalRecHitWorkerRecover::estimateEnergy(), EcalRecHitWorkerRecover::run(), and EcalDeadCellTriggerPrimitiveFilter::setEvtTPstatus().

25 {
26  const EcalTrigTowerDetId & towerId = tpDigi.id() ;
27  int ADC = tpDigi.compressedEt() ;
28  return getTPGInGeV(ADC, towerId) ;
29 }
double getTPGInGeV(const EcalTriggerPrimitiveDigi &tpDigi)
Definition: EcalTPGScale.cc:24
unsigned towerId(const DetId &)
int compressedEt() const
get the encoded/compressed Et of interesting sample
const EcalTrigTowerDetId & id() const
double EcalTPGScale::getTPGInGeV ( unsigned int  ADC,
const EcalTrigTowerDetId towerId 
)

Definition at line 31 of file EcalTPGScale.cc.

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

32 {
33  // 1. get lsb
35  setup_->get<EcalTPGPhysicsConstRcd>().get( physHandle );
36  const EcalTPGPhysicsConstMap & physMap = physHandle.product()->getMap() ;
37 
38  uint32_t eb = DetId(DetId::Ecal,EcalBarrel).rawId() ;
39  uint32_t ee = DetId(DetId::Ecal,EcalEndcap).rawId() ;
40  EcalTPGPhysicsConstMapIterator it = physMap.end() ;
41  if (towerId.subDet() == EcalBarrel) it = physMap.find(eb) ;
42  else if (towerId.subDet() == EcalEndcap) it = physMap.find(ee) ;
43  double lsb10bits = 0. ;
44  if (it != physMap.end()) {
45  EcalTPGPhysicsConst::Item item = it->second ;
46  lsb10bits = item.EtSat/1024. ;
47  }
48 
49  // 2. linearized TPG
50  return lsb10bits * getLinearizedTPG(ADC, towerId) ;
51 
52 }
unsigned int getLinearizedTPG(unsigned int ADC, const EcalTrigTowerDetId &towerId)
Definition: EcalTPGScale.cc:54
const edm::EventSetup * setup_
Definition: EcalTPGScale.h:23
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
Definition: DetId.h:20
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
EcalSubdetector subDet() const
get the subDetector associated to the Trigger Tower
std::map< uint32_t, EcalTPGPhysicsConst::Item > EcalTPGPhysicsConstMap
std::map< uint32_t, EcalTPGPhysicsConst::Item >::const_iterator EcalTPGPhysicsConstMapIterator
virtual void EcalTPGScale::releaseSetup ( ) const
inlinevirtual

Release any objects obtained from the EventSetup.

Definition at line 34 of file EcalTPGScale.h.

34 { }
void EcalTPGScale::setEventSetup ( const edm::EventSetup evtSetup)
virtual void EcalTPGScale::setup ( const edm::EventSetup es) const
inlinevirtual

Get any needed information from the event setup.

Definition at line 32 of file EcalTPGScale.h.

32 { }

Member Data Documentation

const edm::EventSetup* EcalTPGScale::setup_
private

Definition at line 23 of file EcalTPGScale.h.

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