CMS 3D CMS Logo

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

#include <SelectiveReadoutTask.h>

Inheritance diagram for ecaldqm::SelectiveReadoutTask:
ecaldqm::DQWorkerTask ecaldqm::DQWorker

Public Types

enum  Constants { nFIRTaps = 6, bytesPerCrystal = 24, nRU = EcalTrigTowerDetId::kEBTotalTowers + EcalScDetId::kSizeForDenseIndexing }
 
- Public Types inherited from ecaldqm::DQWorkerTask
typedef
EcalDCCHeaderBlock::EcalDCCEventSettings 
EventSettings
 

Public Member Functions

void addDependencies (DependencySet &) override
 
bool analyze (void const *, Collections) override
 
void beginEvent (edm::Event const &, edm::EventSetup const &, bool const &, bool &) override
 
void beginRun (edm::Run const &, edm::EventSetup const &) override
 
template<typename DigiCollection >
void runOnDigis (DigiCollection const &, Collections)
 
void runOnRawData (EcalRawDataCollection const &)
 
void runOnSource (FEDRawDataCollection const &)
 
template<typename SRFlagCollection >
void runOnSrFlags (SRFlagCollection const &, Collections)
 
 SelectiveReadoutTask ()
 
void setTokens (edm::ConsumesCollector &) override
 
 ~SelectiveReadoutTask () override
 
- Public Member Functions inherited from ecaldqm::DQWorkerTask
 DQWorkerTask ()
 
virtual void endEvent (edm::Event const &, edm::EventSetup const &)
 
virtual bool filterRunType (short const *)
 
virtual bool filterTrigger (edm::TriggerResultsByName const &)
 
 ~DQWorkerTask () override
 
- Public Member Functions inherited from ecaldqm::DQWorker
virtual void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void bookMEs (DQMStore::IBooker &)
 
 DQWorker ()
 
virtual void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void endRun (edm::Run const &, edm::EventSetup const &)
 
EcalDQMSetupObjects const getEcalDQMSetupObjects ()
 
EcalElectronicsMapping const * GetElectronicsMap ()
 
CaloGeometry const * GetGeometry ()
 
std::string const & getName () const
 
CaloTopology const * GetTopology ()
 
EcalTrigTowerConstituentsMap
const * 
GetTrigTowerMap ()
 
bool onlineMode () const
 
virtual void releaseMEs ()
 
void setEventNumber (edm::EventNumber_t _e)
 
void setLumiNumber (edm::LuminosityBlockNumber_t _l)
 
void setRunNumber (edm::RunNumber_t _r)
 
void setSetupObjects (edm::EventSetup const &)
 
void setSetupObjectsEndLumi (edm::EventSetup const &)
 
void setTime (time_t _t)
 
void setTokens (edm::ConsumesCollector &)
 
virtual ~DQWorker () noexcept(false)
 

Private Member Functions

void setFIRWeights_ (std::vector< double > const &)
 
void setParams (edm::ParameterSet const &) override
 

Private Attributes

std::vector< short > flags_
 
edm::ESGetToken
< EcalSRSettings,
EcalSRSettingsRcd
hSr
 
int iFirstSample_
 
std::set< std::pair< int, int > > suppressed_
 
bool useCondDb_
 
std::vector< int > ZSFIRWeights_
 

Additional Inherited Members

- Static Public Member Functions inherited from ecaldqm::DQWorkerTask
static void fillDescriptions (edm::ParameterSetDescription &)
 
- Static Public Member Functions inherited from ecaldqm::DQWorker
static void fillDescriptions (edm::ParameterSetDescription &_desc)
 
- Public Attributes inherited from ecaldqm::DQWorker
edm::ESGetToken
< EcalElectronicsMapping,
EcalMappingRcd
elecMapHandle
 
edm::ESGetToken
< EcalElectronicsMapping,
EcalMappingRcd
elecMapHandleEndLumi
 
edm::ESGetToken< CaloGeometry,
CaloGeometryRecord
geomHandle
 
edm::ESGetToken< CaloGeometry,
CaloGeometryRecord
geomHandleEndLumi
 
edm::ESGetToken< CaloTopology,
CaloTopologyRecord
topoHandle
 
edm::ESGetToken< CaloTopology,
CaloTopologyRecord
topoHandleEndLumi
 
edm::ESGetToken
< EcalTrigTowerConstituentsMap,
IdealGeometryRecord
ttMapHandle
 
edm::ESGetToken
< EcalTrigTowerConstituentsMap,
IdealGeometryRecord
ttMapHandleEndLumi
 
- Protected Types inherited from ecaldqm::DQWorker
typedef dqm::legacy::DQMStore DQMStore
 
typedef dqm::legacy::MonitorElement MonitorElement
 
- Protected Member Functions inherited from ecaldqm::DQWorkerTask
void setME (edm::ParameterSet const &) final
 
- Protected Member Functions inherited from ecaldqm::DQWorker
void initialize (std::string const &_name, edm::ParameterSet const &)
 
void print_ (std::string const &, int=0) const
 
virtual void setSource (edm::ParameterSet const &)
 
void setVerbosity (int _verbosity)
 
- Protected Attributes inherited from ecaldqm::DQWorker
bool booked_
 
MESetCollection MEs_
 
std::string name_
 
bool onlineMode_
 
Timestamp timestamp_
 
int verbosity_
 
bool willConvertToEDM_
 

Detailed Description

Definition at line 20 of file SelectiveReadoutTask.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

ecaldqm::SelectiveReadoutTask::SelectiveReadoutTask ( )
ecaldqm::SelectiveReadoutTask::~SelectiveReadoutTask ( )
inlineoverride

Definition at line 23 of file SelectiveReadoutTask.h.

23 {}

Member Function Documentation

void ecaldqm::SelectiveReadoutTask::addDependencies ( DependencySet _dependencies)
overridevirtual
bool ecaldqm::SelectiveReadoutTask::analyze ( void const *  _p,
Collections  _collection 
)
inlineoverridevirtual

Reimplemented from ecaldqm::DQWorkerTask.

Definition at line 60 of file SelectiveReadoutTask.h.

References ecaldqm::kEBDigi, ecaldqm::kEBSrFlag, ecaldqm::kEcalRawData, ecaldqm::kEEDigi, ecaldqm::kEESrFlag, ecaldqm::kSource, runOnDigis(), runOnRawData(), runOnSource(), and runOnSrFlags().

60  {
61  switch (_collection) {
62  case kSource:
63  if (_p)
64  runOnSource(*static_cast<FEDRawDataCollection const*>(_p));
65  return true;
66  break;
67  case kEcalRawData:
68  if (_p)
69  runOnRawData(*static_cast<EcalRawDataCollection const*>(_p));
70  return true;
71  break;
72  case kEBSrFlag:
73  if (_p)
74  runOnSrFlags(*static_cast<EBSrFlagCollection const*>(_p), _collection);
75  return true;
76  break;
77  case kEESrFlag:
78  if (_p)
79  runOnSrFlags(*static_cast<EESrFlagCollection const*>(_p), _collection);
80  return true;
81  break;
82  case kEBDigi:
83  if (_p)
84  runOnDigis(*static_cast<EBDigiCollection const*>(_p), _collection);
85  return true;
86  break;
87  case kEEDigi:
88  if (_p)
89  runOnDigis(*static_cast<EEDigiCollection const*>(_p), _collection);
90  return true;
91  break;
92  default:
93  break;
94  }
95  return false;
96  }
void runOnDigis(DigiCollection const &, Collections)
void runOnRawData(EcalRawDataCollection const &)
void runOnSrFlags(SRFlagCollection const &, Collections)
void runOnSource(FEDRawDataCollection const &)
void ecaldqm::SelectiveReadoutTask::beginEvent ( edm::Event const &  ,
edm::EventSetup const &  ,
bool const &  ,
bool &   
)
overridevirtual

Reimplemented from ecaldqm::DQWorkerTask.

Definition at line 61 of file SelectiveReadoutTask.cc.

References flags_, nRU, and suppressed_.

61  {
62  flags_.assign(nRU, -1);
63  suppressed_.clear();
64  }
std::set< std::pair< int, int > > suppressed_
void ecaldqm::SelectiveReadoutTask::beginRun ( edm::Run const &  ,
edm::EventSetup const &  _es 
)
overridevirtual

Reimplemented from ecaldqm::DQWorker.

Definition at line 44 of file SelectiveReadoutTask.cc.

References SplitLinear::begin, edm::EventSetup::getData(), hSr, setFIRWeights_(), useCondDb_, and HLT_FULL_cff::weights.

44  {
45  using namespace std;
46 
47  if (useCondDb_) {
48  auto const& vSr = &_es.getData(hSr);
49  vector<vector<float> > weights(vSr->dccNormalizedWeights_);
50  if (weights.size() == 1) {
51  vector<double> normWeights;
52  for (vector<float>::iterator it(weights[0].begin()); it != weights[0].end(); it++)
53  normWeights.push_back(*it);
54 
55  setFIRWeights_(normWeights);
56  } else
57  edm::LogWarning("EcalDQM") << "SelectiveReadoutTask: DCC weight set is not exactly 1.";
58  }
59  }
void setFIRWeights_(std::vector< double > const &)
edm::ESGetToken< EcalSRSettings, EcalSRSettingsRcd > hSr
Log< level::Warning, false > LogWarning
template<typename DigiCollection >
void ecaldqm::SelectiveReadoutTask::runOnDigis ( DigiCollection const &  _digis,
Collections  _collection 
)

Definition at line 147 of file SelectiveReadoutTask.cc.

References EcalMGPASample::adc(), ecaldqm::MESetCollection::at(), bytesPerCrystal, ecaldqm::dccId(), EcalTrigTowerDetId::detIdFromDenseIndex(), EcalBarrel, EcalEndcap, flags_, EcalMGPASample::gainId(), ecaldqm::DQWorker::getEcalDQMSetupObjects(), ecaldqm::DQWorker::GetElectronicsMap(), EcalTrigTowerDetId::hashedIndex(), EcalScDetId::hashedIndex(), gpuClustering::id, iFirstSample_, ecaldqm::kEBDigi, EcalTrigTowerDetId::kEBTotalTowers, ecaldqm::kEEmHigh, EcalScDetId::kSizeForDenseIndexing, SiStripPI::max, ecaldqm::DQWorker::MEs_, ecaldqm::nEBDCC, ecaldqm::nEEDCC, nFIRTaps, compare_using_db::sample, EEDetId::sc(), EcalDataFrame::size(), findQualityFiles::size, EcalSrFlag::SRF_FORCED_MASK, EcalSrFlag::SRF_FULL, EcalSrFlag::SRF_ZS1, EcalSrFlag::SRF_ZS2, suppressed_, EBDetId::tower(), ecaldqm::towerId(), EcalScDetId::unhashIndex(), and ZSFIRWeights_.

Referenced by analyze().

147  {
148  MESet& meHighIntOutput(MEs_.at("HighIntOutput"));
149  MESet& meLowIntOutput(MEs_.at("LowIntOutput"));
150  MESet& meHighIntPayload(MEs_.at("HighIntPayload"));
151  MESet& meLowIntPayload(MEs_.at("LowIntPayload"));
152  MESet& meTowerSize(MEs_.at("TowerSize"));
153  MESet& meZSFullReadoutMap(MEs_.at("ZSFullReadoutMap"));
154  MESet& meFRDroppedMap(MEs_.at("FRDroppedMap"));
155  MESet& meZSFullReadout(MEs_.at("ZSFullReadout"));
156  MESet& meFRDropped(MEs_.at("FRDropped"));
157 
158  bool isEB(_collection == kEBDigi);
159 
160  unsigned const nTower(isEB ? unsigned(EcalTrigTowerDetId::kEBTotalTowers)
162 
163  std::vector<unsigned> sizes(nTower, 0);
164 
165  int nHighInt[] = {0, 0};
166  int nLowInt[] = {0, 0};
167 
168  for (typename DigiCollection::const_iterator digiItr(_digis.begin()); digiItr != _digis.end(); ++digiItr) {
169  DetId const& id(digiItr->id());
170 
171  unsigned iTower(-1);
172  unsigned iRU(-1);
173 
174  if (isEB) {
175  iTower = EBDetId(id).tower().hashedIndex();
176  iRU = iTower;
177  } else {
178  iTower = EEDetId(id).sc().hashedIndex();
179  iRU = iTower + EcalTrigTowerDetId::kEBTotalTowers;
180  }
181 
182  if (flags_[iRU] < 0)
183  continue;
184 
185  sizes[iTower] += 1;
186 
187  // SR filter output calculation
188 
189  EcalDataFrame frame(*digiItr);
190 
191  int ZSFIRValue(0); // output
192 
193  bool gain12saturated(false);
194  const int gain12(0x01);
195 
196  for (int iWeight(0); iWeight < nFIRTaps; ++iWeight) {
197  int iSample(iFirstSample_ + iWeight - 1);
198 
199  if (iSample >= 0 && iSample < frame.size()) {
200  EcalMGPASample sample(frame[iSample]);
201  if (sample.gainId() != gain12) {
202  gain12saturated = true;
203  break;
204  }
205  ZSFIRValue += sample.adc() * ZSFIRWeights_[iWeight];
206  } else {
207  edm::LogWarning("EcalDQM") << "SelectiveReadoutTask: Not enough samples in data frame or "
208  "'ecalDccZs1stSample' module parameter is not valid";
209  }
210  }
211 
212  if (gain12saturated)
213  ZSFIRValue = std::numeric_limits<int>::max();
214  else
215  ZSFIRValue /= (0x1 << 8); //discards the 8 LSBs
216 
217  //ZS passed if weighted sum above ZS threshold or if
218  //one sample has a lower gain than gain 12 (that is gain 12 output
219  //is saturated)
220 
221  bool highInterest((flags_[iRU] & ~EcalSrFlag::SRF_FORCED_MASK) == EcalSrFlag::SRF_FULL);
222 
223  if (highInterest) {
224  meHighIntOutput.fill(getEcalDQMSetupObjects(), id, ZSFIRValue);
225  if (isEB || dccId(id, GetElectronicsMap()) - 1 <= kEEmHigh)
226  nHighInt[0] += 1;
227  else
228  nHighInt[1] += 1;
229  } else {
230  meLowIntOutput.fill(getEcalDQMSetupObjects(), id, ZSFIRValue);
231  if (isEB || dccId(id, GetElectronicsMap()) - 1 <= kEEmHigh)
232  nLowInt[0] += 1;
233  else
234  nLowInt[1] += 1;
235  }
236  }
237 
238  if (isEB) {
239  meHighIntPayload.fill(getEcalDQMSetupObjects(), EcalBarrel, nHighInt[0] * bytesPerCrystal / 1024. / nEBDCC);
240  meLowIntPayload.fill(getEcalDQMSetupObjects(), EcalBarrel, nLowInt[0] * bytesPerCrystal / 1024. / nEBDCC);
241  } else {
242  meHighIntPayload.fill(
243  getEcalDQMSetupObjects(), -EcalEndcap, nHighInt[0] * bytesPerCrystal / 1024. / (nEEDCC / 2));
244  meHighIntPayload.fill(getEcalDQMSetupObjects(), EcalEndcap, nHighInt[1] * bytesPerCrystal / 1024. / (nEEDCC / 2));
245  meLowIntPayload.fill(getEcalDQMSetupObjects(), -EcalEndcap, nLowInt[0] * bytesPerCrystal / 1024. / (nEEDCC / 2));
246  meLowIntPayload.fill(getEcalDQMSetupObjects(), EcalEndcap, nLowInt[1] * bytesPerCrystal / 1024. / (nEEDCC / 2));
247  }
248 
249  unsigned iRU(isEB ? 0 : EcalTrigTowerDetId::kEBTotalTowers);
250  for (unsigned iTower(0); iTower < nTower; ++iTower, ++iRU) {
251  DetId id;
252  if (isEB)
254  else
255  id = EcalScDetId::unhashIndex(iTower);
256 
257  double towerSize(sizes[iTower] * bytesPerCrystal);
258 
259  meTowerSize.fill(getEcalDQMSetupObjects(), id, towerSize);
260 
261  if (flags_[iRU] < 0)
262  continue;
263 
264  int dccid(dccId(id, GetElectronicsMap()));
265  int towerid(towerId(id, GetElectronicsMap()));
266 
267  if (suppressed_.find(std::make_pair(dccid, towerid)) != suppressed_.end())
268  continue;
269 
270  int flag(flags_[iRU] & ~EcalSrFlag::SRF_FORCED_MASK);
271 
272  bool ruFullyReadout(sizes[iTower] == GetElectronicsMap()->dccTowerConstituents(dccid, towerid).size());
273 
274  if (ruFullyReadout && (flag == EcalSrFlag::SRF_ZS1 || flag == EcalSrFlag::SRF_ZS2)) {
275  meZSFullReadoutMap.fill(getEcalDQMSetupObjects(), id);
276  meZSFullReadout.fill(getEcalDQMSetupObjects(), id);
277  }
278 
279  if (sizes[iTower] == 0 && flag == EcalSrFlag::SRF_FULL) {
280  meFRDroppedMap.fill(getEcalDQMSetupObjects(), id);
281  meFRDropped.fill(getEcalDQMSetupObjects(), id);
282  }
283  }
284  }
static EcalTrigTowerDetId detIdFromDenseIndex(uint32_t di)
uint16_t *__restrict__ id
MESet & at(const std::string &key)
Definition: MESet.h:399
static const int SRF_ZS2
Definition: EcalSrFlag.h:21
static const int SRF_FORCED_MASK
Definition: EcalSrFlag.h:29
int hashedIndex() const
get a compact index for arrays [TODO: NEEDS WORK]
static EcalScDetId unhashIndex(int hi)
Definition: EcalScDetId.h:117
unsigned towerId(DetId const &, EcalElectronicsMapping const *)
static const int SRF_FULL
Definition: EcalSrFlag.h:24
unsigned dccId(DetId const &, EcalElectronicsMapping const *)
EcalTrigTowerDetId tower() const
get the HCAL/trigger iphi of this crystal
Definition: EBDetId.h:57
int hashedIndex() const
Definition: EcalScDetId.h:106
static const int SRF_ZS1
Definition: EcalSrFlag.h:18
EcalDQMSetupObjects const getEcalDQMSetupObjects()
Definition: DQWorker.cc:142
Definition: DetId.h:17
MESetCollection MEs_
Definition: DQWorker.h:125
EcalScDetId sc() const
Definition: EEDetId.h:89
EcalElectronicsMapping const * GetElectronicsMap()
Definition: DQWorker.cc:118
Log< level::Warning, false > LogWarning
tuple size
Write out results.
std::set< std::pair< int, int > > suppressed_
void ecaldqm::SelectiveReadoutTask::runOnRawData ( EcalRawDataCollection const &  _dcchs)

Definition at line 91 of file SelectiveReadoutTask.cc.

References edm::SortedCollection< T, SORT >::begin(), ecaldqm::Disabled, edm::SortedCollection< T, SORT >::end(), and suppressed_.

Referenced by analyze().

91  {
92  for (EcalRawDataCollection::const_iterator dcchItr(_dcchs.begin()); dcchItr != _dcchs.end(); ++dcchItr) {
93  std::vector<short> const& feStatus(dcchItr->getFEStatus());
94  unsigned nFE(feStatus.size());
95  for (unsigned iFE(0); iFE < nFE; ++iFE)
96  if (feStatus[iFE] == Disabled)
97  suppressed_.insert(std::make_pair(dcchItr->id(), iFE + 1));
98  }
99  }
std::vector< T >::const_iterator const_iterator
std::set< std::pair< int, int > > suppressed_
void ecaldqm::SelectiveReadoutTask::runOnSource ( FEDRawDataCollection const &  _fedRaw)

Definition at line 66 of file SelectiveReadoutTask.cc.

References ecaldqm::MESetCollection::at(), EcalBarrel, EcalEndcap, FEDRawDataCollection::FEDData(), ecaldqm::DQWorker::getEcalDQMSetupObjects(), ecaldqm::kEEmHigh, ecaldqm::kEEpLow, ecaldqm::DQWorker::MEs_, FEDRawData::size(), and findQualityFiles::size.

Referenced by analyze().

66  {
67  MESet& meDCCSize(MEs_.at("DCCSize"));
68  MESet& meDCCSizeProf(MEs_.at("DCCSizeProf"));
69  MESet& meEventSize(MEs_.at("EventSize"));
70 
71  float ebSize(0.), eemSize(0.), eepSize(0.);
72 
73  // DCC event size
74  for (int iFED(601); iFED <= 654; iFED++) {
75  float size(_fedRaw.FEDData(iFED).size() / 1024.);
76  meDCCSize.fill(getEcalDQMSetupObjects(), iFED - 600, size);
77  meDCCSizeProf.fill(getEcalDQMSetupObjects(), iFED - 600, size);
78  if (iFED - 601 <= kEEmHigh)
79  eemSize += size;
80  else if (iFED - 601 >= kEEpLow)
81  eepSize += size;
82  else
83  ebSize += size;
84  }
85 
86  meEventSize.fill(getEcalDQMSetupObjects(), -EcalEndcap, eemSize / 9.);
87  meEventSize.fill(getEcalDQMSetupObjects(), EcalEndcap, eepSize / 9.);
88  meEventSize.fill(getEcalDQMSetupObjects(), EcalBarrel, ebSize / 36.);
89  }
MESet & at(const std::string &key)
Definition: MESet.h:399
EcalDQMSetupObjects const getEcalDQMSetupObjects()
Definition: DQWorker.cc:142
MESetCollection MEs_
Definition: DQWorker.h:125
tuple size
Write out results.
template<typename SRFlagCollection >
void ecaldqm::SelectiveReadoutTask::runOnSrFlags ( SRFlagCollection const &  _srfs,
Collections  _col 
)

Definition at line 102 of file SelectiveReadoutTask.cc.

References ecaldqm::MESetCollection::at(), EcalBarrel, EcalEndcap, EcalTriggerTower, ecaldqm::MESet::fill(), flags_, ecaldqm::DQWorker::getEcalDQMSetupObjects(), EcalTrigTowerDetId::hashedIndex(), EcalScDetId::hashedIndex(), gpuClustering::id, ecaldqm::kEBSrFlag, EcalTrigTowerDetId::kEBTotalTowers, ecaldqm::DQWorker::MEs_, EcalSrFlag::SRF_FORCED_MASK, EcalSrFlag::SRF_FULL, EcalSrFlag::SRF_ZS1, and EcalSrFlag::SRF_ZS2.

Referenced by analyze().

102  {
103  MESet& meFlagCounterMap(MEs_.at("FlagCounterMap"));
104  MESet& meFullReadoutMap(MEs_.at("FullReadoutMap"));
105  MESet& meZS1Map(MEs_.at("ZS1Map"));
106  MESet& meZSMap(MEs_.at("ZSMap"));
107  MESet& meRUForcedMap(MEs_.at("RUForcedMap"));
108 
109  double nFR(0.);
110 
111  std::for_each(_srfs.begin(), _srfs.end(), [&](typename SRFlagCollection::value_type const& srf) {
112  DetId const& id(srf.id());
113  int flag(srf.value());
114 
115  meFlagCounterMap.fill(getEcalDQMSetupObjects(), id);
116 
117  unsigned iRU(-1);
118  if (id.subdetId() == EcalTriggerTower)
119  iRU = EcalTrigTowerDetId(id).hashedIndex();
120  else
122  flags_[iRU] = flag;
123 
124  switch (flag & ~EcalSrFlag::SRF_FORCED_MASK) {
126  meFullReadoutMap.fill(getEcalDQMSetupObjects(), id);
127  nFR += 1.;
128  break;
129  case EcalSrFlag::SRF_ZS1:
130  meZS1Map.fill(getEcalDQMSetupObjects(), id);
131  // fallthrough
132  case EcalSrFlag::SRF_ZS2:
133  meZSMap.fill(getEcalDQMSetupObjects(), id);
134  break;
135  default:
136  break;
137  }
138 
139  if (flag & EcalSrFlag::SRF_FORCED_MASK)
140  meRUForcedMap.fill(getEcalDQMSetupObjects(), id);
141  });
142 
143  MEs_.at("FullReadout").fill(getEcalDQMSetupObjects(), _col == kEBSrFlag ? EcalBarrel : EcalEndcap, nFR);
144  }
uint16_t *__restrict__ id
MESet & at(const std::string &key)
Definition: MESet.h:399
static const int SRF_ZS2
Definition: EcalSrFlag.h:21
static const int SRF_FORCED_MASK
Definition: EcalSrFlag.h:29
int hashedIndex() const
get a compact index for arrays [TODO: NEEDS WORK]
static const int SRF_FULL
Definition: EcalSrFlag.h:24
virtual void fill(EcalDQMSetupObjects const, DetId const &, double=1., double=1., double=1.)
Definition: MESet.h:74
int hashedIndex() const
Definition: EcalScDetId.h:106
static const int SRF_ZS1
Definition: EcalSrFlag.h:18
EcalDQMSetupObjects const getEcalDQMSetupObjects()
Definition: DQWorker.cc:142
Definition: DetId.h:17
MESetCollection MEs_
Definition: DQWorker.h:125
void ecaldqm::SelectiveReadoutTask::setFIRWeights_ ( std::vector< double > const &  _normWeights)
private

Definition at line 286 of file SelectiveReadoutTask.cc.

References funct::abs(), Exception, mps_fire::i, nFIRTaps, and ZSFIRWeights_.

Referenced by beginRun(), and setParams().

286  {
287  if (_normWeights.size() < nFIRTaps)
288  throw cms::Exception("InvalidConfiguration") << "weightsForZsFIR" << std::endl;
289 
290  bool notNormalized(false), notInt(false);
291  for (std::vector<double>::const_iterator it(_normWeights.begin()); it != _normWeights.end(); ++it) {
292  if (*it > 1.)
293  notNormalized = true;
294  if (int(*it) != *it)
295  notInt = true;
296  }
297  if (notInt && notNormalized) {
298  throw cms::Exception("InvalidConfiguration") << "weigtsForZsFIR paramater values are not valid: they "
299  << "must either be integer and uses the hardware representation "
300  << "of the weights or less or equal than 1 and used the normalized "
301  << "representation.";
302  }
303 
304  ZSFIRWeights_.clear();
305  ZSFIRWeights_.resize(_normWeights.size());
306 
307  if (notNormalized) {
308  for (unsigned i(0); i < ZSFIRWeights_.size(); ++i)
309  ZSFIRWeights_[i] = int(_normWeights[i]);
310  } else {
311  const int maxWeight(0xEFF); //weights coded on 11+1 signed bits
312  for (unsigned i(0); i < ZSFIRWeights_.size(); ++i) {
313  ZSFIRWeights_[i] = lround(_normWeights[i] * (0x1 << 10));
314  if (std::abs(ZSFIRWeights_[i]) > maxWeight) //overflow
315  ZSFIRWeights_[i] = ZSFIRWeights_[i] < 0 ? -maxWeight : maxWeight;
316  }
317  }
318  }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
void ecaldqm::SelectiveReadoutTask::setParams ( edm::ParameterSet const &  _params)
overrideprivatevirtual

Reimplemented from ecaldqm::DQWorker.

Definition at line 25 of file SelectiveReadoutTask.cc.

References edm::ParameterSet::getUntrackedParameter(), iFirstSample_, setFIRWeights_(), and useCondDb_.

25  {
26  useCondDb_ = _params.getUntrackedParameter<bool>("useCondDb");
27  iFirstSample_ = _params.getUntrackedParameter<int>("DCCZS1stSample");
28 
29  if (!useCondDb_) {
30  std::vector<double> normWeights(_params.getUntrackedParameter<std::vector<double> >("ZSFIRWeights"));
31  setFIRWeights_(normWeights);
32  }
33  }
void setFIRWeights_(std::vector< double > const &)
void ecaldqm::SelectiveReadoutTask::setTokens ( edm::ConsumesCollector _collector)
overridevirtual

Reimplemented from ecaldqm::DQWorkerTask.

Definition at line 35 of file SelectiveReadoutTask.cc.

References edm::BeginRun, edm::ConsumesCollector::esConsumes(), and hSr.

35  {
37  }
edm::ESGetToken< EcalSRSettings, EcalSRSettingsRcd > hSr

Member Data Documentation

std::vector<short> ecaldqm::SelectiveReadoutTask::flags_
private

Definition at line 56 of file SelectiveReadoutTask.h.

Referenced by beginEvent(), runOnDigis(), and runOnSrFlags().

edm::ESGetToken<EcalSRSettings, EcalSRSettingsRcd> ecaldqm::SelectiveReadoutTask::hSr
private

Definition at line 57 of file SelectiveReadoutTask.h.

Referenced by beginRun(), and setTokens().

int ecaldqm::SelectiveReadoutTask::iFirstSample_
private

Definition at line 52 of file SelectiveReadoutTask.h.

Referenced by runOnDigis(), and setParams().

std::set<std::pair<int, int> > ecaldqm::SelectiveReadoutTask::suppressed_
private

Definition at line 55 of file SelectiveReadoutTask.h.

Referenced by beginEvent(), runOnDigis(), and runOnRawData().

bool ecaldqm::SelectiveReadoutTask::useCondDb_
private

Definition at line 51 of file SelectiveReadoutTask.h.

Referenced by beginRun(), and setParams().

std::vector<int> ecaldqm::SelectiveReadoutTask::ZSFIRWeights_
private

Definition at line 53 of file SelectiveReadoutTask.h.

Referenced by runOnDigis(), and setFIRWeights_().