59 template<
class S,
class SRcd>
void dumpIt(
const std::vector<std::string>&
mDumpRequest,
90 if (mDumpRequest.empty()) {
91 std::cout <<
"CastorDumpConditions: No record to dump. Exiting." << std::endl;
117 #ifdef THIS_IS_AN_EVENT_EXAMPLE 122 #ifdef THIS_IS_AN_EVENTSETUP_EXAMPLE 124 iSetup.
get<SetupRecord>().
get(pSetup);
126 std::cout <<
"I AM IN THE RUN " << iEvent.
id().
run() << std::endl;
127 std::cout <<
"What to dump? "<< std::endl;
129 std::cout<<
"CastorDumpConditions: Empty request" << std::endl;
137 dumpIt<CastorElectronicsMap , CastorElectronicsMapRcd> (
mDumpRequest,
iEvent,iSetup,
"ElectronicsMap" );
139 dumpIt<CastorPedestals , CastorPedestalsRcd> (
mDumpRequest,
iEvent,iSetup,
"Pedestals" );
140 dumpIt<CastorPedestalWidths , CastorPedestalWidthsRcd> (
mDumpRequest,
iEvent,iSetup,
"PedestalWidths" );
142 dumpIt<CastorGainWidths , CastorGainWidthsRcd> (
mDumpRequest,
iEvent,iSetup,
"GainWidths" );
143 dumpIt<CastorChannelQuality , CastorChannelQualityRcd> (
mDumpRequest,
iEvent,iSetup,
"ChannelQuality" );
144 dumpIt<CastorRecoParams , CastorRecoParamsRcd> (
mDumpRequest,
iEvent,iSetup,
"RecoParams" );
145 dumpIt<CastorSaturationCorrs, CastorSaturationCorrsRcd>(
mDumpRequest,
iEvent,iSetup,
"SaturationCorrs");
160 template<
class S,
class SRcd>
165 if (
std::find (mDumpRequest.begin(), mDumpRequest.end(),
name) != mDumpRequest.end())
167 int myrun = e.
id().
run();
169 context.
get<SRcd>().
get(p);
172 std::ostringstream
file;
173 file <<
file_prefix << name.c_str() <<
"_Run" << myrun <<
".txt";
174 std::ofstream outStream(file.str().c_str() );
T getUntrackedParameter(std::string const &, T const &) const
#define DEFINE_FWK_MODULE(type)
void analyze(const edm::Event &, const edm::EventSetup &) override
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
std::vector< std::string > mDumpRequest
~CastorDumpConditions() override
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
void dumpIt(const std::vector< std::string > &mDumpRequest, const edm::Event &e, const edm::EventSetup &context, const std::string name)
bool dumpObject(std::ostream &fOutput, const CastorPedestals &fObject)
CastorDumpConditions(const edm::ParameterSet &)
T const * product() const