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
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_
 
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
 
- 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 EBDcsInfoTask.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 25 of file EBDcsInfoTask.cc.

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

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

Destructor.

Definition at line 43 of file EBDcsInfoTask.cc.

43  {
44 
45 }

Member Function Documentation

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

Analyze.

Implements edm::EDAnalyzer.

Definition at line 215 of file EBDcsInfoTask.cc.

215  {
216 
217 }
void EBDcsInfoTask::beginJob ( void  )
protectedvirtual

BeginJob.

Reimplemented from edm::EDAnalyzer.

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

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

BeginLuminosityBlock.

Reimplemented from edm::EDAnalyzer.

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

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

BeginRun.

Reimplemented from edm::EDAnalyzer.

Definition at line 136 of file EBDcsInfoTask.cc.

References mergeRuns_, readyRun, and reset().

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

Cleanup.

Definition at line 167 of file EBDcsInfoTask.cc.

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

Referenced by endJob().

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

EndJob.

Reimplemented from edm::EDAnalyzer.

Definition at line 76 of file EBDcsInfoTask.cc.

References cleanup(), and enableCleanup_.

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

EndLuminosityBlock.

Reimplemented from edm::EDAnalyzer.

Definition at line 130 of file EBDcsInfoTask.cc.

References fillMonitorElements(), and readyLumi.

130  {
131 
133 
134 }
int readyLumi[72][34]
Definition: EBDcsInfoTask.h:71
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 148 of file EBDcsInfoTask.cc.

References fillMonitorElements(), and readyRun.

148  {
149 
151 
152 }
void fillMonitorElements(int ready[72][34])
int readyRun[72][34]
Definition: EBDcsInfoTask.h:70
void EBDcsInfoTask::fillMonitorElements ( int  ready[72][34])
private

Definition at line 187 of file EBDcsInfoTask.cc.

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

Referenced by endLuminosityBlock(), and endRun().

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

Reset.

Definition at line 154 of file EBDcsInfoTask.cc.

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

Referenced by beginRun().

154  {
155 
157 
158  for (int i = 0; i < 36; i++) {
159  if ( meEBDcsActive_[i] ) meEBDcsActive_[i]->Reset();
160  }
161 
163 
164 }
int i
Definition: DBlmapReader.cc:9
MonitorElement * meEBDcsActive_[36]
Definition: EBDcsInfoTask.h:67
MonitorElement * meEBDcsActiveMap_
Definition: EBDcsInfoTask.h:68
MonitorElement * meEBDcsFraction_
Definition: EBDcsInfoTask.h:66
void Reset(void)
reset ME (ie. contents, errors, etc)

Member Data Documentation

DQMStore* EBDcsInfoTask::dqmStore_
private

Definition at line 58 of file EBDcsInfoTask.h.

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

bool EBDcsInfoTask::enableCleanup_
private

Definition at line 62 of file EBDcsInfoTask.h.

Referenced by EBDcsInfoTask(), and endJob().

MonitorElement* EBDcsInfoTask::meEBDcsActive_[36]
private

Definition at line 67 of file EBDcsInfoTask.h.

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

MonitorElement* EBDcsInfoTask::meEBDcsActiveMap_
private

Definition at line 68 of file EBDcsInfoTask.h.

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

MonitorElement* EBDcsInfoTask::meEBDcsFraction_
private

Definition at line 66 of file EBDcsInfoTask.h.

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

bool EBDcsInfoTask::mergeRuns_
private

Definition at line 64 of file EBDcsInfoTask.h.

Referenced by beginRun(), and EBDcsInfoTask().

std::string EBDcsInfoTask::prefixME_
private

Definition at line 60 of file EBDcsInfoTask.h.

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

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

Definition at line 71 of file EBDcsInfoTask.h.

Referenced by beginLuminosityBlock(), and endLuminosityBlock().

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

Definition at line 70 of file EBDcsInfoTask.h.

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