CbmRoot
Loading...
Searching...
No Matches
CbmTrdHitRateFastQa.h
Go to the documentation of this file.
1/* Copyright (C) 2013-2018 Institut fuer Kernphysik, Westfaelische Wilhelms-Universitaet Muenster, Muenster
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Cyrano Bergmann [committer] */
4
5#ifndef CBMTRDHITRATEFASTQA_H_
6#define CBMTRDHITRATEFASTQA_H_
7
8#include "CbmTrdDigi.h"
9
10#include "FairTask.h"
11
12#include <fstream>
13#include <list>
14#include <map>
15#include <vector>
16
19class CbmTrdParSetGeo;
21
22class TClonesArray;
23class TCanvas;
24class TFile;
25class TH1F;
26class TH2F;
27
28typedef struct HitRateGeoPara2 {
29 Int_t moduleId;
30 Int_t layerId;
31 Int_t stationId;
32
33 Double_t mPos[3]; // center of module (x,y,z)
34 Double_t mSize[3]; // half size of pad plane in (x,y,z) from digi.par
35
36 Double_t sSize[3][3]; // sector size
37 Double_t pSize[3][3]; // pad size // [sectors][dimensions]
38
39 Int_t nSec; // 3 - number of sectors in module
40 Int_t rot_angle; // 0,1,2,3 - angle between long pad axis and x axis
41
42 Int_t nCol;
43 Int_t nRow;
44 Int_t sCol[3]; // number of cols in sector
45 Int_t sRow[3]; // number of rows in sector
46
47 Double_t vOrigin[3]; // vector of pad 0,0
48 Double_t vX[3]; // differential vector of pad 1,0 to pad 0,0
49 Double_t vY[3]; // differential vector of pad 0,1 to pad 0,0
50 Double_t vN[3]; // normal vector
51
52 Double_t lambda;
53 Double_t cosX;
54 Double_t cosY;
55 Int_t stepDirection[3];
56
58
59class CbmTrdHitRateFastQa : public FairTask {
60
61public:
64
66 CbmTrdHitRateFastQa(const char* name, const char* title = "CBM Task");
67
69 virtual ~CbmTrdHitRateFastQa();
70
72 virtual InitStatus ReInit();
73 virtual InitStatus Init();
74 virtual void SetParContainers();
75
77 virtual void Exec(Option_t* option);
78
80 virtual void FinishEvent();
81
83 virtual void FinishTask() { ; }
84
85 /*
86 void AddHit(TVector3 &posHit, TVector3 &posHitErr,
87 Int_t TrackID, Int_t PlaneID, Int_t ref, Double_t ELoss,
88 Double_t ELossTR, Double_t ELossdEdX);
89 */
90
91 void Register();
92
93private:
94 std::ofstream myfile;
95
99
102
103 void HistoInit(TCanvas*& c1, TCanvas*& c2, TCanvas*& c3, TH2F*& Layer, TH1F*& HitPad, Double_t ZRangeL,
104 Double_t ZRangeU, Double_t mm2bin);
105
106 void ScanModulePlane(const Int_t moduleId, TCanvas*& c1, TCanvas*& c2, TH1F*& HitPad, TH1F*& HitAsic);
107
108 void GetModuleInformationFromDigiPar(HitRateGeoPara2* GeoPara, Bool_t Fast, Bool_t Lines, Int_t VolumeID, TH2F* Layer,
109 TCanvas* c1, TH1F* HitPad, TCanvas* c2, TH2F* Topview[3], TCanvas* c0,
110 Double_t mm2bin);
111
113
114 void Histo(HitRateGeoPara2* GeoPara, Bool_t Fast, TH2F* Layer, TCanvas* c1, TH1F* HitPad, TCanvas* c2,
115 TH2F* Topview[3], TCanvas* c0, Double_t mm2bin);
116
117 Double_t CalcHitRate(HitRateGeoPara2* GeoPara, Double_t StartX, Double_t StopX, Int_t xSteps, Double_t StartY,
118 Double_t StopY, Int_t ySteps, Double_t* Mpos, TH2F* Topview[3], TCanvas* c0);
119
120 Double_t CalcHitRatePad(const Double_t x_min, const Double_t x_max, const Double_t y_min, const Double_t y_max,
121 const Double_t z);
122
123 void DrawBorders(HitRateGeoPara2* GeoPara, TH2F* Layer, TCanvas* c1);
124
125 void DrawPads(HitRateGeoPara2* GeoPara, TH2F* Layer, TCanvas* c1);
126
127 void DrawDigi();
128
129
131
132 TFile* tFile;
133
134 Bool_t fDraw;
135
136 Int_t fPlane; // DE
137 Int_t fStation;
138 Int_t fLayer;
139
141 fCol_out; //Calculated pixel column were the hit is in
142 Int_t fRow_mean, fRow_in, fRow_out; //Calculated pixel row were the hit is in
143 Int_t fModuleID; //Unique number for detector module
144 Int_t fMCindex; // index to MCPoint
145 // --------------->[cm]<---------------
146 Double_t local_meanLL[3];
147 Double_t local_meanC[3];
148 Double_t global_meanLL[3]; //[cm]
149 Double_t global_meanC[3];
150 Double_t local_inLL[3];
151 Double_t local_inC[3];
152 Double_t global_inLL[3]; //[cm]
153 Double_t global_inC[3];
154
155 Double_t local_outLL[3];
156 Double_t local_outC[3];
157 Double_t global_outLL[3]; //[cm]
158 Double_t global_outC[3];
159 // --------------->[mm]<---------------
160
162 Int_t fSector;
163 //Int_t tempNosectors = (fModuleInfo->GetNoSectors);
164 static const Int_t accuracy = 1; // '1/accuracy' integration step width [mm]
165 static const Int_t fPadNrX = 7; //7; // has to be odd
166 static const Int_t fPadNrY = 5; //5; // has to be odd
167
168 /*
169 static const Bool_t Histo = true;
170 //static const Bool_t Histo = false;
171 static const Bool_t TEST = true;
172 //static const Bool_t TEST = false;
173 //static const Bool_t Sector = true;
174 static const Bool_t Sector = false;
175 */
176
177 Double_t padsize[3];
178 Double_t modulesize[3];
179
180 Float_t fELoss; //energy loss from MCPoint
181 Float_t fELossdEdX;
182 Float_t fELossTR;
183 Float_t fPosXLL,
184 fPosYLL; //Hit position in chamber coordinates origin 'L'ower 'L'eft corner
185
186 Float_t fPadPosxLL,
187 fPadPosyLL; //Hit position in pad coordinates (not rotated) origin 'L'ower 'L'eft corner
188 Float_t fPadPosxC,
189 fPadPosyC; //Hit position in pad coordinates (not rotated) origin pad 'C'enter
190 Float_t fDeltax, fDeltay;
191
192
193 Float_t fPadCharge[fPadNrY][fPadNrX]; //Charge on 3 adjacent pads calculated by using the Mathieson formula
194
196
197 Float_t fEfficiency; // Digi production efficiency (0-100%)
198 // Double_t fthreshold; //pixel threshold in electrons
199 // Double_t fnoise; //pixel noise in electrons
200
201 TClonesArray* fTrdPoints;
202 TClonesArray* fDigiCollection;
203 TClonesArray* fDigiMatchCollection;
204 TClonesArray* fMCStacks;
205
209
211
212 std::vector<Int_t> fColors;
213 std::vector<Double_t> fZLevel;
214 Double_t fBitPerHit;
216 // map<pair<ModuleID,pair<x,y>>, CbmTrdDigi*>
217 std::map<std::pair<Int_t, std::pair<Int_t, Int_t>>, CbmTrdDigi*> fDigiMap;
219 std::map<std::pair<Int_t, std::pair<Int_t, Int_t>>, CbmTrdDigi*>::iterator fDigiMapIt;
220
223
224 ClassDef(CbmTrdHitRateFastQa, 2)
225};
226
227#endif // CBMTRDHITRATEFASTQA_H
struct HitRateGeoPara2 HitRateGeoPara2
Double_t CalcHitRate(HitRateGeoPara2 *GeoPara, Double_t StartX, Double_t StopX, Int_t xSteps, Double_t StartY, Double_t StopY, Int_t ySteps, Double_t *Mpos, TH2F *Topview[3], TCanvas *c0)
CbmTrdParSetAsic * fAsicPar
MC Track information.
virtual InitStatus Init()
TClonesArray * fMCStacks
Corresponding MCPoints to TRD digis.
Double_t CalcHitRatePad(const Double_t x_min, const Double_t x_max, const Double_t y_min, const Double_t y_max, const Double_t z)
CbmTrdHitRateFastQa & operator=(const CbmTrdHitRateFastQa &)
std::vector< Int_t > fColors
CbmTrdParSetDigi * fDigiPar
void GetModuleInformationFromDigiPar(HitRateGeoPara2 *GeoPara, Bool_t Fast, Bool_t Lines, Int_t VolumeID, TH2F *Layer, TCanvas *c1, TH1F *HitPad, TCanvas *c2, TH2F *Topview[3], TCanvas *c0, Double_t mm2bin)
void ScanModulePlane(const Int_t moduleId, TCanvas *&c1, TCanvas *&c2, TH1F *&HitPad, TH1F *&HitAsic)
void HistoInit(TCanvas *&c1, TCanvas *&c2, TCanvas *&c3, TH2F *&Layer, TH1F *&HitPad, Double_t ZRangeL, Double_t ZRangeU, Double_t mm2bin)
CbmTrdHitRateFastQa(const CbmTrdHitRateFastQa &)
iterator over array above
std::map< std::pair< Int_t, std::pair< Int_t, Int_t > >, CbmTrdDigi * >::iterator fDigiMapIt
void Histo(HitRateGeoPara2 *GeoPara, Bool_t Fast, TH2F *Layer, TCanvas *c1, TH1F *HitPad, TCanvas *c2, TH2F *Topview[3], TCanvas *c0, Double_t mm2bin)
virtual InitStatus ReInit()
Float_t fPadCharge[fPadNrY][fPadNrX]
TClonesArray * fDigiCollection
Trd MC points.
CbmTrdParSetGeo * fGeoPar
static const Int_t accuracy
CbmTrdGeoHandler * fGeoHandler
static const Int_t fPadNrY
static const Int_t fPadNrX
std::map< std::pair< Int_t, std::pair< Int_t, Int_t > >, CbmTrdDigi * > fDigiMap
TClonesArray * fDigiMatchCollection
TRD digis.
void DrawBorders(HitRateGeoPara2 *GeoPara, TH2F *Layer, TCanvas *c1)
void DrawPads(HitRateGeoPara2 *GeoPara, TH2F *Layer, TCanvas *c1)
virtual void Exec(Option_t *option)
std::vector< Double_t > fZLevel
Describe TRD module ASIC settings (electronic gain, delays, etc)
Double_t pSize[3][3]
Double_t sSize[3][3]