CMS 3D CMS Logo

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

#include <Masks.h>

Static Public Member Functions

static void initMasking (const edm::EventSetup &setup, bool verbose=false)
 
static bool maskChannel (int ism, int i1, int i2, uint32_t bits, const EcalSubdetector subdet) throw ( cms::Exception )
 
static bool maskPn (int ism, int i1, uint32_t bits, const EcalSubdetector subdet) throw ( cms::Exception )
 

Private Member Functions

 Masks ()
 
 ~Masks ()
 

Static Private Attributes

static const EcalDQMChannelStatuschannelStatus = 0
 
static bool init = false
 
static const EcalDQMTowerStatustowerStatus = 0
 

Detailed Description

Definition at line 25 of file Masks.h.

Constructor & Destructor Documentation

Masks::Masks ( )
inlineprivate

Definition at line 37 of file Masks.h.

37 {}; // Hidden to force static use
Masks::~Masks ( )
inlineprivate

Definition at line 38 of file Masks.h.

38 {}; // Hidden to force static use

Member Function Documentation

void Masks::initMasking ( const edm::EventSetup setup,
bool  verbose = false 
)
static

Definition at line 31 of file Masks.cc.

References gather_cfg::cout, edm::EventSetup::find(), edm::EventSetup::get(), patZpeak::handle, init, edm::ESHandleBase::isValid(), and edm::ESHandle< class >::product().

Referenced by EcalBarrelMonitorClient::beginRun(), and EcalEndcapMonitorClient::beginRun().

31  {
32 
33  if ( Masks::init ) return;
34 
35  if ( verbose ) std::cout << "Initializing EcalDQMChannelStatus and EcalDQMTowerStatus ..." << std::endl;
36 
37  Masks::init = true;
38 
39  if ( setup.find( edm::eventsetup::EventSetupRecordKey::makeKey<EcalDQMChannelStatusRcd>() ) ) {
41  setup.get<EcalDQMChannelStatusRcd>().get(handle);
42  if ( handle.isValid() ) Masks::channelStatus = handle.product();
43  }
44 
45  if ( setup.find( edm::eventsetup::EventSetupRecordKey::makeKey<EcalDQMTowerStatusRcd>() ) ) {
47  setup.get<EcalDQMTowerStatusRcd>().get(handle);
48  if ( handle.isValid() ) Masks::towerStatus = handle.product();
49  }
50 
51  if ( verbose ) std::cout << "done." << std::endl;
52 
53 }
static bool init
Definition: Masks.h:38
static const EcalDQMTowerStatus * towerStatus
Definition: Masks.h:43
const eventsetup::EventSetupRecord * find(const eventsetup::EventSetupRecordKey &) const
Definition: EventSetup.cc:90
tuple handle
Definition: patZpeak.py:22
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
static const EcalDQMChannelStatus * channelStatus
Definition: Masks.h:42
tuple cout
Definition: gather_cfg.py:121
bool isValid() const
Definition: ESHandle.h:37
bool Masks::maskChannel ( int  ism,
int  i1,
int  i2,
uint32_t  bits,
const EcalSubdetector  subdet 
)
throw (cms::Exception
)
static

Definition at line 57 of file Masks.cc.

References bits, EcalBarrel, EcalEndcap, end, EcalCondTowerObjectContainer< T >::find(), EcalCondObjectContainer< T >::find(), ecalpyutils::ism(), Numbers::iSM(), Numbers::ix0EE(), Numbers::iy0EE(), alignCSCRings::s, EBDetId::SMCRYSTALMODE, and Numbers::validEE().

Referenced by EBSummaryClient::analyze(), EESummaryClient::analyze(), EBStatusFlagsClient::analyze(), EBTimingClient::analyze(), EELaserClient::analyze(), EELedClient::analyze(), EBLaserClient::analyze(), EEStatusFlagsClient::analyze(), EBIntegrityClient::analyze(), EEIntegrityClient::analyze(), EBPedestalOnlineClient::analyze(), EEPedestalClient::analyze(), EEPedestalOnlineClient::analyze(), EBTestPulseClient::analyze(), EETestPulseClient::analyze(), EBPedestalClient::analyze(), and EETimingClient::analyze().

57  {
58 
59  bool mask = false;
60 
61  if ( subdet == EcalBarrel ) {
62 
63  int jsm = Numbers::iSM(ism, EcalBarrel);
64  int ic = 20*(i1-1)+(i2-1)+1;
65 
66  EBDetId id(jsm, ic, EBDetId::SMCRYSTALMODE);
67  if ( Masks::channelStatus ) {
69  if ( it != Masks::channelStatus->end() ) mask |= it->getStatusCode() & bits;
70  }
71  if ( Masks::towerStatus ) {
73  if ( it != Masks::towerStatus->end() ) mask |= it->getStatusCode() & bits;
74  }
75 
76  } else if ( subdet == EcalEndcap ) {
77 
78  int jx = i1 + Numbers::ix0EE(ism);
79  int jy = i2 + Numbers::iy0EE(ism);
80 
81  if ( ism >= 1 && ism <= 9 ) jx = 101 - jx;
82 
83  if ( Numbers::validEE(ism, jx, jy) ) {
84  EEDetId id(jx, jy, (ism>=1&&ism<=9)?-1:+1);
85  if ( Masks::channelStatus ) {
87  if ( it != Masks::channelStatus->end() ) mask |= it->getStatusCode() & bits;
88  }
89  if ( Masks::towerStatus ) {
91  if ( it != Masks::towerStatus->end() ) mask |= it->getStatusCode() & bits;
92  }
93  }
94 
95  } else {
96 
97  std::ostringstream s;
98  s << "Invalid subdetector: subdet = " << subdet;
99  throw( cms::Exception( s.str() ) );
100 
101  }
102 
103  return ( mask );
104 
105 }
static bool validEE(const unsigned ism, const unsigned ix, const unsigned iy)
Definition: Numbers.cc:829
static const EcalDQMTowerStatus * towerStatus
Definition: Masks.h:43
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision bits
static int ix0EE(const unsigned ism)
Definition: Numbers.cc:770
const_iterator find(uint32_t rawId) const
static int iy0EE(const unsigned ism)
Definition: Numbers.cc:809
#define end
Definition: vmac.h:37
std::vector< Item >::const_iterator const_iterator
static unsigned iSM(const unsigned ism, const EcalSubdetector subdet)
Definition: Numbers.cc:243
static const EcalDQMChannelStatus * channelStatus
Definition: Masks.h:42
const_iterator find(uint32_t rawId) const
static const int SMCRYSTALMODE
Definition: EBDetId.h:167
int ism(int ieta, int iphi)
Definition: EcalPyUtils.cc:56
bool Masks::maskPn ( int  ism,
int  i1,
uint32_t  bits,
const EcalSubdetector  subdet 
)
throw (cms::Exception
)
static

Definition at line 109 of file Masks.cc.

References bits, EcalBarrel, EcalEndcap, ecalpyutils::ism(), EcalDQMStatusHelper::LASER_MEAN_ERROR, EcalDQMStatusHelper::LED_MEAN_ERROR, EcalDQMStatusHelper::PEDESTAL_HIGH_GAIN_MEAN_ERROR, EcalDQMStatusHelper::PEDESTAL_LOW_GAIN_MEAN_ERROR, alignCSCRings::s, EcalDQMStatusHelper::STATUS_FLAG_ERROR, EcalDQMStatusHelper::TESTPULSE_HIGH_GAIN_MEAN_ERROR, and EcalDQMStatusHelper::TT_SIZE_ERROR.

Referenced by EBLaserClient::analyze(), EBStatusFlagsClient::analyze(), EELedClient::analyze(), EEStatusFlagsClient::analyze(), EELaserClient::analyze(), EBPedestalClient::analyze(), EEIntegrityClient::analyze(), EBTestPulseClient::analyze(), EETestPulseClient::analyze(), EBIntegrityClient::analyze(), and EEPedestalClient::analyze().

109  {
110 
111  bool mask = false;
112 
113  if ( subdet == EcalBarrel ) {
114 
115  // EB-03
116  if ( ism == 3 && i1 == 1 && (bits & (1 << EcalDQMStatusHelper::LASER_MEAN_ERROR)) ) mask = true;
117  if ( ism == 3 && i1 == 1 && (bits & (1 << EcalDQMStatusHelper::TESTPULSE_HIGH_GAIN_MEAN_ERROR)) ) mask = true;
118 
119  // EB-07
120  if ( ism == 7 && i1 == 4 && (bits & (1 << EcalDQMStatusHelper::LASER_MEAN_ERROR)) ) mask = true;
121  if ( ism == 7 && i1 == 4 && (bits & (1 << EcalDQMStatusHelper::TESTPULSE_HIGH_GAIN_MEAN_ERROR)) ) mask = true;
122 
123  // EB-15
124  if ( ism == 15 && i1 == 6 && (bits & (1 << EcalDQMStatusHelper::TT_SIZE_ERROR)) ) mask = true;
125  if ( ism == 15 && i1 == 6 && (bits & (1 << EcalDQMStatusHelper::STATUS_FLAG_ERROR)) ) mask = true;
126  if ( ism == 15 && i1 == 6 && (bits & (1 << EcalDQMStatusHelper::PEDESTAL_LOW_GAIN_MEAN_ERROR)) ) mask = true;
127  if ( ism == 15 && i1 == 6 && (bits & (1 << EcalDQMStatusHelper::PEDESTAL_HIGH_GAIN_MEAN_ERROR)) ) mask = true;
128  if ( ism == 15 && i1 == 6 && (bits & (1 << EcalDQMStatusHelper::LASER_MEAN_ERROR)) ) mask = true;
129  if ( ism == 15 && i1 == 7 && (bits & (1 << EcalDQMStatusHelper::TT_SIZE_ERROR)) ) mask = true;
130  if ( ism == 15 && i1 == 7 && (bits & (1 << EcalDQMStatusHelper::STATUS_FLAG_ERROR)) ) mask = true;
131  if ( ism == 15 && i1 == 7 && (bits & (1 << EcalDQMStatusHelper::PEDESTAL_LOW_GAIN_MEAN_ERROR)) ) mask = true;
132  if ( ism == 15 && i1 == 7 && (bits & (1 << EcalDQMStatusHelper::PEDESTAL_HIGH_GAIN_MEAN_ERROR)) ) mask = true;
133  if ( ism == 15 && i1 == 7 && (bits & (1 << EcalDQMStatusHelper::LASER_MEAN_ERROR)) ) mask = true;
134  if ( ism == 15 && i1 == 8 && (bits & (1 << EcalDQMStatusHelper::TT_SIZE_ERROR)) ) mask = true;
135  if ( ism == 15 && i1 == 8 && (bits & (1 << EcalDQMStatusHelper::STATUS_FLAG_ERROR)) ) mask = true;
136  if ( ism == 15 && i1 == 8 && (bits & (1 << EcalDQMStatusHelper::PEDESTAL_LOW_GAIN_MEAN_ERROR)) ) mask = true;
137  if ( ism == 15 && i1 == 8 && (bits & (1 << EcalDQMStatusHelper::PEDESTAL_HIGH_GAIN_MEAN_ERROR)) ) mask = true;
138  if ( ism == 15 && i1 == 8 && (bits & (1 << EcalDQMStatusHelper::LASER_MEAN_ERROR)) ) mask = true;
139  if ( ism == 15 && i1 == 9 && (bits & (1 << EcalDQMStatusHelper::TT_SIZE_ERROR)) ) mask = true;
140  if ( ism == 15 && i1 == 9 && (bits & (1 << EcalDQMStatusHelper::STATUS_FLAG_ERROR)) ) mask = true;
141  if ( ism == 15 && i1 == 9 && (bits & (1 << EcalDQMStatusHelper::PEDESTAL_LOW_GAIN_MEAN_ERROR)) ) mask = true;
142  if ( ism == 15 && i1 == 9 && (bits & (1 << EcalDQMStatusHelper::PEDESTAL_HIGH_GAIN_MEAN_ERROR)) ) mask = true;
143  if ( ism == 15 && i1 == 9 && (bits & (1 << EcalDQMStatusHelper::LASER_MEAN_ERROR)) ) mask = true;
144  if ( ism == 15 && i1 == 10 && (bits & (1 << EcalDQMStatusHelper::TT_SIZE_ERROR)) ) mask = true;
145  if ( ism == 15 && i1 == 10 && (bits & (1 << EcalDQMStatusHelper::STATUS_FLAG_ERROR)) ) mask = true;
146  if ( ism == 15 && i1 == 10 && (bits & (1 << EcalDQMStatusHelper::PEDESTAL_LOW_GAIN_MEAN_ERROR)) ) mask = true;
147  if ( ism == 15 && i1 == 10 && (bits & (1 << EcalDQMStatusHelper::PEDESTAL_HIGH_GAIN_MEAN_ERROR)) ) mask = true;
148  if ( ism == 15 && i1 == 10 && (bits & (1 << EcalDQMStatusHelper::LASER_MEAN_ERROR)) ) mask = true;
149 
150  // EB+06
151  if ( ism == 24 && (bits & (1 << EcalDQMStatusHelper::TESTPULSE_HIGH_GAIN_MEAN_ERROR)) ) mask = true;
152 
153  // EB+07
154  if ( ism == 25 && i1 == 4 && (bits & (1 << EcalDQMStatusHelper::LASER_MEAN_ERROR)) ) mask = true;
155  if ( ism == 25 && i1 == 4 && (bits & (1 << EcalDQMStatusHelper::TESTPULSE_HIGH_GAIN_MEAN_ERROR)) ) mask = true;
156 
157  // EB+12
158  if ( ism == 30 && i1 == 9 && (bits & (1 << EcalDQMStatusHelper::LASER_MEAN_ERROR)) ) mask = true;
159  if ( ism == 30 && i1 == 9 && (bits & (1 << EcalDQMStatusHelper::TESTPULSE_HIGH_GAIN_MEAN_ERROR)) ) mask = true;
160 
161  // EB+15
162  if ( ism == 15 && i1 == 3 && (bits & (1 << EcalDQMStatusHelper::TESTPULSE_HIGH_GAIN_MEAN_ERROR)) ) mask = true;
163  if ( ism == 15 && i1 == 4 && (bits & (1 << EcalDQMStatusHelper::TESTPULSE_HIGH_GAIN_MEAN_ERROR)) ) mask = true;
164  if ( ism == 15 && i1 == 5 && (bits & (1 << EcalDQMStatusHelper::TESTPULSE_HIGH_GAIN_MEAN_ERROR)) ) mask = true;
165 
166  } else if ( subdet == EcalEndcap ) {
167 
168  // EE-02
169  if ( ism == 5 && i1 == 3 && (bits & (1 << EcalDQMStatusHelper::LASER_MEAN_ERROR)) ) mask = true;
170  if ( ism == 5 && i1 == 3 && (bits & (1 << EcalDQMStatusHelper::LED_MEAN_ERROR)) ) mask = true;
171  if ( ism == 5 && i1 == 10 && (bits & (1 << EcalDQMStatusHelper::LASER_MEAN_ERROR)) ) mask = true;
172  if ( ism == 5 && i1 == 10 && (bits & (1 << EcalDQMStatusHelper::LED_MEAN_ERROR)) ) mask = true;
173 
174  // EE-03
175  if ( ism == 6 && i1 == 5 && (bits & (1 << EcalDQMStatusHelper::LASER_MEAN_ERROR)) ) mask = true;
176  if ( ism == 6 && i1 == 5 && (bits & (1 << EcalDQMStatusHelper::LED_MEAN_ERROR)) ) mask = true;
177 
178  // EE-07
179  if ( ism == 1 && i1 == 4 && (bits & (1 << EcalDQMStatusHelper::LASER_MEAN_ERROR)) ) mask = true;
180  if ( ism == 1 && i1 == 4 && (bits & (1 << EcalDQMStatusHelper::LED_MEAN_ERROR)) ) mask = true;
181  if ( ism == 1 && i1 == 10 && (bits & (1 << EcalDQMStatusHelper::LASER_MEAN_ERROR)) ) mask = true;
182  if ( ism == 1 && i1 == 10 && (bits & (1 << EcalDQMStatusHelper::LED_MEAN_ERROR)) ) mask = true;
183 
184  // EE-08
185  if ( ism == 2 && i1 == 1 && (bits & (1 << EcalDQMStatusHelper::LASER_MEAN_ERROR)) ) mask = true;
186  if ( ism == 2 && i1 == 1 && (bits & (1 << EcalDQMStatusHelper::LED_MEAN_ERROR)) ) mask = true;
187  if ( ism == 2 && i1 == 4 && (bits & (1 << EcalDQMStatusHelper::LASER_MEAN_ERROR)) ) mask = true;
188  if ( ism == 2 && i1 == 4 && (bits & (1 << EcalDQMStatusHelper::LED_MEAN_ERROR)) ) mask = true;
189  if ( ism == 2 && i1 == 4 && (bits & (1 << EcalDQMStatusHelper::TESTPULSE_HIGH_GAIN_MEAN_ERROR)) ) mask = true;
190  if ( ism == 2 && i1 == 10 && (bits & (1 << EcalDQMStatusHelper::LASER_MEAN_ERROR)) ) mask = true;
191  if ( ism == 2 && i1 == 10 && (bits & (1 << EcalDQMStatusHelper::LED_MEAN_ERROR)) ) mask = true;
192 
193  } else {
194 
195  std::ostringstream s;
196  s << "Invalid subdetector: subdet = " << subdet;
197  throw( cms::Exception( s.str() ) );
198 
199  }
200 
201  return ( mask );
202 
203 }
static const int LED_MEAN_ERROR
static const int LASER_MEAN_ERROR
static const int PEDESTAL_HIGH_GAIN_MEAN_ERROR
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision bits
static const int TT_SIZE_ERROR
static const int STATUS_FLAG_ERROR
static const int PEDESTAL_LOW_GAIN_MEAN_ERROR
static const int TESTPULSE_HIGH_GAIN_MEAN_ERROR
int ism(int ieta, int iphi)
Definition: EcalPyUtils.cc:56

Member Data Documentation

const EcalDQMChannelStatus * Masks::channelStatus = 0
staticprivate

Definition at line 42 of file Masks.h.

bool Masks::init = false
staticprivate

Definition at line 38 of file Masks.h.

Referenced by initMasking().

const EcalDQMTowerStatus * Masks::towerStatus = 0
staticprivate

Definition at line 43 of file Masks.h.