Belle II Software  release-05-02-19
TOPalign Class Reference

Alignment of a TOP module: core of the method is coded in fortran. More...

#include <TOPalign.h>

Collaboration diagram for TOPalign:

Public Member Functions

 TOPalign ()
 Constructor.
 
void setModuleID (int moduleID)
 Sets module ID. More...
 
void setSteps (double position, double angle, double time, double refind)
 Sets steps for numerical calculation of derivatives. More...
 
void setGrid (int NP, int NC)
 Sets grid for averaging of time-of-propagation in analytic PDF. More...
 
void setParameters (const std::vector< double > &parInit)
 Sets initial values of parameters (overwrites current parameters!) Order is: translations in x, y, z, rotation angles around x, y, z, t0, dn/n. More...
 
void fixParameter (const std::string &name)
 Fixes parameter with its name given as argument. More...
 
void unfixParameter (const std::string &name)
 Unfixes parameter with its name given as argument. More...
 
void unfixAll ()
 Unfixes all parameters.
 
int iterate (const TOPtrack &track, const Const::ChargedStable &hypothesis)
 Run a single iteration. More...
 
void reset ()
 Reset the object.
 
int getModuleID () const
 Returns module ID. More...
 
const std::vector< float > & getParameters () const
 Returns alignment parameters. More...
 
const std::vector< std::string > & getParameterNames () const
 Returns alignment parameter names. More...
 
std::vector< float > getErrors () const
 Returns errors on alignment parameters. More...
 
const std::vector< float > & getErrorMatrix () const
 Returns error matrix of alignment parameters. More...
 
int getNumTracks () const
 Returns track counter. More...
 
int getNumUsedTracks () const
 Returns number of tracks used in current result. More...
 
bool isValid () const
 Checks if the results are valid. More...
 
int getNumOfPhotons () const
 Returns number of photons used for log likelihood calculation. More...
 

Static Public Member Functions

static void clearData ()
 Clear data list.
 
static int addData (int moduleID, int pixelID, double time, double timeError)
 Add data. More...
 
static void setPhotonYields (double bkgPerModule, double scaleN0=1)
 Sets expected photon yields. More...
 

Private Attributes

int m_moduleID = 0
 module ID
 
int m_opt = 0
 PDF option (=rough)
 
int m_NP = 0
 grid for averaging: number of emission points along track
 
int m_NC = 0
 grid for averaging: number of Cerenkov angles
 
std::vector< std::string > m_parNames
 parameter names
 
std::vector< float > m_parInit
 initial parameter values
 
std::vector< float > m_par
 current parameter values
 
std::vector< float > m_steps
 step sizes
 
std::vector< float > m_maxDpar
 maximal parameter changes in one iteration
 
std::vector< bool > m_fixed
 true if parameter is fixed
 
std::vector< float > m_COV
 covariance matrix
 
int m_numTracks = 0
 track counter
 
int m_numUsedTracks = 0
 number of tracks used
 
bool m_valid = false
 validity of results
 
int m_numPhotons = 0
 number of photons used for log likelihood calculation
 
std::vector< double > m_U
 matrix (neg. More...
 

Detailed Description

Alignment of a TOP module: core of the method is coded in fortran.

Definition at line 38 of file TOPalign.h.

Member Function Documentation

◆ addData()

int addData ( int  moduleID,
int  pixelID,
double  time,
double  timeError 
)
static

Add data.

Parameters
moduleIDmodule ID
pixelIDpixel ID (e.g. software channel, 1-based)
timeTBC and local T0 corrected time in [ns]
timeErrortime uncertainty in [ns]
Returns
data size (or 0/negative on error)

Definition at line 78 of file TOPalign.cc.

79  {
80  int status = 0;
81  moduleID--; // 0-based ID used in fortran
82  pixelID--; // 0-based ID used in fortran
83  float t = (float) time;
84  float terr = (float) timeError;
85  data_put_(&moduleID, &pixelID, &t, &terr, &status);
86  switch (status) {
87  case 0:
88  B2WARNING("addData: no space available in /TOP_DATA/");
89  return status;
90  case -1:
91  B2ERROR("addData: invalid module ID."
92  << LogVar("moduleID", moduleID + 1));
93  return status;
94  case -2:
95  B2ERROR("addData: invalid pixel ID."
96  << LogVar("pixelID", pixelID + 1));
97  return status;
98  case -3:
99  B2DEBUG(100, "addData: digit should already be masked-out (different masks used?)");
100  return status;
101  default:
102  return status;
103  }
104  }

◆ fixParameter()

void fixParameter ( const std::string &  name)
inline

Fixes parameter with its name given as argument.

Parameters
nameparameter name

Definition at line 111 of file TOPalign.h.

111  : invalid parameter name '" << name << "'");
112  }
113 
118  void unfixParameter(const std::string& name)
119  {
120  for (unsigned i = 0; i < m_parNames.size(); i++) {

◆ getErrorMatrix()

const std::vector<float>& getErrorMatrix ( ) const
inline

Returns error matrix of alignment parameters.

Returns
error matrix (N x N symmetric matrix as a std::vector of N*N components)

Definition at line 188 of file TOPalign.h.

◆ getErrors()

std::vector< float > getErrors ( ) const

Returns errors on alignment parameters.

Order is: translations in x, y, z, rotation angles around x, y, z, t0, dn/n

Returns
errors

Definition at line 183 of file TOPalign.cc.

◆ getModuleID()

int getModuleID ( ) const
inline

Returns module ID.

Returns
module ID

Definition at line 162 of file TOPalign.h.

◆ getNumOfPhotons()

int getNumOfPhotons ( ) const
inline

Returns number of photons used for log likelihood calculation.

Returns
number of photons or -1 if track doesn't hit the bar (no log likelihood)

Definition at line 212 of file TOPalign.h.

◆ getNumTracks()

int getNumTracks ( ) const
inline

Returns track counter.

Returns
number of tracks

Definition at line 194 of file TOPalign.h.

◆ getNumUsedTracks()

int getNumUsedTracks ( ) const
inline

Returns number of tracks used in current result.

Returns
number of tracks

Definition at line 200 of file TOPalign.h.

◆ getParameterNames()

const std::vector<std::string>& getParameterNames ( ) const
inline

Returns alignment parameter names.

Returns
parameter names

Definition at line 175 of file TOPalign.h.

◆ getParameters()

const std::vector<float>& getParameters ( ) const
inline

Returns alignment parameters.

Order is: translations in x, y, z, rotation angles around x, y, z, t0, dn/n

Returns
parameters

Definition at line 169 of file TOPalign.h.

◆ isValid()

bool isValid ( ) const
inline

Checks if the results are valid.

Returns
true if results valid

Definition at line 206 of file TOPalign.h.

◆ iterate()

int iterate ( const TOPtrack track,
const Const::ChargedStable hypothesis 
)

Run a single iteration.

Parameters
tracktrack parameters
hypothesisparticle hypothesis
Returns
error status (0 = OK, < 0 no track hit, > 0 matrix not pos. definite)

Definition at line 114 of file TOPalign.cc.

◆ setGrid()

void setGrid ( int  NP,
int  NC 
)
inline

Sets grid for averaging of time-of-propagation in analytic PDF.

Parameters
NPnumber of emission points along track
NCnumber of Cerenkov angles

Definition at line 88 of file TOPalign.h.

◆ setModuleID()

void setModuleID ( int  moduleID)
inline

Sets module ID.

Parameters
moduleIDmodule ID

Definition at line 72 of file TOPalign.h.

◆ setParameters()

void setParameters ( const std::vector< double > &  parInit)
inline

Sets initial values of parameters (overwrites current parameters!) Order is: translations in x, y, z, rotation angles around x, y, z, t0, dn/n.

Parameters
parInitinitial values

Definition at line 99 of file TOPalign.h.

◆ setPhotonYields()

void setPhotonYields ( double  bkgPerModule,
double  scaleN0 = 1 
)
static

Sets expected photon yields.

Parameters
bkgPerModuleestimation for minimal number of background hits
scaleN0scale factor for figure-of-merit N0

Definition at line 106 of file TOPalign.cc.

◆ setSteps()

void setSteps ( double  position,
double  angle,
double  time,
double  refind 
)

Sets steps for numerical calculation of derivatives.

Parameters
positionstep size for translations [cm]
anglestep size for rotations [radians]
timestep size for T0 [ns]
refindstep size for refractive index scale factor

Definition at line 59 of file TOPalign.cc.

◆ unfixParameter()

void unfixParameter ( const std::string &  name)
inline

Unfixes parameter with its name given as argument.

Parameters
nameparameter name

Definition at line 126 of file TOPalign.h.

Member Data Documentation

◆ m_U

std::vector<double> m_U
private

matrix (neg.

sum of second derivatives)

Definition at line 233 of file TOPalign.h.


The documentation for this class was generated from the following files:
LogVar
Class to store variables with their name which were sent to the logging service.
Definition: LogVariableStream.h:24