Skip to content

Commit

Permalink
Flexible ring radii, a new Boolean switch for module A, module covera…
Browse files Browse the repository at this point in the history
…ge in eta independent of their position
  • Loading branch information
pkurash committed Feb 2, 2025
1 parent 96ad811 commit dcef291
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 15 deletions.
6 changes: 6 additions & 0 deletions Detectors/Upgrades/ALICE3/FD/base/include/FDBase/Constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ struct Constants {
static constexpr int nsect = 8;
static constexpr int nringsA = 5;
static constexpr int nringsC = 6;

static constexpr float etaMax = 7.0f;
static constexpr float etaMin = 4.0f;

static constexpr int nringsA_withFCT = 4;
static constexpr float etaMinA_withFCT = 5.0f;
};

} // namespace fd
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,11 @@ namespace fd
{
struct FDBaseParam : public o2::conf::ConfigurableParamHelper<FDBaseParam> {

float ringsA[Constants::nringsA + 1] = {3., 14.8, 26.6, 38.4, 50.2, 62.};
float ringsC[Constants::nringsC + 1] = {3.5, 14.75, 26.0, 37.25, 48.5, 59.75, 71.};
float zmodA = 1700.0f;
float zmodC = -1950.0f;
float dzscint = 4.0f;

float zmodA = 1700;
float zmodC = -1950;
float dzscint = 4.;
bool withFCT = true;

O2ParamDef(FDBaseParam, "FDBase");
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ class Detector : public o2::base::DetImpl<Detector>
TGeoVolumeAssembly* buildModuleA();
TGeoVolumeAssembly* buildModuleC();

float ringRadius(float zmod, float eta);

int mNumberOfSectors;
int mNumberOfRingsA;
int mNumberOfRingsC;
Expand All @@ -106,6 +108,7 @@ class Detector : public o2::base::DetImpl<Detector>
std::vector<float> mRingRadiiA = {};
std::vector<float> mRingRadiiC = {};

float mEtaMax, mEtaMin, mEtaMinA;
float mZmodA;
float mZmodC;

Expand Down
43 changes: 33 additions & 10 deletions Detectors/Upgrades/ALICE3/FD/simulation/src/Detector.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -55,23 +55,37 @@ Detector::Detector(bool active)
mGeometryTGeo(nullptr),
mTrackData()
{
mNumberOfRingsA = Constants::nringsA;
mNumberOfRingsC = Constants::nringsC;
mNumberOfSectors = Constants::nsect;

mEtaMax = Constants::etaMax;
mEtaMin = Constants::etaMin;

auto& baseParam = FDBaseParam::Instance();

if (baseParam.withFCT) {
mNumberOfRingsA = Constants::nringsA_withFCT;
mEtaMinA = Constants::etaMinA_withFCT;
} else {
mNumberOfRingsA = Constants::nringsA;
mEtaMinA = mEtaMin;
}

mDzScint = baseParam.dzscint / 2;
mZmodA = baseParam.zmodA;
mZmodC = baseParam.zmodC;

for (int i = 0; i <= mNumberOfRingsA + 1; i++) {
mRingRadiiA.emplace_back(baseParam.ringsA[i]);
float eta = mEtaMax - i * (mEtaMax - mEtaMinA) / mNumberOfRingsA;
float r = ringRadius(mZmodA, eta);
mRingRadiiA.emplace_back(r);
}

for (int i = 0; i <= mNumberOfRingsC + 1; i++) {
mRingRadiiC.emplace_back(baseParam.ringsC[i]);
float eta = -mEtaMax + i * (mEtaMax - mEtaMin) / mNumberOfRingsC;
float r = ringRadius(mZmodC, eta);
mRingRadiiC.emplace_back(r);
}

mZmodA = baseParam.zmodA;
mZmodC = baseParam.zmodC;
}

Detector::Detector(const Detector& rhs)
Expand Down Expand Up @@ -297,11 +311,12 @@ TGeoVolumeAssembly* Detector::buildModuleA()
for (int ir = 0; ir < mNumberOfRingsA; ir++) {
std::string rName = "fd_ring" + std::to_string(ir + 1);
TGeoVolumeAssembly* ring = new TGeoVolumeAssembly(rName.c_str());
float rmin = mRingRadiiA[ir];
float rmax = mRingRadiiA[ir + 1];
LOG(info) << "ring" << ir << ": from " << rmin << " to " << rmax;
for (int ic = 0; ic < mNumberOfSectors; ic++) {
int cellId = ic + mNumberOfSectors * ir;
std::string nodeName = "fd_node" + std::to_string(cellId);
float rmin = mRingRadiiA[ir];
float rmax = mRingRadiiA[ir + 1];
float phimin = dphiDeg * ic;
float phimax = dphiDeg * (ic + 1);
auto tbs = new TGeoTubeSeg("tbs", rmin, rmax, mDzScint, phimin, phimax);
Expand All @@ -326,11 +341,12 @@ TGeoVolumeAssembly* Detector::buildModuleC()
for (int ir = 0; ir < mNumberOfRingsC; ir++) {
std::string rName = "fd_ring" + std::to_string(ir + 1 + mNumberOfRingsA);
TGeoVolumeAssembly* ring = new TGeoVolumeAssembly(rName.c_str());
float rmin = mRingRadiiC[ir];
float rmax = mRingRadiiC[ir + 1];
LOG(info) << "ring" << ir + mNumberOfRingsA << ": from " << rmin << " to " << rmax;
for (int ic = 0; ic < mNumberOfSectors; ic++) {
int cellId = ic + mNumberOfSectors * (ir + mNumberOfRingsA);
std::string nodeName = "fd_node" + std::to_string(cellId);
float rmin = mRingRadiiC[ir];
float rmax = mRingRadiiC[ir + 1];
float phimin = dphiDeg * ic;
float phimax = dphiDeg * (ic + 1);
auto tbs = new TGeoTubeSeg("tbs", rmin, rmax, mDzScint, phimin, phimax);
Expand All @@ -354,6 +370,8 @@ void Detector::defineSensitiveVolumes()
int nCellA = mNumberOfRingsA * mNumberOfSectors;
int nCellC = mNumberOfRingsC * mNumberOfSectors;

LOG(info) << "number of A rings = " << mNumberOfRingsA << " number of cells = " << nCellA;

for (int iv = 0; iv < nCellA + nCellC; iv++) {
volumeName = "fd_node" + std::to_string(iv);
v = gGeoManager->GetVolume(volumeName);
Expand Down Expand Up @@ -390,4 +408,9 @@ int Detector::getChannelId(TVector3 vec)
return ir * mNumberOfSectors + isect + noff;
}

float Detector::ringRadius(float z, float eta)
{
return z * TMath::Tan(2 * TMath::ATan(TMath::Exp(-eta)));
}

ClassImp(o2::fd::Detector);

0 comments on commit dcef291

Please sign in to comment.