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