ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
Trk::DetAnnealingMaker Class Reference

#include <DetAnnealingMaker.h>

Inheritance diagram for Trk::DetAnnealingMaker:
Collaboration diagram for Trk::DetAnnealingMaker:

Public Member Functions

virtual StatusCode initialize () override
 
virtual StatusCode finalize () override
 
 DetAnnealingMaker (const std::string &t, const std::string &n, const IInterface *p)
 Default constructor due to Athena interface. More...
 
virtual void reset (AnnealingState &state) const override
 Resets the annealing process to its beginning. More...
 
virtual void anneal (AnnealingState &state) const override
 One more annealing step. More...
 
virtual double getWeight (const AnnealingState &state, double chisq, const std::vector< double > &allchisq) const override
 Weight access method. More...
 
virtual double getWeight (const AnnealingState &state, double chisq) const override
 Weight access method. More...
 
virtual bool isEquilibrium (const AnnealingState &state) const override
 Equilibrium is reached (last scheduled temperature) More...
 
virtual double actualTemp (const AnnealingState &state) const override
 Access to the actual temperature value. More...
 

Private Attributes

std::vector< double > m_SetOfTemperatures
 A vector of temperatures, you will start from SetOfTemperature[0] and Anneal towards SetOfTemperature[last]. More...
 
double m_cutoff
 Weight will be insensitive to chi2 at order of magnitude of the cutoff... More...
 

Detailed Description

This class implements an annealing maker. The weight implemented is phi(chi2)=exp[-1/2.*chi2/Temp]

Author
N. Giacinto Piacquadio (for the Freiburg Group)

Definition at line 21 of file DetAnnealingMaker.h.

Constructor & Destructor Documentation

◆ DetAnnealingMaker()

Trk::DetAnnealingMaker::DetAnnealingMaker ( const std::string &  t,
const std::string &  n,
const IInterface *  p 
)

Default constructor due to Athena interface.

Definition at line 22 of file DetAnnealingMaker.cxx.

22  :
23  base_class(t,n,p),
25  m_cutoff(9.)
26  {
27  declareProperty("SetOfTemperatures", m_SetOfTemperatures);
28  declareProperty("Cutoff", m_cutoff);
29  }

Member Function Documentation

◆ actualTemp()

virtual double Trk::DetAnnealingMaker::actualTemp ( const AnnealingState &  state) const
inlineoverridevirtual

Access to the actual temperature value.

Definition at line 67 of file DetAnnealingMaker.h.

68  {
69  if (state >= m_SetOfTemperatures.size()) {
70  return m_SetOfTemperatures.back();
71  }
72  return m_SetOfTemperatures[state];
73  }

◆ anneal()

void Trk::DetAnnealingMaker::anneal ( AnnealingState &  state) const
overridevirtual

One more annealing step.

Definition at line 49 of file DetAnnealingMaker.cxx.

49  {
50 
51 //check if there are some temperatures
52  if (m_SetOfTemperatures.empty())
53  {
54  ATH_MSG_ERROR( "The vector SetOfTemperatures for the annealing is empty" );
55  }
56  //go one step further
57  ++state;
58  }

◆ finalize()

StatusCode Trk::DetAnnealingMaker::finalize ( )
overridevirtual

Definition at line 37 of file DetAnnealingMaker.cxx.

38  {
39  ATH_MSG_DEBUG( "Finalize successful" );
40  return StatusCode::SUCCESS;
41  }

◆ getWeight() [1/2]

double Trk::DetAnnealingMaker::getWeight ( const AnnealingState &  state,
double  chisq 
) const
overridevirtual

Weight access method.

Definition at line 73 of file DetAnnealingMaker.cxx.

75  {
76  double temp = actualTemp (state);
77  return gauss(chisq,temp)/(gauss(m_cutoff,temp)+gauss(chisq,temp));
78  }

◆ getWeight() [2/2]

double Trk::DetAnnealingMaker::getWeight ( const AnnealingState &  state,
double  chisq,
const std::vector< double > &  allchisq 
) const
overridevirtual

Weight access method.

Definition at line 60 of file DetAnnealingMaker.cxx.

63  {
64  double temp = actualTemp (state);
65  double allweight(0.);
66  for (double ch : allchisq) {
67  allweight+=gauss(ch,temp);
68  }
69  double actualweight(gauss(chisq,temp));
70  return actualweight/(gauss(m_cutoff,temp)+allweight);
71  }

◆ initialize()

StatusCode Trk::DetAnnealingMaker::initialize ( )
overridevirtual

Definition at line 31 of file DetAnnealingMaker.cxx.

32  {
33  ATH_MSG_DEBUG( "Initialize successful" );
34  return StatusCode::SUCCESS;
35  }

◆ isEquilibrium()

virtual bool Trk::DetAnnealingMaker::isEquilibrium ( const AnnealingState &  state) const
inlineoverridevirtual

Equilibrium is reached (last scheduled temperature)

Definition at line 59 of file DetAnnealingMaker.h.

60  {
61  return state >= m_SetOfTemperatures.size();
62  }

◆ reset()

void Trk::DetAnnealingMaker::reset ( AnnealingState &  state) const
overridevirtual

Resets the annealing process to its beginning.

Definition at line 43 of file DetAnnealingMaker.cxx.

44  {
45  state = 0;
46  ATH_MSG_DEBUG( "Annealing reset" );
47  }

Member Data Documentation

◆ m_cutoff

double Trk::DetAnnealingMaker::m_cutoff
private

Weight will be insensitive to chi2 at order of magnitude of the cutoff...

Definition at line 85 of file DetAnnealingMaker.h.

◆ m_SetOfTemperatures

std::vector<double> Trk::DetAnnealingMaker::m_SetOfTemperatures
private

A vector of temperatures, you will start from SetOfTemperature[0] and Anneal towards SetOfTemperature[last].

Definition at line 80 of file DetAnnealingMaker.h.


The documentation for this class was generated from the following files:
sendEI_SPB.ch
ch
Definition: sendEI_SPB.py:35
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
beamspotman.n
n
Definition: beamspotman.py:731
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
Trk::DetAnnealingMaker::m_SetOfTemperatures
std::vector< double > m_SetOfTemperatures
A vector of temperatures, you will start from SetOfTemperature[0] and Anneal towards SetOfTemperature...
Definition: DetAnnealingMaker.h:80
Trk::DetAnnealingMaker::actualTemp
virtual double actualTemp(const AnnealingState &state) const override
Access to the actual temperature value.
Definition: DetAnnealingMaker.h:67
python.SystemOfUnits.gauss
int gauss
Definition: SystemOfUnits.py:230
Trk::DetAnnealingMaker::m_cutoff
double m_cutoff
Weight will be insensitive to chi2 at order of magnitude of the cutoff...
Definition: DetAnnealingMaker.h:85