Created
November 17, 2010 10:26
-
-
Save mazurov/703233 to your computer and use it in GitHub Desktop.
HltCandidatesNoTmpl.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ======================================================================== | |
/** @class | |
* simple functor which filter Hlt::Candidates by some stage condition | |
* @see Hlt::Candidate | |
* @see Hlt::Track | |
* @author [email protected] | |
* @date 2010-10-01 | |
*/ | |
class StageSlotFilter : | |
public LoKi::BasicFunctors<const Hlt::Candidate*>::Pipe | |
{ | |
// ================================================================== | |
public: | |
// ================================================================== | |
/// constructor from the selection | |
StageSlotFilter(const | |
LoKi::BasicFunctors<const LHCb::L0MuonCandidate*>::Predicate& cut, | |
int position = -1 ); | |
StageSlotFilter(const | |
LoKi::BasicFunctors<const LHCb::L0CaloCandidate*>::Predicate& cut, | |
int position = -1 | |
); | |
StageSlotFilter(const | |
LoKi::BasicFunctors<const LHCb::Track*>::Predicate& cut, | |
int position = -1); | |
StageSlotFilter(const | |
LoKi::BasicFunctors<const Hlt::MultiTrack*>::Predicate& cut, | |
int position = -1); | |
StageSlotFilter(const | |
LoKi::BasicFunctors<const Hlt::Stage*>::Predicate& cut, | |
int position = -1); | |
StageSlotFilter(const | |
LoKi::BasicFunctors<const LHCb::RecVertex*>::Predicate& cut, | |
int position = -1); | |
/// MANDATORY: virtual destructor | |
virtual ~StageSlotFilter () {} | |
/// MANDATORY: clone method ("virtual constructor") | |
virtual StageSlotFilter* clone() const | |
{ return new StageSlotFilter (*this) ; } | |
/// MANDATORY: the only one essential method | |
virtual result_type operator() ( argument a ) const ; | |
/// OPTIONAL: the nice printout | |
virtual std::ostream& fillStream ( std::ostream& s ) const ; | |
// ================================================================== | |
public: | |
// ================================================================== | |
// ================================================================== | |
private: | |
// ================================================================== | |
/// default constructor is disabled | |
StageSlotFilter (); | |
// ================================================================== | |
private: | |
// ===============b================================================== | |
LoKi::FunctorFromFunctor<const LHCb::L0MuonCandidate*, bool> m_l0mc_cut; | |
LoKi::FunctorFromFunctor<const LHCb::L0CaloCandidate*, bool> m_l0cc_cut; | |
LoKi::FunctorFromFunctor<const LHCb::Track*, bool> m_t_cut; | |
LoKi::FunctorFromFunctor<const Hlt::MultiTrack*, bool> m_mt_cut; | |
LoKi::FunctorFromFunctor<const Hlt::Stage*, bool> m_s_cut; | |
LoKi::FunctorFromFunctor<const LHCb::RecVertex*, bool> m_rv_cut; | |
bool m_is_l0mc_cut; | |
bool m_is_l0cc_cut; | |
bool m_is_t_cut; | |
bool m_is_mt_cut; | |
bool m_is_s_cut; | |
bool m_is_rv_cut; | |
int m_position; | |
// ================================================================== | |
}; | |
// ======================================================================== | |
/** @class | |
* simple functor which filter Hlt::Candidates by some stage condition | |
* @see Hlt::Candidate | |
* @see Hlt::Track | |
* @author [email protected] | |
* @date 2010-10-01 | |
*/ | |
class StageSlotMap : | |
public LoKi::BasicFunctors<const Hlt::Candidate*>::Map | |
{ | |
// ================================================================== | |
public: | |
// ================================================================== | |
/// constructor from the selection | |
StageSlotMap(const | |
LoKi::BasicFunctors<const LHCb::L0MuonCandidate*>::Function& cut, | |
int position = -1 ); | |
StageSlotMap(const | |
LoKi::BasicFunctors<const LHCb::L0CaloCandidate*>::Function& cut, | |
int position = -1); | |
StageSlotMap(const | |
LoKi::BasicFunctors<const LHCb::Track*>::Function& cut, | |
int position = -1); | |
StageSlotMap(const | |
LoKi::BasicFunctors<const Hlt::MultiTrack*>::Function& cut, | |
int position = -1); | |
StageSlotMap(const | |
LoKi::BasicFunctors<const Hlt::Stage*>::Function& cut, | |
int position = -1); | |
StageSlotMap(const | |
LoKi::BasicFunctors<const LHCb::RecVertex*>::Function& cut, | |
int position = -1); | |
/// MANDATORY: virtual destructor | |
virtual ~StageSlotMap () {} | |
/// MANDATORY: clone method ("virtual constructor") | |
virtual StageSlotMap* clone() const | |
{ return new StageSlotMap (*this) ; } | |
/// MANDATORY: the only one essential method | |
virtual result_type operator() ( argument a ) const ; | |
/// OPTIONAL: the nice printout | |
virtual std::ostream& fillStream ( std::ostream& s ) const ; | |
// ================================================================== | |
public: | |
// ================================================================== | |
private: | |
// ================================================================== | |
/// default constructor is disabled | |
StageSlotMap (); | |
// ================================================================== | |
private: | |
// ===============b================================================== | |
LoKi::FunctorFromFunctor<const LHCb::L0MuonCandidate*, double> m_l0mc_cut; | |
LoKi::FunctorFromFunctor<const LHCb::L0CaloCandidate*, double> m_l0cc_cut; | |
LoKi::FunctorFromFunctor<const LHCb::Track*, double> m_t_cut; | |
LoKi::FunctorFromFunctor<const Hlt::MultiTrack*, double> m_mt_cut; | |
LoKi::FunctorFromFunctor<const Hlt::Stage*, double> m_s_cut; | |
LoKi::FunctorFromFunctor<const LHCb::RecVertex*, double> m_rv_cut; | |
bool m_is_l0mc_cut; | |
bool m_is_l0cc_cut; | |
bool m_is_t_cut; | |
bool m_is_mt_cut; | |
bool m_is_s_cut; | |
bool m_is_rv_cut; | |
int m_position; | |
// ================================================================== | |
}; | |
} // end of namespace LoKi::Candidates | |
// ========================================================================== | |
} // end of namespace LoKi | |
// ============================================================================ | |
template <class TYPE,class TYPE1> inline | |
typename boost::disable_if<boost::is_same<TYPE1,Hlt::Candidate::ConstVector> , | |
LoKi::FunctorFromFunctor<TYPE, Hlt::Candidate::ConstVector> >::type | |
operator >> ( const LoKi::Functor<TYPE, Hlt::Candidate::ConstVector>& left , | |
const LoKi::Functor<TYPE1,bool>& right ) | |
{ | |
return left >> LoKi::Candidates::StageSlotFilter( right ); | |
} | |
template <class TYPE,class TYPE1> inline | |
typename boost::disable_if<boost::is_same<TYPE1,Hlt::Candidate::ConstVector> , | |
LoKi::FunctorFromFunctor<TYPE, std::vector<double> > >::type | |
operator >> ( const LoKi::Functor<TYPE, Hlt::Candidate::ConstVector>& left , | |
const LoKi::Functor<TYPE1,double>& right ) | |
{ | |
return left >> LoKi::Candidates::StageSlotMap( right ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typedef | |
LoKi::BasicFunctors<const LHCb::L0MuonCandidate*>::BooleanConstant | |
BoolL0Mc; | |
typedef | |
LoKi::BasicFunctors<const LHCb::L0CaloCandidate*>::BooleanConstant | |
BoolL0Cc; | |
typedef | |
LoKi::BasicFunctors<const LHCb::Track*>::BooleanConstant | |
BoolT; | |
typedef | |
LoKi::BasicFunctors<const Hlt::MultiTrack*>::BooleanConstant | |
BoolMt; | |
typedef | |
LoKi::BasicFunctors<const Hlt::Stage*>::BooleanConstant | |
BoolS; | |
typedef | |
LoKi::BasicFunctors<const LHCb::RecVertex*>::BooleanConstant | |
BoolRv; | |
// ============================================================================ | |
// constructors | |
// ============================================================================ | |
LoKi::Candidates::StageSlotFilter::StageSlotFilter(const | |
LoKi::BasicFunctors<const LHCb::L0MuonCandidate*>::Predicate& cut, | |
int position) | |
: LoKi::BasicFunctors<const Hlt::Candidate*>::Pipe (), | |
m_l0mc_cut(cut), | |
m_l0cc_cut(BoolL0Cc(false)), | |
m_t_cut(BoolT(false)), | |
m_mt_cut(BoolMt(false)), | |
m_s_cut(BoolS(false)), | |
m_rv_cut(BoolRv(false)), | |
m_is_l0mc_cut(true), | |
m_is_l0cc_cut(false), | |
m_is_t_cut(false), | |
m_is_mt_cut(false), | |
m_is_s_cut(false), | |
m_is_rv_cut(false), | |
m_position(position) { } | |
LoKi::Candidates::StageSlotFilter::StageSlotFilter(const | |
LoKi::BasicFunctors<const LHCb::L0CaloCandidate*>::Predicate& cut, | |
int position | |
) | |
: LoKi::BasicFunctors<const Hlt::Candidate*>::Pipe (), | |
m_l0mc_cut(BoolL0Mc(false)), | |
m_l0cc_cut(cut), | |
m_t_cut(BoolT(false)), | |
m_mt_cut(BoolMt(false)), | |
m_s_cut(BoolS(false)), | |
m_rv_cut(BoolRv(false)), | |
m_is_l0mc_cut(false), | |
m_is_l0cc_cut(true), | |
m_is_t_cut(false), | |
m_is_mt_cut(false), | |
m_is_s_cut(false), | |
m_is_rv_cut(false), | |
m_position(position) { } | |
LoKi::Candidates::StageSlotFilter::StageSlotFilter(const | |
LoKi::BasicFunctors<const LHCb::Track*>::Predicate& cut, | |
int position) | |
: LoKi::BasicFunctors<const Hlt::Candidate*>::Pipe (), | |
m_l0mc_cut(BoolL0Mc(false)), | |
m_l0cc_cut(BoolL0Cc(false)), | |
m_t_cut(cut), | |
m_mt_cut(BoolMt(false)), | |
m_s_cut(BoolS(false)), | |
m_rv_cut(BoolRv(false)), | |
m_is_l0mc_cut(false), | |
m_is_l0cc_cut(false), | |
m_is_t_cut(true), | |
m_is_mt_cut(false), | |
m_is_s_cut(false), | |
m_is_rv_cut(false), | |
m_position(position){} | |
LoKi::Candidates::StageSlotFilter::StageSlotFilter(const | |
LoKi::BasicFunctors<const Hlt::MultiTrack*>::Predicate& cut, | |
int position) | |
: LoKi::BasicFunctors<const Hlt::Candidate*>::Pipe (), | |
m_l0mc_cut(BoolL0Mc(false)), | |
m_l0cc_cut(BoolL0Cc(false)), | |
m_t_cut(BoolT(false)), | |
m_mt_cut(cut), | |
m_s_cut(BoolS(false)), | |
m_rv_cut(BoolRv(false)), | |
m_is_l0mc_cut(false), | |
m_is_l0cc_cut(false), | |
m_is_t_cut(false), | |
m_is_mt_cut(true), | |
m_is_s_cut(false), | |
m_is_rv_cut(false), | |
m_position(position){} | |
LoKi::Candidates::StageSlotFilter::StageSlotFilter(const | |
LoKi::BasicFunctors<const Hlt::Stage*>::Predicate& cut, | |
int position) | |
: LoKi::BasicFunctors<const Hlt::Candidate*>::Pipe (), | |
m_l0mc_cut(BoolL0Mc(false)), | |
m_l0cc_cut(BoolL0Cc(false)), | |
m_t_cut(BoolT(false)), | |
m_mt_cut(BoolMt(false)), | |
m_s_cut(cut), | |
m_rv_cut(BoolRv(false)), | |
m_is_l0mc_cut(false), | |
m_is_l0cc_cut(false), | |
m_is_t_cut(false), | |
m_is_mt_cut(false), | |
m_is_s_cut(true), | |
m_is_rv_cut(false), | |
m_position(position){} | |
LoKi::Candidates::StageSlotFilter::StageSlotFilter(const | |
LoKi::BasicFunctors<const LHCb::RecVertex*>::Predicate& cut, | |
int position) | |
: LoKi::BasicFunctors<const Hlt::Candidate*>::Pipe (), | |
m_l0mc_cut(BoolL0Mc(false)), | |
m_l0cc_cut(BoolL0Cc(false)), | |
m_t_cut(BoolT(false)), | |
m_mt_cut(BoolMt(false)), | |
m_s_cut(BoolS(false)), | |
m_rv_cut(cut), | |
m_is_l0mc_cut(false), | |
m_is_l0cc_cut(false), | |
m_is_t_cut(false), | |
m_is_mt_cut(false), | |
m_is_s_cut(false), | |
m_is_rv_cut(true), | |
m_position(position){} | |
// ======================================================================== | |
// MANDATORY: the only one essential method | |
// ======================================================================== | |
inline LoKi::Candidates::StageSlotFilter::result_type | |
LoKi::Candidates::StageSlotFilter::operator() | |
( LoKi::Candidates::StageSlotFilter::argument a ) const | |
{ | |
typedef | |
LoKi::Candidates::StageSlotFilter::argument_type ARGUMENT; | |
typedef | |
LoKi::Candidates::StageSlotFilter::result_type RESULT; | |
RESULT result; | |
// Loop over candidates | |
for ( ARGUMENT::const_iterator | |
cur = a.begin(); cur != a.end(); cur++){ | |
const SmartRefVector<Hlt::Stage>& stages = (*cur)->stages() ; | |
int pos = m_position < 0 ?stages.size()-1:m_position; | |
if ((pos < 0) || (pos >= int(stages.size()))) continue; | |
const Hlt::Stage* stage = stages[pos]; | |
if (NULL == stage) continue; | |
// LHCb::L0MuonCandidate | |
if (m_is_l0mc_cut) { | |
if (!stage->is<LHCb::L0MuonCandidate>()) continue; | |
if (m_l0mc_cut(stage->get<LHCb::L0MuonCandidate>())){ | |
result.push_back(*cur); | |
} | |
continue; | |
} | |
// LHCb::L0CaloCandidate | |
if (m_is_l0cc_cut) { | |
if (!stage->is<LHCb::L0CaloCandidate>()) continue; | |
if (m_l0cc_cut(stage->get<LHCb::L0CaloCandidate>())){ | |
result.push_back(*cur); | |
} | |
continue; | |
} | |
// LHCb::Track | |
if (m_is_t_cut) { | |
if (!stage->is<LHCb::Track>()) continue; | |
if (m_t_cut(stage->get<LHCb::Track>())){ | |
result.push_back(*cur); | |
} | |
continue; | |
} | |
// Hlt::MultiTrack | |
if (m_is_mt_cut) { | |
if (!stage->is<Hlt::MultiTrack>()) continue; | |
if (m_mt_cut(stage->get<Hlt::MultiTrack>())){ | |
result.push_back(*cur); | |
} | |
continue; | |
} | |
// Hlt::Stage | |
if (m_is_s_cut) { | |
if (!stage->is<Hlt::Stage>()) continue; | |
if (m_s_cut(stage->get<Hlt::Stage>())){ | |
result.push_back(*cur); | |
} | |
continue; | |
} | |
// LHCb::RecVertex | |
if (m_is_rv_cut) { | |
if (!stage->is<LHCb::RecVertex>()) continue; | |
if (m_rv_cut(stage->get<LHCb::RecVertex>())){ | |
result.push_back(*cur); | |
} | |
continue; | |
} | |
}// end for | |
return result; | |
} | |
// ======================================================================== | |
// OPTIONAL: the nice printout | |
// ======================================================================== | |
std::ostream& LoKi::Candidates::StageSlotFilter::fillStream | |
( std::ostream& s ) const | |
{ | |
s << "TC_FILTER("; | |
if (m_is_l0mc_cut) s << m_l0mc_cut.objType(); | |
if (m_is_l0cc_cut) s << m_l0cc_cut.objType(); | |
if (m_is_t_cut) s << m_t_cut.objType(); | |
if (m_is_mt_cut) s << m_mt_cut.objType(); | |
if (m_is_s_cut) s << m_s_cut.objType(); | |
if (m_is_rv_cut) s << m_rv_cut.objType(); | |
s << ")"; | |
return s; | |
} | |
typedef | |
LoKi::BasicFunctors<const LHCb::L0MuonCandidate*>::Constant | |
DoubleL0Mc; | |
typedef | |
LoKi::BasicFunctors<const LHCb::L0CaloCandidate*>::Constant | |
DoubleL0Cc; | |
typedef | |
LoKi::BasicFunctors<const LHCb::Track*>::Constant | |
DoubleT; | |
typedef | |
LoKi::BasicFunctors<const Hlt::MultiTrack*>::Constant | |
DoubleMt; | |
typedef | |
LoKi::BasicFunctors<const Hlt::Stage*>::Constant | |
DoubleS; | |
typedef | |
LoKi::BasicFunctors<const LHCb::RecVertex*>::Constant | |
DoubleRv; | |
// ================================================================== | |
/// constructor from the selection | |
LoKi::Candidates::StageSlotMap::StageSlotMap(const | |
LoKi::BasicFunctors<const LHCb::L0MuonCandidate*>::Function& cut, | |
int position) | |
: LoKi::BasicFunctors<const Hlt::Candidate*>::Map (), | |
m_l0mc_cut(cut), | |
m_l0cc_cut(DoubleL0Cc(false)), | |
m_t_cut(DoubleT(false)), | |
m_mt_cut(DoubleMt(false)), | |
m_s_cut(DoubleS(false)), | |
m_rv_cut(DoubleRv(false)), | |
m_is_l0mc_cut(true), | |
m_is_l0cc_cut(false), | |
m_is_t_cut(false), | |
m_is_mt_cut(false), | |
m_is_s_cut(false), | |
m_is_rv_cut(false), | |
m_position(position) { } | |
LoKi::Candidates::StageSlotMap::StageSlotMap(const | |
LoKi::BasicFunctors<const LHCb::L0CaloCandidate*>::Function& cut, | |
int position) | |
: LoKi::BasicFunctors<const Hlt::Candidate*>::Map (), | |
m_l0mc_cut(DoubleL0Mc(false)), | |
m_l0cc_cut(cut), | |
m_t_cut(DoubleT(false)), | |
m_mt_cut(DoubleMt(false)), | |
m_s_cut(DoubleS(false)), | |
m_rv_cut(DoubleRv(false)), | |
m_is_l0mc_cut(false), | |
m_is_l0cc_cut(true), | |
m_is_t_cut(false), | |
m_is_mt_cut(false), | |
m_is_s_cut(false), | |
m_is_rv_cut(false), | |
m_position(position) { } | |
LoKi::Candidates::StageSlotMap::StageSlotMap(const | |
LoKi::BasicFunctors<const LHCb::Track*>::Function& cut, | |
int position) | |
: LoKi::BasicFunctors<const Hlt::Candidate*>::Map (), | |
m_l0mc_cut(DoubleL0Mc(false)), | |
m_l0cc_cut(DoubleL0Cc(false)), | |
m_t_cut(cut), | |
m_mt_cut(DoubleMt(false)), | |
m_s_cut(DoubleS(false)), | |
m_rv_cut(DoubleRv(false)), | |
m_is_l0mc_cut(false), | |
m_is_l0cc_cut(false), | |
m_is_t_cut(true), | |
m_is_mt_cut(false), | |
m_is_s_cut(false), | |
m_is_rv_cut(false), | |
m_position(position){} | |
LoKi::Candidates::StageSlotMap::StageSlotMap(const | |
LoKi::BasicFunctors<const Hlt::MultiTrack*>::Function& cut, | |
int position) | |
: LoKi::BasicFunctors<const Hlt::Candidate*>::Map (), | |
m_l0mc_cut(DoubleL0Mc(false)), | |
m_l0cc_cut(DoubleL0Cc(false)), | |
m_t_cut(DoubleT(false)), | |
m_mt_cut(cut), | |
m_s_cut(DoubleS(false)), | |
m_rv_cut(DoubleRv(false)), | |
m_is_l0mc_cut(false), | |
m_is_l0cc_cut(false), | |
m_is_t_cut(false), | |
m_is_mt_cut(true), | |
m_is_s_cut(false), | |
m_is_rv_cut(false), | |
m_position(position){} | |
LoKi::Candidates::StageSlotMap::StageSlotMap(const | |
LoKi::BasicFunctors<const Hlt::Stage*>::Function& cut, | |
int position) | |
: LoKi::BasicFunctors<const Hlt::Candidate*>::Map (), | |
m_l0mc_cut(DoubleL0Mc(false)), | |
m_l0cc_cut(DoubleL0Cc(false)), | |
m_t_cut(DoubleT(false)), | |
m_mt_cut(DoubleMt(false)), | |
m_s_cut(cut), | |
m_rv_cut(DoubleRv(false)), | |
m_is_l0mc_cut(false), | |
m_is_l0cc_cut(false), | |
m_is_t_cut(false), | |
m_is_mt_cut(false), | |
m_is_s_cut(true), | |
m_is_rv_cut(false), | |
m_position(position){} | |
LoKi::Candidates::StageSlotMap::StageSlotMap(const | |
LoKi::BasicFunctors<const LHCb::RecVertex*>::Function& cut, | |
int position) | |
: LoKi::BasicFunctors<const Hlt::Candidate*>::Map (), | |
m_l0mc_cut(DoubleL0Mc(false)), | |
m_l0cc_cut(DoubleL0Cc(false)), | |
m_t_cut(DoubleT(false)), | |
m_mt_cut(DoubleMt(false)), | |
m_s_cut(DoubleS(false)), | |
m_rv_cut(cut), | |
m_is_l0mc_cut(false), | |
m_is_l0cc_cut(false), | |
m_is_t_cut(false), | |
m_is_mt_cut(false), | |
m_is_s_cut(false), | |
m_is_rv_cut(true), | |
m_position(position){} | |
// ======================================================================== | |
// MANDATORY: the only one essential method | |
// ======================================================================== | |
LoKi::Candidates::StageSlotMap::result_type | |
LoKi::Candidates::StageSlotMap::operator() | |
( LoKi::Candidates::StageSlotMap::argument a ) const | |
{ | |
typedef LoKi::Candidates::StageSlotMap::argument_type ARGUMENT; | |
typedef LoKi::Candidates::StageSlotMap::result_type RESULT; | |
RESULT result; | |
// Loop over candidates | |
for (ARGUMENT::const_iterator cur = a.begin(); cur != a.end(); cur++){ | |
const SmartRefVector<Hlt::Stage>& stages = (*cur)->stages() ; | |
int pos = m_position < 0 ?stages.size()-1:m_position; | |
if ((pos < 0) || (pos >= int(stages.size()))) continue; | |
const Hlt::Stage* stage = stages[pos]; | |
if (NULL == stage) continue; | |
// LHCb::L0MuonCandidate | |
if (m_is_l0mc_cut) { | |
if (!stage->is<LHCb::L0MuonCandidate>()) continue; | |
result.push_back(m_l0mc_cut(stage->get<LHCb::L0MuonCandidate>())); | |
continue; | |
} | |
// LHCb::L0CaloCandidate | |
if (m_is_l0cc_cut) { | |
if (!stage->is<LHCb::L0CaloCandidate>()) continue; | |
result.push_back(m_l0cc_cut(stage->get<LHCb::L0CaloCandidate>())); | |
continue; | |
} | |
// LHCb::Track | |
if (m_is_t_cut) { | |
if (!stage->is<LHCb::Track>()) continue; | |
result.push_back(m_t_cut(stage->get<LHCb::Track>())); | |
continue; | |
} | |
// Hlt::MultiTrack | |
if (m_is_mt_cut) { | |
if (!stage->is<Hlt::MultiTrack>()) continue; | |
result.push_back(m_mt_cut(stage->get<Hlt::MultiTrack>())); | |
continue; | |
} | |
// Hlt::Stage | |
if (m_is_s_cut) { | |
if (!stage->is<Hlt::Stage>()) continue; | |
result.push_back(m_s_cut(stage->get<Hlt::Stage>())); | |
continue; | |
} | |
// LHCb::RecVertex | |
if (m_is_rv_cut) { | |
if (!stage->is<LHCb::RecVertex>()) continue; | |
result.push_back(m_rv_cut(stage->get<LHCb::RecVertex>())); | |
continue; | |
} | |
}// end for | |
return result; | |
} | |
// ======================================================================== | |
// OPTIONAL: the nice printout | |
// ======================================================================== | |
std::ostream& LoKi::Candidates::StageSlotMap::fillStream | |
( std::ostream& s ) const | |
{ | |
s << "TC_MAP("; | |
if (m_is_l0mc_cut) s << m_l0mc_cut.objType(); | |
if (m_is_l0cc_cut) s << m_l0cc_cut.objType(); | |
if (m_is_t_cut) s << m_t_cut.objType(); | |
if (m_is_mt_cut) s << m_mt_cut.objType(); | |
if (m_is_s_cut) s << m_s_cut.objType(); | |
if (m_is_rv_cut) s << m_rv_cut.objType(); | |
s << ")"; | |
return s; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct TestStruct1 {int a;}; | |
struct TestStruct2 {int a;}; | |
struct TestStruct3 {int a;}; | |
struct TestStruct4 {int a;}; | |
struct TestStruct5 {int a;}; | |
struct TestStruct6 {int a;}; | |
struct TestStruct7 {int a;}; | |
struct TestStruct8 {int a;}; | |
struct TestStruct9 {int a;}; | |
struct TestStruct10 {int a;}; | |
struct TestStruct11 {int a;}; | |
struct TestStruct12 {int a;}; | |
struct TestStruct13 {int a;}; | |
struct TestStruct14 {int a;}; | |
struct TestStruct15 {int a;}; | |
struct TestStruct16 {int a;}; | |
class TestOverloadsLeft | |
{ | |
int a; | |
}; | |
template<typename T> | |
class TestOverloadsParent | |
{ | |
public: | |
virtual int result() const = 0; | |
}; | |
template <typename T> | |
class TestOverloads : public TestOverloadsParent<T> { | |
public: | |
int a; | |
virtual int result() const { return 0;} | |
}; | |
class TestOverloadsShifts | |
{ | |
public: | |
static int __rshift__(const TestOverloadsLeft& left, const TestOverloadsParent<TestStruct1>& right) { | |
return 1; | |
} | |
static int __rshift__(const TestOverloadsLeft& left, const TestOverloadsParent<TestStruct2>& right) { | |
return 2; | |
} | |
static int __rshift__(const TestOverloadsLeft& left, const TestOverloadsParent<TestStruct3>& right) { | |
return 3; | |
} | |
static int __rshift__(const TestOverloadsLeft& left, const TestOverloadsParent<TestStruct4>& right) { | |
return 4; | |
} | |
static int __rshift__(const TestOverloadsLeft& left, const TestOverloadsParent<TestStruct5>& right) { | |
return 5; | |
} | |
static int __rshift__(const TestOverloadsLeft& left, const TestOverloadsParent<TestStruct6>& right) { | |
return 6; | |
} | |
static int __rshift__(const TestOverloadsLeft& left, const TestOverloadsParent<TestStruct7>& right) { | |
return 7; | |
} | |
static int __rshift__(const TestOverloadsLeft& left, const TestOverloadsParent<TestStruct8>& right) { | |
return 8; | |
} | |
static int __rshift__(const TestOverloadsLeft& left, const TestOverloadsParent<TestStruct9>& right) { | |
return 9; | |
} | |
static int __rshift__(const TestOverloadsLeft& left, const TestOverloadsParent<TestStruct10>& right) { | |
return 10; | |
} | |
static int __rshift__(const TestOverloadsLeft& left, const TestOverloadsParent<TestStruct11>& right) { | |
return 11; | |
} | |
static int __rshift__(const TestOverloadsLeft& left, const TestOverloadsParent<TestStruct12>& right) { | |
return 12; | |
} | |
static int __rshift__(const TestOverloadsLeft& left, const TestOverloadsParent<TestStruct13>& right) { | |
return 13; | |
} | |
static int __rshift__(const TestOverloadsLeft& left, const TestOverloadsParent<TestStruct14>& right) { | |
return 14; | |
} | |
static int __rshift__(const TestOverloadsLeft& left, const TestOverloadsParent<TestStruct15>& right) { | |
return 15; | |
} | |
static int __rshift__(const TestOverloadsLeft& left, const TestOverloadsParent<TestStruct16>& right) { | |
return 16; | |
} | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def _a_ ( s , l ) : | |
return LoKi.Dicts.TestOverloadsShifts.__rshift__ ( s , l ) | |
## LoKi.Dicts.TestOverloadsLeft.__rshift__ = lambda s, l : LoKi.Dicts.TestOverloadsShifts.__rshift__ ( s , l ) | |
LoKi.Dicts.TestOverloadsLeft.__rshift__ = _a_ | |
left = LoKi.Dicts.TestOverloadsLeft() | |
##right = LoKi.Dicts.TestOverloads("16")() | |
for i in range(1,17): | |
right = LoKi.Dicts.TestOverloads("LoKi::Dicts::TestStruct"+str(i))() | |
print left >> right |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment