7 #ifndef TRIGGERANALYSISINTERFACES_ITRIGGLOBALEFFICIENCYCORRECTIONTOOL_H
8 #define TRIGGERANALYSISINTERFACES_ITRIGGLOBALEFFICIENCYCORRECTIONTOOL_H 1
17 #include <type_traits>
18 #include <string_view>
25 template<
typename Arg>
static constexpr
bool validArgs(
unsigned nTrailingDoubles);
26 template<
typename Arg1,
typename Arg2,
typename... OtherArgs>
static constexpr
bool validArgs(
unsigned nTrailingDoubles);
38 template<
typename...
Args>
40 template<
typename...
Args>
42 template<
typename...
Args>
58 double*
handleArg(
double&
arg, std::vector<const xAOD::IParticle*>&) {
return &
arg; }
59 template<
typename P>
double*
handleArg(
const std::vector<P>&
arg, std::vector<const xAOD::IParticle*>&
particles)
66 template<
typename Arg>
70 using P = std::remove_cv_t<Arg>;
71 return std::is_same<P, std::vector<xAOD::Electron*>>
::value
72 || std::is_same<P, std::vector<const xAOD::Electron*>>
::value
73 || std::is_same<P, std::vector<xAOD::Muon*>>
::value
74 || std::is_same<P, std::vector<const xAOD::Muon*>>
::value
75 || std::is_same<P, std::vector<xAOD::Photon*>>
::value
76 || std::is_same<P, std::vector<const xAOD::Photon*>>
::value;
79 template<
typename Arg1,
typename Arg2,
typename... OtherArgs>
83 for(
bool x : xs)
if(!
x)
return validArgs<Arg1>(0) &&
validArgs<Arg2, OtherArgs...>(nTrailingDoubles);
84 unsigned nTD =
sizeof...(OtherArgs);
85 if(nTD == nTrailingDoubles)
return validArgs<Arg1>(0) && validArgs<Arg2>(0);
91 template<
typename...
Args>
95 std::vector<const xAOD::IParticle*>
particles;
100 template<
typename...
Args>
104 std::vector<const xAOD::IParticle*>
particles;
109 template<
typename...
Args>
113 std::vector<const xAOD::IParticle*>
particles;
118 #endif //> !TRIGGERANALYSISINTERFACES_ITRIGGLOBALEFFICIENCYCORRECTIONTOOL_H