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
 
- 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)
 

Protected Member Functions

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

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 ( const edm::ParameterSet ps)

Definition at line 10 of file TKStatus.cc.

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

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 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< DcsStatusCollection > dcsStatus_
Definition: TKStatus.h:37
std::string dcsTkFileName_
Definition: TKStatus.h:36
def move(src, dest)
Definition: eostools.py:511

Member Function Documentation

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

Definition at line 21 of file TKStatus.cc.

References DcsStatus::BPIX, MillePedeFileConverter_cfg::e, DcsStatus::FPIX, edm::Event::getByToken(), edm::EventBase::luminosityBlock(), edm::Event::run(), mps_update::status, DcsStatus::TECm, DcsStatus::TECp, DcsStatus::TIBTID, and DcsStatus::TOB.

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 }
int iEvent
Definition: GenABIO.cc:224
edm::EDGetTokenT< DcsStatusCollection > dcsStatus_
Definition: TKStatus.h:37
std::string dcsTkFileName_
Definition: TKStatus.h:36
void dumpTkDcsStatus(std::string const &, edm::RunNumber_t, std::array< bool, 6 > const &)
Definition: TKStatus.cc:53
int lastlumi_
Definition: TKStatus.h:39
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.

References DEFINE_FWK_MODULE, L1TdeCSCTF_cfi::outFile, and mps_update::status.

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 }

Member Data Documentation

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

Definition at line 37 of file TKStatus.h.

std::string TKStatus::dcsTkFileName_
private

Definition at line 36 of file TKStatus.h.

int TKStatus::lastlumi_ = -1
private

Definition at line 39 of file TKStatus.h.