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
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) 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::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
CurrentProcessingContext const * currentContext () const
 
- 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
 
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 17 of file EBDaqInfoTask.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 30 of file EBDaqInfoTask.cc.

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

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

Destructor.

Definition at line 48 of file EBDaqInfoTask.cc.

48  {
49 
50 }

Member Function Documentation

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

Analyze.

Implements edm::EDAnalyzer.

Definition at line 222 of file EBDaqInfoTask.cc.

222  {
223 
224 }
void EBDaqInfoTask::beginJob ( void  )
protectedvirtual

BeginJob.

Reimplemented from edm::EDAnalyzer.

Definition at line 52 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.

52  {
53 
55 
56  if ( dqmStore_ ) {
57 
58  dqmStore_->setCurrentFolder(prefixME_ + "/EventInfo");
59 
60  name = "DAQSummary";
62  meEBDaqFraction_->Fill(0.0);
63 
64  name = "DAQSummaryMap";
65  meEBDaqActiveMap_ = dqmStore_->book2D(name, name, 72, 0., 72., 34, 0., 34.);
66  meEBDaqActiveMap_->setAxisTitle("jphi", 1);
67  meEBDaqActiveMap_->setAxisTitle("jeta", 2);
68 
69  dqmStore_->setCurrentFolder(prefixME_ + "/EventInfo/DAQContents");
70 
71  for (int i = 0; i < 36; i++) {
72  name = "EcalBarrel_" + Numbers::sEB(i+1);
74  meEBDaqActive_[i]->Fill(0.0);
75  }
76 
77  }
78 
79 }
int i
Definition: DBlmapReader.cc:9
static std::string sEB(const unsigned ism)
Definition: Numbers.cc:94
MonitorElement * bookFloat(const char *name)
Book float.
Definition: DQMStore.cc:659
void Fill(long long x)
MonitorElement * meEBDaqActiveMap_
Definition: EBDaqInfoTask.h:70
MonitorElement * meEBDaqFraction_
Definition: EBDaqInfoTask.h:68
std::string prefixME_
Definition: EBDaqInfoTask.h:62
MonitorElement * meEBDaqActive_[36]
Definition: EBDaqInfoTask.h:69
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:850
DQMStore * dqmStore_
Definition: EBDaqInfoTask.h:60
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:434
void EBDaqInfoTask::beginLuminosityBlock ( const edm::LuminosityBlock lumiBlock,
const edm::EventSetup iSetup 
)
protectedvirtual

BeginLuminosityBlock.

Reimplemented from edm::EDAnalyzer.

Definition at line 87 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().

87  {
88 
89  // information is by run, so fill the same for the run and for every lumi section
90  for ( int iett = 0; iett < 34; iett++ ) {
91  for ( int iptt = 0; iptt < 72; iptt++ ) {
92  readyLumi[iptt][iett] = 1;
93  }
94  }
95 
96 
97  if ( !iSetup.find( edm::eventsetup::EventSetupRecordKey::makeKey<EcalDAQTowerStatusRcd>() ) ) {
98  edm::LogWarning("EBDaqInfoTask") << "EcalDAQTowerStatus record not found";
99  return;
100  }
101 
103  iSetup.get<EcalDAQTowerStatusRcd>().get(pDAQStatus);
104  if ( !pDAQStatus.isValid() ) {
105  edm::LogWarning("EBDaqInfoTask") << "EcalDAQTowerStatus record not valid";
106  return;
107  }
108  const EcalDAQTowerStatus* daqStatus = pDAQStatus.product();
109 
110  for(int iz=-1; iz<=1; iz+=2) {
111  for(int iptt=0 ; iptt<72; iptt++) {
112  for(int iett=0 ; iett<17; iett++) {
113  if (EcalTrigTowerDetId::validDetId(iz,EcalBarrel,iett+1,iptt+1 )){
114 
115  EcalTrigTowerDetId ebid(iz,EcalBarrel,iett+1,iptt+1);
116 
117  uint16_t dbStatus = 0; // 0 = good
118  EcalDAQTowerStatus::const_iterator daqStatusIt = daqStatus->find( ebid.rawId() );
119  if ( daqStatusIt != daqStatus->end() ) dbStatus = daqStatusIt->getStatusCode();
120 
121  if ( dbStatus > 0 ) {
122  int ipttEB = iptt;
123  int iettEB = (iz==-1) ? iett : 17+iett;
124  readyRun[ipttEB][iettEB] = 0;
125  readyLumi[ipttEB][iettEB] = 0;
126  }
127 
128  }
129  }
130  }
131  }
132 
133 }
int readyLumi[72][34]
Definition: EBDaqInfoTask.h:73
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:72
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
std::vector< Item >::const_iterator const_iterator
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 143 of file EBDaqInfoTask.cc.

References mergeRuns_, readyRun, and reset().

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

Cleanup.

Definition at line 174 of file EBDaqInfoTask.cc.

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

Referenced by endJob().

174  {
175 
176  if ( dqmStore_ ) {
177 
178  dqmStore_->setCurrentFolder(prefixME_ + "/EventInfo");
179 
181 
183 
184  dqmStore_->setCurrentFolder(prefixME_ + "/EventInfo/DAQContents");
185 
186  for (int i = 0; i < 36; i++) {
187  if ( meEBDaqActive_[i] ) dqmStore_->removeElement( meEBDaqActive_[i]->getName() );
188  }
189 
190  }
191 
192 }
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:2577
MonitorElement * meEBDaqActiveMap_
Definition: EBDaqInfoTask.h:70
MonitorElement * meEBDaqFraction_
Definition: EBDaqInfoTask.h:68
std::string prefixME_
Definition: EBDaqInfoTask.h:62
MonitorElement * meEBDaqActive_[36]
Definition: EBDaqInfoTask.h:69
DQMStore * dqmStore_
Definition: EBDaqInfoTask.h:60
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:434
void EBDaqInfoTask::endJob ( void  )
protectedvirtual

EndJob.

Reimplemented from edm::EDAnalyzer.

Definition at line 81 of file EBDaqInfoTask.cc.

References cleanup(), and enableCleanup_.

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

EndLuminosityBlock.

Reimplemented from edm::EDAnalyzer.

Definition at line 137 of file EBDaqInfoTask.cc.

References fillMonitorElements(), and readyLumi.

137  {
138 
140 
141 }
void fillMonitorElements(int ready[72][34])
int readyLumi[72][34]
Definition: EBDaqInfoTask.h:73
void EBDaqInfoTask::endRun ( const edm::Run r,
const edm::EventSetup c 
)
protectedvirtual

EndRun.

Reimplemented from edm::EDAnalyzer.

Definition at line 155 of file EBDaqInfoTask.cc.

References fillMonitorElements(), and readyRun.

155  {
156 
158 
159 }
void fillMonitorElements(int ready[72][34])
int readyRun[72][34]
Definition: EBDaqInfoTask.h:72
void EBDaqInfoTask::fillMonitorElements ( int  ready[72][34])
private

Definition at line 194 of file EBDaqInfoTask.cc.

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

Referenced by endLuminosityBlock(), and endRun().

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

Reset.

Definition at line 161 of file EBDaqInfoTask.cc.

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

Referenced by beginRun().

161  {
162 
164 
165  for (int i = 0; i < 36; i++) {
166  if ( meEBDaqActive_[i] ) meEBDaqActive_[i]->Reset();
167  }
168 
170 
171 }
int i
Definition: DBlmapReader.cc:9
MonitorElement * meEBDaqActiveMap_
Definition: EBDaqInfoTask.h:70
MonitorElement * meEBDaqFraction_
Definition: EBDaqInfoTask.h:68
MonitorElement * meEBDaqActive_[36]
Definition: EBDaqInfoTask.h:69
void Reset(void)
reset ME (ie. contents, errors, etc)

Member Data Documentation

DQMStore* EBDaqInfoTask::dqmStore_
private

Definition at line 60 of file EBDaqInfoTask.h.

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

bool EBDaqInfoTask::enableCleanup_
private

Definition at line 64 of file EBDaqInfoTask.h.

Referenced by EBDaqInfoTask(), and endJob().

MonitorElement* EBDaqInfoTask::meEBDaqActive_[36]
private

Definition at line 69 of file EBDaqInfoTask.h.

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

MonitorElement* EBDaqInfoTask::meEBDaqActiveMap_
private

Definition at line 70 of file EBDaqInfoTask.h.

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

MonitorElement* EBDaqInfoTask::meEBDaqFraction_
private

Definition at line 68 of file EBDaqInfoTask.h.

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

bool EBDaqInfoTask::mergeRuns_
private

Definition at line 66 of file EBDaqInfoTask.h.

Referenced by beginRun(), and EBDaqInfoTask().

std::string EBDaqInfoTask::prefixME_
private

Definition at line 62 of file EBDaqInfoTask.h.

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

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

Definition at line 73 of file EBDaqInfoTask.h.

Referenced by beginLuminosityBlock(), and endLuminosityBlock().

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

Definition at line 72 of file EBDaqInfoTask.h.

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