Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:51:20

0001 /**
0002  * \class L1GtHfRingEtSumsTemplate
0003  *
0004  *
0005  * Description: L1 Global Trigger "HF Ring ET sums" template.
0006  *
0007  * Implementation:
0008  *    <TODO: enter implementation details>
0009  *
0010  * \author: Vasile Mihai Ghete - HEPHY Vienna
0011  *
0012  * $Date$
0013  * $Revision$
0014  *
0015  */
0016 
0017 // this class header
0018 #include "CondFormats/L1TObjects/interface/L1GtHfRingEtSumsTemplate.h"
0019 
0020 // system include files
0021 
0022 #include <iostream>
0023 #include <iomanip>
0024 
0025 // user include files
0026 
0027 //   base class
0028 
0029 #include "CondFormats/L1TObjects/interface/L1GtFwd.h"
0030 #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutSetupFwd.h"
0031 
0032 // forward declarations
0033 
0034 // constructors
0035 L1GtHfRingEtSumsTemplate::L1GtHfRingEtSumsTemplate() : L1GtCondition() { m_condCategory = CondHfRingEtSums; }
0036 
0037 L1GtHfRingEtSumsTemplate::L1GtHfRingEtSumsTemplate(const std::string& cName) : L1GtCondition(cName) {
0038   m_condCategory = CondHfRingEtSums;
0039 }
0040 
0041 L1GtHfRingEtSumsTemplate::L1GtHfRingEtSumsTemplate(const std::string& cName, const L1GtConditionType& cType)
0042     : L1GtCondition(cName, CondHfRingEtSums, cType) {
0043   m_condCategory = CondHfRingEtSums;
0044 
0045   // should be always 1 - they are global quantities...
0046   int nObjects = nrObjects();
0047 
0048   if (nObjects > 0) {
0049     m_objectParameter.reserve(nObjects);
0050 
0051     m_objectType.reserve(nObjects);
0052     m_objectType.assign(nObjects, HfRingEtSums);
0053   }
0054 }
0055 
0056 // copy constructor
0057 L1GtHfRingEtSumsTemplate::L1GtHfRingEtSumsTemplate(const L1GtHfRingEtSumsTemplate& cp) : L1GtCondition(cp.m_condName) {
0058   copy(cp);
0059 }
0060 
0061 // destructor
0062 L1GtHfRingEtSumsTemplate::~L1GtHfRingEtSumsTemplate() {
0063   // empty now
0064 }
0065 
0066 // assign operator
0067 L1GtHfRingEtSumsTemplate& L1GtHfRingEtSumsTemplate::operator=(const L1GtHfRingEtSumsTemplate& cp) {
0068   copy(cp);
0069   return *this;
0070 }
0071 
0072 // setConditionParameter - set the parameters of the condition
0073 void L1GtHfRingEtSumsTemplate::setConditionParameter(const std::vector<ObjectParameter>& objParameter) {
0074   m_objectParameter = objParameter;
0075 }
0076 
0077 void L1GtHfRingEtSumsTemplate::print(std::ostream& myCout) const {
0078   myCout << "\n  L1GtHfRingEtSumsTemplate print..." << std::endl;
0079 
0080   L1GtCondition::print(myCout);
0081 
0082   int nObjects = nrObjects();
0083 
0084   for (int i = 0; i < nObjects; i++) {
0085     myCout << std::endl;
0086     myCout << "  Template for object " << i << std::endl;
0087     myCout << "    etSumIndex        = " << std::hex << m_objectParameter[i].etSumIndex << " [ dec ]" << std::endl;
0088     myCout << "    etSumThreshold    = " << std::hex << m_objectParameter[i].etSumThreshold << " [ hex ]" << std::endl;
0089   }
0090 
0091   // reset to decimal output
0092   myCout << std::dec << std::endl;
0093 }
0094 
0095 // output stream operator
0096 std::ostream& operator<<(std::ostream& os, const L1GtHfRingEtSumsTemplate& result) {
0097   result.print(os);
0098   return os;
0099 }
0100 
0101 void L1GtHfRingEtSumsTemplate::copy(const L1GtHfRingEtSumsTemplate& cp) {
0102   m_condName = cp.condName();
0103   m_condCategory = cp.condCategory();
0104   m_condType = cp.condType();
0105   m_objectType = cp.objectType();
0106   m_condGEq = cp.condGEq();
0107   m_condChipNr = cp.condChipNr();
0108 
0109   m_objectParameter = *(cp.objectParameter());
0110 }