ATLAS Offline Software
Loading...
Searching...
No Matches
AnalysisUtils::Classify Namespace Reference

classify More...

Functions

template<class COLL>
void charge (COLL *coll, std::vector< typename COLL::value_type > &pos, std::vector< typename COLL::value_type > &neg)
 classify by charge

Detailed Description

classify

Function Documentation

◆ charge()

template<class COLL>
void AnalysisUtils::Classify::charge ( COLL * coll,
std::vector< typename COLL::value_type > & pos,
std::vector< typename COLL::value_type > & neg )
inline

classify by charge

Parameters
COLL[in] type of collection
coll[in] pointer to collection
pos[out] collection of positives
neg[out] collection of nagatives

Definition at line 365 of file AnalysisMisc.h.

368 {
369 pos.clear();
370 neg.clear();
371
372 // classify
373 typename COLL::const_iterator it = coll->begin();
374 typename COLL::const_iterator itE = coll->end();
375 for (; it != itE; ++it)
376 {
377 if ((*it)->pdgId() > 0)
378 pos.push_back(*it);
379 else if ((*it)->pdgId() < 0)
380 neg.push_back(*it);
381 }
382 }