CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
L1GctConfigProducers Class Reference

#include <L1Trigger/L1GctConfigProducers/interface/L1GctConfigProducers.h>

Inheritance diagram for L1GctConfigProducers:
edm::ESProducer edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

Public Types

using ChanMaskReturnType = std::unique_ptr< L1GctChannelMask >
 
using JfParamsReturnType = std::unique_ptr< L1GctJetFinderParams >
 
- Public Types inherited from edm::eventsetup::DataProxyProvider
typedef std::vector< std::pair< DataKey, edm::propagate_const< std::shared_ptr< DataProxy > > > > KeyedProxies
 
typedef std::vector< EventSetupRecordKeyKeys
 
typedef std::map< EventSetupRecordKey, KeyedProxiesRecordProxies
 

Public Member Functions

std::vector< double > etToEnergyConversion (const L1CaloGeometry *geom) const
 Legacy nonsense. More...
 
 L1GctConfigProducers (const edm::ParameterSet &)
 
ChanMaskReturnType produceChanMask (const L1GctChannelMaskRcd &)
 
JfParamsReturnType produceJfParams (const L1GctJetFinderParamsRcd &)
 
 ~L1GctConfigProducers () override
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
 ~ESProducer ()(false) override
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
void newInterval (const eventsetup::EventSetupRecordKey &iRecordType, const ValidityInterval &iInterval) override
 overrides DataProxyProvider method More...
 
 ~ESProxyFactoryProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::eventsetup::DataProxyProvider
 DataProxyProvider ()
 
const ComponentDescriptiondescription () const
 
bool isUsingRecord (const EventSetupRecordKey &) const
 
const KeyedProxieskeyedProxies (const EventSetupRecordKey &iRecordKey) const
 
void resetProxies (const EventSetupRecordKey &iRecordType)
 
void resetProxiesIfTransient (const EventSetupRecordKey &iRecordType)
 
void setAppendToDataLabel (const edm::ParameterSet &)
 
void setDescription (const ComponentDescription &iDescription)
 
std::set< EventSetupRecordKeyusingRecords () const
 
virtual ~DataProxyProvider () noexcept(false)
 

Private Attributes

double m_CenJetSeed
 
bool m_convertToEnergy
 
unsigned m_corrFunType
 
unsigned m_EtaBoundry
 
double m_FwdJetSeed
 
double m_htJetThresh
 
double m_htLsb
 
std::vector< std::vector< double > > m_jetCalibFunc
 
unsigned m_metEtaMask
 
unsigned m_mhtEtaMask
 
double m_mhtJetThresh
 
double m_rgnEtLsb
 
std::vector< std::vector< double > > m_tauCalibFunc
 
double m_tauIsoThresh
 
double m_TauJetSeed
 
unsigned m_tetEtaMask
 
unsigned m_thtEtaMask
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::eventsetup::DataProxyProvider
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::ESProducer
 ESProducer (const ESProducer &)=delete
 
ESProducer const & operator= (const ESProducer &)=delete
 
template<typename T >
auto setWhatProduced (T *iThis, const es::Label &iLabel={})
 
template<typename T >
auto setWhatProduced (T *iThis, const char *iLabel)
 
template<typename T >
auto setWhatProduced (T *iThis, const std::string &iLabel)
 
template<typename T , typename TDecorator >
auto setWhatProduced (T *iThis, const TDecorator &iDec, const es::Label &iLabel={})
 
template<typename T , typename TReturn , typename TRecord >
auto setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const es::Label &iLabel={})
 
template<typename T , typename TReturn , typename TRecord , typename TArg >
ESConsumesCollector setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const TArg &iDec, const es::Label &iLabel={})
 
- Protected Member Functions inherited from edm::ESProxyFactoryProducer
template<class TFactory >
void registerFactory (std::unique_ptr< TFactory > iFactory, const std::string &iLabel=std::string())
 
virtual void registerFactoryWithKey (const eventsetup::EventSetupRecordKey &iRecord, std::unique_ptr< eventsetup::ProxyFactoryBase > iFactory, const std::string &iLabel=std::string())
 
void registerProxies (const eventsetup::EventSetupRecordKey &iRecord, KeyedProxies &aProxyList) override
 override DataProxyProvider method More...
 
- Protected Member Functions inherited from edm::eventsetup::DataProxyProvider
void eraseAll (const EventSetupRecordKey &iRecordKey)
 deletes all the Proxies in aStream More...
 
void invalidateProxies (const EventSetupRecordKey &iRecordKey)
 
template<class T >
void usingRecord ()
 
void usingRecordWithKey (const EventSetupRecordKey &)
 

Detailed Description

Description: <one line="" class="" summary>="">

Implementation: <Notes on="" implementation>="">

Definition at line 49 of file L1GctConfigProducers.h.

Member Typedef Documentation

Definition at line 55 of file L1GctConfigProducers.h.

Definition at line 54 of file L1GctConfigProducers.h.

Constructor & Destructor Documentation

L1GctConfigProducers::L1GctConfigProducers ( const edm::ParameterSet iConfig)

Definition at line 26 of file L1GctConfigProducers.cc.

References edm::ParameterSet::getParameter(), mps_fire::i, m_corrFunType, m_jetCalibFunc, m_tauCalibFunc, L1GctJetFinderParams::N_CENTRAL_ETA_VALUES, L1GctJetFinderParams::NUMBER_ETA_VALUES, produceChanMask(), produceJfParams(), edm::ESProducer::setWhatProduced(), str, and AlCaHLTBitMon_QueryRunRegistry::string.

26  :
27  m_rgnEtLsb(iConfig.getParameter<double>("RctRegionEtLSB")),
28  m_htLsb(iConfig.getParameter<double>("GctHtLSB")),
29  m_CenJetSeed(iConfig.getParameter<double>("JetFinderCentralJetSeed")),
30  m_FwdJetSeed(iConfig.getParameter<double>("JetFinderForwardJetSeed")),
31  m_TauJetSeed(iConfig.getParameter<double>("JetFinderCentralJetSeed")), // no separate tau jet seed yet
32  m_tauIsoThresh(iConfig.getParameter<double>("TauIsoEtThreshold")),
33  m_htJetThresh(iConfig.getParameter<double>("HtJetEtThreshold")),
34  m_mhtJetThresh(iConfig.getParameter<double>("MHtJetEtThreshold")),
35  m_EtaBoundry(7), // not programmable!
36  m_corrFunType(0),
37  m_convertToEnergy (iConfig.getParameter<bool>("ConvertEtValuesToEnergy")),
40  m_metEtaMask(iConfig.getParameter<unsigned>("MEtEtaMask")),
41  m_tetEtaMask(iConfig.getParameter<unsigned>("TEtEtaMask")),
42  m_mhtEtaMask(iConfig.getParameter<unsigned>("MHtEtaMask")),
43  m_thtEtaMask(iConfig.getParameter<unsigned>("HtEtaMask"))
44 {
45 
46  //the following lines are needed to tell the framework what
47  // data is being produced
50 
51  //now do what ever other initialization is needed
52  std::string CalibStyle = iConfig.getParameter<std::string>("CalibrationStyle");
53  edm::ParameterSet calibCoeffs;
54 
55  if (CalibStyle == "PowerSeries") {
56  m_corrFunType = 1;
57  calibCoeffs = iConfig.getParameter<edm::ParameterSet>("PowerSeriesCoefficients");
58  }
59 
60  if (CalibStyle == "ORCAStyle") {
61  m_corrFunType = 2;
62  calibCoeffs = iConfig.getParameter<edm::ParameterSet>("OrcaStyleCoefficients");
63  }
64 
65  if (CalibStyle == "Simple") {
66  m_corrFunType = 3;
67  calibCoeffs = iConfig.getParameter<edm::ParameterSet>("SimpleCoefficients");
68  }
69 
70  if (CalibStyle == "PiecewiseCubic") {
71  m_corrFunType = 4;
72  calibCoeffs = iConfig.getParameter<edm::ParameterSet>("PiecewiseCubicCoefficients");
73  }
74 
75  if (CalibStyle == "PF") {
76  m_corrFunType = 5;
77  calibCoeffs = iConfig.getParameter<edm::ParameterSet>("PFCoefficients");
78  }
79 
80  // check
81  if (CalibStyle != "None") {
82 
83  // Read the coefficients from file
84  // coefficients for non-tau jet corrections
85  for (unsigned i=0; i<L1GctJetFinderParams::NUMBER_ETA_VALUES; ++i) {
86  std::stringstream ss;
88  ss << "nonTauJetCalib" << i;
89  ss >> str;
90  m_jetCalibFunc.push_back(calibCoeffs.getParameter< std::vector<double> >(str));
91  }
92  // coefficients for tau jet corrections
93  for (unsigned i=0; i<L1GctJetFinderParams::N_CENTRAL_ETA_VALUES; ++i) {
94  std::stringstream ss;
96  ss << "tauJetCalib" << i;
97  ss >> str;
98  m_tauCalibFunc.push_back(calibCoeffs.getParameter< std::vector<double> >(str));
99  }
100 
101  } else {
102  // No corrections to be applied
103  m_corrFunType = 0; // no correction
104  // Set the vector sizes to those expected by the CalibrationFunction
105  m_jetCalibFunc.resize(L1GctJetFinderParams::NUMBER_ETA_VALUES);
106  m_tauCalibFunc.resize(L1GctJetFinderParams::N_CENTRAL_ETA_VALUES);
107  }
108 
109  edm::LogWarning("L1GctConfig") << "Calibration Style option " << CalibStyle << std::endl;
110 
111 }
ChanMaskReturnType produceChanMask(const L1GctChannelMaskRcd &)
T getParameter(std::string const &) const
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:116
static const unsigned N_CENTRAL_ETA_VALUES
Number of eta bins used in correction.
JfParamsReturnType produceJfParams(const L1GctJetFinderParamsRcd &)
std::vector< std::vector< double > > m_jetCalibFunc
static const unsigned NUMBER_ETA_VALUES
Number of eta bins used in correction.
std::vector< std::vector< double > > m_tauCalibFunc
#define str(s)
L1GctConfigProducers::~L1GctConfigProducers ( )
override

Definition at line 114 of file L1GctConfigProducers.cc.

115 {
116 
117  // do anything here that needs to be done at desctruction time
118  // (e.g. close files, deallocate resources etc.)
119 
120 }

Member Function Documentation

std::vector< double > L1GctConfigProducers::etToEnergyConversion ( const L1CaloGeometry geom) const

Legacy nonsense.

Calculate Et-to-energy conversion factors for eta bins

Definition at line 173 of file L1GctConfigProducers.cc.

References DEFINE_FWK_EVENTSETUP_MODULE, L1CaloGeometry::etaBinCenter(), JetChargeProducer_cfi::exp, and mps_fire::result.

Referenced by produceJfParams().

174  {
175  // L1CaloGeometry* geom = new L1CaloGeometry();
176  std::vector<double> result;
177  // Factors for central eta bins
178  for (unsigned ieta=0; ieta<7; ieta++) {
179  double bineta = geom->etaBinCenter(ieta, true);
180  double factor = 0.5*(exp(bineta)+exp(-bineta)); // Conversion from eta to cosec(theta)
181  result.push_back(factor);
182  }
183  // Factors for forward eta bins
184  for (unsigned ieta=0; ieta<4; ieta++) {
185  double bineta = geom->etaBinCenter(ieta, false);
186  double factor = 0.5*(exp(bineta)+exp(-bineta)); // Conversion from eta to cosec(theta)
187  result.push_back(factor);
188  }
189  return result;
190 }
double etaBinCenter(unsigned int etaIndex, bool central=true) const
L1GctConfigProducers::ChanMaskReturnType L1GctConfigProducers::produceChanMask ( const L1GctChannelMaskRcd )

Definition at line 153 of file L1GctConfigProducers.cc.

References m_metEtaMask, m_mhtEtaMask, m_tetEtaMask, m_thtEtaMask, RecoTauDiscriminantConfiguration::mask, L1GctChannelMask::maskMissingEt(), L1GctChannelMask::maskMissingHt(), L1GctChannelMask::maskTotalEt(), L1GctChannelMask::maskTotalHt(), and globals_cff::x1.

Referenced by L1GctConfigProducers().

153  {
154 
156 
157  for (unsigned ieta=0; ieta<22; ++ieta) {
158  if (((m_metEtaMask>>ieta)&0x1)==1) mask->maskMissingEt(ieta);
159  if (((m_tetEtaMask>>ieta)&0x1)==1) mask->maskTotalEt(ieta);
160  if (((m_mhtEtaMask>>ieta)&0x1)==1) mask->maskMissingHt(ieta);
161  if (((m_thtEtaMask>>ieta)&0x1)==1) mask->maskTotalHt(ieta);
162  }
163 
164  return std::unique_ptr<L1GctChannelMask>(mask);
165 
166 }
void maskMissingEt(unsigned ieta)
mask eta range from missing Et sum
void maskTotalHt(unsigned ieta)
mask eta range from total Ht sum
void maskTotalEt(unsigned ieta)
mask eta range from total Et sum
void maskMissingHt(unsigned ieta)
mask eta range from missing Ht sum
L1GctConfigProducers::JfParamsReturnType L1GctConfigProducers::produceJfParams ( const L1GctJetFinderParamsRcd aRcd)

Definition at line 125 of file L1GctConfigProducers.cc.

References etToEnergyConversion(), relativeConstraints::geom, edm::eventsetup::EventSetupRecord::get(), edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getRecord(), m_CenJetSeed, m_convertToEnergy, m_corrFunType, m_EtaBoundry, m_FwdJetSeed, m_htJetThresh, m_htLsb, m_jetCalibFunc, m_mhtJetThresh, m_rgnEtLsb, m_tauCalibFunc, m_tauIsoThresh, and m_TauJetSeed.

Referenced by L1GctConfigProducers().

126 {
127  // get geometry
128  const L1CaloGeometryRecord& geomRcd = aRcd.getRecord< L1CaloGeometryRecord >() ;
130  geomRcd.get( geom ) ;
131 
132  // construct jet finder params object
133  auto pL1GctJetFinderParams = std::make_unique<L1GctJetFinderParams>(m_rgnEtLsb,
134  m_htLsb,
135  m_CenJetSeed,
136  m_FwdJetSeed,
137  m_TauJetSeed,
141  m_EtaBoundry,
146  etToEnergyConversion(geom.product()));
147 
148  return pL1GctJetFinderParams ;
149 
150 }
std::vector< std::vector< double > > m_jetCalibFunc
std::vector< double > etToEnergyConversion(const L1CaloGeometry *geom) const
Legacy nonsense.
std::vector< std::vector< double > > m_tauCalibFunc
bool get(HolderT &iHolder) const

Member Data Documentation

double L1GctConfigProducers::m_CenJetSeed
private

Definition at line 66 of file L1GctConfigProducers.h.

Referenced by produceJfParams().

bool L1GctConfigProducers::m_convertToEnergy
private

Definition at line 74 of file L1GctConfigProducers.h.

Referenced by produceJfParams().

unsigned L1GctConfigProducers::m_corrFunType
private

Definition at line 73 of file L1GctConfigProducers.h.

Referenced by L1GctConfigProducers(), and produceJfParams().

unsigned L1GctConfigProducers::m_EtaBoundry
private

Definition at line 72 of file L1GctConfigProducers.h.

Referenced by produceJfParams().

double L1GctConfigProducers::m_FwdJetSeed
private

Definition at line 67 of file L1GctConfigProducers.h.

Referenced by produceJfParams().

double L1GctConfigProducers::m_htJetThresh
private

Definition at line 70 of file L1GctConfigProducers.h.

Referenced by produceJfParams().

double L1GctConfigProducers::m_htLsb
private

Definition at line 65 of file L1GctConfigProducers.h.

Referenced by produceJfParams().

std::vector< std::vector<double> > L1GctConfigProducers::m_jetCalibFunc
private

Definition at line 76 of file L1GctConfigProducers.h.

Referenced by L1GctConfigProducers(), and produceJfParams().

unsigned L1GctConfigProducers::m_metEtaMask
private

Definition at line 79 of file L1GctConfigProducers.h.

Referenced by produceChanMask().

unsigned L1GctConfigProducers::m_mhtEtaMask
private

Definition at line 81 of file L1GctConfigProducers.h.

Referenced by produceChanMask().

double L1GctConfigProducers::m_mhtJetThresh
private

Definition at line 71 of file L1GctConfigProducers.h.

Referenced by produceJfParams().

double L1GctConfigProducers::m_rgnEtLsb
private

Definition at line 64 of file L1GctConfigProducers.h.

Referenced by produceJfParams().

std::vector< std::vector<double> > L1GctConfigProducers::m_tauCalibFunc
private

Definition at line 77 of file L1GctConfigProducers.h.

Referenced by L1GctConfigProducers(), and produceJfParams().

double L1GctConfigProducers::m_tauIsoThresh
private

Definition at line 69 of file L1GctConfigProducers.h.

Referenced by produceJfParams().

double L1GctConfigProducers::m_TauJetSeed
private

Definition at line 68 of file L1GctConfigProducers.h.

Referenced by produceJfParams().

unsigned L1GctConfigProducers::m_tetEtaMask
private

Definition at line 80 of file L1GctConfigProducers.h.

Referenced by produceChanMask().

unsigned L1GctConfigProducers::m_thtEtaMask
private

Definition at line 82 of file L1GctConfigProducers.h.

Referenced by produceChanMask().