Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 /**
0002  * \class CorrelationTemplate
0003  *
0004  *
0005  * Description: L1 Global Trigger correlation template.
0006  * Includes spatial correlation for two objects of different type.
0007  *
0008  * Implementation:
0009  *    <TODO: enter implementation details>
0010  *
0011  * \author: Vasile Mihai Ghete - HEPHY Vienna
0012  *
0013  * $Date$
0014  * $Revision$
0015  *
0016  */
0017 
0018 // this class header
0019 #include "L1Trigger/L1TGlobal/interface/CorrelationTemplate.h"
0020 
0021 // system include files
0022 
0023 #include <iostream>
0024 #include <iomanip>
0025 
0026 // user include files
0027 //   base class
0028 
0029 // forward declarations
0030 
0031 // constructors
0032 //   default
0033 
0034 CorrelationTemplate::CorrelationTemplate() : GlobalCondition() {
0035   m_condCategory = l1t::CondCorrelation;
0036   m_condType = l1t::Type2cor;
0037   m_condChipNr = -1;
0038 
0039   // there are in fact two objects
0040   int nObjects = nrObjects();
0041 
0042   if (nObjects > 0) {
0043     m_objectType.reserve(nObjects);
0044   }
0045 
0046   m_cond0Category = l1t::CondNull;
0047   m_cond1Category = l1t::CondNull;
0048   m_cond0Index = -1;
0049   m_cond1Index = -1;
0050 }
0051 
0052 //   from condition name
0053 CorrelationTemplate::CorrelationTemplate(const std::string& cName) : GlobalCondition(cName) {
0054   m_condCategory = l1t::CondCorrelation;
0055   m_condType = l1t::Type2cor;
0056   m_condChipNr = -1;
0057 
0058   // there are in fact two objects
0059   int nObjects = nrObjects();
0060 
0061   if (nObjects > 0) {
0062     m_objectType.reserve(nObjects);
0063   }
0064 
0065   m_cond0Category = l1t::CondNull;
0066   m_cond1Category = l1t::CondNull;
0067   m_cond0Index = -1;
0068   m_cond1Index = -1;
0069 }
0070 
0071 //   from condition name, the category of first sub-condition, the category of the
0072 //   second sub-condition, the index of first sub-condition in the cor* vector,
0073 //   the index of second sub-condition in the cor* vector
0074 CorrelationTemplate::CorrelationTemplate(const std::string& cName,
0075                                          const l1t::GtConditionCategory& cond0Cat,
0076                                          const l1t::GtConditionCategory& cond1Cat,
0077                                          const int cond0Index,
0078                                          const int cond1index)
0079     : GlobalCondition(cName),
0080       m_cond0Category(cond0Cat),
0081       m_cond1Category(cond1Cat),
0082       m_cond0Index(cond0Index),
0083       m_cond1Index(cond1index)
0084 
0085 {
0086   m_condCategory = l1t::CondCorrelation;
0087   m_condType = l1t::Type2cor;
0088   m_condChipNr = -1;
0089 
0090   // there are in fact two objects
0091   int nObjects = nrObjects();
0092 
0093   if (nObjects > 0) {
0094     m_objectType.resize(nObjects);
0095   }
0096 }
0097 
0098 // copy constructor
0099 CorrelationTemplate::CorrelationTemplate(const CorrelationTemplate& cp) : GlobalCondition(cp.m_condName) { copy(cp); }
0100 
0101 // destructor
0102 CorrelationTemplate::~CorrelationTemplate() {
0103   // empty now
0104 }
0105 
0106 // assign operator
0107 CorrelationTemplate& CorrelationTemplate::operator=(const CorrelationTemplate& cp) {
0108   copy(cp);
0109   return *this;
0110 }
0111 
0112 // set the category of the two sub-conditions
0113 void CorrelationTemplate::setCond0Category(const l1t::GtConditionCategory& condCateg) { m_cond0Category = condCateg; }
0114 
0115 void CorrelationTemplate::setCond1Category(const l1t::GtConditionCategory& condCateg) { m_cond1Category = condCateg; }
0116 
0117 // set the index of the two sub-conditions in the cor* vector from menu
0118 void CorrelationTemplate::setCond0Index(const int& condIndex) { m_cond0Index = condIndex; }
0119 
0120 void CorrelationTemplate::setCond1Index(const int& condIndex) { m_cond1Index = condIndex; }
0121 
0122 // set the correlation parameters of the condition
0123 void CorrelationTemplate::setCorrelationParameter(const CorrelationParameter& corrParameter) {
0124   m_correlationParameter = corrParameter;
0125 }
0126 
0127 void CorrelationTemplate::print(std::ostream& myCout) const {
0128   myCout << "\n  CorrelationTemplate print..." << std::endl;
0129 
0130   GlobalCondition::print(myCout);
0131 
0132   myCout << "\n  First sub-condition category:  " << m_cond0Category << std::endl;
0133   myCout << "  Second sub-condition category: " << m_cond1Category << std::endl;
0134 
0135   myCout << "\n  First sub-condition index:  " << m_cond0Index << std::endl;
0136   myCout << "  Second sub-condition index: " << m_cond1Index << std::endl;
0137 
0138   myCout << "\n  Correlation parameters "
0139          << "[ hex ]" << std::endl;
0140 
0141   myCout << "    Cut Type:  " << m_correlationParameter.corrCutType << std::endl;
0142   myCout << "    minEtaCutValue        = " << std::dec << m_correlationParameter.minEtaCutValue << std::endl;
0143   myCout << "    maxEtaCutValue        = " << std::dec << m_correlationParameter.maxEtaCutValue << std::endl;
0144   myCout << "    precEtaCut            = " << std::dec << m_correlationParameter.precEtaCut << std::endl;
0145   myCout << "    minPhiCutValue        = " << std::dec << m_correlationParameter.minPhiCutValue << std::endl;
0146   myCout << "    maxPhiCutValue        = " << std::dec << m_correlationParameter.maxPhiCutValue << std::endl;
0147   myCout << "    precPhiCut            = " << std::dec << m_correlationParameter.precPhiCut << std::endl;
0148   myCout << "    minDRCutValue         = " << std::dec << m_correlationParameter.minDRCutValue << std::endl;
0149   myCout << "    maxDRCutValue         = " << std::dec << m_correlationParameter.maxDRCutValue << std::endl;
0150   myCout << "    precDRCut             = " << std::dec << m_correlationParameter.precDRCut << std::endl;
0151   myCout << "    minMassCutValue       = " << std::dec << m_correlationParameter.minMassCutValue << std::endl;
0152   myCout << "    maxMassCutValue       = " << std::dec << m_correlationParameter.maxMassCutValue << std::endl;
0153   myCout << "    precMassCut           = " << std::dec << m_correlationParameter.precMassCut << std::endl;
0154   myCout << "    minTBPTCutValue       = " << std::dec << m_correlationParameter.minTBPTCutValue << std::endl;
0155   myCout << "    maxTBPTCutValue       = " << std::dec << m_correlationParameter.maxTBPTCutValue << std::endl;
0156   myCout << "    precTBPTCut           = " << std::dec << m_correlationParameter.precTBPTCut << std::endl;
0157 
0158   myCout << "    chargeCorrelation  = " << std::dec << m_correlationParameter.chargeCorrelation << std::endl;
0159 
0160   // reset to decimal output
0161   myCout << std::dec << std::endl;
0162 }
0163 
0164 void CorrelationTemplate::copy(const CorrelationTemplate& cp) {
0165   m_condName = cp.condName();
0166   m_condCategory = cp.condCategory();
0167   m_condType = cp.condType();
0168   m_objectType = cp.objectType();
0169   m_condGEq = cp.condGEq();
0170   m_condChipNr = cp.condChipNr();
0171 
0172   m_cond0Category = cp.cond0Category();
0173   m_cond1Category = cp.cond1Category();
0174   m_cond0Index = cp.cond0Index();
0175   m_cond1Index = cp.cond1Index();
0176 
0177   m_correlationParameter = *(cp.correlationParameter());
0178 }
0179 
0180 // output stream operator
0181 std::ostream& operator<<(std::ostream& os, const CorrelationTemplate& result) {
0182   result.print(os);
0183   return os;
0184 }