CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes
L1TMP7ZeroSupp Class Reference

#include <L1TMP7ZeroSupp.h>

Inheritance diagram for L1TMP7ZeroSupp:
DQMEDAnalyzer edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > > edm::stream::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 L1TMP7ZeroSupp (const edm::ParameterSet &ps)
 
virtual ~L1TMP7ZeroSupp ()
 
- Public Member Functions inherited from DQMEDAnalyzer
virtual void beginRun (edm::Run const &, edm::EventSetup const &) final
 
virtual void beginStream (edm::StreamID id) final
 
virtual void bookHistograms (DQMStore::IBooker &i, edm::Run const &, edm::EventSetup const &)=0
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer (void)
 
virtual void endLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
virtual void endRunSummary (edm::Run const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
uint32_t streamId () const
 
- Public Member Functions inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::stream::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static std::shared_ptr< dqmDetails::NoCacheglobalBeginLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
 
static std::shared_ptr< dqmDetails::NoCacheglobalBeginRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *)
 
static void globalEndLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *, dqmDetails::NoCache *)
 
static void globalEndRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *, dqmDetails::NoCache *)
 
- Static Public Member Functions inherited from edm::stream::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Protected Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &) override
 
virtual void beginLuminosityBlock (const edm::LuminosityBlock &, const edm::EventSetup &) override
 
virtual void bookHistograms (DQMStore::IBooker &, const edm::Run &, const edm::EventSetup &) override
 
virtual void dqmBeginRun (const edm::Run &, const edm::EventSetup &) override
 
- 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)
 

Private Types

enum  binlabels {
  EVTS =0, EVTSGOOD, EVTSBAD, BLOCKS,
  ZSBLKSGOOD, ZSBLKSBAD, ZSBLKSBADFALSEPOS, ZSBLKSBADFALSENEG,
  NBINLABELS
}
 

Private Member Functions

void bookCapIdHistograms (DQMStore::IBooker &, const unsigned int &)
 

Private Attributes

int amc13HeaderSize_
 
int amc13TrailerSize_
 
int amcHeaderSize_
 
int amcTrailerSize_
 
MonitorElementcapIds_
 
std::vector< unsigned int > definedMaskCapIds_
 
edm::EDGetTokenT< FEDRawDataCollectionfedDataToken_
 
std::vector< int > fedIds_
 
std::vector< std::vector< int > > masks_
 
int maxFedReadoutSize_
 
std::string monitorDir_
 
std::map< unsigned int, MonitorElement * > readoutSizeNoZSMap_
 
std::map< unsigned int, MonitorElement * > readoutSizeZSExpectedMap_
 
std::map< unsigned int, MonitorElement * > readoutSizeZSMap_
 
int slinkHeaderSize_
 
int slinkTrailerSize_
 
bool verbose_
 
std::map< unsigned int, MonitorElement * > zeroSuppValMap_
 
bool zsEnabled_
 
int zsFlagMask_
 

Static Private Attributes

static const unsigned int maxMasks_ = 16
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDAnalyzerBase
typedef EDAnalyzerAdaptorBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 

Detailed Description

Definition at line 22 of file L1TMP7ZeroSupp.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

L1TMP7ZeroSupp::L1TMP7ZeroSupp ( const edm::ParameterSet ps)

Definition at line 7 of file L1TMP7ZeroSupp.cc.

References gather_cfg::cout, TauDecayModes::dec, definedMaskCapIds_, edm::ParameterSet::exists(), edm::ParameterSet::getUntrackedParameter(), mps_fire::i, masks_, maxMasks_, AlCaHLTBitMon_QueryRunRegistry::string, and verbose_.

8  : fedDataToken_(consumes<FEDRawDataCollection>(ps.getParameter<edm::InputTag>("rawData"))),
9  zsEnabled_(ps.getUntrackedParameter<bool>("zsEnabled")),
10  fedIds_(ps.getParameter<std::vector<int>>("fedIds")),
11  slinkHeaderSize_(ps.getUntrackedParameter<int>("lenSlinkHeader")),
12  slinkTrailerSize_(ps.getUntrackedParameter<int>("lenSlinkTrailer")),
13  amc13HeaderSize_(ps.getUntrackedParameter<int>("lenAMC13Header")),
14  amc13TrailerSize_(ps.getUntrackedParameter<int>("lenAMC13Trailer")),
15  amcHeaderSize_(ps.getUntrackedParameter<int>("lenAMCHeader")),
16  amcTrailerSize_(ps.getUntrackedParameter<int>("lenAMCTrailer")),
17  zsFlagMask_(ps.getUntrackedParameter<int>("zsFlagMask")),
18  maxFedReadoutSize_(ps.getUntrackedParameter<int>("maxFEDReadoutSize")),
20  verbose_(ps.getUntrackedParameter<bool>("verbose"))
21 {
22  std::vector<int> zeroMask(6, 0);
23  masks_.reserve(maxMasks_);
24  for (unsigned int i = 0; i < maxMasks_; ++i) {
25  std::string maskCapIdStr{"maskCapId"+std::to_string(i)};
26  masks_.push_back(ps.getUntrackedParameter<std::vector<int>>(maskCapIdStr.c_str(), zeroMask));
27  // which masks are defined?
28  if (ps.exists(maskCapIdStr.c_str())) {
29  definedMaskCapIds_.push_back(i);
30  }
31  }
32  if (verbose_) {
33  // check masks
34  std::cout << "masks" << std::endl;
35  for (unsigned int i = 0; i < maxMasks_; ++i) {
36  std::cout << "caption ID" << i << ":" << std::endl;
37  for (const auto& maskIt: masks_.at(i)) {
38  std::cout << std::hex << std::setw(8) << std::setfill('0') << maskIt << std::dec << std::endl;
39  }
40  }
41  std::cout << "----------" << std::endl;
42  }
43 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< FEDRawDataCollection > fedDataToken_
bool exists(std::string const &parameterName) const
checks if a parameter exists
std::string monitorDir_
std::vector< unsigned int > definedMaskCapIds_
std::vector< std::vector< int > > masks_
static const unsigned int maxMasks_
std::vector< int > fedIds_
L1TMP7ZeroSupp::~L1TMP7ZeroSupp ( )
virtual

Definition at line 45 of file L1TMP7ZeroSupp.cc.

45 {}

Member Function Documentation

void L1TMP7ZeroSupp::analyze ( const edm::Event e,
const edm::EventSetup c 
)
overrideprotectedvirtual

Definition at line 122 of file L1TMP7ZeroSupp.cc.

References amc13HeaderSize_, amc13TrailerSize_, amcHeaderSize_, amcTrailerSize_, groupFilesInBlocks::block, BLOCKS, FEDHeader::bxID(), capIds_, FEDTrailer::check(), FEDHeader::check(), gather_cfg::cout, FEDTrailer::crc(), FEDRawData::data(), data, TauDecayModes::dec, definedMaskCapIds_, end, EVTS, EVTSBAD, EVTSGOOD, FEDTrailer::evtStatus(), FEDRawDataCollection::FEDData(), fedDataToken_, fedIds_, MonitorElement::Fill(), edm::Event::getByToken(), RecoTauValidation_cfi::header, hcalTTPDigis_cfi::id, edm::HandleBase::isValid(), FEDTrailer::lenght(), FEDHeader::lvl1ID(), masks_, maxMasks_, amc13::Packet::parse(), jetCorrFactors_cfi::payload, amc13::Packet::payload(), readoutSizeNoZSMap_, readoutSizeZSExpectedMap_, readoutSizeZSMap_, FEDRawData::size(), slinkHeaderSize_, slinkTrailerSize_, FEDHeader::sourceID(), FEDHeader::triggerType(), FEDTrailer::ttsBits(), verbose_, FEDHeader::version(), zeroSuppValMap_, ZSBLKSBAD, ZSBLKSBADFALSENEG, ZSBLKSBADFALSEPOS, ZSBLKSGOOD, zsEnabled_, and zsFlagMask_.

122  {
123 
124  if (verbose_) edm::LogInfo("L1TDQM") << "L1TMP7ZeroSupp: analyze..." << std::endl;
125 
127  e.getByToken(fedDataToken_, feds);
128 
129  if (!feds.isValid()) {
130  edm::LogError("L1TDQM") << "Cannot analyse: no FEDRawDataCollection found";
131  return;
132  }
133 
135  for (const auto &id: definedMaskCapIds_) {
136  zeroSuppValMap_[id]->Fill(EVTS);
137  }
138 
139  std::map<unsigned int, bool> evtGood;
140  evtGood[maxMasks_] = true;
141  for (const auto &id: definedMaskCapIds_) {
142  evtGood[id] = true;
143  }
144  unsigned valid_count = 0;
145  for (const auto& fedId: fedIds_) {
146  const FEDRawData& l1tRcd = feds->FEDData(fedId);
147 
148  unsigned int fedDataSize = l1tRcd.size();
149  std::map<unsigned int, unsigned int> readoutSizeNoZSMap;
150  std::map<unsigned int, unsigned int> readoutSizeZSMap;
151  std::map<unsigned int, unsigned int> readoutSizeZSExpectedMap;
152  readoutSizeNoZSMap[maxMasks_] = 0;
153  readoutSizeZSMap[maxMasks_] = 0;
154  readoutSizeZSExpectedMap[maxMasks_] = 0;
155  for (const auto &id: definedMaskCapIds_) {
156  readoutSizeNoZSMap[id] = 0;
157  readoutSizeZSMap[id] = 0;
158  readoutSizeZSExpectedMap[id] = 0;
159  }
160 
161  edm::LogInfo("L1TDQM") << "Found FEDRawDataCollection with ID " << fedId << " and size " << l1tRcd.size();
162 
164  if (l1tRcd.size() > 0) {
165  edm::LogError("L1TDQM") << "Cannot analyse: invalid L1T raw data (size = " << l1tRcd.size() << ") for ID " << fedId << ".";
166  }
167  continue;
168  } else {
169  valid_count++;
170  }
171 
172  const unsigned char *data = l1tRcd.data();
173  FEDHeader header(data);
174 
175  if (header.check()) {
176  edm::LogInfo("L1TDQM") << "Found SLink header:" << " Trigger type " << header.triggerType() << " L1 event ID " << header.lvl1ID() << " BX Number " << header.bxID() << " FED source " << header.sourceID() << " FED version " << header.version();
177  } else {
178  edm::LogWarning("L1TDQM") << "Did not find a SLink header!";
179  }
180 
181  FEDTrailer trailer(data + (l1tRcd.size() - slinkTrailerSize_));
182 
183  if (trailer.check()) {
184  edm::LogInfo("L1TDQM") << "Found SLink trailer:" << " Length " << trailer.lenght() << " CRC " << trailer.crc() << " Status " << trailer.evtStatus() << " Throttling bits " << trailer.ttsBits();
185  } else {
186  edm::LogWarning("L1TDQM") << "Did not find a SLink trailer!";
187  }
188 
189  amc13::Packet packet;
190  if (!packet.parse(
191  (const uint64_t*) data,
192  (const uint64_t*) (data + slinkHeaderSize_),
193  (l1tRcd.size() - slinkHeaderSize_ - slinkTrailerSize_) / 8,
194  header.lvl1ID(),
195  header.bxID())) {
196  edm::LogError("L1TDQM") << "Could not extract AMC13 Packet.";
197  return;
198  }
199 
200  for (auto& amc: packet.payload()) {
201  if (amc.size() == 0)
202  continue;
203 
204  auto payload64 = amc.data();
205  const uint32_t * start = (const uint32_t*) payload64.get();
206  // Want to have payload size in 32 bit words, but AMC measures
207  // it in 64 bit words -> factor 2.
208  const uint32_t * end = start + (amc.size() * 2);
209 
210  std::unique_ptr<l1t::Payload> payload;
211  payload.reset(new l1t::MP7Payload(start, end, false));
212 
213  // getBlock() returns a non-null unique_ptr on success
214  std::unique_ptr<l1t::Block> block;
215  while ((block = payload->getBlock()).get()) {
216  if (verbose_) {
217  std::cout << ">>> check zero suppression for block <<<" << std::endl
218  << "hdr: " << std::hex << std::setw(8) << std::setfill('0') << block->header().raw() << std::dec
219  << " (ID " << block->header().getID() << ", size " << block->header().getSize()
220  << ", CapID 0x" << std::hex << std::setw(2) << std::setfill('0') << block->header().getCapID()
221  << ", flags 0x" << std::hex << std::setw(2) << std::setfill('0') << block->header().getFlags()
222  << ")" << std::dec << std::endl;
223  for (const auto& word: block->payload()) {
224  std::cout << "data: " << std::hex << std::setw(8) << std::setfill('0') << word << std::dec << std::endl;
225  }
226  }
227 
228  unsigned int blockCapId = block->header().getCapID();
229  unsigned int blockSize = block->header().getSize() * 4;
230  unsigned int blockHeaderSize = sizeof(block->header().raw());
231  bool zsFlagSet = ((block->header().getFlags() & zsFlagMask_) != 0);
232  bool toSuppress = false;
233 
234  capIds_->Fill(blockCapId);
235 
236  bool capIdDefined = false;
238  if (zeroSuppValMap_.find(blockCapId) != zeroSuppValMap_.end()) {
239  capIdDefined = true;
240  zeroSuppValMap_[blockCapId]->Fill(BLOCKS);
241  }
242 
243  auto totalBlockSize = blockSize + blockHeaderSize;
244  readoutSizeNoZSMap[maxMasks_] += totalBlockSize;
245  if (capIdDefined) {
246  readoutSizeNoZSMap[blockCapId] += totalBlockSize;
247  }
248 
249  // check if this block should be suppressed
250  unsigned int wordcounter = 0;
251  unsigned int wordsum = 0;
252  for (const auto& word: block->payload()) {
253  wordsum += masks_[blockCapId].at(wordcounter%6) & word;
254  if (verbose_) {
255  std::cout << "word: " << std::hex << std::setw(8) << std::setfill('0') << word << std::dec
256  << ", maskword" << wordcounter%6 << ": " << std::hex << std::setw(8) << std::setfill('0')
257  << masks_[blockCapId].at(wordcounter%6) << std::dec << ", wordsum: " << wordsum << std::endl;
258  }
259  if (wordsum > 0) {
260  break;
261  }
262  ++wordcounter;
263  }
264  if (wordsum == 0 && zsEnabled_) {
265  toSuppress = true;
266  if (verbose_) {
267  std::cout << "wordsum == 0: this block should be zero suppressed" << std::endl;
268  }
269  }
270 
271  // check if zero suppression flag agrees
272  if (toSuppress && zsFlagSet) {
273  if (verbose_) std::cout << "GOOD block with ZS flag true" << std::endl;
275  if (capIdDefined) {
276  zeroSuppValMap_[blockCapId]->Fill(ZSBLKSGOOD);
277  }
278  } else if (!toSuppress && !zsFlagSet) {
279  if (verbose_) std::cout << "GOOD block with ZS flag false" << std::endl;
281  readoutSizeZSMap[maxMasks_] += totalBlockSize;
282  readoutSizeZSExpectedMap[maxMasks_] += totalBlockSize;
283  if (capIdDefined) {
284  zeroSuppValMap_[blockCapId]->Fill(ZSBLKSGOOD);
285  readoutSizeZSMap[blockCapId] += totalBlockSize;
286  readoutSizeZSExpectedMap[blockCapId] += totalBlockSize;
287  }
288  } else if (!toSuppress && zsFlagSet) {
289  if (verbose_) std::cout << "BAD block with ZS flag true" << std::endl;
292  readoutSizeZSExpectedMap[maxMasks_] += totalBlockSize;
293  evtGood[maxMasks_] = false;
294  if (capIdDefined) {
295  zeroSuppValMap_[blockCapId]->Fill(ZSBLKSBAD);
296  zeroSuppValMap_[blockCapId]->Fill(ZSBLKSBADFALSEPOS);
297  readoutSizeZSExpectedMap[blockCapId] += totalBlockSize;
298  evtGood[blockCapId] = false;
299  }
300  } else {
301  if (verbose_) std::cout << "BAD block with ZS flag false" << std::endl;
304  readoutSizeZSMap[maxMasks_] += totalBlockSize;
305  evtGood[maxMasks_] = false;
306  if (capIdDefined) {
307  zeroSuppValMap_[blockCapId]->Fill(ZSBLKSBAD);
308  zeroSuppValMap_[blockCapId]->Fill(ZSBLKSBADFALSENEG);
309  readoutSizeZSMap[blockCapId] += totalBlockSize;
310  evtGood[blockCapId] = false;
311  }
312  }
313  }
314  }
315  readoutSizeNoZSMap_[maxMasks_]->Fill(fedDataSize);
316  readoutSizeZSMap_[maxMasks_]->Fill(readoutSizeZSMap[maxMasks_] + fedDataSize - readoutSizeNoZSMap[maxMasks_]);
317  readoutSizeZSExpectedMap_[maxMasks_]->Fill(readoutSizeZSExpectedMap[maxMasks_] + fedDataSize - readoutSizeNoZSMap[maxMasks_]);
318  for (const auto &id: definedMaskCapIds_) {
319  readoutSizeNoZSMap_[id]->Fill(readoutSizeNoZSMap[id]);
320  readoutSizeZSMap_[id]->Fill(readoutSizeZSMap[id]);
321  readoutSizeZSExpectedMap_[id]->Fill(readoutSizeZSExpectedMap[id]);
322  }
323  }
324 
325  if (evtGood[maxMasks_]) {
327  } else {
329  }
330  for (const auto &id: definedMaskCapIds_) {
331  if (evtGood[id]) {
332  zeroSuppValMap_[id]->Fill(EVTSGOOD);
333  } else {
334  zeroSuppValMap_[id]->Fill(EVTSBAD);
335  }
336  }
337 }
Definition: start.py:1
std::vector< amc::Packet > payload() const
Definition: AMC13Spec.h:80
std::map< unsigned int, MonitorElement * > readoutSizeZSExpectedMap_
std::map< unsigned int, MonitorElement * > zeroSuppValMap_
edm::EDGetTokenT< FEDRawDataCollection > fedDataToken_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:460
std::map< unsigned int, MonitorElement * > readoutSizeNoZSMap_
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:47
void Fill(long long x)
std::vector< unsigned int > definedMaskCapIds_
payload
payload postfix for testing
MonitorElement * capIds_
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
std::vector< std::vector< int > > masks_
#define end
Definition: vmac.h:37
static const unsigned int maxMasks_
bool isValid() const
Definition: HandleBase.h:74
unsigned long long uint64_t
Definition: Time.h:15
bool parse(const uint64_t *start, const uint64_t *data, unsigned int size, unsigned int lv1, unsigned int bx, bool legacy_mc=false, bool mtf7_mode=false)
Definition: AMC13Spec.cc:70
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:28
std::vector< int > fedIds_
Definition: AMCSpec.h:8
std::map< unsigned int, MonitorElement * > readoutSizeZSMap_
void L1TMP7ZeroSupp::beginLuminosityBlock ( const edm::LuminosityBlock ,
const edm::EventSetup  
)
overrideprotectedvirtual

Definition at line 70 of file L1TMP7ZeroSupp.cc.

70 {}
void L1TMP7ZeroSupp::bookCapIdHistograms ( DQMStore::IBooker ibooker,
const unsigned int &  id 
)
private

Definition at line 89 of file L1TMP7ZeroSupp.cc.

References BLOCKS, DQMStore::IBooker::book1D(), EVTS, EVTSBAD, EVTSGOOD, hcalTTPDigis_cfi::id, maxFedReadoutSize_, maxMasks_, NBINLABELS, readoutSizeNoZSMap_, readoutSizeZSExpectedMap_, readoutSizeZSMap_, AlCaHLTBitMon_QueryRunRegistry::string, zeroSuppValMap_, ZSBLKSBAD, ZSBLKSBADFALSENEG, ZSBLKSBADFALSEPOS, and ZSBLKSGOOD.

Referenced by bookHistograms().

89  {
90  std::string summaryTitleText = "Zero suppression validation summary";
91  std::string sizeTitleText;
92  if (id == maxMasks_) {
93  sizeTitleText = "FED readout ";
94  } else {
95  std::stringstream ss;
96  ss << summaryTitleText << ", caption id " << id;
97  summaryTitleText = ss.str();
98  ss.str("");
99  ss << "cumulated caption id " << id << " block ";
100  sizeTitleText = ss.str();
101  }
102 
103  zeroSuppValMap_[id] = ibooker.book1D("zeroSuppVal", summaryTitleText.c_str(), NBINLABELS, 0, NBINLABELS);
104  zeroSuppValMap_[id]->setAxisTitle("Block status", 1);
105  zeroSuppValMap_[id]->setBinLabel(EVTS+1, "events", 1);
106  zeroSuppValMap_[id]->setBinLabel(EVTSGOOD+1, "good events", 1);
107  zeroSuppValMap_[id]->setBinLabel(EVTSBAD+1, "bad events", 1);
108  zeroSuppValMap_[id]->setBinLabel(BLOCKS+1, "blocks", 1);
109  zeroSuppValMap_[id]->setBinLabel(ZSBLKSGOOD+1, "good blocks", 1);
110  zeroSuppValMap_[id]->setBinLabel(ZSBLKSBAD+1, "bad blocks", 1);
111  zeroSuppValMap_[id]->setBinLabel(ZSBLKSBADFALSEPOS+1, "false pos.", 1);
112  zeroSuppValMap_[id]->setBinLabel(ZSBLKSBADFALSENEG+1, "false neg.", 1);
113 
114  readoutSizeNoZSMap_[id] = ibooker.book1D("readoutSize", (sizeTitleText + "size").c_str(), 100, 0, maxFedReadoutSize_);
115  readoutSizeNoZSMap_[id]->setAxisTitle("size (byte)", 1);
116  readoutSizeZSMap_[id] = ibooker.book1D("readoutSizeZS", (sizeTitleText + "size with zero suppression").c_str(), 100, 0, maxFedReadoutSize_);
117  readoutSizeZSMap_[id]->setAxisTitle("size (byte)", 1);
118  readoutSizeZSExpectedMap_[id] = ibooker.book1D("readoutSizeZSExpected", ("Expected " + sizeTitleText + "size with zero suppression").c_str(), 100, 0, maxFedReadoutSize_);
119  readoutSizeZSExpectedMap_[id]->setAxisTitle("size (byte)", 1);
120 }
std::map< unsigned int, MonitorElement * > readoutSizeZSExpectedMap_
std::map< unsigned int, MonitorElement * > zeroSuppValMap_
std::map< unsigned int, MonitorElement * > readoutSizeNoZSMap_
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
static const unsigned int maxMasks_
std::map< unsigned int, MonitorElement * > readoutSizeZSMap_
void L1TMP7ZeroSupp::bookHistograms ( DQMStore::IBooker ibooker,
const edm::Run ,
const edm::EventSetup  
)
overrideprotectedvirtual

Definition at line 72 of file L1TMP7ZeroSupp.cc.

References DQMStore::IBooker::book1D(), bookCapIdHistograms(), capIds_, definedMaskCapIds_, hcalTTPDigis_cfi::id, maxMasks_, monitorDir_, MonitorElement::setAxisTitle(), and DQMStore::IBooker::setCurrentFolder().

72  {
73  // overall summary
76  capIds_ = ibooker.book1D("capIds", "Caption ids found in data", maxMasks_, 0, maxMasks_);
77  capIds_->setAxisTitle("caption id", 1);
78 
79  // per caption id subdirectories
80  std::stringstream ss;
81  for (const auto &id: definedMaskCapIds_) {
82  ss.str("");
83  ss << monitorDir_ << "/CapId" << id;
84  ibooker.setCurrentFolder(ss.str().c_str());
85  bookCapIdHistograms(ibooker, id);
86  }
87 }
std::string monitorDir_
void bookCapIdHistograms(DQMStore::IBooker &, const unsigned int &)
std::vector< unsigned int > definedMaskCapIds_
MonitorElement * capIds_
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
static const unsigned int maxMasks_
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:277
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void L1TMP7ZeroSupp::dqmBeginRun ( const edm::Run r,
const edm::EventSetup c 
)
overrideprotectedvirtual

Definition at line 68 of file L1TMP7ZeroSupp.cc.

68 {}
void L1TMP7ZeroSupp::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 47 of file L1TMP7ZeroSupp.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), edm::ParameterSetDescription::addOptionalUntracked(), edm::ParameterSetDescription::addUntracked(), mps_fire::i, maxMasks_, and AlCaHLTBitMon_QueryRunRegistry::string.

47  {
49  desc.add<edm::InputTag>("rawData");
50  desc.add<std::vector<int>>("fedIds")->setComment("FED ids to analyze.");
51  desc.addUntracked<bool>("zsEnabled", true)->setComment("MP7 zero suppression is enabled.");
52  desc.addUntracked<int>("lenSlinkHeader", 8)->setComment("Number of Slink header bytes.");
53  desc.addUntracked<int>("lenSlinkTrailer", 8)->setComment("Number of Slink trailer bytes.");
54  desc.addUntracked<int>("lenAMC13Header", 8)->setComment("Number of AMC13 header bytes.");
55  desc.addUntracked<int>("lenAMC13Trailer", 8)->setComment("Number of AMC13 trailer bytes.");
56  desc.addUntracked<int>("lenAMCHeader", 8)->setComment("Number of AMC header bytes.");
57  desc.addUntracked<int>("lenAMCTrailer", 0)->setComment("Number of AMC trailer bytes.");
58  desc.addUntracked<int>("zsFlagMask", 0x1)->setComment("Zero suppression flag mask.");
59  desc.addUntracked<int>("maxFEDReadoutSize", 10000)->setComment("Maximal FED readout size histogram x-axis value.");
60  for (unsigned int i = 0; i < maxMasks_; ++i) {
61  desc.addOptionalUntracked<std::vector<int>>(("maskCapId"+std::to_string(i)).c_str())->setComment(("ZS mask for caption id "+std::to_string(i)+".").c_str());
62  }
63  desc.addUntracked<std::string>("monitorDir", "")->setComment("Target directory in the DQM file. Will be created if not existing.");
64  desc.addUntracked<bool>("verbose", false);
65  descriptions.add("l1tMP7ZeroSupp", desc);
66 }
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
static const unsigned int maxMasks_
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
ParameterDescriptionBase * addOptionalUntracked(U const &iLabel, T const &value)

Member Data Documentation

int L1TMP7ZeroSupp::amc13HeaderSize_
private

Definition at line 52 of file L1TMP7ZeroSupp.h.

Referenced by analyze().

int L1TMP7ZeroSupp::amc13TrailerSize_
private

Definition at line 53 of file L1TMP7ZeroSupp.h.

Referenced by analyze().

int L1TMP7ZeroSupp::amcHeaderSize_
private

Definition at line 54 of file L1TMP7ZeroSupp.h.

Referenced by analyze().

int L1TMP7ZeroSupp::amcTrailerSize_
private

Definition at line 55 of file L1TMP7ZeroSupp.h.

Referenced by analyze().

MonitorElement* L1TMP7ZeroSupp::capIds_
private

Definition at line 71 of file L1TMP7ZeroSupp.h.

Referenced by analyze(), and bookHistograms().

std::vector<unsigned int> L1TMP7ZeroSupp::definedMaskCapIds_
private

Definition at line 65 of file L1TMP7ZeroSupp.h.

Referenced by analyze(), bookHistograms(), and L1TMP7ZeroSupp().

edm::EDGetTokenT<FEDRawDataCollection> L1TMP7ZeroSupp::fedDataToken_
private

Definition at line 44 of file L1TMP7ZeroSupp.h.

Referenced by analyze().

std::vector<int> L1TMP7ZeroSupp::fedIds_
private

Definition at line 46 of file L1TMP7ZeroSupp.h.

Referenced by analyze().

std::vector<std::vector<int> > L1TMP7ZeroSupp::masks_
private

Definition at line 47 of file L1TMP7ZeroSupp.h.

Referenced by analyze(), and L1TMP7ZeroSupp().

int L1TMP7ZeroSupp::maxFedReadoutSize_
private

Definition at line 58 of file L1TMP7ZeroSupp.h.

Referenced by bookCapIdHistograms().

const unsigned int L1TMP7ZeroSupp::maxMasks_ = 16
staticprivate
std::string L1TMP7ZeroSupp::monitorDir_
private

Definition at line 60 of file L1TMP7ZeroSupp.h.

Referenced by bookHistograms().

std::map<unsigned int, MonitorElement*> L1TMP7ZeroSupp::readoutSizeNoZSMap_
private

Definition at line 68 of file L1TMP7ZeroSupp.h.

Referenced by analyze(), and bookCapIdHistograms().

std::map<unsigned int, MonitorElement*> L1TMP7ZeroSupp::readoutSizeZSExpectedMap_
private

Definition at line 70 of file L1TMP7ZeroSupp.h.

Referenced by analyze(), and bookCapIdHistograms().

std::map<unsigned int, MonitorElement*> L1TMP7ZeroSupp::readoutSizeZSMap_
private

Definition at line 69 of file L1TMP7ZeroSupp.h.

Referenced by analyze(), and bookCapIdHistograms().

int L1TMP7ZeroSupp::slinkHeaderSize_
private

Definition at line 50 of file L1TMP7ZeroSupp.h.

Referenced by analyze().

int L1TMP7ZeroSupp::slinkTrailerSize_
private

Definition at line 51 of file L1TMP7ZeroSupp.h.

Referenced by analyze().

bool L1TMP7ZeroSupp::verbose_
private

Definition at line 61 of file L1TMP7ZeroSupp.h.

Referenced by analyze(), and L1TMP7ZeroSupp().

std::map<unsigned int, MonitorElement*> L1TMP7ZeroSupp::zeroSuppValMap_
private

Definition at line 67 of file L1TMP7ZeroSupp.h.

Referenced by analyze(), and bookCapIdHistograms().

bool L1TMP7ZeroSupp::zsEnabled_
private

Definition at line 45 of file L1TMP7ZeroSupp.h.

Referenced by analyze().

int L1TMP7ZeroSupp::zsFlagMask_
private

Definition at line 56 of file L1TMP7ZeroSupp.h.

Referenced by analyze().