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 edm::EDConsumerBase

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
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 ()
 

Private Attributes

bool verbose_
 

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 &)
 
- 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)
 

Detailed Description

Definition at line 21 of file EcalDQMStatusReader.h.

Constructor & Destructor Documentation

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

Definition at line 30 of file EcalDQMStatusReader.cc.

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

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

Definition at line 26 of file EcalDQMStatusReader.h.

26 {};

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 28 of file EcalDQMStatusReader.h.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 36 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, 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_.

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

Member Data Documentation

bool EcalDQMStatusReader::verbose_
private

Definition at line 34 of file EcalDQMStatusReader.h.

Referenced by beginRun(), and EcalDQMStatusReader().