CbmRoot
CbmLitMCTrackCreator.h
Go to the documentation of this file.
1 
7 #ifndef CBMLITMCTRACKCREATOR_H_
8 #define CBMLITMCTRACKCREATOR_H_
9 
10 #include "CbmDefs.h"
11 #include "CbmLitMCTrack.h"
12 #include "CbmStsAddress.h"
13 #include <assert.h>
14 #include <iostream>
15 #include <map>
16 
17 class TClonesArray;
18 class FairMCPoint;
19 class CbmMvdPoint;
20 class CbmStsPoint;
21 class CbmTrdPoint;
22 class CbmMuchPoint;
23 class CbmGeoStsPar;
24 class CbmStsDigiPar;
26 class CbmMCDataArray;
27 class CbmDigiManager;
28 
36 private:
41 
42 public:
46  virtual ~CbmLitMCTrackCreator();
47 
52 
56  void Create(Int_t eventNum);
57 
58 
64  bool TrackExists(int mcEventId, int mcId) const {
65  return (fLitMCTracks.count(std::make_pair(mcEventId, mcId)) > 0) ? true
66  : false;
67  }
68 
74  const CbmLitMCTrack& GetTrack(int mcEventId, int mcId) const {
75  assert(TrackExists(mcEventId, mcId));
76  return fLitMCTracks.find(std::make_pair(mcEventId, mcId))->second;
77  }
78 
83  Int_t GetNofTracks() const { return fLitMCTracks.size(); }
84 
85 private:
89  void ReadDataBranches();
90 
97  void AddPoints(ECbmModuleId detId, CbmMCDataArray* array, Int_t iEvent);
98 
102  void AddRichHits(Int_t iEvent);
103 
107  void AddRingParameters(Int_t iEvent);
108 
115  void FairMCPointToLitMCPoint(const FairMCPoint* fairPoint,
116  CbmLitMCPoint* litPoint,
117  int eventId,
118  int refId,
119  int stationId);
120 
124  void FillStationMaps(Int_t iEvent);
125 
126 
127  void
128  FairMCPointCoordinatesAndMomentumToLitMCPoint(const FairMCPoint* fairPoint,
129  CbmLitMCPoint* litPoint);
130 
132  CbmLitMCPoint* litPoint);
133 
135  CbmLitMCPoint* litPoint);
136 
138  CbmLitMCPoint* litPoint);
139 
140  void
142  CbmLitMCPoint* litPoint);
143 
144  CbmMCDataArray* fMCTracks; // CbmMCTrack array
145  CbmMCDataArray* fMvdPoints; // CbmMvdPoint array
146  CbmMCDataArray* fStsPoints; // CbmStsPoint array
147  CbmMCDataArray* fTrdPoints; // CbmTrdPoint array
148  CbmMCDataArray* fMuchPoints; // CbmMuchPoint array
149  CbmMCDataArray* fTofPoints; // CbmTofPoint array
150  CbmMCDataArray* fRichPoints; // CbmRichPoint array
151  TClonesArray* fRichHits; // CbmRichHit array
153 
154  // Stores created CbmLitMCTrack objects.
155  // std::map<MC track index, CbmLitMCTrack object>.
156  std::map<std::pair<int, int>, CbmLitMCTrack> fLitMCTracks;
157 
158  // Map <MC point index, station index>
159  std::map<std::pair<int, int>, int> fMvdStationsMap; // for MVD
160  std::map<std::pair<int, int>, int> fStsStationsMap; // for STS
161  std::map<std::pair<int, int>, int> fTrdStationsMap; // for TRD
162  std::map<std::pair<int, int>, int> fMuchStationsMap; // for MUCH
163 
164  CbmRichRingFitterEllipseTau* fTauFit; // Ellipse fitter algorithm
165 
168 };
169 
170 #endif /* CBMLITMCTRACKCREATOR_H_ */
CbmLitMCTrackCreator::fTrdPoints
CbmMCDataArray * fTrdPoints
Definition: CbmLitMCTrackCreator.h:147
CbmMuchPoint
Definition: CbmMuchPoint.h:21
CbmLitMCTrackCreator::~CbmLitMCTrackCreator
virtual ~CbmLitMCTrackCreator()
Destructor.
Definition: CbmLitMCTrackCreator.cxx:61
CbmLitMCTrackCreator::fDigiMan
CbmDigiManager * fDigiMan
Definition: CbmLitMCTrackCreator.h:152
CbmRichRingFitterEllipseTau
Here the ring is fitted with Taubin algorithm from A. Ayriyan, G. Ososkov, N. Chernov.
Definition: CbmRichRingFitterEllipseTau.h:35
CbmLitMCTrackCreator::AddRichHits
void AddRichHits(Int_t iEvent)
Calculate and set number of RICH hits for MC track.
Definition: CbmLitMCTrackCreator.cxx:175
CbmLitMCTrackCreator::fRichPoints
CbmMCDataArray * fRichPoints
Definition: CbmLitMCTrackCreator.h:150
CbmLitMCTrackCreator::TrdPointCoordinatesAndMomentumToLitMCPoint
void TrdPointCoordinatesAndMomentumToLitMCPoint(const CbmTrdPoint *trdPoint, CbmLitMCPoint *litPoint)
Definition: CbmLitMCTrackCreator.cxx:308
CbmLitMCTrackCreator
Creates CbmLitMCTrack objects.
Definition: CbmLitMCTrackCreator.h:35
CbmLitMCTrackCreator::Instance
static CbmLitMCTrackCreator * Instance()
Singleton instance.
Definition: CbmLitMCTrackCreator.cxx:63
CbmLitMCTrackCreator::GetTrack
const CbmLitMCTrack & GetTrack(int mcEventId, int mcId) const
Return CbmLitMCTrack by its index.
Definition: CbmLitMCTrackCreator.h:74
ECbmModuleId
ECbmModuleId
Definition: CbmDefs.h:33
CbmMCDataArray
Access to a MC data branch for time-based analysis.
Definition: CbmMCDataArray.h:35
CbmLitMCTrackCreator::fStsPoints
CbmMCDataArray * fStsPoints
Definition: CbmLitMCTrackCreator.h:146
CbmStsPoint
Definition: CbmStsPoint.h:27
CbmLitMCTrackCreator::fTrdStationsMap
std::map< std::pair< int, int >, int > fTrdStationsMap
Definition: CbmLitMCTrackCreator.h:161
CbmLitMCTrackCreator::StsPointCoordinatesAndMomentumToLitMCPoint
void StsPointCoordinatesAndMomentumToLitMCPoint(const CbmStsPoint *stsPoint, CbmLitMCPoint *litPoint)
Definition: CbmLitMCTrackCreator.cxx:290
CbmLitMCTrackCreator::fTauFit
CbmRichRingFitterEllipseTau * fTauFit
Definition: CbmLitMCTrackCreator.h:164
CbmLitMCTrackCreator::fTofPoints
CbmMCDataArray * fTofPoints
Definition: CbmLitMCTrackCreator.h:149
CbmLitMCTrackCreator::CbmLitMCTrackCreator
CbmLitMCTrackCreator(const CbmLitMCTrackCreator &)
CbmLitMCTrackCreator::MuchPointCoordinatesAndMomentumToLitMCPoint
void MuchPointCoordinatesAndMomentumToLitMCPoint(const CbmMuchPoint *muchPoint, CbmLitMCPoint *litPoint)
Definition: CbmLitMCTrackCreator.cxx:326
CbmLitMCTrackCreator::AddRingParameters
void AddRingParameters(Int_t iEvent)
Fit Rich MC points using ellipse fitter and fill ellipse parameters.
Definition: CbmLitMCTrackCreator.cxx:196
CbmMvdPoint
Definition: CbmMvdPoint.h:28
CbmLitMCPoint
Monte-Carlo point.
Definition: CbmLitMCPoint.h:21
CbmLitMCTrack.h
Monte-Carlo track.
CbmDigiManager
CbmDigiManager.
Definition: CbmDigiManager.h:37
CbmLitMCTrackCreator::MvdPointCoordinatesAndMomentumToLitMCPoint
void MvdPointCoordinatesAndMomentumToLitMCPoint(const CbmMvdPoint *mvdPoint, CbmLitMCPoint *litPoint)
Definition: CbmLitMCTrackCreator.cxx:272
CbmTrdPoint
Definition: CbmTrdPoint.h:23
CbmLitMCTrackCreator::AddPoints
void AddPoints(ECbmModuleId detId, CbmMCDataArray *array, Int_t iEvent)
Add MC points from a certain detector.
Definition: CbmLitMCTrackCreator.cxx:125
CbmLitMCTrack
Monte-Carlo track.
Definition: CbmLitMCTrack.h:30
CbmLitMCTrackCreator::fMuchStationsMap
std::map< std::pair< int, int >, int > fMuchStationsMap
Definition: CbmLitMCTrackCreator.h:162
CbmLitMCTrackCreator::TrackExists
bool TrackExists(int mcEventId, int mcId) const
Check whether a track exists in the array.
Definition: CbmLitMCTrackCreator.h:64
CbmLitMCTrackCreator::fMvdStationsMap
std::map< std::pair< int, int >, int > fMvdStationsMap
Definition: CbmLitMCTrackCreator.h:159
CbmLitMCTrackCreator::FairMCPointToLitMCPoint
void FairMCPointToLitMCPoint(const FairMCPoint *fairPoint, CbmLitMCPoint *litPoint, int eventId, int refId, int stationId)
Convert FairMCPoint to CbmLitMCPoint.
Definition: CbmLitMCTrackCreator.cxx:236
CbmLitMCTrackCreator::ReadDataBranches
void ReadDataBranches()
Read data branches.
Definition: CbmLitMCTrackCreator.cxx:103
CbmLitMCTrackCreator::fMCTracks
CbmMCDataArray * fMCTracks
Definition: CbmLitMCTrackCreator.h:144
CbmStsAddress.h
CbmLitMCTrackCreator::operator=
CbmLitMCTrackCreator operator=(const CbmLitMCTrackCreator &)
CbmLitMCTrackCreator::fLitMCTracks
std::map< std::pair< int, int >, CbmLitMCTrack > fLitMCTracks
Definition: CbmLitMCTrackCreator.h:156
CbmLitMCTrackCreator::GetNofTracks
Int_t GetNofTracks() const
Return number of tracks.
Definition: CbmLitMCTrackCreator.h:83
CbmLitMCTrackCreator::fMvdPoints
CbmMCDataArray * fMvdPoints
Definition: CbmLitMCTrackCreator.h:145
CbmLitMCTrackCreator::fRichHits
TClonesArray * fRichHits
Definition: CbmLitMCTrackCreator.h:151
CbmLitMCTrackCreator::fMuchPoints
CbmMCDataArray * fMuchPoints
Definition: CbmLitMCTrackCreator.h:148
CbmLitMCTrackCreator::Create
void Create(Int_t eventNum)
Creates array of CbmLitMCTracks for current event.
Definition: CbmLitMCTrackCreator.cxx:68
CbmLitMCTrackCreator::CbmLitMCTrackCreator
CbmLitMCTrackCreator()
Constructor.
Definition: CbmLitMCTrackCreator.cxx:40
CbmLitMCTrackCreator::FillStationMaps
void FillStationMaps(Int_t iEvent)
Fill maps for MC points to station id.
Definition: CbmLitMCTrackCreator.cxx:344
CbmLitMCTrackCreator::fStsStationsMap
std::map< std::pair< int, int >, int > fStsStationsMap
Definition: CbmLitMCTrackCreator.h:160
CbmLitMCTrackCreator::FairMCPointCoordinatesAndMomentumToLitMCPoint
void FairMCPointCoordinatesAndMomentumToLitMCPoint(const FairMCPoint *fairPoint, CbmLitMCPoint *litPoint)
Definition: CbmLitMCTrackCreator.cxx:254
CbmDefs.h