ATLAS Offline Software
TFCSParametrizationAbsEtaSelectChain.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
3 */
4 
9 #include <iostream>
10 
11 //=============================================
12 //======= TFCSParametrizationAbsEtaSelectChain =========
13 //=============================================
14 
17  const TFCSExtrapolationState *extrapol) const {
18  return val_to_bin(TMath::Abs(extrapol->IDCaloBoundary_eta()));
19 }
20 
21 const std::string
23  if (bin == -1 || bin >= (int)get_number_of_bins()) {
24  return std::string(Form("bin=%d not in [%2.2f<=|eta|<%2.2f)", bin,
25  m_bin_low_edge[0],
27  }
28  return std::string(Form("bin=%d, %2.2f<=|eta|<%2.2f", bin,
30 }
31 
33  TFCSSimulationState *simulstate, TFCSTruthState *truth,
36  if (!simulstate)
37  simulstate = new TFCSSimulationState();
38  if (!truth)
39  truth = new TFCSTruthState();
40  if (!extrapol)
42 
44  chain.setLevel(MSG::DEBUG);
45 
46  TFCSParametrization *param;
47  param = new TFCSParametrization("A begin all", "A begin all");
48  param->setLevel(MSG::DEBUG);
49  param->set_eta_nominal(2);
50  param->set_eta_min(2);
51  param->set_eta_max(3);
52  chain.push_before_first_bin(param);
53  param = new TFCSParametrization("A end all", "A end all");
54  param->setLevel(MSG::DEBUG);
55  param->set_eta_nominal(2);
56  param->set_eta_min(2);
57  param->set_eta_max(3);
58  chain.push_back(param);
59 
60  const int n_params = 5;
61  for (int i = 2; i < n_params; ++i) {
62  param = new TFCSParametrization(Form("A%d", i), Form("A %d", i));
63  param->setLevel(MSG::DEBUG);
64  param->set_eta_nominal(i * i + 0.1);
65  param->set_eta_min(i * i);
66  param->set_eta_max((i + 1) * (i + 1));
67  chain.push_back_in_bin(param);
68  }
69  for (int i = n_params; i >= 1; --i) {
70  param = new TFCSParametrization(Form("B%d", i), Form("B %d", i));
71  param->setLevel(MSG::DEBUG);
72  param->set_eta_nominal(i * i + 0.1);
73  param->set_eta_min(i * i);
74  param->set_eta_max((i + 1) * (i + 1));
75  chain.push_back_in_bin(param);
76  }
77 
78  ATH_MSG_NOCLASS(logger, "==== Chain setup ====");
79  chain.Print();
80 
81  param = new TFCSParametrization("B end all", "B end all");
82  param->setLevel(MSG::DEBUG);
83  chain.push_back(param);
84  param = new TFCSParametrization("B begin all", "B begin all");
85  param->setLevel(MSG::DEBUG);
86  chain.push_before_first_bin(param);
87 
88  ATH_MSG_NOCLASS(logger, "==== Chain setup ====");
89  chain.Print();
90  ATH_MSG_NOCLASS(logger, "==== Simulate with eta=0.1 ====");
91  extrapol->set_IDCaloBoundary_eta(0.1);
92  chain.simulate(*simulstate, truth, extrapol);
93  ATH_MSG_NOCLASS(logger, "==== Simulate with eta=-1.1 ====");
94  extrapol->set_IDCaloBoundary_eta(-1.1);
95  chain.simulate(*simulstate, truth, extrapol);
96  ATH_MSG_NOCLASS(logger, "==== Simulate with eta=2.1 ====");
97  extrapol->set_IDCaloBoundary_eta(2.1);
98  chain.simulate(*simulstate, truth, extrapol);
99  ATH_MSG_NOCLASS(logger, "==== Simulate with eta=4.1 ====");
100  extrapol->set_IDCaloBoundary_eta(4.1);
101  chain.simulate(*simulstate, truth, extrapol);
102  ATH_MSG_NOCLASS(logger, "==== Simulate with eta=-4.1 ====");
103  extrapol->set_IDCaloBoundary_eta(-4.1);
104  chain.simulate(*simulstate, truth, extrapol);
105  ATH_MSG_NOCLASS(logger, "==== Simulate with eta=100 ====");
106  extrapol->set_IDCaloBoundary_eta(100);
107  chain.simulate(*simulstate, truth, extrapol);
108  ATH_MSG_NOCLASS(logger, "===================================" << std::endl);
109 }
ISF_FCS::MLogging
Cut down AthMessaging.
Definition: MLogging.h:176
TFCSParametrizationAbsEtaSelectChain.h
bin
Definition: BinsDiffFromStripMedian.h:43
TFCSExtrapolationState
Definition: TFCSExtrapolationState.h:13
RunActsMaterialValidation.extrapol
extrapol
Definition: RunActsMaterialValidation.py:90
TFCSParametrization::set_eta_max
virtual void set_eta_max(double max)
Definition: TFCSParametrization.cxx:53
TFCSParametrizationBinnedChain::get_number_of_bins
virtual unsigned int get_number_of_bins() const
Definition: TFCSParametrizationBinnedChain.h:22
TFCSParametrizationAbsEtaSelectChain::get_bin_text
virtual const std::string get_bin_text(int bin) const override
print the range of a bin; for bin -1, print the allowed range
Definition: TFCSParametrizationAbsEtaSelectChain.cxx:22
lumiFormat.i
int i
Definition: lumiFormat.py:85
TFCSParametrizationChain::chain
const Chain_t & chain() const
Definition: TFCSParametrizationChain.h:53
TFCSParametrization::TFCSParametrization
TFCSParametrization(const char *name=nullptr, const char *title=nullptr)
Definition: TFCSParametrization.cxx:12
TFCSParametrizationAbsEtaSelectChain::get_bin
virtual int get_bin(TFCSSimulationState &, const TFCSTruthState *truth, const TFCSExtrapolationState *extrapol) const override
this method should determine in derived classes which bin to simulate, so that the simulate method ca...
Definition: TFCSParametrizationAbsEtaSelectChain.cxx:15
TFCSParametrization
Definition: TFCSParametrization.h:10
TFCSParametrization::set_eta_nominal
virtual void set_eta_nominal(double min)
Definition: TFCSParametrization.cxx:47
ISF_FCS::MLogging::setLevel
virtual void setLevel(MSG::Level lvl)
Update outputlevel.
Definition: MLogging.cxx:105
TFCSParametrizationFloatSelectChain::val_to_bin
int val_to_bin(float val) const
Definition: TFCSParametrizationFloatSelectChain.cxx:92
TFCSParametrizationAbsEtaSelectChain
Definition: TFCSParametrizationAbsEtaSelectChain.h:11
TFCSTruthState.h
ATH_MSG_NOCLASS
#define ATH_MSG_NOCLASS(logger_name, x)
Definition: MLogging.h:52
TFCSExtrapolationState.h
DEBUG
#define DEBUG
Definition: page_access.h:11
TFCSParametrization::set_eta_min
virtual void set_eta_min(double min)
Definition: TFCSParametrization.cxx:51
TFCSSimulationState.h
TFCSTruthState
Definition: TFCSTruthState.h:13
TFCSSimulationState
Definition: TFCSSimulationState.h:32
TFCSParametrizationFloatSelectChain::m_bin_low_edge
std::vector< float > m_bin_low_edge
Definition: TFCSParametrizationFloatSelectChain.h:41
python.iconfTool.gui.pad.logger
logger
Definition: pad.py:14
TFCSParametrizationAbsEtaSelectChain::unit_test
static void unit_test(TFCSSimulationState *simulstate=nullptr, TFCSTruthState *truth=nullptr, TFCSExtrapolationState *extrapol=nullptr)
Definition: TFCSParametrizationAbsEtaSelectChain.cxx:32