File indexing completed on 2024-04-06 11:57:59
0001 #ifndef ECALTPGSCALE_H
0002 #define ECALTPGSCALE_H
0003
0004 #include "FWCore/Framework/interface/EventSetup.h"
0005 #include "FWCore/Framework/interface/ConsumesCollector.h"
0006 #include "DataFormats/EcalDigi/interface/EcalTriggerPrimitiveDigi.h"
0007 #include "DataFormats/EcalDetId/interface/EcalTrigTowerDetId.h"
0008 #include "FWCore/Utilities/interface/ESGetToken.h"
0009 #include "CondFormats/EcalObjects/interface/EcalTPGLutIdMap.h"
0010 #include "CondFormats/EcalObjects/interface/EcalTPGLutGroup.h"
0011 #include "CondFormats/EcalObjects/interface/EcalTPGPhysicsConst.h"
0012 #include "CondFormats/DataRecord/interface/EcalTPGLutIdMapRcd.h"
0013 #include "CondFormats/DataRecord/interface/EcalTPGLutGroupRcd.h"
0014 #include "CondFormats/DataRecord/interface/EcalTPGPhysicsConstRcd.h"
0015
0016 class EcalTPGScale {
0017 public:
0018 struct Tokens {
0019 Tokens(edm::ConsumesCollector);
0020 const edm::ESGetToken<EcalTPGPhysicsConst, EcalTPGPhysicsConstRcd> physConstToken_;
0021 const edm::ESGetToken<EcalTPGLutGroup, EcalTPGLutGroupRcd> lutGrpToken_;
0022 const edm::ESGetToken<EcalTPGLutIdMap, EcalTPGLutIdMapRcd> lutMapToken_;
0023 };
0024
0025 EcalTPGScale(Tokens const&, const edm::EventSetup& evtSetup);
0026
0027 double getTPGInGeV(const EcalTriggerPrimitiveDigi& tpDigi) const;
0028 double getTPGInGeV(unsigned int ADC, const EcalTrigTowerDetId& towerId) const;
0029
0030 unsigned int getLinearizedTPG(unsigned int ADC, const EcalTrigTowerDetId& towerId) const;
0031 unsigned int getTPGInADC(double energy, const EcalTrigTowerDetId& towerId) const;
0032
0033 private:
0034 EcalTPGPhysicsConst const& phys_;
0035 EcalTPGLutGroup const& lutGrp_;
0036 EcalTPGLutIdMap const& lut_;
0037 };
0038
0039 #endif