Belle II Software  release-08-01-10
ARICHReconstruction.h
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 #pragma once
9 
10 #include <arich/dbobjects/ARICHGeometryConfig.h>
11 #include <arich/dbobjects/ARICHReconstructionPar.h>
12 #include <arich/dbobjects/ARICHChannelMask.h>
13 #include <arich/dbobjects/ARICHChannelMapping.h>
14 #include <arich/dbobjects/ARICHGlobalAlignment.h>
15 #include <arich/dbobjects/ARICHMirrorAlignment.h>
16 #include <arich/dbobjects/ARICHAeroTilesAlignment.h>
17 #include "framework/datastore/StoreArray.h"
18 #include "arich/dataobjects/ARICHHit.h"
19 #include "arich/dataobjects/ARICHTrack.h"
20 #include "arich/dataobjects/ARICHLikelihood.h"
21 #include <framework/database/DBObjPtr.h>
22 
23 
24 #include <TVector3.h>
25 
26 namespace Belle2 {
49 
50  public:
51 
53  explicit ARICHReconstruction(int storePhotons = 0);
54 
57 
59  void initialize();
60 
62  int smearTrack(ARICHTrack& arichTrack);
63 
65  void transformTrackToLocal(ARICHTrack& arichTrack, bool align);
66 
68  int likelihood2(ARICHTrack& arichTrack, const StoreArray<ARICHHit>& arichHits, ARICHLikelihood& arichLikelihood);
69 
71  void setTrackPositionResolution(double pRes);
73  void setTrackAngleResolution(double aRes);
74 
76  void useMirrorAlignment(bool align)
77  {
78  m_alignMirrors = align;
79  };
80 
82  void correctEmissionPoint(int tileID, double r);
83 
84  private:
85 
87  static const int c_noOfAerogels = 5;
98  std::vector<TVector3> m_mirrorPoints;
99  std::vector<TVector3> m_mirrorNorms;
101  double m_trackPosRes;
102  double m_trackAngRes;
105  unsigned int m_nAerogelLayers;
113  double m_tilePars[124][2] = {{0}};
114 
116  int InsideDetector(TVector3 a, int copyno);
118 
122  TVector3 HitVirtualPosition(const TVector3& hitpos, int mirrorID);
123 
125 
132  TVector3 FastTracking(TVector3 dirf, TVector3 r, double* refind, double* z, int n, int opt);
133 // TVector3 FastTracking(TVector3 dirf, TVector3 r, double* refind, double* z, int n);
134 
136 
143  TVector3 FastTrackingSimple(TVector3 dirf, TVector3 r, double* refind, double* z, int n);
144 
146 
157  int CherenkovPhoton(TVector3 r, TVector3 rh,
158  TVector3& rf, TVector3& dirf,
159  double* refind, double* z, int n, int mirrorID = 0);
160 
162  /*
163  \param pos photon position
164  \param dir photon direction
165  \param mirrorID ID of mirrro plate
166  */
167  bool HitsMirror(const TVector3& pos, const TVector3& dir, int mirrorID);
168 
170  TVector3 getTrackMeanEmissionPosition(const ARICHTrack& track, int iAero);
171 
173  TVector3 getTrackPositionAtZ(const ARICHTrack& track, double zout);
174 
176  TVector3 getMirrorPoint(int mirrorID);
177 
179  TVector3 getMirrorNorm(int mirrorID);
180 
181  };
182 
184 } // end of namespace Belle2
This is a class to store ARICH likelihoods in the datastore.
Internal ARICH track reconstruction.
DBObjPtr< ARICHReconstructionPar > m_recPars
reconstruction parameters from the DB
TVector3 FastTrackingSimple(TVector3 dirf, TVector3 r, double *refind, double *z, int n)
Calculates the intersection of the Cherenkov photon emitted from point "r" in "dirf" direction with t...
std::vector< TVector3 > m_mirrorNorms
vector of nomal vectors of all mirror plates
double m_zaero[c_noOfAerogels]
z-positions of aerogel layers
double p_mass[c_noOfHypotheses]
particle masses
double m_n0[c_noOfAerogels]
number of emmited photons per unit length
DBObjPtr< ARICHMirrorAlignment > m_mirrAlign
global alignment parameters from the DB
double m_transmissionLen[c_noOfAerogels]
transmission lengths of aerogel layers
bool m_alignMirrors
if set to true mirror alignment constants from DB are used
DBObjPtr< ARICHGeometryConfig > m_arichgp
geometry configuration parameters from the DB
OptionalDBObjPtr< ARICHAeroTilesAlignment > m_tileAlign
alignment of aerogel tiles from DB
double m_trackAngRes
track direction resolution (from tracking)
void useMirrorAlignment(bool align)
use mirror alignment or not
double m_refractiveInd[c_noOfAerogels]
refractive indices of aerogel layers
DBObjPtr< ARICHGlobalAlignment > m_alignp
global alignment parameters from the DB
unsigned int m_nAerogelLayers
number of aerogel layers
static const int c_noOfAerogels
Maximal number of aerogel layers to loop over.
double m_trackPosRes
track position resolution (from tracking)
static const int c_noOfHypotheses
Number of hypotheses to loop over.
DBObjPtr< ARICHChannelMapping > m_chnMap
map x,y channels to asic channels from the DB
int m_storePhot
set to 1 to store individual reconstructed photon information
DBObjPtr< ARICHChannelMask > m_chnMask
map of masked channels from the DB
TVector3 m_anorm[c_noOfAerogels]
normal vector of the aerogle plane
std::vector< TVector3 > m_mirrorPoints
vector of points on all mirror plates
double m_thickness[c_noOfAerogels]
thicknesses of areogel layers
Datastore class that holds position and momentum information of tracks that hit ARICH.
Definition: ARICHTrack.h:32
static const unsigned int c_SetSize
Number of elements (for use in array bounds etc.)
Definition: Const.h:606
Class for accessing objects in the database.
Definition: DBObjPtr.h:21
Optional DBObjPtr: This class behaves the same as the DBObjPtr except that it will not raise errors w...
Definition: DBObjPtr.h:48
Accessor to arrays stored in the data store.
Definition: StoreArray.h:113
void setTrackPositionResolution(double pRes)
Sets track position resolution (from tracking)
TVector3 getMirrorNorm(int mirrorID)
Returns normal vector of the mirror plate with id mirrorID.
int likelihood2(ARICHTrack &arichTrack, const StoreArray< ARICHHit > &arichHits, ARICHLikelihood &arichLikelihood)
Computes the value of identity likelihood function for different particle hypotheses.
void initialize()
read geomerty parameters from xml and initialize class memebers
TVector3 getMirrorPoint(int mirrorID)
Returns point on the mirror plate with id mirrorID.
void correctEmissionPoint(int tileID, double r)
correct mean emission point z position
int InsideDetector(TVector3 a, int copyno)
Returns 1 if vector "a" lies on "copyno"-th detector active surface of detector and 0 else.
void setTrackAngleResolution(double aRes)
Sets track direction resolution (from tracking)
int CherenkovPhoton(TVector3 r, TVector3 rh, TVector3 &rf, TVector3 &dirf, double *refind, double *z, int n, int mirrorID=0)
Calculates the direction of photon emission.
TVector3 FastTracking(TVector3 dirf, TVector3 r, double *refind, double *z, int n, int opt)
Calculates the intersection of the Cherenkov photon emitted from point "r" in "dirf" direction with t...
TVector3 HitVirtualPosition(const TVector3 &hitpos, int mirrorID)
Returns the hit virtual position, assuming that it was reflected from mirror.
void transformTrackToLocal(ARICHTrack &arichTrack, bool align)
Transforms track parameters from global Belle2 to ARICH local frame.
bool HitsMirror(const TVector3 &pos, const TVector3 &dir, int mirrorID)
returns true if photon at position pos with direction dir hits mirror plate with ID mirrorID
ARICHReconstruction(int storePhotons=0)
Constructor.
TVector3 getTrackPositionAtZ(const ARICHTrack &track, double zout)
Returns track direction at point with z coordinate "zout" (assumes straight track).
int smearTrack(ARICHTrack &arichTrack)
Smeares track parameters ("simulate" the uncertainties of tracking).
TVector3 getTrackMeanEmissionPosition(const ARICHTrack &track, int iAero)
Returns mean emission position of Cherenkov photons from i-th aerogel layer.
Abstract base class for different kinds of events.