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 Mjj)
 

Function Documentation

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

Definition at line 74 of file L1TJetsMatching.h.

References mps_fire::i, convertSQLitetoXML_cfg::output, hiDetachedQuadStep_cff::pt1, and hiDetachedQuadStep_cff::pt2.

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

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