14 #include "TLorentzVector.h" 30 inputTag_ (iConfig.getParameter<
edm::InputTag>(
"inputTag")),
31 muonTag_ (iConfig.getParameter<
edm::InputTag>(
"muonTag")),
32 doMuonCorrection_(iConfig.getParameter<bool> (
"doMuonCorrection" )),
33 muonEta_ (iConfig.getParameter<double> (
"maxMuonEta" )),
34 min_Jet_Pt_ (iConfig.getParameter<double> (
"minJetPt" )),
35 max_Eta_ (iConfig.getParameter<double> (
"maxEta" )),
36 max_NJ_ (iConfig.getParameter<
int> (
"maxNJ" )),
37 accNJJets_ (iConfig.getParameter<bool> (
"acceptNJ" ))
39 LogDebug(
"") <<
"Input/minJetPt/maxEta/maxNJ/acceptNJ : " 49 produces<std::vector<math::XYZTLorentzVector> >();
59 desc.
add<
bool>(
"doMuonCorrection",
false);
60 desc.
add<
double>(
"maxMuonEta",2.1);
61 desc.
add<
double>(
"minJetPt",30.0);
62 desc.
add<
double>(
"maxEta",3.0);
63 desc.
add<
int>(
"maxNJ",7);
64 desc.
add<
bool>(
"acceptNJ",
true);
65 descriptions.
add(
"hltRHemisphere",desc);
94 std::unique_ptr<vector<math::XYZTLorentzVector> > Hemispheres(
new vector<math::XYZTLorentzVector> );
98 vector<math::XYZTLorentzVector> JETS;
99 for (
auto const &
i : *jets) {
101 JETS.push_back(
i.p4());
113 int muonIndex[nMu] = { -1, -1 };
114 std::vector<reco::RecoChargedCandidate>::const_iterator muonIt;
117 for(muonIt = muons->begin(); muonIt!=muons->end(); muonIt++,index++){
123 muonIndex[nPassMu++] =
index;
129 std::vector<math::XYZTLorentzVector> muonJets;
131 muonJets.push_back(leadMu.
p4());
132 Hemispheres->push_back(leadMu.
p4());
137 muonJets.push_back(secondMu.
p4());
138 Hemispheres->push_back(secondMu.
p4());
140 muonJets.push_back(leadMu.
p4());
145 if(n<2)
return false;
158 std::vector<math::XYZTLorentzVector>* extraJets){
159 using namespace math;
160 using namespace reco;
163 int nJets = JETS.size();
164 if(extraJets) nJets+=extraJets->size();
167 hlist->push_back(j1R);
168 hlist->push_back(j2R);
171 unsigned int N_comb =
pow(2,nJets);
173 double M_minR = 9999999999.0;
174 unsigned int j_count;
175 for (
unsigned int i = 0;
i < N_comb;
i++) {
177 unsigned int itemp =
i;
179 unsigned int count = 0;
180 while (j_count > 0) {
181 if (itemp/j_count == 1){
182 if(count<JETS.size()) j_temp1 += JETS.at(count);
183 else j_temp1 +=extraJets->at(count-JETS.size());
185 if(count<JETS.size()) j_temp2 += JETS.at(count);
186 else j_temp2 +=extraJets->at(count-JETS.size());
188 itemp -= j_count * (itemp/j_count);
192 double M_temp = j_temp1.M2() + j_temp2.M2();
193 if (M_temp < M_minR) {
200 hlist->push_back(j1R);
201 hlist->push_back(j2R);
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
HLTRHemisphere(const edm::ParameterSet &)
edm::EDGetTokenT< std::vector< reco::RecoChargedCandidate > > m_theMuonToken
edm::EDGetTokenT< edm::View< reco::Jet > > m_theJetToken
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Abs< T >::type abs(const T &t)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void ComputeHemispheres(std::unique_ptr< std::vector< math::XYZTLorentzVector > > &hlist, const std::vector< math::XYZTLorentzVector > &JETS, std::vector< math::XYZTLorentzVector > *extraJets=0)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
virtual const LorentzVector & p4() const final
four-momentum Lorentz vector
Power< A, B >::type pow(const A &a, const B &b)
virtual bool filter(edm::Event &, const edm::EventSetup &)
math::PtEtaPhiELorentzVectorF LorentzVector