CbmRoot
Loading...
Searching...
No Matches
CbmRichGeoTest.cxx
Go to the documentation of this file.
1/* Copyright (C) 2009-2021 UGiessen/JINR-LIT, Giessen/Dubna
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Andrey Lebedev, Semen Lebedev [committer] */
4
12#include "CbmRichGeoTest.h"
13
14#include "CbmDigiManager.h"
15#include "CbmDrawHist.h"
16#include "CbmHistManager.h"
17#include "CbmMCDataArray.h"
18#include "CbmMCDataManager.h"
19#include "CbmMCEventList.h"
20#include "CbmMCTrack.h"
21#include "CbmReport.h"
22#include "CbmRichConverter.h"
23#include "CbmRichDetectorData.h"
24#include "CbmRichDigi.h"
26#include "CbmRichDraw.h"
27#include "CbmRichGeoManager.h"
28#include "CbmRichHit.h"
29#include "CbmRichPmt.h"
30#include "CbmRichPoint.h"
31#include "CbmRichRing.h"
34#include "CbmStudyReport.h"
35#include "CbmTrackMatchNew.h"
36#include "CbmUtils.h"
37#include "FairGeoNode.h"
38#include "FairGeoTransform.h"
39#include "FairRootManager.h"
40#include "FairRunAna.h"
41#include "FairRuntimeDb.h"
42#include "TCanvas.h"
43#include "TClonesArray.h"
44#include "TEllipse.h"
45#include "TF1.h"
46#include "TH1D.h"
47#include "TH2D.h"
48#include "TH3D.h"
49#include "TLatex.h"
50#include "TLegend.h"
51#include "TLine.h"
52#include "TMCProcess.h"
53#include "TMath.h"
54#include "TPad.h"
55#include "TStyle.h"
56#include "TSystem.h"
57
58#include <TFile.h>
59
60#include <iomanip>
61#include <iostream>
62#include <map>
63#include <sstream>
64#include <string>
65#include <vector>
66
67using namespace std;
68using namespace Cbm;
69
70CbmRichGeoTest::CbmRichGeoTest() : FairTask("CbmRichGeoTestQa") {}
71
73
75{
76 fMcTracks = InitOrFatalMc("MCTrack", "CbmRichGeoTest::Init");
77 fRichPoints = InitOrFatalMc("RichPoint", "CbmRichGeoTest::Init");
78 fRichRefPlanePoints = InitOrFatalMc("RefPlanePoint", "CbmRichGeoTest::Init");
79 fRichHits = GetOrFatal<TClonesArray>("RichHit", "CbmRichUrqmdTest::Init");
80 fRichRings = GetOrFatal<TClonesArray>("RichRing", "CbmRichUrqmdTest::Init");
81 fRichRingMatches = GetOrFatal<TClonesArray>("RichRingMatch", "CbmRichUrqmdTest::Init");
82 fEventList = GetOrFatal<CbmMCEventList>("MCEventList.", "CbmRichUrqmdTest::Init");
83
85 fDigiMan->Init();
87 LOG(fatal) << "CbmRichGeoTest::Init No RichDigi!";
88 }
90 LOG(fatal) << "CbmRichGeoTest::Init No RichDigiMatch!";
91 }
92
95
97
98 return kSUCCESS;
99}
100
101void CbmRichGeoTest::Exec(Option_t* /*option*/)
102{
103 fEventNum++;
104 LOG(info) << "CbmRichGeoTest, event No. " << fEventNum;
105
106 ProcessMc();
108 ProcessHits();
109}
110
112{
113 double xMin = -120.;
114 double xMax = 120.;
115 int nBinsX = 240;
116 double yMin = -210;
117 double yMax = 210.;
118 int nBinsY = 420;
119
120 fHM = new CbmHistManager();
121
122 fHM->Create2<TH2D>("fhHitsXY", "fhHitsXY;X [cm];Y [cm];Counter", nBinsX, xMin, xMax, nBinsY, yMin, yMax);
123 fHM->Create2<TH2D>("fhPointsXY", "fhPointsXY;X [cm];Y [cm];Counter", nBinsX, xMin, xMax, nBinsY, yMin, yMax);
124 fHM->Create2<TH2D>("fhPointsXYNoRotation", "fhPointsXYNoRotation;X [cm];Y [cm];Counter", nBinsX, xMin, xMax, nBinsY,
125 yMin, yMax);
126 fHM->Create1<TH1D>("fhHitsZ", "fhHitsZ;Z [cm];Yield", 150, 100, 250);
127 fHM->Create1<TH1D>("fhPointsZ", "fhPointsZ;Z [cm];Yield", 150, 100, 250);
128 fHM->Create1<TH1D>("fhMcVertexZEl", "fhMcVertexZEl;Z [cm];Counter", 250, -100., 150);
129 fHM->Create2<TH2D>("fhMcVertexXYEl", "fhMcVertexXYEl;X [cm];Y [cm];Counter", 50, -5., 5., 50, -5., 5.);
130
131 vector<string> hp = {"_hits", "_points"};
132 for (size_t i = 0; i < hp.size(); i++) {
133 string t = hp[i];
134 if (i == 0) fHM->Create1<TH1D>("fhNofHits" + t, "fhNofHits" + t + ";# hits/ring;Yield", 50, -.5, 49.5);
135 if (i == 1) fHM->Create1<TH1D>("fhNofHits" + t, "fhNofHits" + t + ";# points/ring;Yield", 400, -.5, 399.5);
136 // ellipse fitting parameters
137 fHM->Create2<TH2D>("fhBoAVsMom" + t, "fhBoAVsMom" + t + ";P [GeV/c];B/A;Yield", 40, 0., 10, 100, 0, 1);
138 fHM->Create2<TH2D>("fhXcYcEllipse" + t, "fhXcYcEllipse" + t + ";X [cm];Y [cm];Yield", nBinsX, xMin, xMax, nBinsY,
139 yMin, yMax);
140 fHM->Create2<TH2D>("fhBaxisVsMom" + t, "fhBaxisVsMom" + t + ";P [GeV/c];B axis [cm];Yield", 40, 0., 10, 200, 0.,
141 10.);
142 fHM->Create2<TH2D>("fhAaxisVsMom" + t, "fhAaxisVsMom" + t + ";P [GeV/c];A axis [cm];Yield", 40, 0., 10, 200, 0.,
143 10.);
144 fHM->Create2<TH2D>("fhChi2EllipseVsMom" + t, "fhChi2EllipseVsMom" + t + ";P [GeV/c];#Chi^{2};Yield", 40, 0., 10.,
145 50, 0., 0.5);
146 // circle fitting parameters
147 fHM->Create2<TH2D>("fhXcYcCircle" + t, "fhXcYcCircle" + t + ";X [cm];Y [cm];Yield", nBinsX, xMin, xMax, nBinsY,
148 yMin, yMax);
149 fHM->Create2<TH2D>("fhRadiusVsMom" + t, "fhRadiusVsMom" + t + ";P [GeV/c];Radius [cm];Yield", 40, 0., 10, 200, 0.,
150 10.);
151 fHM->Create2<TH2D>("fhChi2CircleVsMom" + t, "fhChi2CircleVsMom" + t + ";P [GeV/c];#Chi^{2};Yield", 40, 0., 10., 50,
152 0., .5);
153 fHM->Create2<TH2D>("fhDRVsMom" + t, "fhDRVsMom" + t + ";P [GeV/c];dR [cm];Yield", 40, 0, 10, 200, -2., 2.);
154
155 fHM->Create1<TH1D>("fhBaxisUpHalf" + t, "fhBaxisUpHalf" + t + ";B axis [cm];Yield", 200, 0., 10.);
156 fHM->Create1<TH1D>("fhBaxisDownHalf" + t, "fhBaxisDownHalf" + t + ";B axis [cm];Yield", 200, 0., 10.);
157 }
158
159 fHM->Create1<TH1D>("fhNofPhotonsPerHit", "fhNofPhotonsPerHit;Number of photons per hit;Yield", 10, -0.5, 9.5);
160
161 // Difference between Mc Points and Hits fitting.
162 fHM->Create2<TH2D>("fhDiffAaxis", "fhDiffAaxis;# hits/ring;A_{point}-A_{hit} [cm];Yield", 25, 0., 50., 100, -1., 1.);
163 fHM->Create2<TH2D>("fhDiffBaxis", "fhDiffBaxis;# hits/ring;B_{point}-B_{hit} [cm];Yield", 25, 0., 50., 100, -1., 1.);
164 fHM->Create2<TH2D>("fhDiffXcEllipse", "fhDiffXcEllipse;# hits/ring;Xc_{point}-Xc_{hit} [cm];Yield", 25, 0., 50., 100,
165 -1., 1.);
166 fHM->Create2<TH2D>("fhDiffYcEllipse", "fhDiffYcEllipse;# hits/ring;Yc_{point}-Yc_{hit} [cm];Yield", 25, 0., 50., 100,
167 -1., 1.);
168 fHM->Create2<TH2D>("fhDiffXcCircle", "fhDiffXcCircle;# hits/ring;Xc_{point}-Xc_{hit} [cm];Yield", 25, 0., 50., 100,
169 -1., 1.);
170 fHM->Create2<TH2D>("fhDiffYcCircle", "fhDiffYcCircle;# hits/ring;Yc_{point}-Yc_{hit} [cm];Yield", 25, 0., 50., 100,
171 -1., 1.);
172 fHM->Create2<TH2D>("fhDiffRadius", "fhDiffRadius;# hits/ring;Radius_{point}-Radius_{hit} [cm];Yield", 25, 0., 50.,
173 100, -1., 1.);
174
175 // R, A, B distribution for different number of hits from 0 to 40.
176 fHM->Create2<TH2D>("fhRadiusVsNofHits", "fhRadiusVsNofHits;# hits/ring;Radius [cm];Yield", 40, 0., 40., 100, 0., 10.);
177 fHM->Create2<TH2D>("fhAaxisVsNofHits", "fhAaxisVsNofHits;# hits/ring;A axis [cm];Yield", 40, 0., 40., 100, 0., 10.);
178 fHM->Create2<TH2D>("fhBaxisVsNofHits", "fhBaxisVsNofHits;# hits/ring;B axis [cm];Yield", 40, 0., 40., 100, 0., 10.);
179 fHM->Create2<TH2D>("fhDRVsNofHits", "fhDRVsNofHits;# hits/ring;dR [cm];Yield", 40, 0., 40., 200, -2., 2.);
180
181 // Hits and points.
182 fHM->Create1<TH1D>("fhDiffXhit", "fhDiffXhit;X_{point}-X_{hit} [cm];Yield", 200, -.5, .5);
183 fHM->Create1<TH1D>("fhDiffYhit", "fhDiffYhit;Y_{point}-Y_{hit} [cm];Yield", 200, -.5, .5);
184
185 // Fitting efficiency.
186 fHM->Create1<TH1D>("fhNofHitsAll", "fhNofHitsAll;# hits/ring;Yield", 50, 0., 50.);
187 fHM->Create1<TH1D>("fhNofHitsCircleFit", "fhNofHitsCircleFit;# hits/ring;Yield", 50, 0., 50.);
188 fHM->Create1<TH1D>("fhNofHitsEllipseFit", "fhNofHitsEllipseFit;# hits/ring;Yield", 50, 0., 50.);
189 fHM->Create1<TH1D>("fhNofHitsCircleFitEff", "fhNofHitsCircleFitEff;# hits/ring;Efficiency [%]", 50, 0., 50.);
190 fHM->Create1<TH1D>("fhNofHitsEllipseFitEff", "fhNofHitsEllipseFitEff;# hits/ring;Efficiency [%]", 50, 0., 50.);
191
192 // Detector acceptance efficiency 2D:Pt-Rapidity, 2D:P-Rapidity, 1D:P
193 vector<string> mcAccTypes{"Mc", "Acc"};
194 for (const string& t : mcAccTypes) {
195 fHM->Create1<TH1D>("fhMomEl" + t, "fhMomEl" + t + ";p [GeV/c];Yield", 50, 0., 10.);
196 fHM->Create2<TH2D>("fhPtYEl" + t, "fhPtYEl" + t + ";Rapidity;P_{t} [GeV/c];Yield", 25, 0., 4., 25, 0., 3.);
197 fHM->Create2<TH2D>("fhPYEl" + t, "fhPYEl" + t + ";Rapidity;P [GeV/c];Yield", 25, 0., 4., 25, 0., 10.);
198 }
199
200 fHM->Create1<TH1D>("fhMcMomPi", "fhMcMomPi;p [GeV/c];Yield", 50, 0., 10.);
201 fHM->Create2<TH2D>("fhMcPtyPi", "fhMcPtyPi;Rapidity;P_{t} [GeV/c];Yield", 25, 0., 4., 25, 0., 3.);
202
203 // Numbers in dependence on XY position onto the photodetector.
204 fHM->Create3<TH3D>("fhNofHitsXYZ", "fhNofHitsXYZ;X [cm];Y [cm];# hits/ring", nBinsX, xMin, xMax, nBinsY, yMin, yMax,
205 50, 0., 50);
206 fHM->Create3<TH3D>("fhNofPointsXYZ", "fhNofPointsXYZ;X [cm];Y [cm];# points/ring", nBinsX, xMin, xMax, nBinsY, yMin,
207 yMax, 50, 100., 300.);
208 fHM->Create3<TH3D>("fhBoAXYZ", "fhBoAXYZ;X [cm];Y [cm];B/A", nBinsX, xMin, xMax, nBinsY, yMin, yMax, 100, 0., 1.);
209 fHM->Create3<TH3D>("fhBaxisXYZ", "fhBaxisXYZ;X [cm];Y [cm];B axis [cm]", nBinsX, xMin, xMax, nBinsY, yMin, yMax, 80,
210 3., 7.);
211 fHM->Create3<TH3D>("fhAaxisXYZ", "fhAaxisXYZ;X [cm];Y [cm];A axis [cm]", nBinsX, xMin, xMax, nBinsY, yMin, yMax, 80,
212 3., 7.);
213 fHM->Create3<TH3D>("fhRadiusXYZ", "fhRadiusXYZ;X [cm];Y [cm];Radius [cm]", nBinsX, xMin, xMax, nBinsY, yMin, yMax, 80,
214 3., 7.);
215 fHM->Create3<TH3D>("fhdRXYZ", "fhdRXYZ;X [cm];Y [cm];dR [cm]", nBinsX, xMin, xMax, nBinsY, yMin, yMax, 100, -1., 1.);
216
217 int nBinsX1 = 60;
218 int xMin1 = -120;
219 int xMax1 = 120;
220 int nBinsY1 = 25;
221 int yMin1 = 100;
222 int yMax1 = 200;
223 // Numbers in dependence X or Y position onto the photodetector plane
224 fHM->Create2<TH2D>("fhNofHitsVsX", "fhNofHitsVsX;X [cm];# hits/ring", nBinsX1, xMin1, xMax1, 50, 0., 50);
225 fHM->Create2<TH2D>("fhNofHitsVsY", "fhNofHitsVsY;Abs(Y) [cm];# hits/ring", nBinsY1, yMin1, yMax1, 50, 0., 50);
226
227 fHM->Create2<TH2D>("fhNofPointsVsX", "fhNofPointsVsX;X [cm];# points/ring", nBinsX1, xMin1, xMax1, 50, 100., 300.);
228 fHM->Create2<TH2D>("fhNofPointsVsY", "fhNofPointsVsY;Abs(Y) [cm];# points/ring", nBinsY1, yMin1, yMax1, 50, 100.,
229 300.);
230
231 fHM->Create2<TH2D>("fhBoAVsX", "fhBoAVsX;X [cm];B/A", nBinsX1, xMin1, xMax1, 100, 0., 1.);
232 fHM->Create2<TH2D>("fhBoAVsY", "fhBoAVsY;Abs(Y) [cm];B/A", nBinsY1, yMin1, yMax1, 100, 0., 1.);
233
234 fHM->Create2<TH2D>("fhBaxisVsX", "fhBaxisVsX;X [cm];B axis [cm]", nBinsX1, xMin1, xMax1, 80, 3., 7.);
235 fHM->Create2<TH2D>("fhBaxisVsY", "fhBaxisVsY;Abs(Y) [cm];B axis [cm]", nBinsY1, yMin1, yMax1, 80, 3., 7.);
236
237 fHM->Create2<TH2D>("fhAaxisVsX", "fhAaxisVsX;X [cm];A axis [cm]", nBinsX1, xMin1, xMax1, 80, 3., 7.);
238 fHM->Create2<TH2D>("fhAaxisVsY", "fhAaxisVsY;Abs(Y) [cm];A axis [cm]", nBinsY1, yMin1, yMax1, 80, 3., 7.);
239
240 fHM->Create2<TH2D>("fhRadiusVsX", "fhRadiusVsX;X [cm];Radius [cm]", nBinsX1, xMin1, xMax1, 80, 3., 7.);
241 fHM->Create2<TH2D>("fhRadiusVsY", "fhRadiusVsY;Abs(Y) [cm];Radius [cm]", nBinsY1, yMin1, yMax1, 80, 3., 7.);
242
243 fHM->Create2<TH2D>("fhdRVsX", "fhdRVsX;X [cm];dR [cm]", nBinsX1, xMin1, xMax1, 100, -1., 1.);
244 fHM->Create2<TH2D>("fhdRVsY", "fhdRVsY;Abs(Y) [cm];dR [cm]", nBinsY1, yMin1, yMax1, 100, -1., 1.);
245
246 //Photon energy and wevelength
247 vector<string> photonECat = {"PlaneZ+", "PlaneZ-", "PmtPoint", "PmtHit"};
248 for (const auto& t : photonECat) {
249 fHM->Create1<TH1D>("fhPhotonE" + t, "fhPhotonE" + t + ";Photon energy [eV];Counter", 100, 0., 10.);
250 fHM->Create1<TH1D>("fhLambda" + t, "fhLambda" + t + ";Photon wavelength [nm];Counter", 100, 0., 700.);
251 }
252}
253
255{
256 size_t nofEvents = fEventList->GetNofEvents();
257 for (size_t iE = 0; iE < nofEvents; iE++) {
258 int fileId = fEventList->GetFileIdByIndex(iE);
259 int eventId = fEventList->GetEventIdByIndex(iE);
260
261 int nofMcTracks = fMcTracks->Size(fileId, eventId);
262 for (int iT = 0; iT < nofMcTracks; iT++) {
263 const CbmMCTrack* mcTrack = static_cast<CbmMCTrack*>(fMcTracks->Get(fileId, eventId, iT));
264 if (mcTrack == nullptr) continue;
265 int motherId = mcTrack->GetMotherId();
266 int pdgAbs = std::abs(mcTrack->GetPdgCode());
267 bool isMcPrimaryElectron =
268 (pdgAbs == 11 && motherId == -1) || (mcTrack->GetGeantProcessId() == kPPrimary && pdgAbs == 11);
269
270 if (isMcPrimaryElectron) {
271 fHM->H1("fhMomElMc")->Fill(mcTrack->GetP());
272 fHM->H2("fhPtYElMc")->Fill(mcTrack->GetRapidity(), mcTrack->GetPt());
273 fHM->H2("fhPYElMc")->Fill(mcTrack->GetRapidity(), mcTrack->GetP());
274 TVector3 v;
275 mcTrack->GetStartVertex(v);
276 fHM->H1("fhMcVertexZEl")->Fill(v.Z());
277 fHM->H1("fhMcVertexXYEl")->Fill(v.X(), v.Y());
278 }
279
280 if (pdgAbs == 211 && motherId == -1) {
281 fHM->H1("fhMcMomPi")->Fill(mcTrack->GetP());
282 fHM->H2("fhMcPtyPi")->Fill(mcTrack->GetRapidity(), mcTrack->GetPt());
283 }
284 }
285
286 int nofPoints = fRichPoints->Size(fileId, eventId);
287 for (int iP = 0; iP < nofPoints; iP++) {
288 const CbmRichPoint* point = static_cast<CbmRichPoint*>(fRichPoints->Get(fileId, eventId, iP));
289 if (point == nullptr) continue;
290 TVector3 inPos(point->GetX(), point->GetY(), point->GetZ());
291 TVector3 outPos;
293 fHM->H2("fhPointsXYNoRotation")->Fill(point->GetX(), point->GetY());
294 fHM->H2("fhPointsXY")->Fill(outPos.X(), outPos.Y());
295 fHM->H1("fhPointsZ")->Fill(point->GetZ());
296
297 TVector3 mom;
298 point->Momentum(mom);
299 double momMag = mom.Mag();
300 fHM->H1("fhPhotonEPmtPoint")->Fill(1.e9 * momMag);
301 double lambda = CbmRichPmt::getLambda(momMag);
302 fHM->H1("fhLambdaPmtPoint")->Fill(lambda);
303 }
304
305 int nofPlanePoints = fRichRefPlanePoints->Size(fileId, eventId);
306 for (int iP = 0; iP < nofPlanePoints; iP++) {
307 const CbmRichPoint* point = static_cast<CbmRichPoint*>(fRichRefPlanePoints->Get(fileId, eventId, iP));
308 if (point == nullptr) continue;
309 TVector3 mom;
310 point->Momentum(mom);
311 double momMag = mom.Mag();
312 double lambda = CbmRichPmt::getLambda(momMag);
313 if (point->GetPz() > 0) {
314 fHM->H1("fhPhotonEPlaneZ+")->Fill(1.e9 * momMag);
315 fHM->H1("fhLambdaPlaneZ+")->Fill(lambda);
316 }
317 else {
318 fHM->H1("fhPhotonEPlaneZ-")->Fill(1.e9 * momMag);
319 fHM->H1("fhLambdaPlaneZ-")->Fill(lambda);
320 }
321 }
322 }
323}
324
325CbmRichRingLight CbmRichGeoTest::CreateRingLightWithPoints(int fileId, int mcEventId, int mcTrackId)
326{
327 CbmRichRingLight ringPoint;
328 int nofRichPoints = fRichPoints->Size(fileId, mcEventId);
329 for (int iPoint = 0; iPoint < nofRichPoints; iPoint++) {
330 const CbmRichPoint* richPoint = static_cast<CbmRichPoint*>(fRichPoints->Get(fileId, mcEventId, iPoint));
331 if (richPoint == nullptr) continue;
332 int trackId = richPoint->GetTrackID();
333 if (trackId < 0) continue;
334 const CbmMCTrack* mcTrackRich = static_cast<CbmMCTrack*>(fMcTracks->Get(fileId, mcEventId, trackId));
335 if (mcTrackRich == nullptr) continue;
336 int motherIdRich = mcTrackRich->GetMotherId();
337 if (motherIdRich == mcTrackId) {
338 TVector3 posPoint;
339 richPoint->Position(posPoint);
340 TVector3 detPoint;
341 CbmRichGeoManager::GetInstance().RotatePoint(&posPoint, &detPoint);
342 CbmRichHitLight hit(detPoint.X(), detPoint.Y());
343 ringPoint.AddHit(hit);
344 }
345 }
346 return ringPoint;
347}
348
350{
351 int fileId = 0;
352 int nofRings = fRichRings->GetEntriesFast();
353 for (int iR = 0; iR < nofRings; iR++) {
354 const CbmRichRing* ring = static_cast<CbmRichRing*>(fRichRings->At(iR));
355 if (ring == nullptr) continue;
356 const CbmTrackMatchNew* ringMatch = static_cast<CbmTrackMatchNew*>(fRichRingMatches->At(iR));
357 if (ringMatch == nullptr || ringMatch->GetNofLinks() < 1) continue;
358 int mcEventId = ringMatch->GetMatchedLink().GetEntry();
359 int mcTrackId = ringMatch->GetMatchedLink().GetIndex();
360 const CbmMCTrack* mcTrack = static_cast<CbmMCTrack*>(fMcTracks->Get(fileId, mcEventId, mcTrackId));
361 if (mcTrack == nullptr) continue;
362 int motherId = mcTrack->GetMotherId();
363 int pdgAbs = std::abs(mcTrack->GetPdgCode());
364 double mom = mcTrack->GetP();
365 double pt = mcTrack->GetPt();
366 double rapidity = mcTrack->GetRapidity();
367 bool isMcPrimaryElectron =
368 (pdgAbs == 11 && motherId == -1) || (mcTrack->GetGeantProcessId() == kPPrimary && pdgAbs == 11);
369
370 if (ring->GetNofHits() >= fMinNofHits) {
371 if (isMcPrimaryElectron) {
372 fHM->H1("fhMomElAcc")->Fill(mom);
373 fHM->H2("fhPtYElAcc")->Fill(rapidity, pt);
374 fHM->H2("fhPYElAcc")->Fill(rapidity, mom);
375 }
376 }
377
378 if (!isMcPrimaryElectron) continue; // only primary electrons
379
380 CbmRichRingLight ringPoint = CreateRingLightWithPoints(fileId, mcEventId, mcTrackId);
381 fHM->H1("fhNofHitsAll")->Fill(ring->GetNofHits());
382
383 CbmRichRingLight ringHit;
385
386 FitAndFillHistCircle(0, &ringHit, mom); //hits
387 FitAndFillHistCircle(1, &ringPoint, mom); // points
388 FillMcVsHitFitCircle(&ringHit, &ringPoint);
389
390 double r = ringHit.GetRadius();
391 double xc = ringHit.GetCenterX();
392 double yc = ringHit.GetCenterY();
393
394 if (ringHit.GetRadius() > fMinRadius && ringHit.GetRadius() < fMaxRadius) {
395 fHM->H1("fhNofHitsCircleFit")->Fill(ringHit.GetNofHits());
396 }
397 if (fDrawEventDisplay && fNofDrawnRings < 10) {
398 DrawRing(&ringHit, &ringPoint);
399 }
400
401 FitAndFillHistEllipse(0, &ringHit, mom); // hits
402 FitAndFillHistEllipse(1, &ringPoint, mom); // points
403 FillMcVsHitFitEllipse(&ringHit, &ringPoint);
404
405 if (ringHit.GetAaxis() > fMinAaxis && ringHit.GetAaxis() < fMaxAaxis && ringHit.GetBaxis() > fMinBaxis
406 && ringHit.GetAaxis() < fMaxBaxis) {
407 fHM->H1("fhNofHitsEllipseFit")->Fill(ringHit.GetNofHits());
408
409 double np = ringPoint.GetNofHits();
410 double a = ringHit.GetAaxis();
411 double b = ringHit.GetBaxis();
412 double nh = ring->GetNofHits();
413
414 fHM->H3("fhNofHitsXYZ")->Fill(xc, yc, nh);
415 fHM->H3("fhNofPointsXYZ")->Fill(xc, yc, np);
416 fHM->H3("fhBoAXYZ")->Fill(xc, yc, b / a);
417 fHM->H3("fhBaxisXYZ")->Fill(xc, yc, b);
418 fHM->H3("fhAaxisXYZ")->Fill(xc, yc, a);
419 fHM->H3("fhRadiusXYZ")->Fill(xc, yc, r);
420
421 fHM->H2("fhNofHitsVsX")->Fill(xc, nh);
422 fHM->H2("fhNofPointsVsX")->Fill(xc, np);
423 fHM->H2("fhBoAVsX")->Fill(xc, b / a);
424 fHM->H2("fhBaxisVsX")->Fill(xc, b);
425 fHM->H2("fhAaxisVsX")->Fill(xc, a);
426 fHM->H2("fhRadiusVsX")->Fill(xc, r);
427
428 fHM->H2("fhNofHitsVsY")->Fill(abs(yc), nh);
429 fHM->H2("fhNofPointsVsY")->Fill(abs(yc), np);
430 fHM->H2("fhBoAVsY")->Fill(abs(yc), b / a);
431 fHM->H2("fhBaxisVsY")->Fill(abs(yc), b);
432 fHM->H2("fhAaxisVsY")->Fill(abs(yc), a);
433 fHM->H2("fhRadiusVsY")->Fill(abs(yc), r);
434
435 for (int iH = 0; iH < ringHit.GetNofHits(); iH++) {
436 double xh = ringHit.GetHit(iH).fX;
437 double yh = ringHit.GetHit(iH).fY;
438 double dr = r - sqrt((xc - xh) * (xc - xh) + (yc - yh) * (yc - yh));
439 fHM->H3("fhdRXYZ")->Fill(xc, yc, dr);
440 fHM->H2("fhdRVsX")->Fill(xc, dr);
441 fHM->H2("fhdRVsY")->Fill(abs(yc), dr);
442 }
443 }
444 } // iR
445}
446
447void CbmRichGeoTest::FitAndFillHistEllipse(int histIndex, CbmRichRingLight* ring, double momentum)
448{
449 fTauFit->DoFit(ring);
450 double axisA = ring->GetAaxis();
451 double axisB = ring->GetBaxis();
452 double xcEllipse = ring->GetCenterX();
453 double ycEllipse = ring->GetCenterY();
454 int nofHitsRing = ring->GetNofHits();
455 string t = (histIndex == 0) ? "_hits" : "_points";
456
457 if (axisA > fMinAaxis && axisA < fMaxAaxis && axisB > fMinBaxis && axisB < fMaxBaxis) {
458 fHM->H1("fhBoAVsMom" + t)->Fill(momentum, axisB / axisA);
459 fHM->H2("fhXcYcEllipse" + t)->Fill(xcEllipse, ycEllipse);
460 }
461 fHM->H1("fhNofHits" + t)->Fill(nofHitsRing);
462
463 if (ycEllipse > 149 || ycEllipse < -149) {
464 fHM->H1("fhBaxisUpHalf" + t)->Fill(axisB);
465 }
466 else {
467 fHM->H1("fhBaxisDownHalf" + t)->Fill(axisB);
468 }
469
470 fHM->H2("fhBaxisVsMom" + t)->Fill(momentum, axisB);
471 fHM->H2("fhAaxisVsMom" + t)->Fill(momentum, axisA);
472 fHM->H2("fhChi2EllipseVsMom" + t)->Fill(momentum, ring->GetChi2() / ring->GetNofHits());
473 if (histIndex == 0) { // only hit fit
474 fHM->H2("fhAaxisVsNofHits")->Fill(nofHitsRing, axisA);
475 fHM->H2("fhBaxisVsNofHits")->Fill(nofHitsRing, axisB);
476 }
477}
478
479void CbmRichGeoTest::FitAndFillHistCircle(int histIndex, CbmRichRingLight* ring, double momentum)
480{
481 fCopFit->DoFit(ring);
482 double radius = ring->GetRadius();
483 double xcCircle = ring->GetCenterX();
484 double ycCircle = ring->GetCenterY();
485 int nofHitsRing = ring->GetNofHits();
486 string t = (histIndex == 0) ? "_hits" : "_points";
487
488 fHM->H1("fhXcYcCircle" + t)->Fill(xcCircle, ycCircle);
489 fHM->H1("fhRadiusVsMom" + t)->Fill(momentum, radius);
490 fHM->H1("fhChi2CircleVsMom" + t)->Fill(momentum, ring->GetChi2() / ring->GetNofHits());
491
492 for (int iH = 0; iH < nofHitsRing; iH++) {
493 double xh = ring->GetHit(iH).fX;
494 double yh = ring->GetHit(iH).fY;
495 double dr = radius - sqrt((xcCircle - xh) * (xcCircle - xh) + (ycCircle - yh) * (ycCircle - yh));
496 fHM->H1("fhDRVsMom" + t)->Fill(momentum, dr);
497
498 if (histIndex == 0) { // only hit fit
499 fHM->H2("fhDRVsNofHits")->Fill(nofHitsRing, dr);
500 }
501 }
502
503 if (histIndex == 0) { // only hit fit
504 fHM->H2("fhRadiusVsNofHits")->Fill(nofHitsRing, radius);
505 }
506}
507
509{
510 fHM->H2("fhDiffAaxis")->Fill(ring->GetNofHits(), ringMc->GetAaxis() - ring->GetAaxis());
511 fHM->H2("fhDiffBaxis")->Fill(ring->GetNofHits(), ringMc->GetBaxis() - ring->GetBaxis());
512 fHM->H2("fhDiffXcEllipse")->Fill(ring->GetNofHits(), ringMc->GetCenterX() - ring->GetCenterX());
513 fHM->H2("fhDiffYcEllipse")->Fill(ring->GetNofHits(), ringMc->GetCenterY() - ring->GetCenterY());
514}
515
517{
518 fHM->H2("fhDiffXcCircle")->Fill(ring->GetNofHits(), ringMc->GetCenterX() - ring->GetCenterX());
519 fHM->H2("fhDiffYcCircle")->Fill(ring->GetNofHits(), ringMc->GetCenterY() - ring->GetCenterY());
520 fHM->H2("fhDiffRadius")->Fill(ring->GetNofHits(), ringMc->GetRadius() - ring->GetRadius());
521}
522
524{
525 int fileId = 0;
526 int nofHits = fRichHits->GetEntriesFast();
527 for (int iH = 0; iH < nofHits; iH++) {
528 const CbmRichHit* hit = static_cast<CbmRichHit*>(fRichHits->At(iH));
529 if (hit == nullptr) continue;
530 int digiIndex = hit->GetRefId();
531 if (digiIndex < 0) continue;
532 const CbmRichDigi* digi = fDigiMan->Get<CbmRichDigi>(digiIndex);
533 if (digi == nullptr) continue;
534 const CbmMatch* digiMatch = fDigiMan->GetMatch(ECbmModuleId::kRich, digiIndex);
535 if (digiMatch == nullptr) continue;
536
537 vector<CbmLink> links = digiMatch->GetLinks();
538 for (size_t i = 0; i < links.size(); i++) {
539 int pointId = links[i].GetIndex();
540 int eventId = links[i].GetEntry();
541 if (pointId < 0) continue; // noise hit
542
543 const CbmRichPoint* point = static_cast<CbmRichPoint*>(fRichPoints->Get(fileId, eventId, pointId));
544 if (point == nullptr) continue;
545
546 TVector3 inPos(point->GetX(), point->GetY(), point->GetZ());
547 TVector3 outPos;
549 fHM->H1("fhDiffXhit")->Fill(hit->GetX() - outPos.X());
550 fHM->H1("fhDiffYhit")->Fill(hit->GetY() - outPos.Y());
551
552 TVector3 mom;
553 point->Momentum(mom);
554 double momMag = mom.Mag();
555 fHM->H1("fhPhotonEPmtHit")->Fill(1.e9 * momMag);
556 double lambda = CbmRichPmt::getLambda(momMag);
557 fHM->H1("fhLambdaPmtHit")->Fill(lambda);
558 }
559
560 //fHM->H1("fhNofPhotonsPerHit")->Fill(hit->GetNPhotons());
561 fHM->H2("fhHitsXY")->Fill(hit->GetX(), hit->GetY());
562 fHM->H1("fhHitsZ")->Fill(hit->GetZ());
563 }
564}
565
567{
568 if (ringHit->GetNofHits() < 1 || ringPoint->GetNofHits() < 1) return;
569 stringstream ss;
570 ss << "event_display/richgeo_event_display_" << fNofDrawnRings;
572 TCanvas* c = fHM->CreateCanvas(ss.str().c_str(), ss.str().c_str(), 800, 800);
573 c->SetGrid(true, true);
574 TH2D* pad = new TH2D(ss.str().c_str(), (ss.str() + ";X [cm];Y [cm]").c_str(), 1, -15., 15., 1, -15., 15);
575 pad->SetStats(false);
576 pad->Draw();
577
578 // find min and max x and y positions of the hits in order to shift drawing
579 double xmin = ringHit->GetHit(0).fX;
580 double xmax = ringHit->GetHit(0).fX;
581 double ymin = ringHit->GetHit(0).fY;
582 double ymax = ringHit->GetHit(0).fY;
583 for (int i = 0; i < ringHit->GetNofHits(); i++) {
584 double hitX = ringHit->GetHit(i).fX;
585 double hitY = ringHit->GetHit(i).fY;
586 if (xmin > hitX) xmin = hitX;
587 if (xmax < hitX) xmax = hitX;
588 if (ymin > hitY) ymin = hitY;
589 if (ymax < hitY) ymax = hitY;
590 }
591 double xCur = (xmin + xmax) / 2.;
592 double yCur = (ymin + ymax) / 2.;
593
594 //Draw circle and center
595 TEllipse* circle = new TEllipse(ringHit->GetCenterX() - xCur, ringHit->GetCenterY() - yCur, ringHit->GetRadius());
596 circle->SetFillStyle(0);
597 circle->SetLineWidth(3);
598 circle->Draw();
599 TEllipse* center = new TEllipse(ringHit->GetCenterX() - xCur, ringHit->GetCenterY() - yCur, .5);
600 center->Draw();
601
602 // Draw hits
603 for (int i = 0; i < ringHit->GetNofHits(); i++) {
604 TEllipse* hitDr = new TEllipse(ringHit->GetHit(i).fX - xCur, ringHit->GetHit(i).fY - yCur, .5);
605 hitDr->SetFillColor(kRed);
606 hitDr->Draw();
607 }
608
609 // Draw MC Points
610 for (int i = 0; i < ringPoint->GetNofHits(); i++) {
611 TEllipse* pointDr = new TEllipse(ringPoint->GetHit(i).fX - xCur, ringPoint->GetHit(i).fY - yCur, 0.15);
612 pointDr->SetFillColor(kBlue);
613 pointDr->Draw();
614 }
615
616 //Draw information
617 stringstream ss2;
618 ss2 << "(r, n)=(" << setprecision(3) << ringHit->GetRadius() << ", " << ringHit->GetNofHits() << ")";
619 TLatex* latex = new TLatex(-8., 8., ss2.str().c_str());
620 latex->Draw();
621}
622
624{
625 int nofMc = fHM->H1("fhMomElMc")->GetEntries();
626 TH1D* hist = static_cast<TH1D*>(fHM->H1("fhNofHits_hits")->Clone("fhAccVsMinNofHitsHist"));
627 hist->GetXaxis()->SetTitle("Required min nof hits in ring");
628 hist->GetYaxis()->SetTitle("Detector acceptance [%]");
629 double sum = 0.;
630 for (int i = hist->GetNbinsX(); i > 1; i--) {
631 sum += fHM->H1("fhNofHits_hits")->GetBinContent(i);
632 hist->SetBinContent(i, 100. * sum / nofMc);
633 }
634 return hist;
635}
636
637void CbmRichGeoTest::DrawH2MeanRms(TH2* hist, const string& canvasName)
638{
639 TCanvas* c = fHM->CreateCanvas(canvasName.c_str(), canvasName.c_str(), 1200, 600);
640 c->Divide(2, 1);
641 c->cd(1);
642 DrawH2WithProfile(hist);
643 c->cd(2);
644 TH1D* py = (TH1D*) hist->ProjectionY((string(hist->GetName()) + "_py").c_str())->Clone();
645 //DrawH1andFitGauss(py);
646 DrawH1(py, kLinear, kLinear, "hist");
647 py->SetStats(true);
648 py->Scale(1. / py->Integral());
649 py->GetYaxis()->SetTitle("Yield");
650}
651
653{
655
656 {
657 TCanvas* c = fHM->CreateCanvas("richgeo_vertex_el", "richgeo_vertex_el", 2000, 1000);
658 c->Divide(2, 1);
659 c->cd(1);
660 DrawH1(fHM->H1("fhMcVertexZEl"), kLinear, kLinear, "hist");
661 c->cd(2);
662 DrawH2(fHM->H2("fhMcVertexXYEl"));
663 }
664
665 {
666 TCanvas* c = fHM->CreateCanvas("richgeo_hits_xy", "richgeo_hits_xy", 1200, 1200);
667 CbmRichDraw::DrawPmtH2(fHM->H2("fhHitsXY"), c);
668 }
669
670 {
671 TCanvas* c = fHM->CreateCanvas("richgeo_points_xy", "richgeo_points_xy", 1200, 1200);
672 CbmRichDraw::DrawPmtH2(fHM->H2("fhPointsXY"), c);
673 }
674
675 {
676 TCanvas* c = fHM->CreateCanvas("richgeo_points_xy_no_rotation", "richgeo_points_xy_no_rotation", 1200, 1200);
677 CbmRichDraw::DrawPmtH2(fHM->H2("fhPointsXYNoRotation"), c);
678 }
679
680 {
681 fHM->CreateCanvas("richgeo_hits_z", "richgeo_hits_z", 1200, 1200);
682 fHM->NormalizeToIntegral("fhHitsZ");
683 DrawH1(fHM->H1("fhHitsZ"), kLinear, kLinear, "hist");
684 }
685
686 {
687 fHM->CreateCanvas("richgeo_points_z", "richgeo_points_z", 1200, 1200);
688 fHM->NormalizeToIntegral("fhPointsZ");
689 DrawH1(fHM->H1("fhPointsZ"), kLinear, kLinear, "hist");
690 }
691
692 vector<string> ph = {"_hits", "_points"};
693 for (const string& t : ph) {
694
695 DrawH2MeanRms(fHM->H2("fhBoAVsMom" + t), "richgeo" + t + "_ellipse_boa_vs_mom");
696 fHM->H2("fhBoAVsMom" + t)->GetYaxis()->SetRangeUser(0.8, 1.0);
697
698 {
699 string name = "richgeo" + t + "_ellipse_xc_yc";
700 fHM->CreateCanvas(name.c_str(), name.c_str(), 1200, 1200);
701 DrawH2(fHM->H2("fhXcYcEllipse" + t));
702 }
703
704 DrawH2MeanRms(fHM->H2("fhChi2EllipseVsMom" + t), "richgeo" + t + "_chi2_ellipse_vs_mom");
705 DrawH2MeanRms(fHM->H2("fhAaxisVsMom" + t), "richgeo" + t + "_a_vs_mom");
706 DrawH2MeanRms(fHM->H2("fhBaxisVsMom" + t), "richgeo" + t + "_b_vs_mom");
707
708 {
709 string name = "richgeo" + t + "_b_up_down_halves";
710 TCanvas* c = fHM->CreateCanvas(name.c_str(), name.c_str(), 2000, 1000);
711 c->Divide(2, 1);
712 c->cd(1);
713 TH1* hUp = fHM->H1Clone("fhBaxisUpHalf" + t);
714 DrawH1(hUp, kLinear, kLinear, "hist");
715 hUp->SetStats(true);
716 c->cd(2);
717 TH1* hDown = fHM->H1Clone("fhBaxisDownHalf" + t);
718 DrawH1(hDown, kLinear, kLinear, "hist");
719 hDown->SetStats(true);
720 }
721
722 {
723 string name = "richgeo" + t + "_circle";
724 TCanvas* c = fHM->CreateCanvas(name.c_str(), name.c_str(), 2000, 1000);
725 c->Divide(2, 1);
726 c->cd(1);
727 DrawH1andFitGauss(fHM->H1Clone("fhNofHits" + t));
728 LOG(info) << "Number of hits/points = " << fHM->H1("fhNofHits" + t)->GetMean();
729 //gPad->SetLogy(true);
730 c->cd(2);
731 DrawH2(fHM->H2("fhXcYcCircle" + t));
732 }
733
734 DrawH2MeanRms(fHM->H2("fhChi2CircleVsMom" + t), "richgeo" + t + "_chi2_circle_vs_mom");
735 DrawH2MeanRms(fHM->H2("fhRadiusVsMom" + t), "richgeo" + t + "_r_vs_mom");
736 DrawH2MeanRms(fHM->H2("fhDRVsMom" + t), "richgeo" + t + "_dr_vs_mom");
737 fHM->H2("fhDRVsMom" + t)->GetYaxis()->SetRangeUser(-1.05, 1.05);
738 } // _hits, _points
739
740 {
741 fHM->CreateCanvas("richgeo_nof_photons_per_hit", "richgeo_nof_photons_per_hit", 1200, 1200);
742 fHM->NormalizeToIntegral("fhNofPhotonsPerHit");
743 DrawH1(fHM->H1("fhNofPhotonsPerHit"), kLinear, kLinear, "hist");
744 }
745
746 {
747 TCanvas* c = fHM->CreateCanvas("richgeo_diff_ellipse", "richgeo_diff_ellipse", 2000, 1000);
748 c->Divide(4, 2);
749 c->cd(1);
750 DrawH2WithProfile(fHM->H2("fhDiffAaxis"));
751 c->cd(2);
752 DrawH2WithProfile(fHM->H2("fhDiffBaxis"));
753 c->cd(3);
754 DrawH2WithProfile(fHM->H2("fhDiffXcEllipse"));
755 c->cd(4);
756 DrawH2WithProfile(fHM->H2("fhDiffYcEllipse"));
757 c->cd(5);
758 DrawH1(fHM->H2("fhDiffAaxis")->ProjectionY(), kLinear, kLog, "hist");
759 c->cd(6);
760 DrawH1(fHM->H2("fhDiffBaxis")->ProjectionY(), kLinear, kLog, "hist");
761 c->cd(7);
762 DrawH1(fHM->H2("fhDiffXcEllipse")->ProjectionY(), kLinear, kLog, "hist");
763 c->cd(8);
764 DrawH1(fHM->H2("fhDiffYcEllipse")->ProjectionY(), kLinear, kLog, "hist");
765 }
766
767 {
768 TCanvas* c = fHM->CreateCanvas("richgeo_diff_circle", "richgeo_diff_circle", 1500, 1000);
769 c->Divide(3, 2);
770 c->cd(1);
771 DrawH2WithProfile(fHM->H2("fhDiffXcCircle"));
772 c->cd(2);
773 DrawH2WithProfile(fHM->H2("fhDiffYcCircle"));
774 c->cd(3);
775 DrawH2WithProfile(fHM->H2("fhDiffRadius"));
776 c->cd(4);
777 DrawH1(fHM->H2("fhDiffXcCircle")->ProjectionY(), kLinear, kLog, "hist");
778 c->cd(5);
779 DrawH1(fHM->H2("fhDiffYcCircle")->ProjectionY(), kLinear, kLog, "hist");
780 c->cd(6);
781 DrawH1(fHM->H2("fhDiffRadius")->ProjectionY(), kLinear, kLog, "hist");
782 }
783
784 {
785 TCanvas* c = fHM->CreateCanvas("richgeo_hits_residual", "richgeo_hits", 2000, 1000);
786 c->Divide(2, 1);
787 c->cd(1);
788 fHM->NormalizeToIntegral("fhDiffXhit");
789 DrawH1(fHM->H1("fhDiffXhit"), kLinear, kLinear, "hist");
790 c->cd(2);
791 fHM->NormalizeToIntegral("fhDiffYhit");
792 DrawH1(fHM->H1("fhDiffYhit"), kLinear, kLinear, "hist");
793 }
794
795 {
796 TCanvas* c = fHM->CreateCanvas("richgeo_fit_eff", "richgeo_fit_eff", 1800, 600);
797 c->Divide(3, 1);
798 c->cd(1);
799 DrawH1({fHM->H1Clone("fhNofHitsAll"), fHM->H1Clone("fhNofHitsCircleFit"), fHM->H1Clone("fhNofHitsEllipseFit")},
800 {"All", "Circle fit", "Ellipse fit"}, kLinear, kLog, true, 0.7, 0.7, 0.99, 0.99, "hist");
801 TH1D* fhNofHitsCircleFitEff = Cbm::DivideH1(fHM->H1("fhNofHitsCircleFit"), fHM->H1("fhNofHitsAll"));
802 TH1D* fhNofHitsEllipseFitEff = Cbm::DivideH1(fHM->H1("fhNofHitsEllipseFit"), fHM->H1("fhNofHitsAll"));
803 c->cd(2);
804 DrawH1(fhNofHitsCircleFitEff);
805 auto circleEff = CalcEfficiency(fHM->H1("fhNofHitsCircleFit"), fHM->H1("fhNofHitsAll"));
806 TLatex* circleFitEffTxt = new TLatex(15, 0.5, circleEff.c_str());
807 LOG(info) << "Circle fit efficiency:" << circleEff << "%";
808 circleFitEffTxt->Draw();
809 c->cd(3);
810 DrawH1(fhNofHitsEllipseFitEff);
811 auto ellipseFitEff = CalcEfficiency(fHM->H1("fhNofHitsEllipseFit"), fHM->H1("fhNofHitsAll"));
812 TLatex* ellipseFitEffTxt = new TLatex(15, 0.5, ellipseFitEff.c_str());
813 LOG(info) << "Ellipse fit efficiency:" << ellipseFitEff << "%";
814 ellipseFitEffTxt->Draw();
815 }
816
817 {
818 TCanvas* c = fHM->CreateCanvas("richgeo_acc_el", "richgeo_acc_el", 1800, 1200);
819 c->Divide(3, 2);
820 c->cd(1);
821 DrawH1(fHM->H1Vector({string("fhMomElMc"), "fhMomElAcc"}), {"MC", "ACC"}, kLinear, kLog, true, 0.8, 0.8, 0.99, 0.99,
822 "hist");
823 c->cd(2);
824 DrawH2(fHM->H2("fhPtYElMc"));
825 fHM->H2("fhPtYElMc")->SetMinimum(0.);
826 c->cd(3);
827 DrawH2(fHM->H2("fhPtYElAcc"));
828 fHM->H2("fhPtYElAcc")->SetMinimum(0.);
829 c->cd(4);
830 DrawH2(fHM->H2("fhPYElMc"));
831 fHM->H2("fhPYElMc")->SetMinimum(0.);
832 c->cd(5);
833 DrawH2(fHM->H2("fhPYElAcc"));
834 fHM->H2("fhPYElAcc")->SetMinimum(0.);
835 }
836
837
838 TH1D* pxEff = Cbm::DivideH1(fHM->H1Clone("fhMomElAcc"), (TH1D*) fHM->H1Clone("fhMomElMc"), "", 100.,
839 "Geometrical acceptance [%]");
840 {
841 fHM->CreateCanvas("richgeo_acc_eff_el_mom", "richgeo_acc_eff_el_mom", 800, 800);
842 string effEl = CalcEfficiency(fHM->H1Clone("fhMomElAcc"), fHM->H1Clone("fhMomElMc"));
843 LOG(info) << "Geometrical acceptance electrons:" << effEl << "%";
844 DrawH1({pxEff}, {"e^{#pm} (" + effEl + "%)"}, kLinear, kLinear, true, 0.6, 0.55, 0.88, 0.65);
845 }
846
847 {
848 TH2D* pyzEff =
849 Cbm::DivideH2(fHM->H2Clone("fhPtYElAcc"), fHM->H2Clone("fhPtYElMc"), "", 100., "Geometrical acceptance [%]");
850 fHM->CreateCanvas("richgeo_acc_eff_el_pty", "richgeo_acc_eff_el_pty", 800, 800);
851 DrawH2(pyzEff);
852 }
853
854 {
855 TH2D* pyzEff =
856 Cbm::DivideH2(fHM->H2Clone("fhPYElAcc"), fHM->H2Clone("fhPYElMc"), "", 100., "Geometrical acceptance [%]");
857 fHM->CreateCanvas("richgeo_acc_eff_el_py", "richgeo_acc_eff_el_py", 800, 800);
858 DrawH2(pyzEff);
859 }
860
861 {
862 TCanvas* c = fHM->CreateCanvas("richgeo_acc_eff_el_zoom", "richgeo_acc_eff_el_zoom", 1000, 500);
863 c->Divide(2, 1);
864 c->cd(1);
865 TH1* fhMcMomEl = fHM->H1Clone("fhMomElMc");
866 TH1* fhAccMomEl = fHM->H1Clone("fhMomElAcc");
867 fhMcMomEl->GetXaxis()->SetRangeUser(0., 3.);
868 fhAccMomEl->GetXaxis()->SetRangeUser(0., 3.);
869 fhMcMomEl->SetMinimum(0.);
870 DrawH1({fhMcMomEl, fhAccMomEl}, {"MC", "ACC"}, kLinear, kLog, true, 0.8, 0.8, 0.99, 0.99);
871 gPad->SetLogy(false);
872 c->cd(2);
873 TH1D* pxEffClone = static_cast<TH1D*>(pxEff->Clone());
874 pxEffClone->GetXaxis()->SetRangeUser(0., 3.);
875 pxEffClone->SetMinimum(0.);
876 DrawH1(pxEffClone);
877 }
878
879 // Draw number vs position onto the photodetector plane
880 {
881 TCanvas* c = fHM->CreateCanvas("richgeo_numbers_vs_xy_hits", "richgeo_numbers_vs_xy_hits", 1800, 600);
882 c->Divide(3, 1);
883 c->cd(1);
884 DrawH3Profile(fHM->H3("fhNofHitsXYZ"), true, false, 10, 30);
885 c->cd(2);
886 DrawH2WithProfile(fHM->H2("fhNofHitsVsX"), false, true);
887 c->cd(3);
888 DrawH2WithProfile(fHM->H2("fhNofHitsVsY"), false, true);
889 }
890
891 {
892 TCanvas* c = fHM->CreateCanvas("richgeo_numbers_vs_xy_points", "richgeo_numbers_vs_xy_points", 1800, 600);
893 c->Divide(3, 1);
894 c->cd(1);
895 DrawH3Profile(fHM->H3("fhNofPointsXYZ"), true, false, 100., 300.);
896 c->cd(2);
897 DrawH2WithProfile(fHM->H2("fhNofPointsVsX"), false, true);
898 c->cd(3);
899 DrawH2WithProfile(fHM->H2("fhNofPointsVsY"), false, true);
900 }
901
902 {
903 TCanvas* c = fHM->CreateCanvas("richgeo_numbers_vs_xy_boa", "richgeo_numbers_vs_xy_boa", 1800, 600);
904 c->Divide(3, 1);
905 c->cd(1);
906 DrawH3Profile(fHM->H3("fhBoAXYZ"), true, false, 0.75, 1.0);
907 c->cd(2);
908 DrawH2WithProfile(fHM->H2("fhBoAVsX"), false, true);
909 fHM->H2("fhBoAVsX")->GetYaxis()->SetRangeUser(0.75, 1.0);
910 c->cd(3);
911 DrawH2WithProfile(fHM->H2("fhBoAVsY"), false, true);
912 fHM->H2("fhBoAVsY")->GetYaxis()->SetRangeUser(0.75, 1.0);
913 }
914
915 {
916 TCanvas* c = fHM->CreateCanvas("richgeo_numbers_vs_xy_b", "richgeo_numbers_vs_xy_b", 1800, 600);
917 c->Divide(3, 1);
918 c->cd(1);
919 DrawH3Profile(fHM->H3("fhBaxisXYZ"), true, false, 4., 5.);
920 c->cd(2);
921 DrawH2WithProfile(fHM->H2("fhBaxisVsX"), false, true);
922 c->cd(3);
923 DrawH2WithProfile(fHM->H2("fhBaxisVsY"), false, true);
924 }
925
926 {
927 TCanvas* c = fHM->CreateCanvas("richgeo_numbers_vs_xy_a", "richgeo_numbers_vs_xy_a", 1800, 600);
928 c->Divide(3, 1);
929 c->cd(1);
930 DrawH3Profile(fHM->H3("fhAaxisXYZ"), true, false, 4.4, 5.7);
931 c->cd(2);
932 DrawH2WithProfile(fHM->H2("fhAaxisVsX"), false, true);
933 c->cd(3);
934 DrawH2WithProfile(fHM->H2("fhAaxisVsY"), false, true);
935 }
936
937 {
938 TCanvas* c = fHM->CreateCanvas("richgeo_numbers_vs_xy_r", "richgeo_numbers_vs_xy_r", 1800, 600);
939 c->Divide(3, 1);
940 c->cd(1);
941 DrawH3Profile(fHM->H3("fhRadiusXYZ"), true, false, 4.2, 5.2);
942 c->cd(2);
943 DrawH2WithProfile(fHM->H2("fhRadiusVsX"), false, true);
944 c->cd(3);
945 DrawH2WithProfile(fHM->H2("fhRadiusVsY"), false, true);
946 }
947
948 {
949 TCanvas* c = fHM->CreateCanvas("richgeo_numbers_vs_xy_dr", "richgeo_numbers_vs_xy_dr", 1800, 600);
950 c->Divide(3, 1);
951 c->cd(1);
952 DrawH3Profile(fHM->H3("fhdRXYZ"), false, false, 0., .5);
953 c->cd(2);
954 DrawH2WithProfile(fHM->H2("fhdRVsX"), false, false);
955 c->cd(3);
956 DrawH2WithProfile(fHM->H2("fhdRVsY"), false, false);
957 }
958
959 {
960 fHM->CreateCanvas("richgeo_acc_vs_min_nof_hits", "richgeo_acc_vs_min_nof_hits", 1000, 1000);
962 h->GetXaxis()->SetRangeUser(0., 40.0);
963 DrawH1(h);
964 }
965
966 DrawH2MeanRms(fHM->H2("fhRadiusVsNofHits"), "richgeo_hits_r_vs_nof_hits");
967 DrawH2MeanRms(fHM->H2("fhAaxisVsNofHits"), "richgeo_hits_a_vs_nof_hits");
968 DrawH2MeanRms(fHM->H2("fhBaxisVsNofHits"), "richgeo_hits_b_vs_nof_hits");
969 DrawH2MeanRms(fHM->H2("fhDRVsNofHits"), "richgeo_hits_dr_vs_nof_hits");
970 fHM->H2("fhDRVsNofHits")->GetYaxis()->SetRangeUser(-1.05, 1.05);
971
972 {
973 TCanvas* c = fHM->CreateCanvas("richgeo_hits_rab", "richgeo_hits_rab", 1500, 600);
974 c->Divide(3, 1);
975 c->cd(1);
976 TH1D* pyR =
977 fHM->H2("fhRadiusVsNofHits")->ProjectionY((string(fHM->H2("fhRadiusVsNofHits")->GetName()) + "_py").c_str());
978 DrawH1(pyR, kLinear, kLinear, "hist");
979 pyR->SetStats(true);
980 c->cd(2);
981 TH1D* pyA =
982 fHM->H2("fhAaxisVsNofHits")->ProjectionY((string(fHM->H2("fhAaxisVsNofHits")->GetName()) + "_py").c_str());
983 DrawH1(pyA, kLinear, kLinear, "hist");
984 pyA->SetStats(true);
985 c->cd(3);
986 TH1D* pyB =
987 fHM->H2("fhBaxisVsNofHits")->ProjectionY((string(fHM->H2("fhBaxisVsNofHits")->GetName()) + "_py").c_str());
988 DrawH1(pyB, kLinear, kLinear, "hist");
989 pyB->SetStats(true);
990 }
991
992
993 {
994 TCanvas* c = fHM->CreateCanvas("richgeo_photon_energy", "richgeo_photon_energy", 2000, 1000);
995 vector<string> labels = {"Sens plane Z+", "Sens plane Z-", "PMT Point", "PMT hit"};
996 c->Divide(2, 1);
997 c->cd(1);
998 DrawH1(fHM->H1Vector({"fhPhotonEPlaneZ+", "fhPhotonEPlaneZ-", "fhPhotonEPmtPoint", "fhPhotonEPmtHit"}), labels);
999 c->cd(2);
1000 DrawH1(fHM->H1Vector({"fhLambdaPlaneZ+", "fhLambdaPlaneZ-", "fhLambdaPmtPoint", "fhLambdaPmtHit"}), labels);
1001 }
1002}
1003
1004
1006{
1007 fHM->Create3<TH3D>("fhPointsXYZ", "fhPointsXYZ;X [cm];Y [cm];Z [cm];Yield", 100, -50, 50, 100, -300, 300, 100, 100,
1008 300);
1009 fHM->Create3<TH3D>("fhHitsXYZ", "fhHitsXYZ;X [cm];Y [cm];Z [cm];Yield", 100, -50, 50, 100, -300, 300, 100, 100, 300);
1011 vector<int> pmts = CbmRichDigiMapManager::GetInstance().GetPmtIds();
1012
1013 {
1014 TCanvas* c = fHM->CreateCanvas("richgeo_pixels_xy", "richgeo_pixels_xy", 1500, 1500);
1015 c->SetGrid(true, true);
1016 TH2D* pad = new TH2D("richgeo_pixels_xy", ";X [cm];Y [cm]", 1, -120, 120, 1, -210, 210);
1017 //TH2D* pad = new TH2D("richgeo_pixels_xy", ";X [cm];Y [cm]", 1, -20, 20, 1, 140, 180);
1018 pad->SetStats(false);
1019 pad->Draw();
1020 DrawPmtPoint("xy", pixels, true);
1021 }
1022
1023 {
1024 TCanvas* c = fHM->CreateCanvas("richgeo_pixels_xz", "richgeo_pixels_xz", 1500, 1500);
1025 c->SetGrid(true, true);
1026 TH2D* pad = new TH2D("richgeo_pixels_xz", ";Z [cm];X [cm]", 1, 200, 250, 1, -120., 120.);
1027 pad->SetStats(false);
1028 pad->Draw();
1029 DrawPmtPoint("zx", pixels, true);
1030 }
1031
1032 {
1033 fHM->CreateCanvas("richgeo_pixels_yz", "richgeo_pixels_yz", 1500, 1500);
1034 TH2D* pad = new TH2D("richgeo_pixels_yz", ";Z [cm];Y [cm]", 1, 200, 250, 1, -220, 220);
1035 pad->SetStats(false);
1036 pad->Draw();
1037 DrawPmtPoint("zy", pixels, true);
1038 }
1039
1040 {
1041 TCanvas* c = fHM->CreateCanvas("richgeo_pmts_xy", "richgeo_pmts_xy", 1500, 1500);
1042 c->SetGrid(true, true);
1043 TH2D* pad = new TH2D("richgeo_pmts_xy", ";X [cm];Y [cm]", 1, -120, 120, 1, -210, 210);
1044 pad->SetStats(false);
1045 pad->Draw();
1046 DrawPmtPoint("xy", pmts, false);
1047 }
1048
1049
1050 for (unsigned int i = 0; i < pixels.size(); i++) {
1052 TVector3 inPos(pixelData->fX, pixelData->fY, pixelData->fZ);
1053 TVector3 outPos;
1055
1056 fHM->H3("fhPointsXYZ")->Fill(inPos.X(), inPos.Y(), inPos.Z());
1057 fHM->H3("fhHitsXYZ")->Fill(outPos.X(), outPos.Y(), outPos.Z());
1058 }
1059
1060 {
1061 fHM->CreateCanvas("richgeo_pixels_points_xyz", "richgeo_pixels_points_xyz", 1500, 1500);
1062 fHM->H3("fhPointsXYZ")->Draw();
1063 }
1064
1065 {
1066 fHM->CreateCanvas("richgeo_pixels_hits_xyz", "richgeo_pixels_hits_xyz", 1500, 1500);
1067 fHM->H3("fhHitsXYZ")->Draw();
1068 }
1069}
1070
1071void CbmRichGeoTest::DrawPmtPoint(const string& coordOpt, const vector<int>& ids, bool isDrawPixel)
1072{
1073 for (size_t i = 0; i < ids.size(); i++) {
1074 TVector3 inPos;
1075 double halfSize = 0.0;
1076 if (isDrawPixel) {
1078 inPos.SetXYZ(pixelData->fX, pixelData->fY, pixelData->fZ);
1079 halfSize = 0.15;
1080 }
1081 else {
1083 inPos.SetXYZ(pmtData->fX, pmtData->fY, pmtData->fZ);
1084 halfSize = 0.5 * pmtData->fHeight;
1085 }
1086
1087 TVector3 outPos;
1089 TBox* boxOut = nullptr;
1090 TBox* boxIn = nullptr;
1091 if (coordOpt == "xy") {
1092 boxOut = new TBox(outPos.X() - halfSize, outPos.Y() - halfSize, outPos.X() + halfSize, outPos.Y() + halfSize);
1093 boxIn = new TBox(inPos.X() - halfSize, inPos.Y() - halfSize, inPos.X() + halfSize, inPos.Y() + halfSize);
1094 }
1095 else if (coordOpt == "zx") {
1096 boxOut = new TBox(outPos.Z() - halfSize, outPos.X() - halfSize, outPos.Z() + halfSize, outPos.X() + halfSize);
1097 boxIn = new TBox(inPos.Z() - halfSize, inPos.X() - halfSize, inPos.Z() + halfSize, inPos.X() + halfSize);
1098 }
1099 else if (coordOpt == "zy") {
1100 boxOut = new TBox(outPos.Z() - halfSize, outPos.Y() - halfSize, outPos.Z() + halfSize, outPos.Y() + halfSize);
1101 boxIn = new TBox(inPos.Z() - halfSize, inPos.Y() - halfSize, inPos.Z() + halfSize, inPos.Y() + halfSize);
1102 }
1103
1104 if (boxOut != nullptr && boxIn != nullptr) {
1105 if (isDrawPixel) {
1106 boxOut->SetFillColor(kBlue);
1107 boxIn->SetFillColor(kRed);
1108 }
1109 else {
1110 boxOut->SetFillStyle(0);
1111 boxOut->SetLineColor(kBlue);
1112 boxIn->SetFillStyle(0);
1113 boxIn->SetLineColor(kRed);
1114 }
1115 boxOut->Draw();
1116 boxIn->Draw();
1117 }
1118 }
1119}
1120
1121
1123{
1124 if (fDrawPmts) {
1125 DrawPmts();
1126 }
1127
1128 TDirectory* oldir = gDirectory;
1129 TFile* outFile = FairRootManager::Instance()->GetOutFile();
1130 if (outFile != nullptr) {
1131 outFile->mkdir(GetName());
1132 outFile->cd(GetName());
1133 fHM->WriteToFile();
1134 }
1135
1136 DrawHist();
1138 fHM->Clear();
1139 gDirectory->cd(oldir->GetPath());
1140}
1141
1142string CbmRichGeoTest::CalcEfficiency(TH1* histRec, TH1* histAcc)
1143{
1144 if (histAcc->GetEntries() == 0) {
1145 return "0";
1146 }
1147 else {
1148 double eff = 100. * double(histRec->GetEntries()) / double(histAcc->GetEntries());
1149 return Cbm::NumberToString(eff, 2);
1150 }
1151}
1152
1153void CbmRichGeoTest::DrawFromFile(const string& fileName, const string& outputDir)
1154{
1155 fOutputDir = outputDir;
1156
1158 TFile* oldFile = gFile;
1159 TDirectory* oldDir = gDirectory;
1160
1161 if (fHM != nullptr) delete fHM;
1162
1163 fHM = new CbmHistManager();
1164 TFile* file = new TFile(fileName.c_str());
1165 fHM->ReadFromFile(file);
1166
1167 DrawHist();
1168
1169 fHM->SaveCanvasToImage(fOutputDir, "png,eps");
1170
1172 gFile = oldFile;
1173 gDirectory = oldDir;
1174}
1175
ClassImp(CbmConverterManager)
@ kRich
Ring-Imaging Cherenkov Detector.
void DrawH1andFitGauss(TH1 *hist, Bool_t drawResults, Bool_t doScale, Double_t userRangeMin, Double_t userRangeMax)
void DrawH2WithProfile(TH2 *hist, Bool_t doGaussFit, Bool_t drawOnlyMean, const string &drawOpt2D, Int_t profileColor, Int_t profileLineWidth)
void SetDefaultDrawStyle()
void DrawH1(TH1 *hist, HistScale logx, HistScale logy, const string &drawOpt, Int_t color, Int_t lineWidth, Int_t lineStyle, Int_t markerSize, Int_t markerStyle)
void DrawH2(TH2 *hist, HistScale logx, HistScale logy, HistScale logz, const string &drawOpt)
TH2D * DrawH3Profile(TH3 *h, Bool_t drawMean, Bool_t doGaussFit, Double_t zMin, Double_t zMax)
Helper functions for drawing 1D and 2D histograms and graphs.
@ kLinear
Definition CbmDrawHist.h:69
@ kLog
Definition CbmDrawHist.h:68
Histogram manager.
Convert internal data classes to cbmroot common data classes.
RICH geometry checking and testing.
Here the ring is fitted with the COP algorithm from A. Ayriyan/G. Ososkov.
Here the ring is fitted with Taubin algorithm from A. Ayriyan, G. Ososkov, N. Chernov.
Base class for study reports.
friend fvec sqrt(const fvec &a)
fscal v[fmask::Size]
Definition KfSimdPseudo.h:4
Generates beam ions for transport simulation.
static Bool_t IsPresent(ECbmModuleId systemId)
Presence of a digi branch.
static Bool_t IsMatchPresent(ECbmModuleId systemId)
Presence of a digi match branch.
InitStatus Init()
Initialisation.
const Digi * Get(Int_t index) const
Get a digi object.
static CbmDigiManager * Instance()
Static instance.
const CbmMatch * GetMatch(ECbmModuleId systemId, UInt_t index) const
Get a match object.
Histogram manager.
TCanvas * CreateCanvas(const std::string &name, const std::string &title, Int_t width, Int_t height)
Create and draw TCanvas and store pointer to it.
void SaveCanvasToImage(const std::string &outputDir, const std::string &options="png,eps")
Save all stored canvases to images.
std::vector< TH1 * > H1Vector(const std::vector< std::string > &names) const
Return vector of pointers to TH1 histogram.
void Clear(Option_t *="")
Clear memory. Remove all histograms and canvases.
TH2 * H2(const std::string &name) const
Return pointer to TH2 histogram.
void Create2(const std::string &name, const std::string &title, Int_t nofBinsX, Double_t minBinX, Double_t maxBinX, Int_t nofBinsY, Double_t minBinY, Double_t maxBinY)
Helper function for creation of 2-dimensional histograms and profiles. Template argument is a real ob...
void ReadFromFile(TFile *file)
Read histograms from file.
void WriteToFile()
Write all objects to current opened file.
TH3 * H3(const std::string &name) const
Return pointer to TH3 histogram.
void NormalizeToIntegral(const std::string &histName)
Normalize histogram to integral.
TH2 * H2Clone(const std::string &name) const
Return clone of TH2 histogram.
void Create1(const std::string &name, const std::string &title, Int_t nofBins, Double_t minBin, Double_t maxBin)
Helper function for creation of 1-dimensional histograms and profiles. Template argument is a real ob...
void Create3(const std::string &name, const std::string &title, Int_t nofBinsX, Double_t minBinX, Double_t maxBinX, Int_t nofBinsY, Double_t minBinY, Double_t maxBinY, Int_t nofBinsZ, Double_t minBinZ, Double_t maxBinZ)
Helper function for creation of 3-dimensional histograms and profiles. Template argument is a real ob...
TH1 * H1Clone(const std::string &name) const
Return clone of TH1 histogram.
TH1 * H1(const std::string &name) const
Return pointer to TH1 histogram.
double GetZ() const
Definition CbmHit.h:71
int32_t GetRefId() const
Definition CbmHit.h:73
TObject * Get(const CbmLink *lnk)
Int_t Size(Int_t fileNumber, Int_t eventNumber)
int32_t GetFileIdByIndex(uint32_t index)
File number by index @value File number for event at given index in list.
int32_t GetEventIdByIndex(uint32_t index)
Event number by index @value Event number for event at given index in list.
std::size_t GetNofEvents() const
Number of events in the list @value Number of events.
double GetPt() const
Definition CbmMCTrack.h:97
double GetP() const
Definition CbmMCTrack.h:98
uint32_t GetGeantProcessId() const
Definition CbmMCTrack.h:67
int32_t GetMotherId() const
Definition CbmMCTrack.h:69
int32_t GetPdgCode() const
Definition CbmMCTrack.h:68
double GetRapidity() const
void GetStartVertex(TVector3 &vertex) const
Definition CbmMCTrack.h:176
int32_t GetNofLinks() const
Definition CbmMatch.h:42
const CbmLink & GetMatchedLink() const
Definition CbmMatch.h:41
const std::vector< CbmLink > & GetLinks() const
Definition CbmMatch.h:40
double GetY() const
Definition CbmPixelHit.h:74
double GetX() const
Definition CbmPixelHit.h:73
static void CopyHitsToRingLight(const CbmRichRing *ring1, CbmRichRingLight *ring2)
Copy hits from CbmRichRing to CbmRichRingLight.
static CbmRichDigiMapManager & GetInstance()
Return Instance of CbmRichGeoManager.
std::vector< Int_t > GetPmtIds()
Return ids for all pmts.
std::vector< Int_t > GetPixelAddresses()
Return addresses of all pixels.
CbmRichPixelData * GetPixelDataByAddress(Int_t address)
Return CbmRichDataPixel by digi address.
CbmRichPmtData * GetPmtDataById(Int_t id)
Return CbmRichDataPmt by id.
static void DrawPmtH2(TH2 *h, TCanvas *c, Bool_t usePmtBins=false)
Definition CbmRichDraw.h:23
void RotatePoint(TVector3 *inPos, TVector3 *outPos, Bool_t noTilting=false)
static CbmRichGeoManager & GetInstance()
RICH geometry checking and testing.
CbmDigiManager * fDigiMan
virtual ~CbmRichGeoTest()
Standard destructor.
TClonesArray * fRichHits
CbmMCEventList * fEventList
TH1D * CreateAccVsMinNofHitsHist()
Create histogram: RICH detector acceptance vs. minimum required number of hits in ring.
void FillMcVsHitFitCircle(CbmRichRingLight *ring, CbmRichRingLight *ringMc)
Calculate difference between circle parameters for two fittings using hits and MC points for fit and ...
void RingParameters()
Loop over all rings in array and fill ring parameters histograms.
CbmMCDataArray * fMcTracks
CbmMCDataArray * fRichPoints
std::string CalcEfficiency(TH1 *histRec, TH1 *histAcc)
Calculate efficiency.
void InitHistograms()
Initialize histograms.
virtual void Finish()
Inherited from FairTask.
void ProcessHits()
Calculate residuals between hits and MC points and fill histograms.
CbmRichGeoTest()
Standard constructor.
void FillMcVsHitFitEllipse(CbmRichRingLight *ring, CbmRichRingLight *ringMc)
Calculate difference between ellipse parameters for two fitting using hits and MC points for fit and ...
TClonesArray * fRichRings
void ProcessMc()
Fill MC histogram for detector acceptance calculation.
void FitAndFillHistCircle(int histIndex, CbmRichRingLight *ring, double momentum)
Fit ring using circle fitter and fill histograms.
void DrawPmtPoint(const std::string &coordOpt, const std::vector< int > &ids, bool isDrawPixel)
TClonesArray * fRichRingMatches
CbmRichRingFitterEllipseTau * fTauFit
void DrawH2MeanRms(TH2 *hist, const std::string &canvasName)
CbmHistManager * fHM
virtual InitStatus Init()
Inherited from FairTask.
void DrawHist()
Draw histograms.
std::string fOutputDir
virtual void Exec(Option_t *option)
Inherited from FairTask.
void DrawPmts()
DrawPmts.
void FitAndFillHistEllipse(int histIndex, CbmRichRingLight *ring, double momentum)
Fit ring using ellipse fitter and fill histograms.
CbmRichRingFitterCOP * fCopFit
CbmRichRingLight CreateRingLightWithPoints(int fileId, int mcEventId, int mcTrackId)
void DrawRing(CbmRichRingLight *ringHit, CbmRichRingLight *ringPoint)
Draw ring in separate TCanvas.
void DrawFromFile(const std::string &fileName, const std::string &outputDir)
Draw histogram from file.
CbmMCDataArray * fRichRefPlanePoints
static Double_t getLambda(Double_t momentum)
Here the ring is fitted with the COP algorithm from A. Ayriyan/G. Ososkov.
virtual void DoFit(CbmRichRingLight *ring)
Inherited from CbmRichRingFitterBase.
Here the ring is fitted with Taubin algorithm from A. Ayriyan, G. Ososkov, N. Chernov.
virtual void DoFit(CbmRichRingLight *ring)
Inherited from CbmRichRingFitterBase.
float GetCenterX() const
float GetAaxis() const
float GetRadius() const
float GetCenterY() const
int GetNofHits() const
Return number of hits in ring.
float GetBaxis() const
CbmRichHitLight GetHit(int ind)
Return hit by the index.
float GetChi2() const
void AddHit(CbmRichHitLight hit)
Add new hit to the ring.
int32_t GetNofHits() const
Definition CbmRichRing.h:37
TH1D * DivideH1(TH1 *h1, TH1 *h2, const string &histName, double scale, const string &titleYaxis)
Definition CbmUtils.cxx:84
T * GetOrFatal(const std::string &objName, const std::string &description="")
Definition CbmUtils.h:60
TH2D * DivideH2(TH2 *h1, TH2 *h2, const string &histName, double scale, const string &titleZaxis)
Definition CbmUtils.cxx:103
CbmMCDataArray * InitOrFatalMc(const std::string &objName, const std::string &description)
Definition CbmUtils.cxx:28
std::string NumberToString(const T &value, int precision=1)
Definition CbmUtils.h:34
Hash for CbmL1LinkKey.