CMS 3D CMS Logo

Static Public Member Functions

reco::modules::ParameterAdapter< helpers::MCTruthPairSelector< T > > Struct Template Reference

#include <MCTruthPairSelector.h>

List of all members.

Static Public Member Functions

static
helpers::MCTruthPairSelector
< T
make (const edm::ParameterSet &cfg)

Detailed Description

template<typename T>
struct reco::modules::ParameterAdapter< helpers::MCTruthPairSelector< T > >

Definition at line 44 of file MCTruthPairSelector.h.


Member Function Documentation

template<typename T >
static helpers::MCTruthPairSelector<T> reco::modules::ParameterAdapter< helpers::MCTruthPairSelector< T > >::make ( const edm::ParameterSet cfg) [inline, static]

Definition at line 45 of file MCTruthPairSelector.h.

References spr::find(), newFWLiteAna::found, and gen::vint.

                                                                               {
        const std::string matchPDGId( "matchPDGId" );
        const std::string checkCharge( "checkCharge" );
        bool ck = false;
        std::vector<std::string> bools = cfg.template getParameterNamesForType<bool>();
        bool found = find( bools.begin(), bools.end(), checkCharge ) != bools.end();
        if (found) ck = cfg.template getParameter<bool>( checkCharge ); 
        typedef std::vector<int> vint;
        std::vector<std::string> ints = cfg.template getParameterNamesForType<vint>();
        found = find( ints.begin(), ints.end(), matchPDGId ) != ints.end();
        if ( found ) {
          vint ids = cfg.template getParameter<vint>( matchPDGId );
          return helpers::MCTruthPairSelector<T>( ids.begin(), ids.end(), ck );
        } else {
          return helpers::MCTruthPairSelector<T>( ck );
        }
      }