27 inputTag_ (iConfig.getParameter<edm::InputTag>(
"inputTag")),
28 inputMetTag_ (iConfig.getParameter<edm::InputTag>(
"inputMetTag")){
30 produces<std::vector<double> >();
58 std::auto_ptr<std::vector<double> >
result(
new std::vector<double>);
60 if (hemispheres.isValid() && inputMet.isValid() && hemispheres->size() > 1){
62 TLorentzVector ja(hemispheres->at(0).x(),hemispheres->at(0).y(),hemispheres->at(0).z(),hemispheres->at(0).t());
63 TLorentzVector jb(hemispheres->at(1).x(),hemispheres->at(1).y(),hemispheres->at(1).z(),hemispheres->at(1).t());
65 std::vector<math::XYZTLorentzVector> muonVec;
66 const double MR =
CalcMR(ja,jb);
67 const double R =
CalcR(MR,ja,jb,inputMet,muonVec);
68 result->push_back(MR);
77 if(ja.Pt()<=0.1)
return -1;
79 ja.SetPtEtaPhiM(ja.Pt(),ja.Eta(),ja.Phi(),0.0);
80 jb.SetPtEtaPhiM(jb.Pt(),jb.Eta(),jb.Phi(),0.0);
82 if(ja.Pt() > jb.Pt()){
83 TLorentzVector
temp = ja;
93 jaT.SetXYZ(ja.Px(),ja.Py(),0.0);
94 jbT.SetXYZ(jb.Px(),jb.Py(),0.0);
95 double ATBT = (jaT+jbT).Mag2();
97 double MR =
sqrt((A+B)*(A+B)-(az+bz)*(az+bz)-
98 (jbT.Dot(jbT)-jaT.Dot(jaT))*(jbT.Dot(jbT)-jaT.Dot(jaT))/(jaT+jbT).Mag2());
100 double mybeta = (jbT.Dot(jbT)-jaT.Dot(jaT))/
101 sqrt(ATBT*((A+B)*(A+B)-(az+bz)*(az+bz)));
103 double mygamma = 1./
sqrt(1.-mybeta*mybeta);
113 met.SetPtEtaPhi((inputMet->front()).pt(),0.0,(inputMet->front()).
phi());
115 std::vector<math::XYZTLorentzVector>::const_iterator muonIt;
116 for(muonIt = muons.begin(); muonIt!=muons.end(); muonIt++){
118 tmp.SetPtEtaPhi(muonIt->pt(),0,muonIt->phi());
122 double MTR =
sqrt(0.5*(met.Mag()*(ja.Pt()+jb.Pt()) - met.Dot(ja.Vect()+jb.Vect())));
125 return float(MTR)/float(MR);
RazorVarProducer(const edm::ParameterSet &)
#define DEFINE_FWK_MODULE(type)
double CalcR(double MR, TLorentzVector ja, TLorentzVector jb, edm::Handle< reco::CaloMETCollection > met, std::vector< math::XYZTLorentzVector > muons)
double CalcMR(TLorentzVector ja, TLorentzVector jb)
edm::InputTag inputMetTag_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
virtual void produce(edm::Event &, const edm::EventSetup &)
std::vector< std::vector< double > > tmp