CMS 3D CMS Logo

Classes | Functions
L1TJetsMatching.h File Reference
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/global/EDProducer.h"
#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
#include "FWCore/ParameterSet/interface/ParameterSetDescription.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/Utilities/interface/InputTag.h"
#include "DataFormats/Common/interface/Handle.h"
#include "DataFormats/JetReco/interface/PFJetCollection.h"
#include "DataFormats/TauReco/interface/PFTauFwd.h"
#include "DataFormats/HLTReco/interface/TriggerFilterObjectWithRefs.h"
#include "Math/GenVector/VectorUtil.h"
#include "DataFormats/HLTReco/interface/TriggerTypeDefs.h"
#include "FWCore/Utilities/interface/EDMException.h"
#include "DataFormats/JetReco/interface/PFJet.h"
#include "HLTrigger/HLTcore/interface/defaultModuleLabel.h"
#include "DataFormats/Math/interface/deltaR.h"
#include <map>
#include <vector>

Go to the source code of this file.

Classes

class  L1TJetsMatching< T >
 

Functions

template<typename T >
std::pair< std::vector< T >, std::vector< T > > categorise (const std::vector< T > &pfMatchedJets, double pt1, double pt2, double pt3, double Mjj)
 

Function Documentation

◆ categorise()

template<typename T >
std::pair<std::vector<T>, std::vector<T> > categorise ( const std::vector< T > &  pfMatchedJets,
double  pt1,
double  pt2,
double  pt3,
double  Mjj 
)

Definition at line 71 of file L1TJetsMatching.h.

References mps_fire::i, testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, dqmiolumiharvest::j, convertSQLitetoXML_cfg::output, HLT_2022v15_cff::pt1, and HLT_2022v15_cff::pt2.

Referenced by L1TJetsMatching< T >::produce().

72  {
73  std::pair<std::vector<T>, std::vector<T>> output;
74  unsigned int i1 = 0;
75  unsigned int i2 = 0;
76  double mjj = 0;
77  if (pfMatchedJets.size() > 1) {
78  for (unsigned int i = 0; i < pfMatchedJets.size() - 1; i++) {
79  const T& myJet1 = (pfMatchedJets)[i];
80 
81  for (unsigned int j = i + 1; j < pfMatchedJets.size(); j++) {
82  const T& myJet2 = (pfMatchedJets)[j];
83 
84  const double mjj_test = (myJet1.p4() + myJet2.p4()).M();
85 
86  if (mjj_test > mjj) {
87  mjj = mjj_test;
88  i1 = i;
89  i2 = j;
90  }
91  }
92  }
93 
94  const T& myJet1 = (pfMatchedJets)[i1];
95  const T& myJet2 = (pfMatchedJets)[i2];
96 
97  if ((mjj > Mjj) && (myJet1.pt() >= pt1) && (myJet2.pt() > pt2)) {
98  output.first.push_back(myJet1);
99  output.first.push_back(myJet2);
100  }
101 
102  if ((mjj > Mjj) && (myJet1.pt() < pt3) && (myJet1.pt() > pt2) && (myJet2.pt() > pt2)) {
103  const T& myJetTest = (pfMatchedJets)[0];
104  if (myJetTest.pt() > pt3) {
105  output.second.push_back(myJet1);
106  output.second.push_back(myJet2);
107  output.second.push_back(myJetTest);
108  }
109  }
110  }
111 
112  return output;
113 }
long double T