Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:20:35

0001 /**
0002  * \class EnergySumZdcTemplate
0003  *
0004  *
0005  * Description: L1 Global Trigger energy-sum template for EtSums from ZDC.
0006  *
0007  * Implementation:
0008  *    Effective clone of EnergySumTemplate for use w/ ZDC
0009  *
0010  * \author: Elisa Fontanesi, Boston University, and Christopher Mc Ginn, MIT
0011  *   cloned from work of Vasile Mihai Ghete - HEPHY Vienna
0012  *
0013  * 2023.08.31
0014  * Version 1
0015  *
0016  */
0017 
0018 // this class header
0019 #include "L1Trigger/L1TGlobal/interface/EnergySumZdcTemplate.h"
0020 
0021 // system include files
0022 
0023 #include <iostream>
0024 #include <iomanip>
0025 
0026 // user include files
0027 
0028 //   base class
0029 
0030 // forward declarations
0031 
0032 // constructors
0033 EnergySumZdcTemplate::EnergySumZdcTemplate() : GlobalCondition() { m_condCategory = l1t::CondEnergySumZdc; }
0034 
0035 EnergySumZdcTemplate::EnergySumZdcTemplate(const std::string& cName) : GlobalCondition(cName) {
0036   m_condCategory = l1t::CondEnergySumZdc;
0037 }
0038 
0039 EnergySumZdcTemplate::EnergySumZdcTemplate(const std::string& cName, const l1t::GtConditionType& cType)
0040     : GlobalCondition(cName, l1t::CondEnergySumZdc, cType) {
0041   m_condCategory = l1t::CondEnergySumZdc;
0042 
0043   // should be always 1 - they are global quantities...
0044   int nObjects = nrObjects();
0045 
0046   if (nObjects > 0) {
0047     m_objectParameter.reserve(nObjects);
0048     m_objectType.reserve(nObjects);
0049   }
0050 }
0051 
0052 // copy constructor
0053 EnergySumZdcTemplate::EnergySumZdcTemplate(const EnergySumZdcTemplate& cp) : GlobalCondition(cp.m_condName) {
0054   copy(cp);
0055 }
0056 
0057 // destructor
0058 EnergySumZdcTemplate::~EnergySumZdcTemplate() = default;
0059 
0060 // assign operator
0061 EnergySumZdcTemplate& EnergySumZdcTemplate::operator=(const EnergySumZdcTemplate& cp) {
0062   copy(cp);
0063   return *this;
0064 }
0065 
0066 // setConditionParameter - set the parameters of the condition
0067 void EnergySumZdcTemplate::setConditionParameter(const std::vector<ObjectParameter>& objParameter) {
0068   m_objectParameter = objParameter;
0069 }
0070 
0071 void EnergySumZdcTemplate::print(std::ostream& myCout) const {
0072   myCout << "\n  EnergySumZdcTemplate print..." << std::endl;
0073 
0074   GlobalCondition::print(myCout);
0075 
0076   int nObjects = nrObjects();
0077 
0078   for (int i = 0; i < nObjects; i++) {
0079     myCout << std::endl;
0080     myCout << "  Template for object " << i << " [ hex ]" << std::endl;
0081     myCout << "    etThreshold       = " << std::hex << m_objectParameter[i].etLowThreshold << " - "
0082            << m_objectParameter[i].etHighThreshold << std::endl;
0083   }
0084 
0085   // reset to decimal output
0086   myCout << std::dec << std::endl;
0087 }
0088 
0089 void EnergySumZdcTemplate::copy(const EnergySumZdcTemplate& cp) {
0090   m_condName = cp.condName();
0091   m_condCategory = cp.condCategory();
0092   m_condType = cp.condType();
0093   m_objectType = cp.objectType();
0094   m_condGEq = cp.condGEq();
0095   m_condChipNr = cp.condChipNr();
0096   m_condRelativeBx = cp.condRelativeBx();
0097 
0098   m_objectParameter = *(cp.objectParameter());
0099 }
0100 
0101 // output stream operator
0102 std::ostream& operator<<(std::ostream& os, const EnergySumZdcTemplate& result) {
0103   result.print(os);
0104   return os;
0105 }