CMS 3D CMS Logo

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

Public Member Functions

 corrResps (const edm::ParameterSet &)
 
 ~corrResps () 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 noexcept final
 
bool wantsGlobalRuns () const noexcept final
 
bool wantsInputProcessBlocks () const noexcept final
 
bool wantsProcessBlocks () const noexcept 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 noexcept
 
bool wantsStreamRuns () const noexcept
 
 ~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 const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > 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
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, 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::ESRecordsToProductResolverIndices 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
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
EDGetToken consumes (const TypeToGet &id, 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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
void resetItemsToGetFrom (BranchType iType)
 

Detailed Description

Definition at line 16 of file corrResps.cc.

Constructor & Destructor Documentation

◆ corrResps()

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

Definition at line 29 of file corrResps.cc.

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

29  {
30  fileIn = iConfig.getUntrackedParameter<std::string>("FileIn");
31  fileOut = iConfig.getUntrackedParameter<std::string>("FileOut");
32  fileCorr = iConfig.getUntrackedParameter<std::string>("FileCorr");
33  tok_htopo_ = esConsumes<HcalTopology, HcalRecNumberingRecord>();
34 }
std::string fileOut
Definition: corrResps.cc:25
edm::ESGetToken< HcalTopology, HcalRecNumberingRecord > tok_htopo_
Definition: corrResps.cc:26
T getUntrackedParameter(std::string const &, T const &) const
std::string fileCorr
Definition: corrResps.cc:25
std::string fileIn
Definition: corrResps.cc:25

◆ ~corrResps()

corrResps::~corrResps ( )
override

Definition at line 36 of file corrResps.cc.

36 {}

Member Function Documentation

◆ analyze()

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

Implements edm::one::EDAnalyzerBase.

Definition at line 38 of file corrResps.cc.

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(), HcalCondObjectContainer< Item >::getValues(), mps_fire::i, B2GTnPMonitor_cfi::item, l1tEGammaCrystalsEmulatorProducer_cfi::scale, and tok_htopo_.

38  {
39  HcalTopology topo = iSetup.getData(tok_htopo_);
40 
41  HcalRespCorrs respIn(&topo);
42  std::ifstream inStream(fileIn.c_str());
43  HcalDbASCIIIO::getObject(inStream, &respIn);
44  inStream.close();
45 
46  HcalRespCorrs corrsIn(&topo);
47  std::ifstream inCorr(fileCorr.c_str());
48  HcalDbASCIIIO::getObject(inCorr, &corrsIn);
49  inCorr.close();
50 
51  HcalRespCorrs respOut(&topo);
52  std::vector<DetId> channels = respIn.getAllChannels();
53  for (unsigned int i = 0; i < channels.size(); i++) {
54  DetId id = channels[i];
55  float scale = 1.0;
56  if (corrsIn.exists(id))
57  scale = corrsIn.getValues(id)->getValue();
58  HcalRespCorr item(id, respIn.getValues(id)->getValue() * scale);
59  respOut.addValues(item);
60  }
61 
62  std::ofstream outStream(fileOut.c_str());
63  HcalDbASCIIIO::dumpObject(outStream, respOut);
64  outStream.close();
65 }
std::string fileOut
Definition: corrResps.cc:25
edm::ESGetToken< HcalTopology, HcalRecNumberingRecord > tok_htopo_
Definition: corrResps.cc:26
Definition: DetId.h:17
std::string fileCorr
Definition: corrResps.cc:25
std::string fileIn
Definition: corrResps.cc:25
bool getObject(std::istream &fInput, HcalPedestals *fObject)
bool dumpObject(std::ostream &fOutput, const HcalPedestals &fObject)

◆ beginRun()

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

Definition at line 22 of file corrResps.cc.

22 {}

◆ endRun()

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

Definition at line 24 of file corrResps.cc.

24 {}

Member Data Documentation

◆ fileCorr

std::string corrResps::fileCorr
private

Definition at line 25 of file corrResps.cc.

Referenced by analyze(), and corrResps().

◆ fileIn

std::string corrResps::fileIn
private

Definition at line 25 of file corrResps.cc.

Referenced by analyze(), and corrResps().

◆ fileOut

std::string corrResps::fileOut
private

Definition at line 25 of file corrResps.cc.

Referenced by analyze(), and corrResps().

◆ tok_htopo_

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

Definition at line 26 of file corrResps.cc.

Referenced by analyze(), and corrResps().