DTTFFEDSim

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
//-------------------------------------------------
//
/**  \class DTTFFEDSim
 *
 *   L1 DT Track Finder Digi-to-Raw
 *
 *
 *
 *   J. Troconiz  UAM Madrid
 */
//
//--------------------------------------------------
#ifndef DTTFRawToDigi_DTTFFEDSim_h
#define DTTFRawToDigi_DTTFFEDSim_h

#include "FWCore/Framework/interface/ConsumesCollector.h"

#include "DataFormats/FEDRawData/interface/FEDRawDataCollection.h"
#include <DataFormats/L1DTTrackFinder/interface/L1MuDTChambPhContainer.h>
#include <DataFormats/L1DTTrackFinder/interface/L1MuDTChambThContainer.h>
#include <DataFormats/L1DTTrackFinder/interface/L1MuDTTrackContainer.h>

#include <FWCore/Framework/interface/stream/EDProducer.h>
#include <FWCore/ParameterSet/interface/ParameterSet.h>
#include <FWCore/Utilities/interface/InputTag.h>

#include <string>

class DTTFFEDSim : public edm::stream::EDProducer<> {
public:
  /// Constructor
  DTTFFEDSim(const edm::ParameterSet &pset);

  /// Destructor
  ~DTTFFEDSim() override;

  /// Produce digis out of raw data
  void produce(edm::Event &e, const edm::EventSetup &c) override;

  /// Generate and fill FED raw data for a full event
  bool fillRawData(edm::Event &e, FEDRawDataCollection &data);

private:
  unsigned int eventNum;

  edm::InputTag DTDigiInputTag;
  edm::InputTag DTPHTFInputTag;

  // utilities
  int channel(int wheel, int sector, int bx);

  int bxNr(int channel);

  int sector(int channel);

  int wheel(int channel);

  edm::InputTag getDTDigiInputTag() { return DTDigiInputTag; }
  edm::InputTag getDTPHTFInputTag() { return DTPHTFInputTag; }

  edm::EDGetTokenT<L1MuDTChambPhContainer> ChPh_tok;
  edm::EDGetTokenT<L1MuDTChambThContainer> ChTh_tok;
  edm::EDGetTokenT<L1MuDTTrackContainer> Trk_tok;
};
#endif