#include <AlphaTVarProducer.h>
Public Member Functions | |
AlphaTVarProducer (const edm::ParameterSet &) | |
virtual void | produce (edm::Event &, const edm::EventSetup &) |
~AlphaTVarProducer () | |
Private Member Functions | |
double | CalcAlphaT (std::vector< TLorentzVector >) |
Static Private Member Functions | |
static double | alphaT (const double, const double, const double) |
static double | CalcHT (const std::vector< TLorentzVector >) |
static double | CalcMHT (const std::vector< TLorentzVector >) |
static double | deltaHt (const std::vector< double > &) |
Private Attributes | |
edm::InputTag | inputJetTag_ |
Definition at line 15 of file AlphaTVarProducer.h.
AlphaTVarProducer::AlphaTVarProducer | ( | const edm::ParameterSet & | iConfig | ) | [explicit] |
Definition at line 26 of file AlphaTVarProducer.cc.
References edm::InputTag::encode(), inputJetTag_, and LogDebug.
: inputJetTag_ (iConfig.getParameter<edm::InputTag>("inputJetTag")){ produces<std::vector<double> >(); LogDebug("") << "Inputs: " << inputJetTag_.encode() << " "; }
AlphaTVarProducer::~AlphaTVarProducer | ( | ) |
Definition at line 35 of file AlphaTVarProducer.cc.
{ }
double AlphaTVarProducer::alphaT | ( | const double | HT, |
const double | DHT, | ||
const double | MHT | ||
) | [static, private] |
Definition at line 103 of file AlphaTVarProducer.cc.
References mathSSE::sqrt().
Referenced by CalcAlphaT(), and produce().
double AlphaTVarProducer::CalcAlphaT | ( | std::vector< TLorentzVector > | jets | ) | [private] |
Definition at line 72 of file AlphaTVarProducer.cc.
References alphaT(), CalcHT(), CalcMHT(), deltaHt(), reco::tau::disc::Eta(), and i.
Referenced by produce().
{ std::vector<double> ETs; TVector3 MHT = CalcMHT(jets); float HT = CalcHT(jets); //float HT = 0; for(unsigned int i = 0; i < jets.size(); i++){ if(jets[i].Et() > 50. && fabs(jets[i].Eta()) < 2.5) ETs.push_back(jets[i].Et()); //HT += jets[i].Et(); } if(ETs.size() < 2.) return 0.0; if(ETs.size() > 16.) return 0.0; float DHT = deltaHt(ETs); float AlphaT = alphaT(HT,DHT,MHT.Mag()); return AlphaT; }
double AlphaTVarProducer::CalcHT | ( | const std::vector< TLorentzVector > | jets | ) | [static, private] |
double AlphaTVarProducer::CalcMHT | ( | const std::vector< TLorentzVector > | jets | ) | [static, private] |
double AlphaTVarProducer::deltaHt | ( | const std::vector< double > & | ETs | ) | [static, private] |
Definition at line 91 of file AlphaTVarProducer.cc.
References diffTreeTool::diff, i, j, and min.
Referenced by CalcAlphaT().
{ if(ETs.size() > 16.) return 9999999; std::vector<double> diff( 1<<(ETs.size()-1) , 0. ); for(unsigned i=0; i < diff.size(); i++) for(unsigned j=0; j < ETs.size(); j++) diff[i] += ETs[j] * ( 1 - 2 * (int(i>>j)&1) ) ; std::vector<double>::const_iterator it; double min=9999999; for(it = diff.begin(); it !=diff.end(); it++) if(*it<min) min = *it; return min; }
void AlphaTVarProducer::produce | ( | edm::Event & | iEvent, |
const edm::EventSetup & | iSetup | ||
) | [virtual] |
Implements edm::EDProducer.
Definition at line 41 of file AlphaTVarProducer.cc.
References alphaT(), CalcAlphaT(), CalcHT(), edm::Event::getByLabel(), inputJetTag_, j, edm::Event::put(), L1Trigger_dataformats::reco, and query::result.
{ using namespace std; using namespace edm; using namespace reco; // get hold of collection of objects edm::Handle<reco::CaloJetCollection> calojet_handle; iEvent.getByLabel(inputJetTag_,calojet_handle); std::auto_ptr<std::vector<double> > result(new std::vector<double>); // check the the input collections are available if (calojet_handle.isValid()){ std::vector<TLorentzVector> myJets; reco::CaloJetCollection::const_iterator jetIt; for(jetIt = calojet_handle->begin(); jetIt != calojet_handle->end(); jetIt++){ TLorentzVector j; j.SetPtEtaPhiE(jetIt->pt(),jetIt->eta(), jetIt->phi(), jetIt->energy()); myJets.push_back(j); } double alphaT = CalcAlphaT(myJets); double HT = CalcHT(myJets); result->push_back(alphaT); result->push_back(HT); } iEvent.put(result); }
edm::InputTag AlphaTVarProducer::inputJetTag_ [private] |
Definition at line 29 of file AlphaTVarProducer.h.
Referenced by AlphaTVarProducer(), and produce().