Skip to content

Commit e2b6b28

Browse files
committed
Fixed hit merging
1 parent bf7b954 commit e2b6b28

File tree

4 files changed

+17
-15
lines changed

4 files changed

+17
-15
lines changed

Detectors/Upgrades/ALICE3/FD/base/include/FDBase/Constants.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ namespace o2
2222
namespace fd
2323
{
2424
struct Constants {
25-
static constexpr int nsect = 8;
26-
static constexpr int nringsA = 3;
27-
static constexpr int nringsC = 6;
25+
static constexpr unsigned int nsect = 8;
26+
static constexpr unsigned int nringsA = 3;
27+
static constexpr unsigned int nringsC = 6;
2828

2929
static constexpr float etaMax = 7.0f;
3030
static constexpr float etaMinC = 4.0f;
3131
static constexpr float etaMinA = 5.0f;
3232

33-
static constexpr int nringsA_noFCT = 5;
33+
static constexpr unsigned int nringsA_noFCT = 5;
3434
static constexpr float etaMinA_noFCT = 4.0f;
3535
};
3636

Detectors/Upgrades/ALICE3/FD/simulation/include/FDSimulation/Detector.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,9 @@ class Detector : public o2::base::DetImpl<Detector>
100100

101101
float ringRadius(float zmod, float eta);
102102

103-
int mNumberOfSectors;
104-
int mNumberOfRingsA;
105-
int mNumberOfRingsC;
103+
unsigned int mNumberOfSectors;
104+
unsigned int mNumberOfRingsA;
105+
unsigned int mNumberOfRingsC;
106106
float mDzScint;
107107

108108
std::vector<float> mRingRadiiA = {};
@@ -115,7 +115,7 @@ class Detector : public o2::base::DetImpl<Detector>
115115

116116
void defineSensitiveVolumes();
117117

118-
int getChannelId(TVector3 vec);
118+
unsigned int getChannelId(TVector3 vec);
119119

120120
/// Transient data about track passing the sensor, needed by ProcessHits()
121121
struct TrackData { // this is transient

Detectors/Upgrades/ALICE3/FD/simulation/src/Detector.cxx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,6 @@ bool Detector::ProcessHits(FairVolume* vol)
138138
// Check track status to define when hit is started and when it is stopped
139139
bool startHit = false, stopHit = false;
140140
unsigned char status = 0;
141-
142-
int currVolId, offId;
143-
144141
if (fMC->IsTrackEntering()) {
145142
status |= Hit::kTrackEntering;
146143
}
@@ -186,8 +183,8 @@ bool Detector::ProcessHits(FairVolume* vol)
186183
if (stopHit) {
187184
TLorentzVector positionStop;
188185
fMC->TrackPosition(positionStop);
189-
int trackId = fMC->GetStack()->GetCurrentTrackNumber();
190-
int chId = getChannelId(mTrackData.mPositionStart.Vect());
186+
int trackId = stack->GetCurrentTrackNumber();
187+
unsigned int chId = getChannelId(mTrackData.mPositionStart.Vect());
191188

192189
Hit* p = addHit(trackId, chId /*cellId*/, mTrackData.mPositionStart.Vect(), positionStop.Vect(),
193190
mTrackData.mMomentumStart.Vect(), mTrackData.mMomentumStart.E(),
@@ -374,7 +371,7 @@ void Detector::defineSensitiveVolumes()
374371
}
375372
}
376373

377-
int Detector::getChannelId(TVector3 vec)
374+
unsigned int Detector::getChannelId(TVector3 vec)
378375
{
379376
float phi = vec.Phi();
380377
if (phi < 0) {
@@ -384,7 +381,7 @@ int Detector::getChannelId(TVector3 vec)
384381
float r = vec.Perp();
385382
float z = vec.Z();
386383

387-
int isect = int(phi / (TMath::Pi() / 4));
384+
int isect = int(phi / (TMath::TwoPi() / mNumberOfSectors));
388385

389386
std::vector<float> rd = z > 0 ? mRingRadiiA : mRingRadiiC;
390387
int noff = z > 0 ? 0 : mNumberOfRingsA * mNumberOfSectors;

run/O2HitMerger.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@
7878
#include <RICHSimulation/Detector.h>
7979
#include <ECalSimulation/Detector.h>
8080
#include <MI3Simulation/Detector.h>
81+
#include <FDSimulation/Detector.h>
8182
#endif
8283

8384
#include <tbb/concurrent_unordered_map.h>
@@ -1020,6 +1021,10 @@ void O2HitMerger::initDetInstances()
10201021
mDetectorInstances[i] = std::move(std::make_unique<o2::ecal::Detector>(true));
10211022
counter++;
10221023
}
1024+
if (i == DetID::FD) {
1025+
mDetectorInstances[i] = std::move(std::make_unique<o2::fd::Detector>(true));
1026+
counter++;
1027+
}
10231028
#endif
10241029
}
10251030
if (counter != DetID::nDetectors) {

0 commit comments

Comments
 (0)