NCFS-Pack
A generic (astro)particle physics analysis framework
 
Loading...
Searching...
No Matches
NcPosition Class Reference

Handling of positions (with timestamps) in various reference frames. More...

#include "NcPosition.h"

Inheritance diagram for NcPosition:
Nc3Vector NcPositionObj NcSignal NcVertex NcCalcluster NcCalmodule NcDevice NcEvent IceGOM NcCalorimeter NcDetectorUnit NcTagger NcVeto RnoGANT IceEvent RnoEvent

Detailed Description

Handling of positions (with timestamps) in various reference frames.


Copyright(c) 1999 NCFS/IIHE, All Rights Reserved. *
*
Authors: The Netherlands Center for Fundamental Studies (NCFS). *
The Inter-university Institute for High Energies (IIHE). *
Website : http://www.iihe.ac.be *
Contact : Nick van Eijndhoven (nickve.nl@gmail.com) *
*
Contributors are mentioned in the code where appropriate. *
*
No part of this software may be used, copied, modified or distributed *
by any means nor transmitted or translated into machine language for *
commercial purposes without written permission by the IIHE representative. *
Permission to use the software strictly for non-commercial purposes *
is hereby granted without fee, provided that the above copyright notice *
appears in all copies and that both the copyright notice and this *
permission notice appear in the supporting documentation. *
This software is provided "as is" without express or implied warranty. *
The authors make no claims that this software is free of error, or is *
consistent with any particular standard of merchantability, or that it *
will meet your requirements for any particular application, other than *
indicated in the corresponding documentation. *
This software should not be relied on for solving a problem whose *
incorrect solution could result in injury to a person or loss of property. *
If you do use this software in such a manner, it is at your own risk. *
The authors disclaim all liability for direct or consequential damage *
resulting from your use of this software. *

// Class NcPosition
// Handling of positions in various reference frames.
//
// This class is meant to serve as a base class for ALICE objects
// that have a unique position in 3-dimensional space.
//
// Note :
// ------
// Positions (r), errors (e), reference frames (f) and angular units (u)
// are specified via
//
// SetPosition(Float_t* r,TString f,TString u)
// SetPositionErrors(Float_t* e,TString f,TString u)
//
// under the following conventions :
//
// f="car" ==> r in Cartesian coordinates (x,y,z)
// f="sph" ==> r in Spherical coordinates (r,theta,phi)
// f="cyl" ==> r in Cylindrical coordinates (rho,phi,z)
//
// u="rad" ==> angles in radians
// u="deg" ==> angles in degrees
//
// The "f" and "u" facilities only serve as a convenient user interface.
// Internally the actual storage of the various components is performed
// in a unique way. This allows setting/retrieval of vector components in a
// user selected frame/unit convention at any time.
//
// The metric unit scale for the coordinates can be defined by the user
// via the SetUnitScale() memberfunction.
// This enables standardised expressions using numerical values of
// physical constants by means of the GetUnitScale() memberfunction.
// By default the unit scale is set to meter, corresponding to invokation
// of SetUnitScale(1).
// The user can specify a certain required metric unit scale in retreiving
// position components and/or distances.
// Please refer to the corresponding member functions for further details.
//
//
// Example :
// ---------
//
// NcPosition q;
// Float_t pos[3]={-1,25,7};
// Float_t err[3]={0.08,1.85,0.5};
// q.SetPosition(pos,"car");
// q.SetPositionErrors(pos,"car");
// Float_t loc[3],dloc[3];
// q.GetPosition(loc,"sph","deg");
// q.GetPositionErrors(dloc,"sph","deg");
//
//--- Author: Nick van Eijndhoven 06-feb-1999 Utrecht University
//- Modified: Nick van Eijndhoven, IIHE-VUB, Brussel, May 4, 2021 10:49Z

Definition at line 17 of file NcPosition.h.

Public Member Functions

 NcPosition ()
 
 NcPosition (const NcPosition &p)
 
virtual ~NcPosition ()
 
virtual void Data (TString f="car", TString u="rad") const
 
Double_t GetDistance (NcPosition &p, Float_t scale=-1)
 
Double_t GetDistance (NcPosition *p, Float_t scale=-1)
 
NcPositionGetPosition ()
 
void GetPosition (Double_t *r, TString f, TString u="rad", Float_t s=-1) const
 
void GetPosition (Float_t *r, TString f, TString u="rad", Float_t s=-1) const
 
void GetPositionErrors (Double_t *e, TString f, TString u="rad", Float_t s=-1) const
 
void GetPositionErrors (Float_t *e, TString f, TString u="rad", Float_t s=-1) const
 
NcTimestampGetTimestamp ()
 
Float_t GetUnitScale () const
 
void RemoveTimestamp ()
 
void ResetPosition ()
 
void SetPosition (Double_t *r, TString f, TString u="rad")
 
void SetPosition (Double_t r1, Double_t r2, Double_t r3, TString f, TString u="rad")
 
void SetPosition (Float_t *r, TString f, TString u="rad")
 
void SetPosition (Nc3Vector &r)
 
void SetPositionErrors (Double_t *e, TString f, TString u="rad")
 
void SetPositionErrors (Double_t e1, Double_t e2, Double_t e3, TString f, TString u="rad")
 
void SetPositionErrors (Float_t *e, TString f, TString u="rad")
 
void SetTimestamp (NcTimestamp &t)
 
void SetUnitScale (Float_t s)
 
- Public Member Functions inherited from Nc3Vector
 Nc3Vector ()
 
 Nc3Vector (const Nc3Vector &v)
 
virtual ~Nc3Vector ()
 
Double_t ConvertAngle (Double_t a, TString in, TString out) const
 
Nc3Vector Cross (Nc3Vector &q) const
 
Double_t Dot (Nc3Vector &q)
 
void GetErrors (Double_t *e, TString f, TString u="rad") const
 
void GetErrors (Float_t *e, TString f, TString u="rad") const
 
Double_t GetNorm ()
 
virtual Double_t GetOpeningAngle (Nc3Vector &q, TString u="rad")
 
Nc3Vector GetPrimed (TRotMatrix *m) const
 
Double_t GetPseudoRapidity ()
 
Double_t GetResultError () const
 
Nc3Vector GetUnprimed (TRotMatrix *m) const
 
Nc3Vector GetVecLong () const
 
void GetVector (Double_t *v, TString f, TString u="rad") const
 
void GetVector (Float_t *v, TString f, TString u="rad") const
 
Nc3Vector GetVecTrans () const
 
Double_t GetX (Int_t i, TString f, TString u="rad")
 
Int_t HasErrors () const
 
Int_t HasVector () const
 
virtual void Load (Nc3Vector &q)
 
Nc3Vector operator* (Double_t s) const
 
Nc3Vectoroperator*= (Double_t s)
 
Nc3Vector operator+ (Nc3Vector &q) const
 
Nc3Vectoroperator+= (Nc3Vector &q)
 
Nc3Vector operator- (Nc3Vector &q) const
 
Nc3Vectoroperator-= (Nc3Vector &q)
 
Nc3Vector operator/ (Double_t s) const
 
Nc3Vectoroperator/= (Double_t s)
 
Nc3Vectoroperator= (const Nc3Vector &q)
 
void PrintAngle (Double_t a, TString in, TString out, Int_t ndig=1, Bool_t align=kFALSE) const
 
void SetErrors (Double_t *e, TString f, TString u="rad")
 
void SetErrors (Double_t e1, Double_t e2, Double_t e3, TString f, TString u="rad")
 
void SetErrors (Float_t *e, TString f, TString u="rad")
 
void SetVector (Double_t *v, TString f, TString u="rad")
 
void SetVector (Double_t v1, Double_t v2, Double_t v3, TString f, TString u="rad")
 
void SetVector (Float_t *v, TString f, TString u="rad")
 
virtual void SetZero ()
 

Protected Attributes

Float_t fScale
 
NcTimestampfTstamp
 
- Protected Attributes inherited from Nc3Vector
Double32_t fDresult
 ! Error on scalar result (e.g. norm or dotproduct)
 
Int_t fNv
 
Double32_t * fV
 

Constructor & Destructor Documentation

◆ NcPosition() [1/2]

NcPosition::NcPosition ( )
// Creation of an NcPosition object and initialisation of parameters.
// The unit scale for position coordinates is initialised to cm.

Definition at line 98 of file NcPosition.cxx.

◆ ~NcPosition()

NcPosition::~NcPosition ( )
virtual
// Destructor to delete dynamically allocated memory.

Definition at line 111 of file NcPosition.cxx.

◆ NcPosition() [2/2]

NcPosition::NcPosition ( const NcPosition & p)
// Copy constructor.

Definition at line 126 of file NcPosition.cxx.

Member Function Documentation

◆ Data()

void NcPosition::Data ( TString f = "car",
TString u = "rad" ) const
virtual
// Provide all position/time information within the coordinate frame f.
//
// The string argument "u" allows to choose between different angular units
// in case e.g. a spherical frame is selected.
// u = "rad" : angles provided in radians
// "deg" : angles provided in degrees
//
// The defaults are f="car" and u="rad".

Reimplemented from Nc3Vector.

Reimplemented in NcDetectorUnit, NcDevice, NcSignal, and NcVertex.

Definition at line 509 of file NcPosition.cxx.

◆ GetDistance() [1/2]

Double_t NcPosition::GetDistance ( NcPosition & p,
Float_t scale = -1 )
// Provide distance of the current NcPosition to position p.
// The error on the result can be obtained as usual by invoking
// GetResultError() afterwards.
//
// By default the distance will be provided in the metric unit scale of
// the current NcPosition.
// This implies that the results of r1.GetDistance(r2) and r2.GetDistance(r1)
// may be numerically different in case r1 and r2 have different metric units.
// However, the user can specify a required metric unit scale by specification
// of the scale parameter.
// The convention is that scale=1 corresponds to meter, so specification
// of scale=0.01 will provide the distance in cm.
// As such it is possible to obtain a correctly computed distance even in case
// the position coordinates have a different unit scale.
// However, it is recommended to work always with one single unit scale.

Definition at line 393 of file NcPosition.cxx.

◆ GetDistance() [2/2]

Double_t NcPosition::GetDistance ( NcPosition * p,
Float_t scale = -1 )
inline

Definition at line 31 of file NcPosition.h.

◆ GetPosition() [1/3]

NcPosition & NcPosition::GetPosition ( )
// Provide position.

Definition at line 247 of file NcPosition.cxx.

◆ GetPosition() [2/3]

void NcPosition::GetPosition ( Double_t * r,
TString f,
TString u = "rad",
Float_t s = -1 ) const
// Provide position according to reference frame f.
//
// The string argument "u" allows to choose between different angular units
// in case e.g. a spherical frame is selected.
// u = "rad" : angles provided in radians
// "deg" : angles provided in degrees
//
// The default is u="rad".
//
// By default the coordinates will be provided in the metric unit scale as
// stored in the NcPosition object.
// However, the user can select a different metric unit scale by
// specification of the scale parameter.
// The convention is that scale=1 corresponds to meter, so specification
// of scale=0.01 will provide the position coordinates in cm.

Definition at line 175 of file NcPosition.cxx.

◆ GetPosition() [3/3]

void NcPosition::GetPosition ( Float_t * r,
TString f,
TString u = "rad",
Float_t s = -1 ) const
// Provide position according to reference frame f.
//
// The string argument "u" allows to choose between different angular units
// in case e.g. a spherical frame is selected.
// u = "rad" : angles provided in radians
// "deg" : angles provided in degrees
//
// The default is u="rad".
//
// By default the coordinates will be provided in the metric unit scale as
// stored in the NcPosition object.
// However, the user can select a different metric unit scale by
// specification of the scale parameter.
// The convention is that scale=1 corresponds to meter, so specification
// of scale=0.01 will provide the position coordinates in cm.

Definition at line 220 of file NcPosition.cxx.

◆ GetPositionErrors() [1/2]

void NcPosition::GetPositionErrors ( Double_t * e,
TString f,
TString u = "rad",
Float_t s = -1 ) const
// Provide position errors according to reference frame f.
//
// The string argument "u" allows to choose between different angular units
// in case e.g. a spherical frame is selected.
// u = "rad" : angles provided in radians
// "deg" : angles provided in degrees
//
// The default is u="rad".
//
// By default the coordinate errors will be provided in the metric unit scale as
// stored in the NcPosition object.
// However, the user can select a different metric unit scale by
// specification of the scale parameter.
// The convention is that scale=1 corresponds to meter, so specification
// of scale=0.01 will provide the position coordinate errors in cm.

Definition at line 309 of file NcPosition.cxx.

◆ GetPositionErrors() [2/2]

void NcPosition::GetPositionErrors ( Float_t * e,
TString f,
TString u = "rad",
Float_t s = -1 ) const
// Provide position errors according to reference frame f.
//
// The string argument "u" allows to choose between different angular units
// in case e.g. a spherical frame is selected.
// u = "rad" : angles provided in radians
// "deg" : angles provided in degrees
//
// The default is u="rad".
//
// By default the coordinate errors will be provided in the metric unit scale as
// stored in the NcPosition object.
// However, the user can select a different metric unit scale by
// specification of the scale parameter.
// The convention is that scale=1 corresponds to meter, so specification
// of scale=0.01 will provide the position coordinate errors in cm.

Definition at line 354 of file NcPosition.cxx.

◆ GetTimestamp()

NcTimestamp * NcPosition::GetTimestamp ( )
// Provide the timestamp of this position.

Definition at line 483 of file NcPosition.cxx.

◆ GetUnitScale()

Float_t NcPosition::GetUnitScale ( ) const
// Provide the unit scale for the position coordinates.
// The scale is normalised w.r.t. the meter, so a unit scale of 0.01
// means that all position coordinates are in cm.

Definition at line 458 of file NcPosition.cxx.

◆ RemoveTimestamp()

void NcPosition::RemoveTimestamp ( )
// Remove the timestamp from this postion.

Definition at line 494 of file NcPosition.cxx.

◆ ResetPosition()

void NcPosition::ResetPosition ( )
// Reset the position and corresponding errors.
// When retrieved, values of 0 will be returned.

Definition at line 381 of file NcPosition.cxx.

◆ SetPosition() [1/4]

void NcPosition::SetPosition ( Double_t * r,
TString f,
TString u = "rad" )
// Store position according to reference frame f.
//
// The string argument "u" allows to choose between different angular units
// in case e.g. a spherical frame is selected.
// u = "rad" : angles provided in radians
// "deg" : angles provided in degrees
//
// The default is u="rad".

Definition at line 139 of file NcPosition.cxx.

◆ SetPosition() [2/4]

void NcPosition::SetPosition ( Double_t r1,
Double_t r2,
Double_t r3,
TString f,
TString u = "rad" )
// Store position according to reference frame f.
//
// The string argument "u" allows to choose between different angular units
// in case e.g. a spherical frame is selected.
// u = "rad" : angles provided in radians
// "deg" : angles provided in degrees
//
// The default is u="rad".

Definition at line 157 of file NcPosition.cxx.

◆ SetPosition() [3/4]

void NcPosition::SetPosition ( Float_t * r,
TString f,
TString u = "rad" )
// Store position according to reference frame f.
//
// The string argument "u" allows to choose between different angular units
// in case e.g. a spherical frame is selected.
// u = "rad" : angles provided in radians
// "deg" : angles provided in degrees
//
// The default is u="rad".

Definition at line 202 of file NcPosition.cxx.

◆ SetPosition() [4/4]

void NcPosition::SetPosition ( Nc3Vector & r)
// Set position.

Definition at line 258 of file NcPosition.cxx.

◆ SetPositionErrors() [1/3]

void NcPosition::SetPositionErrors ( Double_t * e,
TString f,
TString u = "rad" )
// Store position errors according to reference frame f.
//
// The string argument "u" allows to choose between different angular units
// in case e.g. a spherical frame is selected.
// u = "rad" : angles provided in radians
// "deg" : angles provided in degrees
//
// The default is u="rad".

Definition at line 273 of file NcPosition.cxx.

◆ SetPositionErrors() [2/3]

void NcPosition::SetPositionErrors ( Double_t e1,
Double_t e2,
Double_t e3,
TString f,
TString u = "rad" )
// Store position errors according to reference frame f.
//
// The string argument "u" allows to choose between different angular units
// in case e.g. a spherical frame is selected.
// u = "rad" : angles provided in radians
// "deg" : angles provided in degrees
//
// The default is u="rad".

Definition at line 291 of file NcPosition.cxx.

◆ SetPositionErrors() [3/3]

void NcPosition::SetPositionErrors ( Float_t * e,
TString f,
TString u = "rad" )
// Store position errors according to reference frame f.
//
// The string argument "u" allows to choose between different angular units
// in case e.g. a spherical frame is selected.
// u = "rad" : angles provided in radians
// "deg" : angles provided in degrees
//
// The default is u="rad".

Definition at line 336 of file NcPosition.cxx.

◆ SetTimestamp()

void NcPosition::SetTimestamp ( NcTimestamp & t)
// Store the timestamp for this position.

Definition at line 471 of file NcPosition.cxx.

◆ SetUnitScale()

void NcPosition::SetUnitScale ( Float_t s)
// Set the unit scale for the position coordinates.
// The scale is normalised w.r.t. the meter, so setting the unit scale
// to 0.01 means that all position coordinates are in cm.
// By default the unit scale is set to meter in the NcPosition constructor.
// It is recommended to use one single unit scale throughout a complete
// analysis and/or simulation project.
//
// Note : This memberfunction does not modify the numerical values of
// the position coordinates.
// It only specifies their numerical meaning.

Definition at line 431 of file NcPosition.cxx.

Member Data Documentation

◆ fScale

Float_t NcPosition::fScale
protected

Definition at line 46 of file NcPosition.h.

◆ fTstamp

NcTimestamp* NcPosition::fTstamp
protected

Definition at line 47 of file NcPosition.h.


The documentation for this class was generated from the following files: