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