SatAndLight  2.2.2-hubble
Simulation toolkit for space telescopes
CameraRead Class Reference

Read a camera sequence. More...

#include <CameraRead.h>

Inheritance diagram for CameraRead:
Collaboration diagram for CameraRead:

Public Member Functions

int GetAmplitudeNbits (void)
 Returns the current camera number of bits to encode the raw amplitude. More...
 
int GetEntry (Long64_t entry=0, Int_t getall=0)
 Gets a new Camera entry. More...
 
TH2F * GetGainMap (void)
 Returns a pointer to the current gain map. More...
 
int GetHitN (void)
 Returns the current number of hits. More...
 
int GetHitParticleIndex (const UInt_t aHitIndex)
 Returns the particle index for a given hit index. More...
 
int GetHitSourceIndex (const UInt_t aHitIndex)
 Returns the source index for a given hit index. More...
 
double GetHitY (const UInt_t aHitIndex)
 Returns the Y position (intrinsic coordinates) for a given hit index. More...
 
double GetHitZ (const UInt_t aHitIndex)
 Returns the Z position (intrinsic coordinates) for a given hit index. More...
 
TH2S * GetMap (const CAMERA_MAPTYPE aMapType=pixamplitude)
 Returns a pointer to the current map. More...
 
TH2S * GetMapThreshold (TH2S *aAmplitudeThresholdMap)
 Returns the camera amplitude map after thresholding. More...
 
UInt_t GetNy (void)
 Returns the current number of pixels in the Y direction. More...
 
UInt_t GetNz (void)
 Returns the current number of pixels in the Z direction. More...
 
double GetPhotonResolutionY (void)
 Returns the current photon resolution (Y). More...
 
double GetPhotonResolutionZ (void)
 Returns the current photon resolution (Z). More...
 
int GetPixelAmplitudeMax (void)
 Returns the current camera pixel maximum amplitude range value. More...
 
int GetPixelError (const CAMERA_MAPTYPE aMapType, const int aPixIndexY, const int aPixIndexZ)
 Returns current error value of a given pixel and for a selected map type. More...
 
int GetPixelValue (const CAMERA_MAPTYPE aMapType, const int aPixIndexY, const int aPixIndexZ)
 Returns current value of a given pixel and for a selected map type. More...
 
double GetSizeX (void)
 Returns the current camera size in the X direction \([\mathrm{mm}]\). More...
 
double GetSizeY (void)
 Returns the current camera size in the Y direction \([\mathrm{mm}]\). More...
 
double GetSizeZ (void)
 Returns the current camera size in the Z direction \([\mathrm{mm}]\). More...
 
void GetSortedPixelIndex (int &aPixIndexY, int &aPixIndexZ, const int aPixIndex, const string aSortMethod="STANDARD")
 Returns the pixel indices (Y/Z) in a pre-defined order. More...
 
double GetThreshold (void)
 Returns the camera threshold. More...
 
ULong64_t GetTime (void)
 Returns the current camera time \([\mathrm{ms}]\). More...
 
ULong64_t GetTimeMaximum (void)
 Returns the maximum camera time \([\mathrm{ms}]\). More...
 
ULong64_t GetTimeMinimum (void)
 Returns the minimum camera time \([\mathrm{ms}]\). More...
 
UInt_t GetTimeResolution (void)
 Returns the current camera time resolution \([\mathrm{ms}]\). More...
 
UInt_t GetTimeResolutionMaximum (void)
 Returns the maximum camera time resolution \([\mathrm{ms}]\). More...
 
UInt_t GetTimeResolutionMinimum (void)
 Returns the minimum camera time resolution \([\mathrm{ms}]\). More...
 
void SetThreshold (const double aThreshold)
 Sets the camera threshold. More...
 
bool SetTime (const ULong64_t aTime)
 Sets the camera time. More...
 
Constructors and destructors
 CameraRead (const string aFilePattern, const string aName)
 CameraRead class constuctor. More...
 
virtual ~CameraRead (void)
 CameraRead class destructor. More...
 
- Public Member Functions inherited from Rotation
double GetAlpha (void)
 Returns the current value of \(\alpha\) [rad]. More...
 
double GetBeta (void)
 Returns the current value of \(\beta\) [rad]. More...
 
double GetCosAlpha (void)
 Returns the current value of \(\cos(\alpha)\). More...
 
double GetCosBeta (void)
 Returns the current value of \(\cos(\beta)\). More...
 
double GetCosGamma (void)
 Returns the current value of \(\cos(\gamma)\). More...
 
double GetGamma (void)
 Returns the current value of \(\gamma\) [rad]. More...
 
double GetOmega (void)
 Returns the current value of \(\omega\). More...
 
double GetPsi (void)
 Returns the current value of \(\Psi\). More...
 
double GetRotationAngle (void)
 Returns the rotation angle from \(\cal{R}^{\prime}\) to \(\cal{R}\) [rad]. More...
 
double GetRotationAxisXp (void)
 Returns the \(x^{\prime}\) component in \(\cal{R}^{\prime}\) of a vector defining the rotation axis from \(\cal{R}^{\prime}\) to \(\cal{R}\). More...
 
double GetRotationAxisYp (void)
 Returns the \(y^{\prime}\) component in \(\cal{R}^{\prime}\) of a vector defining the rotation axis from \(\cal{R}^{\prime}\) to \(\cal{R}\). More...
 
double GetRotationAxisZp (void)
 Returns the \(z^{\prime}\) component in \(\cal{R}^{\prime}\) of a vector defining the rotation axis from \(\cal{R}^{\prime}\) to \(\cal{R}\). More...
 
double GetRxx ()
 Returns the rotation matrix element \(R_{xx}\). More...
 
double GetRxy ()
 Returns the rotation matrix element \(R_{xy}\). More...
 
double GetRxz ()
 Returns the rotation matrix element \(R_{xz}\). More...
 
double GetRyx ()
 Returns the rotation matrix element \(R_{yx}\). More...
 
double GetRyy ()
 Returns the rotation matrix element \(R_{yy}\). More...
 
double GetRyz ()
 Returns the rotation matrix element \(R_{yz}\). More...
 
double GetRzx ()
 Returns the rotation matrix element \(R_{zx}\). More...
 
double GetRzy ()
 Returns the rotation matrix element \(R_{zy}\). More...
 
double GetRzz ()
 Returns the rotation matrix element \(R_{zz}\). More...
 
double GetSinAlpha (void)
 Returns the current value of \(\sin(\alpha)\). More...
 
double GetSinBeta (void)
 Returns the current value of \(\sin(\beta)\). More...
 
double GetSinGamma (void)
 Returns the current value of \(\sin(\gamma)\). More...
 
double GetUpx (const double aThetaPrime, const double aPhiPrime)
 Returns the \(u^{\prime}_x\) coordinate in the \(\cal{R}^{\prime}\) reference frame. More...
 
double GetUpy (const double aThetaPrime, const double aPhiPrime)
 Returns the \(u^{\prime}_y\) coordinate in the \(\cal{R}^{\prime}\) reference frame. More...
 
double GetUpz (const double aThetaPrime)
 Returns the \(u^{\prime}_z\) coordinate in the \(\cal{R}^{\prime}\) reference frame. More...
 
double GetUx (const double aTheta)
 Returns the \(u_x\) coordinate in the \(\cal{R}\) reference frame. More...
 
double GetUy (const double aTheta, const double aPhi)
 Returns the \(u_y\) coordinate in the \(\cal{R}\) reference frame. More...
 
double GetUz (const double aTheta, const double aPhi)
 Returns the \(u_z\) coordinate in the \(\cal{R}\) reference frame. More...
 
void SetAlpha (const double aAlpha=0.0)
 Sets a new \(\alpha\) value. More...
 
void SetAlphaBetaGamma (const double aAlpha, const double aBeta, const double aGamma)
 Sets Euler angles, \(\alpha, \beta, \gamma\), for the rotation. More...
 
void SetBeta (const double aBeta=0.0)
 Sets a new \(\beta\) value. More...
 
void SetGamma (const double aGamma=0.0)
 Sets a new \(\gamma\) value. More...
 
void SetUnitQuaternion (const double aQ0, const double aQ1, const double aQ2, const double aQ3, const bool aRtoRprime=true)
 Sets Euler angles from a unit quaternion. More...
 
double TransformGetCosPhi (const double aThetaPrime, const double aPhiPrime)
 Returns the \(\cos\varphi\) in the reference frame \(\cal{R}\). More...
 
double TransformGetCosPhiPrime (const double aTheta, const double aPhi)
 Returns the \(\cos\varphi^{\prime}\) in the reference frame \(\cal{R}^{\prime}\). More...
 
double TransformGetCosTheta (const double aThetaPrime, const double aPhiPrime)
 Returns the \(\cos\theta\) in the reference frame \(\cal{R}\). More...
 
double TransformGetCosThetaPrime (const double aTheta, const double aPhi)
 Returns the \(\cos\theta^{\prime}\) in the reference frame \(\cal{R}^{\prime}\). More...
 
double TransformGetSinPhi (const double aThetaPrime, const double aPhiPrime)
 Returns the \(\sin\varphi\) in the reference frame \(\cal{R}\). More...
 
double TransformGetSinPhiPrime (const double aTheta, const double aPhi)
 Returns the \(\sin\varphi^{\prime}\) in the reference frame \(\cal{R}^{\prime}\). More...
 
double TransformGetSinTheta (const double aThetaPrime, const double aPhiPrime)
 Returns the \(\sin\theta\) in the reference frame \(\cal{R}\). More...
 
double TransformGetSinThetaPrime (const double aTheta, const double aPhi)
 Returns the \(\sin\theta^{\prime}\) in the reference frame \(\cal{R}^{\prime}\). More...
 
double TransformGetTanPhi (const double aThetaPrime, const double aPhiPrime)
 Returns the \(\tan\varphi\) in the reference frame \(\cal{R}\). More...
 
double TransformGetTanPhiPrime (const double aTheta, const double aPhi)
 Returns the \(\tan\varphi^{\prime}\) in the reference frame \(\cal{R}^{\prime}\). More...
 
double TransformGetTanTheta (const double aThetaPrime, const double aPhiPrime)
 Returns the \(\tan\theta\) in the reference frame \(\cal{R}\). More...
 
double TransformGetTanThetaCosPhi (const double aThetaPrime, const double aPhiPrime)
 Returns the \(\tan\theta\cos\varphi\) in the reference frame \(\cal{R}\). More...
 
double TransformGetTanThetaPrime (const double aTheta, const double aPhi)
 Returns the \(\tan\theta^{\prime}\) in the reference frame \(\cal{R}^{\prime}\). More...
 
double TransformGetTanThetaSinPhi (const double aThetaPrime, const double aPhiPrime)
 Returns the \(\tan\theta\sin\varphi\) in the reference frame \(\cal{R}\). More...
 
 Rotation (const double aAlpha, const double aBeta, const double aGamma)
 Rotation class constuctor. More...
 
virtual ~Rotation (void)
 Rotation class destructor. More...
 

Private Member Functions

void ApplyThreshold (TH2S *aAmplitudeThresholdMap)
 Apply threshold on the current amplitude map. More...
 

Private Attributes

UInt_t cam_dt
 resolution time \([\mathrm{ms}]\). More...
 
TH2F * cam_gain
 gain map. More...
 
int cam_hitastro [CAMERA_NHITMAX]
 hit astro-particle index. More...
 
int cam_hitn
 number of hits. More...
 
int cam_hitsrc [CAMERA_NHITMAX]
 hit source index. More...
 
double cam_hity [CAMERA_NHITMAX]
 hit position in the Y direction. More...
 
double cam_hitz [CAMERA_NHITMAX]
 hit position in the Z direction. More...
 
TH2S * cam_map [pixntype]
 pixel maps. More...
 
TH2S * cam_map_proc
 image after processing. More...
 
int cam_nbits
 number of bits to encode the raw amplitude. More...
 
double cam_photon_resy
 Gaussian width for photons (Y). More...
 
double cam_photon_resz
 Gaussian width for photons (Z). More...
 
double cam_threshold
 threshold. More...
 
ULong64_t cam_time
 camera time \([\mathrm{ms}]\). More...
 
double cam_xsize
 physical size in the X direction \([\mathrm{mm}]\). More...
 
double cam_ysize
 physical size in the Y direction \([\mathrm{mm}]\). More...
 
double cam_zsize
 physical size in the Z direction \([\mathrm{mm}]\). More...
 

Additional Inherited Members

- Protected Attributes inherited from Rotation
double rot_alpha
 Euler angle \(\alpha\). More...
 
double rot_beta
 Euler angle \(\beta\). More...
 
double rot_gamma
 Euler angle \(\gamma\). More...
 

Detailed Description

Read a camera sequence.

A sequence of camera pictures, saved in ROOT files, is extracted. This class offers many methods to read the sequence and the camera/pixels attributes. Use the TChain methods to navigate through the pictures.

Author
Florent Robinet

Constructor & Destructor Documentation

◆ CameraRead()

CameraRead::CameraRead ( const string  aFilePattern,
const string  aName 
)

CameraRead class constuctor.

The camera sequence is extracted from the list of ROOT files given in argument. The first camera picture is loaded.

Parameters
[in]aFilePatternROOT file pattern where the camera sequence is saved.
[in]aNameTTree name (sub-directories are supported).

◆ ~CameraRead()

CameraRead::~CameraRead ( void  )
virtual

CameraRead class destructor.

Member Function Documentation

◆ ApplyThreshold()

void CameraRead::ApplyThreshold ( TH2S *  aAmplitudeThresholdMap)
private

Apply threshold on the current amplitude map.

The current amplitude map is applied the amplitude threshold set with SetThreshold(). Only pixels above threshold are saved.

Two threshold procedures are implemented:

  • if aAmplitudeThresholdMap == NULL: the pixel threshold is computed with the internal READ and DARK noise maps: \(\Xi_{ij} + \Lambda_{ij} + \kappa\sqrt{\xi^2_{ij} + \lambda^2_{ij}}\), where \(\kappa\) is the threshold value set with SetThreshold().
  • if aAmplitudeThresholdMap != NULL: the input map is used to threshold pixels.
    Parameters
    [in]aAmplitudeThresholdMapInput threshold map. Use a pointer to NULL to derive the threshold from the internal READ and DARK noise maps.

◆ GetAmplitudeNbits()

int CameraRead::GetAmplitudeNbits ( void  )
inline

Returns the current camera number of bits to encode the raw amplitude.

◆ GetEntry()

int CameraRead::GetEntry ( Long64_t  entry = 0,
Int_t  getall = 0 
)
inline

Gets a new Camera entry.

This function overloads TChain::GetEntry() and should be the only one used! Indeed, on top of of loading the TChain entry, this function also updates the Rotation Euler angles.

Parameters
[in]entryCamera entry number.
[in]getall= 0: get only active branches, = 1 : get all branches
Returns
The total number of bytes read, 0 bytes read indicates a failure

◆ GetGainMap()

TH2F* CameraRead::GetGainMap ( void  )
inline

Returns a pointer to the current gain map.

◆ GetHitN()

int CameraRead::GetHitN ( void  )
inline

Returns the current number of hits.

◆ GetHitParticleIndex()

int CameraRead::GetHitParticleIndex ( const UInt_t  aHitIndex)
inline

Returns the particle index for a given hit index.

Parameters
[in]aHitIndexHit index.
Precondition
aHitIndex must be a valid hit index (less than the number of hits returned by GetHitN()).

◆ GetHitSourceIndex()

int CameraRead::GetHitSourceIndex ( const UInt_t  aHitIndex)
inline

Returns the source index for a given hit index.

Parameters
[in]aHitIndexHit index.
Precondition
aHitIndex must be a valid hit index (less than the number of hits returned by GetHitN()).

◆ GetHitY()

double CameraRead::GetHitY ( const UInt_t  aHitIndex)
inline

Returns the Y position (intrinsic coordinates) for a given hit index.

Parameters
[in]aHitIndexHit index.
Precondition
aHitIndex must be a valid hit index (less than the number of hits returned by GetHitN()).

◆ GetHitZ()

double CameraRead::GetHitZ ( const UInt_t  aHitIndex)
inline

Returns the Z position (intrinsic coordinates) for a given hit index.

Parameters
[in]aHitIndexHit index.
Precondition
aHitIndex must be a valid hit index (less than the number of hits returned by GetHitN()).

◆ GetMap()

TH2S* CameraRead::GetMap ( const CAMERA_MAPTYPE  aMapType = pixamplitude)
inline

Returns a pointer to the current map.

Parameters
[in]aMapTypeMap type, see CAMERA_MAPTYPE.

◆ GetMapThreshold()

TH2S * CameraRead::GetMapThreshold ( TH2S *  aAmplitudeThresholdMap)

Returns the camera amplitude map after thresholding.

A processed map is built applying the method described in ApplyThreshold().

Parameters
[in]aAmplitudeThresholdMapInput threshold map. Use a pointer to NULL to derive the threshold from the internal READ and DARK noise maps.
Returns
A pointer to NULL if the processed map cannot be computed.
Warning
Do not delete the returned map, it is internal to this class.

◆ GetNy()

UInt_t CameraRead::GetNy ( void  )
inline

Returns the current number of pixels in the Y direction.

◆ GetNz()

UInt_t CameraRead::GetNz ( void  )
inline

Returns the current number of pixels in the Z direction.

◆ GetPhotonResolutionY()

double CameraRead::GetPhotonResolutionY ( void  )
inline

Returns the current photon resolution (Y).

◆ GetPhotonResolutionZ()

double CameraRead::GetPhotonResolutionZ ( void  )
inline

Returns the current photon resolution (Z).

◆ GetPixelAmplitudeMax()

int CameraRead::GetPixelAmplitudeMax ( void  )
inline

Returns the current camera pixel maximum amplitude range value.

◆ GetPixelError()

int CameraRead::GetPixelError ( const CAMERA_MAPTYPE  aMapType,
const int  aPixIndexY,
const int  aPixIndexZ 
)
inline

Returns current error value of a given pixel and for a selected map type.

When a sequence entry is selected, this function returns the pixel error value of a given map.

Parameters
[in]aMapTypeMap type, see CAMERA_MAPTYPE.
[in]aPixIndexYY pixel index.
[in]aPixIndexZZ pixel index.
Returns
Pixel error value.

◆ GetPixelValue()

int CameraRead::GetPixelValue ( const CAMERA_MAPTYPE  aMapType,
const int  aPixIndexY,
const int  aPixIndexZ 
)
inline

Returns current value of a given pixel and for a selected map type.

When a sequence entry is selected, this function returns the pixel value of a given map.

Parameters
[in]aMapTypeMap type, see CAMERA_MAPTYPE.
[in]aPixIndexYY pixel index.
[in]aPixIndexZZ pixel index.
Returns
Pixel value.

◆ GetSizeX()

double CameraRead::GetSizeX ( void  )
inline

Returns the current camera size in the X direction \([\mathrm{mm}]\).

◆ GetSizeY()

double CameraRead::GetSizeY ( void  )
inline

Returns the current camera size in the Y direction \([\mathrm{mm}]\).

◆ GetSizeZ()

double CameraRead::GetSizeZ ( void  )
inline

Returns the current camera size in the Z direction \([\mathrm{mm}]\).

◆ GetSortedPixelIndex()

void CameraRead::GetSortedPixelIndex ( int &  aPixIndexY,
int &  aPixIndexZ,
const int  aPixIndex,
const string  aSortMethod = "STANDARD" 
)

Returns the pixel indices (Y/Z) in a pre-defined order.

Camera pixels are usually read using a specific front-end electronic configuration. This function is designed to run through the pixels using a pre-defined order. The user must first load a camera picture with TChain::GetEntry(). Then, when running a loop over a global index (aPixIndex), the corresponding indices along the Y and Z axis are returned. Several pre-defined order are implemented:

  • the "STANDARD" sort method. With the "STANDARD" order, the rows are read sequentially. The following picture show the order with which the pixels are loaded (8x8 matrix). The global pixel index is given in each cell.
    STANDARD pixel order.
  • the "MXT" sort method. The camera map is divided in 2 halves (camex). The pixels are read alternatively in the left and right camex, starting from top Z values. The following picture show the order with which the pixels are loaded (8x8 matrix). The global pixel index is given in each cell.
    MXT pixel order.
Parameters
[out]aPixIndexYPixel index along the Y axis.
[out]aPixIndexZPixel index along the Z axis.
[in]aPixIndexGlobal pixel index.
[in]aSortMethodSorting method: either "STANDARD" or "MXT".

◆ GetThreshold()

double CameraRead::GetThreshold ( void  )
inline

Returns the camera threshold.

◆ GetTime()

ULong64_t CameraRead::GetTime ( void  )
inline

Returns the current camera time \([\mathrm{ms}]\).

◆ GetTimeMaximum()

ULong64_t CameraRead::GetTimeMaximum ( void  )
inline

Returns the maximum camera time \([\mathrm{ms}]\).

◆ GetTimeMinimum()

ULong64_t CameraRead::GetTimeMinimum ( void  )
inline

Returns the minimum camera time \([\mathrm{ms}]\).

◆ GetTimeResolution()

UInt_t CameraRead::GetTimeResolution ( void  )
inline

Returns the current camera time resolution \([\mathrm{ms}]\).

◆ GetTimeResolutionMaximum()

UInt_t CameraRead::GetTimeResolutionMaximum ( void  )
inline

Returns the maximum camera time resolution \([\mathrm{ms}]\).

◆ GetTimeResolutionMinimum()

UInt_t CameraRead::GetTimeResolutionMinimum ( void  )
inline

Returns the minimum camera time resolution \([\mathrm{ms}]\).

◆ SetThreshold()

void CameraRead::SetThreshold ( const double  aThreshold)
inline

Sets the camera threshold.

Parameters
[in]aThresholdThreshold value.

◆ SetTime()

bool CameraRead::SetTime ( const ULong64_t  aTime)

Sets the camera time.

The CameraRead TChain entries are scanned to match the input time. The TChain entry is selected if the input time is during the camera integration time.

Warning
This function assumes that the camera entries are time sorted. The CameraRead entries are scanned starting from the current entry, forward or backward.
Parameters
[in]aTimeTime \([\mathrm{ms}]\) to select the camera entry.
Returns
true if a camera entry is found to match the input time, false otherwise.

Member Data Documentation

◆ cam_dt

UInt_t CameraRead::cam_dt
private

resolution time \([\mathrm{ms}]\).

◆ cam_gain

TH2F* CameraRead::cam_gain
private

gain map.

◆ cam_hitastro

int CameraRead::cam_hitastro[CAMERA_NHITMAX]
private

hit astro-particle index.

◆ cam_hitn

int CameraRead::cam_hitn
private

number of hits.

◆ cam_hitsrc

int CameraRead::cam_hitsrc[CAMERA_NHITMAX]
private

hit source index.

◆ cam_hity

double CameraRead::cam_hity[CAMERA_NHITMAX]
private

hit position in the Y direction.

◆ cam_hitz

double CameraRead::cam_hitz[CAMERA_NHITMAX]
private

hit position in the Z direction.

◆ cam_map

TH2S* CameraRead::cam_map[pixntype]
private

pixel maps.

◆ cam_map_proc

TH2S* CameraRead::cam_map_proc
private

image after processing.

◆ cam_nbits

int CameraRead::cam_nbits
private

number of bits to encode the raw amplitude.

◆ cam_photon_resy

double CameraRead::cam_photon_resy
private

Gaussian width for photons (Y).

◆ cam_photon_resz

double CameraRead::cam_photon_resz
private

Gaussian width for photons (Z).

◆ cam_threshold

double CameraRead::cam_threshold
private

threshold.

◆ cam_time

ULong64_t CameraRead::cam_time
private

camera time \([\mathrm{ms}]\).

◆ cam_xsize

double CameraRead::cam_xsize
private

physical size in the X direction \([\mathrm{mm}]\).

◆ cam_ysize

double CameraRead::cam_ysize
private

physical size in the Y direction \([\mathrm{mm}]\).

◆ cam_zsize

double CameraRead::cam_zsize
private

physical size in the Z direction \([\mathrm{mm}]\).


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