11 #include "FairGeoNode.h"
12 #include "FairGeoTransform.h"
13 #include "FairGeoVector.h"
14 #include "FairRootManager.h"
16 #include "FairRunAna.h"
17 #include "FairRuntimeDb.h"
18 #include "FairTrackParam.h"
19 #include "TGeoManager.h"
22 #include "TClonesArray.h"
23 #include "TMatrixFSym.h"
27 #include "FairLogger.h"
37 : fTrackParams(NULL), fNHits(0), fEventNum(0) {}
40 FairRootManager* fManager = FairRootManager::Instance();
46 LOG(info) <<
"CbmRichProjectionProducerTGeo::Init()";
47 FairRootManager* manager = FairRootManager::Instance();
49 fTrackParams = (TClonesArray*) manager->GetObject(
"RichTrackParamZ");
50 if (NULL ==
fTrackParams) { LOG(fatal) <<
"No RichTrackParamZ array!"; }
55 LOG(info) <<
"CbmRichProjectionProducer: event " <<
fEventNum;
63 TMatrixFSym covMat(5);
64 for (Int_t
i = 0;
i < 5;
i++) {
65 for (Int_t j = 0; j <=
i; j++) {
69 covMat(0, 0) = covMat(1, 1) = covMat(2, 2) = covMat(3, 3) = covMat(4, 4) =
72 for (Int_t j = 0; j <
fTrackParams->GetEntriesFast(); j++) {
73 FairTrackParam* trackParam = (FairTrackParam*)
fTrackParams->At(j);
74 new ((*richProj)[j]) FairTrackParam(0., 0., 0., 0., 0., 0., covMat);
76 if (trackParam->GetX() == 0 && trackParam->GetY() == 0
77 && trackParam->GetZ() == 0 && trackParam->GetTx() == 0
78 && trackParam->GetTy() == 0)
80 if (trackParam->GetQp() == 0)
continue;
82 TVector3 startP, crossP, centerP;
86 dirCos.SetXYZ(nx, ny, nz);
89 trackParam, crossP,
"mirror_tile_type");
90 Bool_t mirrorIntersectionFound = (volumeName != string(
""));
91 if (!mirrorIntersectionFound)
continue;
95 centerP.SetXYZ(mirrorX, mirrorY, mirrorZ);
97 centerP.SetXYZ(mirrorX, -mirrorY, mirrorZ);
101 TVector3 normP(crossP.x() - centerP.x(),
102 crossP.y() - centerP.y(),
103 crossP.z() - centerP.z());
104 normP = normP.Unit();
106 if ((normP.z() * dirCos.z()) < 0.)
107 normP = TVector3(-1. * normP.x(), -1. * normP.y(), -1. * normP.z());
111 normP.x() * dirCos.x() + normP.y() * dirCos.y() + normP.z() * dirCos.z();
112 Double_t refX = 2 * np * normP.x() - dirCos.x();
113 Double_t refY = 2 * np * normP.y() - dirCos.y();
114 Double_t refZ = 2 * np * normP.z() - dirCos.z();
116 refl.SetXYZ(-refX, -refY, -refZ);
119 TVector3 pmtIntersectionPoint;
121 refl, crossP, pmtIntersectionPoint,
"pmt");
122 Bool_t pmtIntersectionFound = (volumeName != string(
""));
123 if (!pmtIntersectionFound)
continue;
131 Double_t xDet = outPos.X();
132 Double_t yDet = outPos.Y();
133 Double_t zDet = outPos.Z();
138 FairTrackParam richtrack(xDet, yDet, zDet, 0., 0., 0., covMat);
139 *(FairTrackParam*) (
richProj->At(j)) = richtrack;
144 cout <<
"nofRichProjections:" <<
richProj->GetEntriesFast() << endl;