27 : inputTag_(iConfig.getParameter<
edm::
InputTag>(
"inputTag")),
28 inputMetTag_(iConfig.getParameter<
edm::
InputTag>(
"inputMetTag")) {
33 produces<std::vector<double>>();
52 std::unique_ptr<std::vector<double>>
result(
new std::vector<double>);
58 std::vector<math::XYZTLorentzVector> muonVec;
59 const double MR =
CalcMR(ja, jb);
60 const double R =
CalcR(MR, ja, jb, inputMet, muonVec);
71 ja.SetPtEtaPhiM(ja.Pt(), ja.Eta(), ja.Phi(), 0.0);
72 jb.SetPtEtaPhiM(jb.Pt(), jb.Eta(), jb.Phi(), 0.0);
74 if (ja.Pt() > jb.Pt()) {
75 TLorentzVector
temp = ja;
85 jaT.SetXYZ(ja.Px(), ja.Py(), 0.0);
86 jbT.SetXYZ(jb.Px(), jb.Py(), 0.0);
87 double ATBT = (jaT + jbT).Mag2();
89 double MR =
sqrt((
A +
B) * (
A +
B) - (az + bz) * (az + bz) -
90 (jbT.Dot(jbT) - jaT.Dot(jaT)) * (jbT.Dot(jbT) - jaT.Dot(jaT)) / (jaT + jbT).Mag2());
92 double mybeta = (jbT.Dot(jbT) - jaT.Dot(jaT)) /
sqrt(ATBT * ((
A +
B) * (
A +
B) - (az + bz) * (az + bz)));
94 double mygamma = 1. /
sqrt(1. - mybeta * mybeta);
101 const TLorentzVector &ja,
102 const TLorentzVector &jb,
104 const std::vector<math::XYZTLorentzVector> &
muons)
const {
107 met.SetPtEtaPhi((inputMet->front()).
pt(), 0.0, (inputMet->front()).
phi());
109 std::vector<math::XYZTLorentzVector>::const_iterator muonIt;
110 for (muonIt =
muons.begin(); muonIt !=
muons.end(); muonIt++) {
112 tmp.SetPtEtaPhi(muonIt->pt(), 0, muonIt->phi());
116 double MTR =
sqrt(0.5 * (
met.Mag() * (ja.Pt() + jb.Pt()) -
met.Dot(ja.Vect() + jb.Vect())));
RazorVarProducer(const edm::ParameterSet &)
T getParameter(std::string const &) const
edm::InputTag inputMetTag_
edm::EDGetTokenT< reco::CaloMETCollection > inputMetTagToken_
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
#define DEFINE_FWK_MODULE(type)
double CalcMR(TLorentzVector ja, TLorentzVector jb) const
double CalcR(double MR, const TLorentzVector &ja, const TLorentzVector &jb, edm::Handle< reco::CaloMETCollection > met, const std::vector< math::XYZTLorentzVector > &muons) const
edm::EDGetTokenT< std::vector< math::XYZTLorentzVector > > inputTagToken_