CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Static 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 }
 
enum  MESets {
  kTowerSize, kDCCSize, kEventSize, kFlagCounterMap,
  kRUForcedMap, kFullReadout, kFullReadoutMap, kZS1Map,
  kZSMap, kZSFullReadout, kZSFullReadoutMap, kFRDropped,
  kFRDroppedMap, kHighIntPayload, kLowIntPayload, kHighIntOutput,
  kLowIntOutput, nMESets
}
 
- Public Types inherited from ecaldqm::DQWorker
enum  MESets { nMESets }
 

Public Member Functions

void analyze (const void *, Collections)
 
void beginEvent (const edm::Event &, const edm::EventSetup &)
 
void beginRun (const edm::Run &, const edm::EventSetup &)
 
void runOnDigis (const EcalDigiCollection &, Collections)
 
void runOnEBSrFlags (const EBSrFlagCollection &)
 
void runOnEESrFlags (const EESrFlagCollection &)
 
void runOnRawData (const EcalRawDataCollection &)
 
void runOnSource (const FEDRawDataCollection &)
 
 SelectiveReadoutTask (const edm::ParameterSet &, const edm::ParameterSet &)
 
 ~SelectiveReadoutTask ()
 
- Public Member Functions inherited from ecaldqm::DQWorkerTask
 DQWorkerTask (const edm::ParameterSet &, const edm::ParameterSet &, std::string const &)
 
virtual void endEvent (const edm::Event &, const edm::EventSetup &)
 
virtual bool filterRunType (const std::vector< short > &)
 
virtual bool filterTrigger (const edm::TriggerResultsByName &)
 
virtual const std::vector
< std::pair< Collections,
Collections > > & 
getDependencies ()
 
virtual bool runsOn (unsigned)
 
virtual ~DQWorkerTask ()
 
- Public Member Functions inherited from ecaldqm::DQWorker
virtual void beginLuminosityBlock (const edm::LuminosityBlock &, const edm::EventSetup &)
 
virtual void bookMEs ()
 
 DQWorker (const edm::ParameterSet &, const edm::ParameterSet &, std::string const &)
 
virtual void endLuminosityBlock (const edm::LuminosityBlock &, const edm::EventSetup &)
 
virtual void endRun (const edm::Run &, const edm::EventSetup &)
 
const std::vector< MESet * > & getMEs ()
 
virtual std::string const & getName ()
 
virtual bool isInitialized ()
 
virtual void reset ()
 
virtual void setInitialized (bool _init)
 
virtual void setVerbosity (int _verbosity)
 
virtual ~DQWorker ()
 

Static Public Member Functions

static void setMEData (std::vector< MEData > &)
 
- Static Public Member Functions inherited from ecaldqm::DQWorker
static void setMEData (std::vector< MEData > &)
 

Private Member Functions

void runOnSrFlag_ (const DetId &, int, float &)
 
void setFIRWeights_ (const std::vector< double > &)
 

Private Attributes

const EcalChannelStatuschannelStatus_
 
const EBSrFlagCollectionebSRFs_
 
const EESrFlagCollectioneeSRFs_
 
std::vector< short > feStatus_ [54]
 
std::set< uint32_t > frFlaggedTowers_
 
int iFirstSample_
 
std::map< uint32_t, int > ttCrystals_
 
const
EcalTrigTowerConstituentsMap
ttMap_
 
bool useCondDb_
 
std::vector< int > ZSFIRWeights_
 
std::set< uint32_t > zsFlaggedTowers_
 

Additional Inherited Members

- Static Public Attributes inherited from ecaldqm::DQWorker
static std::map< std::string,
std::vector< MEData > > 
meData
 
- Protected Member Functions inherited from ecaldqm::DQWorker
MESetcreateMESet_ (std::string const &, MEData const &, bool _readOnly=false) const
 
void meSet_ (unsigned, edm::ParameterSet const &)
 
- Protected Attributes inherited from ecaldqm::DQWorkerTask
uint32_t collectionMask_
 
std::vector< std::pair
< Collections, Collections > > 
dependencies_
 
- Protected Attributes inherited from ecaldqm::DQWorker
bool initialized_
 
std::vector< MESet * > MEs_
 
std::string name_
 
int verbosity_
 

Detailed Description

Definition at line 16 of file SelectiveReadoutTask.h.

Member Enumeration Documentation

Enumerator
nFIRTaps 
bytesPerCrystal 

Definition at line 55 of file SelectiveReadoutTask.h.

Enumerator
kTowerSize 
kDCCSize 
kEventSize 
kFlagCounterMap 
kRUForcedMap 
kFullReadout 
kFullReadoutMap 
kZS1Map 
kZSMap 
kZSFullReadout 
kZSFullReadoutMap 
kFRDropped 
kFRDroppedMap 
kHighIntPayload 
kLowIntPayload 
kHighIntOutput 
kLowIntOutput 
nMESets 

Definition at line 32 of file SelectiveReadoutTask.h.

32  {
33  kTowerSize, // profile2d
34  kDCCSize, // h2f
35  kEventSize, // h1f
36  kFlagCounterMap, // h2f counter
37  kRUForcedMap, // h2f counter
38  kFullReadout, // h1f
39  kFullReadoutMap, // h2f counter
40  kZS1Map, // h2f counter
41  kZSMap, // h2f counter
42  kZSFullReadout, // h1f
43  kZSFullReadoutMap, // h2f counter
44  kFRDropped, // h1f
45  kFRDroppedMap, // h2f counter
46  kHighIntPayload, // h1f
47  kLowIntPayload, // h1f
48  kHighIntOutput, // h1f
49  kLowIntOutput, // h1f
50  nMESets
51  };

Constructor & Destructor Documentation

ecaldqm::SelectiveReadoutTask::SelectiveReadoutTask ( const edm::ParameterSet _params,
const edm::ParameterSet _paths 
)

Definition at line 20 of file SelectiveReadoutTask.cc.

References ecaldqm::DQWorkerTask::collectionMask_, ecaldqm::DQWorkerTask::dependencies_, edm::ParameterSet::getUntrackedParameterSet(), iFirstSample_, ecaldqm::kEBDigi, ecaldqm::kEBSrFlag, ecaldqm::kEcalRawData, ecaldqm::kEEDigi, ecaldqm::kEESrFlag, ecaldqm::kRun, ecaldqm::kSource, ecaldqm::DQWorker::name_, setFIRWeights_(), and useCondDb_.

20  :
21  DQWorkerTask(_params, _paths, "SelectiveReadoutTask"),
22  useCondDb_(false),
23  iFirstSample_(0),
24  channelStatus_(0),
25  ebSRFs_(0),
26  eeSRFs_(0),
29  {
31  (0x1 << kRun) |
32  (0x1 << kSource) |
33  (0x1 << kEcalRawData) |
34  (0x1 << kEBSrFlag) |
35  (0x1 << kEESrFlag) |
36  (0x1 << kEBDigi) |
37  (0x1 << kEEDigi);
38 
39  dependencies_.push_back(std::pair<Collections, Collections>(kEBDigi, kEcalRawData));
40  dependencies_.push_back(std::pair<Collections, Collections>(kEEDigi, kEcalRawData));
41 
42  edm::ParameterSet const& taskParams(_params.getUntrackedParameterSet(name_));
43 
44  useCondDb_ = taskParams.getUntrackedParameter<bool>("useCondDb");
45  iFirstSample_ = taskParams.getUntrackedParameter<int>("DCCZS1stSample");
46 
47  std::vector<double> normWeights(taskParams.getUntrackedParameter<std::vector<double> >("ZSFIRWeights", std::vector<double>(0)));
48  if(normWeights.size()) setFIRWeights_(normWeights);
49  }
std::vector< std::pair< Collections, Collections > > dependencies_
Definition: DQWorkerTask.h:31
const EBSrFlagCollection * ebSRFs_
DQWorkerTask(const edm::ParameterSet &, const edm::ParameterSet &, std::string const &)
Definition: DQWorkerTask.cc:5
const EcalChannelStatus * channelStatus_
const EESrFlagCollection * eeSRFs_
std::set< uint32_t > zsFlaggedTowers_
ParameterSet const & getUntrackedParameterSet(std::string const &name, ParameterSet const &defaultValue) const
std::set< uint32_t > frFlaggedTowers_
void setFIRWeights_(const std::vector< double > &)
std::string name_
Definition: DQWorker.h:55
ecaldqm::SelectiveReadoutTask::~SelectiveReadoutTask ( )

Definition at line 51 of file SelectiveReadoutTask.cc.

52  {
53  }

Member Function Documentation

void ecaldqm::SelectiveReadoutTask::analyze ( const void *  _p,
Collections  _collection 
)
inlinevirtual

Reimplemented from ecaldqm::DQWorkerTask.

Definition at line 80 of file SelectiveReadoutTask.h.

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

80  {
81  switch(_collection){
82  case kSource:
83  runOnSource(*static_cast<const FEDRawDataCollection*>(_p));
84  break;
85  case kEcalRawData:
86  runOnRawData(*static_cast<const EcalRawDataCollection*>(_p));
87  break;
88  case kEBSrFlag:
89  runOnEBSrFlags(*static_cast<const EBSrFlagCollection*>(_p));
90  break;
91  case kEESrFlag:
92  runOnEESrFlags(*static_cast<const EESrFlagCollection*>(_p));
93  break;
94  case kEBDigi:
95  case kEEDigi:
96  runOnDigis(*static_cast<const EcalDigiCollection*>(_p), _collection);
97  break;
98  default:
99  break;
100  }
101  }
void runOnDigis(const EcalDigiCollection &, Collections)
void runOnEESrFlags(const EESrFlagCollection &)
void runOnSource(const FEDRawDataCollection &)
void runOnRawData(const EcalRawDataCollection &)
void runOnEBSrFlags(const EBSrFlagCollection &)
void ecaldqm::SelectiveReadoutTask::beginEvent ( const edm::Event ,
const edm::EventSetup  
)
virtual

Reimplemented from ecaldqm::DQWorkerTask.

Definition at line 83 of file SelectiveReadoutTask.cc.

References hitfit::clear(), feStatus_, frFlaggedTowers_, and zsFlaggedTowers_.

84  {
85  for(int iDCC(0); iDCC < 54; iDCC++) feStatus_[iDCC].clear();
86  frFlaggedTowers_.clear();
87  zsFlaggedTowers_.clear();
88  }
std::set< uint32_t > zsFlaggedTowers_
void clear(CLHEP::HepGenMatrix &m)
Helper function: Reset all elements of a matrix to 0.
Definition: matutil.cc:168
std::set< uint32_t > frFlaggedTowers_
std::vector< short > feStatus_[54]
void ecaldqm::SelectiveReadoutTask::beginRun ( const edm::Run ,
const edm::EventSetup _es 
)
virtual

Reimplemented from ecaldqm::DQWorker.

Definition at line 56 of file SelectiveReadoutTask.cc.

References begin, channelStatus_, edm::hlt::Exception, edm::EventSetup::get(), setFIRWeights_(), useCondDb_, and create_public_pileup_plots::weights.

57  {
58  using namespace std;
59 
60  if(useCondDb_){
62  _es.get<EcalSRSettingsRcd>().get(hSr);
63 
64  vector<vector<float> > weights(hSr->dccNormalizedWeights_);
65  if(weights.size() == 1){
66  vector<double> normWeights;
67  for(vector<float>::iterator it(weights[0].begin()); it != weights[0].end(); it++)
68  normWeights.push_back(*it);
69 
70  setFIRWeights_(normWeights);
71  }
72  else edm::LogWarning("EcalDQM") << "SelectiveReadoutTask: DCC weight set is not exactly 1.";
73  }
74 
76  _es.get<EcalChannelStatusRcd>().get(chSHndl);
77  channelStatus_ = chSHndl.product();
78  if(!channelStatus_)
79  throw cms::Exception("EventSetup") << "EcalChannelStatusRcd";
80  }
const EcalChannelStatus * channelStatus_
void setFIRWeights_(const std::vector< double > &)
const T & get() const
Definition: EventSetup.h:55
#define begin
Definition: vmac.h:31
void ecaldqm::SelectiveReadoutTask::runOnDigis ( const EcalDigiCollection _digis,
Collections  _collection 
)

Definition at line 175 of file SelectiveReadoutTask.cc.

References EcalMGPASample::adc(), edm::DataFrameContainer::begin(), bytesPerCrystal, ecaldqm::dccId(), EcalTrigTowerDetId::detIdFromDenseIndex(), ebSRFs_, eeSRFs_, edm::SortedCollection< T, SORT >::end(), edm::DataFrameContainer::end(), edm::SortedCollection< T, SORT >::find(), frFlaggedTowers_, EcalMGPASample::gainId(), ecaldqm::getElectronicsMap(), iFirstSample_, EcalDQMBinningService::kEB, ecaldqm::kEBDigi, EcalTrigTowerDetId::kEBTotalTowers, EcalDQMBinningService::kEE, kFRDropped, kFRDroppedMap, kHighIntOutput, kHighIntPayload, kLowIntOutput, kLowIntPayload, EcalScDetId::kSizeForDenseIndexing, kTowerSize, kZSFullReadout, kZSFullReadoutMap, max(), ecaldqm::DQWorker::MEs_, nFIRTaps, DetId::rawId(), compare_using_db::sample, EcalDataFrame::size(), findQualityFiles::size, EcalSrFlag::SRF_FORCED_MASK, EcalSrFlag::SRF_FULL, ecaldqm::towerId(), EcalScDetId::unhashIndex(), ZSFIRWeights_, and zsFlaggedTowers_.

Referenced by analyze().

176  {
177  using namespace std;
178 
179  map<uint32_t, pair<int, int> > flagAndSizeMap;
180  map<uint32_t, pair<int, int> >::iterator fasItr;
181 
182  int nHighInt(0), nLowInt(0); // one or two entries will be empty
183 
184  for(EcalDigiCollection::const_iterator digiItr(_digis.begin()); digiItr != _digis.end(); ++digiItr){
185 
186  DetId id(digiItr->id());
187 
188  pair<int, int> *flagAndSize(0);
189 
190  if(_collection == kEBDigi){
191  EcalTrigTowerDetId ttid(EBDetId(id).tower());
192  uint32_t rawId(ttid.rawId());
193 
194  fasItr = flagAndSizeMap.find(rawId);
195 
196  if(fasItr == flagAndSizeMap.end()){
197  flagAndSize = &(flagAndSizeMap[rawId]);
198 
200  if(srItr != ebSRFs_->end()) flagAndSize->first = srItr->value();
201  else flagAndSize->first = -1;
202  }else{
203  flagAndSize = &(fasItr->second);
204  }
205  }else{
206  EcalScDetId scid(EEDetId(id).sc());
207  uint32_t rawId(scid.rawId());
208 
209  fasItr = flagAndSizeMap.find(rawId);
210 
211  if(fasItr == flagAndSizeMap.end()){
212  flagAndSize = &(flagAndSizeMap[rawId]);
213 
215  if(srItr != eeSRFs_->end()) flagAndSize->first = srItr->value();
216  else flagAndSize->first = -1;
217  }else{
218  flagAndSize = &(fasItr->second);
219  }
220  }
221 
222  if(flagAndSize->first < 0) continue;
223 
224  flagAndSize->second += 1;
225 
226  // SR filter output calculation
227 
228  EcalDataFrame frame(*digiItr);
229 
230  int ZSFIRValue(0); // output
231 
232  bool gain12saturated(false);
233  const int gain12(0x01);
234 
235  for(int iWeight(0); iWeight < nFIRTaps; ++iWeight){
236 
237  int iSample(iFirstSample_ + iWeight - 1);
238 
239  if(iSample >= 0 && iSample < frame.size()){
240  EcalMGPASample sample(frame[iSample]);
241  if(sample.gainId() != gain12){
242  gain12saturated = true;
243  break;
244  }
245  ZSFIRValue += sample.adc() * ZSFIRWeights_[iWeight];
246  }else{
247  edm::LogWarning("EcalDQM") << "SelectiveReadoutTask: Not enough samples in data frame or 'ecalDccZs1stSample' module parameter is not valid";
248  }
249 
250  }
251 
252  if(gain12saturated) ZSFIRValue = std::numeric_limits<int>::max();
253  else ZSFIRValue /= (0x1 << 8); //discards the 8 LSBs
254 
255  //ZS passed if weighted sum above ZS threshold or if
256  //one sample has a lower gain than gain 12 (that is gain 12 output
257  //is saturated)
258 
259  bool highInterest((flagAndSize->first & ~EcalSrFlag::SRF_FORCED_MASK) == EcalSrFlag::SRF_FULL);
260 
261  if(highInterest){
262  MEs_[kHighIntOutput]->fill(id, ZSFIRValue);
263  nHighInt += 1;
264  }else{
265  MEs_[kLowIntOutput]->fill(id, ZSFIRValue);
266  nLowInt += 1;
267  }
268  }
269 
270  unsigned iSubdet(_collection == kEBDigi ? BinService::kEB : BinService::kEE);
271  float denom(_collection == kEBDigi ? 36. : 18.);
272 
273  float highIntPayload(nHighInt * bytesPerCrystal / 1024. / denom);
274  MEs_[kHighIntPayload]->fill(iSubdet + 1, highIntPayload);
275 
276  float lowIntPayload(nLowInt * bytesPerCrystal / 1024. / denom);
277  MEs_[kLowIntPayload]->fill(iSubdet + 1, lowIntPayload);
278 
279  // Check for "ZS-flagged but readout" and "FR-flagged but dropped" towers
280 
281  float nZSFullReadout(0.);
282  for(unsigned iTower(0); iTower < EcalTrigTowerDetId::kEBTotalTowers + EcalScDetId::kSizeForDenseIndexing; iTower++){
283  DetId id;
286 
287  fasItr = flagAndSizeMap.find(id.rawId());
288 
289  float towerSize(0.);
290  if(fasItr != flagAndSizeMap.end()) towerSize = fasItr->second.second * bytesPerCrystal;
291 
292  MEs_[kTowerSize]->fill(id, towerSize);
293 
294  if(fasItr == flagAndSizeMap.end() || fasItr->second.first < 0) continue; // not read out || no flag set
295 
296  bool ruFullyReadout(unsigned(fasItr->second.second) == getElectronicsMap()->dccTowerConstituents(dccId(id), towerId(id)).size());
297 
298  if(ruFullyReadout && zsFlaggedTowers_.find(id.rawId()) != zsFlaggedTowers_.end()){
299  MEs_[kZSFullReadoutMap]->fill(id);
300  nZSFullReadout += 1.;
301  }
302 
303  // we will later use the list of FR flagged towers that do not have data
304  // if the tower is in flagAndSizeMap then there is data; remove it from the list
305  if(frFlaggedTowers_.find(id.rawId()) != frFlaggedTowers_.end()) frFlaggedTowers_.erase(id.rawId());
306  }
307 
308  MEs_[kZSFullReadout]->fill(iSubdet + 1, nZSFullReadout);
309 
310  float nFRDropped(0.);
311 
312  for(set<uint32_t>::iterator frItr(frFlaggedTowers_.begin()); frItr != frFlaggedTowers_.end(); ++frItr){
313  DetId id(*frItr);
314 
315  MEs_[kFRDroppedMap]->fill(id);
316  nFRDropped += 1.;
317  }
318 
319  MEs_[kFRDropped]->fill(iSubdet + 1, nFRDropped);
320 
321  }
static EcalTrigTowerDetId detIdFromDenseIndex(uint32_t di)
const EcalElectronicsMapping * getElectronicsMap()
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
const EBSrFlagCollection * ebSRFs_
static const int SRF_FORCED_MASK
Definition: EcalSrFlag.h:30
std::vector< T >::const_iterator const_iterator
static EcalScDetId unhashIndex(int hi)
Definition: EcalScDetId.h:119
unsigned dccId(const DetId &)
const EESrFlagCollection * eeSRFs_
const_iterator begin() const
std::set< uint32_t > zsFlaggedTowers_
unsigned towerId(const DetId &)
const T & max(const T &a, const T &b)
std::set< uint32_t > frFlaggedTowers_
static const int SRF_FULL
Definition: EcalSrFlag.h:25
const_iterator end() const
Definition: DetId.h:20
std::vector< MESet * > MEs_
Definition: DQWorker.h:56
const_iterator end() const
iterator find(key_type k)
tuple size
Write out results.
void ecaldqm::SelectiveReadoutTask::runOnEBSrFlags ( const EBSrFlagCollection _srfs)

Definition at line 117 of file SelectiveReadoutTask.cc.

References edm::SortedCollection< T, SORT >::begin(), ebSRFs_, edm::SortedCollection< T, SORT >::end(), EcalDQMBinningService::kEB, kFullReadout, ecaldqm::DQWorker::MEs_, and runOnSrFlag_().

Referenced by analyze().

118  {
119  float nFR(0.);
120 
121  ebSRFs_ = &_srfs;
122 
123  for(EBSrFlagCollection::const_iterator srfItr(_srfs.begin()); srfItr != _srfs.end(); ++srfItr)
124  runOnSrFlag_(srfItr->id(), srfItr->value(), nFR);
125 
126  MEs_[kFullReadout]->fill(unsigned(BinService::kEB) + 1, nFR);
127  }
const EBSrFlagCollection * ebSRFs_
std::vector< T >::const_iterator const_iterator
const_iterator end() const
std::vector< MESet * > MEs_
Definition: DQWorker.h:56
const_iterator begin() const
void runOnSrFlag_(const DetId &, int, float &)
void ecaldqm::SelectiveReadoutTask::runOnEESrFlags ( const EESrFlagCollection _srfs)

Definition at line 130 of file SelectiveReadoutTask.cc.

References edm::SortedCollection< T, SORT >::begin(), eeSRFs_, edm::SortedCollection< T, SORT >::end(), EcalDQMBinningService::kEE, kFullReadout, ecaldqm::DQWorker::MEs_, and runOnSrFlag_().

Referenced by analyze().

131  {
132  float nFR(0.);
133 
134  eeSRFs_ = &_srfs;
135 
136  for(EESrFlagCollection::const_iterator srfItr(_srfs.begin()); srfItr != _srfs.end(); ++srfItr)
137  runOnSrFlag_(srfItr->id(), srfItr->value(), nFR);
138 
139  MEs_[kFullReadout]->fill(unsigned(BinService::kEE) + 1, nFR);
140  }
std::vector< T >::const_iterator const_iterator
const EESrFlagCollection * eeSRFs_
const_iterator end() const
std::vector< MESet * > MEs_
Definition: DQWorker.h:56
const_iterator begin() const
void runOnSrFlag_(const DetId &, int, float &)
void ecaldqm::SelectiveReadoutTask::runOnRawData ( const EcalRawDataCollection _dcchs)

Definition at line 108 of file SelectiveReadoutTask.cc.

References edm::SortedCollection< T, SORT >::begin(), edm::SortedCollection< T, SORT >::end(), and feStatus_.

Referenced by analyze().

109  {
110  for(EcalRawDataCollection::const_iterator dcchItr(_dcchs.begin()); dcchItr != _dcchs.end(); ++dcchItr){
111  const std::vector<short> &feStatus(dcchItr->getFEStatus());
112  feStatus_[dcchItr->id() - 1].assign(feStatus.begin(), feStatus.end());
113  }
114  }
std::vector< T >::const_iterator const_iterator
const_iterator end() const
std::vector< short > feStatus_[54]
const_iterator begin() const
void ecaldqm::SelectiveReadoutTask::runOnSource ( const FEDRawDataCollection _fedRaw)

Definition at line 91 of file SelectiveReadoutTask.cc.

References FEDRawDataCollection::FEDData(), kDCCSize, EcalDQMBinningService::kEB, EcalDQMBinningService::kEE, ecaldqm::kEEmHigh, ecaldqm::kEEpLow, kEventSize, ecaldqm::DQWorker::MEs_, FEDRawData::size(), and findQualityFiles::size.

Referenced by analyze().

92  {
93  float ebSize(0.), eeSize(0.);
94 
95  // DCC event size
96  for(unsigned iFED(601); iFED <= 654; iFED++){
97  float size(_fedRaw.FEDData(iFED).size() / 1024.);
98  MEs_[kDCCSize]->fill(iFED - 600, size);
99  if(iFED - 601 <= kEEmHigh || iFED - 601 >= kEEpLow) eeSize += size;
100  else ebSize += size;
101  }
102 
103  MEs_[kEventSize]->fill(unsigned(BinService::kEE) + 1, eeSize / 18.);
104  MEs_[kEventSize]->fill(unsigned(BinService::kEB) + 1, ebSize / 36.);
105  }
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:49
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
std::vector< MESet * > MEs_
Definition: DQWorker.h:56
tuple size
Write out results.
void ecaldqm::SelectiveReadoutTask::runOnSrFlag_ ( const DetId _id,
int  _flag,
float &  nFR 
)
private

Definition at line 143 of file SelectiveReadoutTask.cc.

References ecaldqm::dccId(), ecaldqm::Disabled, feStatus_, frFlaggedTowers_, kFlagCounterMap, kFullReadoutMap, kRUForcedMap, kZS1Map, kZSMap, ecaldqm::DQWorker::MEs_, DetId::rawId(), findQualityFiles::size, EcalSrFlag::SRF_FORCED_MASK, EcalSrFlag::SRF_FULL, EcalSrFlag::SRF_ZS1, EcalSrFlag::SRF_ZS2, ntuplemaker::status, ecaldqm::towerId(), and zsFlaggedTowers_.

Referenced by runOnEBSrFlags(), and runOnEESrFlags().

144  {
145  uint32_t rawId(_id.rawId());
146  int dccid(dccId(_id));
147  int towerid(towerId(_id));
148 
149  MEs_[kFlagCounterMap]->fill(_id);
150 
151  short status(feStatus_[dccid - 1].size() ? feStatus_[dccid - 1][towerid - 1] : 0); // check: towerid == feId??
152 
153  switch(_flag & ~EcalSrFlag::SRF_FORCED_MASK){
155  MEs_[kFullReadoutMap]->fill(_id);
156  nFR += 1.;
157  if(status != Disabled) frFlaggedTowers_.insert(rawId); // will be used in Digi loop
158  break;
159  case EcalSrFlag::SRF_ZS1:
160  MEs_[kZS1Map]->fill(_id);
161  // fallthrough
162  case EcalSrFlag::SRF_ZS2:
163  MEs_[kZSMap]->fill(_id);
164  if(status != Disabled) zsFlaggedTowers_.insert(rawId);
165  break;
166  default:
167  break;
168  }
169 
170  if(_flag & EcalSrFlag::SRF_FORCED_MASK)
171  MEs_[kRUForcedMap]->fill(_id);
172  }
static const int SRF_ZS2
Definition: EcalSrFlag.h:22
static const int SRF_FORCED_MASK
Definition: EcalSrFlag.h:30
unsigned dccId(const DetId &)
std::set< uint32_t > zsFlaggedTowers_
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
unsigned towerId(const DetId &)
std::set< uint32_t > frFlaggedTowers_
static const int SRF_FULL
Definition: EcalSrFlag.h:25
static const int SRF_ZS1
Definition: EcalSrFlag.h:19
std::vector< MESet * > MEs_
Definition: DQWorker.h:56
std::vector< short > feStatus_[54]
tuple status
Definition: ntuplemaker.py:245
tuple size
Write out results.
void ecaldqm::SelectiveReadoutTask::setFIRWeights_ ( const std::vector< double > &  _normWeights)
private

Definition at line 324 of file SelectiveReadoutTask.cc.

References abs, edm::hlt::Exception, i, nFIRTaps, and ZSFIRWeights_.

Referenced by beginRun(), and SelectiveReadoutTask().

325  {
326  if(_normWeights.size() < nFIRTaps)
327  throw cms::Exception("InvalidConfiguration") << "weightsForZsFIR" << std::endl;
328 
329  bool notNormalized(false), notInt(false);
330  for(std::vector<double>::const_iterator it(_normWeights.begin()); it != _normWeights.end(); ++it){
331  if(*it > 1.) notNormalized = true;
332  if((int)(*it) != *it) notInt = true;
333  }
334  if(notInt && notNormalized){
335  throw cms::Exception("InvalidConfiguration")
336  << "weigtsForZsFIR paramater values are not valid: they "
337  << "must either be integer and uses the hardware representation "
338  << "of the weights or less or equal than 1 and used the normalized "
339  << "representation.";
340  }
341 
342  ZSFIRWeights_.clear();
343  ZSFIRWeights_.resize(_normWeights.size());
344 
345  if(notNormalized){
346  for(unsigned i(0); i< ZSFIRWeights_.size(); ++i)
347  ZSFIRWeights_[i] = (int)_normWeights[i];
348  }else{
349  const unsigned maxWeight(0xEFF); //weights coded on 11+1 signed bits
350  for(unsigned i(0); i < ZSFIRWeights_.size(); ++i){
351  ZSFIRWeights_[i] = lround(_normWeights[i] * (1<<10));
352  if(abs(ZSFIRWeights_[i]) > (int)maxWeight) //overflow
353  ZSFIRWeights_[i] = ZSFIRWeights_[i] < 0 ? -maxWeight : maxWeight;
354  }
355  }
356  }
int i
Definition: DBlmapReader.cc:9
#define abs(x)
Definition: mlp_lapack.h:159
void ecaldqm::SelectiveReadoutTask::setMEData ( std::vector< MEData > &  _data)
static

Definition at line 360 of file SelectiveReadoutTask.cc.

References MonitorElement::DQM_KIND_TH1F, MonitorElement::DQM_KIND_TH2F, MonitorElement::DQM_KIND_TPROFILE2D, EcalDQMBinningService::AxisSpecs::edges, EcalDQMBinningService::AxisSpecs::high, i, EcalDQMBinningService::kDCC, kDCCSize, EcalDQMBinningService::kEcal2P, EcalDQMBinningService::kEcal3P, kEventSize, kFlagCounterMap, kFRDropped, kFRDroppedMap, kFullReadout, kFullReadoutMap, kHighIntOutput, kHighIntPayload, kLowIntOutput, kLowIntPayload, kRUForcedMap, EcalDQMBinningService::kSuperCrystal, kTowerSize, EcalDQMBinningService::kUser, kZS1Map, kZSFullReadout, kZSFullReadoutMap, kZSMap, EcalDQMBinningService::AxisSpecs::low, EcalDQMBinningService::AxisSpecs::nbins, and EcalDQMBinningService::AxisSpecs::title.

361  {
363 
364  axis.low = 0.;
365  axis.high = 50.;
367 
368  axis.title = "event size (kB)";
369  axis.nbins = 78; // 10 zero-bins + 68
370  axis.edges = new double[79];
371  float fullTTSize(0.608);
372  for(int i(0); i <= 10; i++) axis.edges[i] = fullTTSize / 10. * i;
373  for(int i(11); i < 79; i++) axis.edges[i] = fullTTSize * (i - 10);
374  _data[kDCCSize] = MEData("DCCSize", BinService::kEcal2P, BinService::kDCC, MonitorElement::DQM_KIND_TH2F, 0, &axis);
375  delete [] axis.edges;
376  axis.edges = 0;
377 
378  axis.nbins = 100;
379  axis.low = 0.;
380  axis.high = 3.;
381  axis.title = "event size (kB)";
382  _data[kEventSize] = MEData("EventSize", BinService::kEcal2P, BinService::kUser, MonitorElement::DQM_KIND_TH1F, &axis);
385 
386  axis.nbins = 100;
387  axis.low = 0.;
388  axis.high = 200.;
389  axis.title = "number of towers";
390  _data[kFullReadout] = MEData("FullReadout", BinService::kEcal2P, BinService::kUser, MonitorElement::DQM_KIND_TH1F, &axis);
394 
395  axis.nbins = 20;
396  axis.low = 0.;
397  axis.high = 20.;
398  axis.title = "number of towers";
399  _data[kZSFullReadout] = MEData("ZSFullReadout", BinService::kEcal2P, BinService::kUser, MonitorElement::DQM_KIND_TH1F, &axis);
401  _data[kFRDropped] = MEData("FRDropped", BinService::kEcal2P, BinService::kUser, MonitorElement::DQM_KIND_TH1F, &axis);
403 
404  axis.nbins = 100;
405  axis.low = 0.;
406  axis.high = 3.;
407  axis.title = "event size (kB)";
408  _data[kHighIntPayload] = MEData("HighIntPayload", BinService::kEcal2P, BinService::kUser, MonitorElement::DQM_KIND_TH1F, &axis);
409  _data[kLowIntPayload] = MEData("LowIntPayload", BinService::kEcal2P, BinService::kUser, MonitorElement::DQM_KIND_TH1F, &axis);
410 
411  axis.nbins = 100;
412  axis.low = -60.;
413  axis.high = 60.;
414  axis.title = "ADC counts*4";
415  _data[kHighIntOutput] = MEData("HighIntOutput", BinService::kEcal2P, BinService::kUser, MonitorElement::DQM_KIND_TH1F, &axis);
416  _data[kLowIntOutput] = MEData("LowIntOutput", BinService::kEcal2P, BinService::kUser, MonitorElement::DQM_KIND_TH1F, &axis);
417  }
int i
Definition: DBlmapReader.cc:9

Member Data Documentation

const EcalChannelStatus* ecaldqm::SelectiveReadoutTask::channelStatus_
private

Definition at line 68 of file SelectiveReadoutTask.h.

Referenced by beginRun().

const EBSrFlagCollection* ecaldqm::SelectiveReadoutTask::ebSRFs_
private

Definition at line 70 of file SelectiveReadoutTask.h.

Referenced by runOnDigis(), and runOnEBSrFlags().

const EESrFlagCollection* ecaldqm::SelectiveReadoutTask::eeSRFs_
private

Definition at line 71 of file SelectiveReadoutTask.h.

Referenced by runOnDigis(), and runOnEESrFlags().

std::vector<short> ecaldqm::SelectiveReadoutTask::feStatus_[54]
private

Definition at line 73 of file SelectiveReadoutTask.h.

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

std::set<uint32_t> ecaldqm::SelectiveReadoutTask::frFlaggedTowers_
private

Definition at line 74 of file SelectiveReadoutTask.h.

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

int ecaldqm::SelectiveReadoutTask::iFirstSample_
private

Definition at line 65 of file SelectiveReadoutTask.h.

Referenced by runOnDigis(), and SelectiveReadoutTask().

std::map<uint32_t, int> ecaldqm::SelectiveReadoutTask::ttCrystals_
private

Definition at line 76 of file SelectiveReadoutTask.h.

const EcalTrigTowerConstituentsMap* ecaldqm::SelectiveReadoutTask::ttMap_
private

Definition at line 69 of file SelectiveReadoutTask.h.

bool ecaldqm::SelectiveReadoutTask::useCondDb_
private

Definition at line 64 of file SelectiveReadoutTask.h.

Referenced by beginRun(), and SelectiveReadoutTask().

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

Definition at line 66 of file SelectiveReadoutTask.h.

Referenced by runOnDigis(), and setFIRWeights_().

std::set<uint32_t> ecaldqm::SelectiveReadoutTask::zsFlaggedTowers_
private

Definition at line 75 of file SelectiveReadoutTask.h.

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