ATLAS Offline Software
ZDCWaveformFermiExp.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef ZDCUTILS_ZDCWAVEFORMFERMIEXP_H
6 #define ZDCUTILS_ZDCWAVEFORMFERMIEXP_H
7 
8 #include "ZDCWaveform.h"
9 
10 //
11 // The Fermi*negative exponential that we have used since the start of Run 2 to
12 // parameterize ZDC pulses
13 //
15 {
16 protected:
17  double doEvaluate(double time) const override;
18 
19  virtual std::string name() const override {return "FermiExp";}
20 
21 public:
22  ZDCWaveformFermiExp() = delete;
23 
24  ZDCWaveformFermiExp(const std::string& tag, double initialTauRise, double initialTauFall) :
25  ZDCWaveformBase(tag, initialTauRise, initialTauFall, std::vector<std::string>(), std::vector<double>())
26  {}
27 
29  ZDCWaveformBase(instance.getTag(), instance.getTauRise(),instance.getTauFall(), std::vector<std::string>(), std::vector<double>()) {};
30 };
31 
32 //
33 // A version of the Fermi*negative exponential that has a shift in baseline before and after T0
34 // to describe a small (few %) long tail seen in pulses in the Run 3 data
35 //
36 //
38 {
39  double doEvaluate(double time) const override
40  {
41  double tailShift = getAddtlShapeValue(0);
42  if (time <= 0) return ZDCWaveformFermiExp::doEvaluate(time);
43  else return ZDCWaveformFermiExp::doEvaluate(time) + tailShift;
44  }
45 
46  virtual std::string name() const override {return "FermiExpTail";}
47 
48 public:
50 
51  ZDCWaveformFermiExpTail(const std::string& tag, double initialTauRise, double initialTauFall, double tailShiftFrac) :
52  ZDCWaveformFermiExp(tag, initialTauRise, initialTauFall)
53  {
54  double tailShiftScaled = tailShiftFrac*ZDCWaveformFermiExp::doEvaluate(0);
55  setAddtlShapeParameters(std::vector<std::string>({"tailFrac"}), std::vector<double>({tailShiftScaled}));
56  }
57 
58  void setTailParameter(double tailShiftFrac) {
59  double tailShiftScaled = tailShiftFrac*ZDCWaveformFermiExp::doEvaluate(0);
60  setAddtlShapeValue(0, tailShiftScaled);
61  }
62 
63 };
64 #endif
ZDCWaveform.h
ZDCWaveformFermiExp::ZDCWaveformFermiExp
ZDCWaveformFermiExp(const ZDCWaveformFermiExp &instance)
Definition: ZDCWaveformFermiExp.h:28
ZDCWaveformFermiExp::ZDCWaveformFermiExp
ZDCWaveformFermiExp(const std::string &tag, double initialTauRise, double initialTauFall)
Definition: ZDCWaveformFermiExp.h:24
ZDCWaveformBase::setAddtlShapeParameters
void setAddtlShapeParameters(const std::vector< std::string > &addtlShapeNames, const std::vector< double > &addtlShapeValues)
Definition: ZDCWaveform.cxx:32
ZDCWaveformFermiExp::ZDCWaveformFermiExp
ZDCWaveformFermiExp()=delete
ZDCWaveformFermiExpTail::name
virtual std::string name() const override
Definition: ZDCWaveformFermiExp.h:46
ZDCWaveformFermiExp::doEvaluate
double doEvaluate(double time) const override
Definition: ZDCWaveformFermiExp.cxx:7
ZDCWaveformFermiExp
Definition: ZDCWaveformFermiExp.h:15
instance
std::map< std::string, double > instance
Definition: Run_To_Get_Tags.h:8
ZDCWaveformFermiExpTail::ZDCWaveformFermiExpTail
ZDCWaveformFermiExpTail()=delete
ZDCWaveformBase::getTag
const std::string & getTag() const
Definition: ZDCWaveform.h:101
ZDCWaveformFermiExpTail::doEvaluate
double doEvaluate(double time) const override
Definition: ZDCWaveformFermiExp.h:39
ZDCWaveformBase::setAddtlShapeValue
void setAddtlShapeValue(std::string name, double value)
ZDCWaveformFermiExpTail::setTailParameter
void setTailParameter(double tailShiftFrac)
Definition: ZDCWaveformFermiExp.h:58
vector
Definition: MultiHisto.h:13
ZDCWaveformBase::getTauRise
double getTauRise() const
Definition: ZDCWaveform.h:104
ZDCWaveformBase::getAddtlShapeValue
double getAddtlShapeValue(const std::string &name) const
Definition: ZDCWaveform.h:108
xAOD::double
double
Definition: CompositeParticle_v1.cxx:159
ZDCWaveformBase
Definition: ZDCWaveform.h:31
CaloSwCorrections.time
def time(flags, cells_name, *args, **kw)
Definition: CaloSwCorrections.py:242
ZDCWaveformFermiExpTail::ZDCWaveformFermiExpTail
ZDCWaveformFermiExpTail(const std::string &tag, double initialTauRise, double initialTauFall, double tailShiftFrac)
Definition: ZDCWaveformFermiExp.h:51
CaloCondBlobAlgs_fillNoiseFromASCII.tag
string tag
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:24
ZDCWaveformBase::getTauFall
double getTauFall() const
Definition: ZDCWaveform.h:105
ZDCWaveformFermiExp::name
virtual std::string name() const override
Definition: ZDCWaveformFermiExp.h:19
ZDCWaveformFermiExpTail
Definition: ZDCWaveformFermiExp.h:38