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 80 of file L1TJetsMatching.h.

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

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

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