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
EBDaqInfoTask Class Reference

#include <EBDaqInfoTask.h>

Inheritance diagram for EBDaqInfoTask:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 EBDaqInfoTask (const edm::ParameterSet &ps)
 Constructor. More...
 
virtual ~EBDaqInfoTask ()
 Destructor. More...
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Protected Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c)
 Analyze. More...
 
void beginJob (void)
 BeginJob. More...
 
void beginLuminosityBlock (const edm::LuminosityBlock &lumiBlock, const edm::EventSetup &iSetup)
 BeginLuminosityBlock. More...
 
void beginRun (const edm::Run &r, const edm::EventSetup &c)
 BeginRun. More...
 
void cleanup (void)
 Cleanup. More...
 
void endJob (void)
 EndJob. More...
 
void endLuminosityBlock (const edm::LuminosityBlock &lumiBlock, const edm::EventSetup &iSetup)
 EndLuminosityBlock. More...
 
void endRun (const edm::Run &r, const edm::EventSetup &c)
 EndRun. More...
 
void reset (void)
 Reset. More...
 
- 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 fillMonitorElements (int ready[72][34])
 

Private Attributes

DQMStoredqmStore_
 
bool enableCleanup_
 
MonitorElementmeEBDaqActive_ [36]
 
MonitorElementmeEBDaqActiveMap_
 
MonitorElementmeEBDaqFraction_
 
bool mergeRuns_
 
std::string prefixME_
 
int readyLumi [72][34]
 
int readyRun [72][34]
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- 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 15 of file EBDaqInfoTask.h.

Constructor & Destructor Documentation

EBDaqInfoTask::EBDaqInfoTask ( const edm::ParameterSet ps)

Constructor.

Definition at line 28 of file EBDaqInfoTask.cc.

References dqmStore_, enableCleanup_, edm::ParameterSet::getUntrackedParameter(), i, meEBDaqActive_, meEBDaqActiveMap_, meEBDaqFraction_, mergeRuns_, cppFunctionSkipper::operator, prefixME_, and AlCaHLTBitMon_QueryRunRegistry::string.

28  {
29 
31 
32  prefixME_ = ps.getUntrackedParameter<std::string>("prefixME", "");
33 
34  enableCleanup_ = ps.getUntrackedParameter<bool>("enableCleanup", false);
35 
36  mergeRuns_ = ps.getUntrackedParameter<bool>("mergeRuns", false);
37 
38  meEBDaqFraction_ = 0;
40  for (int i = 0; i < 36; i++) {
41  meEBDaqActive_[i] = 0;
42  }
43 
44 }
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
MonitorElement * meEBDaqActiveMap_
Definition: EBDaqInfoTask.h:68
MonitorElement * meEBDaqFraction_
Definition: EBDaqInfoTask.h:66
std::string prefixME_
Definition: EBDaqInfoTask.h:60
MonitorElement * meEBDaqActive_[36]
Definition: EBDaqInfoTask.h:67
DQMStore * dqmStore_
Definition: EBDaqInfoTask.h:58
EBDaqInfoTask::~EBDaqInfoTask ( )
virtual

Destructor.

Definition at line 46 of file EBDaqInfoTask.cc.

46  {
47 
48 }

Member Function Documentation

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

Analyze.

Implements edm::EDAnalyzer.

Definition at line 220 of file EBDaqInfoTask.cc.

220  {
221 
222 }
void EBDaqInfoTask::beginJob ( void  )
protectedvirtual

BeginJob.

Reimplemented from edm::EDAnalyzer.

Definition at line 50 of file EBDaqInfoTask.cc.

References DQMStore::book2D(), DQMStore::bookFloat(), dqmStore_, MonitorElement::Fill(), i, meEBDaqActive_, meEBDaqActiveMap_, meEBDaqFraction_, mergeVDriftHistosByStation::name, prefixME_, Numbers::sEB(), MonitorElement::setAxisTitle(), DQMStore::setCurrentFolder(), and AlCaHLTBitMon_QueryRunRegistry::string.

50  {
51 
53 
54  if ( dqmStore_ ) {
55 
56  dqmStore_->setCurrentFolder(prefixME_ + "/EventInfo");
57 
58  name = "DAQSummary";
60  meEBDaqFraction_->Fill(0.0);
61 
62  name = "DAQSummaryMap";
63  meEBDaqActiveMap_ = dqmStore_->book2D(name, name, 72, 0., 72., 34, 0., 34.);
64  meEBDaqActiveMap_->setAxisTitle("jphi", 1);
65  meEBDaqActiveMap_->setAxisTitle("jeta", 2);
66 
67  dqmStore_->setCurrentFolder(prefixME_ + "/EventInfo/DAQContents");
68 
69  for (int i = 0; i < 36; i++) {
70  name = "EcalBarrel_" + Numbers::sEB(i+1);
72  meEBDaqActive_[i]->Fill(0.0);
73  }
74 
75  }
76 
77 }
int i
Definition: DBlmapReader.cc:9
static std::string sEB(const unsigned ism)
Definition: Numbers.cc:91
MonitorElement * bookFloat(const char *name)
Book float.
Definition: DQMStore.cc:809
void Fill(long long x)
MonitorElement * meEBDaqActiveMap_
Definition: EBDaqInfoTask.h:68
MonitorElement * meEBDaqFraction_
Definition: EBDaqInfoTask.h:66
std::string prefixME_
Definition: EBDaqInfoTask.h:60
MonitorElement * meEBDaqActive_[36]
Definition: EBDaqInfoTask.h:67
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:1000
DQMStore * dqmStore_
Definition: EBDaqInfoTask.h:58
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:584
void EBDaqInfoTask::beginLuminosityBlock ( const edm::LuminosityBlock lumiBlock,
const edm::EventSetup iSetup 
)
protectedvirtual

BeginLuminosityBlock.

Reimplemented from edm::EDAnalyzer.

Definition at line 85 of file EBDaqInfoTask.cc.

References EcalBarrel, EcalCondTowerObjectContainer< T >::end(), EcalCondTowerObjectContainer< T >::find(), edm::EventSetup::find(), edm::EventSetup::get(), edm::ESHandleBase::isValid(), edm::ESHandle< class >::product(), DetId::rawId(), readyLumi, readyRun, and EcalTrigTowerDetId::validDetId().

85  {
86 
87  // information is by run, so fill the same for the run and for every lumi section
88  for ( int iett = 0; iett < 34; iett++ ) {
89  for ( int iptt = 0; iptt < 72; iptt++ ) {
90  readyLumi[iptt][iett] = 1;
91  }
92  }
93 
94 
95  if ( !iSetup.find( edm::eventsetup::EventSetupRecordKey::makeKey<EcalDAQTowerStatusRcd>() ) ) {
96  edm::LogWarning("EBDaqInfoTask") << "EcalDAQTowerStatus record not found";
97  return;
98  }
99 
101  iSetup.get<EcalDAQTowerStatusRcd>().get(pDAQStatus);
102  if ( !pDAQStatus.isValid() ) {
103  edm::LogWarning("EBDaqInfoTask") << "EcalDAQTowerStatus record not valid";
104  return;
105  }
106  const EcalDAQTowerStatus* daqStatus = pDAQStatus.product();
107 
108  for(int iz=-1; iz<=1; iz+=2) {
109  for(int iptt=0 ; iptt<72; iptt++) {
110  for(int iett=0 ; iett<17; iett++) {
111  if (EcalTrigTowerDetId::validDetId(iz,EcalBarrel,iett+1,iptt+1 )){
112 
113  EcalTrigTowerDetId ebid(iz,EcalBarrel,iett+1,iptt+1);
114 
115  uint16_t dbStatus = 0; // 0 = good
116  EcalDAQTowerStatus::const_iterator daqStatusIt = daqStatus->find( ebid.rawId() );
117  if ( daqStatusIt != daqStatus->end() ) dbStatus = daqStatusIt->getStatusCode();
118 
119  if ( dbStatus > 0 ) {
120  int ipttEB = iptt;
121  int iettEB = (iz==-1) ? iett : 17+iett;
122  readyRun[ipttEB][iettEB] = 0;
123  readyLumi[ipttEB][iettEB] = 0;
124  }
125 
126  }
127  }
128  }
129  }
130 
131 }
int readyLumi[72][34]
Definition: EBDaqInfoTask.h:71
const_iterator find(uint32_t rawId) const
const eventsetup::EventSetupRecord * find(const eventsetup::EventSetupRecordKey &) const
Definition: EventSetup.cc:90
int readyRun[72][34]
Definition: EBDaqInfoTask.h:70
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
static bool validDetId(int iz, EcalSubdetector sd, int i, int j)
check if a valid index combination
bool isValid() const
Definition: ESHandle.h:37
void EBDaqInfoTask::beginRun ( const edm::Run r,
const edm::EventSetup c 
)
protectedvirtual

BeginRun.

Reimplemented from edm::EDAnalyzer.

Definition at line 141 of file EBDaqInfoTask.cc.

References mergeRuns_, readyRun, and reset().

141  {
142 
143  if ( ! mergeRuns_ ) this->reset();
144 
145  for ( int iett = 0; iett < 34; iett++ ) {
146  for ( int iptt = 0; iptt < 72; iptt++ ) {
147  readyRun[iptt][iett] = 1;
148  }
149  }
150 
151 }
void reset(void)
Reset.
int readyRun[72][34]
Definition: EBDaqInfoTask.h:70
void EBDaqInfoTask::cleanup ( void  )
protected

Cleanup.

Definition at line 172 of file EBDaqInfoTask.cc.

References dqmStore_, MonitorElement::getName(), i, meEBDaqActive_, meEBDaqActiveMap_, meEBDaqFraction_, prefixME_, DQMStore::removeElement(), and DQMStore::setCurrentFolder().

Referenced by endJob().

172  {
173 
174  if ( dqmStore_ ) {
175 
176  dqmStore_->setCurrentFolder(prefixME_ + "/EventInfo");
177 
179 
181 
182  dqmStore_->setCurrentFolder(prefixME_ + "/EventInfo/DAQContents");
183 
184  for (int i = 0; i < 36; i++) {
185  if ( meEBDaqActive_[i] ) dqmStore_->removeElement( meEBDaqActive_[i]->getName() );
186  }
187 
188  }
189 
190 }
const std::string & getName(void) const
get name of ME
int i
Definition: DBlmapReader.cc:9
void removeElement(const std::string &name)
Definition: DQMStore.cc:2772
MonitorElement * meEBDaqActiveMap_
Definition: EBDaqInfoTask.h:68
MonitorElement * meEBDaqFraction_
Definition: EBDaqInfoTask.h:66
std::string prefixME_
Definition: EBDaqInfoTask.h:60
MonitorElement * meEBDaqActive_[36]
Definition: EBDaqInfoTask.h:67
DQMStore * dqmStore_
Definition: EBDaqInfoTask.h:58
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:584
void EBDaqInfoTask::endJob ( void  )
protectedvirtual

EndJob.

Reimplemented from edm::EDAnalyzer.

Definition at line 79 of file EBDaqInfoTask.cc.

References cleanup(), and enableCleanup_.

79  {
80 
81  if ( enableCleanup_ ) this->cleanup();
82 
83 }
void cleanup(void)
Cleanup.
void EBDaqInfoTask::endLuminosityBlock ( const edm::LuminosityBlock lumiBlock,
const edm::EventSetup iSetup 
)
protectedvirtual

EndLuminosityBlock.

Reimplemented from edm::EDAnalyzer.

Definition at line 135 of file EBDaqInfoTask.cc.

References fillMonitorElements(), and readyLumi.

135  {
136 
138 
139 }
void fillMonitorElements(int ready[72][34])
int readyLumi[72][34]
Definition: EBDaqInfoTask.h:71
void EBDaqInfoTask::endRun ( const edm::Run r,
const edm::EventSetup c 
)
protectedvirtual

EndRun.

Reimplemented from edm::EDAnalyzer.

Definition at line 153 of file EBDaqInfoTask.cc.

References fillMonitorElements(), and readyRun.

153  {
154 
156 
157 }
void fillMonitorElements(int ready[72][34])
int readyRun[72][34]
Definition: EBDaqInfoTask.h:70
void EBDaqInfoTask::fillMonitorElements ( int  ready[72][34])
private

Definition at line 192 of file EBDaqInfoTask.cc.

References MonitorElement::Fill(), ecalpyutils::ism(), meEBDaqActive_, meEBDaqActiveMap_, meEBDaqFraction_, and MonitorElement::setBinContent().

Referenced by endLuminosityBlock(), and endRun().

192  {
193 
194  float readySum[36];
195  for ( int ism = 0; ism < 36; ism++ ) readySum[ism] = 0;
196  float readySumTot = 0.;
197 
198  for ( int iett = 0; iett < 34; iett++ ) {
199  for ( int iptt = 0; iptt < 72; iptt++ ) {
200 
201  if(meEBDaqActiveMap_) meEBDaqActiveMap_->setBinContent( iptt+1, iett+1, ready[iptt][iett] );
202 
203  int ism = ( iett<17 ) ? iptt/4 : 18+iptt/4;
204  if(ready[iptt][iett]) {
205  readySum[ism]++;
206  readySumTot++;
207  }
208 
209  }
210  }
211 
212  for ( int ism = 0; ism < 36; ism++ ) {
213  if( meEBDaqActive_[ism] ) meEBDaqActive_[ism]->Fill( readySum[ism]/68. );
214  }
215 
216  if( meEBDaqFraction_ ) meEBDaqFraction_->Fill(readySumTot/34./72.);
217 
218 }
void setBinContent(int binx, double content)
set content of bin (1-D)
void Fill(long long x)
MonitorElement * meEBDaqActiveMap_
Definition: EBDaqInfoTask.h:68
MonitorElement * meEBDaqFraction_
Definition: EBDaqInfoTask.h:66
MonitorElement * meEBDaqActive_[36]
Definition: EBDaqInfoTask.h:67
int ism(int ieta, int iphi)
Definition: EcalPyUtils.cc:56
void EBDaqInfoTask::reset ( void  )
protected

Reset.

Definition at line 159 of file EBDaqInfoTask.cc.

References i, meEBDaqActive_, meEBDaqActiveMap_, meEBDaqFraction_, and MonitorElement::Reset().

Referenced by beginRun().

159  {
160 
162 
163  for (int i = 0; i < 36; i++) {
164  if ( meEBDaqActive_[i] ) meEBDaqActive_[i]->Reset();
165  }
166 
168 
169 }
int i
Definition: DBlmapReader.cc:9
MonitorElement * meEBDaqActiveMap_
Definition: EBDaqInfoTask.h:68
MonitorElement * meEBDaqFraction_
Definition: EBDaqInfoTask.h:66
MonitorElement * meEBDaqActive_[36]
Definition: EBDaqInfoTask.h:67
void Reset(void)
reset ME (ie. contents, errors, etc)

Member Data Documentation

DQMStore* EBDaqInfoTask::dqmStore_
private

Definition at line 58 of file EBDaqInfoTask.h.

Referenced by beginJob(), cleanup(), and EBDaqInfoTask().

bool EBDaqInfoTask::enableCleanup_
private

Definition at line 62 of file EBDaqInfoTask.h.

Referenced by EBDaqInfoTask(), and endJob().

MonitorElement* EBDaqInfoTask::meEBDaqActive_[36]
private

Definition at line 67 of file EBDaqInfoTask.h.

Referenced by beginJob(), cleanup(), EBDaqInfoTask(), fillMonitorElements(), and reset().

MonitorElement* EBDaqInfoTask::meEBDaqActiveMap_
private

Definition at line 68 of file EBDaqInfoTask.h.

Referenced by beginJob(), cleanup(), EBDaqInfoTask(), fillMonitorElements(), and reset().

MonitorElement* EBDaqInfoTask::meEBDaqFraction_
private

Definition at line 66 of file EBDaqInfoTask.h.

Referenced by beginJob(), cleanup(), EBDaqInfoTask(), fillMonitorElements(), and reset().

bool EBDaqInfoTask::mergeRuns_
private

Definition at line 64 of file EBDaqInfoTask.h.

Referenced by beginRun(), and EBDaqInfoTask().

std::string EBDaqInfoTask::prefixME_
private

Definition at line 60 of file EBDaqInfoTask.h.

Referenced by beginJob(), cleanup(), and EBDaqInfoTask().

int EBDaqInfoTask::readyLumi[72][34]
private

Definition at line 71 of file EBDaqInfoTask.h.

Referenced by beginLuminosityBlock(), and endLuminosityBlock().

int EBDaqInfoTask::readyRun[72][34]
private

Definition at line 70 of file EBDaqInfoTask.h.

Referenced by beginLuminosityBlock(), beginRun(), and endRun().