DCCFEBlock

Macros

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
#ifndef DCCFEBLOCK_HH
#define DCCFEBLOCK_HH

#include <iostream>
#include <memory>
#include <cstdint>
#include <string>
#include <vector>
#include <map>
#include <utility>

#include <DataFormats/EcalDigi/interface/EcalDigiCollections.h>
#include <DataFormats/EcalRawData/interface/EcalRawDataCollections.h>
#include <DataFormats/EcalDetId/interface/EcalDetIdCollections.h>
#include <FWCore/MessageLogger/interface/MessageLogger.h>

#include "DCCDataBlockPrototype.h"

class DCCEventBlock;
class DCCDataUnpacker;

class DCCFEBlock : public DCCDataBlockPrototype {
public:
  DCCFEBlock(DCCDataUnpacker* u, EcalElectronicsMapper* m, DCCEventBlock* e, bool unpack, bool forceToKeepFRdata);

  ~DCCFEBlock() override { delete[] xtalGains_; }

  void zsFlag(bool zs) { zs_ = zs; }

  void enableFeIdChecks() { checkFeId_ = true; }

  void updateCollectors() override;

  void display(std::ostream& o) override;
  using DCCDataBlockPrototype::unpack;
  int unpack(const uint64_t** data, unsigned int* dwToEnd, bool zs, unsigned int expectedTowerID);

  unsigned int getLength() override { return blockLength_; }

protected:
  virtual int unpackXtalData(unsigned int stripID, unsigned int xtalID) { return BLOCK_UNPACKED; };
  virtual void fillEcalElectronicsError(std::unique_ptr<EcalElectronicsIdCollection>*) {}

  bool zs_;
  bool checkFeId_;
  unsigned int expTowerID_;
  bool forceToKeepFRdata_;
  unsigned int expXtalTSamples_;
  unsigned int unfilteredDataBlockLength_;
  unsigned int lastStripId_;
  unsigned int lastXtalId_;

  unsigned int towerId_;
  unsigned int numbDWInXtalBlock_;
  unsigned int xtalBlockSize_;
  unsigned int nTSamples_;

  unsigned int blockSize_;
  unsigned int bx_;
  unsigned int l1_;

  short* xtalGains_;
  std::unique_ptr<EcalElectronicsIdCollection>* invalidTTIds_;
  std::unique_ptr<EcalElectronicsIdCollection>* invalidZSXtalIds_;
  std::unique_ptr<EcalElectronicsIdCollection>* invalidBlockLengths_;
};

#endif