Skip to content

Commit 8dde3a8

Browse files
committed
removed obsolete variables and funcions
1 parent 0a7a750 commit 8dde3a8

4 files changed

Lines changed: 55 additions & 146 deletions

File tree

Detectors/Upgrades/ALICE3/FD3/base/include/FD3Base/Constants.h

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -20,29 +20,19 @@ namespace o2
2020
namespace fd3
2121
{
2222
struct Constants {
23-
static constexpr unsigned int nsect = 8;
24-
static constexpr unsigned int nringsScint = 5;
25-
static constexpr unsigned int nringsCher = 1;
23+
static constexpr unsigned int nSectScint = 8;
24+
static constexpr unsigned int nRingsScint = 5;
2625

27-
static constexpr float dzscint = 4.0f;
28-
static constexpr float dzcher = 4.0f;
26+
static constexpr float zScint = 420.0f;
27+
static constexpr float zCher = 430.0f;
2928

30-
static constexpr float etaMin_scintA = 2.5f;
31-
static constexpr float etaMax_scintA_v1 = 4.9f;
32-
static constexpr float etaMax_scintA_v2 = 5.5f;
33-
static constexpr float etaMin_cherA = 4.0f;
34-
static constexpr float etaMax_cherA_v1 = 4.9f;
35-
static constexpr float etaMax_cherA_v2 = 5.5f;
29+
static constexpr float dzScint = 4.0f;
30+
static constexpr float dzCher = 2.0f;
3631

37-
static constexpr float etaMin_scintC = -4.9f;
38-
static constexpr float etaMax_scintC = -2.5f;
39-
static constexpr float etaMin_cherC = -4.9f;
40-
static constexpr float etaMax_cherC = -4.0f;
32+
static constexpr float etaMin = 2.5f;
33+
static constexpr float etaMax = 4.9f;
34+
static constexpr float etaMax2 = 5.5f; // asymmetric configuration
4135

42-
static constexpr float zscint = 420.0f;
43-
static constexpr float zcher = 430.0f;
44-
45-
static constexpr float rsize = 1.6f; // characteristic distance for building cherenkov segments
4636
static constexpr float rsizeq = 1.025f; // quartz radiator transverse size
4737
};
4838

Detectors/Upgrades/ALICE3/FD3/base/include/FD3Base/FD3BaseParam.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ namespace fd3
2525
struct FD3BaseParam : public o2::conf::ConfigurableParamHelper<FD3BaseParam> {
2626

2727
bool isSymmetric = true;
28-
bool isCherenkovSegmented = true;
2928

3029
O2ParamDef(FD3BaseParam, "FD3Base");
3130
};

Detectors/Upgrades/ALICE3/FD3/simulation/include/FD3Simulation/Detector.h

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,9 @@ class Detector : public o2::base::DetImpl<Detector>
9090

9191
enum EMedia {
9292
Scintillator,
93+
RadiatorOpticalGlass,
9394
Aluminium,
94-
MCPGlass,
95-
RadiatorOpticalGlass
95+
MCPGlass
9696
};
9797

9898
private:
@@ -102,9 +102,7 @@ class Detector : public o2::base::DetImpl<Detector>
102102
std::vector<o2::fd3::Hit>* mHits = nullptr;
103103
GeometryTGeo* mGeometryTGeo = nullptr;
104104

105-
TGeoVolumeAssembly* buildModuleScintA();
106-
TGeoVolumeAssembly* buildModuleScintC();
107-
TGeoVolumeAssembly* buildModuleCherenkov_v0(float etaMin, float etaMax, float zMod);
105+
TGeoVolumeAssembly* buildModuleScint(float etaMin, float etaMax);
108106
TGeoVolumeAssembly* buildModuleCherenkov_v1();
109107
TGeoVolumeAssembly* buildModuleCherenkov_v2();
110108

@@ -113,13 +111,6 @@ class Detector : public o2::base::DetImpl<Detector>
113111

114112
float getRingSize(float zmod, float eta);
115113

116-
unsigned int mNumberOfRingsScint, mNumberOfRingsCher, mNumberOfSectors;
117-
float mDzScint, mDzCher;
118-
119-
float mEtaMinScintA, mEtaMaxScintA, mEtaMinScintC, mEtaMaxScintC;
120-
float mEtaMaxCherA, mEtaMinCherA, mEtaMaxCherC, mEtaMinCherC;
121-
float mZScint, mZCher;
122-
123114
void defineSensitiveVolumes();
124115
void definePassiveVolumes();
125116

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

Lines changed: 43 additions & 114 deletions
Original file line numberDiff line numberDiff line change
@@ -218,10 +218,12 @@ void Detector::createMaterials()
218218

219219
int fieldType;
220220
float maxField;
221+
221222
// TODO: Comment out two lines below once tested that the above function assigns field type and max correctly
222-
fieldType = 3; // Field type
223-
maxField = 5.0; // Field max.
224-
// o2::base::Detector::initFieldTrackingParams(fieldType, maxField);
223+
fieldType = 2; // Field type
224+
maxField = 10.; // Field max.
225+
226+
o2::base::Detector::initFieldTrackingParams(fieldType, maxField);
225227
LOG(info) << "FD3: createMaterials(): fieldType " << fieldType << ", maxField " << maxField;
226228

227229
float tmaxfd3 = -10.0; // max deflection angle due to magnetic field in one step
@@ -265,150 +267,77 @@ void Detector::buildModules()
265267
{
266268
LOGP(info, "Creating FD3 geometry");
267269

268-
mNumberOfRingsScint = Constants::nringsScint;
269-
mNumberOfRingsCher = Constants::nringsCher;
270-
mNumberOfSectors = Constants::nsect;
271-
mDzScint = Constants::dzscint;
272-
mDzCher = Constants::dzcher;
273-
274270
auto& baseParam = FD3BaseParam::Instance();
275271

276-
mEtaMinScintA = Constants::etaMin_scintA;
277-
mEtaMinCherA = Constants::etaMin_cherA;
278-
mEtaMaxScintA = baseParam.isSymmetric ? Constants::etaMax_scintA_v1 : Constants::etaMax_scintA_v2;
279-
mEtaMaxCherA = baseParam.isSymmetric ? Constants::etaMax_cherA_v1 : Constants::etaMax_cherA_v2;
280-
281-
mEtaMinScintC = Constants::etaMin_scintC;
282-
mEtaMinCherC = Constants::etaMin_cherC;
283-
mEtaMaxScintC = Constants::etaMax_scintC;
284-
mEtaMaxCherC = Constants::etaMax_cherC;
285-
286-
mZScint = Constants::zscint;
287-
mZCher = Constants::zcher;
288-
289272
auto topVolume = (TGeoVolume*)gGeoManager->GetVolume("barrel");
290273

291274
mChannelCounter = 0;
292275

293-
TGeoVolumeAssembly* vFD3_ScintA = buildModuleScintA();
294-
TGeoVolumeAssembly* vFD3_ScintC = buildModuleScintC();
295-
TGeoVolumeAssembly *vFD3_CherA, *vFD3_CherC;
276+
TGeoVolumeAssembly *vFD3_ScintA, *vFD3_ScintC, *vFD3_CherA, *vFD3_CherC;
296277

297-
if (baseParam.isCherenkovSegmented) {
298-
if (baseParam.isSymmetric) {
299-
vFD3_CherA = buildModuleCherenkov_v1();
300-
} else {
301-
vFD3_CherA = buildModuleCherenkov_v2();
302-
}
303-
vFD3_CherC = buildModuleCherenkov_v1();
278+
if (baseParam.isSymmetric) {
279+
vFD3_ScintA = buildModuleScint(Constants::etaMin, Constants::etaMax);
280+
vFD3_CherA = buildModuleCherenkov_v1();
304281
} else {
305-
vFD3_CherA = buildModuleCherenkov_v0(mEtaMaxCherA, mEtaMaxCherA, mZCher);
306-
vFD3_CherC = buildModuleCherenkov_v0(mEtaMinCherC, mEtaMaxCherC, -mZCher);
282+
vFD3_ScintA = buildModuleScint(Constants::etaMin, Constants::etaMax2);
283+
vFD3_CherA = buildModuleCherenkov_v2();
307284
}
308285

286+
vFD3_ScintC = buildModuleScint(Constants::etaMin, Constants::etaMax);
287+
vFD3_CherC = buildModuleCherenkov_v1();
288+
289+
vFD3_ScintA->SetName("FD3_ScintA");
290+
vFD3_ScintC->SetName("FD3_ScintC");
309291
vFD3_CherA->SetName("FD3_CherA");
310292
vFD3_CherC->SetName("FD3_CherC");
311293

312-
topVolume->AddNode(vFD3_ScintA, 1, new TGeoTranslation(0., 30.f, mZScint));
313-
topVolume->AddNode(vFD3_ScintC, 1, new TGeoTranslation(0., 30.f, -mZScint));
294+
topVolume->AddNode(vFD3_ScintA, 1, new TGeoTranslation(0., 30.f, Constants::zScint));
295+
topVolume->AddNode(vFD3_ScintC, 1, new TGeoTranslation(0., 30.f, -Constants::zScint));
314296

315-
topVolume->AddNode(vFD3_CherA, 1, new TGeoTranslation(0., 30.f, mZCher));
316-
topVolume->AddNode(vFD3_CherC, 1, new TGeoTranslation(0., 30.f, -mZCher));
297+
topVolume->AddNode(vFD3_CherA, 1, new TGeoTranslation(0., 30.f, Constants::zCher));
298+
topVolume->AddNode(vFD3_CherC, 1, new TGeoTranslation(0., 30.f, -Constants::zCher));
317299
}
318300

319-
TGeoVolumeAssembly* Detector::buildModuleScintA()
301+
TGeoVolumeAssembly* Detector::buildModuleScint(float etaMin, float etaMax)
320302
{
321-
auto mod = new TGeoVolumeAssembly("FD3_ScintA");
303+
auto mod = new TGeoVolumeAssembly("FD3_Scint");
322304

323305
const TGeoMedium* medium = gGeoManager->GetMedium("FD3_Scintillator");
324306

325-
float dphiDeg = 360. / mNumberOfSectors;
326-
327-
for (int ir = 0; ir < mNumberOfRingsScint; ir++) {
328-
std::string rName = "fd3_ring" + std::to_string(ir + 1);
329-
float etaMin = mEtaMaxScintA - (ir + 1) * (mEtaMaxScintA - mEtaMinScintA) / mNumberOfRingsScint;
330-
float etaMax = mEtaMaxScintA - ir * (mEtaMaxScintA - mEtaMinScintA) / mNumberOfRingsScint;
331-
float zmod = mZScint;
332-
float rmin = getRingSize(zmod, etaMax), rmax = getRingSize(zmod, etaMin);
333-
LOG(info) << "Scintillator ring" << ir << ": from " << rmin << " to " << rmax;
334-
for (int ic = 0; ic < mNumberOfSectors; ic++) {
335-
int cellId = mChannelCounter++; // ic + mNumberOfSectors * ir;
336-
std::string nodeName = "fd3_node" + std::to_string(cellId);
337-
float phimin = dphiDeg * ic;
338-
float phimax = dphiDeg * (ic + 1);
339-
auto tbs = new TGeoTubeSeg("tbs", rmin, rmax, mDzScint / 2, phimin, phimax);
340-
auto node = new TGeoVolume(nodeName.c_str(), tbs, medium);
341-
node->SetLineColor((ir + ic) % 2 == 0 ? kRed : kRed - 7);
342-
mod->AddNode(node, 1);
343-
}
344-
}
345-
346-
return mod;
347-
}
307+
int nrings = Constants::nRingsScint, nsect = Constants::nSectScint;
308+
float zmod = Constants::zScint, dz = Constants::dzScint;
348309

349-
TGeoVolumeAssembly* Detector::buildModuleScintC()
350-
{
351-
auto mod = new TGeoVolumeAssembly("FD3_ScintC");
352-
353-
const TGeoMedium* medium = gGeoManager->GetMedium("FD3_Scintillator");
354-
355-
float dphiDeg = 360. / mNumberOfSectors;
356-
357-
for (int ir = 0; ir < mNumberOfRingsScint; ir++) {
358-
std::string rName = "fd3_ring" + std::to_string(ir + 1 + mNumberOfRingsScint);
359-
float etaMin = mEtaMinScintC + ir * (mEtaMaxScintC - mEtaMinScintC) / mNumberOfRingsScint;
360-
float etaMax = mEtaMinScintC + (ir + 1) * (mEtaMaxScintC - mEtaMinScintC) / mNumberOfRingsScint;
361-
float zmod = -mZScint;
362-
float rmin = getRingSize(zmod, etaMin), rmax = getRingSize(zmod, etaMax);
363-
LOG(info) << "Scintillator ring" << ir + mNumberOfRingsScint << ": from " << rmin << " to " << rmax;
364-
for (int ic = 0; ic < mNumberOfSectors; ic++) {
365-
int cellId = mChannelCounter++; // ic + mNumberOfSectors * (ir + mNumberOfRingsScint);
310+
for (int ir = 0; ir < nrings; ir++) {
311+
float eta1 = etaMax - ir * (etaMax - etaMin) / nrings;
312+
float eta2 = etaMax - (ir + 1) * (etaMax - etaMin) / nrings;
313+
float r1 = getRingSize(zmod, eta1), r2 = getRingSize(zmod, eta2);
314+
LOG(info) << "Scintillator ring " << ir + 1 << ": from " << r1 << " to " << r2;
315+
for (int ic = 0; ic < nsect; ic++) {
316+
int cellId = mChannelCounter++;
366317
std::string nodeName = "fd3_node" + std::to_string(cellId);
367-
float phimin = dphiDeg * ic;
368-
float phimax = dphiDeg * (ic + 1);
369-
auto tbs = new TGeoTubeSeg("tbs", rmin, rmax, mDzScint / 2, phimin, phimax);
318+
float phi1 = ic * 360. / nsect;
319+
float phi2 = (ic + 1) * 360. / nsect;
320+
auto tbs = new TGeoTubeSeg("tbs", r1, r2, dz / 2, phi1, phi2);
370321
auto node = new TGeoVolume(nodeName.c_str(), tbs, medium);
371-
node->SetLineColor((ir + ic) % 2 == 0 ? kBlue : kBlue - 7);
322+
if (cellId < nrings * nsect) {
323+
node->SetLineColor((ir + ic) % 2 == 0 ? kRed : kRed - 7);
324+
} else {
325+
node->SetLineColor((ir + ic) % 2 == 0 ? kBlue : kBlue - 7);
326+
}
372327
mod->AddNode(node, 1);
373328
}
374329
}
375330

376331
return mod;
377332
}
378333

379-
TGeoVolumeAssembly* Detector::buildModuleCherenkov_v0(float etaMin, float etaMax, float zmod)
380-
{
381-
auto mod = new TGeoVolumeAssembly("");
382-
383-
const TGeoMedium* medium = gGeoManager->GetMedium("FD3_Glass");
384-
385-
float rmin, rmax;
386-
if (zmod >= 0) {
387-
rmin = getRingSize(zmod, etaMin);
388-
rmax = getRingSize(zmod, etaMax);
389-
} else {
390-
rmin = getRingSize(zmod, etaMin);
391-
rmax = getRingSize(zmod, etaMax);
392-
}
393-
394-
int cellId = mChannelCounter++;
395-
std::string nodeName = "fd3_node" + std::to_string(cellId);
396-
397-
auto tbs = new TGeoTubeSeg("tbs", rmin, rmax, mDzScint / 2, 0, 360);
398-
auto node = new TGeoVolume(nodeName.c_str(), tbs, medium);
399-
node->SetLineColor(zmod > 0 ? kOrange : kMagenta);
400-
mod->AddNode(node, 1);
401-
402-
return mod;
403-
}
404-
405334
TGeoVolumeAssembly* Detector::buildModuleCherenkov_v1()
406335
{
407336
auto mod = new TGeoVolumeAssembly("FD3_Ch");
408337

409338
TGeoMedium* medium = gGeoManager->GetMedium("FD3_Glass");
410339

411-
double rsizeq = Constants::rsizeq;
340+
float rsizeq = Constants::rsizeq, dz = Constants::dzCher;
412341

413342
const int N = 68;
414343

@@ -429,7 +358,7 @@ TGeoVolumeAssembly* Detector::buildModuleCherenkov_v1()
429358
for (int i = 0; i < N; i++) {
430359
int cellId = mChannelCounter++;
431360
std::string nodeName = "fd3_node" + std::to_string(cellId);
432-
auto box = new TGeoBBox(rsizeq - 0.05, rsizeq - 0.05, mDzCher / 2);
361+
auto box = new TGeoBBox(rsizeq - 0.05, rsizeq - 0.05, dz / 2);
433362
auto node = new TGeoVolume(nodeName.c_str(), box, medium);
434363
node->SetLineColor(kOrange + 7);
435364
mod->AddNode(node, 1, new TGeoTranslation(x[i], y[i], 0));
@@ -444,7 +373,7 @@ TGeoVolumeAssembly* Detector::buildModuleCherenkov_v2()
444373

445374
TGeoMedium* medium = gGeoManager->GetMedium("FD3_Glass");
446375

447-
double rsizeq = Constants::rsizeq;
376+
float rsizeq = Constants::rsizeq, dz = Constants::dzCher;
448377

449378
const int N = 68;
450379

@@ -465,7 +394,7 @@ TGeoVolumeAssembly* Detector::buildModuleCherenkov_v2()
465394
for (int i = 0; i < N; i++) {
466395
int cellId = mChannelCounter++;
467396
std::string nodeName = "fd3_node" + std::to_string(cellId);
468-
auto box = new TGeoBBox(rsizeq - 0.05, rsizeq - 0.05, mDzCher / 2);
397+
auto box = new TGeoBBox(rsizeq - 0.05, rsizeq - 0.05, dz / 2);
469398
auto node = new TGeoVolume(nodeName.c_str(), box, medium);
470399
node->SetLineColor(kOrange + 7);
471400
mod->AddNode(node, 1, new TGeoTranslation(x[i], y[i], 0));

0 commit comments

Comments
 (0)