Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ void Detector::createGeometry()
TGeoTube* ecalShape = new TGeoTube("ECLsh", mInnerRadius, mOuterRadius, mLength);
TGeoVolume* ecalVol = new TGeoVolume("ECL", ecalShape, medPb);
ecalVol->SetLineColor(kCyan + 1);
ecalVol->SetTransparency(50);
ecalVol->SetTransparency(0);
vECal->AddNode(ecalVol, 1, nullptr);
}

Expand Down
4 changes: 2 additions & 2 deletions Detectors/Upgrades/ALICE3/IOTOF/simulation/src/Detector.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ void Detector::configLayers(bool itof, bool otof, bool ftof, bool btof)
mOTOFLayer = OTOFLayer(std::string{GeometryTGeo::getOTOFLayerPattern()}, 85.f, 0.f, 680.f, 0.f, 0.02f, true); // oTOF
}
if (ftof) {
mFTOFLayer = FTOFLayer(std::string{GeometryTGeo::getFTOFLayerPattern()}, 15.f, 150.f, 0.f, 405.f, 0.02f, false); // fTOF
mFTOFLayer = FTOFLayer(std::string{GeometryTGeo::getFTOFLayerPattern()}, 15.f, 100.f, 0.f, 370.f, 0.02f, false); // fTOF
}
if (btof) {
mBTOFLayer = BTOFLayer(std::string{GeometryTGeo::getBTOFLayerPattern()}, 15.f, 150.f, 0.f, -405.f, 0.02f, false); // bTOF
mBTOFLayer = BTOFLayer(std::string{GeometryTGeo::getBTOFLayerPattern()}, 15.f, 100.f, 0.f, -370.f, 0.02f, false); // bTOF
}
}

Expand Down
26 changes: 6 additions & 20 deletions Detectors/Upgrades/ALICE3/MID/simulation/src/MIDLayer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,7 @@ MIDLayer::Stave::Module::Sensor::Sensor(std::string sensorName,
void MIDLayer::createLayer(TGeoVolume* motherVolume)
{
LOGP(debug, "Creating MIDLayer: {}", mName);
TGeoTube* layer = new TGeoTube(mName.c_str(), mRadius, mRadius + 10, mLength);
auto* airMed = gGeoManager->GetMedium("MI3_AIR");
TGeoVolume* layerVolume = new TGeoVolume(mName.c_str(), layer, airMed);
layerVolume->SetVisibility(true);
layerVolume->SetTransparency(0);
TGeoVolumeAssembly* layerVolume = new TGeoVolumeAssembly(mName.c_str());
motherVolume->AddNode(layerVolume, 0);
for (auto& stave : mStaves) {
stave.createStave(layerVolume);
Expand All @@ -151,11 +147,7 @@ void MIDLayer::createLayer(TGeoVolume* motherVolume)
void MIDLayer::Stave::createStave(TGeoVolume* motherVolume)
{
LOGP(debug, "\tCreating MIDStave: {} layer: {}", mName, mLayer);
TGeoBBox* stave = new TGeoBBox(mName.c_str(), mWidth, mThickness, mLength);
auto* airMed = gGeoManager->GetMedium("MI3_AIR");
TGeoVolume* staveVolume = new TGeoVolume(mName.c_str(), stave, airMed);
staveVolume->SetVisibility(true);
staveVolume->SetTransparency(0);
TGeoVolumeAssembly* staveVolume = new TGeoVolumeAssembly(mName.c_str());
// Create the modules
for (auto& module : mModules) {
module.createModule(staveVolume);
Expand All @@ -173,16 +165,8 @@ void MIDLayer::Stave::Module::createModule(TGeoVolume* motherVolume)
// Module is an air box with floating bars inside for the moment
auto sumWidth = ((mBarWidth * 2 + mBarSpacing) * mNBars) / 2;
LOGP(debug, "\t\t\tCreating MIDModule: {} with ", mName);
TGeoBBox* module = nullptr;
if (!mLayer) {
module = new TGeoBBox(mName.c_str(), sumWidth, mBarThickness, mBarLength);
} else {
module = new TGeoBBox(mName.c_str(), mBarLength, mBarThickness, sumWidth);
}
auto* airMed = gGeoManager->GetMedium("MI3_AIR");
TGeoVolume* moduleVolume = new TGeoVolume(mName.c_str(), module, airMed);
moduleVolume->SetVisibility(true);
moduleVolume->SetTransparency(0);
TGeoVolumeAssembly* moduleVolume = new TGeoVolumeAssembly(mName.c_str() /*, module, airMed*/);

// Create the bars
for (auto& sensor : mSensors) {
sensor.createSensor(moduleVolume);
Expand Down Expand Up @@ -213,9 +197,11 @@ void MIDLayer::Stave::Module::Sensor::createSensor(TGeoVolume* motherVolume)
if (!mLayer) {
sensorTrans = new TGeoTranslation(mModuleOffset + 2 * totWidth * mNumber + totWidth, 0, 0);
sensorVolume->SetLineColor(kBlue);
sensorVolume->SetTransparency(50);
} else {
sensorTrans = new TGeoTranslation(0, 0, mModuleOffset + 2 * totWidth * mNumber + totWidth);
sensorVolume->SetLineColor(kPink);
sensorVolume->SetTransparency(50);
}
motherVolume->AddNode(sensorVolume, 0, sensorTrans);
}
Expand Down
2 changes: 1 addition & 1 deletion Detectors/Upgrades/ALICE3/Passive/src/Absorber.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ void Alice3Absorber::ConstructGeometry()
TGeoVolume* abso = new TGeoVolume("Absorber", absorings, kMedIron);

abso->SetVisibility(1);
abso->SetLineColor(kGray);
abso->SetLineColor(kBlack);

//
// Adding volumes to mother volume
Expand Down
8 changes: 3 additions & 5 deletions Detectors/Upgrades/ALICE3/Passive/src/Magnet.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,10 @@ void Alice3Magnet::ConstructGeometry()
TGeoVolume* outerWrapVol = new TGeoVolume("outerWrap", outerLayer, kMedAl);

innerWrapVol->SetLineColor(kRed);
innerVacuumVol->SetLineColor(kGray);
innerVacuumVol->SetVisibility(1);
coilsVol->SetLineColor(kOrange);
innerVacuumVol->SetLineColor(kRed);
coilsVol->SetLineColor(kRed);
restMaterialVol->SetLineColor(kRed);
outerVacuumVol->SetLineColor(kGray);
outerVacuumVol->SetVisibility(1);
outerVacuumVol->SetLineColor(kRed);
outerWrapVol->SetLineColor(kRed);

new TGeoVolumeAssembly("magnet");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ class GeometryTGeo : public o2::detectors::DetMatrixCache
static const char* getRICHRingPattern() { return sRingName.c_str(); }
static const char* getRICHChipPattern() { return sChipName.c_str(); }
static const char* getRICHSensorPattern() { return sSensorName.c_str(); }
static const char* getRICHSensorFWDPattern() { return sSensorFWDName.c_str(); }
static const char* getRICHSensorBWDPattern() { return sSensorBWDName.c_str(); }

static const char* composeSymNameRICH(int d)
{
Expand All @@ -38,12 +40,16 @@ class GeometryTGeo : public o2::detectors::DetMatrixCache
static const char* composeSymNameRing(int d, int ring);
static const char* composeSymNameChip(int d, int ring);
static const char* composeSymNameSensor(int d, int ring);
static const char* composeSymNameSensorFWD(int d);
static const char* composeSymNameSensorBWD(int d);

protected:
static std::string sVolumeName;
static std::string sRingName;
static std::string sChipName;
static std::string sSensorName;
static std::string sSensorFWDName;
static std::string sSensorBWDName;

private:
static std::unique_ptr<o2::rich::GeometryTGeo> sInstance;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,28 @@ struct RICHBaseParam : public o2::conf::ConfigurableParamHelper<RICHBaseParam> {
float radiatorThickness = 2.0; // cm
float detectorThickness = 0.2; // cm
float zRichLength = 700.0; // cm
int nRings = 21;
int nRings = 25;
int nTiles = 36;
std::string configFile = "";
bool oddGeom = false;

// FWD and BWD RICH
bool enableFWDRich = true;
bool enableBWDRich = true;

float rFWDMin = 13.7413f;
float rFWDMax = 103.947f;

// Aerogel:
float zAerogelMin = 375.f;
float zAerogelMax = 377.f;

// Argon:
float zArgonMin = 377.f;
float zArgonMax = 407.f;

// Detector:
float zSiliconMin = 407.f;
float zSiliconMax = 407.2f;

O2ParamDef(RICHBaseParam, "RICHBase");
};
Expand Down
12 changes: 12 additions & 0 deletions Detectors/Upgrades/ALICE3/RICH/base/src/GeometryTGeo.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ std::string GeometryTGeo::sVolumeName = "RICHV";
std::string GeometryTGeo::sRingName = "RICHRing";
std::string GeometryTGeo::sChipName = "RICHChip";
std::string GeometryTGeo::sSensorName = "RICHSensor";
std::string GeometryTGeo::sSensorFWDName = "FWDRICHSensor"; // only one big sensor for now
std::string GeometryTGeo::sSensorBWDName = "BWDRICHSensor"; // only one big sensor for now

GeometryTGeo::GeometryTGeo(bool build, int loadTrans) : DetMatrixCache()
{
Expand Down Expand Up @@ -74,5 +76,15 @@ const char* GeometryTGeo::composeSymNameSensor(int d, int rg)
return Form("%s/%s%d", composeSymNameChip(d, rg), getRICHSensorPattern(), rg);
}

const char* GeometryTGeo::composeSymNameSensorFWD(int d)
{
return Form("%s/%s", composeSymNameRICH(d), getRICHSensorFWDPattern());
}

const char* GeometryTGeo::composeSymNameSensorBWD(int d)
{
return Form("%s/%s", composeSymNameRICH(d), getRICHSensorBWDPattern());
}

} // namespace rich
} // namespace o2
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,9 @@ class Detector : public o2::base::DetImpl<Detector>
return nullptr;
}

void configDefault();
void configFromFile(std::string fileName = "alice3_RICH_layout.txt");
void configToFile(std::string fileName = "alice3_RICH_layout.txt");

void createMaterials();
void createGeometry();
void prepareEvenLayout();
void prepareOddLayout();
void prepareLayout();
void createRings(TGeoVolume*);

private:
Expand Down Expand Up @@ -110,6 +105,11 @@ class Detector : public o2::base::DetImpl<Detector>
std::vector<double> mR0PhotoDet;
template <typename Det>
friend class o2::base::DetImpl;

// FWD and BWD RICH
FWDRich mFWDRich;
BWDRich mBWDRich;

ClassDefOverride(Detector, 1);
};
} // namespace rich
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,73 @@ class Ring
ClassDef(Ring, 0);
};

// Definitions for fwd and bwd RICH are put here
class FWDRich
{
public:
FWDRich() = default;
FWDRich(std::string name,
float rMin,
float rMax,
float zAerogelMin,
float dZAerogel,
float zArgonMin,
float dZArgon,
float zSiliconMin,
float dZSilicon);
void createFWDRich(TGeoVolume* motherVolume);

protected:
std::string mName;
float mRmin;
float mRmax;

// Aerogel:
float mZAerogelMin;
float mDZAerogel;

// Argon:
float mZArgonMin;
float mDZArgon;

// Silicon:
float mZSiliconMin;
float mDZSilicon;
};

class BWDRich
{
public:
BWDRich() = default;
BWDRich(std::string name,
float rMin,
float rMax,
float zAerogelMin,
float dZAerogel,
float zArgonMin,
float dZArgon,
float zSiliconMin,
float dZSilicon);
void createBWDRich(TGeoVolume* motherVolume);

protected:
std::string mName;
float mRmin;
float mRmax;

// Aerogel:
float mZAerogelMin;
float mDZAerogel;

// Argon:
float mZArgonMin;
float mDZArgon;

// Silicon:
float mZSiliconMin;
float mDZSilicon;
};

} // namespace rich
} // namespace o2
#endif // ALICEO2_RICH_RING_H
64 changes: 43 additions & 21 deletions Detectors/Upgrades/ALICE3/RICH/simulation/src/Detector.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -145,20 +145,12 @@ void Detector::createGeometry()
vRICH->SetTitle(vstrng);
auto& richPars = RICHBaseParam::Instance();

// TGeoTube* richVessel = new TGeoTube(richPars.rMin, richPars.rMax, richPars.zRichLength / 2.0);
// TGeoMedium* medArgon = gGeoManager->GetMedium("RCH_ARGON$");
// TGeoVolume* vRichVessel = new TGeoVolume(vstrng, richVessel, medArgon);
// vRichVessel->SetLineColor(kGray);
// vRichVessel->SetVisibility(kTRUE);
// vRichVessel->SetTransparency(75);
// vALIC->AddNode(vRichVessel, 1, new TGeoTranslation(0, 30., 0));

if (!(richPars.nRings % 2)) {
prepareEvenLayout();
} else {
prepareOddLayout();
}
prepareLayout();

for (int iRing{0}; iRing < richPars.nRings; ++iRing) {
if (!richPars.oddGeom && iRing == (richPars.nRings / 2)) {
continue;
}
mRings[iRing] = Ring{iRing,
richPars.nTiles,
richPars.rMin,
Expand All @@ -177,6 +169,13 @@ void Detector::createGeometry()
(float)mThetaBi[iRing],
GeometryTGeo::getRICHVolPattern()};
}

if (richPars.enableFWDRich) {
mFWDRich.createFWDRich(vRICH);
}
if (richPars.enableBWDRich) {
mBWDRich.createBWDRich(vRICH);
}
}

void Detector::InitializeO2Detector()
Expand Down Expand Up @@ -317,15 +316,12 @@ o2::itsmft::Hit* Detector::addHit(int trackID, int detID, const TVector3& startP
return &(mHits->back());
}

void Detector::prepareEvenLayout()
{
}

void Detector::prepareOddLayout()
void Detector::prepareLayout()
{ // Mere translation of Nicola's code
LOGP(info, "Setting up ODD layout for bRICH");
auto& richPars = RICHBaseParam::Instance();
LOGP(info, "Setting up {} layout for bRICH", richPars.oddGeom ? "odd" : "even");

bool isOdd = richPars.oddGeom;
mThetaBi.resize(richPars.nRings);
mR0Tilt.resize(richPars.nRings);
mZ0Tilt.resize(richPars.nRings);
Expand All @@ -346,9 +342,9 @@ void Detector::prepareOddLayout()
mThetaBi[richPars.nRings / 2] = TMath::ATan(mVal);
mR0Tilt[richPars.nRings / 2] = richPars.rMax;
mZ0Tilt[richPars.nRings / 2] = mR0Tilt[richPars.nRings / 2] * TMath::Tan(mThetaBi[richPars.nRings / 2]);
mLAerogelZ[richPars.nRings / 2] = TMath::Sqrt(1.0 + mVal * mVal) * richPars.rMin * richPars.zBaseSize / (TMath::Sqrt(1.0 + mVal * mVal) * richPars.rMax - mVal * richPars.zBaseSize);
mLAerogelZ[richPars.nRings / 2] = isOdd ? TMath::Sqrt(1.0 + mVal * mVal) * richPars.rMin * richPars.zBaseSize / (TMath::Sqrt(1.0 + mVal * mVal) * richPars.rMax - mVal * richPars.zBaseSize) : 0.f;
mTRplusG[richPars.nRings / 2] = richPars.rMax - richPars.rMin;
double t = TMath::Tan(TMath::ATan(mVal) + TMath::ATan(richPars.zBaseSize / (2.0 * richPars.rMax * TMath::Sqrt(1.0 + mVal * mVal) - richPars.zBaseSize * mVal)));
double t = isOdd ? TMath::Tan(TMath::ATan(mVal) + TMath::ATan(richPars.zBaseSize / (2.0 * richPars.rMax * TMath::Sqrt(1.0 + mVal * mVal) - richPars.zBaseSize * mVal))) : 0.f;
mMinRadialMirror[richPars.nRings / 2] = richPars.rMax;
mMaxRadialRadiator[richPars.nRings / 2] = richPars.rMin;

Expand Down Expand Up @@ -402,6 +398,32 @@ void Detector::prepareOddLayout()
mR0Radiator[iRing] = mR0Tilt[iRing] - (mTRplusG[iRing] - richPars.radiatorThickness / 2) * TMath::Cos(mThetaBi[iRing]);
mR0PhotoDet[iRing] = mR0Tilt[iRing] - (richPars.detectorThickness / 2) * TMath::Cos(mThetaBi[iRing]);
}

// FWD and BWD RICH
if (richPars.enableFWDRich) {
LOGP(info, "Setting up FWD RICH layout");
mFWDRich = FWDRich(GeometryTGeo::getRICHSensorFWDPattern(),
richPars.rFWDMin,
richPars.rFWDMax,
richPars.zAerogelMin,
richPars.zAerogelMax - richPars.zArgonMin,
richPars.zArgonMin,
richPars.zArgonMax - richPars.zArgonMin,
richPars.zSiliconMin,
richPars.zSiliconMax - richPars.zSiliconMin);
}
if (richPars.enableBWDRich) {
LOGP(info, "Setting up BWD RICH layout");
mBWDRich = BWDRich(GeometryTGeo::getRICHSensorBWDPattern(),
richPars.rFWDMin,
richPars.rFWDMax,
richPars.zAerogelMin,
richPars.zAerogelMax - richPars.zAerogelMin,
richPars.zArgonMin,
richPars.zArgonMax - richPars.zArgonMin,
richPars.zSiliconMin,
richPars.zSiliconMax - richPars.zSiliconMin);
}
}
} // namespace rich
} // namespace o2
Expand Down
Loading