ATLAS Offline Software
TFCSEnergyInterpolationPiecewiseLinear.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef ISF_FASTCALOSIMEVENT_TFCSEnergyInterpolationPiecewiseLinear_h
6 #define ISF_FASTCALOSIMEVENT_TFCSEnergyInterpolationPiecewiseLinear_h
7 
8 // base class include
10 // interpolator include
11 #include <Math/Interpolator.h>
12 // graphic includes for unit_test
13 #include "TCanvas.h"
14 #include "TGraph.h"
15 #include "TAxis.h"
16 // TBuffer include required for custom class streamer
17 #include "TBuffer.h"
18 
20 
21 public:
22  TFCSEnergyInterpolationPiecewiseLinear(const char *name = nullptr,
23  const char *title = nullptr);
27  BIT(15)
28  };
30 
31  bool OnlyScaleEnergy() const { return TestBit(kOnlyScaleEnergy); };
33  void reset_OnlyScaleEnergy() { ResetBit(kOnlyScaleEnergy); };
34 
35  virtual bool is_match_Ekin_bin(int /*Ekin_bin*/) const override {
36  return true;
37  };
38  virtual bool is_match_calosample(int /*calosample*/) const override {
39  return true;
40  };
41 
42  void InitFromArrayInLogEkin(Int_t np, const Double_t logEkin[],
43  const Double_t response[]);
44  void InitFromArrayInEkin(Int_t np, const Double_t Ekin[],
45  const Double_t response[]);
46 
47  virtual FCSReturnCode
48  simulate(TFCSSimulationState &simulstate, const TFCSTruthState *truth,
49  const TFCSExtrapolationState *extrapol) const override;
50 
51  double evaluate(const double &Ekin) const;
52 
53  void Print(Option_t *option = "") const override;
54 
55  static void unit_test(TFCSSimulationState *simulstate = nullptr,
56  TFCSTruthState *truth = nullptr,
57  const TFCSExtrapolationState *extrapol = nullptr,
58  TGraph *grlinear = nullptr);
59 
60 private:
61  ROOT::Math::Interpolator m_linInterpol;
62 
63  std::vector<double> m_logEkin;
64  std::vector<double> m_response;
65  std::pair<double, double> m_MinMaxlogEkin;
66 
68  4) // TFCSEnergyInterpolationPiecewiseLinear
69 };
70 
71 #endif
FCSReturnCode
FCSReturnCode
Base class for all FastCaloSim parametrizations Functionality in derivde classes is provided through ...
Definition: TFCSParametrizationBase.h:41
TFCSEnergyInterpolationPiecewiseLinear::m_response
std::vector< double > m_response
Definition: TFCSEnergyInterpolationPiecewiseLinear.h:64
TFCSEnergyInterpolationPiecewiseLinear::set_OnlyScaleEnergy
void set_OnlyScaleEnergy()
Definition: TFCSEnergyInterpolationPiecewiseLinear.h:32
TFCSEnergyInterpolationPiecewiseLinear::InitFromArrayInEkin
void InitFromArrayInEkin(Int_t np, const Double_t Ekin[], const Double_t response[])
Definition: TFCSEnergyInterpolationPiecewiseLinear.cxx:43
response
MDT_Response response
Definition: MDT_ResponseTest.cxx:28
TFCSEnergyInterpolationPiecewiseLinear::reset_OnlyScaleEnergy
void reset_OnlyScaleEnergy()
Definition: TFCSEnergyInterpolationPiecewiseLinear.h:33
TFCSEnergyInterpolationPiecewiseLinear
Definition: TFCSEnergyInterpolationPiecewiseLinear.h:19
TFCSEnergyInterpolationPiecewiseLinear::simulate
virtual FCSReturnCode simulate(TFCSSimulationState &simulstate, const TFCSTruthState *truth, const TFCSExtrapolationState *extrapol) const override
Method in all derived classes to do some simulation.
Definition: TFCSEnergyInterpolationPiecewiseLinear.cxx:51
TFCSExtrapolationState
Definition: TFCSExtrapolationState.h:13
RunActsMaterialValidation.extrapol
extrapol
Definition: RunActsMaterialValidation.py:90
PlotPulseshapeFromCool.np
np
Definition: PlotPulseshapeFromCool.py:64
TFCSEnergyInterpolationPiecewiseLinear::m_logEkin
std::vector< double > m_logEkin
Do not persistify.
Definition: TFCSEnergyInterpolationPiecewiseLinear.h:63
TFCSEnergyInterpolationPiecewiseLinear::is_match_calosample
virtual bool is_match_calosample(int) const override
Definition: TFCSEnergyInterpolationPiecewiseLinear.h:38
TFCSEnergyInterpolationPiecewiseLinear::m_linInterpol
ROOT::Math::Interpolator m_linInterpol
Definition: TFCSEnergyInterpolationPiecewiseLinear.h:61
TFCSParametrization.h
TFCSEnergyInterpolationPiecewiseLinear::kOnlyScaleEnergy
@ kOnlyScaleEnergy
Set this bit in the TObject bit field the simulated energy should only be scaled by the spline.
Definition: TFCSEnergyInterpolationPiecewiseLinear.h:26
covarianceTool.title
title
Definition: covarianceTool.py:542
TFCSParametrization
Definition: TFCSParametrization.h:10
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
TFCSEnergyInterpolationPiecewiseLinear::m_MinMaxlogEkin
std::pair< double, double > m_MinMaxlogEkin
Definition: TFCSEnergyInterpolationPiecewiseLinear.h:65
TFCSEnergyInterpolationPiecewiseLinear::unit_test
static void unit_test(TFCSSimulationState *simulstate=nullptr, TFCSTruthState *truth=nullptr, const TFCSExtrapolationState *extrapol=nullptr, TGraph *grlinear=nullptr)
Definition: TFCSEnergyInterpolationPiecewiseLinear.cxx:142
TFCSEnergyInterpolationPiecewiseLinear::TFCSEnergyInterpolationPiecewiseLinear
TFCSEnergyInterpolationPiecewiseLinear(const char *name=nullptr, const char *title=nullptr)
Definition: TFCSEnergyInterpolationPiecewiseLinear.cxx:26
TFCSEnergyInterpolationPiecewiseLinear::OnlyScaleEnergy
bool OnlyScaleEnergy() const
Definition: TFCSEnergyInterpolationPiecewiseLinear.h:31
TFCSEnergyInterpolationPiecewiseLinear::evaluate
double evaluate(const double &Ekin) const
Definition: TFCSEnergyInterpolationPiecewiseLinear.cxx:89
TFCSEnergyInterpolationPiecewiseLinear::is_match_Ekin_bin
virtual bool is_match_Ekin_bin(int) const override
Definition: TFCSEnergyInterpolationPiecewiseLinear.h:35
TFCSTruthState
Definition: TFCSTruthState.h:13
TFCSEnergyInterpolationPiecewiseLinear::Print
void Print(Option_t *option="") const override
Definition: TFCSEnergyInterpolationPiecewiseLinear.cxx:110
TFCSSimulationState
Definition: TFCSSimulationState.h:32
TFCSEnergyInterpolationPiecewiseLinear::FCSEnergyInitializationStatusBits
FCSEnergyInitializationStatusBits
Status bit for energy initialization.
Definition: TFCSEnergyInterpolationPiecewiseLinear.h:25
TFCSEnergyInterpolationPiecewiseLinear::InitFromArrayInLogEkin
void InitFromArrayInLogEkin(Int_t np, const Double_t logEkin[], const Double_t response[])
Definition: TFCSEnergyInterpolationPiecewiseLinear.cxx:31