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
 
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)
 
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 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 27 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>(
18  ps.getUntrackedParameter<std::string>("DCSStatus", "scalersRawToDigi"));
19 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< DcsStatusCollection > dcsStatus_
Definition: TKStatus.h:40
std::string dcsTkFileName_
Definition: TKStatus.h:39
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 22 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.

23  {
24  int nthlumi = iEvent.luminosityBlock();
25  if (nthlumi > lastlumi_) { // check every LS
26  lastlumi_ = nthlumi;
27  // Checking TK status
29  iEvent.getByToken(dcsStatus_, dcsStatus);
30 
31  std::array<bool,6> dcsTk;
32  for (auto& e: dcsTk) {e=true;}
33 
34  for (auto const& status: *dcsStatus) {
35  if (!status.ready(DcsStatus::BPIX)) dcsTk[0]=false;
36  if (!status.ready(DcsStatus::FPIX)) dcsTk[1]=false;
37  if (!status.ready(DcsStatus::TIBTID)) dcsTk[2]=false;
38  if (!status.ready(DcsStatus::TOB)) dcsTk[3]=false;
39  if (!status.ready(DcsStatus::TECp)) dcsTk[4]=false;
40  if (!status.ready(DcsStatus::TECm)) dcsTk[5]=false;
41  }
42  dumpTkDcsStatus(dcsTkFileName_,iEvent.run(), dcsTk );
43  }
44 }
int iEvent
Definition: GenABIO.cc:230
edm::EDGetTokenT< DcsStatusCollection > dcsStatus_
Definition: TKStatus.h:40
std::string dcsTkFileName_
Definition: TKStatus.h:39
void dumpTkDcsStatus(std::string const &, edm::RunNumber_t, std::array< bool, 6 > const &)
Definition: TKStatus.cc:47
int lastlumi_
Definition: TKStatus.h:42
void TKStatus::dumpTkDcsStatus ( std::string const &  fileName,
edm::RunNumber_t  runnum,
std::array< bool, 6 > const &  dcsTk 
)
private

Definition at line 47 of file TKStatus.cc.

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

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

Member Data Documentation

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

Definition at line 40 of file TKStatus.h.

std::string TKStatus::dcsTkFileName_
private

Definition at line 39 of file TKStatus.h.

int TKStatus::lastlumi_ = -1
private

Definition at line 42 of file TKStatus.h.