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 27 of file Masks.h.

Constructor & Destructor Documentation

Masks::Masks ( )
inlineprivate

Definition at line 39 of file Masks.h.

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

Definition at line 40 of file Masks.h.

40 {}; // Hidden to force static use

Member Function Documentation

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

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

34  {
35 
36  if ( Masks::init ) return;
37 
38  if ( verbose ) std::cout << "Initializing EcalDQMChannelStatus and EcalDQMTowerStatus ..." << std::endl;
39 
40  Masks::init = true;
41 
42  if ( setup.find( edm::eventsetup::EventSetupRecordKey::makeKey<EcalDQMChannelStatusRcd>() ) ) {
44  setup.get<EcalDQMChannelStatusRcd>().get(handle);
45  if ( handle.isValid() ) Masks::channelStatus = handle.product();
46  }
47 
48  if ( setup.find( edm::eventsetup::EventSetupRecordKey::makeKey<EcalDQMTowerStatusRcd>() ) ) {
50  setup.get<EcalDQMTowerStatusRcd>().get(handle);
51  if ( handle.isValid() ) Masks::towerStatus = handle.product();
52  }
53 
54  if ( verbose ) std::cout << "done." << std::endl;
55 
56 }
static bool init
Definition: Masks.h:40
static const EcalDQMTowerStatus * towerStatus
Definition: Masks.h:45
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:44
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 60 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().

60  {
61 
62  bool mask = false;
63 
64  if ( subdet == EcalBarrel ) {
65 
66  int jsm = Numbers::iSM(ism, EcalBarrel);
67  int ic = 20*(i1-1)+(i2-1)+1;
68 
69  EBDetId id(jsm, ic, EBDetId::SMCRYSTALMODE);
70  if ( Masks::channelStatus ) {
72  if ( it != Masks::channelStatus->end() ) mask |= it->getStatusCode() & bits;
73  }
74  if ( Masks::towerStatus ) {
76  if ( it != Masks::towerStatus->end() ) mask |= it->getStatusCode() & bits;
77  }
78 
79  } else if ( subdet == EcalEndcap ) {
80 
81  int jx = i1 + Numbers::ix0EE(ism);
82  int jy = i2 + Numbers::iy0EE(ism);
83 
84  if ( ism >= 1 && ism <= 9 ) jx = 101 - jx;
85 
86  if ( Numbers::validEE(ism, jx, jy) ) {
87  EEDetId id(jx, jy, (ism>=1&&ism<=9)?-1:+1);
88  if ( Masks::channelStatus ) {
90  if ( it != Masks::channelStatus->end() ) mask |= it->getStatusCode() & bits;
91  }
92  if ( Masks::towerStatus ) {
94  if ( it != Masks::towerStatus->end() ) mask |= it->getStatusCode() & bits;
95  }
96  }
97 
98  } else {
99 
100  std::ostringstream s;
101  s << "Invalid subdetector: subdet = " << subdet;
102  throw( cms::Exception( s.str() ) );
103 
104  }
105 
106  return ( mask );
107 
108 }
static bool validEE(const unsigned ism, const unsigned ix, const unsigned iy)
Definition: Numbers.cc:832
static const EcalDQMTowerStatus * towerStatus
Definition: Masks.h:45
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:773
const_iterator find(uint32_t rawId) const
static int iy0EE(const unsigned ism)
Definition: Numbers.cc:812
#define end
Definition: vmac.h:38
std::vector< Item >::const_iterator const_iterator
static unsigned iSM(const unsigned ism, const EcalSubdetector subdet)
Definition: Numbers.cc:246
static const EcalDQMChannelStatus * channelStatus
Definition: Masks.h:44
const_iterator find(uint32_t rawId) const
std::vector< Item >::const_iterator const_iterator
static const int SMCRYSTALMODE
Definition: EBDetId.h:168
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 112 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().

112  {
113 
114  bool mask = false;
115 
116  if ( subdet == EcalBarrel ) {
117 
118  // EB-03
119  if ( ism == 3 && i1 == 1 && (bits & (1 << EcalDQMStatusHelper::LASER_MEAN_ERROR)) ) mask = true;
120  if ( ism == 3 && i1 == 1 && (bits & (1 << EcalDQMStatusHelper::TESTPULSE_HIGH_GAIN_MEAN_ERROR)) ) mask = true;
121 
122  // EB-07
123  if ( ism == 7 && i1 == 4 && (bits & (1 << EcalDQMStatusHelper::LASER_MEAN_ERROR)) ) mask = true;
124  if ( ism == 7 && i1 == 4 && (bits & (1 << EcalDQMStatusHelper::TESTPULSE_HIGH_GAIN_MEAN_ERROR)) ) mask = true;
125 
126  // EB-15
127  if ( ism == 15 && i1 == 6 && (bits & (1 << EcalDQMStatusHelper::TT_SIZE_ERROR)) ) mask = true;
128  if ( ism == 15 && i1 == 6 && (bits & (1 << EcalDQMStatusHelper::STATUS_FLAG_ERROR)) ) mask = true;
129  if ( ism == 15 && i1 == 6 && (bits & (1 << EcalDQMStatusHelper::PEDESTAL_LOW_GAIN_MEAN_ERROR)) ) mask = true;
130  if ( ism == 15 && i1 == 6 && (bits & (1 << EcalDQMStatusHelper::PEDESTAL_HIGH_GAIN_MEAN_ERROR)) ) mask = true;
131  if ( ism == 15 && i1 == 6 && (bits & (1 << EcalDQMStatusHelper::LASER_MEAN_ERROR)) ) mask = true;
132  if ( ism == 15 && i1 == 7 && (bits & (1 << EcalDQMStatusHelper::TT_SIZE_ERROR)) ) mask = true;
133  if ( ism == 15 && i1 == 7 && (bits & (1 << EcalDQMStatusHelper::STATUS_FLAG_ERROR)) ) mask = true;
134  if ( ism == 15 && i1 == 7 && (bits & (1 << EcalDQMStatusHelper::PEDESTAL_LOW_GAIN_MEAN_ERROR)) ) mask = true;
135  if ( ism == 15 && i1 == 7 && (bits & (1 << EcalDQMStatusHelper::PEDESTAL_HIGH_GAIN_MEAN_ERROR)) ) mask = true;
136  if ( ism == 15 && i1 == 7 && (bits & (1 << EcalDQMStatusHelper::LASER_MEAN_ERROR)) ) mask = true;
137  if ( ism == 15 && i1 == 8 && (bits & (1 << EcalDQMStatusHelper::TT_SIZE_ERROR)) ) mask = true;
138  if ( ism == 15 && i1 == 8 && (bits & (1 << EcalDQMStatusHelper::STATUS_FLAG_ERROR)) ) mask = true;
139  if ( ism == 15 && i1 == 8 && (bits & (1 << EcalDQMStatusHelper::PEDESTAL_LOW_GAIN_MEAN_ERROR)) ) mask = true;
140  if ( ism == 15 && i1 == 8 && (bits & (1 << EcalDQMStatusHelper::PEDESTAL_HIGH_GAIN_MEAN_ERROR)) ) mask = true;
141  if ( ism == 15 && i1 == 8 && (bits & (1 << EcalDQMStatusHelper::LASER_MEAN_ERROR)) ) mask = true;
142  if ( ism == 15 && i1 == 9 && (bits & (1 << EcalDQMStatusHelper::TT_SIZE_ERROR)) ) mask = true;
143  if ( ism == 15 && i1 == 9 && (bits & (1 << EcalDQMStatusHelper::STATUS_FLAG_ERROR)) ) mask = true;
144  if ( ism == 15 && i1 == 9 && (bits & (1 << EcalDQMStatusHelper::PEDESTAL_LOW_GAIN_MEAN_ERROR)) ) mask = true;
145  if ( ism == 15 && i1 == 9 && (bits & (1 << EcalDQMStatusHelper::PEDESTAL_HIGH_GAIN_MEAN_ERROR)) ) mask = true;
146  if ( ism == 15 && i1 == 9 && (bits & (1 << EcalDQMStatusHelper::LASER_MEAN_ERROR)) ) mask = true;
147  if ( ism == 15 && i1 == 10 && (bits & (1 << EcalDQMStatusHelper::TT_SIZE_ERROR)) ) mask = true;
148  if ( ism == 15 && i1 == 10 && (bits & (1 << EcalDQMStatusHelper::STATUS_FLAG_ERROR)) ) mask = true;
149  if ( ism == 15 && i1 == 10 && (bits & (1 << EcalDQMStatusHelper::PEDESTAL_LOW_GAIN_MEAN_ERROR)) ) mask = true;
150  if ( ism == 15 && i1 == 10 && (bits & (1 << EcalDQMStatusHelper::PEDESTAL_HIGH_GAIN_MEAN_ERROR)) ) mask = true;
151  if ( ism == 15 && i1 == 10 && (bits & (1 << EcalDQMStatusHelper::LASER_MEAN_ERROR)) ) mask = true;
152 
153  // EB+06
154  if ( ism == 24 && (bits & (1 << EcalDQMStatusHelper::TESTPULSE_HIGH_GAIN_MEAN_ERROR)) ) mask = true;
155 
156  // EB+07
157  if ( ism == 25 && i1 == 4 && (bits & (1 << EcalDQMStatusHelper::LASER_MEAN_ERROR)) ) mask = true;
158  if ( ism == 25 && i1 == 4 && (bits & (1 << EcalDQMStatusHelper::TESTPULSE_HIGH_GAIN_MEAN_ERROR)) ) mask = true;
159 
160  // EB+12
161  if ( ism == 30 && i1 == 9 && (bits & (1 << EcalDQMStatusHelper::LASER_MEAN_ERROR)) ) mask = true;
162  if ( ism == 30 && i1 == 9 && (bits & (1 << EcalDQMStatusHelper::TESTPULSE_HIGH_GAIN_MEAN_ERROR)) ) mask = true;
163 
164  // EB+15
165  if ( ism == 15 && i1 == 3 && (bits & (1 << EcalDQMStatusHelper::TESTPULSE_HIGH_GAIN_MEAN_ERROR)) ) mask = true;
166  if ( ism == 15 && i1 == 4 && (bits & (1 << EcalDQMStatusHelper::TESTPULSE_HIGH_GAIN_MEAN_ERROR)) ) mask = true;
167  if ( ism == 15 && i1 == 5 && (bits & (1 << EcalDQMStatusHelper::TESTPULSE_HIGH_GAIN_MEAN_ERROR)) ) mask = true;
168 
169  } else if ( subdet == EcalEndcap ) {
170 
171  // EE-02
172  if ( ism == 5 && i1 == 3 && (bits & (1 << EcalDQMStatusHelper::LASER_MEAN_ERROR)) ) mask = true;
173  if ( ism == 5 && i1 == 3 && (bits & (1 << EcalDQMStatusHelper::LED_MEAN_ERROR)) ) mask = true;
174  if ( ism == 5 && i1 == 10 && (bits & (1 << EcalDQMStatusHelper::LASER_MEAN_ERROR)) ) mask = true;
175  if ( ism == 5 && i1 == 10 && (bits & (1 << EcalDQMStatusHelper::LED_MEAN_ERROR)) ) mask = true;
176 
177  // EE-03
178  if ( ism == 6 && i1 == 5 && (bits & (1 << EcalDQMStatusHelper::LASER_MEAN_ERROR)) ) mask = true;
179  if ( ism == 6 && i1 == 5 && (bits & (1 << EcalDQMStatusHelper::LED_MEAN_ERROR)) ) mask = true;
180 
181  // EE-07
182  if ( ism == 1 && i1 == 4 && (bits & (1 << EcalDQMStatusHelper::LASER_MEAN_ERROR)) ) mask = true;
183  if ( ism == 1 && i1 == 4 && (bits & (1 << EcalDQMStatusHelper::LED_MEAN_ERROR)) ) mask = true;
184  if ( ism == 1 && i1 == 10 && (bits & (1 << EcalDQMStatusHelper::LASER_MEAN_ERROR)) ) mask = true;
185  if ( ism == 1 && i1 == 10 && (bits & (1 << EcalDQMStatusHelper::LED_MEAN_ERROR)) ) mask = true;
186 
187  // EE-08
188  if ( ism == 2 && i1 == 1 && (bits & (1 << EcalDQMStatusHelper::LASER_MEAN_ERROR)) ) mask = true;
189  if ( ism == 2 && i1 == 1 && (bits & (1 << EcalDQMStatusHelper::LED_MEAN_ERROR)) ) mask = true;
190  if ( ism == 2 && i1 == 4 && (bits & (1 << EcalDQMStatusHelper::LASER_MEAN_ERROR)) ) mask = true;
191  if ( ism == 2 && i1 == 4 && (bits & (1 << EcalDQMStatusHelper::LED_MEAN_ERROR)) ) mask = true;
192  if ( ism == 2 && i1 == 4 && (bits & (1 << EcalDQMStatusHelper::TESTPULSE_HIGH_GAIN_MEAN_ERROR)) ) mask = true;
193  if ( ism == 2 && i1 == 10 && (bits & (1 << EcalDQMStatusHelper::LASER_MEAN_ERROR)) ) mask = true;
194  if ( ism == 2 && i1 == 10 && (bits & (1 << EcalDQMStatusHelper::LED_MEAN_ERROR)) ) mask = true;
195 
196  } else {
197 
198  std::ostringstream s;
199  s << "Invalid subdetector: subdet = " << subdet;
200  throw( cms::Exception( s.str() ) );
201 
202  }
203 
204  return ( mask );
205 
206 }
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 44 of file Masks.h.

bool Masks::init = false
staticprivate

Definition at line 40 of file Masks.h.

Referenced by initMasking().

const EcalDQMTowerStatus * Masks::towerStatus = 0
staticprivate

Definition at line 45 of file Masks.h.