CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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::EDAnalyzer

Public Member Functions

 TKStatus (const edm::ParameterSet &)
 
 ~TKStatus ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Protected Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c)
 
void beginJob ()
 
void beginLuminosityBlock (const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &context)
 
void beginRun (const edm::Run &r, const edm::EventSetup &c)
 
void endJob (const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
 
void endLuminosityBlock (const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
 
void endRun (const edm::Run &r, const edm::EventSetup &c)
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Private Member Functions

void dumpTkDcsStatus (std::string &)
 

Private Attributes

int beginLumi_
 
bool checkStatus_
 
int countEvt_
 
int countLumi_
 
bool dcsTk [6]
 
std::string dcsTkFileName_
 
bool debug_
 
int endLumi_
 
std::ofstream fasciiDcsTkFile
 
edm::TimeValue_t ftimestamp
 
int lastlumi_
 
edm::ParameterSet parameters_
 
std::time_t refTime
 
int runnum
 
std::time_t tmpTime
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 

Detailed Description

Definition at line 26 of file TKStatus.h.

Constructor & Destructor Documentation

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

Definition at line 11 of file TKStatus.cc.

References countLumi_, dcsTk, dcsTkFileName_, edm::ParameterSet::getParameter(), i, lastlumi_, parameters_, and runnum.

11  :
12  checkStatus_(true) {
13  parameters_ = ps;
14  dcsTkFileName_ = parameters_.getParameter<ParameterSet>("BeamFitter").getUntrackedParameter<std::string>("DIPFileName");
15  for (int i=0;i<6;i++) dcsTk[i]=true;
16  countLumi_ = lastlumi_ = 0;
17  runnum = -1;
18 }
T getParameter(std::string const &) const
int i
Definition: DBlmapReader.cc:9
edm::ParameterSet parameters_
Definition: TKStatus.h:55
bool dcsTk[6]
Definition: TKStatus.h:66
int countLumi_
Definition: TKStatus.h:62
bool checkStatus_
Definition: TKStatus.h:60
std::string dcsTkFileName_
Definition: TKStatus.h:56
int runnum
Definition: TKStatus.h:73
int lastlumi_
Definition: TKStatus.h:65
TKStatus::~TKStatus ( )

Definition at line 20 of file TKStatus.cc.

20  {
21 
22 }

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 43 of file TKStatus.cc.

References DcsStatus::BPIX, checkStatus_, dcsTk, dcsTkFileName_, dumpTkDcsStatus(), DcsStatus::FPIX, edm::Event::getByLabel(), i, DcsStatus::TECm, DcsStatus::TECp, DcsStatus::TIBTID, and DcsStatus::TOB.

44  {
45  if (checkStatus_) { // check every LS
46  // Checking TK status
48  iEvent.getByLabel("scalersRawToDigi", dcsStatus);
49  for (int i=0;i<6;i++) dcsTk[i]=true;
50  for (DcsStatusCollection::const_iterator dcsStatusItr = dcsStatus->begin();
51  dcsStatusItr != dcsStatus->end(); ++dcsStatusItr) {
52  if (!dcsStatusItr->ready(DcsStatus::BPIX)) dcsTk[0]=false;
53  if (!dcsStatusItr->ready(DcsStatus::FPIX)) dcsTk[1]=false;
54  if (!dcsStatusItr->ready(DcsStatus::TIBTID)) dcsTk[2]=false;
55  if (!dcsStatusItr->ready(DcsStatus::TOB)) dcsTk[3]=false;
56  if (!dcsStatusItr->ready(DcsStatus::TECp)) dcsTk[4]=false;
57  if (!dcsStatusItr->ready(DcsStatus::TECm)) dcsTk[5]=false;
58  }
60  checkStatus_ = false;
61  }
62 }
int i
Definition: DBlmapReader.cc:9
void dumpTkDcsStatus(std::string &)
Definition: TKStatus.cc:84
bool dcsTk[6]
Definition: TKStatus.h:66
int iEvent
Definition: GenABIO.cc:243
bool checkStatus_
Definition: TKStatus.h:60
std::string dcsTkFileName_
Definition: TKStatus.h:56
void TKStatus::beginJob ( void  )
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 25 of file TKStatus.cc.

25  {
26 }
void TKStatus::beginLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup context 
)
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 34 of file TKStatus.cc.

References checkStatus_, lastlumi_, and edm::LuminosityBlockBase::luminosityBlock().

35  {
36  int nthlumi = lumiSeg.luminosityBlock();
37  if (nthlumi <= lastlumi_) return;
38  checkStatus_ = true;
39  lastlumi_ = nthlumi;
40 }
LuminosityBlockNumber_t luminosityBlock() const
bool checkStatus_
Definition: TKStatus.h:60
int lastlumi_
Definition: TKStatus.h:65
void TKStatus::beginRun ( const edm::Run r,
const edm::EventSetup c 
)
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 29 of file TKStatus.cc.

References edm::RunBase::run(), and runnum.

29  {
30  runnum = r.run();
31 }
RunNumber_t run() const
Definition: RunBase.h:42
int runnum
Definition: TKStatus.h:73
void TKStatus::dumpTkDcsStatus ( std::string &  fileName)
private

Definition at line 84 of file TKStatus.cc.

References dcsTk, convertXMLtoSQLite_cfg::fileName, i, getHLTprescales::index, GetRecoTauVFromDQM_MC_cff::outFile, and runnum.

Referenced by analyze().

84  {
85  std::ofstream outFile;
86  std::string tmpname = fileName;
87  char index[10];
88  sprintf(index,"%s","_TkStatus");
89  tmpname.insert(fileName.length()-4,index);
90 
91  outFile.open(tmpname.c_str());
92  outFile << "BPIX " << (dcsTk[0]?"On":"Off") << std::endl;
93  outFile << "FPIX " << (dcsTk[1]?"On":"Off") << std::endl;
94  outFile << "TIBTID " << (dcsTk[2]?"On":"Off") << std::endl;
95  outFile << "TOB " << (dcsTk[3]?"On":"Off") << std::endl;
96  outFile << "TECp " << (dcsTk[4]?"On":"Off") << std::endl;
97  outFile << "TECm " << (dcsTk[5]?"On":"Off") << std::endl;
98  bool AllTkOn = true;
99  for (int i=0; i<5; i++) {
100  if (!dcsTk[i]) {
101  AllTkOn = false;
102  break;
103  }
104  }
105  outFile << "WholeTrackerOn " << (AllTkOn?"Yes":"No") << std::endl;
106  outFile << "Runnumber " << runnum << std::endl;
107 
108  outFile.close();
109 }
int i
Definition: DBlmapReader.cc:9
bool dcsTk[6]
Definition: TKStatus.h:66
int runnum
Definition: TKStatus.h:73
void TKStatus::endJob ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup c 
)
protected

Definition at line 78 of file TKStatus.cc.

79  {
80 
81 }
void TKStatus::endLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup c 
)
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 65 of file TKStatus.cc.

References edm::LuminosityBlockBase::id(), lastlumi_, and edm::LuminosityBlockID::luminosityBlock().

66  {
67  int nlumi = lumiSeg.id().luminosityBlock();
68  if (nlumi <= lastlumi_ ) return;
69 
70 }
LuminosityBlockID id() const
LuminosityBlockNumber_t luminosityBlock() const
int lastlumi_
Definition: TKStatus.h:65
void TKStatus::endRun ( const edm::Run r,
const edm::EventSetup c 
)
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 73 of file TKStatus.cc.

73  {
74 
75 }

Member Data Documentation

int TKStatus::beginLumi_
private

Definition at line 63 of file TKStatus.h.

bool TKStatus::checkStatus_
private

Definition at line 60 of file TKStatus.h.

Referenced by analyze(), and beginLuminosityBlock().

int TKStatus::countEvt_
private

Definition at line 61 of file TKStatus.h.

int TKStatus::countLumi_
private

Definition at line 62 of file TKStatus.h.

Referenced by TKStatus().

bool TKStatus::dcsTk[6]
private

Definition at line 66 of file TKStatus.h.

Referenced by analyze(), dumpTkDcsStatus(), and TKStatus().

std::string TKStatus::dcsTkFileName_
private

Definition at line 56 of file TKStatus.h.

Referenced by analyze(), and TKStatus().

bool TKStatus::debug_
private

Definition at line 59 of file TKStatus.h.

int TKStatus::endLumi_
private

Definition at line 64 of file TKStatus.h.

std::ofstream TKStatus::fasciiDcsTkFile
private

Definition at line 57 of file TKStatus.h.

edm::TimeValue_t TKStatus::ftimestamp
private

Definition at line 72 of file TKStatus.h.

int TKStatus::lastlumi_
private

Definition at line 65 of file TKStatus.h.

Referenced by beginLuminosityBlock(), endLuminosityBlock(), and TKStatus().

edm::ParameterSet TKStatus::parameters_
private
std::time_t TKStatus::refTime
private

Definition at line 71 of file TKStatus.h.

int TKStatus::runnum
private

Definition at line 73 of file TKStatus.h.

Referenced by beginRun(), dumpTkDcsStatus(), and TKStatus().

std::time_t TKStatus::tmpTime
private

Definition at line 70 of file TKStatus.h.