CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
EcalDQMStatusReader Class Reference

#include <EcalDQMStatusReader.h>

Inheritance diagram for EcalDQMStatusReader:
edm::EDAnalyzer

Public Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c)
 
void beginRun (const edm::Run &r, const edm::EventSetup &c)
 
 EcalDQMStatusReader (const edm::ParameterSet &ps)
 
virtual ~EcalDQMStatusReader ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Private Attributes

bool verbose_
 

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 &)
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Detailed Description

Definition at line 23 of file EcalDQMStatusReader.h.

Constructor & Destructor Documentation

EcalDQMStatusReader::EcalDQMStatusReader ( const edm::ParameterSet ps)

Definition at line 32 of file EcalDQMStatusReader.cc.

References edm::ParameterSet::getUntrackedParameter(), and verbose_.

32  {
33 
34  verbose_ = ps.getUntrackedParameter<bool>("verbose", false);
35 
36 }
T getUntrackedParameter(std::string const &, T const &) const
virtual EcalDQMStatusReader::~EcalDQMStatusReader ( )
inlinevirtual

Definition at line 28 of file EcalDQMStatusReader.h.

28 {};

Member Function Documentation

void EcalDQMStatusReader::analyze ( const edm::Event e,
const edm::EventSetup c 
)
inlinevirtual

Implements edm::EDAnalyzer.

Definition at line 30 of file EcalDQMStatusReader.h.

30 {};
void EcalDQMStatusReader::beginRun ( const edm::Run r,
const edm::EventSetup c 
)
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 38 of file EcalDQMStatusReader.cc.

References gather_cfg::cout, EcalBarrel, EcalCondTowerObjectContainer< T >::end(), EcalCondObjectContainer< T >::end(), EcalCondTowerObjectContainer< T >::find(), EcalCondObjectContainer< T >::find(), edm::EventSetup::find(), edm::EventSetup::get(), EcalDQMStatusDictionary::getCodes(), EcalDQMStatusDictionary::getDictionary(), patZpeak::handle, i, errorMatrix2Lands_multiChannel::id, Numbers::indexEE(), Numbers::initGeometry(), Numbers::iSC(), ecalpyutils::ism(), Numbers::iSM(), edm::ESHandleBase::isValid(), Numbers::iTT(), edm::ESHandle< class >::product(), Numbers::sEB(), Numbers::sEE(), EBDetId::SMCRYSTALMODE, EcalTrigTowerDetId::validDetId(), EcalScDetId::validDetId(), EEDetId::validDetId(), and verbose_.

38  {
39 
41 
42  std::vector<EcalDQMStatusDictionary::codeDef> dictionary;
44 
45  const EcalDQMChannelStatus* channelStatus = 0;
46  if ( c.find( edm::eventsetup::EventSetupRecordKey::makeKey< EcalDQMChannelStatusRcd >() ) ) {
48  c.get< EcalDQMChannelStatusRcd >().get(handle);
49  if ( handle.isValid() ) channelStatus = handle.product();
50  }
51 
52  const EcalDQMTowerStatus* towerStatus = 0;
53  if ( c.find( edm::eventsetup::EventSetupRecordKey::makeKey< EcalDQMTowerStatusRcd >() ) ) {
55  c.get< EcalDQMTowerStatusRcd >().get(handle);
56  if ( handle.isValid() ) towerStatus = handle.product();
57  }
58 
59  // barrel
60  for ( int ism=1; ism<=36; ism++ ) {
61  for ( int ic=1; ic<=1700; ic++ ) {
62  int jsm = Numbers::iSM(ism, EcalBarrel);
64  if ( channelStatus ) {
65  EcalDQMChannelStatus::const_iterator it = channelStatus->find( id.rawId() );
66  if ( it != channelStatus->end() ) {
67  if ( it->getStatusCode() != 0 ) {
68  if ( verbose_ ) std::cout << "# EB:channel, ic=" << ic << " hi=" << id.hashedIndex() << " status=" << it->getStatusCode() << std::endl;
69  std::vector<EcalDQMStatusDictionary::codeDef> codes;
70  EcalDQMStatusDictionary::getCodes( codes, it->getStatusCode() );
71  for ( unsigned int i=0; i<codes.size(); i++ ) {
72  std::cout << "Crystal " << Numbers::sEB(ism) << " " << ic << " " << codes[i].desc << std::endl;
73  }
74  }
75  }
76  }
77  }
78  }
79 
80  for ( int ix=1; ix<=17; ix++ ) {
81  for ( int iy=1; iy<=72; iy++ ) {
82  if ( EcalTrigTowerDetId::validDetId(+1, EcalBarrel, ix, iy) ) {
83  EcalTrigTowerDetId id(+1, EcalBarrel, ix, iy);
84  if ( towerStatus ) {
85  EcalDQMTowerStatus::const_iterator it = towerStatus->find( id.rawId() );
86  if ( it != towerStatus->end() ) {
87  if ( it->getStatusCode() != 0 ) {
88  if ( verbose_ ) std::cout << "# EB:tower, tt=" << Numbers::iTT(id) << " hi=" << id.hashedIndex() << " status=" << it->getStatusCode() << std::endl;
89  std::vector<EcalDQMStatusDictionary::codeDef> codes;
90  EcalDQMStatusDictionary::getCodes( codes, it->getStatusCode() );
91  for ( unsigned int i=0; i<codes.size(); i++ ) {
92  std::cout << "TT " << Numbers::sEB(Numbers::iSM(id)) << " " << Numbers::iTT(id) << " " << codes[i].desc << std::endl;
93  }
94  }
95  }
96  }
97  }
98  if ( EcalTrigTowerDetId::validDetId(-1, EcalBarrel, ix, iy) ) {
99  EcalTrigTowerDetId id(-1, EcalBarrel, ix, iy);
100  if ( towerStatus ) {
101  EcalDQMTowerStatus::const_iterator it = towerStatus->find( id.rawId() );
102  if ( it != towerStatus->end() ) {
103  if ( it->getStatusCode() != 0 ) {
104  if ( verbose_ ) std::cout << "# EB:tower, tt=" << Numbers::iTT(id) << " hi=" << id.hashedIndex() << " status=" << it->getStatusCode() << std::endl;
105  std::vector<EcalDQMStatusDictionary::codeDef> codes;
106  EcalDQMStatusDictionary::getCodes( codes, it->getStatusCode() );
107  for ( unsigned int i=0; i<codes.size(); i++ ) {
108  std::cout << "TT " << Numbers::sEB(Numbers::iSM(id)) << " " << Numbers::iTT(id) << " " << codes[i].desc << std::endl;
109  }
110  }
111  }
112  }
113  }
114  }
115  }
116 
117  // endcap
118  for ( int ix=1; ix<=100; ix++ ) {
119  for ( int iy=1; iy<=100; iy++ ) {
120  if ( EEDetId::validDetId(ix, iy, +1) ) {
121  EEDetId id(ix, iy, +1);
122  if ( channelStatus ) {
123  EcalDQMChannelStatus::const_iterator it = channelStatus->find( id.rawId() );
124  if ( it != channelStatus->end() ) {
125  if ( it->getStatusCode() != 0 ) {
126  if ( verbose_ ) std::cout << "# EE:channel, " << Numbers::indexEE(Numbers::iSM(id), ix, iy) << " hi=" << id.hashedIndex() << " " << it->getStatusCode() << std::endl;
127  std::vector<EcalDQMStatusDictionary::codeDef> codes;
128  EcalDQMStatusDictionary::getCodes( codes, it->getStatusCode() );
129  for ( unsigned int i=0; i<codes.size(); i++ ) {
130  std::cout << "Crystal " << Numbers::sEE(Numbers::iSM(id)) << " " << Numbers::indexEE(Numbers::iSM(id), ix, iy) << " " << codes[i].desc << std::endl;
131  }
132  }
133  }
134  }
135  }
136  if ( EEDetId::validDetId(ix, iy, -1) ) {
137  EEDetId id(ix, iy, -1);
138  if ( channelStatus ) {
139  EcalDQMChannelStatus::const_iterator it = channelStatus->find( id.rawId() );
140  if ( it != channelStatus->end() ) {
141  if ( it->getStatusCode() != 0 ) {
142  if ( verbose_ ) std::cout << "# EE:channel, " << Numbers::indexEE(Numbers::iSM(id), ix, iy) << " hi=" << id.hashedIndex() << " " << it->getStatusCode() << std::endl;
143  std::vector<EcalDQMStatusDictionary::codeDef> codes;
144  EcalDQMStatusDictionary::getCodes( codes, it->getStatusCode() );
145  for ( unsigned int i=0; i<codes.size(); i++ ) {
146  std::cout << "Crystal " << Numbers::sEE(Numbers::iSM(id)) << " " << Numbers::indexEE(Numbers::iSM(id), ix, iy) << " " << codes[i].desc << std::endl;
147  }
148  }
149  }
150  }
151  }
152  }
153  }
154 
155  for ( int ix=1; ix<=20; ix++ ) {
156  for ( int iy=1; iy<=20; iy++ ) {
157  if ( EcalScDetId::validDetId(ix, iy, +1) ) {
158  EcalScDetId id(ix, iy, +1);
159  if ( towerStatus ) {
160  EcalDQMTowerStatus::const_iterator it = towerStatus->find( id.rawId() );
161  if ( it != towerStatus->end() ) {
162  if ( it->getStatusCode() != 0 ) {
163  if ( verbose_ ) std::cout << "# EE:tower, " << Numbers::iSC(id) << " hi=" << id.hashedIndex() << " " << it->getStatusCode() << std::endl;
164  std::vector<EcalDQMStatusDictionary::codeDef> codes;
165  EcalDQMStatusDictionary::getCodes( codes, it->getStatusCode() );
166  for ( unsigned int i=0; i<codes.size(); i++ ) {
167  std::cout << "TT " << Numbers::sEE(Numbers::iSM(id)) << " " << Numbers::iSC(id) << " " << codes[i].desc << std::endl;
168  }
169  }
170  }
171  }
172  }
173  if ( EcalScDetId::validDetId(ix, iy, -1) ) {
174  EcalScDetId id(ix, iy, -1);
175  if ( towerStatus ) {
176  EcalDQMTowerStatus::const_iterator it = towerStatus->find( id.rawId() );
177  if ( it != towerStatus->end() ) {
178  if ( it->getStatusCode() != 0 ) {
179  if ( verbose_ ) std::cout << "# EE:tower, " << Numbers::iSC(id) << " hi=" << id.hashedIndex() << " " << it->getStatusCode() << std::endl;
180  std::vector<EcalDQMStatusDictionary::codeDef> codes;
181  EcalDQMStatusDictionary::getCodes( codes, it->getStatusCode() );
182  for ( unsigned int i=0; i<codes.size(); i++ ) {
183  std::cout << "TT " << Numbers::sEE(Numbers::iSM(id)) << " " << Numbers::iSC(id) << " " << codes[i].desc << std::endl;
184  }
185  }
186  }
187  }
188  }
189  }
190  }
191 
192 }
static bool validDetId(int ix, int iy, int iz)
Definition: EcalScDetId.cc:63
static std::string sEE(const unsigned ism)
Definition: Numbers.cc:226
int i
Definition: DBlmapReader.cc:9
static void getCodes(std::vector< codeDef > &codeVec, uint32_t code)
static std::string sEB(const unsigned ism)
Definition: Numbers.cc:94
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
Definition: EEDetId.cc:562
const_iterator find(uint32_t rawId) const
const eventsetup::EventSetupRecord * find(const eventsetup::EventSetupRecordKey &) const
Definition: EventSetup.cc:90
static void getDictionary(std::vector< codeDef > &dict)
static unsigned iSC(const EcalScDetId &id)
Definition: Numbers.cc:437
tuple handle
Definition: patZpeak.py:22
static void initGeometry(const edm::EventSetup &setup, bool verbose=false)
Definition: Numbers.cc:50
const T & get() const
Definition: EventSetup.h:55
std::vector< Item >::const_iterator const_iterator
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
static unsigned indexEE(const unsigned ism, const unsigned ix, const unsigned iy)
Definition: Numbers.cc:712
static unsigned iSM(const unsigned ism, const EcalSubdetector subdet)
Definition: Numbers.cc:246
const_iterator find(uint32_t rawId) const
tuple cout
Definition: gather_cfg.py:121
const_iterator end() const
std::vector< Item >::const_iterator const_iterator
bool isValid() const
Definition: ESHandle.h:37
static const int SMCRYSTALMODE
Definition: EBDetId.h:146
int ism(int ieta, int iphi)
Definition: EcalPyUtils.cc:56
static unsigned iTT(const unsigned ism, const EcalSubdetector subdet, const unsigned i1, const unsigned i2)
Definition: Numbers.cc:485

Member Data Documentation

bool EcalDQMStatusReader::verbose_
private

Definition at line 36 of file EcalDQMStatusReader.h.

Referenced by beginRun(), and EcalDQMStatusReader().