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
 
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 const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
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
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
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 (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
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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 57 of file CastorDumpConditions.cc.

Constructor & Destructor Documentation

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

Definition at line 85 of file CastorDumpConditions.cc.

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

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

Member Function Documentation

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

Definition at line 103 of file CastorDumpConditions.cc.

References edm::EventBase::id(), iEvent, cmsBatch::log, mDumpRequest, and edm::EventID::run().

104 {
105  using namespace edm;
106 
107  {
108  edm::LogAbsolute log("CastorDumpConditions");
109  log << "I AM IN THE RUN " << iEvent.id().run() << "\n";
110  log << "What to dump? "<< std::endl;
111  if (mDumpRequest.empty()) {
112  log<< "CastorDumpConditions: Empty request \n";
113  return;
114  }
115  }
116 
117  for(std::vector<std::string>::const_iterator it=mDumpRequest.begin();it!=mDumpRequest.end();it++)
118  LogAbsolute("CastorDumpConditions") << *it << "\n";
119 
120  // dumpIt called for all possible ValueMaps. The function checks if the dump is actually requested.
121  dumpIt<CastorElectronicsMap , CastorElectronicsMapRcd> (mDumpRequest, iEvent,iSetup,"ElectronicsMap" );
122  dumpIt<CastorQIEData , CastorQIEDataRcd> (mDumpRequest, iEvent,iSetup,"QIEData" );
123  dumpIt<CastorPedestals , CastorPedestalsRcd> (mDumpRequest, iEvent,iSetup,"Pedestals" );
124  dumpIt<CastorPedestalWidths , CastorPedestalWidthsRcd> (mDumpRequest, iEvent,iSetup,"PedestalWidths" );
125  dumpIt<CastorGains , CastorGainsRcd> (mDumpRequest, iEvent,iSetup,"Gains" );
126  dumpIt<CastorGainWidths , CastorGainWidthsRcd> (mDumpRequest, iEvent,iSetup,"GainWidths" );
127  dumpIt<CastorChannelQuality , CastorChannelQualityRcd> (mDumpRequest, iEvent,iSetup,"ChannelQuality" );
128  dumpIt<CastorRecoParams , CastorRecoParamsRcd> (mDumpRequest, iEvent,iSetup,"RecoParams" );
129  dumpIt<CastorSaturationCorrs, CastorSaturationCorrsRcd>(mDumpRequest, iEvent,iSetup,"SaturationCorrs");
130 }
RunNumber_t run() const
Definition: EventID.h:39
int iEvent
Definition: GenABIO.cc:224
std::vector< std::string > mDumpRequest
edm::EventID id() const
Definition: EventBase.h:59
HLT enums.
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 134 of file CastorDumpConditions.cc.

References DEFINE_FWK_MODULE, CastorDbASCIIIO::dumpObject(), FrontierConditions_GlobalTag_cff::file, file_prefix, spr::find(), edm::EventSetup::get(), edm::EventBase::id(), dataset::name, AlCaHLTBitMon_ParallelJobs::p, edm::ESHandle< T >::product(), and edm::EventID::run().

137  {
138  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), name) != mDumpRequest.end())
139  {
140  int myrun = e.id().run();
142  context.get<SRcd>().get(p);
143  S myobject(*p.product());
144 
145  std::ostringstream file;
146  file << file_prefix << name.c_str() << "_Run" << myrun << ".txt";
147  std::ofstream outStream(file.str().c_str() );
148  CastorDbASCIIIO::dumpObject (outStream, myobject );
149  }
150 }
RunNumber_t run() const
Definition: EventID.h:39
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
std::vector< std::string > mDumpRequest
bool dumpObject(std::ostream &fOutput, const CastorPedestals &fObject)
edm::EventID id() const
Definition: EventBase.h:59
T get() const
Definition: EventSetup.h:71
T const * product() const
Definition: ESHandle.h:86

Member Data Documentation

std::string CastorDumpConditions::file_prefix
private

Definition at line 67 of file CastorDumpConditions.cc.

Referenced by CastorDumpConditions(), and dumpIt().

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

Definition at line 68 of file CastorDumpConditions.cc.

Referenced by analyze(), and CastorDumpConditions().