CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
cond::BTransitionAnalyzer< T, R > Class Template Referenceabstract

#include <BTransitionAnalyzer.h>

Inheritance diagram for cond::BTransitionAnalyzer< T, R >:
edm::one::EDAnalyzer< edm::one::WatchRuns > edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

void analyze (edm::Event const &, edm::EventSetup const &) final
 
void beginJob () final
 
void beginRun (edm::Run const &, edm::EventSetup const &) final
 
 BTransitionAnalyzer (const edm::ParameterSet &pset)
 
void endJob () final
 
void endRun (edm::Run const &run, edm::EventSetup const &eventSetup) final
 
virtual bool equalPayloads (edm::ESHandle< T > const &payloadHandle, edm::ESHandle< T > const &payloadRefHandle)=0
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::WatchRuns >
 EDAnalyzer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
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::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

double m_currentThreshold
 

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

template<class T, class R>
class cond::BTransitionAnalyzer< T, R >

Definition at line 17 of file BTransitionAnalyzer.h.

Constructor & Destructor Documentation

◆ BTransitionAnalyzer()

template<class T, class R>
cond::BTransitionAnalyzer< T, R >::BTransitionAnalyzer ( const edm::ParameterSet pset)
inline

Definition at line 19 of file BTransitionAnalyzer.h.

20  : m_currentThreshold(pset.getUntrackedParameter<double>("currentThreshold", 18000.)) {}

Member Function Documentation

◆ analyze()

template<class T, class R>
void cond::BTransitionAnalyzer< T, R >::analyze ( edm::Event const &  ,
edm::EventSetup const &   
)
inlinefinalvirtual

Implements edm::one::EDAnalyzerBase.

Definition at line 29 of file BTransitionAnalyzer.h.

29 {};

◆ beginJob()

template<class T, class R>
void cond::BTransitionAnalyzer< T, R >::beginJob ( void  )
inlinefinalvirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 27 of file BTransitionAnalyzer.h.

27 {};

◆ beginRun()

template<class T, class R>
void cond::BTransitionAnalyzer< T, R >::beginRun ( edm::Run const &  ,
edm::EventSetup const &   
)
inlinefinal

Definition at line 28 of file BTransitionAnalyzer.h.

28 {};

◆ endJob()

template<class T, class R>
void cond::BTransitionAnalyzer< T, R >::endJob ( void  )
inlinefinalvirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 66 of file BTransitionAnalyzer.h.

66 {};

◆ endRun()

template<class T, class R>
void cond::BTransitionAnalyzer< T, R >::endRun ( edm::Run const &  run,
edm::EventSetup const &  eventSetup 
)
inlinefinal

Definition at line 30 of file BTransitionAnalyzer.h.

30  {
31  edm::ESHandle<RunInfo> runInfoHandle;
32  edm::ESHandle<T> payloadHandle, payloadRefHandle;
33  eventSetup.get<RunInfoRcd>().get(runInfoHandle);
34  double avg_current = (double)runInfoHandle->m_avg_current;
35  double current_default = -1;
36  std::string bOnLabel = std::string("38T");
37  std::string bOffLabel = std::string("0T");
38  std::string bFieldLabel = bOnLabel;
39  LogDebug("BTransitionAnalyzer") << "Comparing value of magnet current: " << avg_current
40  << " A for run: " << run.run()
41  << " with the corresponding threshold: " << m_currentThreshold << " A."
42  << std::endl;
43  if (avg_current != current_default && avg_current <= m_currentThreshold)
44  bFieldLabel = bOffLabel;
45  edm::LogInfo("BTransitionAnalyzer")
46  << "The magnet was " << (bFieldLabel == bOnLabel ? "ON" : "OFF") << " during run " << run.run()
47  << ".\nLoading the product for the corrisponding label " << bFieldLabel << std::endl;
48  eventSetup.get<R>().get(bFieldLabel, payloadHandle);
49  eventSetup.get<R>().get(payloadRefHandle);
51  if (mydbservice.isAvailable()) {
52  if (!equalPayloads(payloadHandle, payloadRefHandle)) {
53  edm::LogInfo("BTransitionAnalyzer")
54  << "Exporting payload corresponding to the calibrations for magnetic field "
55  << (bFieldLabel == bOnLabel ? "ON" : "OFF") << " starting from run number: " << run.run() << std::endl;
56  mydbservice->writeOne(payloadHandle.product(), run.run(), demangledName(typeid(R)));
57  } else {
58  edm::LogInfo("BTransitionAnalyzer") << "The payload corresponding to the calibrations for magnetic field "
59  << (bFieldLabel == bOnLabel ? "ON" : "OFF") << " is still valid for run "
60  << run.run() << ".\nNo transfer needed." << std::endl;
61  }
62  } else {
63  edm::LogError("BTransitionAnalyzer") << "PoolDBOutputService unavailable";
64  }
65  }

◆ equalPayloads()

template<class T, class R>
virtual bool cond::BTransitionAnalyzer< T, R >::equalPayloads ( edm::ESHandle< T > const &  payloadHandle,
edm::ESHandle< T > const &  payloadRefHandle 
)
pure virtual

Member Data Documentation

◆ m_currentThreshold

template<class T, class R>
double cond::BTransitionAnalyzer< T, R >::m_currentThreshold
private
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
cond::BTransitionAnalyzer::equalPayloads
virtual bool equalPayloads(edm::ESHandle< T > const &payloadHandle, edm::ESHandle< T > const &payloadRefHandle)=0
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
edm::Service::isAvailable
bool isAvailable() const
Definition: Service.h:40
edm::ESHandle
Definition: DTSurvey.h:22
RunInfoRcd
Definition: RunSummaryRcd.h:26
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:223
cond::BTransitionAnalyzer::m_currentThreshold
double m_currentThreshold
Definition: BTransitionAnalyzer.h:70
edm::Service< cond::service::PoolDBOutputService >
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
get
#define get
writedatasetfile.run
run
Definition: writedatasetfile.py:27
cond::service::PoolDBOutputService::writeOne
Hash writeOne(const T *payload, Time_t time, const std::string &recordName)
Definition: PoolDBOutputService.h:63
RunInfo::m_avg_current
float m_avg_current
Definition: RunInfo.h:28
dttmaxenums::R
Definition: DTTMax.h:29
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27