DCCSRPBlock

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
#ifndef DCCSRPBLOCK_HH
#define DCCSRPBLOCK_HH

/*
 *\ Class DCCSRPBlock
 *
 * Class responsible for SR flag unpacking.
 *
 * \file DCCSRPBlock.h
 *
 *
 * \author N. Almeida
 *
*/

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

#include "DCCDataBlockPrototype.h"

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

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

  void display(std::ostream& o) override;
  using DCCDataBlockPrototype::unpack;
  int unpack(const uint64_t** data, unsigned int* dwToEnd, unsigned int numbFlags = SRP_NUMBFLAGS);

  unsigned short srFlag(unsigned int feChannel) { return srFlags_[feChannel - 1]; }

protected:
  virtual void addSRFlagToCollection() {}

  virtual bool checkSrpIdAndNumbSRFlags() { return true; };

  unsigned int srpId_;
  unsigned int bx_;
  unsigned int l1_;
  unsigned int nSRFlags_;
  unsigned int expNumbSrFlags_;

  unsigned short srFlags_[SRP_NUMBFLAGS];
};

#endif