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

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

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

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

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