Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 /**
0002  * \class L1GtBptxTemplate
0003  *
0004  *
0005  * Description: L1 Global Trigger BPTX template.
0006  *
0007  * Implementation:
0008  *    Instantiated L1GtCondition. BPTX conditions sends a logical result only.
0009  *    No changes are possible at the L1 GT level. BPTX conditions can be used
0010  *    in physics algorithms in combination with other defined conditions,
0011  *    see L1GtFwd.
0012  *
0013  *    It has zero objects associated.
0014  *
0015  * \author: Vasile Mihai Ghete - HEPHY Vienna
0016  *
0017  * $Date$
0018  * $Revision$
0019  *
0020  */
0021 
0022 // this class header
0023 #include "CondFormats/L1TObjects/interface/L1GtBptxTemplate.h"
0024 
0025 // system include files
0026 
0027 #include <iostream>
0028 #include <iomanip>
0029 
0030 // user include files
0031 
0032 //   base class
0033 
0034 #include "CondFormats/L1TObjects/interface/L1GtFwd.h"
0035 #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutSetupFwd.h"
0036 
0037 // forward declarations
0038 
0039 // constructors
0040 L1GtBptxTemplate::L1GtBptxTemplate() : L1GtCondition() {
0041   m_condCategory = CondBptx;
0042   m_condType = TypeBptx;
0043 }
0044 
0045 L1GtBptxTemplate::L1GtBptxTemplate(const std::string& cName) : L1GtCondition(cName) {
0046   m_condCategory = CondBptx;
0047   m_condType = TypeBptx;
0048 }
0049 
0050 L1GtBptxTemplate::L1GtBptxTemplate(const std::string& cName, const L1GtConditionType& cType)
0051     : L1GtCondition(cName, CondEnergySum, cType) {
0052   m_condCategory = CondBptx;
0053   m_condType = TypeBptx;
0054 
0055   // actually no objects are sent by BPTX, only the result of the condition
0056   int nObjects = nrObjects();
0057 
0058   if (nObjects > 0) {
0059     m_objectType.reserve(nObjects);
0060   }
0061 }
0062 
0063 // copy constructor
0064 L1GtBptxTemplate::L1GtBptxTemplate(const L1GtBptxTemplate& cp) : L1GtCondition(cp.m_condName) { copy(cp); }
0065 
0066 // destructor
0067 L1GtBptxTemplate::~L1GtBptxTemplate() {
0068   // empty now
0069 }
0070 
0071 // assign operator
0072 L1GtBptxTemplate& L1GtBptxTemplate::operator=(const L1GtBptxTemplate& cp) {
0073   copy(cp);
0074   return *this;
0075 }
0076 
0077 void L1GtBptxTemplate::print(std::ostream& myCout) const {
0078   myCout << "\n  L1GtBptxTemplate print..." << std::endl;
0079 
0080   L1GtCondition::print(myCout);
0081 
0082   // reset to decimal output
0083   myCout << std::dec << std::endl;
0084 }
0085 
0086 void L1GtBptxTemplate::copy(const L1GtBptxTemplate& cp) {
0087   m_condName = cp.condName();
0088   m_condCategory = cp.condCategory();
0089   m_condType = cp.condType();
0090   m_objectType = cp.objectType();
0091   m_condGEq = cp.condGEq();
0092   m_condChipNr = cp.condChipNr();
0093 }
0094 
0095 // output stream operator
0096 std::ostream& operator<<(std::ostream& os, const L1GtBptxTemplate& result) {
0097   result.print(os);
0098   return os;
0099 }