CMS 3D CMS Logo

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

Public Member Functions

 scaleGains (const edm::ParameterSet &)
 
 ~scaleGains () override
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::WatchRuns >
 EDAnalyzer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () 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
 
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::vector< ModuleDescription const * > &modules, 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
 
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 fileIn
 
std::string fileOut
 
double scale
 

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>
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<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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 17 of file scaleGains.cc.

Constructor & Destructor Documentation

◆ scaleGains()

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

Definition at line 30 of file scaleGains.cc.

30  {
31  fileIn = iConfig.getUntrackedParameter<std::string>("FileIn");
32  fileOut = iConfig.getUntrackedParameter<std::string>("FileOut");
33  scale = iConfig.getUntrackedParameter<double>("Scale");
34 }

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

◆ ~scaleGains()

scaleGains::~scaleGains ( )
override

Definition at line 36 of file scaleGains.cc.

36 {}

Member Function Documentation

◆ analyze()

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

Implements edm::one::EDAnalyzerBase.

Definition at line 38 of file scaleGains.cc.

38  {
40  iSetup.get<HcalRecNumberingRecord>().get(htopo);
41  HcalTopology topo = (*htopo);
42 
43  HcalGains gainsIn(&topo);
44  ;
45  std::ifstream inStream(fileIn.c_str());
46  HcalDbASCIIIO::getObject(inStream, &gainsIn);
47  inStream.close();
48 
49  HcalGains gainsOut(&topo);
50  ;
51  std::vector<DetId> channels = gainsIn.getAllChannels();
52  for (unsigned i = 0; i < channels.size(); i++) {
53  DetId id = channels[i];
54  HcalGain item(id,
55  gainsIn.getValues(id)->getValue(0) * scale,
56  gainsIn.getValues(id)->getValue(1) * scale,
57  gainsIn.getValues(id)->getValue(2) * scale,
58  gainsIn.getValues(id)->getValue(3) * scale);
59  gainsOut.addValues(item);
60  }
61 
62  std::ofstream outStream(fileOut.c_str());
63  HcalDbASCIIIO::dumpObject(outStream, gainsOut);
64  outStream.close();
65 }

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

◆ beginRun()

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

Definition at line 23 of file scaleGains.cc.

23 {}

◆ endRun()

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

Definition at line 25 of file scaleGains.cc.

25 {}

Member Data Documentation

◆ fileIn

std::string scaleGains::fileIn
private

Definition at line 26 of file scaleGains.cc.

Referenced by analyze(), and scaleGains().

◆ fileOut

std::string scaleGains::fileOut
private

Definition at line 26 of file scaleGains.cc.

Referenced by analyze(), and scaleGains().

◆ scale

double scaleGains::scale
private

Definition at line 27 of file scaleGains.cc.

Referenced by python.rootplot.rootmath.Target::__repr__(), analyze(), and scaleGains().

mps_fire.i
i
Definition: mps_fire.py:355
scaleGains::scale
double scale
Definition: scaleGains.cc:27
HcalTopology
Definition: HcalTopology.h:26
scaleGains::fileOut
std::string fileOut
Definition: scaleGains.cc:26
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
DetId
Definition: DetId.h:17
scaleGains::fileIn
std::string fileIn
Definition: scaleGains.cc:26
edm::ESHandle< HcalTopology >
HcalRecNumberingRecord
Definition: HcalRecNumberingRecord.h:23
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
HcalGain
Definition: HcalGain.h:16
B2GTnPMonitor_cfi.item
item
Definition: B2GTnPMonitor_cfi.py:147
get
#define get
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