CMS 3D CMS Logo

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

Public Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c) override
 
template<class S , class SRcd >
void dumpIt (const std::vector< std::string > &mDumpRequest, const edm::Event &e, const edm::EventSetup &context, const std::string name)
 
template<class S , class SRcd >
void dumpIt (const std::vector< std::string > &mDumpRequest, const edm::Event &e, const edm::EventSetup &context, const std::string name, const HcalTopology *topo, const std::string label="")
 
 HcalDumpConditions (edm::ParameterSet const &p)
 
 HcalDumpConditions (int i)
 
template<class S >
void writeToFile (const S &myS, const edm::Event &e, const std::string name)
 
 ~HcalDumpConditions () 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
 
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 Attributes

std::string front
 
std::vector< std::string > mDumpRequest
 

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 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>
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 39 of file HcalDumpConditions.cc.

Constructor & Destructor Documentation

◆ HcalDumpConditions() [1/2]

edmtest::HcalDumpConditions::HcalDumpConditions ( edm::ParameterSet const &  p)
inlineexplicit

Definition at line 41 of file HcalDumpConditions.cc.

41  {
42  front = p.getUntrackedParameter<std::string>("outFilePrefix", "Dump");
43  mDumpRequest = p.getUntrackedParameter<std::vector<std::string> >("dump", std::vector<std::string>());
44  }

References front, mDumpRequest, AlCaHLTBitMon_ParallelJobs::p, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ HcalDumpConditions() [2/2]

edmtest::HcalDumpConditions::HcalDumpConditions ( int  i)
inlineexplicit

Definition at line 46 of file HcalDumpConditions.cc.

46 {}

◆ ~HcalDumpConditions()

edmtest::HcalDumpConditions::~HcalDumpConditions ( )
inlineoverride

Definition at line 47 of file HcalDumpConditions.cc.

47 {}

Member Function Documentation

◆ analyze()

void edmtest::HcalDumpConditions::analyze ( const edm::Event e,
const edm::EventSetup c 
)
overridevirtual

Implements edm::EDAnalyzer.

Definition at line 121 of file HcalDumpConditions.cc.

121  {
123  context.get<HcalRecNumberingRecord>().get(topology);
124  const HcalTopology* topo = &(*topology);
125 
126  using namespace edm::eventsetup;
127  std::cout << "HcalDumpConditions::analyze-> I AM IN RUN NUMBER " << e.id().run() << std::endl;
128 
129  if (mDumpRequest.empty())
130  return;
131 
132  // dumpIt called for all possible ValueMaps. The function checks if the dump is actually requested.
133  dumpIt<HcalElectronicsMap, HcalElectronicsMapRcd>(mDumpRequest, e, context, "ElectronicsMap");
134  dumpIt<HcalFrontEndMap, HcalFrontEndMapRcd>(mDumpRequest, e, context, "FrontEndMap");
135  dumpIt<HcalQIEData, HcalQIEDataRcd>(mDumpRequest, e, context, "QIEData", topo);
136  dumpIt<HcalQIETypes, HcalQIETypesRcd>(mDumpRequest, e, context, "QIETypes", topo);
137  dumpIt<HcalPedestals, HcalPedestalsRcd>(mDumpRequest, e, context, "Pedestals", topo);
138  dumpIt<HcalPedestalWidths, HcalPedestalWidthsRcd>(mDumpRequest, e, context, "PedestalWidths", topo);
139  dumpIt<HcalPedestals, HcalPedestalsRcd>(mDumpRequest, e, context, "EffectivePedestals", topo, "effective");
140  dumpIt<HcalPedestalWidths, HcalPedestalWidthsRcd>(
141  mDumpRequest, e, context, "EffectivePedestalWidths", topo, "effective");
142  dumpIt<HcalGains, HcalGainsRcd>(mDumpRequest, e, context, "Gains", topo);
143  dumpIt<HcalGainWidths, HcalGainWidthsRcd>(mDumpRequest, e, context, "GainWidths", topo);
144  dumpIt<HcalChannelQuality, HcalChannelQualityRcd>(mDumpRequest, e, context, "ChannelQuality", topo, "withTopo");
145  dumpIt<HcalRespCorrs, HcalRespCorrsRcd>(mDumpRequest, e, context, "RespCorrs", topo);
146  dumpIt<HcalZSThresholds, HcalZSThresholdsRcd>(mDumpRequest, e, context, "ZSThresholds", topo);
147  dumpIt<HcalL1TriggerObjects, HcalL1TriggerObjectsRcd>(mDumpRequest, e, context, "L1TriggerObjects", topo);
148  dumpIt<HcalTimeCorrs, HcalTimeCorrsRcd>(mDumpRequest, e, context, "TimeCorrs", topo);
149  dumpIt<HcalLUTCorrs, HcalLUTCorrsRcd>(mDumpRequest, e, context, "LUTCorrs", topo);
150  dumpIt<HcalPFCorrs, HcalPFCorrsRcd>(mDumpRequest, e, context, "PFCorrs", topo);
151  dumpIt<HcalValidationCorrs, HcalValidationCorrsRcd>(mDumpRequest, e, context, "ValidationCorrs", topo);
152  dumpIt<HcalLutMetadata, HcalLutMetadataRcd>(mDumpRequest, e, context, "LutMetadata", topo);
153  dumpIt<HcalDcsValues, HcalDcsRcd>(mDumpRequest, e, context, "DcsValues");
154  dumpIt<HcalDcsMap, HcalDcsMapRcd>(mDumpRequest, e, context, "DcsMap");
155  dumpIt<HcalRecoParams, HcalRecoParamsRcd>(mDumpRequest, e, context, "RecoParams", topo);
156  dumpIt<HcalTimingParams, HcalTimingParamsRcd>(mDumpRequest, e, context, "TimingParams", topo);
157  dumpIt<HcalLongRecoParams, HcalLongRecoParamsRcd>(mDumpRequest, e, context, "LongRecoParams", topo);
158  dumpIt<HcalZDCLowGainFractions, HcalZDCLowGainFractionsRcd>(mDumpRequest, e, context, "ZDCLowGainFractions", topo);
159  dumpIt<HcalMCParams, HcalMCParamsRcd>(mDumpRequest, e, context, "MCParams", topo);
160  dumpIt<HcalFlagHFDigiTimeParams, HcalFlagHFDigiTimeParamsRcd>(
161  mDumpRequest, e, context, "FlagHFDigiTimeParams", topo);
162  dumpIt<HcalSiPMParameters, HcalSiPMParametersRcd>(mDumpRequest, e, context, "SiPMParameters", topo);
163  dumpIt<HcalSiPMCharacteristics, HcalSiPMCharacteristicsRcd>(mDumpRequest, e, context, "SiPMCharacteristics");
164  dumpIt<HcalTPChannelParameters, HcalTPChannelParametersRcd>(mDumpRequest, e, context, "TPChannelParameters", topo);
165  dumpIt<HcalTPParameters, HcalTPParametersRcd>(mDumpRequest, e, context, "TPParameters");
166 
168  if (std::find(mDumpRequest.begin(), mDumpRequest.end(), std::string("CalibrationsSet")) != mDumpRequest.end() ||
169  std::find(mDumpRequest.begin(), mDumpRequest.end(), std::string("CalibrationWidthsSet")) !=
170  mDumpRequest.end()) {
171  context.get<HcalDbRecord>().get(pSetup);
172  if (std::find(mDumpRequest.begin(), mDumpRequest.end(), std::string("CalibrationsSet")) != mDumpRequest.end()) {
173  writeToFile(*pSetup->getHcalCalibrationsSet(), e, "CalibrationsSet");
174  }
175  if (std::find(mDumpRequest.begin(), mDumpRequest.end(), std::string("CalibrationWidthsSet")) !=
176  mDumpRequest.end()) {
177  writeToFile(*pSetup->getHcalCalibrationWidthsSet(), e, "CalibrationWidthsSet");
178  }
179  }
180  }

References gather_cfg::cout, MillePedeFileConverter_cfg::e, spr::find(), edm::EventSetup::get(), get, HcalDbService::getHcalCalibrationsSet(), HcalDbService::getHcalCalibrationWidthsSet(), mDumpRequest, AlCaHLTBitMon_QueryRunRegistry::string, ecaldqm::topology(), and writeToFile().

◆ dumpIt() [1/2]

template<class S , class SRcd >
void edmtest::HcalDumpConditions::dumpIt ( const std::vector< std::string > &  mDumpRequest,
const edm::Event e,
const edm::EventSetup context,
const std::string  name 
)

Definition at line 95 of file HcalDumpConditions.cc.

98  {
99  if (std::find(mDumpRequest.begin(), mDumpRequest.end(), name) != mDumpRequest.end()) {
101  context.get<SRcd>().get(p);
102  S myobject(*p.product());
103 
104  writeToFile(myobject, e, name);
105 
106  if (context.get<SRcd>().validityInterval().first() == edm::IOVSyncValue::invalidIOVSyncValue())
107  std::cout << "error: invalid IOV sync value !" << std::endl;
108  }
109  }

References gather_cfg::cout, MillePedeFileConverter_cfg::e, spr::find(), edm::EventSetup::get(), get, edm::IOVSyncValue::invalidIOVSyncValue(), mDumpRequest, Skims_PA_cff::name, AlCaHLTBitMon_ParallelJobs::p, and writeToFile().

◆ dumpIt() [2/2]

template<class S , class SRcd >
void edmtest::HcalDumpConditions::dumpIt ( const std::vector< std::string > &  mDumpRequest,
const edm::Event e,
const edm::EventSetup context,
const std::string  name,
const HcalTopology topo,
const std::string  label = "" 
)

Definition at line 71 of file HcalDumpConditions.cc.

76  {
77  if (std::find(mDumpRequest.begin(), mDumpRequest.end(), name) != mDumpRequest.end()) {
79  if (!label.empty())
80  context.get<SRcd>().get(label, p);
81  else
82  context.get<SRcd>().get(p);
83  S myobject(*p.product());
84  if (topo)
85  myobject.setTopo(topo);
86 
87  writeToFile(myobject, e, name);
88 
89  if (context.get<SRcd>().validityInterval().first() == edm::IOVSyncValue::invalidIOVSyncValue())
90  std::cout << "error: invalid IOV sync value !" << std::endl;
91  }
92  }

References gather_cfg::cout, MillePedeFileConverter_cfg::e, spr::find(), edm::EventSetup::get(), get, edm::IOVSyncValue::invalidIOVSyncValue(), label, mDumpRequest, Skims_PA_cff::name, AlCaHLTBitMon_ParallelJobs::p, and writeToFile().

◆ writeToFile()

template<class S >
void edmtest::HcalDumpConditions::writeToFile ( const S myS,
const edm::Event e,
const std::string  name 
)

Definition at line 112 of file HcalDumpConditions.cc.

112  {
113  int myrun = e.id().run();
114  std::ostringstream file;
115  file << front << name.c_str() << "_Run" << myrun << ".txt";
116  std::ofstream outStream(file.str().c_str());
117  std::cout << "HcalDumpConditions: ---- Dumping " << name << " ----" << std::endl;
118  HcalDbASCIIIO::dumpObject(outStream, myS);
119  }

References gather_cfg::cout, HcalDbASCIIIO::dumpObject(), MillePedeFileConverter_cfg::e, FrontierConditions_GlobalTag_cff::file, front, and Skims_PA_cff::name.

Referenced by analyze(), and dumpIt().

Member Data Documentation

◆ front

std::string edmtest::HcalDumpConditions::front
private

Definition at line 66 of file HcalDumpConditions.cc.

Referenced by HcalDumpConditions(), and writeToFile().

◆ mDumpRequest

std::vector<std::string> edmtest::HcalDumpConditions::mDumpRequest
private

Definition at line 67 of file HcalDumpConditions.cc.

Referenced by analyze(), dumpIt(), and HcalDumpConditions().

edmtest::HcalDumpConditions::writeToFile
void writeToFile(const S &myS, const edm::Event &e, const std::string name)
Definition: HcalDumpConditions.cc:112
edm::IOVSyncValue::invalidIOVSyncValue
static const IOVSyncValue & invalidIOVSyncValue()
Definition: IOVSyncValue.cc:78
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
gather_cfg.cout
cout
Definition: gather_cfg.py:144
HcalTopology
Definition: HcalTopology.h:26
spr::find
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
HcalDbService::getHcalCalibrationWidthsSet
const HcalCalibrationWidthsSet * getHcalCalibrationWidthsSet() const
Definition: HcalDbService.cc:80
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
ecaldqm::topology
const CaloTopology * topology(nullptr)
edm::ESHandle< HcalTopology >
HcalRecNumberingRecord
Definition: HcalRecNumberingRecord.h:23
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edmtest::HcalDumpConditions::mDumpRequest
std::vector< std::string > mDumpRequest
Definition: HcalDumpConditions.cc:67
FrontierConditions_GlobalTag_cff.file
file
Definition: FrontierConditions_GlobalTag_cff.py:13
HcalDbService::getHcalCalibrationsSet
const HcalCalibrationsSet * getHcalCalibrationsSet() const
Definition: HcalDbService.cc:75
get
#define get
edmtest::HcalDumpConditions::front
std::string front
Definition: HcalDumpConditions.cc:66
HcalDbASCIIIO::dumpObject
bool dumpObject(std::ostream &fOutput, const HcalPedestals &fObject)
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
S
Definition: CSCDBL1TPParametersExtended.h:16
HcalDbRecord
Definition: HcalDbRecord.h:30
edm::eventsetup
Definition: ES_DDDetector.cc:16
label
const char * label
Definition: PFTauDecayModeTools.cc:11
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37