108 map<Int_t, std::vector <Int_t> > mapStripPoint;
109 map<Int_t, std::vector <Int_t> > mapBoxPoint;
110 map<Int_t, TVector3> mapStripPos;
111 map<Int_t, TVector3> mapBoxPos;
113 mapStripPoint.clear();
118 TVector3 mdtSize(0.5, 0.5, 0.5);
123 TVector3 inPos, outPos, meanPos;
125 for (Int_t iPoint=0; iPoint<nPoints; iPoint++) {
127 if (point->GetEnergyLoss()==0)
continue;
129 point->Position(inPos);
132 if ((inPos-outPos).Mag()<0.2)
continue;
134 meanPos = 0.5*(inPos+outPos);
135 gGeoManager->FindNode(meanPos.X(), meanPos.Y(), meanPos.Z());
136 TGeoMatrix *mdtMat = (TGeoMatrix*)
gGeoManager->GetCurrentMatrix();
137 const Double_t *matM = mdtMat->GetTranslation();
138 TVector3 tubePos(matM[0], matM[1], matM[2]);
139 TVector3 stripPos1, stripPos2;
140 Int_t stripNum1 = -10, stripNum2 = -10, stripId1 = -10, stripId2 = -10;
145 if (stripNum1<0) stripNum1 = 0;
146 if (stripNum2<0) stripNum2 = 0;
147 stripPos1.SetXYZ(matM[0], matM[1],
fBarrelStart - stripNum1 - 0.5);
148 stripPos2.SetXYZ(matM[0], matM[1],
fBarrelStart - stripNum2 - 0.5);
154 if (stripNum1<0) stripNum1 = 0;
155 if (stripNum2<0) stripNum2 = 0;
156 stripPos1.SetXYZ(
fEndcapStart - stripNum1 - 0.5, matM[1], matM[2]);
157 stripPos2.SetXYZ(
fEndcapStart - stripNum2 - 0.5, matM[1], matM[2]);
161 stripNum1 = (Int_t)(
fMFStart - point->GetX()-0.25);
162 stripNum2 = (Int_t)(
fMFStart - point->GetX()+0.25);
163 if (stripNum1<0) stripNum1 = 0;
164 if (stripNum2<0) stripNum2 = 0;
165 stripPos1.SetXYZ(
fMFStart - stripNum1 - 0.5, matM[1], matM[2]);
166 stripPos2.SetXYZ(
fMFStart - stripNum2 - 0.5, matM[1], matM[2]);
174 mapBoxPoint[point->GetDetectorID()].push_back(iPoint);
175 mapBoxPos[point->GetDetectorID()] = tubePos;
176 mapStripPoint[stripId1].push_back(iPoint);
177 mapStripPos[stripId1] = stripPos1;
178 if (stripNum1!=stripNum2)
180 mapStripPoint[stripId2].push_back(iPoint);
181 mapStripPos[stripId2] = stripPos2;
186 mapBoxPoint[point->GetDetectorID()].push_back(iPoint);
187 mapBoxPos[point->GetDetectorID()] = stripPos1;
192 map<Int_t, std::vector <Int_t> >::const_iterator boxIter;
193 for( boxIter = mapBoxPoint.begin(); boxIter != mapBoxPoint.end(); ++boxIter)
195 AddDigiBox((*boxIter).first, mapBoxPos[(*boxIter).first], (*boxIter).second);
197 map<Int_t, std::vector <Int_t> >::const_iterator stripIter;
198 for( stripIter = mapStripPoint.begin(); stripIter != mapStripPoint.end(); ++stripIter)
200 AddDigiStrip((*stripIter).first, mapStripPos[(*stripIter).first], (*stripIter).second);
TClonesArray * fDigiStripArray
PndMdtDigi * AddDigiStrip(Int_t detID, TVector3 &pos, std::vector< Int_t > pointList)
PndMdtDigi * AddDigiBox(Int_t detID, TVector3 &pos, std::vector< Int_t > pointList)
TClonesArray * fDigiBoxArray
TGeoManager * gGeoManager
TClonesArray * fPointArray
Short_t GetSector() const
Float_t fBarrelStart
Strip Mode.
TVector3 GetPosIn() const
Short_t GetLayerID() const
Short_t GetModule() const