CbmRoot
Loading...
Searching...
No Matches
CbmRichRingRecoQa.h
Go to the documentation of this file.
1/* Copyright (C) 2025 Justus-Liebig-Universitaet Giessen, Giessen
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Martin Beyer [committer] */
4
11
12#pragma once
13
14#include "CbmQaTask.h"
15
16class CbmDigiManager;
17class CbmMCDataArray;
18class CbmMCTrack;
19class CbmRichRing;
20class TClonesArray;
21
42 public:
43 CbmRichRingRecoQa(int verbose, bool isMcUsed) : CbmQaTask("CbmRichRingRecoQa", verbose, isMcUsed){};
44
45 InitStatus InitQa() override;
46
47 void ExecQa() override;
48
49 void Check() override;
50
51 void CreateSummary() override{};
52
53 private:
55 {
56 Reco = -1, // Reconstruced ring
57 TrueReco = 0, // [MC] True reconstructed ring, all particle types
58 PrimEl = 1, // [MC] True reconstructed primary electron ring
59 SecEl = 2, // [MC] True reconstructed secondary electron ring
60 Pion = 3, // [MC] True reconstructed pion ring
61 Other = 4, // [MC] True reconstructed other ring, e.g. muon
62 Fake = 5, // [MC] Fake/Ghost ring (e.g. sub quota)
63 Clone = 6, // [MC] Clone ring, i.e. multiple reconstructed rings for same accepted ring
64 };
65
67 {
68 Radius = 0, // Ring radius
69 NHits = 1, // Number of ring hits
70 CenterX = 2, // Center x of ellipse fit
71 CenterY = 3, // Center y of ellipse fit
72 Aaxis = 4, // A axis of ellipse fit
73 Baxis = 5, // B axis of ellipse fit
74 BoA = 6, // B axis / A axis
75 Phi = 7, // Ring tilt/rotation angle
76 Chi2oNDF = 8, // Chi2 / (nHits - 5) [5 for ellipse]
77 Angle = 9, // Largest sum of 3 consecutive angles between hits
78 RadialPosition = 10, // Radial position
79 RadialAngle = 11, // Radial angle
80 };
81
82 void InitHistograms();
83
84 void FillHistsTrueRecoRing(const CbmRichRing* ring, const CbmMCTrack* mcTrack);
85
86 void FillHistsFakeRing(const CbmRichRing* ring);
87
88 void FillHistsRingFeatures(const CbmRichRing* ring, const CbmMCTrack* mcTrack, const ERecoRingType ringType);
89
90 bool IsMcPrimaryElectron(const CbmMCTrack* mcTrack);
91
92 bool IsMcSecondaryElectron(const CbmMCTrack* mcTrack);
93
94 bool IsMcPion(const CbmMCTrack* mcTrack);
95
96 static constexpr int fAccRingMinNumHits{7}; // [MC] Minimum amount of hits for a accepted ring
97 static constexpr double fQuotaRich{0.7}; // [MC] Fraction of hits from a mother particle needed to be true reco
98
99 // [MC] For now very generous checks for efficiencies and purity
100 static constexpr std::array<double, 4> fRingRecoEffsMin{
101 0.5, 0.8, 0.5, 0.2}; // Minimum valid efficiency for TrueReco, PrimEl, SecEl and pion rings
102 static constexpr double fRingPurityMin{0.7}; // Minimum valid ring reco purity
103
104 // Input data
106 TClonesArray* fCbmEvents{nullptr};
107 TClonesArray* fRichHits{nullptr};
108 TClonesArray* fRichRings{nullptr};
109 TClonesArray* fRichProjections{nullptr};
110
111 // [MC] Input data
114 TClonesArray* fRichRingMatches{nullptr};
115
116 // Histograms
117 TH1D* fhRichRingsPerEvent{nullptr}; // Number of rings per CbmEvent
118 TH1D* fhRingTimeInEvent{nullptr}; // Ring time in CbmEvent
119 TH1D* fhRingHitsTime{nullptr}; // Hit times in ring
120 TH2D* fhRingCenterXY{nullptr}; // Position of rings (center of ellipse fit) in camera
121 std::array<TH1D*, 12> fhRingFeatures{}; // Ring features (i.e. radius, number of hits, center x, etc.)
122
123 // [MC] Histograms
124 TH1D* fhRingTypeCounts{nullptr}; // Count rings for various particles types & fake, clone rings
125 TProfile2D* fhRingRecoPurityXY{nullptr}; // Ring reconstruction purity in XY camera plane
126 std::array<TProfile*, 5> fhRingRecoEff{}; // Ring reconstruction efficiency vs MC momentum for various particle types
127 std::array<std::array<TH1D*, 12>, 6> fhRingTypeFeatures{}; // Ring features for all reco ring types, except Clones
128 std::array<std::array<TH2D*, 12>, 5> fhRingTypeFeaturesMomentum{}; // Ring features vs MC momentum all particle types
129
131};
A base class for CBM QA task logic.
CbmDigiManager.
Access to a MC data branch for time-based analysis.
CbmQaTask(const char *name, int verbose, bool isMCUsed, ECbmRecoMode recoMode=ECbmRecoMode::Timeslice)
Constructor from parameters.
Definition CbmQaTask.cxx:32
void FillHistsFakeRing(const CbmRichRing *ring)
void FillHistsTrueRecoRing(const CbmRichRing *ring, const CbmMCTrack *mcTrack)
TClonesArray * fRichRingMatches
bool IsMcPion(const CbmMCTrack *mcTrack)
TClonesArray * fRichHits
CbmMCDataArray * fMcTracks
std::array< std::array< TH2D *, 12 >, 5 > fhRingTypeFeaturesMomentum
TClonesArray * fRichRings
void FillHistsRingFeatures(const CbmRichRing *ring, const CbmMCTrack *mcTrack, const ERecoRingType ringType)
bool IsMcSecondaryElectron(const CbmMCTrack *mcTrack)
CbmMCDataArray * fRichPoints
static constexpr double fQuotaRich
static constexpr int fAccRingMinNumHits
TClonesArray * fCbmEvents
std::array< std::array< TH1D *, 12 >, 6 > fhRingTypeFeatures
CbmRichRingRecoQa(int verbose, bool isMcUsed)
static constexpr double fRingPurityMin
CbmDigiManager * fDigiManager
void ExecQa() override
Method to fill histograms per event or time-slice.
std::array< TH1D *, 12 > fhRingFeatures
void Check() override
Function to check, if the QA results are acceptable.
std::array< TProfile *, 5 > fhRingRecoEff
TProfile2D * fhRingRecoPurityXY
static constexpr std::array< double, 4 > fRingRecoEffsMin
void CreateSummary() override
Initializes QA-task summary: canvases, tables etc.
TClonesArray * fRichProjections
bool IsMcPrimaryElectron(const CbmMCTrack *mcTrack)
InitStatus InitQa() override
Initializes the task.
ClassDefOverride(CbmRichRingRecoQa, 1)