ATLAS Offline Software
Public Member Functions | Static Public Attributes | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
HGTD_TimingResolution Class Reference

#include <HGTD_TimingResolution.h>

Inheritance diagram for HGTD_TimingResolution:
Collaboration diagram for HGTD_TimingResolution:

Public Member Functions

 HGTD_TimingResolution (const std::string &type, const std::string &name, const IInterface *parent)
 
virtual StatusCode initialize () override final
 AlgTool initialize. More...
 
void print ()
 
float calculateTime (const float t, const float E, float r, CLHEP::HepRandomEngine *rndm_engine) const
 Return simulated CFD time. More...
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Static Public Attributes

constexpr static float HGTDInitialLuminosity = 0.0
 
constexpr static float HGTDIntermediateLuminosity_pre_Replacement = 2000.0
 
constexpr static float HGTDIntermediateLuminosity_post_Replacement = 2001.0
 
constexpr static float HGTDFinalLuminosity = 4000.0
 

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
 
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed. More...
 

Private Types

typedef std::array< float, 400 > PulseWaveform
 
typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

bool radiusInRange (float) const
 
bool etaInRange (float) const
 
float hitTimingResolution (float radius) const
 
float resolution (float) const
 
float gain (float) const
 
float electronicJitter () const
 
float sensorResolution (float radius) const
 
float translateR2Eta (float) const
 
float translateEta2R (float) const
 
void radToResolution ()
 
void radToGain ()
 
void computeDose ()
 
StatusCode propagateDamage ()
 
PulseWaveform simulatePulse (CLHEP::HepRandomEngine *rndm_engine) const
 Simulate a new pulse that can be acess using the PulseShape method. More...
 
void calculatePulse (const PulseWaveform &pulseWaveform, std::map< int, std::pair< float, float >> &pulsebin, float t, float E, float *max, CLHEP::HepRandomEngine *rndm_engine) const
 Calculate the pulse as a vector of float (400 points) More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

std::string m_version {""}
 
float m_Rmin {120.}
 
float m_Rmax {670.}
 
float m_z {3500.}
 
FloatProperty m_integratedLumi
 
float m_electronicJitter {}
 
std::vector< int > m_radii {}
 
std::vector< float > m_doseInner1000 {}
 
std::vector< float > m_doseMiddle2000 {}
 
std::vector< float > m_doseOuter4000 {}
 
std::vector< float > m_dose {}
 
std::vector< float > m_resolution {}
 
std::vector< float > m_gain {}
 
std::vector< std::pair< float, float > > m_doseResolution {}
 
std::vector< std::pair< float, float > > m_doseGain {}
 
const float m_sensorNoiseFactor
 
const float m_cfdThreshold = 0.5
 
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 

Detailed Description

Definition at line 24 of file HGTD_TimingResolution.h.

Member Typedef Documentation

◆ PulseWaveform

typedef std::array<float, 400> HGTD_TimingResolution::PulseWaveform
private

Definition at line 44 of file HGTD_TimingResolution.h.

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ HGTD_TimingResolution()

HGTD_TimingResolution::HGTD_TimingResolution ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Definition at line 35 of file HGTD_TimingResolution.cxx.

39  m_version("HGTD Timing three-ring layout"),
40 
41  // resolution in ns
42  m_electronicJitter(std::sqrt((0.025 * 0.025) - (0.010 * 0.010))),
43 
44  // Contain also the peripheral electronics region, i.e. (R>640 mm)
45  m_radii{120, 130, 140, 150, 160, 170, 180, 190, 200, 210, 220, 230,
46  240, 250, 260, 270, 280, 290, 300, 310, 320, 330, 340, 350,
47  360, 370, 380, 390, 400, 410, 420, 430, 440, 450, 460, 470,
48  480, 490, 500, 510, 520, 530, 540, 550, 560, 570, 580, 590,
49  600, 610, 620, 630, 640, 650, 660, 670, 680, 690},
50 
51  m_doseInner1000{1.995, 1.953, 1.787, 1.687, 1.608, 1.518,
52  1.448, 1.425, 1.354, 1.328, 1.275},
53 
54  m_doseMiddle2000{2.44, 2.355, 2.26, 2.204, 2.137, 2.081, 2.015, 1.96,
55  1.878, 1.87, 1.809, 1.732, 1.722, 1.63, 1.588, 1.57,
56  1.509, 1.464, 1.44, 1.38, 1.333, 1.321, 1.284, 1.271},
57 
58  m_doseOuter4000{2.458, 2.4, 2.382, 2.362, 2.266, 2.207, 2.122, 2.067,
59  2.046, 1.973, 1.94, 1.9, 1.869, 1.83, 1.711, 1.701,
60  1.685, 1.615, 1.626, 1.565, 1.53, 1.499, 1.429},
61 
62  m_doseResolution{{0.01, 0.025}, {0.1, 0.031}, {0.3, 0.035}, {0.6, 0.040},
63  {1.0, 0.046}, {3.0, 0.065}, {6.0, 0.065}},
64 
65  m_doseGain{{0.01, 39}, {0.1, 23}, {0.3, 21}, {0.6, 19},
66  {1.0, 10}, {3.0, 5}, {6.0, 4}} {}

Member Function Documentation

◆ calculatePulse()

void HGTD_TimingResolution::calculatePulse ( const PulseWaveform pulseWaveform,
std::map< int, std::pair< float, float >> &  pulsebin,
float  t,
float  E,
float *  max,
CLHEP::HepRandomEngine *  rndm_engine 
) const
private

Calculate the pulse as a vector of float (400 points)

Definition at line 320 of file HGTD_TimingResolution.cxx.

323  {
324 
325  int timebin = 0;
326  float energy = 0;
327  float time = 0;
328 
329  for (size_t point = 0; point < pulseWaveform.size(); point++) {
330 
331  energy = pulseWaveform[point] * E +
332  CLHEP::RandGaussZiggurat::shoot(rndm_engine, 0, 0.015) * E;
333  time = t + point * 0.005;
334  timebin = (int)(t / 0.005) + point;
335 
336  auto pulse = pulsebin.find(timebin);
337  if (pulse == pulsebin.end()) {
338  pulsebin.insert({timebin, {time * energy, energy}});
339  pulse = pulsebin.find(timebin);
340  } else {
341  (*pulse).second = {(*pulse).second.first + time * energy,
342  (*pulse).second.second + energy};
343  }
344  if (max[0] < (*pulse).second.second) {
345  max[0] = (*pulse).second.second;
346  max[1] = (*pulse).second.first / max[0];
347  }
348  }
349  return;
350 }

◆ calculateTime()

float HGTD_TimingResolution::calculateTime ( const float  t,
const float  E,
float  r,
CLHEP::HepRandomEngine *  rndm_engine 
) const

Return simulated CFD time.

Definition at line 352 of file HGTD_TimingResolution.cxx.

354  {
355  std::map<int, std::pair<float, float>> pulseBins;
356  float max_hit[4] = {0};
357  const PulseWaveform pulse = simulatePulse(rndm_engine);
358  calculatePulse(pulse, pulseBins, t, E, max_hit, rndm_engine);
359  for (auto &pulse : pulseBins) {
360  if (pulse.second.second == 0) {
362  "HGTD_TimingResolution::calculateTime -> Energy goes zero, please "
363  "have a check, energy * time = "
364  << pulse.second.first << " while energy = " << pulse.second.second);
365  // This bin will have both time and energy equal to 0 and won't affect
366  // the peak finding step afterwards
367  pulse.second.first = 0;
368  } else {
369  pulse.second.first = pulse.second.first / pulse.second.second;
370  }
371  // We look the the time when E=Emax/2 to get the time
372  if ((max_hit[1] > pulse.second.first) &&
373  (max_hit[0] * m_cfdThreshold < pulse.second.second) &&
374  (max_hit[3] > pulse.second.first || max_hit[3] == 0)) {
375  max_hit[2] = pulse.second.second; // Energy when E=Emax*m_cfd
376  max_hit[3] = pulse.second.first; // Time when E=Emax*m_cfd
377  }
378  }
379 
380  return max_hit[3] +
381  CLHEP::RandGaussZiggurat::shoot(rndm_engine, 0, sensorResolution(r));
382 }

◆ computeDose()

void HGTD_TimingResolution::computeDose ( )
private

Definition at line 190 of file HGTD_TimingResolution.cxx.

190  {
191  for (unsigned int i = 0; i < m_doseInner1000.size(); ++i) {
192  m_dose.push_back(remainder_1(m_integratedLumi, 1000) / 1000 *
193  m_doseInner1000[i]);
194  }
195  for (unsigned int i = 0; i < m_doseMiddle2000.size(); ++i) {
196  m_dose.push_back(remainder_1(m_integratedLumi, 2000) / 2000 *
198  }
199  for (unsigned int i = 0; i < m_doseOuter4000.size(); ++i) {
200  m_dose.push_back(m_integratedLumi / 4000 * m_doseOuter4000[i]);
201  }
202 }

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyArrayType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKeyArray>

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleBase>

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  t,
const SG::NotHandleType  
)
inlineprivateinherited

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleBase. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 245 of file AthCommonDataStore.h.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleKey. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 221 of file AthCommonDataStore.h.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This is the generic version, for types that do not derive from SG::VarHandleKey. It just forwards to the base class version of declareProperty.

Definition at line 333 of file AthCommonDataStore.h.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This dispatches to either the generic declareProperty or the one for VarHandle/Key/KeyArray.

Definition at line 352 of file AthCommonDataStore.h.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T > &  t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145  {
146  typedef typename SG::HandleClassifier<T>::type htype;
148  }

◆ detStore()

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

95 { return m_detStore; }

◆ electronicJitter()

float HGTD_TimingResolution::electronicJitter ( ) const
inlineprivate

Definition at line 164 of file HGTD_TimingResolution.cxx.

164  {
165  return m_electronicJitter;
166 }

◆ etaInRange()

bool HGTD_TimingResolution::etaInRange ( float  eta) const
private

Definition at line 174 of file HGTD_TimingResolution.cxx.

174  {
175  float radius = translateEta2R(eta);
176  return radiusInRange(radius);
177 }

◆ evtStore() [1/2]

ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

85 { return m_evtStore; }

◆ evtStore() [2/2]

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( ) const
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase &  ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ gain()

float HGTD_TimingResolution::gain ( float  radius) const
private

Definition at line 142 of file HGTD_TimingResolution.cxx.

142  {
143  float gain = 1.;
144 
145  if (radius < m_radii[0]) {
146  gain = m_gain[0];
147  return gain;
148  }
149 
150  for (unsigned int i = 1; i < m_radii.size(); i++) {
151 
152  if (radius < m_radii[i]) {
153  gain = m_gain[i - 1] +
154  (((radius - m_radii[i - 1]) / (m_radii[i] - m_radii[i - 1])) *
155  (m_gain[i] - m_gain[i - 1]));
156  return gain;
157  }
158  }
159 
160  gain = m_gain[m_gain.size() - 1];
161  return gain;
162 }

◆ hitTimingResolution()

float HGTD_TimingResolution::hitTimingResolution ( float  radius) const
private

Definition at line 111 of file HGTD_TimingResolution.cxx.

111  {
112  float sigmaT = sensorResolution(radius);
113  // include the effect of electronic jitter and add in quadrature
114  float sigmaT2 = sigmaT * sigmaT + m_electronicJitter * m_electronicJitter;
115  return std::sqrt(sigmaT2);
116 }

◆ initialize()

StatusCode HGTD_TimingResolution::initialize ( )
finaloverridevirtual

AlgTool initialize.

Definition at line 68 of file HGTD_TimingResolution.cxx.

68  {
69 
70  if (m_radii.size() != (m_doseInner1000.size() + m_doseMiddle2000.size() +
71  m_doseOuter4000.size())) {
73  "ERROR while initializing the HGTD timing resolution. Vector of "
74  "different size.");
75  return StatusCode::FAILURE;
76  }
77 
79 
80  return StatusCode::SUCCESS;
81 }

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ msg() [1/2]

MsgStream& AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24  {
25  return this->msgStream();
26  }

◆ msg() [2/2]

MsgStream& AthCommonMsg< AlgTool >::msg ( const MSG::Level  lvl) const
inlineinherited

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30  {
31  return this->msgLevel(lvl);
32  }

◆ outputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ print()

void HGTD_TimingResolution::print ( )

Definition at line 253 of file HGTD_TimingResolution.cxx.

253  {
254  ATH_MSG_VERBOSE("HGTD_TimingResolution version: " << m_version);
255  ATH_MSG_VERBOSE("Integrated Lumi: " << m_integratedLumi);
256  ATH_MSG_VERBOSE("Rmin = " << m_Rmin);
257  ATH_MSG_VERBOSE("Rmax = " << m_Rmax);
258  ATH_MSG_VERBOSE("Z = " << m_z);
259 
260  ATH_MSG_VERBOSE("");
261  for (unsigned int i = 0; i < m_resolution.size(); i++) {
262  ATH_MSG_VERBOSE("Resolution r = " << m_radii[i] << " mm "
264  << " ps");
265  ATH_MSG_VERBOSE("Gain r = " << m_radii[i] << " mm " << gain(m_radii[i]));
266  }
267 }

◆ propagateDamage()

StatusCode HGTD_TimingResolution::propagateDamage ( )
private

Definition at line 85 of file HGTD_TimingResolution.cxx.

85  {
86 
87  m_dose.clear();
88  m_resolution.clear();
89  m_gain.clear();
90  computeDose();
92  radToGain();
93 
94  return StatusCode::SUCCESS;
95 }

◆ radiusInRange()

bool HGTD_TimingResolution::radiusInRange ( float  radius) const
private

Definition at line 169 of file HGTD_TimingResolution.cxx.

169  {
170  return (std::fabs(radius) >= m_Rmin && std::fabs(radius) <= m_Rmax);
171 }

◆ radToGain()

void HGTD_TimingResolution::radToGain ( )
private

Definition at line 230 of file HGTD_TimingResolution.cxx.

230  {
231  for (unsigned int i = 0; i < m_dose.size(); i++) {
232  if (m_dose[i] < m_doseGain[0].first) {
233  m_gain.push_back(m_doseGain[0].second);
234  continue;
235  }
236  for (unsigned int j = 1; j < m_doseGain.size(); j++) {
237  if (m_dose[i] < m_doseGain[j].first) {
238  float gain = m_doseGain[j - 1].second +
239  (((m_dose[i] - m_doseGain[j - 1].first) /
240  (m_doseGain[j].first - m_doseGain[j - 1].first)) *
241  (m_doseGain[j].second - m_doseGain[j - 1].second));
242  m_gain.push_back(gain);
243  break;
244  }
245 
246  else if (j == m_doseGain.size() - 1) {
247  m_gain.push_back(m_doseGain[m_doseGain.size() - 1].second);
248  }
249  }
250  }
251 }

◆ radToResolution()

void HGTD_TimingResolution::radToResolution ( )
private

Definition at line 204 of file HGTD_TimingResolution.cxx.

204  {
205 
206  for (unsigned int i = 0; i < m_dose.size(); i++) {
207  if (m_dose[i] < m_doseResolution[0].first) {
208  m_resolution.push_back(m_doseResolution[0].second);
209  continue;
210  }
211  for (unsigned int j = 1; j < m_doseResolution.size(); j++) {
212  if (m_dose[i] < m_doseResolution[j].first) {
213  float res =
214  m_doseResolution[j - 1].second +
215  (((m_dose[i] - m_doseResolution[j - 1].first) /
218  m_resolution.push_back(res);
219  break;
220  }
221 
222  else if (j == m_doseResolution.size() - 1) {
223  m_resolution.push_back(
224  m_doseResolution[m_doseResolution.size() - 1].second);
225  }
226  }
227  }
228 }

◆ renounce()

std::enable_if_t<std::is_void_v<std::result_of_t<decltype(&T::renounce)(T)> > && !std::is_base_of_v<SG::VarHandleKeyArray, T> && std::is_base_of_v<Gaudi::DataHandle, T>, void> AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T &  h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381  {
382  h.renounce();
383  PBASE::renounce (h);
384  }

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364  {
365  handlesArray.renounce();
366  }

◆ resolution()

float HGTD_TimingResolution::resolution ( float  radius) const
private

Definition at line 119 of file HGTD_TimingResolution.cxx.

119  {
120  float resolution = 9999.;
121 
122  if (radius < m_radii[0]) {
124  return resolution;
125  }
126 
127  for (unsigned int i = 1; i < m_radii.size(); i++) {
128 
129  if (radius < m_radii[i]) {
130  resolution =
131  m_resolution[i - 1] +
132  (((radius - m_radii[i - 1]) / (m_radii[i] - m_radii[i - 1])) *
133  (m_resolution[i] - m_resolution[i - 1]));
134  return resolution;
135  }
136  }
137 
138  resolution = m_resolution[m_resolution.size() - 1];
139  return resolution;
140 }

◆ sensorResolution()

float HGTD_TimingResolution::sensorResolution ( float  radius) const
private

Definition at line 99 of file HGTD_TimingResolution.cxx.

99  {
100  float sigmaT = 99999.;
101  if (!radiusInRange(radius))
102  return sigmaT;
103  if (m_integratedLumi == 0)
104  sigmaT = m_resolution[0];
105  else
106  sigmaT = resolution(std::fabs(radius));
107  return sigmaT;
108 }

◆ simulatePulse()

HGTD_TimingResolution::PulseWaveform HGTD_TimingResolution::simulatePulse ( CLHEP::HepRandomEngine *  rndm_engine) const
private

Simulate a new pulse that can be acess using the PulseShape method.

Definition at line 269 of file HGTD_TimingResolution.cxx.

270  {
271 
272  PulseWaveform pulseWaveform{};
273  float pulseParameter[4] = {0};
274  pulseParameter[0] = 0.036; // Width (scale) parameter of Landau density
275  pulseParameter[1] =
276  5.754; // Most Probable (MP, location) parameter of Landau density
277  pulseParameter[3] = CLHEP::RandGaussZiggurat::shoot(
278  rndm_engine, 0.318,
280  0.1 * m_sensorNoiseFactor); // Width (sigma) of convoluted Gaussian
281  // function
282  pulseParameter[2] =
283  0.4785 + 1.4196 * pulseParameter[3]; // Total area (integral -inf to inf,
284  // normalization constant)
285 
286  // Convoluted Landau and Gaussian Fitting Function
287  // Adapted to simulate a pulse in an HGTD pad
288 
289  // Numeric constants
290  float invsq2pi = 1 / sqrt(2 * M_PI); // 0.3989422804014; // (2 pi)^(-1/2)
291  float mpshift = -0.22278298; // Landau maximum location
292 
293  // Variables
294  float mpc = pulseParameter[1] - mpshift * pulseParameter[0];
295  float step = 0.03;
296  float step_par = step / (sqrt(2) * pulseParameter[3]);
297  float f_weight = pulseParameter[2] * step * invsq2pi / pulseParameter[3];
298  float fland;
299  float p_time;
300 
301  // Convolution integral of Landau and Gaussian by sum
302  for (int i = 412; i < 527; i++) {
303 
304  fland = TMath::Landau(3.5 + (i * 0.005), mpc, pulseParameter[0]) /
305  pulseParameter[0];
306  p_time = (1.5 + (i % 6 - i) * 0.005) / (sqrt(2) * pulseParameter[3]);
307 
308  for (size_t point = i % 6; point < pulseWaveform.size(); point += 6) {
309  p_time += step_par;
310  pulseWaveform[point] += fland * exp16(-p_time * p_time);
311  }
312  }
313  for (size_t point = 0; point < pulseWaveform.size(); point++) {
314  pulseWaveform[point] = f_weight * pulseWaveform[point];
315  }
316 
317  return pulseWaveform;
318 }

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in DerivationFramework::CfAthAlgTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and asg::AsgMetadataTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ translateEta2R()

float HGTD_TimingResolution::translateEta2R ( float  eta) const
private

Definition at line 186 of file HGTD_TimingResolution.cxx.

186  {
187  return std::fabs(std::tan(std::atan(std::exp(-eta)) * 2.) * m_z);
188 }

◆ translateR2Eta()

float HGTD_TimingResolution::translateR2Eta ( float  radius) const
private

Definition at line 180 of file HGTD_TimingResolution.cxx.

180  {
181  return std::fabs(
182  -std::log(std::tan(std::atan(std::fabs(radius) / m_z) / 2.)));
183 }

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase &  )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308  {
309  // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310  // << " size: " << m_vhka.size() << endmsg;
311  for (auto &a : m_vhka) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
313  for (auto k : keys) {
314  k->setOwner(this);
315  }
316  }
317  }

Member Data Documentation

◆ HGTDFinalLuminosity

constexpr static float HGTD_TimingResolution::HGTDFinalLuminosity = 4000.0
staticconstexpr

Definition at line 41 of file HGTD_TimingResolution.h.

◆ HGTDInitialLuminosity

constexpr static float HGTD_TimingResolution::HGTDInitialLuminosity = 0.0
staticconstexpr

Definition at line 38 of file HGTD_TimingResolution.h.

◆ HGTDIntermediateLuminosity_post_Replacement

constexpr static float HGTD_TimingResolution::HGTDIntermediateLuminosity_post_Replacement = 2001.0
staticconstexpr

Definition at line 40 of file HGTD_TimingResolution.h.

◆ HGTDIntermediateLuminosity_pre_Replacement

constexpr static float HGTD_TimingResolution::HGTDIntermediateLuminosity_pre_Replacement = 2000.0
staticconstexpr

Definition at line 39 of file HGTD_TimingResolution.h.

◆ m_cfdThreshold

const float HGTD_TimingResolution::m_cfdThreshold = 0.5
private

Definition at line 105 of file HGTD_TimingResolution.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_dose

std::vector<float> HGTD_TimingResolution::m_dose {}
private

Definition at line 95 of file HGTD_TimingResolution.h.

◆ m_doseGain

std::vector<std::pair<float, float> > HGTD_TimingResolution::m_doseGain {}
private

Definition at line 100 of file HGTD_TimingResolution.h.

◆ m_doseInner1000

std::vector<float> HGTD_TimingResolution::m_doseInner1000 {}
private

Definition at line 92 of file HGTD_TimingResolution.h.

◆ m_doseMiddle2000

std::vector<float> HGTD_TimingResolution::m_doseMiddle2000 {}
private

Definition at line 93 of file HGTD_TimingResolution.h.

◆ m_doseOuter4000

std::vector<float> HGTD_TimingResolution::m_doseOuter4000 {}
private

Definition at line 94 of file HGTD_TimingResolution.h.

◆ m_doseResolution

std::vector<std::pair<float, float> > HGTD_TimingResolution::m_doseResolution {}
private

Definition at line 99 of file HGTD_TimingResolution.h.

◆ m_electronicJitter

float HGTD_TimingResolution::m_electronicJitter {}
private

Definition at line 86 of file HGTD_TimingResolution.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_gain

std::vector<float> HGTD_TimingResolution::m_gain {}
private

Definition at line 97 of file HGTD_TimingResolution.h.

◆ m_integratedLumi

FloatProperty HGTD_TimingResolution::m_integratedLumi
private
Initial value:
{this, "IntegratedLuminosity", 0.,
"Integrated Luminosity for smearing of LGAD "
"timing based on amount of radiation"}

Definition at line 82 of file HGTD_TimingResolution.h.

◆ m_radii

std::vector<int> HGTD_TimingResolution::m_radii {}
private

Definition at line 88 of file HGTD_TimingResolution.h.

◆ m_resolution

std::vector<float> HGTD_TimingResolution::m_resolution {}
private

Definition at line 96 of file HGTD_TimingResolution.h.

◆ m_Rmax

float HGTD_TimingResolution::m_Rmax {670.}
private

Definition at line 79 of file HGTD_TimingResolution.h.

◆ m_Rmin

float HGTD_TimingResolution::m_Rmin {120.}
private

Definition at line 78 of file HGTD_TimingResolution.h.

◆ m_sensorNoiseFactor

const float HGTD_TimingResolution::m_sensorNoiseFactor
private
Initial value:
=
0.0229

Definition at line 102 of file HGTD_TimingResolution.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_version

std::string HGTD_TimingResolution::m_version {""}
private

Definition at line 76 of file HGTD_TimingResolution.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.

◆ m_z

float HGTD_TimingResolution::m_z {3500.}
private

Definition at line 80 of file HGTD_TimingResolution.h.


The documentation for this class was generated from the following files:
HGTD_TimingResolution::PulseWaveform
std::array< float, 400 > PulseWaveform
Definition: HGTD_TimingResolution.h:44
beamspotman.r
def r
Definition: beamspotman.py:676
HGTD_TimingResolution::radToGain
void radToGain()
Definition: HGTD_TimingResolution.cxx:230
HGTD_TimingResolution::radiusInRange
bool radiusInRange(float) const
Definition: HGTD_TimingResolution.cxx:169
python.SystemOfUnits.second
int second
Definition: SystemOfUnits.py:120
HGTD_TimingResolution::sensorResolution
float sensorResolution(float radius) const
Definition: HGTD_TimingResolution.cxx:99
HGTD_TimingResolution::m_dose
std::vector< float > m_dose
Definition: HGTD_TimingResolution.h:95
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
HGTD_TimingResolution::resolution
float resolution(float) const
Definition: HGTD_TimingResolution.cxx:119
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
HGTD_TimingResolution::m_doseInner1000
std::vector< float > m_doseInner1000
Definition: HGTD_TimingResolution.h:92
HGTD_TimingResolution::m_cfdThreshold
const float m_cfdThreshold
Definition: HGTD_TimingResolution.h:105
HGTD_TimingResolution::propagateDamage
StatusCode propagateDamage()
Definition: HGTD_TimingResolution.cxx:85
M_PI
#define M_PI
Definition: ActiveFraction.h:11
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
HGTD_TimingResolution::m_gain
std::vector< float > m_gain
Definition: HGTD_TimingResolution.h:97
HGTD_TimingResolution::computeDose
void computeDose()
Definition: HGTD_TimingResolution.cxx:190
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
drawFromPickle.exp
exp
Definition: drawFromPickle.py:36
drawFromPickle.atan
atan
Definition: drawFromPickle.py:36
HGTD_TimingResolution::m_Rmax
float m_Rmax
Definition: HGTD_TimingResolution.h:79
HGTD_TimingResolution::m_doseOuter4000
std::vector< float > m_doseOuter4000
Definition: HGTD_TimingResolution.h:94
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
HGTD_TimingResolution::hitTimingResolution
float hitTimingResolution(float radius) const
Definition: HGTD_TimingResolution.cxx:111
HGTD_TimingResolution::m_electronicJitter
float m_electronicJitter
Definition: HGTD_TimingResolution.h:86
HGTD_TimingResolution::m_doseMiddle2000
std::vector< float > m_doseMiddle2000
Definition: HGTD_TimingResolution.h:93
HGTD_TimingResolution::calculatePulse
void calculatePulse(const PulseWaveform &pulseWaveform, std::map< int, std::pair< float, float >> &pulsebin, float t, float E, float *max, CLHEP::HepRandomEngine *rndm_engine) const
Calculate the pulse as a vector of float (400 points)
Definition: HGTD_TimingResolution.cxx:320
HGTD_TimingResolution::gain
float gain(float) const
Definition: HGTD_TimingResolution.cxx:142
HGTD_TimingResolution::m_Rmin
float m_Rmin
Definition: HGTD_TimingResolution.h:78
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
AthCommonDataStore
Definition: AthCommonDataStore.h:52
HGTD_TimingResolution::simulatePulse
PulseWaveform simulatePulse(CLHEP::HepRandomEngine *rndm_engine) const
Simulate a new pulse that can be acess using the PulseShape method.
Definition: HGTD_TimingResolution.cxx:269
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
ParticleGun_FastCalo_ChargeFlip_Config.energy
energy
Definition: ParticleGun_FastCalo_ChargeFlip_Config.py:78
lumiFormat.i
int i
Definition: lumiFormat.py:85
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
HGTD_TimingResolution::m_integratedLumi
FloatProperty m_integratedLumi
Definition: HGTD_TimingResolution.h:82
HGTD_TimingResolution::m_version
std::string m_version
Definition: HGTD_TimingResolution.h:76
res
std::pair< std::vector< unsigned int >, bool > res
Definition: JetGroupProductTest.cxx:14
test_pyathena.parent
parent
Definition: test_pyathena.py:15
HGTD_TimingResolution::radToResolution
void radToResolution()
Definition: HGTD_TimingResolution.cxx:204
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
drawFromPickle.tan
tan
Definition: drawFromPickle.py:36
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
HGTD_TimingResolution::m_doseGain
std::vector< std::pair< float, float > > m_doseGain
Definition: HGTD_TimingResolution.h:100
AthAlgTool::AthAlgTool
AthAlgTool()
Default constructor:
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
HGTD_TimingResolution::m_sensorNoiseFactor
const float m_sensorNoiseFactor
Definition: HGTD_TimingResolution.h:102
HGTD_TimingResolution::translateEta2R
float translateEta2R(float) const
Definition: HGTD_TimingResolution.cxx:186
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
VP1PartSpect::E
@ E
Definition: VP1PartSpectFlags.h:21
HGTD_TimingResolution::m_resolution
std::vector< float > m_resolution
Definition: HGTD_TimingResolution.h:96
HGTD_TimingResolution::m_doseResolution
std::vector< std::pair< float, float > > m_doseResolution
Definition: HGTD_TimingResolution.h:99
ParticleGun_SamplingFraction.radius
radius
Definition: ParticleGun_SamplingFraction.py:96
a
TList * a
Definition: liststreamerinfos.cxx:10
h
CaloSwCorrections.time
def time(flags, cells_name, *args, **kw)
Definition: CaloSwCorrections.py:242
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
DeMoScan.first
bool first
Definition: DeMoScan.py:536
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
LArCellBinning.step
step
Definition: LArCellBinning.py:158
HGTD_TimingResolution::m_radii
std::vector< int > m_radii
Definition: HGTD_TimingResolution.h:88
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
HGTD_TimingResolution::m_z
float m_z
Definition: HGTD_TimingResolution.h:80
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
fitman.k
k
Definition: fitman.py:528