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

#include <EBDcsInfoTask.h>

Inheritance diagram for EBDcsInfoTask:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 EBDcsInfoTask (const edm::ParameterSet &ps)
 Constructor. More...
 
virtual ~EBDcsInfoTask ()
 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_
 
MonitorElementmeEBDcsActive_ [36]
 
MonitorElementmeEBDcsActiveMap_
 
MonitorElementmeEBDcsFraction_
 
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 EBDcsInfoTask.h.

Constructor & Destructor Documentation

EBDcsInfoTask::EBDcsInfoTask ( const edm::ParameterSet ps)

Constructor.

Definition at line 27 of file EBDcsInfoTask.cc.

References dqmStore_, enableCleanup_, edm::ParameterSet::getUntrackedParameter(), i, meEBDcsActive_, meEBDcsActiveMap_, meEBDcsFraction_, mergeRuns_, cppFunctionSkipper::operator, prefixME_, and AlCaHLTBitMon_QueryRunRegistry::string.

27  {
28 
30 
31  prefixME_ = ps.getUntrackedParameter<std::string>("prefixME", "");
32 
33  enableCleanup_ = ps.getUntrackedParameter<bool>("enableCleanup", false);
34 
35  mergeRuns_ = ps.getUntrackedParameter<bool>("mergeRuns", false);
36 
37  meEBDcsFraction_ = 0;
39  for (int i = 0; i < 36; i++) {
40  meEBDcsActive_[i] = 0;
41  }
42 
43 }
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
MonitorElement * meEBDcsActive_[36]
Definition: EBDcsInfoTask.h:69
MonitorElement * meEBDcsActiveMap_
Definition: EBDcsInfoTask.h:70
DQMStore * dqmStore_
Definition: EBDcsInfoTask.h:60
MonitorElement * meEBDcsFraction_
Definition: EBDcsInfoTask.h:68
std::string prefixME_
Definition: EBDcsInfoTask.h:62
EBDcsInfoTask::~EBDcsInfoTask ( )
virtual

Destructor.

Definition at line 45 of file EBDcsInfoTask.cc.

45  {
46 
47 }

Member Function Documentation

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

Analyze.

Implements edm::EDAnalyzer.

Definition at line 217 of file EBDcsInfoTask.cc.

217  {
218 
219 }
void EBDcsInfoTask::beginJob ( void  )
protectedvirtual

BeginJob.

Reimplemented from edm::EDAnalyzer.

Definition at line 49 of file EBDcsInfoTask.cc.

References DQMStore::book2D(), DQMStore::bookFloat(), dqmStore_, MonitorElement::Fill(), i, meEBDcsActive_, meEBDcsActiveMap_, meEBDcsFraction_, mergeVDriftHistosByStation::name, prefixME_, Numbers::sEB(), MonitorElement::setAxisTitle(), DQMStore::setCurrentFolder(), and AlCaHLTBitMon_QueryRunRegistry::string.

49  {
50 
52 
53  if ( dqmStore_ ) {
54 
55  dqmStore_->setCurrentFolder(prefixME_ + "/EventInfo");
56 
57  name = "DCSSummary";
59  meEBDcsFraction_->Fill(0.0);
60 
61  name = "DCSSummaryMap";
62  meEBDcsActiveMap_ = dqmStore_->book2D(name, name, 72, 0., 72., 34, 0., 34.);
63  meEBDcsActiveMap_->setAxisTitle("jphi", 1);
64  meEBDcsActiveMap_->setAxisTitle("jeta", 2);
65 
66  dqmStore_->setCurrentFolder(prefixME_ + "/EventInfo/DCSContents");
67 
68  for (int i = 0; i < 36; i++) {
69  name = "EcalBarrel_" + Numbers::sEB(i+1);
71  meEBDcsActive_[i]->Fill(-1.0);
72  }
73 
74  }
75 
76 }
int i
Definition: DBlmapReader.cc:9
MonitorElement * meEBDcsActive_[36]
Definition: EBDcsInfoTask.h:69
MonitorElement * meEBDcsActiveMap_
Definition: EBDcsInfoTask.h:70
static std::string sEB(const unsigned ism)
Definition: Numbers.cc:94
DQMStore * dqmStore_
Definition: EBDcsInfoTask.h:60
MonitorElement * bookFloat(const char *name)
Book float.
Definition: DQMStore.cc:659
void Fill(long long x)
MonitorElement * meEBDcsFraction_
Definition: EBDcsInfoTask.h:68
std::string prefixME_
Definition: EBDcsInfoTask.h:62
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
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 EBDcsInfoTask::beginLuminosityBlock ( const edm::LuminosityBlock lumiBlock,
const edm::EventSetup iSetup 
)
protectedvirtual

BeginLuminosityBlock.

Reimplemented from edm::EDAnalyzer.

Definition at line 84 of file EBDcsInfoTask.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().

84  {
85 
86  // information is by run, so fill the same for the run and for every lumi section
87  for ( int iett = 0; iett < 34; iett++ ) {
88  for ( int iptt = 0; iptt < 72; iptt++ ) {
89  readyLumi[iptt][iett] = 1;
90  }
91  }
92 
93  if ( !iSetup.find( edm::eventsetup::EventSetupRecordKey::makeKey<EcalDCSTowerStatusRcd>() ) ) {
94  edm::LogWarning("EBDcsInfoTask") << "EcalDCSTowerStatus record not found";
95  return;
96  }
97 
99  iSetup.get<EcalDCSTowerStatusRcd>().get(pDCSStatus);
100  if ( !pDCSStatus.isValid() ) {
101  edm::LogWarning("EBDcsInfoTask") << "EcalDCSTowerStatus record not valid";
102  return;
103  }
104  const EcalDCSTowerStatus* dcsStatus = pDCSStatus.product();
105 
106  for(int iz=-1; iz<=1; iz+=2) {
107  for(int iptt=0 ; iptt<72; iptt++) {
108  for(int iett=0 ; iett<17; iett++) {
109  if (EcalTrigTowerDetId::validDetId(iz,EcalBarrel,iett+1,iptt+1 )){
110 
111  EcalTrigTowerDetId ebid(iz,EcalBarrel,iett+1,iptt+1);
112 
113  uint16_t dbStatus = 0; // 0 = good
114  EcalDCSTowerStatus::const_iterator dcsStatusIt = dcsStatus->find( ebid.rawId() );
115  if ( dcsStatusIt != dcsStatus->end() ) dbStatus = dcsStatusIt->getStatusCode();
116 
117  if ( dbStatus > 0 ) {
118  int ipttEB = iptt;
119  int iettEB = (iz==-1) ? iett : 17+iett;
120  readyRun[ipttEB][iettEB] = 0;
121  readyLumi[ipttEB][iettEB] = 0;
122  }
123 
124  }
125  }
126  }
127  }
128 
129 
130 }
int readyLumi[72][34]
Definition: EBDcsInfoTask.h:73
const_iterator find(uint32_t rawId) const
const eventsetup::EventSetupRecord * find(const eventsetup::EventSetupRecordKey &) const
Definition: EventSetup.cc:90
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
int readyRun[72][34]
Definition: EBDcsInfoTask.h:72
void EBDcsInfoTask::beginRun ( const edm::Run r,
const edm::EventSetup c 
)
protectedvirtual

BeginRun.

Reimplemented from edm::EDAnalyzer.

Definition at line 138 of file EBDcsInfoTask.cc.

References mergeRuns_, readyRun, and reset().

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

Cleanup.

Definition at line 169 of file EBDcsInfoTask.cc.

References dqmStore_, MonitorElement::getName(), i, meEBDcsActive_, meEBDcsActiveMap_, meEBDcsFraction_, prefixME_, DQMStore::removeElement(), and DQMStore::setCurrentFolder().

Referenced by endJob().

169  {
170 
171  if ( dqmStore_ ) {
172 
173  dqmStore_->setCurrentFolder(prefixME_ + "/EventInfo");
174 
176 
178 
179  dqmStore_->setCurrentFolder(prefixME_ + "/EventInfo/DCSContents");
180 
181  for (int i = 0; i < 36; i++) {
182  if ( meEBDcsActive_[i] ) dqmStore_->removeElement( meEBDcsActive_[i]->getName() );
183  }
184 
185  }
186 
187 }
const std::string & getName(void) const
get name of ME
int i
Definition: DBlmapReader.cc:9
MonitorElement * meEBDcsActive_[36]
Definition: EBDcsInfoTask.h:69
MonitorElement * meEBDcsActiveMap_
Definition: EBDcsInfoTask.h:70
DQMStore * dqmStore_
Definition: EBDcsInfoTask.h:60
void removeElement(const std::string &name)
Definition: DQMStore.cc:2577
MonitorElement * meEBDcsFraction_
Definition: EBDcsInfoTask.h:68
std::string prefixME_
Definition: EBDcsInfoTask.h:62
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:434
void EBDcsInfoTask::endJob ( void  )
protectedvirtual

EndJob.

Reimplemented from edm::EDAnalyzer.

Definition at line 78 of file EBDcsInfoTask.cc.

References cleanup(), and enableCleanup_.

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

EndLuminosityBlock.

Reimplemented from edm::EDAnalyzer.

Definition at line 132 of file EBDcsInfoTask.cc.

References fillMonitorElements(), and readyLumi.

132  {
133 
135 
136 }
int readyLumi[72][34]
Definition: EBDcsInfoTask.h:73
void fillMonitorElements(int ready[72][34])
void EBDcsInfoTask::endRun ( const edm::Run r,
const edm::EventSetup c 
)
protectedvirtual

EndRun.

Reimplemented from edm::EDAnalyzer.

Definition at line 150 of file EBDcsInfoTask.cc.

References fillMonitorElements(), and readyRun.

150  {
151 
153 
154 }
void fillMonitorElements(int ready[72][34])
int readyRun[72][34]
Definition: EBDcsInfoTask.h:72
void EBDcsInfoTask::fillMonitorElements ( int  ready[72][34])
private

Definition at line 189 of file EBDcsInfoTask.cc.

References MonitorElement::Fill(), ecalpyutils::ism(), meEBDcsActive_, meEBDcsActiveMap_, meEBDcsFraction_, and MonitorElement::setBinContent().

Referenced by endLuminosityBlock(), and endRun().

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

Reset.

Definition at line 156 of file EBDcsInfoTask.cc.

References i, meEBDcsActive_, meEBDcsActiveMap_, meEBDcsFraction_, and MonitorElement::Reset().

Referenced by beginRun().

156  {
157 
159 
160  for (int i = 0; i < 36; i++) {
161  if ( meEBDcsActive_[i] ) meEBDcsActive_[i]->Reset();
162  }
163 
165 
166 }
int i
Definition: DBlmapReader.cc:9
MonitorElement * meEBDcsActive_[36]
Definition: EBDcsInfoTask.h:69
MonitorElement * meEBDcsActiveMap_
Definition: EBDcsInfoTask.h:70
MonitorElement * meEBDcsFraction_
Definition: EBDcsInfoTask.h:68
void Reset(void)
reset ME (ie. contents, errors, etc)

Member Data Documentation

DQMStore* EBDcsInfoTask::dqmStore_
private

Definition at line 60 of file EBDcsInfoTask.h.

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

bool EBDcsInfoTask::enableCleanup_
private

Definition at line 64 of file EBDcsInfoTask.h.

Referenced by EBDcsInfoTask(), and endJob().

MonitorElement* EBDcsInfoTask::meEBDcsActive_[36]
private

Definition at line 69 of file EBDcsInfoTask.h.

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

MonitorElement* EBDcsInfoTask::meEBDcsActiveMap_
private

Definition at line 70 of file EBDcsInfoTask.h.

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

MonitorElement* EBDcsInfoTask::meEBDcsFraction_
private

Definition at line 68 of file EBDcsInfoTask.h.

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

bool EBDcsInfoTask::mergeRuns_
private

Definition at line 66 of file EBDcsInfoTask.h.

Referenced by beginRun(), and EBDcsInfoTask().

std::string EBDcsInfoTask::prefixME_
private

Definition at line 62 of file EBDcsInfoTask.h.

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

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

Definition at line 73 of file EBDcsInfoTask.h.

Referenced by beginLuminosityBlock(), and endLuminosityBlock().

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

Definition at line 72 of file EBDcsInfoTask.h.

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