Belle II Software  release-06-01-15
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 
9 #ifndef ARICHRECONSTRUCTION_H
10 #define ARICHRECONSTRUCTION_H
11 
12 #include <arich/dbobjects/ARICHGeometryConfig.h>
13 #include <arich/dbobjects/ARICHReconstructionPar.h>
14 #include <arich/dbobjects/ARICHChannelMask.h>
15 #include <arich/dbobjects/ARICHChannelMapping.h>
16 #include <arich/dbobjects/ARICHGlobalAlignment.h>
17 #include <arich/dbobjects/ARICHMirrorAlignment.h>
18 #include <arich/dbobjects/ARICHAeroTilesAlignment.h>
19 #include "framework/datastore/StoreArray.h"
20 #include "arich/dataobjects/ARICHHit.h"
21 #include "arich/dataobjects/ARICHTrack.h"
22 #include "arich/dataobjects/ARICHLikelihood.h"
23 #include <framework/database/DBObjPtr.h>
24 
25 
26 #include <TVector3.h>
27 
28 namespace Belle2 {
51 
52  public:
53 
55  explicit ARICHReconstruction(int storePhotons = 0);
56 
59 
61  void initialize();
62 
64  int smearTrack(ARICHTrack& arichTrack);
65 
67  void transformTrackToLocal(ARICHTrack& arichTrack, bool align);
68 
70  int likelihood2(ARICHTrack& arichTrack, const StoreArray<ARICHHit>& arichHits, ARICHLikelihood& arichLikelihood);
71 
73  void setTrackPositionResolution(double pRes);
75  void setTrackAngleResolution(double aRes);
76 
78  void useMirrorAlignment(bool align)
79  {
80  m_alignMirrors = align;
81  };
82 
84  void correctEmissionPoint(int tileID, double r);
85 
86  private:
87 
89  static const int c_noOfAerogels = 5;
100  std::vector<TVector3> m_mirrorPoints;
101  std::vector<TVector3> m_mirrorNorms;
103  double m_trackPosRes;
104  double m_trackAngRes;
107  unsigned int m_nAerogelLayers;
115  double m_tilePars[124][2] = {0};
116 
118  int InsideDetector(TVector3 a, int copyno);
120 
124  TVector3 HitVirtualPosition(const TVector3& hitpos, int mirrorID);
125 
127 
134  TVector3 FastTracking(TVector3 dirf, TVector3 r, double* refind, double* z, int n, int opt);
135 // TVector3 FastTracking(TVector3 dirf, TVector3 r, double* refind, double* z, int n);
136 
138 
145  TVector3 FastTrackingSimple(TVector3 dirf, TVector3 r, double* refind, double* z, int n);
146 
148 
159  int CherenkovPhoton(TVector3 r, TVector3 rh,
160  TVector3& rf, TVector3& dirf,
161  double* refind, double* z, int n, int mirrorID = 0);
162 
164  /*
165  \param pos photon position
166  \param dir photon direction
167  \param mirrorID ID of mirrro plate
168  */
169  bool HitsMirror(const TVector3& pos, const TVector3& dir, int mirrorID);
170 
172  TVector3 getTrackMeanEmissionPosition(const ARICHTrack& track, int iAero);
173 
175  TVector3 getTrackPositionAtZ(const ARICHTrack& track, double zout);
176 
178  TVector3 getMirrorPoint(int mirrorID);
179 
181  TVector3 getMirrorNorm(int mirrorID);
182 
183  };
184 
186 } // end of namespace Belle2
187 
188 #endif // ARICHRECONSTRUCTION_H
189 
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:496
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.