Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:22:56

0001 /**
0002  * \class CorrelationWithOverlapRemovalTemplate
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/CorrelationWithOverlapRemovalTemplate.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 CorrelationWithOverlapRemovalTemplate::CorrelationWithOverlapRemovalTemplate() : GlobalCondition() {
0035   m_condCategory = l1t::CondCorrelationWithOverlapRemoval;
0036   m_condType = l1t::Type2corWithOverlapRemoval;
0037   m_condChipNr = -1;
0038 
0039   // there are in fact three 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_cond2Category = l1t::CondNull;
0049   m_cond0Index = -1;
0050   m_cond1Index = -1;
0051   m_cond2Index = -1;
0052 }
0053 
0054 //   from condition name
0055 CorrelationWithOverlapRemovalTemplate::CorrelationWithOverlapRemovalTemplate(const std::string& cName)
0056     : GlobalCondition(cName) {
0057   m_condCategory = l1t::CondCorrelationWithOverlapRemoval;
0058   m_condType = l1t::Type2corWithOverlapRemoval;
0059   m_condChipNr = -1;
0060 
0061   // there are in fact two objects
0062   int nObjects = nrObjects();
0063 
0064   if (nObjects > 0) {
0065     m_objectType.reserve(nObjects);
0066   }
0067 
0068   m_cond0Category = l1t::CondNull;
0069   m_cond1Category = l1t::CondNull;
0070   m_cond2Category = l1t::CondNull;
0071   m_cond0Index = -1;
0072   m_cond1Index = -1;
0073   m_cond2Index = -1;
0074 }
0075 
0076 //   from condition name, the category of first sub-condition, the category of the
0077 //   second sub-condition, the index of first sub-condition in the cor* vector,
0078 //   the index of second sub-condition in the cor* vector
0079 CorrelationWithOverlapRemovalTemplate::CorrelationWithOverlapRemovalTemplate(const std::string& cName,
0080                                                                              const l1t::GtConditionCategory& cond0Cat,
0081                                                                              const l1t::GtConditionCategory& cond1Cat,
0082                                                                              const l1t::GtConditionCategory& cond2Cat,
0083                                                                              const int cond0Index,
0084                                                                              const int cond1index,
0085                                                                              const int cond2index)
0086     : GlobalCondition(cName),
0087       m_cond0Category(cond0Cat),
0088       m_cond1Category(cond1Cat),
0089       m_cond2Category(cond2Cat),
0090       m_cond0Index(cond0Index),
0091       m_cond1Index(cond1index),
0092       m_cond2Index(cond2index)
0093 
0094 {
0095   m_condCategory = l1t::CondCorrelationWithOverlapRemoval;
0096   m_condType = l1t::Type2corWithOverlapRemoval;
0097   m_condChipNr = -1;
0098 
0099   // there are in fact two objects
0100   int nObjects = nrObjects();
0101 
0102   if (nObjects > 0) {
0103     m_objectType.resize(nObjects);
0104   }
0105 }
0106 
0107 // copy constructor
0108 CorrelationWithOverlapRemovalTemplate::CorrelationWithOverlapRemovalTemplate(
0109     const CorrelationWithOverlapRemovalTemplate& cp)
0110     : GlobalCondition(cp.m_condName) {
0111   copy(cp);
0112 }
0113 
0114 // destructor
0115 CorrelationWithOverlapRemovalTemplate::~CorrelationWithOverlapRemovalTemplate() {
0116   // empty now
0117 }
0118 
0119 // assign operator
0120 CorrelationWithOverlapRemovalTemplate& CorrelationWithOverlapRemovalTemplate::operator=(
0121     const CorrelationWithOverlapRemovalTemplate& cp) {
0122   copy(cp);
0123   return *this;
0124 }
0125 
0126 // set the category of the two sub-conditions
0127 void CorrelationWithOverlapRemovalTemplate::setCond0Category(const l1t::GtConditionCategory& condCateg) {
0128   m_cond0Category = condCateg;
0129 }
0130 
0131 void CorrelationWithOverlapRemovalTemplate::setCond1Category(const l1t::GtConditionCategory& condCateg) {
0132   m_cond1Category = condCateg;
0133 }
0134 
0135 void CorrelationWithOverlapRemovalTemplate::setCond2Category(const l1t::GtConditionCategory& condCateg) {
0136   m_cond2Category = condCateg;
0137 }
0138 
0139 // set the index of the two sub-conditions in the cor* vector from menu
0140 void CorrelationWithOverlapRemovalTemplate::setCond0Index(const int& condIndex) { m_cond0Index = condIndex; }
0141 
0142 void CorrelationWithOverlapRemovalTemplate::setCond1Index(const int& condIndex) { m_cond1Index = condIndex; }
0143 
0144 void CorrelationWithOverlapRemovalTemplate::setCond2Index(const int& condIndex) { m_cond2Index = condIndex; }
0145 
0146 // set the correlation parameters of the condition
0147 void CorrelationWithOverlapRemovalTemplate::setCorrelationWithOverlapRemovalParameter(
0148     const CorrelationWithOverlapRemovalParameter& corrParameter) {
0149   m_correlationParameter = corrParameter;
0150 }
0151 
0152 void CorrelationWithOverlapRemovalTemplate::print(std::ostream& myCout) const {
0153   myCout << "\n  CorrelationWithOverlapRemovalTemplate print..." << std::endl;
0154 
0155   GlobalCondition::print(myCout);
0156 
0157   myCout << "\n  First sub-condition category:  " << m_cond0Category << std::endl;
0158   myCout << "  Second sub-condition category: " << m_cond1Category << std::endl;
0159   myCout << "  Third sub-condition category: " << m_cond2Category << std::endl;
0160 
0161   myCout << "\n  First sub-condition index:  " << m_cond0Index << std::endl;
0162   myCout << "  Second sub-condition index: " << m_cond1Index << std::endl;
0163   myCout << "  Third sub-condition index: " << m_cond2Index << std::endl;
0164 
0165   myCout << "\n  CorrelationWithOverlapRemoval parameters "
0166          << "[ hex ]" << std::endl;
0167 
0168   myCout << "    Cut Type:  " << m_correlationParameter.corrCutType << std::endl;
0169   myCout << "    minEtaCutValue        = " << std::dec << m_correlationParameter.minEtaCutValue << std::endl;
0170   myCout << "    maxEtaCutValue        = " << std::dec << m_correlationParameter.maxEtaCutValue << std::endl;
0171   myCout << "    precEtaCut            = " << std::dec << m_correlationParameter.precEtaCut << std::endl;
0172   myCout << "    minPhiCutValue        = " << std::dec << m_correlationParameter.minPhiCutValue << std::endl;
0173   myCout << "    maxPhiCutValue        = " << std::dec << m_correlationParameter.maxPhiCutValue << std::endl;
0174   myCout << "    precPhiCut            = " << std::dec << m_correlationParameter.precPhiCut << std::endl;
0175   myCout << "    minDRCutValue         = " << std::dec << m_correlationParameter.minDRCutValue << std::endl;
0176   myCout << "    maxDRCutValue         = " << std::dec << m_correlationParameter.maxDRCutValue << std::endl;
0177   myCout << "    precDRCut             = " << std::dec << m_correlationParameter.precDRCut << std::endl;
0178   myCout << "    minMassCutValue       = " << std::dec << m_correlationParameter.minMassCutValue << std::endl;
0179   myCout << "    maxMassCutValue       = " << std::dec << m_correlationParameter.maxMassCutValue << std::endl;
0180   myCout << "    precMassCut           = " << std::dec << m_correlationParameter.precMassCut << std::endl;
0181   myCout << "    minOverlapRemovalEtaCutValue        = " << std::dec
0182          << m_correlationParameter.minOverlapRemovalEtaCutValue << std::endl;
0183   myCout << "    maxOverlapRemovalEtaCutValue        = " << std::dec
0184          << m_correlationParameter.maxOverlapRemovalEtaCutValue << std::endl;
0185   myCout << "    precOverlapRemovalEtaCut            = " << std::dec << m_correlationParameter.precOverlapRemovalEtaCut
0186          << std::endl;
0187   myCout << "    minOverlapRemovalPhiCutValue        = " << std::dec
0188          << m_correlationParameter.minOverlapRemovalPhiCutValue << std::endl;
0189   myCout << "    maxOverlapRemovalPhiCutValue        = " << std::dec
0190          << m_correlationParameter.maxOverlapRemovalPhiCutValue << std::endl;
0191   myCout << "    precOverlapRemovalPhiCut            = " << std::dec << m_correlationParameter.precOverlapRemovalPhiCut
0192          << std::endl;
0193   myCout << "    minOverlapRemovalDRCutValue         = " << std::dec
0194          << m_correlationParameter.minOverlapRemovalDRCutValue << std::endl;
0195   myCout << "    maxOverlapRemovalDRCutValue         = " << std::dec
0196          << m_correlationParameter.maxOverlapRemovalDRCutValue << std::endl;
0197   myCout << "    precOverlapRemovalDRCut             = " << std::dec << m_correlationParameter.precOverlapRemovalDRCut
0198          << std::endl;
0199 
0200   myCout << "    chargeCorrelation  = " << std::dec << m_correlationParameter.chargeCorrelation << std::endl;
0201 
0202   // reset to decimal output
0203   myCout << std::dec << std::endl;
0204 }
0205 
0206 void CorrelationWithOverlapRemovalTemplate::copy(const CorrelationWithOverlapRemovalTemplate& cp) {
0207   m_condName = cp.condName();
0208   m_condCategory = cp.condCategory();
0209   m_condType = cp.condType();
0210   m_objectType = cp.objectType();
0211   m_condGEq = cp.condGEq();
0212   m_condChipNr = cp.condChipNr();
0213 
0214   m_cond0Category = cp.cond0Category();
0215   m_cond1Category = cp.cond1Category();
0216   m_cond2Category = cp.cond2Category();
0217   m_cond0Index = cp.cond0Index();
0218   m_cond1Index = cp.cond1Index();
0219   m_cond2Index = cp.cond2Index();
0220 
0221   m_correlationParameter = *(cp.correlationParameter());
0222 }
0223 
0224 // output stream operator
0225 std::ostream& operator<<(std::ostream& os, const CorrelationWithOverlapRemovalTemplate& result) {
0226   result.print(os);
0227   return os;
0228 }