16 #include "FairGeoNode.h"
17 #include "FairLogger.h"
18 #include "FairRootManager.h"
19 #include "FairRunAna.h"
20 #include "FairRuntimeDb.h"
25 #include "TGeoManager.h"
27 #include "TObjArray.h"
28 #include "TRefArray.h"
31 #include "TClonesArray.h"
55 using std::setprecision;
68 , fClusters(new TClonesArray(
"CbmMvdCluster", 10000))
69 , fPixelChargeHistos(NULL)
70 , fTotalChargeInNpixelsArray(NULL)
71 , fResolutionHistoX(NULL)
72 , fResolutionHistoY(NULL)
73 , fResolutionHistoCleanX(NULL)
74 , fResolutionHistoCleanY(NULL)
75 , fResolutionHistoMergedX(NULL)
76 , fResolutionHistoMergedY(NULL)
80 , fGausArrayLimit(5000)
88 , fFullClusterHisto(NULL)
96 , fShowDebugHistos(kFALSE)
100 , fLayerRadiusInner(0.)
105 , fHitPosErrX(0.0005)
106 , fHitPosErrY(0.0005)
108 , fBranchName(
"MvdHit")
110 , fAddNoise(kFALSE) {}
122 , fClusters(new TClonesArray(
"CbmMvdCluster", 10000))
123 , fPixelChargeHistos(NULL)
124 , fTotalChargeInNpixelsArray(NULL)
125 , fResolutionHistoX(NULL)
126 , fResolutionHistoY(NULL)
127 , fResolutionHistoCleanX(NULL)
128 , fResolutionHistoCleanY(NULL)
129 , fResolutionHistoMergedX(NULL)
130 , fResolutionHistoMergedY(NULL)
134 , fGausArrayLimit(5000)
142 , fFullClusterHisto(NULL)
149 , fNeighThreshold(1.)
150 , fShowDebugHistos(kFALSE)
154 , fLayerRadiusInner(0.)
159 , fHitPosErrX(0.0005)
160 , fHitPosErrY(0.0005)
162 , fBranchName(
"MvdHit")
164 , fAddNoise(kFALSE) {}
193 fInputBuffer =
new TClonesArray(
"CbmMvdCluster", 10000);
221 <<
"CbmMvdSensorHitfinderTask::ReInt---------------" << endl;
245 TVector3
pos(0, 0, 0);
246 TVector3
dpos(0, 0, 0);
264 Int_t indexX, indexY;
310 Double_t
lab[3] = {0, 0, 0};
311 std::map<pair<Int_t, Int_t>, Int_t> PixelMap = cluster->
GetPixelMap();
317 Double_t sigmaIn[3], sigmaOut[3], shiftIn[3], shiftOut[3];
319 for (map<pair<Int_t, Int_t>, Int_t>::iterator it = PixelMap.begin();
320 it != PixelMap.end();
322 pair<Int_t, Int_t> pixel = it->first;
329 if (PixelMap.size() <= 4) {
330 if (it == PixelMap.begin()) {
340 <<
"CbmMvdSensorHitfinderTask:: iCluster= " << cluster->
GetRefId()
341 <<
" , clusterSize= " << clusterSize << endl;
343 <<
"CbmMvdSensorHitfinderTask::xIndex " <<
xIndex <<
" , yIndex "
344 <<
yIndex <<
" , charge = " << charge << endl;
352 Double_t xc =
x * charge;
353 Double_t yc =
y * charge;
362 <<
"CbmMvdSensorHitfinderTask::=========================\n " << endl;
364 <<
"CbmMvdSensorHitfinderTask::numeratorX: " <<
numeratorX
382 <<
"CbmMvdSensorHitfinderTask::-----------------------------------"
385 <<
"CbmMvdSensorHitfinderTask::X hit= " <<
fHitPosX
388 <<
"CbmMvdSensorHitfinderTask::-----------------------------------\n"
393 if (
shape == 12288) {
394 sigmaIn[0] = 0.00053;
395 sigmaIn[1] = 0.00063;
397 shiftIn[0] = -0.00000;
398 shiftIn[1] = -0.00001;
400 }
else if (
shape == 208896) {
401 sigmaIn[0] = 0.00035;
402 sigmaIn[1] = 0.00036;
404 shiftIn[0] = -0.00000;
405 shiftIn[1] = -0.00002;
407 }
else if (
shape == 69632) {
408 sigmaIn[0] = 0.00028;
409 sigmaIn[1] = 0.00028;
411 shiftIn[0] = -0.00000;
412 shiftIn[1] = -0.00002;
414 }
else if (
shape == 28672) {
415 sigmaIn[0] = 0.00028;
416 sigmaIn[1] = 0.00039;
418 shiftIn[0] = -0.00000;
419 shiftIn[1] = -0.00001;
421 }
else if (
shape == 143360) {
422 sigmaIn[0] = 0.00024;
423 sigmaIn[1] = 0.00022;
425 shiftIn[0] = +0.00020;
426 shiftIn[1] = +0.00008;
428 }
else if (
shape == 200704) {
429 sigmaIn[0] = 0.00024;
430 sigmaIn[1] = 0.00022;
432 shiftIn[0] = -0.00020;
433 shiftIn[1] = -0.00011;
435 }
else if (
shape == 77824) {
436 sigmaIn[0] = 0.00024;
437 sigmaIn[1] = 0.00022;
439 shiftIn[0] = -0.00020;
440 shiftIn[1] = +0.00008;
442 }
else if (
shape == 12800) {
443 sigmaIn[0] = 0.00024;
444 sigmaIn[1] = 0.00022;
446 shiftIn[0] = +0.00020;
447 shiftIn[1] = -0.00011;
449 }
else if (
shape == 4096) {
450 sigmaIn[0] = 0.00027;
451 sigmaIn[1] = 0.00092;
453 shiftIn[0] = +0.00002;
454 shiftIn[1] = +0.00004;
457 sigmaIn[0] = 0.00036;
458 sigmaIn[1] = 0.00044;
460 shiftIn[0] = -0.00000;
461 shiftIn[1] = -0.00002;
466 TGeoHMatrix RotMatrix;
467 RotMatrix.SetRotation(RecoMatrix->GetRotationMatrix());
469 RotMatrix.LocalToMaster(sigmaIn, sigmaOut);
470 RotMatrix.LocalToMaster(shiftIn, shiftOut);