Skip to content

Commit ce021d3

Browse files
committed
UpdateFT3
1 parent 975d5ba commit ce021d3

File tree

4 files changed

+50
-170
lines changed

4 files changed

+50
-170
lines changed

Detectors/Upgrades/ALICE3/FT3/base/include/FT3Base/FT3BaseParam.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,6 @@ struct FT3BaseParam : public o2::conf::ConfigurableParamHelper<FT3BaseParam> {
4242
Float_t etaOut = 1.5;
4343
Float_t Layerx2X0 = 0.01;
4444

45-
// FT3Geometry::External file
46-
std::string configFile = ""; // Overrides geoModel parameter when provided
47-
4845
O2ParamDef(FT3BaseParam, "FT3Base");
4946
};
5047

Detectors/Upgrades/ALICE3/FT3/simulation/include/FT3Simulation/Detector.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,6 @@ class Detector : public o2::base::DetImpl<Detector>
109109
void buildFT3Scoping();
110110
void buildFT3NewVacuumVessel();
111111
void buildFT3ScopingV3();
112-
void buildFT3FromFile(std::string);
113-
114-
void exportLayout();
115112

116113
protected:
117114
std::vector<Int_t> mLayerID;

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

Lines changed: 39 additions & 152 deletions
Original file line numberDiff line numberDiff line change
@@ -59,88 +59,6 @@ Detector::Detector()
5959
{
6060
}
6161

62-
//_________________________________________________________________________________________________
63-
void Detector::buildFT3FromFile(std::string configFileName)
64-
{
65-
// Geometry description from file. One line per disk
66-
// z_layer r_in r_out Layerx2X0
67-
// This simple file reader is not failproof. Do not add empty lines!
68-
69-
/*
70-
# Sample FT3 configuration
71-
# z_layer r_in r_out Layerx2X0
72-
-45.3 2.5 9.26 0.0042
73-
-46.7 2.5 9.26 0.0042
74-
-48.6 2.5 9.8 0.0042
75-
-50.0 2.5 9.8 0.0042
76-
-52.4 2.5 10.43 0.0042
77-
-53.8 2.5 10.43 0.0042
78-
-67.7 3.82 13.01 0.0042
79-
-69.1 3.82 13.01 0.0042
80-
-76.1 3.92 14.35 0.0042
81-
-77.5 3.92 14.35 0.0042
82-
*/
83-
84-
mLayerID.clear();
85-
86-
LOG(info) << "Building FT3 Detector: From file";
87-
LOG(info) << " FT3 detector configuration: " << configFileName;
88-
std::ifstream ifs(configFileName.c_str());
89-
if (!ifs.good()) {
90-
LOG(fatal) << " Invalid FT3Base.configFile!";
91-
}
92-
std::string tempstr;
93-
float z_layer, r_in, r_out, Layerx2X0;
94-
char delimiter;
95-
int layerNumber = 0;
96-
while (std::getline(ifs, tempstr)) {
97-
if (tempstr[0] == '#') {
98-
LOG(info) << " Comment: " << tempstr;
99-
continue;
100-
}
101-
std::istringstream iss(tempstr);
102-
iss >> z_layer;
103-
iss >> r_in;
104-
iss >> r_out;
105-
iss >> Layerx2X0;
106-
107-
const int direction = z_layer < 0 ? IdxBackwardDisks : IdxForwardDisks;
108-
std::string directionName = std::to_string(direction);
109-
std::string layerName = GeometryTGeo::getFT3LayerPattern() + directionName + std::string("_") + std::to_string(layerNumber);
110-
mLayerName[direction].push_back(layerName);
111-
LOG(info) << "Adding Layer " << layerName << " at z = " << z_layer << " ; direction = " << direction << " ; r_in = " << r_in << " ; r_out = " << r_out << " x/X0 = " << Layerx2X0;
112-
const bool isMiddleLayer = layerNumber < 3;
113-
auto& thisLayer = mLayers[direction].emplace_back(direction, layerNumber, layerName, z_layer, r_in, r_out, Layerx2X0, isMiddleLayer);
114-
layerNumber++;
115-
}
116-
117-
LOG(info) << " Loaded FT3 Detector with " << layerNumber << " layers";
118-
}
119-
120-
//_________________________________________________________________________________________________
121-
void Detector::exportLayout()
122-
{
123-
// Export FT3 Layout description to file.
124-
// One line per disk:
125-
// z_layer r_in r_out Layerx2X0
126-
127-
std::string configFileName = "FT3_layout.cfg";
128-
129-
LOG(info) << "Exporting FT3 Detector layout to " << configFileName;
130-
131-
std::ofstream fOut(configFileName.c_str(), std::ios::out);
132-
if (!fOut) {
133-
printf("Cannot open file\n");
134-
return;
135-
}
136-
fOut << "# z_layer r_in r_out Layerx2X0" << std::endl;
137-
for (auto layers_dir : mLayers) {
138-
for (auto layer : layers_dir) {
139-
fOut << layer.getZ() << " " << layer.getInnerRadius() << " " << layer.getOuterRadius() << " " << layer.getx2X0() << std::endl;
140-
}
141-
}
142-
}
143-
14462
//_________________________________________________________________________________________________
14563
void Detector::buildBasicFT3(const FT3BaseParam& param)
14664
{
@@ -360,13 +278,17 @@ void Detector::buildFT3ScopingV3()
360278
LayerConfig{150., 20.0, 68.f, layersx2X0},
361279
LayerConfig{180., 20.0, 68.f, layersx2X0},
362280
LayerConfig{220., 20.0, 68.f, layersx2X0}};
281+
const std::array<bool, numberOfLayers> enabled{true, true, true, true, true, true}; // To enable or disable layers for debug purpose
363282

364283
mLayerID.clear();
365284

366285
for (int direction : {IdxBackwardDisks, IdxForwardDisks}) {
367286
mLayerName[direction].clear();
368287
const std::array<LayerConfig, numberOfLayers>& layerConfig = (direction == IdxBackwardDisks) ? layersConfigCSide : layersConfigASide;
369288
for (int layerNumber = 0; layerNumber < numberOfLayers; layerNumber++) {
289+
if (!enabled[layerNumber]) {
290+
continue;
291+
}
370292
const std::string directionName = std::to_string(direction);
371293
const std::string layerName = GeometryTGeo::getFT3LayerPattern() + directionName + std::string("_") + std::to_string(layerNumber);
372294
mLayerName[direction].push_back(layerName.c_str());
@@ -438,24 +360,17 @@ Detector::Detector(bool active)
438360
// FT3 Base configuration parameters
439361
auto& ft3BaseParam = FT3BaseParam::Instance();
440362

441-
if (ft3BaseParam.configFile != "") {
442-
LOG(info) << "FT3 Geometry configuration file provided. Overriding FT3Base.geoModel configuration.";
443-
buildFT3FromFile(ft3BaseParam.configFile);
444-
445-
} else {
446-
switch (ft3BaseParam.geoModel) {
447-
case Default:
448-
buildFT3ScopingV3(); // v3 Dec 25
449-
break;
450-
case Telescope:
451-
buildBasicFT3(ft3BaseParam); // BasicFT3 = Parametrized telescopic detector (equidistant layers)
452-
break;
453-
default:
454-
LOG(fatal) << "Invalid Geometry.\n";
455-
break;
456-
}
363+
switch (ft3BaseParam.geoModel) {
364+
case Default:
365+
buildFT3ScopingV3(); // v3 Dec 25
366+
break;
367+
case Telescope:
368+
buildBasicFT3(ft3BaseParam); // BasicFT3 = Parametrized telescopic detector (equidistant layers)
369+
break;
370+
default:
371+
LOG(fatal) << "Invalid Geometry.\n";
372+
break;
457373
}
458-
exportLayout();
459374
}
460375

461376
//_________________________________________________________________________________________________
@@ -679,67 +594,39 @@ void Detector::createGeometry()
679594
}
680595

681596
// This will need to adapt to the new scheme
682-
if (mLayers.size() == 2) { // V1 and telescope
683-
if (!A3IPvac) {
684-
for (int direction : {IdxBackwardDisks, IdxForwardDisks}) { // Backward layers at mLayers[0]; Forward layers at mLayers[1]
685-
const std::string directionString = direction ? "Forward" : "Backward";
686-
LOG(info) << " Creating FT3 without beampipe " << directionString << " layers:";
687-
for (int iLayer = 0; iLayer < mLayers[direction].size(); iLayer++) {
688-
mLayers[direction][iLayer].createLayer(volFT3);
689-
}
690-
}
691-
vALIC->AddNode(volFT3, 2, new TGeoTranslation(0., 30., 0.));
692-
} else { // If beampipe is enabled append inner disks to beampipe filling volume, this should be temporary.
693-
for (int direction : {IdxBackwardDisks, IdxForwardDisks}) {
694-
const std::string directionString = direction ? "Forward" : "Backward";
695-
LOG(info) << " Creating FT3 " << directionString << " layers:";
696-
for (int iLayer = 0; iLayer < mLayers[direction].size(); iLayer++) {
697-
LOG(info) << " Creating " << directionString << " layer " << iLayer;
698-
if (mLayers[direction][iLayer].getIsInMiddleLayer()) { // ML disks
699-
mLayers[direction][iLayer].createLayer(volIFT3);
700-
} else {
701-
mLayers[direction][iLayer].createLayer(volFT3);
702-
}
703-
}
704-
}
705-
A3IPvac->AddNode(volIFT3, 2, new TGeoTranslation(0., 0., 0.));
706-
vALIC->AddNode(volFT3, 2, new TGeoTranslation(0., 30., 0.));
707-
}
708-
709-
for (auto direction : {IdxBackwardDisks, IdxForwardDisks}) {
710-
std::string directionString = direction ? "Forward" : "Backward";
711-
LOG(info) << " Registering FT3 " << directionString << " LayerIDs for " << mLayers[direction].size() << " layers:";
597+
if (!A3IPvac) {
598+
for (int direction : {IdxBackwardDisks, IdxForwardDisks}) { // Backward layers at mLayers[0]; Forward layers at mLayers[1]
599+
const std::string directionString = direction ? "Forward" : "Backward";
600+
LOG(info) << " Creating FT3 without beampipe " << directionString << " layers:";
712601
for (int iLayer = 0; iLayer < mLayers[direction].size(); iLayer++) {
713-
auto layerID = gMC ? TVirtualMC::GetMC()->VolId(Form("%s_%d_%d", GeometryTGeo::getFT3SensorPattern(), direction, iLayer)) : 0;
714-
mLayerID.push_back(layerID);
715-
LOG(info) << " " << directionString << " layer " << iLayer << " LayerID " << layerID;
602+
mLayers[direction][iLayer].createLayer(volFT3);
716603
}
717604
}
718-
}
719-
720-
if (mLayers.size() == 1) { // All layers registered at mLayers[0], used when building from file
721-
LOG(info) << " Creating FT3 layers:";
722-
if (A3IPvac) {
723-
for (int iLayer = 0; iLayer < mLayers[0].size(); iLayer++) {
724-
if (std::abs(mLayers[0][iLayer].getZ()) < 25) {
725-
mLayers[0][iLayer].createLayer(volIFT3);
605+
vALIC->AddNode(volFT3, 2, new TGeoTranslation(0., 30., 0.));
606+
} else { // If beampipe is enabled append inner disks to beampipe filling volume, this should be temporary.
607+
for (int direction : {IdxBackwardDisks, IdxForwardDisks}) {
608+
const std::string directionString = direction ? "Forward" : "Backward";
609+
LOG(info) << " Creating FT3 " << directionString << " layers:";
610+
for (int iLayer = 0; iLayer < mLayers[direction].size(); iLayer++) {
611+
LOG(info) << " Creating " << directionString << " layer " << iLayer;
612+
if (mLayers[direction][iLayer].getIsInMiddleLayer()) { // ML disks
613+
mLayers[direction][iLayer].createLayer(volIFT3);
726614
} else {
727-
mLayers[0][iLayer].createLayer(volFT3);
615+
mLayers[direction][iLayer].createLayer(volFT3);
728616
}
729617
}
730-
A3IPvac->AddNode(volIFT3, 2, new TGeoTranslation(0., 0., 0.));
731-
vALIC->AddNode(volFT3, 2, new TGeoTranslation(0., 30., 0.));
732-
} else {
733-
for (int iLayer = 0; iLayer < mLayers[0].size(); iLayer++) {
734-
mLayers[0][iLayer].createLayer(volFT3);
735-
}
736-
vALIC->AddNode(volFT3, 2, new TGeoTranslation(0., 30., 0.));
737618
}
738-
LOG(info) << " Registering FT3 LayerIDs:";
739-
for (int iLayer = 0; iLayer < mLayers[0].size(); iLayer++) {
740-
auto layerID = gMC ? TVirtualMC::GetMC()->VolId(Form("%s_%d_%d", GeometryTGeo::getFT3SensorPattern(), 0, iLayer)) : 0;
619+
A3IPvac->AddNode(volIFT3, 2, new TGeoTranslation(0., 0., 0.));
620+
vALIC->AddNode(volFT3, 2, new TGeoTranslation(0., 30., 0.));
621+
}
622+
623+
for (auto direction : {IdxBackwardDisks, IdxForwardDisks}) {
624+
std::string directionString = direction ? "Forward" : "Backward";
625+
LOG(info) << " Registering FT3 " << directionString << " LayerIDs for " << mLayers[direction].size() << " layers:";
626+
for (int iLayer = 0; iLayer < mLayers[direction].size(); iLayer++) {
627+
auto layerID = gMC ? TVirtualMC::GetMC()->VolId(Form("%s_%d_%d", GeometryTGeo::getFT3SensorPattern(), direction, iLayer)) : 0;
741628
mLayerID.push_back(layerID);
742-
LOG(info) << " mLayerID[" << iLayer << "] = " << layerID;
629+
LOG(info) << " " << directionString << " layer " << iLayer << " LayerID " << layerID;
743630
}
744631
}
745632
}

Detectors/Upgrades/ALICE3/FT3/simulation/src/FT3Layer.cxx

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@ void FT3Layer::createSeparationLayer_waterCooling(TGeoVolume* motherVolume, cons
118118

119119
FT3Layer::initialize_mat();
120120

121-
double carbonFiberThickness = 0.01;
122-
double foamSpacingThickness = 0.5;
121+
const double carbonFiberThickness = 0.01; // cm
122+
const double foamSpacingThickness = 0.5; // cm
123123

124124
TGeoTube* carbonFiberLayer = new TGeoTube(mInnerRadius, mOuterRadius, carbonFiberThickness / 2);
125125

@@ -130,15 +130,15 @@ void FT3Layer::createSeparationLayer_waterCooling(TGeoVolume* motherVolume, cons
130130
carbonFiberLayerVol1->SetLineColor(kGray + 2);
131131
carbonFiberLayerVol2->SetLineColor(kGray + 2);
132132

133-
double zSeparation = foamSpacingThickness / 2.0 + carbonFiberThickness / 2.0;
133+
const double zSeparation = foamSpacingThickness / 2.0 + carbonFiberThickness / 2.0;
134134

135135
motherVolume->AddNode(carbonFiberLayerVol1, 1, new TGeoTranslation(0, 0, mZ - zSeparation));
136136
motherVolume->AddNode(carbonFiberLayerVol2, 1, new TGeoTranslation(0, 0, mZ + zSeparation));
137137

138-
double pipeOuterRadius = 0.20;
139-
double kaptonThickness = 0.0025;
140-
double pipeInnerRadius = pipeOuterRadius - kaptonThickness;
141-
double pipeMaxLength = mOuterRadius * 2.0;
138+
const double pipeOuterRadius = 0.20;
139+
const double kaptonThickness = 0.0025;
140+
const double pipeInnerRadius = pipeOuterRadius - kaptonThickness;
141+
const double pipeMaxLength = mOuterRadius * 2.0;
142142

143143
int name_it = 0;
144144

@@ -207,8 +207,8 @@ void FT3Layer::createSeparationLayer(TGeoVolume* motherVolume, const std::string
207207

208208
FT3Layer::initialize_mat();
209209

210-
double carbonFiberThickness = 0.01;
211-
double foamSpacingThickness = 1.0;
210+
constexpr double carbonFiberThickness = 0.01; // cm
211+
constexpr double foamSpacingThickness = 1.0; // cm
212212

213213
TGeoTube* carbonFiberLayer = new TGeoTube(mInnerRadius, mOuterRadius, carbonFiberThickness / 2);
214214
TGeoTube* foamLayer = new TGeoTube(mInnerRadius, mOuterRadius, foamSpacingThickness / 2);
@@ -223,7 +223,7 @@ void FT3Layer::createSeparationLayer(TGeoVolume* motherVolume, const std::string
223223
foamLayerVol->SetFillColorAlpha(kBlack, 1.0);
224224
carbonFiberLayerVol2->SetLineColor(kGray + 2);
225225

226-
double zSeparation = foamSpacingThickness / 2.0 + carbonFiberThickness / 2.0;
226+
const double zSeparation = foamSpacingThickness / 2.0 + carbonFiberThickness / 2.0;
227227

228228
motherVolume->AddNode(carbonFiberLayerVol1, 1, new TGeoTranslation(0, 0, 0 - zSeparation));
229229
motherVolume->AddNode(foamLayerVol, 1, new TGeoTranslation(0, 0, 0));
@@ -276,10 +276,9 @@ void FT3Layer::createLayer(TGeoVolume* motherVolume)
276276
std::string separationLayerName = "FT3SeparationLayer" + std::to_string(mDirection) + std::to_string(mLayerNumber);
277277

278278
TGeoMedium* medAir = gGeoManager->GetMedium("FT3_AIR$");
279-
TGeoTube* layer = new TGeoTube(mInnerRadius, mOuterRadius, mChipThickness / 2);
279+
TGeoTube* layer = new TGeoTube(mInnerRadius, mOuterRadius, 10 * mChipThickness / 2);
280280
TGeoVolume* layerVol = new TGeoVolume(mLayerName.c_str(), layer, medAir);
281281
layerVol->SetLineColor(kYellow + 2);
282-
layerVol->SetTransparency(70);
283282

284283
// createSeparationLayer_waterCooling(motherVolume, separationLayerName);
285284
createSeparationLayer(layerVol, separationLayerName);

0 commit comments

Comments
 (0)