CbmRoot
CbmAnaJpsiTask.h
Go to the documentation of this file.
1 
2 #ifndef CBMJPSIANATASK
3 #define CBMJPSIANATASK
4 
5 #include "FairTask.h"
6 
7 #include "CbmAnaJpsiCandidate.h"
8 #include "CbmAnaJpsiCuts.h"
9 #include "CbmAnaJpsiHist.h"
11 #include "CbmGlobalTrack.h"
12 #include "CbmHistManager.h"
13 #include "CbmKFVertex.h"
14 #include "CbmRichRing.h"
15 #include "CbmTrdTrack.h"
16 #include "CbmVertex.h"
17 
18 #include "TClonesArray.h"
19 #include "TH1D.h"
20 #include "TH2D.h"
21 #include "TH3D.h"
22 
23 #include <string>
24 #include <vector>
25 
26 using namespace std;
27 
28 class CbmAnaJpsiTask : public FairTask {
29 
30 public:
35 
39  virtual ~CbmAnaJpsiTask();
40 
44  virtual InitStatus Init();
45 
49  virtual void Exec(Option_t* option);
50 
54  virtual void Finish();
55 
56 
57 private:
58  Int_t fEventNum;
59 
60  TClonesArray* fMcTracks;
61  TClonesArray* fStsPoints;
62  TClonesArray* fStsHits;
63  TClonesArray* fStsTracks;
64  TClonesArray* fStsTrackMatches;
65  TClonesArray* fRichPoints;
66  TClonesArray* fRichHits;
67  TClonesArray* fRichRings;
68  TClonesArray* fRichRingMatches;
69  TClonesArray* fTrdPoints;
70  TClonesArray* fTrdHits;
71  TClonesArray* fTrdTracks;
72  TClonesArray* fTrdTrackMatches;
73  TClonesArray* fTofPoints;
74  TClonesArray* fTofHits;
75  TClonesArray* fTofHitsMatches;
76  TClonesArray* fGlobalTracks;
77  TClonesArray* fJpsiCandidates; //output array of Jpsi candidates
78 
79 
80  // Number of hits in the MC RICH ring
81  std::map<Int_t, Int_t> fNofHitsInRingMap;
82 
85 
86  std::vector<CbmAnaJpsiCandidate> fCandidates; // array of JPsi candidates
87 
88  CbmAnaJpsiCuts fCuts; //electron identification and analysis cuts
89 
90  Double_t fWeight; // Multiplicity * Branching Ratio of J/Psi;
91 
93 
94  Bool_t fUseTrd;
95  Bool_t fUseTof;
96 
97  /*
98  * \brief Creates 1D histograms for each analysis step.
99  * \param[in] name Base name of the histograms.
100  * \param[in] axisX X axis title.
101  * \param[in] axisY Y axis title.
102  * \param[in] nBins Number of bins for X axis in the histogram.
103  * \param[in] min Minimum value for X axis.
104  * \param[in] max Maximum value for X axis.
105  */
106  void CreateAnalysisStepsH1(const string& name,
107  const string& axisX,
108  const string& axisY,
109  double nBins,
110  double min,
111  double max);
112 
113  /*
114  * \brief Creates 2D histograms for each analysis step.
115  * \param[in] name Base name of the histograms.
116  * \param[in] axisX X axis title.
117  * \param[in] axisY Y axis title.
118  * \param[in] axisZ Z axis title.
119  * \param[in] nBinsX Number of bins for X axis in the histogram.
120  * \param[in] minX Minimum value for X axis.
121  * \param[in] maxX Maximum value for X axis.
122  * \param[in] nBinsY Number of bins for Y axis in the histogram.
123  * \param[in] minY Minimum value for Y axis.
124  * \param[in] maxY Maximum value for Y axis.
125  */
126  void CreateAnalysisStepsH2(const string& name,
127  const string& axisX,
128  const string& axisY,
129  const string& axisZ,
130  double nBinsX,
131  double minX,
132  double maxX,
133  double nBinsY,
134  double minY,
135  double maxY);
136 
137 
138  /*
139  * \brief Creates 1D histograms for different track source types.
140  * \param[in] name Base name of the histograms.
141  * \param[in] axisX X axis title.
142  * \param[in] axisY Y axis title.
143  * \param[in] nBins Number of bins in the histogram.
144  * \param[in] min Minimum value.
145  * \param[in] max Maximum value.
146  */
147  void CreateSourceTypesH1(const string& name,
148  const string& axisX,
149  const string& axisY,
150  double nBins,
151  double min,
152  double max);
153 
154 
155  /*
156  * \brief Creates 2D histograms for different track source types.
157  * \param[in] name Base name of the histograms.
158  * \param[in] axisX X axis title.
159  * \param[in] axisY Y axis title.
160  * \param[in] axisZ Z axis title.
161  * \param[in] nBinsX Number of bins for X axis in the histogram.
162  * \param[in] minX Minimum value for X axis.
163  * \param[in] maxX Maximum value for X axis.
164  * \param[in] nBinsY Number of bins for Y axis in the histogram.
165  * \param[in] minY Minimum value for Y axis.
166  * \param[in] maxY Maximum value for Y axis.
167  */
168  void CreateSourceTypesH2(const string& name,
169  const string& axisX,
170  const string& axisY,
171  const string& axisZ,
172  double nBinsX,
173  double minX,
174  double maxX,
175  double nBinsY,
176  double minY,
177  double maxY);
178 
179  void CreateAnaStepsPairSourceH1(const string& name,
180  const string& axisX,
181  const string& axisY,
182  double nBins,
183  double min,
184  double max);
185 
186  void InitHist();
187 
188  void FillRichRingNofHits();
189 
190  void MCPairs();
191 
192  void RichPmtXY();
193 
198  void FillCandidates();
199 
203  void AssignMcToCandidates();
204 
208  Bool_t IsMcTrackAccepted(Int_t mcTrackInd);
209 
210  void IsRecoTrackAccepted(CbmAnaJpsiCandidate* cand);
211 
212  void SingleParticleAcceptance();
213 
217  void PairMcAndAcceptance();
218 
219  void PairSource(CbmAnaJpsiCandidate* candP,
220  CbmAnaJpsiCandidate* candM,
222  CbmAnaJpsiKinematicParams* parRec);
223 
224  void TrackSource(CbmAnaJpsiCandidate* cand,
226  Int_t pdg);
227 
228  void FillPairHists(CbmAnaJpsiCandidate* candP,
229  CbmAnaJpsiCandidate* candM,
233 
234  void SignalAndBgReco();
235 
239  void IsElectron(Int_t globalTrackIndex,
240  Double_t momentum,
241  CbmAnaJpsiCandidate* cand);
242 
243 
244  void IsMismatch(CbmAnaJpsiCandidate* cand);
245 
249  void DifferenceSignalAndBg();
250 
251  /*
252  * \brief Copy candidates to the output array.
253  */
254  void CopyCandidatesToOutputArray();
255 
256 
261 
266 
267 
268  ClassDef(CbmAnaJpsiTask, 1)
269 };
270 
271 #endif
CbmAnaJpsiTask::fTofHits
TClonesArray * fTofHits
Definition: CbmAnaJpsiTask.h:74
CbmVertex.h
CbmAnaJpsiTask::fStsTrackMatches
TClonesArray * fStsTrackMatches
Definition: CbmAnaJpsiTask.h:64
CbmAnaJpsiTask::fWeight
Double_t fWeight
Definition: CbmAnaJpsiTask.h:90
CbmAnaJpsiTask::fRichHits
TClonesArray * fRichHits
Definition: CbmAnaJpsiTask.h:66
CbmAnaJpsiTask::fNofHitsInRingMap
std::map< Int_t, Int_t > fNofHitsInRingMap
Definition: CbmAnaJpsiTask.h:81
CbmAnaJpsiTask::fMcTracks
TClonesArray * fMcTracks
Definition: CbmAnaJpsiTask.h:60
CbmAnaJpsiCandidate
Definition: CbmAnaJpsiCandidate.h:8
CbmGlobalTrack.h
CbmAnaJpsiTask::fTrdPoints
TClonesArray * fTrdPoints
Definition: CbmAnaJpsiTask.h:69
CbmRichRing.h
CbmAnaJpsiTask::fUseTrd
Bool_t fUseTrd
Definition: CbmAnaJpsiTask.h:94
CbmHistManager.h
Histogram manager.
CbmAnaJpsiTask::fStsPoints
TClonesArray * fStsPoints
Definition: CbmAnaJpsiTask.h:61
CbmAnaJpsiTask::CbmAnaJpsiTask
CbmAnaJpsiTask(const CbmAnaJpsiTask &)
Copy constructor.
CbmAnaJpsiTask::fCuts
CbmAnaJpsiCuts fCuts
Definition: CbmAnaJpsiTask.h:88
CbmAnaJpsiTask::fCandidates
std::vector< CbmAnaJpsiCandidate > fCandidates
Definition: CbmAnaJpsiTask.h:86
min
friend F32vec4 min(const F32vec4 &a, const F32vec4 &b)
Definition: L1/vectors/P4_F32vec4.h:33
CbmAnaJpsiTask::fEventNum
Int_t fEventNum
Definition: CbmAnaJpsiTask.h:58
CbmAnaJpsiTask::fUseTof
Bool_t fUseTof
Definition: CbmAnaJpsiTask.h:95
CbmAnaJpsiCuts.h
CbmAnaJpsiTask::fTrdHits
TClonesArray * fTrdHits
Definition: CbmAnaJpsiTask.h:70
CbmAnaJpsiHist.h
CbmHistManager
Histogram manager.
Definition: CbmHistManager.h:41
CbmAnaJpsiTask::fStsTracks
TClonesArray * fStsTracks
Definition: CbmAnaJpsiTask.h:63
CbmVertex
Definition: CbmVertex.h:26
CbmAnaJpsiTask::fRichRingMatches
TClonesArray * fRichRingMatches
Definition: CbmAnaJpsiTask.h:68
CbmAnaJpsiTask::fTrdTracks
TClonesArray * fTrdTracks
Definition: CbmAnaJpsiTask.h:71
CbmAnaJpsiTask::fRichRings
TClonesArray * fRichRings
Definition: CbmAnaJpsiTask.h:67
CbmAnaJpsiTask::fTofPoints
TClonesArray * fTofPoints
Definition: CbmAnaJpsiTask.h:73
CbmAnaJpsiAnalysisSteps
CbmAnaJpsiAnalysisSteps
Definition: CbmAnaJpsiHist.h:20
CbmAnaJpsiKinematicParams
Definition: CbmAnaJpsiKinematicParams.h:12
CbmAnaJpsiKinematicParams.h
CbmAnaJpsiTask::fTrdTrackMatches
TClonesArray * fTrdTrackMatches
Definition: CbmAnaJpsiTask.h:72
CbmAnaJpsiCandidate.h
CbmAnaJpsiTask::fPrimVertex
CbmVertex * fPrimVertex
Definition: CbmAnaJpsiTask.h:83
CbmAnaJpsiTask::fHM
CbmHistManager * fHM
Definition: CbmAnaJpsiTask.h:92
CbmAnaJpsiTask::fStsHits
TClonesArray * fStsHits
Definition: CbmAnaJpsiTask.h:62
CbmAnaJpsiTask::fJpsiCandidates
TClonesArray * fJpsiCandidates
Definition: CbmAnaJpsiTask.h:77
CbmTrdTrack.h
CbmAnaJpsiTask::operator=
CbmAnaJpsiTask & operator=(const CbmAnaJpsiTask &)
Assignment operator.
max
friend F32vec4 max(const F32vec4 &a, const F32vec4 &b)
Definition: L1/vectors/P4_F32vec4.h:36
CbmAnaJpsiTask::fRichPoints
TClonesArray * fRichPoints
Definition: CbmAnaJpsiTask.h:65
CbmKFVertex.h
CbmAnaJpsiTask::fKFVertex
CbmKFVertex fKFVertex
Definition: CbmAnaJpsiTask.h:84
CbmAnaJpsiTask::fTofHitsMatches
TClonesArray * fTofHitsMatches
Definition: CbmAnaJpsiTask.h:75
CbmAnaJpsiTask::fGlobalTracks
TClonesArray * fGlobalTracks
Definition: CbmAnaJpsiTask.h:76
CbmAnaJpsiTask
Definition: CbmAnaJpsiTask.h:28
CbmKFVertex
Definition: CbmKFVertex.h:6
CbmAnaJpsiCuts
Definition: CbmAnaJpsiCuts.h:10