#include <RazorVarProducer.h>
Public Member Functions | |
double | CalcMR (TLorentzVector ja, TLorentzVector jb) |
double | CalcR (double MR, TLorentzVector ja, TLorentzVector jb, edm::Handle< reco::CaloMETCollection > met, std::vector< math::XYZTLorentzVector > muons) |
virtual void | produce (edm::Event &, const edm::EventSetup &) |
RazorVarProducer (const edm::ParameterSet &) | |
~RazorVarProducer () | |
Private Attributes | |
edm::InputTag | inputMetTag_ |
edm::InputTag | inputTag_ |
Definition at line 13 of file RazorVarProducer.h.
RazorVarProducer::RazorVarProducer | ( | const edm::ParameterSet & | iConfig | ) | [explicit] |
Definition at line 26 of file RazorVarProducer.cc.
References edm::InputTag::encode(), inputMetTag_, inputTag_, and LogDebug.
: inputTag_ (iConfig.getParameter<edm::InputTag>("inputTag")), inputMetTag_ (iConfig.getParameter<edm::InputTag>("inputMetTag")){ produces<std::vector<double> >(); LogDebug("") << "Inputs: " << inputTag_.encode() << " " << inputMetTag_.encode() << "."; }
RazorVarProducer::~RazorVarProducer | ( | ) |
Definition at line 37 of file RazorVarProducer.cc.
{ }
double RazorVarProducer::CalcMR | ( | TLorentzVector | ja, |
TLorentzVector | jb | ||
) |
Definition at line 76 of file RazorVarProducer.cc.
References funct::A, mathSSE::sqrt(), and groupFilesInBlocks::temp.
Referenced by produce().
{ if(ja.Pt()<=0.1) return -1; ja.SetPtEtaPhiM(ja.Pt(),ja.Eta(),ja.Phi(),0.0); jb.SetPtEtaPhiM(jb.Pt(),jb.Eta(),jb.Phi(),0.0); if(ja.Pt() > jb.Pt()){ TLorentzVector temp = ja; ja = jb; jb = temp; } double A = ja.P(); double B = jb.P(); double az = ja.Pz(); double bz = jb.Pz(); TVector3 jaT, jbT; jaT.SetXYZ(ja.Px(),ja.Py(),0.0); jbT.SetXYZ(jb.Px(),jb.Py(),0.0); double ATBT = (jaT+jbT).Mag2(); double MR = sqrt((A+B)*(A+B)-(az+bz)*(az+bz)- (jbT.Dot(jbT)-jaT.Dot(jaT))*(jbT.Dot(jbT)-jaT.Dot(jaT))/(jaT+jbT).Mag2()); double mybeta = (jbT.Dot(jbT)-jaT.Dot(jaT))/ sqrt(ATBT*((A+B)*(A+B)-(az+bz)*(az+bz))); double mygamma = 1./sqrt(1.-mybeta*mybeta); //use gamma times MRstar return MR*mygamma; }
double RazorVarProducer::CalcR | ( | double | MR, |
TLorentzVector | ja, | ||
TLorentzVector | jb, | ||
edm::Handle< reco::CaloMETCollection > | met, | ||
std::vector< math::XYZTLorentzVector > | muons | ||
) |
Definition at line 110 of file RazorVarProducer.cc.
References CaloMET_cfi::met, phi, mathSSE::sqrt(), and tmp.
Referenced by produce().
{ //now we can calculate MTR TVector3 met; met.SetPtEtaPhi((inputMet->front()).pt(),0.0,(inputMet->front()).phi()); std::vector<math::XYZTLorentzVector>::const_iterator muonIt; for(muonIt = muons.begin(); muonIt!=muons.end(); muonIt++){ TVector3 tmp; tmp.SetPtEtaPhi(muonIt->pt(),0,muonIt->phi()); met-=tmp; } double MTR = sqrt(0.5*(met.Mag()*(ja.Pt()+jb.Pt()) - met.Dot(ja.Vect()+jb.Vect()))); //filter events return float(MTR)/float(MR); //R }
void RazorVarProducer::produce | ( | edm::Event & | iEvent, |
const edm::EventSetup & | iSetup | ||
) | [virtual] |
Implements edm::EDProducer.
Definition at line 43 of file RazorVarProducer.cc.
References CalcMR(), CalcR(), edm::Event::getByLabel(), inputMetTag_, inputTag_, edm::Event::put(), dttmaxenums::R, dt_dqm_sourceclient_common_cff::reco, and query::result.
{ using namespace std; using namespace edm; using namespace reco; // get hold of collection of objects Handle< vector<math::XYZTLorentzVector> > hemispheres; iEvent.getByLabel (inputTag_,hemispheres); // get hold of the MET Collection Handle<CaloMETCollection> inputMet; iEvent.getByLabel(inputMetTag_,inputMet); std::auto_ptr<std::vector<double> > result(new std::vector<double>); // check the the input collections are available if (hemispheres.isValid() && inputMet.isValid() && hemispheres->size() > 1){ TLorentzVector ja(hemispheres->at(0).x(),hemispheres->at(0).y(),hemispheres->at(0).z(),hemispheres->at(0).t()); TLorentzVector jb(hemispheres->at(1).x(),hemispheres->at(1).y(),hemispheres->at(1).z(),hemispheres->at(1).t()); std::vector<math::XYZTLorentzVector> muonVec; const double MR = CalcMR(ja,jb); const double R = CalcR(MR,ja,jb,inputMet,muonVec); result->push_back(MR); result->push_back(R); } iEvent.put(result); }
edm::InputTag RazorVarProducer::inputMetTag_ [private] |
Definition at line 25 of file RazorVarProducer.h.
Referenced by produce(), and RazorVarProducer().
edm::InputTag RazorVarProducer::inputTag_ [private] |
Definition at line 24 of file RazorVarProducer.h.
Referenced by produce(), and RazorVarProducer().