CbmRoot
Loading...
Searching...
No Matches
CbmLitMCTrackCreator.h
Go to the documentation of this file.
1/* Copyright (C) 2011-2020 GSI/JINR-LIT, Darmstadt/Dubna
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Andrey Lebedev [committer], Timur Ablyazimov */
4
11#ifndef CBMLITMCTRACKCREATOR_H_
12#define CBMLITMCTRACKCREATOR_H_
13
14#include "CbmDefs.h"
15#include "CbmLitMCTrack.h"
16#include "CbmStsAddress.h"
17
18#include <iostream>
19#include <map>
20
21#include <assert.h>
22
23class TClonesArray;
24class FairMCPoint;
25class CbmMvdPoint;
26class CbmStsPoint;
27class CbmTrdPoint;
28class CbmMuchPoint;
29class CbmGeoStsPar;
30class CbmStsDigiPar;
32class CbmMCDataArray;
33class CbmDigiManager;
34
42 private:
47
48 public:
52 virtual ~CbmLitMCTrackCreator();
53
58
62 void Create(Int_t eventNum);
63
64
70 bool TrackExists(int mcEventId, int mcId) const
71 {
72 return (fLitMCTracks.count(std::make_pair(mcEventId, mcId)) > 0) ? true : false;
73 }
74
80 const CbmLitMCTrack& GetTrack(int mcEventId, int mcId) const
81 {
82 assert(TrackExists(mcEventId, mcId));
83 return fLitMCTracks.find(std::make_pair(mcEventId, mcId))->second;
84 }
85
90 Int_t GetNofTracks() const { return fLitMCTracks.size(); }
91
92 private:
96 void ReadDataBranches();
97
104 void AddPoints(ECbmModuleId detId, CbmMCDataArray* array, Int_t iEvent);
105
109 void AddRichHits(Int_t iEvent);
110
114 void AddRingParameters(Int_t iEvent);
115
122 void FairMCPointToLitMCPoint(const FairMCPoint* fairPoint, CbmLitMCPoint* litPoint, int eventId, int refId,
123 int stationId);
124
128 void FillStationMaps(Int_t iEvent);
129
130
131 void FairMCPointCoordinatesAndMomentumToLitMCPoint(const FairMCPoint* fairPoint, CbmLitMCPoint* litPoint);
132
134
136
138
140
141 CbmMCDataArray* fMCTracks; // CbmMCTrack array
142 CbmMCDataArray* fMvdPoints; // CbmMvdPoint array
143 CbmMCDataArray* fStsPoints; // CbmStsPoint array
144 CbmMCDataArray* fTrdPoints; // CbmTrdPoint array
145 CbmMCDataArray* fMuchPoints; // CbmMuchPoint array
146 CbmMCDataArray* fTofPoints; // CbmTofPoint array
147 CbmMCDataArray* fRichPoints; // CbmRichPoint array
148 TClonesArray* fRichHits; // CbmRichHit array
150
151 // Stores created CbmLitMCTrack objects.
152 // std::map<MC track index, CbmLitMCTrack object>.
153 std::map<std::pair<int, int>, CbmLitMCTrack> fLitMCTracks;
154
155 // Map <MC point index, station index>
156 std::map<std::pair<int, int>, int> fMvdStationsMap; // for MVD
157 std::map<std::pair<int, int>, int> fStsStationsMap; // for STS
158 std::map<std::pair<int, int>, int> fTrdStationsMap; // for TRD
159 std::map<std::pair<int, int>, int> fMuchStationsMap; // for MUCH
160
161 CbmRichRingFitterEllipseTau* fTauFit; // Ellipse fitter algorithm
162
165};
166
167#endif /* CBMLITMCTRACKCREATOR_H_ */
ECbmModuleId
Definition CbmDefs.h:39
Monte-Carlo track.
CbmDigiManager.
Monte-Carlo point.
Creates CbmLitMCTrack objects.
CbmLitMCTrackCreator(const CbmLitMCTrackCreator &)
void FillStationMaps(Int_t iEvent)
Fill maps for MC points to station id.
std::map< std::pair< int, int >, int > fTrdStationsMap
void StsPointCoordinatesAndMomentumToLitMCPoint(const CbmStsPoint *stsPoint, CbmLitMCPoint *litPoint)
void FairMCPointCoordinatesAndMomentumToLitMCPoint(const FairMCPoint *fairPoint, CbmLitMCPoint *litPoint)
void MuchPointCoordinatesAndMomentumToLitMCPoint(const CbmMuchPoint *muchPoint, CbmLitMCPoint *litPoint)
CbmLitMCTrackCreator operator=(const CbmLitMCTrackCreator &)
void FairMCPointToLitMCPoint(const FairMCPoint *fairPoint, CbmLitMCPoint *litPoint, int eventId, int refId, int stationId)
Convert FairMCPoint to CbmLitMCPoint.
virtual ~CbmLitMCTrackCreator()
Destructor.
bool TrackExists(int mcEventId, int mcId) const
Check whether a track exists in the array.
void AddPoints(ECbmModuleId detId, CbmMCDataArray *array, Int_t iEvent)
Add MC points from a certain detector.
std::map< std::pair< int, int >, int > fMvdStationsMap
std::map< std::pair< int, int >, CbmLitMCTrack > fLitMCTracks
Int_t GetNofTracks() const
Return number of tracks.
void AddRichHits(Int_t iEvent)
Calculate and set number of RICH hits for MC track.
std::map< std::pair< int, int >, int > fMuchStationsMap
void Create(Int_t eventNum)
Creates array of CbmLitMCTracks for current event.
CbmRichRingFitterEllipseTau * fTauFit
std::map< std::pair< int, int >, int > fStsStationsMap
void AddRingParameters(Int_t iEvent)
Fit Rich MC points using ellipse fitter and fill ellipse parameters.
void MvdPointCoordinatesAndMomentumToLitMCPoint(const CbmMvdPoint *mvdPoint, CbmLitMCPoint *litPoint)
void ReadDataBranches()
Read data branches.
void TrdPointCoordinatesAndMomentumToLitMCPoint(const CbmTrdPoint *trdPoint, CbmLitMCPoint *litPoint)
static CbmLitMCTrackCreator * Instance()
Singleton instance.
const CbmLitMCTrack & GetTrack(int mcEventId, int mcId) const
Return CbmLitMCTrack by its index.
Monte-Carlo track.
Access to a MC data branch for time-based analysis.
Here the ring is fitted with Taubin algorithm from A. Ayriyan, G. Ososkov, N. Chernov.