BmnRoot
Loading...
Searching...
No Matches
BmnLambdaEmbeddingQa.h
Go to the documentation of this file.
1#ifndef BMNEMBQA_H
2#define BMNEMBQA_H 1
3
4#include <iostream>
5#include <fstream>
6
7#include <TNamed.h>
8#include <TString.h>
9#include <TSystem.h>
10#include <TPolyLine.h>
11#include <TBox.h>
12#include <TChain.h>
13#include <TClonesArray.h>
14#include <TGeoManager.h>
15#include <TCanvas.h>
16#include <TH2.h>
17#include <TMarker.h>
18#include <TProfile.h>
19#include <TProfile2D.h>
20#include <TColor.h>
21#include <TStyle.h>
22#include <TLegend.h>
23
24#include <BmnGlobalTrack.h>
25#include <BmnGemStripHit.h>
26#include <BmnSiliconHit.h>
27#include <CbmStsPoint.h>
28#include <CbmMCTrack.h>
29#include <BmnKalmanFilter.h>
30#include <BmnGemStripStationSet.h>
31#include <BmnSiliconStationSet.h>
33#include <BmnLambdaMisc.h>
34#include <BmnNewFieldMap.h>
35#include <DstEventHeader.h>
36#include <BmnEventHeader.h>
37#include <BmnStripDigit.h>
38#include <UniRun.h>
40
41#include <FairRunAna.h>
42#include <FairTrackParam.h>
43#include <FairMCPoint.h>
44
46
47using namespace std;
48
50
51class BmnLambdaEmbeddingQa : public TNamed {
52public:
53
55 BmnLambdaEmbeddingQa(TString);
56
57 virtual ~BmnLambdaEmbeddingQa();
58
59 // Types of analysis available ...
60 void DoDigiAnalysis();
61 void DoEffAnalysis();
62
63 void DoDrawEventsWithEmbeddedSignals(); // Draw events with embedded hits from Lambda decay products
64 // void DoInnerTrackerEmbeddingEfficiency(); // Calculate efficiency of embedding
65 void DoInnerTrackerRecoEfficiency(); // Calculate some params. showing hit reconstruction and tracking efficiency
66
67 void DoDrawFoundTracks(Bool_t flag) {
68 drawFoundTracks = flag;
69 }
70
71 // Setting prefix name if needed ...
72 void SetPrefixName(TString name) {
73 fPrefix = name;
74 }
75
76 void ShowLays(Int_t lay1, Int_t lay2) {
77 aLaysToShow[0] = lay1;
78 aLaysToShow[1] = lay2;
79 }
80
81 void SetSignalCuts(TString det, Double_t min, Double_t max) {
82 Int_t idx = det.Contains("GEM") ? GEM : det.Contains("SILICON") ? SILICON : -1;
83 fSignalWindow[idx][0] = min;
84 fSignalWindow[idx][1] = max;
85 }
86
87 void DrawHistos6(TClonesArray*, TClonesArray*); // Function to draw histos from BmnLambdaMisc::CheckStripOverlaps(), temporarily solution
88
89private:
90 Int_t nInputs;
91
92 FairRunAna* fRunAna;
93
94 // Geometries
96
97 // Files
98 TString* fDigi;
99 TString* fDst;
100 TString* fEmb;
101 TString* fPath;
102
103 // Pointers to be addressed to corresponding objects if an analysis we do uses them
104 BmnFieldMap* fMagField;
106 DstEventHeader* hDst;
107 BmnEventHeader* hDigi;
108 TClonesArray* fGemDigits;
109 TClonesArray* fSiliconDigits;
110 TClonesArray* fGemHits;
111 TClonesArray* fSiliconHits;
112 TClonesArray* fSiliconTracks;
113 TClonesArray* fGlobTracks;
114 TClonesArray* fMcTracks;
115 TClonesArray* fSiliconPoints;
116 TClonesArray* fGemPoints;
117
118 // Containers to be used for analysis
119 map <Int_t, Double_t> fSilGemZ; // <stat, Z-position map>
120 // Maps to store <stat, (xy)-coordinates> for GEM and SILICON (MC--> 0, RECO --> 1)
121 map <Int_t, vector <pair <Double_t, Double_t>>> gems[2];
122 map <Int_t, vector <pair <Double_t, Double_t>>> silicons[2];
123
124 // Histos to be shown
125 TH2F* hXzMC;
126 TH2F* hXzReco;
127 TH2F* hYzMC;
128 TH2F* hYzReco;
129 TH2F** hGemXYProfiles;
130 TH2F** hSiliconXYProfiles;
131 TH2F* hXzRecoFromTracks;
132
133 TH1F* hProtonMomentaEmb;
134 TH1F* hPionMomentaEmb;
135
136 TH1F* hProtonMomentaReco;
137 TH1F* hPionMomentaReco;
138
139 TH1F* hProtonNhitsEmb;
140 TH1F* hPionNhitsEmb;
141
142 TH1F* hProtonNhitsReco;
143 TH1F* hPionNhitsReco;
144
145 TH1F* hProtonNhitsRecoAll;
146 TH1F* hPionNhitsRecoAll;
147
148 TProfile* pEffProton;
149 TProfile* pEffPion;
150
151 Int_t aLaysToShow[2]; // array of strips lays to be shown in histos
152
153 TH2F**** hStripChannel; // Strip vs. Chan for main part of big zone and common ADC [main, common][stat][Right or Left]
154
155 Double_t fSignalWindow[2][2]; // two detectors, two limits
156
157 // Options to be reset by user if necessary
158 Bool_t drawFoundTracks;
159
160private:
161
162 Bool_t wasReconstructed(BmnGlobalTrack*, Double_t fracLostOrWrongConnectedHits, Double_t momResCut);
163 Bool_t wasReconstructed(BmnGlobalTrack*, Double_t momResCut);
164
165 // Int_t DefineSiliconStatByZpoint(Double_t);
166 // Int_t DefineSiliconModuleByStatAndXY(TBox***, Int_t, Double_t, Double_t);
167 void DrawFoundTracks();
168
169 // Int_t GetStripBoundValues(TString, Int_t&, Int_t&);
170
171 // Additional prefix, if necessary, in output file names...
172 TString fPrefix;
173
174 void DrawHistos1(); // Histos taken from DoDrawEventsWithEmbeddedSignals-analysis
175 // void DrawHistos3(); // Histos taken from DoInnerTrackerRecoEfficiency-analysis
176
177
179
180 ClassDef(BmnLambdaEmbeddingQa, 1)
181};
182
183#endif
friend F32vec4 min(const F32vec4 &a, const F32vec4 &b)
Definition P4_F32vec4.h:30
friend F32vec4 max(const F32vec4 &a, const F32vec4 &b)
Definition P4_F32vec4.h:31
void ShowLays(Int_t lay1, Int_t lay2)
void DoDrawFoundTracks(Bool_t flag)
void SetPrefixName(TString name)
void DrawHistos6(TClonesArray *, TClonesArray *)
void SetSignalCuts(TString det, Double_t min, Double_t max)
STL namespace.