17 return dRmax_tau+0*Pvis*tau_type;
26 while (phiOut>TMath::Pi()) {
27 phiOut-=TMath::TwoPi();
32 while (phiOut<-TMath::Pi()) {
33 phiOut+=TMath::TwoPi();
44 const double fastB=4/TMath::Pi();
45 const double fastC=-4/(TMath::Pi()*TMath::Pi());
46 const double fastP=9./40.;
47 const double fastQ=31./40.;
63 const double y=phi*(fastB+fastC*std::abs(phi));
64 sinPhi=
y*(fastP*std::abs(
y)+fastQ);
70 if (std::abs(phi)>TMath::PiOver2()) cosPhi=-cosPhi;
77 if (
out==in)
return true;
86 if(
p1 ==
nullptr ||
p2 ==
nullptr) {
87 Info(
"DiTauMassTools",
"MissingMassTool::getLFVMode() got a nullptr - returning -1");
92 if (mmcType1 == -1) mmcType1 =
mmcType(
p1);
93 if (mmcType1 < 0)
return -1;
95 if (mmcType2 == -1) mmcType2 =
mmcType(
p2);
96 if (mmcType2 < 0)
return -1;
100 if(mmcType1 == 8 && mmcType2 == 8) {
102 if(
p1->pt() >
p2->pt() ) {
112 }
else if(mmcType2 == 8) {
116 Warning(
"DiTauMassTools",
"Trying to set LFV mode for 2 taus!");
126 Info(
"DiTauMassTools",
"Setting MMC to mu+tau mode");
131 Info(
"DiTauMassTools",
"Setting MMC to e+tau mode");
142 if(
part ==
nullptr) {
144 Info(
"DiTauMassTools",
"MissingMassTool::mmcType() got a nullptr - returning -1");
159 Warning(
"DiTauMassTools",
"MissingMassTool::mmcType() dynamic_cast of TauJet failed");
169 Warning(
"DiTauMassTools",
"MissingMassTool::mmcType() unrecognised particle type! Only Electron, Muon, TauJet allowed. If no mistake, please call MissingMassTool::calculate() directly.");
178 std::string paramcode;
181 Info(
"DiTauMassTools",
"The specified calibration version does not support root file parametrisations");
184 TIter
next(
dir->GetListOfKeys());
186 while ((
key = (TKey*)
next())) {
187 TClass *
cl = gROOT->GetClass(
key->GetClassName());
189 if (
cl->InheritsFrom(
"TDirectory")) {
195 else if (
cl->InheritsFrom(
"TF1") ||
cl->InheritsFrom(
"TGraph")) {
197 std::string total_path =
dir->GetPath();
198 if (total_path.find(paramcode) == std::string::npos)
continue;
199 TF1* func = (TF1*)
dir->Get( (
const char*)
key->GetName() );
200 TF1*
f =
new TF1(*func);
201 if (total_path.find(
"lep") != std::string::npos)
203 if (total_path.find(
"Angle") != std::string::npos){
204 lep_angle.push_back(
f);
206 else if (total_path.find(
"Ratio") != std::string::npos)
208 lep_ratio.push_back(
f);
210 else if (total_path.find(
"Mass") != std::string::npos)
212 lep_numass.push_back(
f);
216 Warning(
"DiTauMassTools",
"Undefined leptonic PDF term in input file.");
219 else if (total_path.find(
"had") != std::string::npos)
221 if (total_path.find(
"Angle") != std::string::npos){
222 had_angle.push_back(
f);
224 else if (total_path.find(
"Ratio") != std::string::npos)
226 had_ratio.push_back(
f);
230 Warning(
"DiTauMassTools",
"Undefined hadronic PDF term in input file.");
235 Warning(
"DiTauMassTools",
"Undefined decay channel in input file.");
239 Warning(
"DiTauMassTools",
"Class in input file not recognized.");