CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
TKStatus Class Reference

#include <TKStatus.h>

Inheritance diagram for TKStatus:
edm::one::EDAnalyzer<> edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 TKStatus (const edm::ParameterSet &)
 
- Public Member Functions inherited from edm::one::EDAnalyzer<>
 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::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
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Protected Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c) override
 
- 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)
 

Private Member Functions

void dumpTkDcsStatus (std::string const &, edm::RunNumber_t, std::array< bool, 6 > const &)
 

Private Attributes

edm::EDGetTokenT< DcsStatusCollectiondcsStatus_
 
std::string dcsTkFileName_
 
int lastlumi_ = -1
 

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)
 

Detailed Description

Definition at line 26 of file TKStatus.h.

Constructor & Destructor Documentation

◆ TKStatus()

TKStatus::TKStatus ( const edm::ParameterSet ps)

Definition at line 10 of file TKStatus.cc.

10  {
11  dcsTkFileName_ = ps.getParameter<ParameterSet>("BeamFitter").getUntrackedParameter<std::string>("DIPFileName");
12  {
13  std::string tmpname = dcsTkFileName_;
14  tmpname.insert(dcsTkFileName_.length() - 4, "_TkStatus");
15  dcsTkFileName_ = std::move(tmpname);
16  }
17  dcsStatus_ = consumes<DcsStatusCollection>(ps.getUntrackedParameter<std::string>("DCSStatus", "scalersRawToDigi"));
18 }

References edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), eostools::move(), and AlCaHLTBitMon_QueryRunRegistry::string.

Member Function Documentation

◆ analyze()

void TKStatus::analyze ( const edm::Event e,
const edm::EventSetup c 
)
overrideprotectedvirtual

Implements edm::one::EDAnalyzerBase.

Definition at line 21 of file TKStatus.cc.

21  {
22  int nthlumi = iEvent.luminosityBlock();
23  if (nthlumi > lastlumi_) { // check every LS
24  lastlumi_ = nthlumi;
25  // Checking TK status
27  iEvent.getByToken(dcsStatus_, dcsStatus);
28 
29  std::array<bool, 6> dcsTk;
30  for (auto& e : dcsTk) {
31  e = true;
32  }
33 
34  for (auto const& status : *dcsStatus) {
35  if (!status.ready(DcsStatus::BPIX))
36  dcsTk[0] = false;
37  if (!status.ready(DcsStatus::FPIX))
38  dcsTk[1] = false;
39  if (!status.ready(DcsStatus::TIBTID))
40  dcsTk[2] = false;
41  if (!status.ready(DcsStatus::TOB))
42  dcsTk[3] = false;
43  if (!status.ready(DcsStatus::TECp))
44  dcsTk[4] = false;
45  if (!status.ready(DcsStatus::TECm))
46  dcsTk[5] = false;
47  }
48  dumpTkDcsStatus(dcsTkFileName_, iEvent.run(), dcsTk);
49  }
50 }

References DcsStatus::BPIX, MillePedeFileConverter_cfg::e, DcsStatus::FPIX, iEvent, mps_update::status, DcsStatus::TECm, DcsStatus::TECp, DcsStatus::TIBTID, and DcsStatus::TOB.

◆ dumpTkDcsStatus()

void TKStatus::dumpTkDcsStatus ( std::string const &  fileName,
edm::RunNumber_t  runnum,
std::array< bool, 6 > const &  dcsTk 
)
private

Definition at line 53 of file TKStatus.cc.

53  {
54  std::ofstream outFile;
55 
56  outFile.open(fileName.c_str());
57  outFile << "BPIX " << (dcsTk[0] ? "On" : "Off") << std::endl;
58  outFile << "FPIX " << (dcsTk[1] ? "On" : "Off") << std::endl;
59  outFile << "TIBTID " << (dcsTk[2] ? "On" : "Off") << std::endl;
60  outFile << "TOB " << (dcsTk[3] ? "On" : "Off") << std::endl;
61  outFile << "TECp " << (dcsTk[4] ? "On" : "Off") << std::endl;
62  outFile << "TECm " << (dcsTk[5] ? "On" : "Off") << std::endl;
63  bool AllTkOn = true;
64  for (auto status : dcsTk) {
65  if (!status) {
66  AllTkOn = false;
67  break;
68  }
69  }
70  outFile << "WholeTrackerOn " << (AllTkOn ? "Yes" : "No") << std::endl;
71  outFile << "Runnumber " << runnum << std::endl;
72 
73  outFile.close();
74 }

References MillePedeFileConverter_cfg::fileName, L1TdeCSCTF_cfi::outFile, and mps_update::status.

Member Data Documentation

◆ dcsStatus_

edm::EDGetTokenT<DcsStatusCollection> TKStatus::dcsStatus_
private

Definition at line 37 of file TKStatus.h.

◆ dcsTkFileName_

std::string TKStatus::dcsTkFileName_
private

Definition at line 36 of file TKStatus.h.

◆ lastlumi_

int TKStatus::lastlumi_ = -1
private

Definition at line 39 of file TKStatus.h.

mps_update.status
status
Definition: mps_update.py:69
TKStatus::dcsStatus_
edm::EDGetTokenT< DcsStatusCollection > dcsStatus_
Definition: TKStatus.h:37
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
MillePedeFileConverter_cfg.fileName
fileName
Definition: MillePedeFileConverter_cfg.py:32
edm::Handle
Definition: AssociativeIterator.h:50
DcsStatus::BPIX
Definition: DcsStatus.h:55
TKStatus::lastlumi_
int lastlumi_
Definition: TKStatus.h:39
TKStatus::dcsTkFileName_
std::string dcsTkFileName_
Definition: TKStatus.h:36
DcsStatus::TOB
Definition: DcsStatus.h:52
L1TdeCSCTF_cfi.outFile
outFile
Definition: L1TdeCSCTF_cfi.py:5
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition: ParameterSet.h:47
iEvent
int iEvent
Definition: GenABIO.cc:224
TKStatus::dumpTkDcsStatus
void dumpTkDcsStatus(std::string const &, edm::RunNumber_t, std::array< bool, 6 > const &)
Definition: TKStatus.cc:53
DcsStatus::TECm
Definition: DcsStatus.h:54
eostools.move
def move(src, dest)
Definition: eostools.py:511
DcsStatus::TECp
Definition: DcsStatus.h:53
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
DcsStatus::TIBTID
Definition: DcsStatus.h:51
DcsStatus::FPIX
Definition: DcsStatus.h:56
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37