Skip to content
Snippets Groups Projects
Commit 14922627 authored by Andrii Verbytskyi's avatar Andrii Verbytskyi Committed by Walter Lampl
Browse files

Merge FromWZ and FromTau into one function

Merge FromWZ and FromTau into one function
parent 90b2407c
No related branches found
No related tags found
No related merge requests found
......@@ -8,8 +8,7 @@
#include "GaudiKernel/ToolHandle.h"
namespace Common {
bool prompt( const xAOD::TruthParticle* part,ToolHandle<IMCTruthClassifier>& m_classif );
bool fromTau(const HepMC::ConstGenParticlePtr& part );
bool fromWZ(const HepMC::ConstGenParticlePtr& part );
bool fromWZorTau(const HepMC::ConstGenParticlePtr& part );
void classify(ToolHandle<IMCTruthClassifier>& m_classif,
const xAOD::TruthParticle * theParticle,
unsigned int& particleOutCome,
......
......@@ -33,7 +33,7 @@ bool prompt( const xAOD::TruthParticle* part,ToolHandle<IMCTruthClassifier>& cla
}
bool fromWZ(const HepMC::ConstGenParticlePtr& part )
static bool fromWZ(const HepMC::ConstGenParticlePtr& part )
{
// Loop through parents
// Hit a hadron -> return false
......@@ -63,7 +63,7 @@ bool fromWZ(const HepMC::ConstGenParticlePtr& part )
return false;
}
bool fromTau(const HepMC::ConstGenParticlePtr& part )
static bool fromTau(const HepMC::ConstGenParticlePtr& part )
{
// Loop through parents
// Find a tau -> return true
......@@ -88,7 +88,10 @@ bool fromTau(const HepMC::ConstGenParticlePtr& part )
#endif
return false;
}
bool fromWZorTau(const HepMC::ConstGenParticlePtr& part ) { return fromWZ(part)||fromTau(part); }
void classify(ToolHandle<IMCTruthClassifier>& classif,
const xAOD::TruthParticle * theParticle,
unsigned int& particleOutCome,
......
......@@ -122,15 +122,15 @@ return StatusCode::FAILURE;
if ( !iter ) continue;
int pdgid = iter->pdg_id();
if (m_UseNu && MC::isNeutrino(pdgid) && MC::isGenStable(iter)) {
if( Common::fromWZ(iter) || Common::fromTau(iter) ) {
if( Common::fromWZorTau(iter)) {
HT += iter->momentum().perp();
}
}
// pick muons and electrons specifically -- isLepton selects both charged leptons and neutrinos
if (m_UseLep && (std::abs(pdgid)==11 || std::abs(pdgid)==13) && MC::isGenStable(iter)
&& (iter)->momentum().perp()>m_MinLepPt*Gaudi::Units::GeV && std::abs(iter->momentum().eta())<m_MaxLepEta) {
bool isFromWZ = Common::fromWZ(iter);
if(isFromWZ || Common::fromTau(iter) ) {
if( Common::fromWZorTau(iter)) {
ATH_MSG_VERBOSE("Adding W/Z/tau lepton with pt " << iter->momentum().perp()
<< ", eta " << iter->momentum().eta()
<< ", phi " << iter->momentum().phi()
......
......@@ -35,9 +35,9 @@ return StatusCode::FAILURE;
if (!MC::isGenStable(pitr)) continue;
// Consider all non-interacting particles
// We want Missing Transverse Momentum, not "Missing Transverse Energy"
if (!MC::isInteracting(pitr->pdg_id()) || (m_useChargedNonShowering && MC::isChargedNonShowering(pitr->pdg_id()))) {
if (!MC::isInteracting(pitr) || (m_useChargedNonShowering && MC::isChargedNonShowering(pitr))) {
bool addpart = true;
if(!m_useHadronicNu && MC::isNeutrino(pitr->pdg_id()) && !(Common::fromWZ(pitr) || Common::fromTau(pitr)) ) {
if(!m_useHadronicNu && MC::isNeutrino(pitr) && !(Common::fromWZorTau(pitr)) ) {
addpart = false; // ignore neutrinos from hadron decays
}
if(addpart) {
......@@ -50,7 +50,7 @@ return StatusCode::FAILURE;
}
// Now see what the total missing Et is and compare to minimum
double met = std::sqrt(sumx*sumx + sumy*sumy);
double met = std::hypot(sumx,sumy);
ATH_MSG_DEBUG("Totals for event: EX = " << sumx << ", EY = "<< sumy << ", ET = " << met);
setFilterPassed(met >= m_METmin);
return StatusCode::SUCCESS;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment