1 #ifndef BTRANSITIONANALYZER_H 2 #define BTRANSITIONANALYZER_H 16 template<
class T,
class R>
20 m_currentThreshold( pset.getUntrackedParameter<double>(
"currentThreshold", 18000. ) ) {
22 #ifdef __INTEL_COMPILER 34 eventSetup.get<
RunInfoRcd>().
get(runInfoHandle);
36 double current_default = -1;
40 LogDebug(
"BTransitionAnalyzer" ) <<
"Comparing value of magnet current: " << avg_current <<
" A for run: " <<
run.run()
42 if( avg_current != current_default && avg_current <=
m_currentThreshold ) bFieldLabel = bOffLabel;
43 edm::LogInfo(
"BTransitionAnalyzer" ) <<
"The magnet was " 44 << ( bFieldLabel == bOnLabel ?
"ON" :
"OFF" ) <<
" during run " <<
run.run()
45 <<
".\nLoading the product for the corrisponding label " << bFieldLabel << std::endl;
46 eventSetup.get<
R>().
get( bFieldLabel, payloadHandle );
47 eventSetup.get<
R>().
get( payloadRefHandle );
51 edm::LogInfo(
"BTransitionAnalyzer" ) <<
"Exporting payload corresponding to the calibrations for magnetic field " 52 << ( bFieldLabel == bOnLabel ?
"ON" :
"OFF" )
53 <<
" starting from run number: " <<
run.run() << std::endl;
56 edm::LogInfo(
"BTransitionAnalyzer" ) <<
"The payload corresponding to the calibrations for magnetic field " 57 << ( bFieldLabel == bOnLabel ?
"ON" :
"OFF" )
58 <<
" is still valid for run " <<
run.run()
59 <<
".\nNo transfer needed." << std::endl;
62 edm::LogError(
"BTransitionAnalyzer" ) <<
"PoolDBOutputService unavailable";
71 #endif //BTRANSITIONANALYZER_H
double m_currentThreshold
virtual void endRun(edm::Run const &run, edm::EventSetup const &eventSetup) final
BTransitionAnalyzer(const edm::ParameterSet &pset)
virtual void beginJob() final
virtual bool equalPayloads(edm::ESHandle< T > const &payloadHandle, edm::ESHandle< T > const &payloadRefHandle)=0
void writeOne(T *payload, Time_t time, const std::string &recordName, bool withlogging=false)
virtual void analyze(edm::Event const &, edm::EventSetup const &) final
virtual void beginRun(edm::Run const &, edm::EventSetup const &) final
T const * product() const
virtual void endJob() final