Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:02:22

0001 /**
0002  * \class L1GtJetCountsTemplate
0003  *
0004  *
0005  * Description: L1 Global Trigger "jet counts" 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/L1GtJetCountsTemplate.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 L1GtJetCountsTemplate::L1GtJetCountsTemplate() : L1GtCondition() { m_condCategory = CondJetCounts; }
0036 
0037 L1GtJetCountsTemplate::L1GtJetCountsTemplate(const std::string& cName) : L1GtCondition(cName) {
0038   m_condCategory = CondJetCounts;
0039 }
0040 
0041 L1GtJetCountsTemplate::L1GtJetCountsTemplate(const std::string& cName, const L1GtConditionType& cType)
0042     : L1GtCondition(cName, CondJetCounts, cType) {
0043   m_condCategory = CondJetCounts;
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, JetCounts);
0053   }
0054 }
0055 
0056 // copy constructor
0057 L1GtJetCountsTemplate::L1GtJetCountsTemplate(const L1GtJetCountsTemplate& cp) : L1GtCondition(cp.m_condName) {
0058   copy(cp);
0059 }
0060 
0061 // destructor
0062 L1GtJetCountsTemplate::~L1GtJetCountsTemplate() {
0063   // empty now
0064 }
0065 
0066 // assign operator
0067 L1GtJetCountsTemplate& L1GtJetCountsTemplate::operator=(const L1GtJetCountsTemplate& cp) {
0068   copy(cp);
0069   return *this;
0070 }
0071 
0072 // setConditionParameter - set the parameters of the condition
0073 void L1GtJetCountsTemplate::setConditionParameter(const std::vector<ObjectParameter>& objParameter) {
0074   m_objectParameter = objParameter;
0075 }
0076 
0077 void L1GtJetCountsTemplate::print(std::ostream& myCout) const {
0078   myCout << "\n  L1GtJetCountsTemplate 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 << "    countIndex        = " << std::hex << m_objectParameter[i].countIndex << " [ dec ]" << std::endl;
0088     myCout << "    countThreshold    = " << std::hex << m_objectParameter[i].countThreshold << " [ hex ]" << std::endl;
0089     myCout << "    countOverflow     = " << std::hex << m_objectParameter[0].countOverflow << std::endl;
0090   }
0091 
0092   // reset to decimal output
0093   myCout << std::dec << std::endl;
0094 }
0095 
0096 void L1GtJetCountsTemplate::copy(const L1GtJetCountsTemplate& cp) {
0097   m_condName = cp.condName();
0098   m_condCategory = cp.condCategory();
0099   m_condType = cp.condType();
0100   m_objectType = cp.objectType();
0101   m_condGEq = cp.condGEq();
0102   m_condChipNr = cp.condChipNr();
0103 
0104   m_objectParameter = *(cp.objectParameter());
0105 }
0106 
0107 // output stream operator
0108 std::ostream& operator<<(std::ostream& os, const L1GtJetCountsTemplate& result) {
0109   result.print(os);
0110   return os;
0111 }