L1GlobalTriggerEvmReadoutRecord

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 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129
#ifndef L1GlobalTrigger_L1GlobalTriggerEvmReadoutRecord_h
#define L1GlobalTrigger_L1GlobalTriggerEvmReadoutRecord_h

/**
 * \class L1GlobalTriggerEvmReadoutRecord
 * 
 * 
 * Description: EVM readout record for L1 Global Trigger.  
 *
 * Implementation:
 *    <TODO: enter implementation details>
 *   
 * \author: Vasile Mihai Ghete - HEPHY Vienna
 * 
 *
 */

// system include files
#include <string>
#include <vector>
#include <iosfwd>

// user include files
#include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutSetupFwd.h"
#include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutSetup.h"

#include "DataFormats/L1GlobalTrigger/interface/L1GtfeWord.h"
#include "DataFormats/L1GlobalTrigger/interface/L1GtfeExtWord.h"
#include "DataFormats/L1GlobalTrigger/interface/L1TcsWord.h"
#include "DataFormats/L1GlobalTrigger/interface/L1GtFdlWord.h"

// forward declarations

// class interface

class L1GlobalTriggerEvmReadoutRecord {
public:
  /// constructors
  L1GlobalTriggerEvmReadoutRecord();

  L1GlobalTriggerEvmReadoutRecord(int NumberBxInEvent);

  L1GlobalTriggerEvmReadoutRecord(const int numberBxInEvent, const int numberFdlBoards);

  /// copy constructor
  L1GlobalTriggerEvmReadoutRecord(const L1GlobalTriggerEvmReadoutRecord&);

  /// destructor
  virtual ~L1GlobalTriggerEvmReadoutRecord();

  /// assignment operator
  L1GlobalTriggerEvmReadoutRecord& operator=(const L1GlobalTriggerEvmReadoutRecord&);

  /// equal operator
  bool operator==(const L1GlobalTriggerEvmReadoutRecord&) const;

  /// unequal operator
  bool operator!=(const L1GlobalTriggerEvmReadoutRecord&) const;

public:
  /// get Global Trigger decision and the decision word
  ///   overloaded w.r.t. bxInEvent argument
  ///   bxInEvent not given: for bunch cross with L1Accept
  const bool decision(int bxInEvent) const;
  const DecisionWord decisionWord(int bxInEvent) const;

  const bool decision() const;
  const DecisionWord decisionWord() const;

  /// set global decision and the decision word
  void setDecision(bool t, int bxInEvent);
  void setDecisionWord(const DecisionWord& decisionWordValue, int bxInEvent);

  void setDecision(bool t);
  void setDecisionWord(const DecisionWord& decisionWordValue);

  /// print global decision and algorithm decision word
  void printGtDecision(std::ostream& myCout, int bxInEventValue) const;
  void printGtDecision(std::ostream& myCout) const;

  /// print technical triggers
  void printTechnicalTrigger(std::ostream& myCout, int bxInEventValue) const;
  void printTechnicalTrigger(std::ostream& myCout) const;

  //**************************************************************************
  // get/set hardware-related words
  //
  // Board description: file GlobalTriggerBoardsMapper.dat // TODO xml file instead?
  //**************************************************************************

  /// get / set GTFE word (record) in the GT readout record
  const L1GtfeExtWord gtfeWord() const;
  void setGtfeWord(const L1GtfeExtWord&);

  /// get / set TCS word (record) in the GT readout record
  const L1TcsWord tcsWord() const;
  void setTcsWord(const L1TcsWord&);

  /// get the vector of L1GtFdlWord
  const std::vector<L1GtFdlWord> gtFdlVector() const { return m_gtFdlWord; }

  std::vector<L1GtFdlWord>& gtFdlVector() { return m_gtFdlWord; }

  /// get / set FDL word (record) in the GT readout record
  const L1GtFdlWord gtFdlWord(int bxInEvent) const;
  const L1GtFdlWord gtFdlWord() const;

  void setGtFdlWord(const L1GtFdlWord&, int bxInEvent);
  void setGtFdlWord(const L1GtFdlWord&);

  // other methods

  /// clear the record
  void reset();

  /// pretty print the content of a L1GlobalTriggerEvmReadoutRecord
  void print(std::ostream& myCout) const;

  /// output stream operator
  friend std::ostream& operator<<(std::ostream&, const L1GlobalTriggerEvmReadoutRecord&);

private:
  L1GtfeExtWord m_gtfeWord;
  L1TcsWord m_tcsWord;

  std::vector<L1GtFdlWord> m_gtFdlWord;
};

#endif