#include <PFTauDiscriminantBase.h>
Public Types | |
typedef std::vector< T > ::const_iterator | myVectorIterator |
Public Member Functions | |
void | branchTree (TTree *theTree) |
add a branch to a ttree corresponding to this variable | |
void | compute (PFTauDiscriminantManager *input) |
DiscriminantBase (std::string name, std::string rootTypeName, bool branchAsSimpleDataType, bool isMultiple, T defaultValue) | |
void | fillMVA (std::vector< PhysicsTools::Variable::Value > &mvaHolder) const |
virtual void | setNullResult (PFTauDiscriminantManager *input) |
virtual | ~DiscriminantBase () |
Protected Member Functions | |
virtual void | doComputation (PFTauDiscriminantManager *input, std::vector< T > &result)=0 |
Private Attributes | |
T | defaultValue_ |
bool | isMultiple_ |
std::vector< T > | result_ |
std::vector< T > * | resultPtr_ |
T | singleResult_ |
Definition at line 69 of file PFTauDiscriminantBase.h.
typedef std::vector<T>::const_iterator PFTauDiscriminants::DiscriminantBase< T >::myVectorIterator |
Definition at line 76 of file PFTauDiscriminantBase.h.
PFTauDiscriminants::DiscriminantBase< T >::DiscriminantBase | ( | std::string | name, |
std::string | rootTypeName, | ||
bool | branchAsSimpleDataType, | ||
bool | isMultiple, | ||
T | defaultValue | ||
) | [inline, explicit] |
Definition at line 71 of file PFTauDiscriminantBase.h.
:Discriminant(name, rootTypeName, branchAsSimpleDataType),isMultiple_(isMultiple),defaultValue_(defaultValue){ resultPtr_ = &result_; };
virtual PFTauDiscriminants::DiscriminantBase< T >::~DiscriminantBase | ( | ) | [inline, virtual] |
Definition at line 76 of file PFTauDiscriminantBase.h.
{};
void PFTauDiscriminants::DiscriminantBase< T >::branchTree | ( | TTree * | theTree | ) | [inline, virtual] |
add a branch to a ttree corresponding to this variable
Implements PFTauDiscriminants::Discriminant.
Definition at line 111 of file PFTauDiscriminantBase.h.
{ if (!this->branchSimply()) { edm::LogInfo("PFTauDiscriminantBase") << "Branching TTree: " << theTree->GetName() << " with full class name (bronch)"; theTree->Branch(name().c_str(), rootTypeName().c_str(), &resultPtr_); } else { edm::LogInfo("PFTauDiscriminantBase") << "Branching TTree: " << theTree->GetName() << " with struct style branch (leaflist)"; std::stringstream branchType; branchType << name() << "/" << rootTypeName(); //eg D, F, I, etc theTree->Branch(this->name().c_str(), &singleResult_, branchType.str().c_str()); } }
void PFTauDiscriminants::DiscriminantBase< T >::compute | ( | PFTauDiscriminantManager * | input | ) | [inline, virtual] |
computes the associated quanity for the tau object that is loaded in the PFTauDiscriminantManager implemented in derived implementation class
Implements PFTauDiscriminants::Discriminant.
Definition at line 87 of file PFTauDiscriminantBase.h.
{ result_.clear(); if (input) doComputation(input, result_); else edm::LogError("DiscriminantBase") << "Error in DiscriminantBase - trying to compute discriminants on null PFTauDecayMode pointer!"; size_t numberOfResultsReturned = result_.size(); if(!numberOfResultsReturned) //if there are no results, ROOT branches of simple variables must be filled w/ the default value { singleResult_ = defaultValue_; } else { if(!isMultiple_ && numberOfResultsReturned > 1) { edm::LogWarning("PFTauDiscriminants::DiscriminantBase") << "Warning, multiple discriminant values recieved for a non-multiple branch, taking only the first!"; } singleResult_ = result_[0]; } }
virtual void PFTauDiscriminants::DiscriminantBase< T >::doComputation | ( | PFTauDiscriminantManager * | input, |
std::vector< T > & | result | ||
) | [protected, pure virtual] |
Implemented in PFTauDiscriminants::DecayMode, PFTauDiscriminants::OutlierNCharged, PFTauDiscriminants::OutlierN, PFTauDiscriminants::Pt, PFTauDiscriminants::Eta, PFTauDiscriminants::MainTrackPt, PFTauDiscriminants::MainTrackAngle, PFTauDiscriminants::TrackPt, PFTauDiscriminants::PiZeroPt, PFTauDiscriminants::FilteredObjectPt, PFTauDiscriminants::GammaOccupancy, PFTauDiscriminants::GammaPt, PFTauDiscriminants::TrackAngle, PFTauDiscriminants::PiZeroAngle, PFTauDiscriminants::Dalitz, PFTauDiscriminants::InvariantMassOfSignal, PFTauDiscriminants::InvariantMassOfSignalWithFiltered, PFTauDiscriminants::InvariantMass, PFTauDiscriminants::OutlierPt, PFTauDiscriminants::OutlierSumPt, PFTauDiscriminants::OutlierMass, PFTauDiscriminants::OutlierAngle, PFTauDiscriminants::ChargedOutlierPt, PFTauDiscriminants::ChargedOutlierSumPt, PFTauDiscriminants::ChargedOutlierAngle, PFTauDiscriminants::NeutralOutlierPt, PFTauDiscriminants::NeutralOutlierSumPt, and PFTauDiscriminants::NeutralOutlierAngle.
Referenced by PFTauDiscriminants::DiscriminantBase< int >::compute().
void PFTauDiscriminants::DiscriminantBase< T >::fillMVA | ( | std::vector< PhysicsTools::Variable::Value > & | mvaHolder | ) | const [inline, virtual] |
Implements PFTauDiscriminants::Discriminant.
Definition at line 126 of file PFTauDiscriminantBase.h.
{ if (isMultiple_) { for(myVectorIterator aResult = result_.begin(); aResult != result_.end(); ++aResult) { mvaHolder.push_back(PhysicsTools::Variable::Value(theAtomicId(), static_cast<double>(*aResult))); } } else { mvaHolder.push_back(PhysicsTools::Variable::Value(theAtomicId(), static_cast<double>(singleResult_))); } }
virtual void PFTauDiscriminants::DiscriminantBase< T >::setNullResult | ( | PFTauDiscriminantManager * | input | ) | [inline, virtual] |
Implements PFTauDiscriminants::Discriminant.
Definition at line 79 of file PFTauDiscriminantBase.h.
{ result_.clear(); singleResult_ = defaultValue_; }
T PFTauDiscriminants::DiscriminantBase< T >::defaultValue_ [private] |
Definition at line 144 of file PFTauDiscriminantBase.h.
Referenced by PFTauDiscriminants::DiscriminantBase< int >::compute(), and PFTauDiscriminants::DiscriminantBase< int >::setNullResult().
bool PFTauDiscriminants::DiscriminantBase< T >::isMultiple_ [private] |
Definition at line 143 of file PFTauDiscriminantBase.h.
Referenced by PFTauDiscriminants::DiscriminantBase< int >::compute(), and PFTauDiscriminants::DiscriminantBase< int >::fillMVA().
std::vector<T> PFTauDiscriminants::DiscriminantBase< T >::result_ [private] |
Definition at line 146 of file PFTauDiscriminantBase.h.
Referenced by PFTauDiscriminants::DiscriminantBase< int >::compute(), PFTauDiscriminants::DiscriminantBase< int >::DiscriminantBase(), PFTauDiscriminants::DiscriminantBase< int >::fillMVA(), and PFTauDiscriminants::DiscriminantBase< int >::setNullResult().
std::vector<T>* PFTauDiscriminants::DiscriminantBase< T >::resultPtr_ [private] |
Definition at line 147 of file PFTauDiscriminantBase.h.
Referenced by PFTauDiscriminants::DiscriminantBase< int >::branchTree(), and PFTauDiscriminants::DiscriminantBase< int >::DiscriminantBase().
T PFTauDiscriminants::DiscriminantBase< T >::singleResult_ [private] |
Definition at line 145 of file PFTauDiscriminantBase.h.
Referenced by PFTauDiscriminants::DiscriminantBase< int >::branchTree(), PFTauDiscriminants::DiscriminantBase< int >::compute(), PFTauDiscriminants::DiscriminantBase< int >::fillMVA(), and PFTauDiscriminants::DiscriminantBase< int >::setNullResult().