24 #include "TLorentzVector.h"
38 inputTag_ (iConfig.getParameter<edm::InputTag>(
"inputTag")),
39 muonTag_ (iConfig.getParameter<edm::InputTag>(
"muonTag")),
40 doMuonCorrection_(iConfig.getParameter<bool> (
"doMuonCorrection" )),
41 muonEta_ (iConfig.getParameter<double> (
"maxMuonEta" )),
42 min_Jet_Pt_ (iConfig.getParameter<double> (
"minJetPt" )),
43 max_Eta_ (iConfig.getParameter<double> (
"maxEta" )),
44 max_NJ_ (iConfig.getParameter<int> (
"maxNJ" )),
45 accNJJets_ (iConfig.getParameter<bool> (
"acceptNJ" ))
47 LogDebug(
"") <<
"Input/minJetPt/maxEta/maxNJ/acceptNJ : "
55 produces<std::vector<math::XYZTLorentzVector> >();
67 desc.
add<
bool>(
"doMuonCorrection",
false);
68 desc.
add<
double>(
"maxMuonEta",2.1);
69 desc.
add<
double>(
"minJetPt",30.0);
70 desc.
add<
double>(
"maxEta",3.0);
71 desc.
add<
int>(
"maxNJ",7);
72 desc.
add<
bool>(
"acceptNJ",
true);
73 descriptions.
add(
"hltRHemisphere",desc);
88 using namespace trigger;
102 std::auto_ptr<vector<math::XYZTLorentzVector> > Hemispheres(
new vector<math::XYZTLorentzVector> );
106 vector<math::XYZTLorentzVector> JETS;
107 for (
unsigned int i=0;
i<
jets->size();
i++) {
109 JETS.push_back(
jets->at(
i).p4());
115 iEvent.
put(Hemispheres);
121 int muonIndex[nMu] = { -1, -1 };
122 std::vector<reco::RecoChargedCandidate>::const_iterator muonIt;
125 for(muonIt =
muons->begin(); muonIt!=
muons->end(); muonIt++,index++){
128 iEvent.
put(Hemispheres);
131 muonIndex[nPassMu++] =
index;
137 std::vector<math::XYZTLorentzVector> muonJets;
139 muonJets.push_back(leadMu.
p4());
140 Hemispheres->push_back(leadMu.
p4());
145 muonJets.push_back(secondMu.
p4());
146 Hemispheres->push_back(secondMu.
p4());
148 muonJets.push_back(leadMu.
p4());
153 if(n<2)
return false;
160 iEvent.
put(Hemispheres);
166 std::vector<math::XYZTLorentzVector>* extraJets){
167 using namespace math;
168 using namespace reco;
171 int nJets = JETS.size();
172 if(extraJets) nJets+=extraJets->size();
175 hlist->push_back(j1R);
176 hlist->push_back(j2R);
179 unsigned int N_comb =
pow(2,nJets);
181 double M_minR = 9999999999.0;
182 unsigned int j_count;
183 for (
unsigned int i = 0;
i < N_comb;
i++) {
185 unsigned int itemp =
i;
187 unsigned int count = 0;
188 while (j_count > 0) {
189 if (itemp/j_count == 1){
190 if(count<JETS.size()) j_temp1 += JETS.at(count);
191 else j_temp1 +=extraJets->at(count-JETS.size());
193 if(count<JETS.size()) j_temp2 += JETS.at(count);
194 else j_temp2 +=extraJets->at(count-JETS.size());
196 itemp -= j_count * (itemp/j_count);
200 double M_temp = j_temp1.M2() + j_temp2.M2();
201 if (M_temp < M_minR) {
208 hlist->push_back(j1R);
209 hlist->push_back(j2R);
virtual const LorentzVector & p4() const GCC11_FINAL
four-momentum Lorentz vector
#define DEFINE_FWK_MODULE(type)
HLTRHemisphere(const edm::ParameterSet &)
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
ParameterDescriptionBase * add(U const &iLabel, T const &value)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void ComputeHemispheres(std::auto_ptr< std::vector< math::XYZTLorentzVector > > &hlist, const std::vector< math::XYZTLorentzVector > &JETS, std::vector< math::XYZTLorentzVector > *extraJets=0)
Power< A, B >::type pow(const A &a, const B &b)
virtual bool filter(edm::Event &, const edm::EventSetup &)
math::PtEtaPhiELorentzVectorF LorentzVector