BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
BmnMCTrackCreator.h
Go to the documentation of this file.
1/**
2 * \file BmnMCTrackCreator.h
3 * \brief Creates BmnMCTrack objects.
4 * \author Andrey Lebedev <andrey.lebedev@gsi.de>
5 * \author Sergey Merts <sergey.merts@gmail.com> - modifications for BMN experiment
6 * \date 2011-2014
7 **/
8#ifndef BMNMCTRACKCREATOR_H_
9#define BMNMCTRACKCREATOR_H_
10
11#include "BmnCSCStationSet.h"
12#include "BmnGemStripStationSet.h"
13#include "BmnGemStripStationSet_RunSpring2017.h"
14#include "BmnMCTrack.h"
15#include "BmnSiliconStationSet.h"
16
17#include <assert.h>
18#include <iostream>
19#include <map>
20
21class TClonesArray;
22class FairMCPoint;
23class CbmStsPoint;
24class CbmGeoStsPar;
25class CbmStsDigiPar;
27
28/**
29 * \class CbmLitMCTrackCreator
30 * \brief Creates CbmLitMCTrack objects.
31 * \author Andrey Lebedev <andrey.lebedev@gsi.de>
32 * \date 2011
33 **/
35{
36 private:
37 /**
38 * \brief Constructor.
39 */
41
42 public:
43 /**
44 * \brief Destructor.
45 */
47
48 /**
49 * \brief Singleton instance.
50 */
52
53 /**
54 * \brief Creates array of BmnMCTracks for current event.
55 * Has to be executed in Exec() function of the task.
56 */
57 void Create();
58
59 /**
60 * \brief Check whether a track exists in the array.
61 * \param[in] mcId MC index of track.
62 * \return true if track exists in array.
63 */
65 {
66 return (fBmnMCTracks.count(mcId) > 0) ? kTRUE : kFALSE;
67 // if (fBmnMCTracks.count(mcId) == 0) return kFALSE;
68 // Int_t NPointsSil = fBmnMCTracks.find(mcId)->second.GetNofPoints(kSILICON);
69 // Int_t NPointsGem = fBmnMCTracks.find(mcId)->second.GetNofPoints(kGEM);
70 // if (NPointsSil > fSilDetector->GetNStations()) return kFALSE;
71 // if (NPointsGem > fGemDetector->GetNStations()) return kFALSE;
72 // //if (NPointsSil + NPointsGem < 4) return kFALSE;
73 // return kTRUE;
74 //// printf("NPointsSil = %d isNSilPointsCorrect = %d\n", NPointsSil, isNSilPointsCorrect);
75 //// printf("NPointsGem = %d isNGemPointsCorrect = %d\n", NPointsGem, isNGemPointsCorrect);
76 }
77
78 /**
79 * \brief Return BmnMCTrack by its index.
80 * \param[in] mcId MC index of track.
81 * \return MC track.
82 */
83 const BmnMCTrack& GetTrack(int mcId) const
84 {
85 assert(TrackExists(mcId));
86 return fBmnMCTracks.find(mcId)->second;
87 }
88
89 /**
90 * \brief Return number of tracks.
91 * \return Number of tracks.
92 */
93 Int_t GetNofTracks() const { return fBmnMCTracks.size(); }
94
95 private:
96 /**
97 * \brief Read data branches.
98 */
100
101 /**
102 * \brief Add MC points from a certain detector.
103 * \param[in] detId Detector identificator.
104 * \param[in] array Array of FairMCPoint.
105 */
106 void AddPoints(DetectorId detId, const TClonesArray* array);
107
108 /**
109 * \brief Calculate and set number of RICH hits for MC track.
110 */
112
113 /**
114 * \brief Fit Rich MC points using ellipse fitter and fill ellipse parameters.
115 */
117
118 /**
119 * \brief Convert FairMCPoint to BmnMCPoint.
120 * \param[in] fairPoint Pointer to FairMCPoint to be converted.
121 * \param[out] bmnPoint Pointer to output BmnMCPoint.
122 * \param[in] refId Reference index of the MC point.
123 * \param[in] stationId Index of the station of the MC point.
124 */
125 void FairMCPointToBmnMCPoint(const FairMCPoint* fairPoint, BmnMCPoint* bmnPoint, int refId, int stationId);
126
127 void FairMCPointCoordinatesAndMomentumToBmnMCPoint( // for DCH1, DCH2, TOF1 points
128 const FairMCPoint* fairPoint,
129 BmnMCPoint* bmnPoint);
130
139
143
144 // Stores created BmnMCTrack objects.
145 // std::map<MC track index, BmnMCTrack object>.
146 std::map<Int_t, BmnMCTrack> fBmnMCTracks;
147
151};
152
153#endif /* BMNMCTRACKCREATOR_H_ */
Monte-Carlo track.
bool Bool_t
int Int_t
constexpr Bool_t kFALSE
constexpr Bool_t kTRUE
Monte-Carlo point.
Definition BmnMCPoint.h:23
void FairMCPointToBmnMCPoint(const FairMCPoint *fairPoint, BmnMCPoint *bmnPoint, int refId, int stationId)
Convert FairMCPoint to BmnMCPoint.
void AddPoints(DetectorId detId, const TClonesArray *array)
Add MC points from a certain detector.
TClonesArray * fDchPoints
void FairMCPointCoordinatesAndMomentumToBmnMCPoint(const FairMCPoint *fairPoint, BmnMCPoint *bmnPoint)
virtual ~BmnMCTrackCreator()
Destructor.
std::map< Int_t, BmnMCTrack > fBmnMCTracks
TClonesArray * fTof400Points
void ReadDataBranches()
Read data branches.
TClonesArray * fMCTracks
Int_t GetNofTracks() const
Return number of tracks.
void AddRingParameters()
Fit Rich MC points using ellipse fitter and fill ellipse parameters.
TClonesArray * fTof700Points
BmnCSCStationSet * fCscDetector
BmnGemStripStationSet * fGemDetector
static BmnMCTrackCreator * Instance(TString gem, TString sil, TString csc)
Singleton instance.
BmnSiliconStationSet * fSilDetector
TClonesArray * fCscPoints
Bool_t TrackExists(Int_t mcId) const
Check whether a track exists in the array.
BmnMCTrackCreator(TString gem, TString sil, TString csc)
Constructor.
TClonesArray * fSilPoints
void Create()
Creates array of BmnMCTracks for current event.
TClonesArray * fGemPoints
void AddRichHits()
Calculate and set number of RICH hits for MC track.
TClonesArray * fSsdPoints
const BmnMCTrack & GetTrack(int mcId) const
Return BmnMCTrack by its index.
Monte-Carlo track.
Definition BmnMCTrack.h:27