ATLAS Offline Software
Classes | Functions
ZDCFitWrapper.h File Reference
#include "CxxUtils/checker_macros.h"
#include <TF1.h>
#include <memory>
Include dependency graph for ZDCFitWrapper.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  ZDCFitWrapper
 
class  ZDCPrePulseFitWrapper
 
class  ZDCPreExpFitWrapper
 
class  ZDCFitExpFermiVariableTaus
 
class  ZDCFitExpFermiVariableTausLHCf
 
class  ZDCFitExpFermiVariableTausRun3
 
class  ZDCFitExpFermiFixedTaus
 
class  ZDCFitExpFermiPrePulse
 
class  ZDCFitExpFermiLHCfPrePulse
 
class  ZDCFitExpFermiPreExp
 
class  ZDCFitExpFermiLHCfPreExp
 
class  ZDCFitExpFermiLinearFixedTaus
 
class  ZDCFitExpFermiLinearPrePulse
 
class  ZDCFitComplexPrePulse
 
class  ZDCFitGeneralPulse
 

Functions

double ZDCFermiExpFit (const double *xvec, const double *pvec)
 
double ZDCFermiExpFitRefl (const double *xvec, const double *pvec)
 

Function Documentation

◆ ZDCFermiExpFit()

double ZDCFermiExpFit ( const double *  xvec,
const double *  pvec 
)
inline

Definition at line 1190 of file ZDCFitWrapper.h.

1191 {
1192  double t = xvec[0];
1193 
1194  double amp = pvec[0];
1195  double t0 = pvec[1];
1196  double tau1 = pvec[2];
1197  double tau2 = pvec[3];
1198  double C = pvec[4];
1199 
1200  double tauRatio = tau2 / tau1;
1201  double tauRatioMinunsOne = tauRatio - 1;
1202 
1203  double norm = (std::pow(1. / tauRatioMinunsOne, 1. / (1 + tauRatio)) /
1204  ( 1 + std::pow(1. / tauRatioMinunsOne, 1. / (1 + 1 / tauRatio))));
1205 
1206  double deltaT = t - t0;
1207  if (deltaT < 0) deltaT = 0;
1208 
1209  double expTerm = std::exp(-deltaT / tau2);
1210  double fermiTerm = 1. / (1. + std::exp(-(t - t0) / tau1));
1211 
1212  return amp * expTerm * fermiTerm / norm + C;
1213 }

◆ ZDCFermiExpFitRefl()

double ZDCFermiExpFitRefl ( const double *  xvec,
const double *  pvec 
)
inline

Definition at line 1215 of file ZDCFitWrapper.h.

1216 {
1217  double t = xvec[0];
1218 
1219  double amp = pvec[0];
1220  double t0 = pvec[1];
1221  double tau1 = pvec[2];
1222  double tau2 = pvec[3];
1223  double C = pvec[4];
1224 
1225  double refldelay = pvec[5];
1226  double reflFrac = pvec[6];
1227  double reflwidth = pvec[7];
1228  double delta = pvec[8];
1229 
1230  double tauRatio = tau2 / tau1;
1231  double tauRatioMinunsOne = tauRatio - 1;
1232 
1233  double norm = std::pow(1. / tauRatioMinunsOne, 1. / (1 + tauRatio)) /
1234  ( 1 + std::pow(1. / tauRatioMinunsOne, 1. / (1 + 1 / tauRatio))) ;
1235 
1236  double deltaT = t - t0;
1237  if (deltaT < 0) deltaT = 0;
1238 
1239  // Note: the small constant added here accounts for the very long tail on the pulse
1240  // which doesn't go to zero over the time range that we sample
1241  //
1242  double expTerm = delta + std::exp(-deltaT / tau2);
1243  double fermiTerm = 1. / (1. + std::exp(-(t - t0) / tau1));
1244 
1245  double deltaTRefl = deltaT - refldelay;
1246  double reflTerm = -reflFrac*amp*std::exp(-0.5*deltaTRefl*deltaTRefl/reflwidth/reflwidth);
1247 
1248  return amp * expTerm * fermiTerm / norm + C + reflTerm;
1249 }
PlotCalibFromCool.norm
norm
Definition: PlotCalibFromCool.py:100
conifer::pow
constexpr int pow(int x)
Definition: conifer.h:20
DMTest::C
C_v1 C
Definition: C.h:26
ALFA_EventTPCnv_Dict::t0
std::vector< ALFA_RawData_p1 > t0
Definition: ALFA_EventTPCnvDict.h:42
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
drawFromPickle.exp
exp
Definition: drawFromPickle.py:36
pvec
std::array< fp_t, 2 > pvec
Definition: FPGATrackSimLLPDoubletHoughTransformTool.cxx:9