25 #ifndef RecoTauTag_HLTProducers_L1TJetsMatching_h 26 #define RecoTauTag_HLTProducers_L1TJetsMatching_h 41 #include "Math/GenVector/VectorUtil.h" 75 std::pair<std::vector<T>,std::vector<T>>
categorise(
const std::vector<T>& pfMatchedJets,
double pt1,
double pt2,
double pt3,
double Mjj)
77 std::pair<std::vector<T>,std::vector<T>>
output;
81 if (pfMatchedJets.size()>1){
82 for (
unsigned int i = 0;
i < pfMatchedJets.size()-1;
i++){
84 const T & myJet1 = (pfMatchedJets)[
i];
86 for (
unsigned int j =
i+1; j < pfMatchedJets.size(); j++)
88 const T & myJet2 = (pfMatchedJets)[j];
90 const double mjj_test = (myJet1.p4()+myJet2.p4()).M();
101 const T & myJet1 = (pfMatchedJets)[i1];
102 const T & myJet2 = (pfMatchedJets)[i2];
104 if ((mjj > Mjj) && (myJet1.pt() >=
pt1) && (myJet2.pt() >
pt2) )
107 output.first.push_back(myJet1);
108 output.first.push_back(myJet2);
112 if ((mjj > Mjj) && (myJet1.pt() < pt3) && (myJet1.pt() >
pt2) && (myJet2.pt() >
pt2))
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);
129 template<
typename T>
133 pt1Min_ ( iConfig.getParameter<double>(
"pt1Min")),
134 pt2Min_ ( iConfig.getParameter<double>(
"pt2Min")),
135 pt3Min_ ( iConfig.getParameter<double>(
"pt3Min")),
136 mjjMin_ ( iConfig.getParameter<double>(
"mjjMin")),
137 matchingR_ ( iConfig.getParameter<double>(
"matchingR")),
140 produces<std::vector<T>>(
"TwoJets");
141 produces<std::vector<T>>(
"ThreeJets");
144 template<
typename T>
147 template<
typename T>
151 unique_ptr<std::vector<T>> pfMatchedJets(
new std::vector<T>);
152 std::pair<std::vector<T>,std::vector<T>>
output;
170 for(
unsigned int iJet = 0; iJet < pfJets->size(); iJet++){
171 const T & myJet = (*pfJets)[iJet];
172 for(
unsigned int iL1Jet = 0; iL1Jet < jetCandRefVec.size(); iL1Jet++){
176 pfMatchedJets->push_back(myJet);
183 unique_ptr<std::vector<T>> output1(
new std::vector<T>(output.first));
184 unique_ptr<std::vector<T>> output2(
new std::vector<T>(output.second));
190 template<
typename T>
196 desc.
add<
double> (
"pt1Min",110.0)->
setComment(
"Minimal pT1 of PFJets to match");
197 desc.
add<
double> (
"pt2Min",35.0)->
setComment(
"Minimal pT2 of PFJets to match");
198 desc.
add<
double> (
"pt3Min",110.0)->
setComment(
"Minimum pT3 of PFJets to match");
199 desc.
add<
double> (
"mjjMin",650.0)->
setComment(
"Minimal mjj of matched PFjets");
200 desc.
add<
double> (
"matchingR",0.5)->
setComment(
"dR value used for matching");
201 descriptions.
setComment(
"This module produces collection of PFJetss matched to L1 Taus / Jets passing a HLT filter (Only p4 and vertex of returned PFJetss are set).");
void setComment(std::string const &value)
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
void getObjects(Vids &ids, VRphoton &refs) const
various physics-level getters:
L1TJetsMatching(const edm::ParameterSet &)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::vector< JetRef > JetVectorRef
std::string defaultModuleLabel()
const edm::EDGetTokenT< std::vector< T > > jetSrc_
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
~L1TJetsMatching() override
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > jetTrigger_
void setComment(std::string const &value)
XYZPointD XYZPoint
point in space with cartesian internal representation
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
void add(std::string const &label, ParameterSetDescription const &psetDescription)
T1 deltaR2(T1 eta1, T2 phi1, T3 eta2, T4 phi2)
std::pair< std::vector< T >, std::vector< T > > categorise(const std::vector< T > &pfMatchedJets, double pt1, double pt2, double pt3, double Mjj)