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
/**
 * \class L1GtExternalTemplate
 *
 *
 * Description: L1 Global Trigger external template.
 *
 * Implementation:
 *    Instantiated L1GtCondition. External conditions sends a logical result only.
 *    No changes are possible at the L1 GT level. External conditions can be used
 *    in physics algorithms in combination with other defined conditions,
 *    see L1GtFwd.
 *
 *    It has zero objects associated.
 *
 * \author: Vasile Mihai Ghete - HEPHY Vienna
 *
 * $Date$
 * $Revision$
 *
 */

// this class header
#include "CondFormats/L1TObjects/interface/L1GtExternalTemplate.h"

// system include files

#include <iostream>
#include <iomanip>

// user include files

//   base class

#include "CondFormats/L1TObjects/interface/L1GtFwd.h"
#include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutSetupFwd.h"

// forward declarations

// constructors
L1GtExternalTemplate::L1GtExternalTemplate() : L1GtCondition() {
  m_condCategory = CondExternal;
  m_condType = TypeExternal;
}

L1GtExternalTemplate::L1GtExternalTemplate(const std::string& cName) : L1GtCondition(cName) {
  m_condCategory = CondExternal;
  m_condType = TypeExternal;
}

L1GtExternalTemplate::L1GtExternalTemplate(const std::string& cName, const L1GtConditionType& cType)
    : L1GtCondition(cName, CondEnergySum, cType) {
  m_condCategory = CondExternal;
  m_condType = TypeExternal;

  // actually no objects are sent by External, only the result of the condition
  int nObjects = nrObjects();

  if (nObjects > 0) {
    m_objectType.reserve(nObjects);
  }
}

// copy constructor
L1GtExternalTemplate::L1GtExternalTemplate(const L1GtExternalTemplate& cp) : L1GtCondition(cp.m_condName) { copy(cp); }

// destructor
L1GtExternalTemplate::~L1GtExternalTemplate() {
  // empty now
}

// assign operator
L1GtExternalTemplate& L1GtExternalTemplate::operator=(const L1GtExternalTemplate& cp) {
  copy(cp);
  return *this;
}

void L1GtExternalTemplate::print(std::ostream& myCout) const {
  myCout << "\n  L1GtExternalTemplate print..." << std::endl;

  L1GtCondition::print(myCout);

  // reset to decimal output
  myCout << std::dec << std::endl;
}

void L1GtExternalTemplate::copy(const L1GtExternalTemplate& cp) {
  m_condName = cp.condName();
  m_condCategory = cp.condCategory();
  m_condType = cp.condType();
  m_objectType = cp.objectType();
  m_condGEq = cp.condGEq();
  m_condChipNr = cp.condChipNr();
}

// output stream operator
std::ostream& operator<<(std::ostream& os, const L1GtExternalTemplate& result) {
  result.print(os);
  return os;
}