CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 ()
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::WatchRuns >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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
 

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)
 
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 ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
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)
 

Detailed Description

Definition at line 17 of file corrResps.cc.

Constructor & Destructor Documentation

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

Definition at line 30 of file corrResps.cc.

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

30  {
31  fileIn = iConfig.getUntrackedParameter<std::string>("FileIn");
32  fileOut = iConfig.getUntrackedParameter<std::string>("FileOut");
33  fileCorr = iConfig.getUntrackedParameter<std::string>("FileCorr");
34 }
T getUntrackedParameter(std::string const &, T const &) const
std::string fileOut
Definition: corrResps.cc:27
std::string fileCorr
Definition: corrResps.cc:27
std::string fileIn
Definition: corrResps.cc:27
corrResps::~corrResps ( )

Definition at line 36 of file corrResps.cc.

36 { }

Member Function Documentation

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(), HcalDbASCIIIO::dumpObject(), HcalCondObjectContainer< Item >::exists(), fileCorr, fileIn, fileOut, edm::EventSetup::get(), HcalCondObjectContainer< Item >::getAllChannels(), HcalDbASCIIIO::getObject(), HcalRespCorr::getValue(), HcalCondObjectContainer< Item >::getValues(), i, and pileupReCalc_HLTpaths::scale.

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

Definition at line 24 of file corrResps.cc.

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

Definition at line 26 of file corrResps.cc.

26 {}

Member Data Documentation

std::string corrResps::fileCorr
private

Definition at line 27 of file corrResps.cc.

Referenced by analyze(), and corrResps().

std::string corrResps::fileIn
private

Definition at line 27 of file corrResps.cc.

Referenced by analyze(), and corrResps().

std::string corrResps::fileOut
private

Definition at line 27 of file corrResps.cc.

Referenced by analyze(), and corrResps().