CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
JetCorrectorDBReader Class Reference
Inheritance diagram for JetCorrectorDBReader:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 JetCorrectorDBReader (const edm::ParameterSet &)
 
 ~JetCorrectorDBReader () override
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
 ~EDAnalyzer () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const * > *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void beginJob () override
 
void endJob () override
 

Private Attributes

bool mCreateTextFile
 
std::string mGlobalTag
 
std::string mPayloadName
 
bool mPrintScreen
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsInputProcessBlocks ()
 
static bool wantsProcessBlocks ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

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

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

Definition at line 37 of file JetCorrectorDBReader.cc.

Constructor & Destructor Documentation

◆ JetCorrectorDBReader()

JetCorrectorDBReader::JetCorrectorDBReader ( const edm::ParameterSet iConfig)
explicit

Definition at line 51 of file JetCorrectorDBReader.cc.

51  {
52  mPayloadName = iConfig.getUntrackedParameter<std::string>("payloadName");
53  mGlobalTag = iConfig.getUntrackedParameter<std::string>("globalTag");
54  mPrintScreen = iConfig.getUntrackedParameter<bool>("printScreen");
55  mCreateTextFile = iConfig.getUntrackedParameter<bool>("createTextFile");
56 }

References edm::ParameterSet::getUntrackedParameter(), mCreateTextFile, mGlobalTag, mPayloadName, mPrintScreen, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ ~JetCorrectorDBReader()

JetCorrectorDBReader::~JetCorrectorDBReader ( )
override

Definition at line 58 of file JetCorrectorDBReader.cc.

58 {}

Member Function Documentation

◆ analyze()

void JetCorrectorDBReader::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Implements edm::EDAnalyzer.

Definition at line 60 of file JetCorrectorDBReader.cc.

60  {
62  std::cout << "Inspecting JEC payload with label: " << mPayloadName << std::endl;
63  iSetup.get<JetCorrectionsRecord>().get(mPayloadName, JetCorParamsColl);
64  std::vector<JetCorrectorParametersCollection::key_type> keys;
65  JetCorParamsColl->validKeys(keys);
66  for (std::vector<JetCorrectorParametersCollection::key_type>::const_iterator ibegin = keys.begin(),
67  iend = keys.end(),
68  ikey = ibegin;
69  ikey != iend;
70  ++ikey) {
71  std::cout << "-------------------------------------------------" << std::endl;
72  std::cout << "Processing key = " << *ikey << std::endl;
73  std::cout << "object label: " << JetCorParamsColl->findLabel(*ikey) << std::endl;
74  JetCorrectorParameters const& JetCorParams = (*JetCorParamsColl)[*ikey];
75 
76  if (mCreateTextFile) {
77  std::cout << "Creating txt file: "
78  << mGlobalTag + "_" + mPayloadName + "_" + JetCorParamsColl->findLabel(*ikey) + ".txt" << std::endl;
79  JetCorParams.printFile(mGlobalTag + "_" + JetCorParamsColl->findLabel(*ikey) + "_" + mPayloadName + ".txt");
80  }
81  if (mPrintScreen)
82  JetCorParams.printScreen();
83  }
84 }

References gather_cfg::cout, JetCorrectorParametersCollection::findLabel(), edm::EventSetup::get(), get, relativeConstraints::keys, mCreateTextFile, mGlobalTag, mPayloadName, mPrintScreen, JetCorrectorParameters::printFile(), JetCorrectorParameters::printScreen(), and JetCorrectorParametersCollection::validKeys().

◆ beginJob()

void JetCorrectorDBReader::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 86 of file JetCorrectorDBReader.cc.

86 {}

◆ endJob()

void JetCorrectorDBReader::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 88 of file JetCorrectorDBReader.cc.

88 {}

Member Data Documentation

◆ mCreateTextFile

bool JetCorrectorDBReader::mCreateTextFile
private

Definition at line 48 of file JetCorrectorDBReader.cc.

Referenced by analyze(), and JetCorrectorDBReader().

◆ mGlobalTag

std::string JetCorrectorDBReader::mGlobalTag
private

Definition at line 47 of file JetCorrectorDBReader.cc.

Referenced by analyze(), and JetCorrectorDBReader().

◆ mPayloadName

std::string JetCorrectorDBReader::mPayloadName
private

Definition at line 47 of file JetCorrectorDBReader.cc.

Referenced by analyze(), and JetCorrectorDBReader().

◆ mPrintScreen

bool JetCorrectorDBReader::mPrintScreen
private

Definition at line 48 of file JetCorrectorDBReader.cc.

Referenced by analyze(), and JetCorrectorDBReader().

JetCorrectorDBReader::mPrintScreen
bool mPrintScreen
Definition: JetCorrectorDBReader.cc:48
JetCorrectorParameters::printFile
void printFile(const std::string &fFileName) const
Definition: JetCorrectorParameters.cc:316
gather_cfg.cout
cout
Definition: gather_cfg.py:144
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
relativeConstraints.keys
keys
Definition: relativeConstraints.py:89
JetCorrectorDBReader::mPayloadName
std::string mPayloadName
Definition: JetCorrectorDBReader.cc:47
JetCorrectorDBReader::mCreateTextFile
bool mCreateTextFile
Definition: JetCorrectorDBReader.cc:48
edm::EventSetup::get
T get() const
Definition: EventSetup.h:87
edm::ESHandle
Definition: DTSurvey.h:22
JetCorrectionsRecord
Definition: JetCorrectionsRecord.h:11
get
#define get
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
JetCorrectorDBReader::mGlobalTag
std::string mGlobalTag
Definition: JetCorrectorDBReader.cc:47
JetCorrectorParameters
Definition: JetCorrectorParameters.h:25
JetCorrectorParameters::printScreen
void printScreen() const
Definition: JetCorrectorParameters.cc:278
JetCorrectorParametersCollection::validKeys
void validKeys(std::vector< key_type > &keys) const
Definition: JetCorrectorParameters.cc:492
JetCorrectorParametersCollection::findLabel
static std::string findLabel(key_type k)
Definition: JetCorrectorParameters.cc:405