7#ifndef TRIGGERANALYSISINTERFACES_ITRIGGLOBALEFFICIENCYCORRECTIONTOOL_H
8#define TRIGGERANALYSISINTERFACES_ITRIGGLOBALEFFICIENCYCORRECTIONTOOL_H 1
25 template<
typename Arg>
static constexpr bool validArgs(
unsigned nTrailingDoubles);
26 template<
typename Arg1,
typename Arg2,
typename... OtherArgs>
static constexpr bool validArgs(
unsigned nTrailingDoubles);
39 template<
typename...
Args>
41 template<
typename...
Args>
43 template<
typename BoolOrMap,
typename...
Args>
54 virtual CP::CorrectionCode getEfficiency(
unsigned runNumber,
const std::vector<const xAOD::IParticle*>& particles,
double& efficiencyData,
double& efficiencyMc) = 0;
59 double*
handleArg(
double& arg, std::vector<const xAOD::IParticle*>&) {
return &arg; }
60 template<
typename P>
double*
handleArg(
const std::vector<P>& arg, std::vector<const xAOD::IParticle*>& particles)
62 for(
auto ptr : arg) particles.push_back(
static_cast<const xAOD::IParticle*
>(ptr));
70 if(std::is_same<double, Arg>::value)
return (nTrailingDoubles==1);
71 using P = std::remove_cv_t<Arg>;
72 return std::is_same<P, std::vector<xAOD::Electron*>>::value
73 || std::is_same<P, std::vector<const xAOD::Electron*>>::value
74 || std::is_same<P, std::vector<xAOD::Muon*>>::value
75 || std::is_same<P, std::vector<const xAOD::Muon*>>::value
76 || std::is_same<P, std::vector<xAOD::Photon*>>::value
77 || std::is_same<P, std::vector<const xAOD::Photon*>>::value;
80template<
typename Arg1,
typename Arg2,
typename... OtherArgs>
83 bool xs [] = { std::is_same<OtherArgs, double>::value...,
true };
85 unsigned nTD =
sizeof...(OtherArgs);
87 if(nTD == nTrailingDoubles-1)
return validArgs<Arg1>(0) && std::is_same<Arg2, double>::value;
88 if(nTD == nTrailingDoubles-2)
return std::is_same<Arg1, double>::value && std::is_same<Arg2, double>::value;
92template<
typename...
Args>
96 std::vector<const xAOD::IParticle*> particles;
97 double* sf[] = {
nullptr,
handleArg(args, particles)... };
101template<
typename...
Args>
105 std::vector<const xAOD::IParticle*> particles;
106 double* eff[] = {
nullptr,
handleArg(args, particles)... };
110template<
typename BoolOrMap,
typename...
Args>
114 std::vector<const xAOD::IParticle*> particles;
__attribute__((always_inline)) inline uint16_t TileCalibDrawerBase
Return value from object correction CP tools.
Class providing the definition of the 4-vector interface.