ATLAS Offline Software
TFCSParametrizationChain.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_TFCSParametrizationChain_h
6 #define ISF_FASTCALOSIMEVENT_TFCSParametrizationChain_h
7 
9 
11 public:
12  TFCSParametrizationChain(const char *name = nullptr,
13  const char *title = nullptr)
16  : TFCSParametrization(ref.GetName(), ref.GetTitle()),
17  m_chain(ref.chain()){};
18 
22  BIT(16),
23  kRetryChainFromStart = BIT(17)
30  };
31 
32  bool SplitChainObjects() const { return TestBit(kSplitChainObjects); };
35 
36  bool RetryChainFromStart() const { return TestBit(kRetryChainFromStart); };
39 
40  typedef std::vector<TFCSParametrizationBase *> Chain_t;
41  virtual unsigned int size() const override { return m_chain.size(); };
42  virtual const TFCSParametrizationBase *
43  operator[](unsigned int ind) const override {
44  return m_chain[ind];
45  };
46  virtual TFCSParametrizationBase *operator[](unsigned int ind) override {
47  return m_chain[ind];
48  };
49  virtual void set_daughter(unsigned int ind,
50  TFCSParametrizationBase *param) override {
51  m_chain.at(ind) = param;
52  };
53  const Chain_t &chain() const { return m_chain; };
54  Chain_t &chain() { return m_chain; };
55  void push_back(const Chain_t::value_type &param) {
56  m_chain.push_back(param);
57  recalc();
58  };
59 
60  virtual bool is_match_Ekin_bin(int Ekin_bin) const override;
61  virtual bool is_match_calosample(int calosample) const override;
62 
63  virtual FCSReturnCode
64  simulate(TFCSSimulationState &simulstate, const TFCSTruthState *truth,
65  const TFCSExtrapolationState *extrapol) const override;
66 
67  void Print(Option_t *option = "") const override;
68 
69  static void unit_test(TFCSSimulationState *simulstate = nullptr,
70  const TFCSTruthState *truth = nullptr,
71  const TFCSExtrapolationState *extrapol = nullptr);
72 
73  // THIS CLASS HAS A CUSTOM STREAMER! CHANGES IN THE VERSIONING OR DATA TYPES
74  // NEED TO BE IMPLEMENTED BY HAND! void
75  // TFCSParametrizationChain::Streamer(TBuffer &R__b)
76 protected:
78  void recalc_pdgid_union();
79 
80  void recalc_Ekin_intersect();
81  void recalc_eta_intersect();
83 
84  void recalc_Ekin_union();
85  void recalc_eta_union();
86  void recalc_Ekin_eta_union();
87 
90  virtual void recalc();
91 
94  TFCSSimulationState &simulstate,
95  const TFCSTruthState *truth,
96  const TFCSExtrapolationState *extrapol) const;
97 
98 private:
100 
101  // Ensure all objects to be written by the streamer live long enough.
102  std::vector<std::unique_ptr<TFCSParametrizationBase>> m_writtenBases;
103 
104  ClassDefOverride(TFCSParametrizationChain, 2) // TFCSParametrizationChain
105 };
106 
108 
109 #endif
TFCSParametrizationChain
Definition: TFCSParametrizationChain.h:10
TFCSParametrizationChain::chain
Chain_t & chain()
Definition: TFCSParametrizationChain.h:54
TFCSParametrizationChain::recalc
virtual void recalc()
Default is to call recalc_pdgid_intersect() and recalc_Ekin_eta_intersect()
Definition: TFCSParametrizationChain.cxx:119
FCSReturnCode
FCSReturnCode
Base class for all FastCaloSim parametrizations Functionality in derivde classes is provided through ...
Definition: TFCSParametrizationBase.h:41
TFCSParametrizationChain::is_match_Ekin_bin
virtual bool is_match_Ekin_bin(int Ekin_bin) const override
Definition: TFCSParametrizationChain.cxx:130
TFCSParametrizationChain::reset_SplitChainObjects
void reset_SplitChainObjects()
Definition: TFCSParametrizationChain.h:34
TFCSParametrizationChain::kSplitChainObjects
@ kSplitChainObjects
Set this bit in the TObject bit field if the TFCSParametrizationBase objects in the chain should be w...
Definition: TFCSParametrizationChain.h:21
TFCSParametrizationChain::Chain_t
std::vector< TFCSParametrizationBase * > Chain_t
Definition: TFCSParametrizationChain.h:38
TFCSParametrizationChain::Print
void Print(Option_t *option="") const override
Definition: TFCSParametrizationChain.cxx:184
TFCSParametrizationChain::set_RetryChainFromStart
void set_RetryChainFromStart()
Definition: TFCSParametrizationChain.h:37
TFCSParametrizationChain::TFCSParametrizationChain
TFCSParametrizationChain(const TFCSParametrizationChain &ref)
Definition: TFCSParametrizationChain.h:15
TFCSParametrizationChain::recalc_eta_intersect
void recalc_eta_intersect()
Definition: TFCSParametrizationChain.cxx:61
TFCSParametrizationChain::operator[]
virtual const TFCSParametrizationBase * operator[](unsigned int ind) const override
Some derived classes have daughter instances of TFCSParametrizationBase objects The size() and operat...
Definition: TFCSParametrizationChain.h:43
TFCSParametrizationChain::recalc_Ekin_union
void recalc_Ekin_union()
Definition: TFCSParametrizationChain.cxx:82
TFCSParametrizationChain.icc
TFCSParametrizationChain::reset_RetryChainFromStart
void reset_RetryChainFromStart()
Definition: TFCSParametrizationChain.h:38
TFCSExtrapolationState
Definition: TFCSExtrapolationState.h:13
RunActsMaterialValidation.extrapol
extrapol
Definition: RunActsMaterialValidation.py:90
TFCSParametrizationChain::push_back
void push_back(const Chain_t::value_type &param)
Definition: TFCSParametrizationChain.h:55
TFCSParametrizationChain::recalc_eta_union
void recalc_eta_union()
Definition: TFCSParametrizationChain.cxx:98
TFCSParametrizationChain::simulate
virtual FCSReturnCode simulate(TFCSSimulationState &simulstate, const TFCSTruthState *truth, const TFCSExtrapolationState *extrapol) const override
Method in all derived classes to do some simulation.
Definition: TFCSParametrizationChain.cxx:144
TFCSParametrizationChain::RetryChainFromStart
bool RetryChainFromStart() const
Definition: TFCSParametrizationChain.h:36
TFCSParametrizationBase
Definition: TFCSParametrizationBase.h:46
TFCSParametrization.h
TFCSParametrizationChain::chain
const Chain_t & chain() const
Definition: TFCSParametrizationChain.h:53
TFCSParametrizationChain::is_match_calosample
virtual bool is_match_calosample(int calosample) const override
Definition: TFCSParametrizationChain.cxx:137
covarianceTool.title
title
Definition: covarianceTool.py:542
TFCSParametrizationChain::recalc_pdgid_intersect
void recalc_pdgid_intersect()
Definition: TFCSParametrizationChain.cxx:20
TFCSParametrizationChain::recalc_Ekin_intersect
void recalc_Ekin_intersect()
Definition: TFCSParametrizationChain.cxx:45
TFCSParametrizationChain::set_daughter
virtual void set_daughter(unsigned int ind, TFCSParametrizationBase *param) override
Some derived classes have daughter instances of TFCSParametrizationBase objects The set_daughter meth...
Definition: TFCSParametrizationChain.h:49
TFCSParametrization
Definition: TFCSParametrization.h:10
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
TFCSParametrizationChain::m_writtenBases
std::vector< std::unique_ptr< TFCSParametrizationBase > > m_writtenBases
Definition: TFCSParametrizationChain.h:102
TFCSParametrizationChain::operator[]
virtual TFCSParametrizationBase * operator[](unsigned int ind) override
Some derived classes have daughter instances of TFCSParametrizationBase objects The size() and operat...
Definition: TFCSParametrizationChain.h:46
TFCSParametrizationChain::recalc_pdgid_union
void recalc_pdgid_union()
Definition: TFCSParametrizationChain.cxx:33
TFCSParametrizationChain::FCSSplitChainObjects
FCSSplitChainObjects
Status bit for chain persistency.
Definition: TFCSParametrizationChain.h:20
TFCSParametrizationChain::set_SplitChainObjects
void set_SplitChainObjects()
Definition: TFCSParametrizationChain.h:33
ref
const boost::regex ref(r_ef)
TFCSParametrizationChain::SplitChainObjects
bool SplitChainObjects() const
Definition: TFCSParametrizationChain.h:32
TFCSParametrizationChain::simulate_and_retry
FCSReturnCode simulate_and_retry(TFCSParametrizationBase *parametrization, TFCSSimulationState &simulstate, const TFCSTruthState *truth, const TFCSExtrapolationState *extrapol) const
TFCSParametrizationChain::m_chain
Chain_t m_chain
Definition: TFCSParametrizationChain.h:99
TFCSParametrizationChain::recalc_Ekin_eta_intersect
void recalc_Ekin_eta_intersect()
Definition: TFCSParametrizationChain.cxx:77
TFCSParametrizationChain::TFCSParametrizationChain
TFCSParametrizationChain(const char *name=nullptr, const char *title=nullptr)
Definition: TFCSParametrizationChain.h:12
TFCSParametrizationChain::unit_test
static void unit_test(TFCSSimulationState *simulstate=nullptr, const TFCSTruthState *truth=nullptr, const TFCSExtrapolationState *extrapol=nullptr)
Definition: TFCSParametrizationChain.cxx:288
TFCSParametrizationChain::recalc_Ekin_eta_union
void recalc_Ekin_eta_union()
Definition: TFCSParametrizationChain.cxx:114
TFCSTruthState
Definition: TFCSTruthState.h:13
TFCSSimulationState
Definition: TFCSSimulationState.h:32
TFCSParametrizationChain::kRetryChainFromStart
@ kRetryChainFromStart
Definition: TFCSParametrizationChain.h:29
LArG4GenerateShowerLib.parametrization
parametrization
Definition: LArG4GenerateShowerLib.py:19
checkFileSG.ind
list ind
Definition: checkFileSG.py:118
TFCSParametrizationChain::size
virtual unsigned int size() const override
Some derived classes have daughter instances of TFCSParametrizationBase objects The size() and operat...
Definition: TFCSParametrizationChain.h:41