CbmRoot
Loading...
Searching...
No Matches
CbmMvdClusterAna.cxx
Go to the documentation of this file.
1/* Copyright (C) 2015-2019 Institut fuer Kernphysik, Goethe-Universitaet Frankfurt, Frankfurt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Samir Amar-Youcef [committer] */
4
5// -------------------------------------------------------------------------
6// ----- CbmMvdClusterAna source file -----
7// ----- Created 27/04/15 by S. Amar-Youcef -----
8// ------------------------------------------------------------------------
9
10//-- Include from Cbm --//
11#include "CbmMvdClusterAna.h"
12// #include "CbmStsTrack.h"
13#include "CbmMvdCluster.h"
14#include "CbmMvdDigi.h"
15#include "CbmMvdDigiMatch.h"
16#include "CbmMvdHit.h"
17#include "CbmMvdHitMatch.h"
18#include "CbmMvdPoint.h"
19
20// #include "CbmVertex.h"
21#include "CbmLink.h"
22#include "CbmMCTrack.h"
23#include "CbmMatch.h"
24#include "CbmTrackMatchNew.h"
25
26// #include "base/CbmLitToolFactory.h"
27// #include "data/CbmLitTrackParam.h"
28// #include "utils/CbmLitConverter.h"
29
30
31//-- Include from Fair --//
32#include "FairTrackParam.h"
33#include <Logger.h>
34
35
36//-- Include from Root --//
37#include "TCanvas.h"
38#include "TF1.h"
39#include "TGeoBBox.h"
40#include "TGeoManager.h"
41#include "TH1.h"
42#include "TH2.h"
43#include "TLegend.h"
44#include "TMath.h"
45#include "TProfile.h"
46#include "TROOT.h"
47
48//-- Include from C++ --//
49#include <iomanip>
50
51using std::flush;
52
53// ----- Default constructor -------------------------------------------
55 : FairTask("MvdClusterAna")
56 , fMcPoints(nullptr)
57 , fMvdDigis(nullptr)
58 , fMvdClusters(nullptr)
59 , fMvdHits(nullptr)
60 , fMvdDigisMatch(nullptr)
61 , fMvdClustersMatch(nullptr)
62 , fMvdHitsMatch(nullptr)
63 , fListMCTracks(nullptr)
64 , fStsTrackArray(nullptr)
65 , fStsTrackMatches(nullptr)
66 , fMvdHisto1()
67 , fMvdHisto2()
68 , fProf()
69 , fNrMcPointsAll(-1)
70 , fNrHitsAll(-1)
71 , fMcperDigi()
72 , fMcperHit()
73 , fPixelpitch()
74{
75 ;
76}
77// -------------------------------------------------------------------------
78
79
80// ----- Standard constructor ------------------------------------------
81CbmMvdClusterAna::CbmMvdClusterAna(const char* name, Int_t iVerbose)
82 : FairTask(name, iVerbose)
83 , fMcPoints(nullptr)
84 , fMvdDigis(nullptr)
85 , fMvdClusters(nullptr)
86 , fMvdHits(nullptr)
87 , fMvdDigisMatch(nullptr)
88 , fMvdClustersMatch(nullptr)
89 , fMvdHitsMatch(nullptr)
90 , fListMCTracks(nullptr)
91 , fStsTrackArray(nullptr)
92 , fStsTrackMatches(nullptr)
93 , fMvdHisto1()
94 , fMvdHisto2()
95 , fProf()
96 , fNrMcPointsAll(-1)
97 , fNrHitsAll(-1)
98 , fMcperDigi()
99 , fMcperHit()
100 , fPixelpitch()
101{
102 ;
103}
104// -------------------------------------------------------------------------
105
106
107// ----- Destructor ----------------------------------------------------
109// -------------------------------------------------------------------------
110
111
112// -------------------------------------------------------------------------
114{
115 LOG(info) << GetName() << "::Init: Start Initilisation ";
116
117 FairRootManager* ioman = FairRootManager::Instance();
118 if (!ioman) {
119 LOG(error) << GetName() << "::Init: RootManager not instantised!";
120 return kFATAL;
121 }
122
123 gGeoManager = (TGeoManager*) gROOT->FindObject("FAIRGeom");
124
125 fMcPoints = (TClonesArray*) ioman->GetObject("MvdPoint");
126 fMvdDigis = (TClonesArray*) ioman->GetObject("MvdDigi");
127 fMvdClusters = (TClonesArray*) ioman->GetObject("MvdCluster");
128 fMvdHits = (TClonesArray*) ioman->GetObject("MvdHit");
129
130 fMvdDigisMatch = (TClonesArray*) ioman->GetObject("MvdDigiMatch");
131 fMvdClustersMatch = (TClonesArray*) ioman->GetObject("MvdClusterMatch");
132 fMvdHitsMatch = (TClonesArray*) ioman->GetObject("MvdHitMatch");
133
134 fListMCTracks = (TClonesArray*) ioman->GetObject("MCTrack");
135 // fStsTrackArray = (TClonesArray*) ioman->GetObject("StsTrack");
136 // fStsTrackMatches = (TClonesArray*) ioman->GetObject("StsTrackMatch");
137
138 // fPrimVtx = (CbmVertex*) ioman->GetObject("PrimaryVertex");
139 /*
140 // Get pointer to PrimaryVertex object from IOManager if it exists
141 // The old name for the object is "PrimaryVertex" the new one
142 // "PrimaryVertex." Check first for the new name
143 fPrimVtx = dynamic_cast<CbmVertex*>(ioman->GetObject("PrimaryVertex."));
144 if (nullptr == fPrimVtx) {
145 fPrimVtx = dynamic_cast<CbmVertex*>(ioman->GetObject("PrimaryVertex"));
146 }
147 if (nullptr == fPrimVtx) {
148 LOG(fatal) << "No PrimaryVertex array!";
149 }
150*/
151 // fListMCTracks = (TClonesArray*) ioman->GetObject("MCTrack");
152 // fExtrapolator = CbmLitToolFactory::Instance()->CreateTrackExtrapolator("rk4");
153
154
155 fMvdHisto1[0] = new TH1F("Momentum", "Momentum", 100, 0, 30);
156 fMvdHisto1[1] = new TH1F("Angle", "Angle", 200, 0, 2);
157 fMvdHisto1[2] = new TH1F("DigisPerHit", "DigisPerHit", 100, 0, 100);
158 fMvdHisto1[3] = new TH1F("xResidual", "xResidual", 500, -50, 50);
159 fMvdHisto1[4] = new TH1F("yResidual", "yResidual", 500, -50, 50);
160 fMvdHisto1[5] = new TH1F("zResidual", "zResidual", 2000, -20, 20);
161 fMvdHisto1[6] = new TH1F("DistancePixX", "DistancePixX", 100, -2, 2);
162 fMvdHisto1[7] = new TH1F("DistancePixY", "DistancePixY", 100, -2, 2);
163 fMvdHisto1[8] = new TH1F("ClusterShape", "ClusterShape", 10, 0, 10);
164 fMvdHisto1[9] = new TH1F("ChargeSpectrum", "ChargeSpectrum", 50000, 0, 10000);
165 fMvdHisto1[10] = new TH1F("res_x_shape_0", "res_x_shape_0", 500, -50, 50);
166 fMvdHisto1[11] = new TH1F("res_x_shape_1", "res_x_shape_1", 500, -50, 50);
167 fMvdHisto1[12] = new TH1F("res_x_shape_2", "res_x_shape_2", 500, -50, 50);
168 fMvdHisto1[13] = new TH1F("res_x_shape_3", "res_x_shape_3", 500, -50, 50);
169 fMvdHisto1[14] = new TH1F("res_x_shape_4", "res_x_shape_4", 500, -50, 50);
170 fMvdHisto1[15] = new TH1F("res_x_shape_5", "res_x_shape_5", 500, -50, 50);
171 fMvdHisto1[16] = new TH1F("res_x_shape_6", "res_x_shape_6", 500, -50, 50);
172 fMvdHisto1[17] = new TH1F("res_x_shape_7", "res_x_shape_7", 500, -50, 50);
173 fMvdHisto1[18] = new TH1F("res_x_shape_8", "res_x_shape_8", 500, -50, 50);
174 fMvdHisto1[19] = new TH1F("res_x_shape_9", "res_x_shape_9", 500, -50, 50);
175 fMvdHisto1[20] = new TH1F("res_y_shape_0", "res_y_shape_0", 500, -50, 50);
176 fMvdHisto1[21] = new TH1F("res_y_shape_1", "res_y_shape_1", 500, -50, 50);
177 fMvdHisto1[22] = new TH1F("res_y_shape_2", "res_y_shape_2", 500, -50, 50);
178 fMvdHisto1[23] = new TH1F("res_y_shape_3", "res_y_shape_3", 500, -50, 50);
179 fMvdHisto1[24] = new TH1F("res_y_shape_4", "res_y_shape_4", 500, -50, 50);
180 fMvdHisto1[25] = new TH1F("res_y_shape_5", "res_y_shape_5", 500, -50, 50);
181 fMvdHisto1[26] = new TH1F("res_y_shape_6", "res_y_shape_6", 500, -50, 50);
182 fMvdHisto1[27] = new TH1F("res_y_shape_7", "res_y_shape_7", 500, -50, 50);
183 fMvdHisto1[28] = new TH1F("res_y_shape_8", "res_y_shape_8", 500, -50, 50);
184 fMvdHisto1[29] = new TH1F("res_y_shape_9", "res_y_shape_9", 500, -50, 50);
185 fMvdHisto1[30] = new TH1F("DigisPerMC", "DigisPerMC", 100, 0, 100);
186 fMvdHisto1[31] = new TH1F("HitsPerMC", "HitsPerMC", 11, 0, 11);
187 fMvdHisto1[32] = new TH1F("McPerHit (merged)", "McPerHit (merged)", 11, 0, 11);
188 fMvdHisto1[33] = new TH1F("xPull", "xPull", 500, -50, 50);
189 fMvdHisto1[34] = new TH1F("yPull", "yPull", 500, -50, 50);
190 fMvdHisto1[35] = new TH1F("McPerDigi", "McPerDigi", 6, 0, 6);
191 fMvdHisto1[36] = new TH1F("McPerHit", "McPerHit", 11, 0, 11);
192
193 fMvdHisto2[0] = new TH2F("dxpdyp", "dxpdyp", 100, -1, 1, 100, -1, 1);
194 fMvdHisto2[1] = new TH2F("dpnorm", "dpnorm", 100, -1, 1, 100, -1, 1);
195 fMvdHisto2[2] = new TH2F("mom_dx", "mom_dx", 100, 0, 30, 100, -50, 50);
196 fMvdHisto2[3] = new TH2F("mom_dy", "mom_dy", 100, 0, 30, 100, -50, 50);
197 fMvdHisto2[4] = new TH2F("ang_dx", "ang_dx", 100, 0, 2, 100, -50, 50);
198 fMvdHisto2[5] = new TH2F("ang_dy", "ang_dy", 100, 0, 2, 100, -50, 50);
199 fMvdHisto2[6] = new TH2F("dnr_dx", "dnr_dx", 100, 0, 100, 100, -50, 50);
200 fMvdHisto2[7] = new TH2F("dnr_dy", "dnr_dy", 100, 0, 100, 100, -50, 50);
201 fMvdHisto2[8] = new TH2F("dxp_dx", "dxp_dx", 50, 0, 1, 100, -50, 50);
202 fMvdHisto2[9] = new TH2F("dxp_dy", "dxp_dy", 50, 0, 1, 100, -50, 50);
203 fMvdHisto2[10] = new TH2F("cha_dx", "cha_dx", 100, 0, 10000, 100, -50, 50);
204 fMvdHisto2[11] = new TH2F("cha_dy", "cha_dy", 100, 0, 10000, 100, -50, 50);
205
206 fMvdHisto2[12] = new TH2F("mom_dz", "mom_dz", 100, 0, 30, 2000, -20, 20);
207 fMvdHisto2[13] = new TH2F("ang_dz", "ang_dz", 200, 0, 2, 2000, -20, 20);
208 fMvdHisto2[14] = new TH2F("dx_dy", "dx_dy", 100, -50, 50, 100, -50, 50);
209
210 fMvdHisto2[15] = new TH2F("mom_cha", "mom_cha", 100, 0, 3, 1000, 0, 10000);
211 fMvdHisto2[16] = new TH2F("ang_cha", "ang_cha", 200, 0, 2, 1000, 0, 10000);
212 fMvdHisto2[17] = new TH2F("mom_chacut", "mom_chacut", 100, 0, 3, 1000, 0, 10000);
213 LOG(info) << GetName() << "::Init: Finished Initilisation ";
214
215 fNrMcPointsAll = 0;
216 fNrHitsAll = 0;
217
218 for (Int_t i = 0; i < 6; i++) {
219 fMcperDigi[i] = 0;
220 }
221 for (Int_t i = 0; i < 11; i++) {
222 fMcperHit[i] = 0;
223 }
224
225 return kSUCCESS;
226}
227// -------------------------------------------------------------------------
228
229
230// -------------------------------------------------------------------------
231void CbmMvdClusterAna::Exec(Option_t* /*opt*/)
232{
233 Int_t nMcpoints = fMcPoints->GetEntriesFast(); // Number of Monte Carlo Points
234 Int_t nDigis = fMvdDigis->GetEntriesFast(); // Number of Mvd Digis
235 // Int_t nClusters = fMvdClusters->GetEntriesFast(); // Number of reconstructed Mvd Clusters
236 Int_t nHits = fMvdHits->GetEntriesFast(); // Number of reconstructed Mvd Hits
237
238 // Int_t nDigisMatch = fMvdDigisMatch ->GetEntriesFast(); // Number of Matches from Digis to Monte Carlo
239 // Int_t nClustersMatch = fMvdClustersMatch ->GetEntriesFast(); // Number of Matches from Reconstructed Mvd Clusters to Mvd Hits (?)
240 // Int_t nHitsMatch = fMvdHitsMatch ->GetEntriesFast(); // Number of Matches from Reconstructed Mvd Hits to Monte Carlo
241
242 // Int_t nMcTracks = fListMCTracks ->GetEntriesFast();
243 // Int_t nTracks = fStsTrackArray ->GetEntriesFast(); // Number of Tracks
244
245 // LOG(debug)<<"MC Points : "<< nMcpoints;
246 // LOG(debug)<<"Hits : "<< nHits;
247 // LOG(debug)<<"HitMatchs : "<< nHitsMatch;
248 // LOG(debug)<<"Clusters : "<< nClusters;
249 // LOG(debug)<<"ClusterMatch : "<< nClustersMatch;
250 // LOG(debug)<<"Digis : "<< nDigis;
251 // LOG(debug)<<"DigiMatchs : "<< nDigisMatch;
252 // LOG(debug)<<"MC Tracks : "<< nMcTracks;
253 // LOG(debug)<<"Tracks : "<< nTracks;
254 // LOG(debug)<<"------";
255 // -------------------
256 CbmMvdPoint* mvdPoint; // Monte Carlo Point
257 CbmMvdDigi* mvdDigi; // Digi
258 CbmMvdCluster* mvdCluster;
259 CbmMvdHit* mvdHit; // Digitized Hit
260
261 CbmMvdDigiMatch* mvdDigiMatch; // Digi to MC point
262 CbmMatch* mvdClusterMatch; // Cluster to (?)
263 CbmMvdHitMatch* mvdHitMatch; // Hit to MC point
264
265 CbmMCTrack* mcTrack;
266 // CbmStsTrack * stsTrack;
267 // CbmTrackMatchNew* trackMatch;
268 // CbmMatch * mvdMatch; // Reco Track to Hit Match
269 // -------------------
270 typedef map<pair<Int_t, Int_t>, Int_t>::iterator it_type;
271 map<pair<Int_t, Int_t>, Int_t> digiMap;
272 pair<Int_t, Int_t> digiCoor;
273 Int_t digiCharge;
274
275 TVector3 cOrth;
276 TVector3 cVect;
277
278 Int_t* digiList;
279 Double_t gloMC[3];
280 Double_t locMC[3];
281 Double_t gloHit[3];
282 Double_t locHit[3];
283 Double_t locRef[3];
284
285 Double_t pitchx, pitchy;
286
287 Int_t MAXHITS = nHits;
288 Int_t count;
289 Int_t charge;
290 UInt_t shape;
291 // bool correctshape;
292 Double_t ARR_momentum[MAXHITS];
293 Double_t ARR_angle[MAXHITS];
294 Int_t ARR_digis[MAXHITS];
295 Double_t ARR_dx[MAXHITS];
296 Double_t ARR_dy[MAXHITS];
297 Double_t ARR_dz[MAXHITS];
298 Double_t ARR_dxp[MAXHITS];
299 Double_t ARR_dyp[MAXHITS];
300 UInt_t ARR_shape[MAXHITS];
301 Int_t ARR_charge[MAXHITS];
302 Int_t XAXIS[1000];
303 Int_t YAXIS[1000];
304 Int_t xaxis, yaxis, xaxismin, xaxismax, yaxismin, yaxismax, xrel, yrel;
305 Int_t POS;
306 // -------------------
307 fNrMcPointsAll += nMcpoints;
308 fNrHitsAll += nHits;
309 // -------------------
310 mvdDigi = (CbmMvdDigi*) fMvdDigis->At(0);
311 pitchx = mvdDigi->GetPixelSizeX();
312 pitchy = mvdDigi->GetPixelSizeY();
313 fPixelpitch[0] = pitchx;
314 fPixelpitch[1] = pitchy;
315
316 TGeoVolume* CurrentVolume;
317 TGeoBBox* VolumeShape;
318 // -------------------
319 std::map<std::pair<std::pair<Int_t, Int_t>, TString>, std::vector<int>> DigisMap;
320 std::map<std::pair<std::pair<Int_t, Int_t>, TString>, std::vector<int>>::iterator it;
321 std::pair<std::pair<Int_t, Int_t>, TString> DigiStation;
322 std::pair<Int_t, Int_t> Digi;
323 std::vector<int> McContrToHitList;
324 std::vector<int> McContrList; // vector of Mc Points which contribute to a Digi
325 std::map<Int_t, Int_t> McInHit;
326 std::map<Int_t, Int_t>::iterator it2;
327 std::vector<int> DigisInMc(nMcpoints, 0);
328 std::map<Int_t, std::vector<int>> McsInHit;
329 std::map<Int_t, std::vector<int>> HitsInMc;
330 std::map<Int_t, std::vector<int>>::iterator it3;
331
332 DigisMap.clear();
333 McInHit.clear();
334 McsInHit.clear();
335 HitsInMc.clear();
336
337 // -------------------
338 // Analyze Digis:
339
340 for (int iDigi = 0; iDigi < nDigis; iDigi++) {
341
342 mvdDigi = (CbmMvdDigi*) fMvdDigis->At(iDigi);
343 mvdDigiMatch = (CbmMvdDigiMatch*) fMvdDigisMatch->At(iDigi);
344
345 Int_t nMatchedIndex = mvdDigiMatch->GetMatchedLink().GetIndex();
346 mvdPoint = (CbmMvdPoint*) fMcPoints->At(nMatchedIndex); // Get matched MC Point from Digi
347
348 // mcTrack = (CbmMCTrack*) fListMCTracks->At ( mvdpoint->GetTrackID() ); // Get matched MC Track from MC Point
349
350 gloMC[0] = (mvdPoint->GetXOut() + mvdPoint->GetX()) / 2.;
351 gloMC[1] = (mvdPoint->GetYOut() + mvdPoint->GetY()) / 2.;
352 gloMC[2] = (mvdPoint->GetZOut() + mvdPoint->GetZ()) / 2.;
353
354 gGeoManager->FindNode(gloMC[0], gloMC[1], gloMC[2]);
355
356 CurrentVolume = gGeoManager->GetCurrentVolume();
357 // VolumeShape = (TGeoBBox*)CurrentVolume->GetShape();
358
359 Digi.first = mvdDigi->GetPixelX();
360 Digi.second = mvdDigi->GetPixelY();
361
362 DigiStation.first = Digi;
363 DigiStation.second = CurrentVolume->GetName();
364
365 McContrList.clear();
366
367 for (Int_t iLink = 0; iLink < mvdDigiMatch->GetNofLinks(); iLink++) {
368 McContrList.push_back(mvdDigiMatch->GetLink(iLink).GetIndex());
369 }
370
371 // it = DigisMap.find(DigiStation);
372 // if (it == DigisMap.end())
373 // {
374 DigisMap[DigiStation] = McContrList;
375 // }
376 // else // Should not be possible
377 // {
378 // }
379 }
380
381 // -------------------
382 // Analyze Hits and Clusters
383
384 for (Int_t iHit = 0; iHit < nHits; iHit++) {
385 LOG(info) << "run next Hit " << iHit << " of " << nHits << " Hits";
386 mvdHit = (CbmMvdHit*) fMvdHits->At(iHit);
387 mvdCluster = (CbmMvdCluster*) fMvdClusters->At(iHit);
388 mvdHitMatch = (CbmMvdHitMatch*) fMvdHitsMatch->At(iHit);
389 mvdClusterMatch = (CbmMatch*) fMvdClustersMatch->At(iHit);
390
391 Int_t nHitMatch = mvdHitMatch->GetMatchedLink().GetIndex();
392 mvdPoint = (CbmMvdPoint*) fMcPoints->At(nHitMatch);
393
394 mcTrack = (CbmMCTrack*) fListMCTracks->At(mvdPoint->GetTrackID());
395
396 gloMC[0] = (mvdPoint->GetXOut() + mvdPoint->GetX()) / 2.;
397 gloMC[1] = (mvdPoint->GetYOut() + mvdPoint->GetY()) / 2.;
398 gloMC[2] = (mvdPoint->GetZOut() + mvdPoint->GetZ()) / 2.;
399
400 gloHit[0] = mvdHit->GetX();
401 gloHit[1] = mvdHit->GetY();
402 gloHit[2] = mvdHit->GetZ();
403
404 gGeoManager->FindNode(gloMC[0], gloMC[1], gloMC[2]);
405 gGeoManager->MasterToLocal(gloMC, locMC);
406 gGeoManager->MasterToLocal(gloHit, locHit);
407
408 CurrentVolume = gGeoManager->GetCurrentVolume();
409 VolumeShape = (TGeoBBox*) CurrentVolume->GetShape();
410
411 locRef[0] = (mvdHit->GetIndexCentralX() + 0.5) * pitchx - VolumeShape->GetDX();
412 locRef[1] = (mvdHit->GetIndexCentralY() + 0.5) * pitchy - VolumeShape->GetDY();
413 locRef[2] = 0;
414
415 cOrth.SetXYZ(0., 0., mvdPoint->GetZOut() - mvdPoint->GetZ());
416 cVect.SetXYZ(mvdPoint->GetXOut() - mvdPoint->GetX(), mvdPoint->GetYOut() - mvdPoint->GetY(),
417 mvdPoint->GetZOut() - mvdPoint->GetZ());
418
419 digiMap = mvdCluster->GetPixelMap();
420 digiList = mvdCluster->GetDigiList();
421
422 count = 0;
423 charge = 0;
424 shape = 0;
425
426 McInHit.clear();
427 McContrToHitList.clear();
428 for (it_type iterator = digiMap.begin(); iterator != digiMap.end(); iterator++) {
429 digiCoor = iterator->first;
430 digiCharge = iterator->second;
431 xaxis = digiCoor.first;
432 yaxis = digiCoor.second;
433
434 XAXIS[count] = xaxis;
435 YAXIS[count] = yaxis;
436
437 if (count == 0) {
438 xaxismin = xaxis;
439 xaxismax = xaxis;
440 yaxismin = yaxis;
441 yaxismax = yaxis;
442 }
443 else {
444 if (xaxismin > xaxis) { xaxismin = xaxis; }
445 if (xaxismax < xaxis) { xaxismax = xaxis; }
446 if (yaxismin > yaxis) { yaxismin = yaxis; }
447 if (yaxismax < yaxis) { yaxismax = yaxis; }
448 }
449
450 charge += digiCharge;
451 count++;
452
453 DigiStation.first = digiCoor;
454 DigiStation.second = CurrentVolume->GetName();
455
456 it = DigisMap.find(DigiStation);
457
458 McContrList = it->second; // Mcs contributing to a Digi
459
460 // if (it != DigisMap.end())
461 // {
462 fMcperDigi[McContrList.size()]++; // Number of MC Points contributing to a Digi
463 for (Int_t iMc = 0; iMc < McContrList.size(); iMc++) {
464 if (std::find(McContrToHitList.begin(), McContrToHitList.end(), McContrList[iMc]) == McContrToHitList.end()) {
465 McContrToHitList.push_back(McContrList[iMc]);
466 }
467
468 it2 = McInHit.find(McContrList[iMc]);
469
470 if (it2 != McInHit.end()) { McInHit[McContrList[iMc]]++; }
471 else {
472 McInHit[McContrList[iMc]] = 1;
473 }
474 }
475 // }
476 // else // should not be possible
477 // {
478 // }
479 }
480
481 McsInHit[iHit] = McContrToHitList;
482
483 if (McInHit.size() < 11) { fMcperHit[McInHit.size()]++; }
484 else {
485 fMcperHit[10]++;
486 }
487 count = 0;
488 for (std::map<Int_t, Int_t>::iterator iterator = McInHit.begin(); iterator != McInHit.end(); iterator++) {
489 DigisInMc[iterator->first] += iterator->second;
490 count++;
491
492 it3 = HitsInMc.find(iterator->first);
493
494 if (it3 != HitsInMc.end()) {
495 McContrList = it3->second;
496 McContrList.push_back(iHit);
497 }
498 else {
499 McContrList.clear();
500 McContrList.push_back(iHit);
501 }
502
503 HitsInMc[iterator->first] = McContrList;
504 }
505 if ((xaxismax - xaxismin) < 4 && (yaxismax - yaxismin) < 4) {
506 shape = 0;
507
508 for (int i = 0; i < mvdCluster->GetNofDigis(); i++) {
509 xrel = XAXIS[i] - xaxismin;
510 yrel = YAXIS[i] - yaxismin;
511 POS = xrel + 5 * yrel;
512 shape += TMath::Power(2, POS);
513 }
514
515 if (shape == 3) { shape = 0; }
516 else if (shape == 99) {
517 shape = 1;
518 }
519 else if (shape == 33) {
520 shape = 2;
521 }
522 else if (shape == 7) {
523 shape = 3;
524 }
525 else if (shape == 67) {
526 shape = 4;
527 }
528 else if (shape == 97) {
529 shape = 5;
530 }
531 else if (shape == 35) {
532 shape = 6;
533 }
534 else if (shape == 98) {
535 shape = 7;
536 }
537 else if (shape == 1) {
538 shape = 8;
539 }
540 else {
541 shape = 9;
542 }
543 }
544 else {
545 shape = 9;
546 }
547 ARR_momentum[iHit] = mcTrack->GetP();
548 ARR_angle[iHit] = cVect.Angle(cOrth);
549 ARR_digis[iHit] = mvdCluster->GetNofDigis();
550 ARR_dx[iHit] = 10000 * (locHit[0] - locMC[0]);
551 ARR_dy[iHit] = 10000 * (locHit[1] - locMC[1]);
552 ARR_dz[iHit] = 10000 * (gloHit[2] - gloMC[2]);
553 ARR_dxp[iHit] = -(int) (((locMC[0] + VolumeShape->GetDX()) / (1 * pitchx)) - 0.5)
554 + (double) (((locMC[0] + VolumeShape->GetDX()) / (1 * pitchx)) - 0.5);
555 ARR_dyp[iHit] = -(int) (((locMC[1] + VolumeShape->GetDY()) / (1 * pitchy)) - 0.5)
556 + (double) (((locMC[1] + VolumeShape->GetDY()) / (1 * pitchy)) - 0.5);
557 ARR_shape[iHit] = shape;
558 ARR_charge[iHit] = charge;
559 }
560
561 // -------------------
562 for (Int_t iHit = 0; iHit < nHits; iHit++) {
563 LOG(debug) << "fill stuff";
564 fMvdHisto1[0]->Fill(ARR_momentum[iHit]);
565 fMvdHisto1[1]->Fill(ARR_angle[iHit]);
566 fMvdHisto1[2]->Fill(ARR_digis[iHit]);
567 fMvdHisto1[3]->Fill(ARR_dx[iHit]);
568 fMvdHisto1[4]->Fill(ARR_dy[iHit]);
569 fMvdHisto1[5]->Fill(ARR_dz[iHit]);
570 fMvdHisto1[6]->Fill(ARR_dxp[iHit]);
571 fMvdHisto1[7]->Fill(ARR_dyp[iHit]);
572 fMvdHisto1[8]->Fill(ARR_shape[iHit]);
573 fMvdHisto1[9]->Fill(ARR_charge[iHit]);
574 // fMvdHisto1[10+ARR_shape[iHit]]->Fill(ARR_dx[iHit]);
575 // fMvdHisto1[20+ARR_shape[iHit]]->Fill(ARR_dy[iHit]);
576
577 fMvdHisto2[0]->Fill(ARR_dxp[iHit], ARR_dyp[iHit], ARR_digis[iHit]);
578 fMvdHisto2[0]->Fill(ARR_dxp[iHit], -ARR_dyp[iHit], ARR_digis[iHit]);
579 fMvdHisto2[0]->Fill(-ARR_dxp[iHit], ARR_dyp[iHit], ARR_digis[iHit]);
580 fMvdHisto2[0]->Fill(-ARR_dxp[iHit], -ARR_dyp[iHit], ARR_digis[iHit]);
581 fMvdHisto2[1]->Fill(ARR_dxp[iHit], ARR_dyp[iHit]);
582 fMvdHisto2[1]->Fill(ARR_dxp[iHit], -ARR_dyp[iHit]);
583 fMvdHisto2[1]->Fill(-ARR_dxp[iHit], ARR_dyp[iHit]);
584 fMvdHisto2[1]->Fill(-ARR_dxp[iHit], -ARR_dyp[iHit]);
585 fMvdHisto2[2]->Fill(ARR_momentum[iHit], ARR_dx[iHit]);
586 fMvdHisto2[3]->Fill(ARR_momentum[iHit], ARR_dy[iHit]);
587 fMvdHisto2[4]->Fill(ARR_angle[iHit], ARR_dx[iHit]);
588 fMvdHisto2[5]->Fill(ARR_angle[iHit], ARR_dy[iHit]);
589 fMvdHisto2[6]->Fill(ARR_digis[iHit], ARR_dx[iHit]);
590 fMvdHisto2[7]->Fill(ARR_digis[iHit], ARR_dy[iHit]);
591 // fMvdHisto2[8]->Fill(ARR_dxp[iHit], ARR_dx[iHit]);
592 // fMvdHisto2[9]->Fill(ARR_dyp[iHit], ARR_dy[iHit]);
593 fMvdHisto2[10]->Fill(ARR_charge[iHit], ARR_dx[iHit]);
594 fMvdHisto2[11]->Fill(ARR_charge[iHit], ARR_dy[iHit]);
595 fMvdHisto2[12]->Fill(ARR_momentum[iHit], ARR_dz[iHit]);
596 fMvdHisto2[13]->Fill(ARR_angle[iHit], ARR_dz[iHit]);
597 fMvdHisto2[14]->Fill(ARR_dx[iHit], ARR_dy[iHit]);
598
599 fMvdHisto1[33]->Fill(ARR_dx[iHit] / 3.8);
600 fMvdHisto1[34]->Fill(ARR_dy[iHit] / 4.8);
601
602 fMvdHisto2[15]->Fill(ARR_momentum[iHit], ARR_charge[iHit]);
603 fMvdHisto2[16]->Fill(ARR_angle[iHit], ARR_charge[iHit]);
604
605 if (ARR_angle[iHit] < 0.3) { fMvdHisto2[17]->Fill(ARR_momentum[iHit], ARR_charge[iHit]); }
606 }
607
608 for (int iMc = 0; iMc < nMcpoints; iMc++) {
609 fMvdHisto1[30]->Fill(DigisInMc[iMc]);
610 }
611
612 for (std::map<Int_t, std::vector<int>>::iterator iterator = HitsInMc.begin(); iterator != HitsInMc.end();
613 iterator++) {
614 McContrList = iterator->second;
615 fMvdHisto1[31]->Fill(McContrList.size());
616 }
617
618 bool criteria;
619
620 for (std::map<Int_t, std::vector<int>>::iterator iterator = McsInHit.begin(); iterator != McsInHit.end();
621 iterator++) {
622 criteria = true;
623
624 McContrToHitList = iterator->second;
625
626 for (int i = 0; i < McContrToHitList.size(); i++) {
627 it3 = HitsInMc.find(McContrToHitList[i]);
628
629 if (it3 != HitsInMc.end()) {
630 if ((it3->second).size() != 1) { criteria = false; }
631 }
632 }
633
634 if (criteria) { fMvdHisto1[32]->Fill(McContrToHitList.size()); }
635 }
636 // -------------------
637}
638// -------------------------------------------------------------------------
639
640
641// -------------------------------------------------------------------------
643{
644 LOG(info) << "======================";
645 LOG(info) << "'Mvd QA Output' Start!";
646 LOG(info) << "======================";
647 // -------------------
648 LOG(info) << "----------------------";
649 LOG(info) << "Pixelpitch: ";
650 LOG(info) << "x: " << fPixelpitch[0];
651 LOG(info) << "y: " << fPixelpitch[1];
652 // -------------------
653 int sum;
654 LOG(info) << "----------------------";
655 LOG(info) << "MC points per Digi:";
656 sum = 0;
657 for (Int_t i = 0; i < 6; i++) {
658 sum += fMcperDigi[i];
659 }
660 for (Int_t i = 0; i < 6; i++) {
661 fMvdHisto1[35]->Fill(i, fMcperDigi[i]);
662 printf(" %2i %10i %6.5f \n", i, fMcperDigi[i], 1. * fMcperDigi[i] / sum);
663 }
664 // -------------------
665 LOG(info) << "----------------------";
666 LOG(info) << "Digis per MC Point:";
667 for (Int_t i = 0; i < 11; i++) {
668 if (fMvdHisto1[30]->GetBinCenter(i) >= 0)
669 printf(" %2i %10i %6.5f \n", (int) (fMvdHisto1[30]->GetBinCenter(i)),
670 (int) (fMvdHisto1[30]->GetBinContent(i)),
671 1. * (int) (fMvdHisto1[30]->GetBinContent(i)) * 1. / fMvdHisto1[30]->GetEntries());
672 }
673 LOG(info) << " ..";
674 // -------------------
675 LOG(info) << "----------------------";
676 LOG(info) << "Digis per Hit:";
677 for (Int_t i = 0; i < 11; i++) {
678 if (fMvdHisto1[2]->GetBinCenter(i) >= 0)
679 printf(" %2i %10i %6.5f \n", (int) (fMvdHisto1[2]->GetBinCenter(i)), (int) (fMvdHisto1[2]->GetBinContent(i)),
680 1. * (int) (fMvdHisto1[2]->GetBinContent(i)) * 1. / fMvdHisto1[2]->GetEntries());
681 }
682 LOG(info) << " ..";
683 // -------------------
684 LOG(info) << "----------------------";
685 LOG(info) << "Hits per MC Point:";
686 for (Int_t i = 0; i < 11; i++) {
687 if (fMvdHisto1[31]->GetBinCenter(i) >= 0)
688 printf(" %2i %10i %6.5f \n", (int) (fMvdHisto1[31]->GetBinCenter(i)),
689 (int) (fMvdHisto1[31]->GetBinContent(i)),
690 1. * (int) (fMvdHisto1[31]->GetBinContent(i)) * 1. / fMvdHisto1[31]->GetEntries());
691 }
692 LOG(info) << " ..";
693 // -------------------
694 LOG(info) << "----------------------";
695 LOG(info) << "MC Points per Hit:";
696 sum = 0;
697 for (Int_t i = 0; i < 11; i++) {
698 sum += fMcperHit[i];
699 }
700 for (Int_t i = 0; i < 11; i++) {
701 fMvdHisto1[36]->Fill(i, fMcperHit[i]);
702 printf(" %2i %10i %6.5f \n", i, fMcperHit[i], 1. * fMcperHit[i] / sum);
703 }
704 // -------------------
705 LOG(info) << "----------------------";
706 LOG(info) << "MC Points per Hit (merged Clusters):";
707 for (Int_t i = 0; i < 11; i++) {
708 if (fMvdHisto1[32]->GetBinCenter(i) >= 0)
709 printf(" %2i %10i %6.5f \n", (int) (fMvdHisto1[32]->GetBinCenter(i)),
710 (int) (fMvdHisto1[32]->GetBinContent(i)),
711 1. * (int) (fMvdHisto1[32]->GetBinContent(i)) * 1. / fMvdHisto1[32]->GetEntries());
712 }
713 LOG(info) << " ..";
714 // -------------------
715 LOG(info) << "----------------------";
716 // -------------------
717 Double_t xpar[3];
718 Double_t ypar[3];
719
720 TF1* gFitx = new TF1("gausx", "gaus", -50, 50);
721 TF1* gFity = new TF1("gausy", "gaus", -50, 50);
722
723 fMvdHisto1[3]->Fit(gFitx, "QRN0");
724 fMvdHisto1[4]->Fit(gFity, "QRN0");
725
726 gFitx->GetParameters(&xpar[0]);
727 gFity->GetParameters(&ypar[0]);
728
729 LOG(info) << setw(40) << "---------------------------------------------------------------------";
730 LOG(info) << "Resolution:";
731 LOG(info) << setw(40) << "---------------------------------------------------------------------";
732 LOG(info) << setw(9) << " Shape";
733 LOG(info) << setw(10) << " Mean(x)";
734 LOG(info) << setw(10) << " RMS(x)";
735 LOG(info) << setw(10) << " Mean(y)";
736 LOG(info) << setw(10) << " RMS(y)";
737 LOG(info) << setw(10) << " Mean(z)";
738 LOG(info) << setw(10) << " RMS(z)";
739 LOG(info);
740 LOG(info) << setw(40) << "---------------------------------------------------------------------";
741 LOG(info);
742
743 for (int i = 0; i < 10; i++) {
744 printf("%6i %+5.4f %+5.4f %+5.4f %+5.4f \n", i, fMvdHisto1[10 + i]->GetMean(),
745 fMvdHisto1[10 + i]->GetRMS(), fMvdHisto1[20 + i]->GetMean(), fMvdHisto1[20 + i]->GetRMS());
746 }
747 LOG(info) << setw(40) << "---------------------------------------------------------------------";
748 printf("%10s%+5.4f %+5.4f %+5.4f %+5.4f %+5.4f %+5.4f \n", "All ", fMvdHisto1[3]->GetMean(),
749 fMvdHisto1[3]->GetRMS(), fMvdHisto1[4]->GetMean(), fMvdHisto1[4]->GetRMS(), fMvdHisto1[5]->GetMean(),
750 fMvdHisto1[5]->GetRMS());
751 printf("%10s%+5.4f %+5.4f %+5.4f %+5.4f \n", "All (Fit) ", xpar[1], xpar[2], ypar[1], ypar[2]);
752
753 LOG(info) << setw(40) << "---------------------------------------------------------------------";
754 fMvdHisto1[33]->Fit(gFitx, "QRN0");
755 fMvdHisto1[34]->Fit(gFity, "QRN0");
756
757 gFitx->GetParameters(&xpar[0]);
758 gFity->GetParameters(&ypar[0]);
759 LOG(info) << "Pulls:";
760 printf("%10s%+5.4f %+5.4f %+5.4f %+5.4f \n", "All ", fMvdHisto1[33]->GetMean(), fMvdHisto1[33]->GetRMS(),
761 fMvdHisto1[34]->GetMean(), fMvdHisto1[34]->GetRMS());
762 printf("%10s%+5.4f %+5.4f %+5.4f %+5.4f \n", "All (Fit) ", xpar[1], xpar[2], ypar[1], ypar[2]);
763 LOG(info) << "(Using 3.8(x) and 4.8(y) as nominal resolution!)";
764 LOG(info) << setw(40) << "---------------------------------------------------------------------";
765 LOG(info) << setw(40) << "---------------------------------------------------------------------";
766 // -------------------
767 LOG(info) << "Hit Reco Efficiency: " << float(1. * fNrHitsAll / fNrMcPointsAll) << "\t( " << fNrHitsAll << "\t"
768 << fNrMcPointsAll << " )";
769 LOG(info) << setw(40) << "---------------------------------------------------------------------";
770 // -------------------
771 LOG(info) << "======================";
772 LOG(info) << "'Mvd QA Output' End!";
773 LOG(info) << "======================";
774
775 // -------------------
776 TCanvas* a = new TCanvas("Residuals", "Residuals");
777 a->Divide(3, 3);
778
779 a->cd(1);
780 fMvdHisto1[3]->Draw();
781 fMvdHisto1[3]->GetXaxis()->SetTitle("Residual in x [um]");
782 fMvdHisto1[3]->GetYaxis()->SetTitle("Entries");
783
784 a->cd(2);
785 fMvdHisto1[4]->Draw();
786 fMvdHisto1[4]->GetXaxis()->SetTitle("Residual in y [um]");
787 fMvdHisto1[4]->GetYaxis()->SetTitle("Entries");
788
789 a->cd(3);
790 fMvdHisto1[5]->Draw();
791 fMvdHisto1[5]->GetXaxis()->SetTitle("Residual in z [um]");
792 fMvdHisto1[5]->GetYaxis()->SetTitle("Entries");
793
794 a->cd(4);
795 fMvdHisto1[33]->Draw();
796 fMvdHisto1[33]->GetXaxis()->SetTitle("Pull in x [um]");
797 fMvdHisto1[33]->GetYaxis()->SetTitle("Entries");
798
799 a->cd(5);
800 fMvdHisto1[34]->Draw();
801 fMvdHisto1[34]->GetXaxis()->SetTitle("Pull in y [um]");
802 fMvdHisto1[34]->GetYaxis()->SetTitle("Entries");
803
804 int col[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 11};
805
806 TLegend* leg = new TLegend(0.1, 0.7, 0.48, 0.9);
807
808 a->cd(7);
809 for (int i = 0; i < 10; i++) {
810 if (i == 0) {
811 fMvdHisto1[10 + i]->Draw();
812 fMvdHisto1[10 + i]->GetXaxis()->SetTitle("Residual in x [um]");
813 fMvdHisto1[10 + i]->GetYaxis()->SetTitle("Entries");
814 }
815 else {
816 fMvdHisto1[10 + i]->Draw("same");
817 }
818 fMvdHisto1[10 + i]->SetLineColor(col[i]);
819 leg->AddEntry(fMvdHisto1[10 + i], Form("Shape %i", i));
820 }
821 leg->Draw();
822
823 a->cd(8);
824 for (int i = 0; i < 10; i++) {
825 if (i == 0) {
826 fMvdHisto1[20 + i]->Draw();
827 fMvdHisto1[20 + i]->GetXaxis()->SetTitle("Residual in y [um]");
828 fMvdHisto1[20 + i]->GetYaxis()->SetTitle("Entries");
829 }
830 else {
831 fMvdHisto1[20 + i]->Draw("same");
832 }
833 fMvdHisto1[20 + i]->SetLineColor(col[i]);
834 }
835 leg->Draw();
836 // -------------------
837 TCanvas* b = new TCanvas("Matches", "Matches");
838 b->Divide(3, 2);
839
840 b->cd(1);
841 fMvdHisto1[35]->Draw();
842 fMvdHisto1[35]->GetXaxis()->SetTitle("Mc Points per Digi");
843 fMvdHisto1[35]->GetYaxis()->SetTitle("Entries");
844
845 b->cd(2);
846 fMvdHisto1[30]->Draw();
847 fMvdHisto1[30]->GetXaxis()->SetTitle("Digis per Mc Point");
848 fMvdHisto1[30]->GetYaxis()->SetTitle("Entries");
849
850 b->cd(3);
851 fMvdHisto1[2]->Draw();
852 fMvdHisto1[2]->GetXaxis()->SetTitle("Digis per Hit");
853 fMvdHisto1[2]->GetYaxis()->SetTitle("Entries");
854
855 b->cd(4);
856 fMvdHisto1[31]->Draw();
857 fMvdHisto1[31]->GetXaxis()->SetTitle("Hits per Mc Point");
858 fMvdHisto1[31]->GetYaxis()->SetTitle("Entries");
859
860 b->cd(5);
861 fMvdHisto1[36]->Draw();
862 fMvdHisto1[36]->GetXaxis()->SetTitle("Mc Points per Hit");
863 fMvdHisto1[36]->GetYaxis()->SetTitle("Entries");
864
865 b->cd(6);
866 fMvdHisto1[32]->Draw();
867 fMvdHisto1[32]->GetXaxis()->SetTitle("Mc Points per Hit (merged)");
868 fMvdHisto1[32]->GetYaxis()->SetTitle("Entries");
869 // -------------------
870 TCanvas* d = new TCanvas("ResAna", "ResAna");
871 d->Divide(4, 2);
872
873 fProf[0] = fMvdHisto2[2]->ProfileX("0", 1, -1, "s");
874 fProf[1] = fMvdHisto2[3]->ProfileX("1", 1, -1, "s");
875 fProf[2] = fMvdHisto2[4]->ProfileX("2", 1, -1, "s");
876 fProf[3] = fMvdHisto2[5]->ProfileX("3", 1, -1, "s");
877 fProf[4] = fMvdHisto2[6]->ProfileX("4", 1, -1, "s");
878 fProf[5] = fMvdHisto2[7]->ProfileX("5", 1, -1, "s");
879 fProf[6] = fMvdHisto2[10]->ProfileX("6", 1, -1, "s");
880 fProf[7] = fMvdHisto2[11]->ProfileX("7", 1, -1, "s");
881
882 d->cd(1);
883 fProf[0]->Draw();
884 fProf[0]->GetXaxis()->SetTitle("Momentum [GeV]");
885 fProf[0]->GetYaxis()->SetTitle("Residual in x [um]");
886
887 d->cd(5);
888 fProf[1]->Draw();
889 fProf[1]->GetXaxis()->SetTitle("Momentum [GeV]");
890 fProf[1]->GetYaxis()->SetTitle("Residual in y [um]");
891
892 d->cd(2);
893 fProf[2]->Draw();
894 fProf[2]->GetXaxis()->SetTitle("Angle [rad]");
895 fProf[2]->GetYaxis()->SetTitle("Residual in x [um]");
896
897 d->cd(6);
898 fProf[3]->Draw();
899 fProf[3]->GetXaxis()->SetTitle("Angle [rad]");
900 fProf[3]->GetYaxis()->SetTitle("Residual in y [um]");
901
902 d->cd(3);
903 fProf[4]->Draw();
904 fProf[4]->GetXaxis()->SetTitle("Digis per Hit");
905 fProf[4]->GetYaxis()->SetTitle("Residual in x [um]");
906
907 d->cd(7);
908 fProf[5]->Draw();
909 fProf[5]->GetXaxis()->SetTitle("Digis per Hit");
910 fProf[5]->GetYaxis()->SetTitle("Residual in y [um]");
911
912 d->cd(4);
913 fProf[6]->Draw();
914 fProf[6]->GetXaxis()->SetTitle("Charge");
915 fProf[6]->GetYaxis()->SetTitle("Residual in x [um]");
916
917 d->cd(8);
918 fProf[7]->Draw();
919 fProf[7]->GetXaxis()->SetTitle("Charge");
920 fProf[7]->GetYaxis()->SetTitle("Residual in y [um]");
921
922 TCanvas* c = new TCanvas("Rest", "Rest");
923 c->Divide(6, 2);
924
925 c->cd(1);
926 fMvdHisto1[0]->Draw();
927 fMvdHisto1[0]->GetXaxis()->SetTitle("Momentum [GeV]");
928 fMvdHisto1[0]->GetYaxis()->SetTitle("Entries");
929
930 c->cd(2);
931 fMvdHisto1[1]->Draw();
932 fMvdHisto1[1]->GetXaxis()->SetTitle("Angle [rad]");
933 fMvdHisto1[1]->GetYaxis()->SetTitle("Entries");
934
935 c->cd(3);
936 fMvdHisto1[2]->Draw();
937 fMvdHisto1[2]->GetXaxis()->SetTitle("Digis per Hit");
938 fMvdHisto1[2]->GetYaxis()->SetTitle("Entries");
939
940 c->cd(4);
941 fMvdHisto2[14]->Draw("colz");
942 fMvdHisto2[14]->GetXaxis()->SetTitle("Residual in x [um]");
943 fMvdHisto2[14]->GetYaxis()->SetTitle("Residual in y [um]");
944 fMvdHisto2[14]->GetZaxis()->SetTitle("Entries");
945
946 c->cd(5);
947 fMvdHisto2[15]->Draw("colz");
948 fMvdHisto2[15]->GetXaxis()->SetTitle("Momentum [GeV]");
949 fMvdHisto2[15]->GetYaxis()->SetTitle("Charge");
950 fMvdHisto2[15]->GetZaxis()->SetTitle("Entries");
951
952 c->cd(6);
953 fMvdHisto2[16]->Draw("colz");
954 fMvdHisto2[16]->GetXaxis()->SetTitle("Angle [rad]");
955 fMvdHisto2[16]->GetYaxis()->SetTitle("Charge");
956 fMvdHisto2[16]->GetZaxis()->SetTitle("Entries");
957
958 c->cd(7);
959 fMvdHisto1[6]->Draw();
960 fMvdHisto1[6]->GetXaxis()->SetTitle("Distance to Pixel in x [Pixelpitch]");
961 fMvdHisto1[6]->GetYaxis()->SetTitle("Entries");
962
963 c->cd(8);
964 fMvdHisto1[7]->Draw();
965 fMvdHisto1[7]->GetXaxis()->SetTitle("Distance to Pixel in y [Pixelpitch]");
966 fMvdHisto1[7]->GetYaxis()->SetTitle("Entries");
967
968 c->cd(9);
969 fMvdHisto1[8]->Draw();
970 fMvdHisto1[8]->GetXaxis()->SetTitle("Clustershape");
971 fMvdHisto1[8]->GetYaxis()->SetTitle("Entries");
972
973 c->cd(10);
974 fMvdHisto1[9]->Draw();
975 fMvdHisto1[9]->GetXaxis()->SetTitle("Charge");
976 fMvdHisto1[9]->GetYaxis()->SetTitle("Entries");
977
978 fProf[8] = fMvdHisto2[15]->ProfileX("8", 1, -1, "");
979 fProf[9] = fMvdHisto2[16]->ProfileX("9", 1, -1, "");
980 fProf[10] = fMvdHisto2[17]->ProfileX("10", 1, -1, "");
981
982 c->cd(11);
983 fProf[8]->Draw();
984 fProf[8]->GetXaxis()->SetTitle("Momentum [GeV]");
985 fProf[8]->GetYaxis()->SetTitle("Charge");
986 fProf[10]->Draw("same");
987 fProf[10]->SetLineColor(2);
988
989 c->cd(12);
990 fProf[9]->Draw();
991 fProf[9]->GetXaxis()->SetTitle("Angle [rad]");
992 fProf[9]->GetYaxis()->SetTitle("Charge");
993
994 // fMvdHisto2[0]->Divide(fMvdHisto2[1]);
995 // TCanvas* e=new TCanvas();
996 // e->cd(1);
997 // fMvdHisto2[0]->Draw("colz");
998 // fMvdHisto2[0]->GetXaxis()->SetTitle("Distance in x MC to Pix [Pixelpitch]");
999 // fMvdHisto2[0]->GetYaxis()->SetTitle("Distance in y MC to Pix [Pixelpitch]");
1000 // fMvdHisto2[0]->GetZaxis()->SetTitle("Cluster Multiplicity");
1001
1002
1003 //
1004}
1005// -------------------------------------------------------------------------
1006
1007//-----------------------------------------------------------------------------------------
ClassImp(CbmMvdClusterAna)
int32_t GetNofDigis() const
Number of digis in cluster.
Definition CbmCluster.h:69
double GetZ() const
Definition CbmHit.h:71
double GetP() const
Definition CbmMCTrack.h:98
const CbmLink & GetMatchedLink() const
Definition CbmMatch.h:41
TProfile * fProf[50]
TClonesArray * fMvdDigis
TClonesArray * fMvdHitsMatch
TClonesArray * fMvdHits
TClonesArray * fMvdDigisMatch
TClonesArray * fMvdClusters
TClonesArray * fMcPoints
TClonesArray * fMvdClustersMatch
void Exec(Option_t *opt)
Double_t fPixelpitch[2]
TClonesArray * fListMCTracks
std::map< std::pair< int32_t, int32_t >, int32_t > GetPixelMap()
double GetPixelSizeX()
Definition CbmMvdDigi.h:50
int32_t GetPixelY()
double GetPixelSizeY()
Definition CbmMvdDigi.h:51
int32_t GetPixelX()
int32_t GetIndexCentralY() const
Definition CbmMvdHit.h:65
int32_t GetIndexCentralX() const
Definition CbmMvdHit.h:64
double GetXOut() const
Definition CbmMvdPoint.h:67
double GetZOut() const
Definition CbmMvdPoint.h:69
double GetYOut() const
Definition CbmMvdPoint.h:68
double GetY() const
Definition CbmPixelHit.h:74
double GetX() const
Definition CbmPixelHit.h:73