Skip to content

Commit cfed487

Browse files
committed
Fix: wrong ZEM could be assigned
1 parent a6a09cb commit cfed487

1 file changed

Lines changed: 13 additions & 11 deletions

File tree

Detectors/ZDC/simulation/src/Detector.cxx

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include <cassert>
3030
#include <fstream>
3131
#include "ZDCSimulation/ZDCSimParam.h"
32+
#include "ZDCBase/Constants.h"
3233

3334
using namespace o2::zdc;
3435

@@ -194,35 +195,35 @@ void Detector::getDetIDandSecID(TString const& volname, Vector3D<float> const& x
194195
// for the neutron calorimeter
195196

196197
if (x.Z() > 0) {
197-
detector = 1; //ZNA
198+
detector = ZNA;
198199
xDet = x - Vector3D<float>(Geometry::ZNAPOSITION[0], Geometry::ZNAPOSITION[1], Geometry::ZNAPOSITION[2]);
199200

200201
} else if (x.Z() < 0) {
201-
detector = 4; //ZNC
202+
detector = ZNC;
202203
xDet = x - Vector3D<float>(Geometry::ZNCPOSITION[0], Geometry::ZNCPOSITION[1], Geometry::ZNCPOSITION[2]);
203204
}
204205
// now determine sector/tower
205206
if (xDet.X() <= 0.) {
206207
if (xDet.Y() <= 0.) {
207-
sector = 1;
208+
sector = Ch1;
208209
} else
209-
sector = 3;
210+
sector = Ch3;
210211
} else {
211212
if (xDet.Y() <= 0.) {
212-
sector = 2;
213+
sector = Ch2;
213214
} else {
214-
sector = 4;
215+
sector = Ch4;
215216
}
216217
}
217218
return;
218219

219220
} else if (volname.BeginsWith("ZP")) {
220221
// proton calorimeter
221222
if (x.Z() > 0) {
222-
detector = 2; //ZPA (NB -> DIFFERENT FROM AliRoot!!!)
223+
detector = ZPA; // (NB -> DIFFERENT FROM AliRoot!!!)
223224
xDet = x - Vector3D<float>(Geometry::ZPAPOSITION[0], Geometry::ZPAPOSITION[1], Geometry::ZPAPOSITION[2]);
224225
} else if (x.Z() < 0) {
225-
detector = 5; //ZPC (NB -> DIFFERENT FROM AliRoot!!!)
226+
detector = ZPC; // (NB -> DIFFERENT FROM AliRoot!!!)
226227
xDet = x - Vector3D<float>(Geometry::ZPCPOSITION[0], Geometry::ZPCPOSITION[1], Geometry::ZPCPOSITION[2]);
227228
}
228229

@@ -244,9 +245,9 @@ void Detector::getDetIDandSecID(TString const& volname, Vector3D<float> const& x
244245

245246
} else if (volname.BeginsWith("ZE")) {
246247
// electromagnetic calorimeter
247-
detector = 3;
248+
detector = ZEM;
248249
xDet = x - Vector3D<float>(Geometry::ZEMPOSITION[0], Geometry::ZEMPOSITION[1], Geometry::ZEMPOSITION[2]);
249-
sector = (x.X() > 0.) ? 1 : 2;
250+
sector = (x.X() > 0.) ? Ch1 : Ch2;
250251
return;
251252
}
252253

@@ -305,7 +306,8 @@ Bool_t Detector::ProcessHits(FairVolume* v)
305306

306307
// If the particle is in a ZN or ZP fiber connected to the common PMT
307308
// then the assigned sector is 0 (PMC) NB-> does not work for ZEM
308-
if((fMC->CurrentMedium() == mMediumPMCid) && (volID != mZEMVolID)) sector = 0;
309+
if ((fMC->CurrentMedium() == mMediumPMCid) && (detector != ZEM))
310+
sector = 0;
309311
//printf("ProcessHits: x=(%f, %f, %f) \n",x[0], x[1], x[2]);
310312
//printf("\tDET %d SEC %d -> XImpact=(%f, %f, %f)\n",detector,sector, xImp.X(), xImp.Y(), xImp.Z());
311313

0 commit comments

Comments
 (0)