CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
corrGains Class Reference
Inheritance diagram for corrGains:
edm::one::EDAnalyzer< edm::one::WatchRuns > edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 corrGains (const edm::ParameterSet &)
 
 ~corrGains () override
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::WatchRuns >
 EDAnalyzer ()=default
 
 EDAnalyzer (const EDAnalyzer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
const EDAnalyzeroperator= (const EDAnalyzer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDAnalyzerBase () 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 (edm::Event const &, edm::EventSetup const &) override
 
void beginRun (edm::Run const &iEvent, edm::EventSetup const &) override
 
void endRun (edm::Run const &iEvent, edm::EventSetup const &) override
 

Private Attributes

std::string fileCorr
 
std::string fileIn
 
std::string fileOut
 
edm::ESGetToken< HcalTopology, HcalRecNumberingRecordtok_htopo_
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- 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

Definition at line 18 of file corrGains.cc.

Constructor & Destructor Documentation

◆ corrGains()

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

Definition at line 31 of file corrGains.cc.

31  {
32  fileIn = iConfig.getUntrackedParameter<std::string>("FileIn");
33  fileOut = iConfig.getUntrackedParameter<std::string>("FileOut");
34  fileCorr = iConfig.getUntrackedParameter<std::string>("FileCorr");
35  tok_htopo_ = esConsumes<HcalTopology, HcalRecNumberingRecord>();
36 }

References fileCorr, fileIn, fileOut, edm::ParameterSet::getUntrackedParameter(), AlCaHLTBitMon_QueryRunRegistry::string, and tok_htopo_.

◆ ~corrGains()

corrGains::~corrGains ( )
override

Definition at line 38 of file corrGains.cc.

38 {}

Member Function Documentation

◆ analyze()

void corrGains::analyze ( edm::Event const &  ,
edm::EventSetup const &  iSetup 
)
overrideprivatevirtual

Implements edm::one::EDAnalyzerBase.

Definition at line 40 of file corrGains.cc.

40  {
41  HcalTopology topo = iSetup.getData(tok_htopo_);
42 
43  HcalGains gainsIn(&topo);
44  ;
45  std::ifstream inStream(fileIn.c_str());
46  HcalDbASCIIIO::getObject(inStream, &gainsIn);
47  inStream.close();
48 
49  HcalRespCorrs corrsIn(&topo);
50  ;
51  std::ifstream inCorr(fileCorr.c_str());
52  HcalDbASCIIIO::getObject(inCorr, &corrsIn);
53  inCorr.close();
54 
55  HcalGains gainsOut(&topo);
56  ;
57  std::vector<DetId> channels = gainsIn.getAllChannels();
58  for (unsigned int i = 0; i < channels.size(); i++) {
59  DetId id = channels[i];
60  float scale = 1.;
61  if (corrsIn.exists(id))
62  scale = corrsIn.getValues(id)->getValue();
63  HcalGain item(id,
64  gainsIn.getValues(id)->getValue(0) * scale,
65  gainsIn.getValues(id)->getValue(1) * scale,
66  gainsIn.getValues(id)->getValue(2) * scale,
67  gainsIn.getValues(id)->getValue(3) * scale);
68  gainsOut.addValues(item);
69  }
70  std::ofstream outStream(fileOut.c_str());
71  HcalDbASCIIIO::dumpObject(outStream, gainsOut);
72  outStream.close();
73 }

References HcalCondObjectContainer< Item >::addValues(), ewkTauDQM_cfi::channels, HcalDbASCIIIO::dumpObject(), HcalCondObjectContainer< Item >::exists(), fileCorr, fileIn, fileOut, HcalCondObjectContainer< Item >::getAllChannels(), edm::EventSetup::getData(), HcalDbASCIIIO::getObject(), HcalRespCorr::getValue(), HcalGain::getValue(), HcalCondObjectContainer< Item >::getValues(), mps_fire::i, B2GTnPMonitor_cfi::item, L1EGammaCrystalsEmulatorProducer_cfi::scale, and tok_htopo_.

◆ beginRun()

void corrGains::beginRun ( edm::Run const &  iEvent,
edm::EventSetup const &   
)
inlineoverrideprivate

Definition at line 24 of file corrGains.cc.

24 {}

◆ endRun()

void corrGains::endRun ( edm::Run const &  iEvent,
edm::EventSetup const &   
)
inlineoverrideprivate

Definition at line 26 of file corrGains.cc.

26 {}

Member Data Documentation

◆ fileCorr

std::string corrGains::fileCorr
private

Definition at line 27 of file corrGains.cc.

Referenced by analyze(), and corrGains().

◆ fileIn

std::string corrGains::fileIn
private

Definition at line 27 of file corrGains.cc.

Referenced by analyze(), and corrGains().

◆ fileOut

std::string corrGains::fileOut
private

Definition at line 27 of file corrGains.cc.

Referenced by analyze(), and corrGains().

◆ tok_htopo_

edm::ESGetToken<HcalTopology, HcalRecNumberingRecord> corrGains::tok_htopo_
private

Definition at line 28 of file corrGains.cc.

Referenced by analyze(), and corrGains().

HcalRespCorrs
Definition: HcalRespCorrs.h:17
mps_fire.i
i
Definition: mps_fire.py:428
L1EGammaCrystalsEmulatorProducer_cfi.scale
scale
Definition: L1EGammaCrystalsEmulatorProducer_cfi.py:10
corrGains::fileIn
std::string fileIn
Definition: corrGains.cc:27
HcalTopology
Definition: HcalTopology.h:26
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
DetId
Definition: DetId.h:17
corrGains::fileOut
std::string fileOut
Definition: corrGains.cc:27
corrGains::fileCorr
std::string fileCorr
Definition: corrGains.cc:27
HcalGain
Definition: HcalGain.h:16
B2GTnPMonitor_cfi.item
item
Definition: B2GTnPMonitor_cfi.py:147
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
HcalDbASCIIIO::dumpObject
bool dumpObject(std::ostream &fOutput, const HcalPedestals &fObject)
HcalDbASCIIIO::getObject
bool getObject(std::istream &fInput, HcalPedestals *fObject)
ewkTauDQM_cfi.channels
channels
Definition: ewkTauDQM_cfi.py:14
HcalGains
Definition: HcalGains.h:17
corrGains::tok_htopo_
edm::ESGetToken< HcalTopology, HcalRecNumberingRecord > tok_htopo_
Definition: corrGains.cc:28