Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 /**
0002  * \class CorrelationThreeBodyTemplate
0003  *
0004  * Description: L1 Global Trigger three-body correlation template:                                                                                                               
0005  *              include invariant mass calculation for three-muon events                                                                                                                                   
0006  *
0007  * Implementation:
0008  *    <TODO: enter implementation details>
0009  *
0010  * \author: Elisa Fontanesi - Boston University                                                                                                                                                            
0011  *          CorrelationTemplate and CorrelationWithOverlapRemovalTemplate classes used as a starting point                                                                           
0012  *
0013  * $Date$
0014  * $Revision$
0015  *
0016  */
0017 
0018 // this class header
0019 #include "L1Trigger/L1TGlobal/interface/CorrelationThreeBodyTemplate.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 CorrelationThreeBodyTemplate::CorrelationThreeBodyTemplate() : GlobalCondition() {
0035   m_condCategory = l1t::CondCorrelationThreeBody;
0036   m_condType = l1t::Type3s;
0037   m_condChipNr = -1;
0038 
0039   // there are in fact three objects according to m_condType = l1t::Type3s as defined in CondFormats/L1TObjects/src/L1GtCondition.cc
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 CorrelationThreeBodyTemplate::CorrelationThreeBodyTemplate(const std::string& cName) : GlobalCondition(cName) {
0056   m_condCategory = l1t::CondCorrelationThreeBody;
0057   m_condType = l1t::Type3s;
0058   m_condChipNr = -1;
0059 
0060   // there are in fact three objects according to m_condType = l1t::Type3s as defined in CondFormats/L1TObjects/src/L1GtCondition.cc
0061   int nObjects = nrObjects();
0062 
0063   if (nObjects > 0) {
0064     m_objectType.reserve(nObjects);
0065   }
0066 
0067   m_cond0Category = l1t::CondNull;
0068   m_cond1Category = l1t::CondNull;
0069   m_cond2Category = l1t::CondNull;
0070   m_cond0Index = -1;
0071   m_cond1Index = -1;
0072   m_cond2Index = -1;
0073 }
0074 
0075 //   from condition name, the category of first sub-condition, the category of the
0076 //   second sub-condition, the index of first sub-condition in the cor* vector,
0077 //   the index of second sub-condition in the cor* vector
0078 CorrelationThreeBodyTemplate::CorrelationThreeBodyTemplate(const std::string& cName,
0079                                                            const l1t::GtConditionCategory& cond0Cat,
0080                                                            const l1t::GtConditionCategory& cond1Cat,
0081                                                            const l1t::GtConditionCategory& cond2Cat,
0082                                                            const int cond0Index,
0083                                                            const int cond1index,
0084                                                            const int cond2index)
0085     : GlobalCondition(cName),
0086       m_cond0Category(cond0Cat),
0087       m_cond1Category(cond1Cat),
0088       m_cond2Category(cond2Cat),
0089       m_cond0Index(cond0Index),
0090       m_cond1Index(cond1index),
0091       m_cond2Index(cond2index)
0092 
0093 {
0094   m_condCategory = l1t::CondCorrelationThreeBody;
0095   m_condType = l1t::Type3s;
0096   m_condChipNr = -1;
0097 
0098   // there are in fact three objects according to m_condType = l1t::Type3s as defined in CondFormats/L1TObjects/src/L1GtCondition.cc
0099   int nObjects = nrObjects();
0100 
0101   if (nObjects > 0) {
0102     m_objectType.resize(nObjects);
0103   }
0104 }
0105 
0106 // copy constructor
0107 CorrelationThreeBodyTemplate::CorrelationThreeBodyTemplate(const CorrelationThreeBodyTemplate& cp)
0108     : GlobalCondition(cp.m_condName) {
0109   copy(cp);
0110 }
0111 
0112 // destructor
0113 CorrelationThreeBodyTemplate::~CorrelationThreeBodyTemplate() {
0114   // empty now
0115 }
0116 
0117 // assign operator
0118 CorrelationThreeBodyTemplate& CorrelationThreeBodyTemplate::operator=(const CorrelationThreeBodyTemplate& cp) {
0119   copy(cp);
0120   return *this;
0121 }
0122 
0123 // set the category of the three sub-conditions
0124 void CorrelationThreeBodyTemplate::setCond0Category(const l1t::GtConditionCategory& condCateg) {
0125   m_cond0Category = condCateg;
0126 }
0127 void CorrelationThreeBodyTemplate::setCond1Category(const l1t::GtConditionCategory& condCateg) {
0128   m_cond1Category = condCateg;
0129 }
0130 void CorrelationThreeBodyTemplate::setCond2Category(const l1t::GtConditionCategory& condCateg) {
0131   m_cond2Category = condCateg;
0132 }
0133 
0134 // set the index of the three sub-conditions in the cor* vector from menu
0135 void CorrelationThreeBodyTemplate::setCond0Index(const int& condIndex) { m_cond0Index = condIndex; }
0136 void CorrelationThreeBodyTemplate::setCond1Index(const int& condIndex) { m_cond1Index = condIndex; }
0137 void CorrelationThreeBodyTemplate::setCond2Index(const int& condIndex) { m_cond2Index = condIndex; }
0138 
0139 // set the correlation parameters of the condition
0140 void CorrelationThreeBodyTemplate::setCorrelationThreeBodyParameter(
0141     const CorrelationThreeBodyParameter& corrThreeBodyParameter) {
0142   m_correlationThreeBodyParameter = corrThreeBodyParameter;
0143 }
0144 
0145 void CorrelationThreeBodyTemplate::print(std::ostream& myCout) const {
0146   myCout << "\n  CorrelationThreeBodyTemplate print..." << std::endl;
0147 
0148   GlobalCondition::print(myCout);
0149 
0150   myCout << "\n  First subcondition category:  " << m_cond0Category << std::endl;
0151   myCout << "  Second subcondition category: " << m_cond1Category << std::endl;
0152   myCout << "  Third subcondition category: " << m_cond2Category << std::endl;
0153 
0154   myCout << "\n  First subcondition index:  " << m_cond0Index << std::endl;
0155   myCout << "  Second subcondition index: " << m_cond1Index << std::endl;
0156   myCout << "  Third subcondition index: " << m_cond2Index << std::endl;
0157 
0158   myCout << "\n  Correlation parameter: "
0159          << "[ hex ]" << std::endl;
0160 
0161   myCout << "    Cut Type:  " << m_correlationThreeBodyParameter.corrCutType << std::endl;
0162   myCout << "    minEtaCutValue        = " << std::dec << m_correlationThreeBodyParameter.minEtaCutValue << std::endl;
0163   myCout << "    maxEtaCutValue        = " << std::dec << m_correlationThreeBodyParameter.maxEtaCutValue << std::endl;
0164   myCout << "    precEtaCut            = " << std::dec << m_correlationThreeBodyParameter.precEtaCut << std::endl;
0165   myCout << "    minPhiCutValue        = " << std::dec << m_correlationThreeBodyParameter.minPhiCutValue << std::endl;
0166   myCout << "    maxPhiCutValue        = " << std::dec << m_correlationThreeBodyParameter.maxPhiCutValue << std::endl;
0167   myCout << "    precPhiCut            = " << std::dec << m_correlationThreeBodyParameter.precPhiCut << std::endl;
0168   myCout << "    minMassCutValue       = " << std::dec << m_correlationThreeBodyParameter.minMassCutValue << std::endl;
0169   myCout << "    maxMassCutValue       = " << std::dec << m_correlationThreeBodyParameter.maxMassCutValue << std::endl;
0170   myCout << "    precMassCut           = " << std::dec << m_correlationThreeBodyParameter.precMassCut << std::endl;
0171 
0172   // reset to decimal output
0173   myCout << std::dec << std::endl;
0174 }
0175 
0176 void CorrelationThreeBodyTemplate::copy(const CorrelationThreeBodyTemplate& cp) {
0177   m_condName = cp.condName();
0178   m_condCategory = cp.condCategory();
0179   m_condType = cp.condType();
0180   m_objectType = cp.objectType();
0181   m_condGEq = cp.condGEq();
0182   m_condChipNr = cp.condChipNr();
0183 
0184   m_cond0Category = cp.cond0Category();
0185   m_cond1Category = cp.cond1Category();
0186   m_cond2Category = cp.cond2Category();
0187   m_cond0Index = cp.cond0Index();
0188   m_cond1Index = cp.cond1Index();
0189   m_cond2Index = cp.cond2Index();
0190 
0191   m_correlationThreeBodyParameter = *(cp.correlationThreeBodyParameter());
0192 }
0193 
0194 // output stream operator
0195 std::ostream& operator<<(std::ostream& os, const CorrelationThreeBodyTemplate& result) {
0196   result.print(os);
0197   return os;
0198 }