CMS 3D CMS Logo

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

Public Member Functions

 CastorDumpConditions (const edm::ParameterSet &)
 
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)
 
- Public Member Functions inherited from edm::one::EDAnalyzer<>
 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 (const edm::Event &, const edm::EventSetup &) override
 

Private Attributes

std::string file_prefix
 
std::vector< std::string > mDumpRequest
 

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 55 of file CastorDumpConditions.cc.

Constructor & Destructor Documentation

◆ CastorDumpConditions()

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

Definition at line 84 of file CastorDumpConditions.cc.

86 {
87  file_prefix = iConfig.getUntrackedParameter<std::string>("outFilePrefix", "Dump");
88  mDumpRequest = iConfig.getUntrackedParameter<std::vector<std::string> >("dump", std::vector<std::string>());
89  if (mDumpRequest.empty()) {
90  throw cms::Exception("Bad Config") << "CastorDumpConditions: No record to dump.";
91  }
92 }

References Exception, file_prefix, edm::ParameterSet::getUntrackedParameter(), mDumpRequest, and AlCaHLTBitMon_QueryRunRegistry::string.

Member Function Documentation

◆ analyze()

void CastorDumpConditions::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Implements edm::one::EDAnalyzerBase.

Definition at line 99 of file CastorDumpConditions.cc.

99  {
100  using namespace edm;
101 
102  {
103  edm::LogAbsolute log("CastorDumpConditions");
104  log << "I AM IN THE RUN " << iEvent.id().run() << "\n";
105  log << "What to dump? " << std::endl;
106  if (mDumpRequest.empty()) {
107  log << "CastorDumpConditions: Empty request \n";
108  return;
109  }
110  }
111 
112  for (std::vector<std::string>::const_iterator it = mDumpRequest.begin(); it != mDumpRequest.end(); it++)
113  LogAbsolute("CastorDumpConditions") << *it << "\n";
114 
115  // dumpIt called for all possible ValueMaps. The function checks if the dump is actually requested.
116  dumpIt<CastorElectronicsMap, CastorElectronicsMapRcd>(mDumpRequest, iEvent, iSetup, "ElectronicsMap");
117  dumpIt<CastorQIEData, CastorQIEDataRcd>(mDumpRequest, iEvent, iSetup, "QIEData");
118  dumpIt<CastorPedestals, CastorPedestalsRcd>(mDumpRequest, iEvent, iSetup, "Pedestals");
119  dumpIt<CastorPedestalWidths, CastorPedestalWidthsRcd>(mDumpRequest, iEvent, iSetup, "PedestalWidths");
120  dumpIt<CastorGains, CastorGainsRcd>(mDumpRequest, iEvent, iSetup, "Gains");
121  dumpIt<CastorGainWidths, CastorGainWidthsRcd>(mDumpRequest, iEvent, iSetup, "GainWidths");
122  dumpIt<CastorChannelQuality, CastorChannelQualityRcd>(mDumpRequest, iEvent, iSetup, "ChannelQuality");
123  dumpIt<CastorRecoParams, CastorRecoParamsRcd>(mDumpRequest, iEvent, iSetup, "RecoParams");
124  dumpIt<CastorSaturationCorrs, CastorSaturationCorrsRcd>(mDumpRequest, iEvent, iSetup, "SaturationCorrs");
125 }

References iEvent, dqm-mbProfile::log, and mDumpRequest.

◆ dumpIt()

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

Definition at line 128 of file CastorDumpConditions.cc.

131  {
132  if (std::find(mDumpRequest.begin(), mDumpRequest.end(), name) != mDumpRequest.end()) {
133  int myrun = e.id().run();
134  edm::ESGetToken<S, SRcd> tok = esConsumes<S, SRcd>();
135  const S& myobject = context.getData(tok);
136 
137  std::ostringstream file;
138  file << file_prefix << name.c_str() << "_Run" << myrun << ".txt";
139  std::ofstream outStream(file.str().c_str());
140  CastorDbASCIIIO::dumpObject(outStream, myobject);
141  }
142 }

References visDQMUpload::context, CastorDbASCIIIO::dumpObject(), MillePedeFileConverter_cfg::e, geometryDiff::file, file_prefix, spr::find(), mDumpRequest, and Skims_PA_cff::name.

Member Data Documentation

◆ file_prefix

std::string CastorDumpConditions::file_prefix
private

Definition at line 66 of file CastorDumpConditions.cc.

Referenced by CastorDumpConditions(), and dumpIt().

◆ mDumpRequest

std::vector<std::string> CastorDumpConditions::mDumpRequest
private

Definition at line 67 of file CastorDumpConditions.cc.

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

edm
HLT enums.
Definition: AlignableModifier.h:19
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
spr::find
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
visDQMUpload.context
context
Definition: visDQMUpload.py:37
CastorDumpConditions::file_prefix
std::string file_prefix
Definition: CastorDumpConditions.cc:66
geometryDiff.file
file
Definition: geometryDiff.py:13
CastorDbASCIIIO::dumpObject
bool dumpObject(std::ostream &fOutput, const CastorPedestals &fObject)
Definition: CastorDbASCIIIO.cc:320
CastorDumpConditions::mDumpRequest
std::vector< std::string > mDumpRequest
Definition: CastorDumpConditions.cc:67
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::LogAbsolute
Log< level::System, true > LogAbsolute
Definition: MessageLogger.h:134
edm::ESGetToken
Definition: EventSetup.h:48
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
Exception
Definition: hltDiff.cc:245
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
dqm-mbProfile.log
log
Definition: dqm-mbProfile.py:17
S
Definition: CSCDBL1TPParametersExtended.h:16
edm::Log
Definition: MessageLogger.h:70
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37