CMS 3D CMS Logo

Public Member Functions | Protected Member Functions

PFTauDiscriminants::OutlierNCharged Class Reference

#include <Discriminants.h>

Inheritance diagram for PFTauDiscriminants::OutlierNCharged:
PFTauDiscriminants::DiscriminantBase< int > PFTauDiscriminants::Discriminant

List of all members.

Public Member Functions

 OutlierNCharged ()
 ~OutlierNCharged ()

Protected Member Functions

void doComputation (PFTauDiscriminantManager *input, std::vector< int > &result)

Detailed Description

Definition at line 44 of file Discriminants.h.


Constructor & Destructor Documentation

PFTauDiscriminants::OutlierNCharged::OutlierNCharged ( ) [inline]

Definition at line 46 of file Discriminants.h.

:DiscriminantBase<int>("OutlierNCharged", "I", true, false, -1){};
PFTauDiscriminants::OutlierNCharged::~OutlierNCharged ( ) [inline]

Definition at line 47 of file Discriminants.h.

{};

Member Function Documentation

void PFTauDiscriminants::OutlierNCharged::doComputation ( PFTauDiscriminantManager input,
std::vector< int > &  result 
) [protected, virtual]

Implements PFTauDiscriminants::DiscriminantBase< int >.

Definition at line 16 of file Discriminants.cc.

References reco::Candidate::charge(), PFTauDiscriminants::PFTauDiscriminantManager::outlierObjectsSortedByPt(), and convertSQLitetoXML_cfg::output.

{
   size_t output = 0;
   const std::vector<const reco::Candidate*>& theOutlierObjects = input->outlierObjectsSortedByPt();
   for(std::vector<const reco::Candidate*>::const_iterator iObject  = theOutlierObjects.begin();
         iObject != theOutlierObjects.end();
         ++iObject)
   {
      const reco::Candidate* currentObject = *iObject;
      if (currentObject && currentObject->charge() != 0 )
         output++;
   }
   // convert to int for TTree
   result.push_back(static_cast<int>(output));
}