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
2 changes: 2 additions & 0 deletions Detectors/ITSMFT/MFT/base/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ o2_add_library(MFTBase
src/HalfDisk.cxx
src/Ladder.cxx
src/Flex.cxx
src/PCBSupport.cxx
src/Support.cxx
src/HeatExchanger.cxx
src/HalfCone.cxx
Expand All @@ -46,6 +47,7 @@ o2_target_root_dictionary(MFTBase
include/MFTBase/Ladder.h
include/MFTBase/Flex.h
include/MFTBase/Support.h
include/MFTBase/PCBSupport.h
include/MFTBase/HeatExchanger.h
include/MFTBase/HalfCone.h
include/MFTBase/PowerSupplyUnit.h
Expand Down
10 changes: 10 additions & 0 deletions Detectors/ITSMFT/MFT/base/include/MFTBase/HalfDisk.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ namespace o2
{
namespace mft
{
class PCBSupport;
}
} // namespace o2
namespace o2
{
namespace mft
{
class HeatExchanger;
}
} // namespace o2
Expand All @@ -55,6 +62,8 @@ class HalfDisk : public TNamed
HalfDisk(HalfDiskSegmentation* segmentation);

TGeoVolumeAssembly* createHeatExchanger();
TGeoVolumeAssembly* createSupport();
TGeoVolumeAssembly* createPCBSupport();
void createLadders();

~HalfDisk() override;
Expand All @@ -64,6 +73,7 @@ class HalfDisk : public TNamed

private:
Support* mSupport; ///< \brief Disk Support
PCBSupport* mPCBSupport; ///< \brief PCB Support
HeatExchanger* mHeatExchanger; ///< \brief Heat Exchanger
TGeoVolumeAssembly* mHalfDiskVolume; ///< \brief Half-Disk Volume
HalfDiskSegmentation* mSegmentation; ///< \brief Virtual Segmentation of the half-disk
Expand Down
81 changes: 81 additions & 0 deletions Detectors/ITSMFT/MFT/base/include/MFTBase/PCBSupport.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
// Copyright CERN and copyright holders of ALICE O2. This software is
// distributed under the terms of the GNU General Public License v3 (GPL
// Version 3), copied verbatim in the file "COPYING".
//
// See http://alice-o2.web.cern.ch/license for full licensing information.
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.

/// \file PCBSupport.h
/// \brief Class describing geometry of one MFT half-disk PCBsupport
/// \author Raphael Tieulent <raphael.tieulent@cern.ch>

#ifndef ALICEO2_MFT_PCBSUPPORT_H_
#define ALICEO2_MFT_PCBSUPPORT_H_

#include "TGeoVolume.h"
#include "TGeoMatrix.h"
#include "TGeoBBox.h"
#include "TGeoCompositeShape.h"
#include "TGeoTube.h"
#include "TGeoCone.h"
#include "TGeoArb8.h"
#include "TGeoBoolNode.h"
#include "TMath.h"
#include "TGeoManager.h"
#include "TGeoVolume.h"
#include "FairLogger.h"

class TGeoVolume;
class TGeoCompositeShape;

namespace o2
{
namespace mft
{

class PCBSupport
{

public:
PCBSupport();
~PCBSupport() = default;
TGeoVolumeAssembly* create(Int_t kHalf, Int_t disk);

private:
void initParameters();
TGeoVolumeAssembly* mHalfDisk;
TGeoMedium* mPCBMediumCu;
TGeoMedium* mPCBMediumFR4;
TGeoBBox* mSomeBox;
TGeoTube* mSomeTube;
TGeoArb8* mSomeArb;

TGeoSubtraction* mSomeSubtraction;
TGeoUnion* mSomeUnion;
TGeoTranslation* mSomeTranslation;
TGeoCompositeShape* mPCBCu;
TGeoCompositeShape* mPCBFR4;

Double_t mCuThickness; //Cu layer thickness
Double_t mFR4Thickness; //FR4 layer thickness
Double_t mPCBRad[5]; // Radius of each PCB disk
Double_t mDiskGap; //gap between half disks
Double_t mPhi0;
Double_t mPhi1;
Double_t mT_delta; //Excess to remove to avoid coplanar surfaces that causes visualization glitches and overlaps
Int_t mNumberOfBoxCuts[5]; // Number of box cuts in each PCB
Double_t (*mBoxCuts[5])[4]; // Box cuts on each PCB
Int_t mNumberOfBoxAdd[5]; // Number of box added to each PCB
Double_t (*mBoxAdd[5])[4]; // Box added to each PCB
Int_t mNumberOfHoles[5]; // Number of Holes in each PCB
Double_t (*mHoles[5])[3]; // Holes on each PCB

ClassDef(PCBSupport, 1);
};
} // namespace mft
} // namespace o2

#endif
147 changes: 113 additions & 34 deletions Detectors/ITSMFT/MFT/base/include/MFTBase/Support.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,60 +11,139 @@
/// \file Support.h
/// \brief Class describing geometry of one MFT half-disk support
/// \author Raphael Tieulent <raphael.tieulent@cern.ch>
/// \author Rafael Pezzi <rafael.pezzi@cern.ch>

#ifndef ALICEO2_MFT_SUPPORT_H_
#define ALICEO2_MFT_SUPPORT_H_

#include "TGeoVolume.h"
#include "TGeoMatrix.h"
#include "TGeoBBox.h"
#include "TGeoCompositeShape.h"
#include "TGeoTube.h"
#include "TGeoCone.h"
#include "TGeoArb8.h"
#include "TGeoBoolNode.h"
#include "TMath.h"
#include "TGeoManager.h"
#include "TGeoVolume.h"
#include "FairLogger.h"

class TGeoVolume;
class TGeoCompositeShape;

namespace o2
{
namespace mft
{

class Support
{
using shapeParam = std::vector<Double_t>;
using diskBoxCuts = std::vector<shapeParam>;

public:
Support();

~Support();

TGeoVolumeAssembly* createVolume(Int_t half, Int_t disk);
TGeoVolumeAssembly* createPCBs(Int_t half, Int_t disk);
TGeoVolumeAssembly* createPCB_00_01(Int_t half, Int_t disk);
TGeoVolumeAssembly* createPCB_02(Int_t half, Int_t disk);
TGeoVolumeAssembly* createPCB_03(Int_t half, Int_t disk);
TGeoVolumeAssembly* createPCB_04(Int_t half, Int_t disk);
TGeoVolumeAssembly* createPCB_PSU(Int_t half, Int_t disk);
TGeoVolume* createSupport(Int_t half, Int_t disk);
TGeoVolume* createDisk_Support_00();
TGeoVolume* createDisk_Support_01();
TGeoVolume* createDisk_Support_02();
TGeoVolume* createDisk_Support_03();
TGeoVolume* createDisk_Support_04();

TGeoCompositeShape* screw_array(Int_t N, Double_t gap = 1.7);
TGeoCompositeShape* screw_C();
TGeoCompositeShape* screw_D();
TGeoCompositeShape* screw_E();
TGeoCompositeShape* through_hole_a(Double_t thickness = .8);
TGeoCompositeShape* through_hole_b(Double_t thickness = .8);
TGeoCompositeShape* through_hole_c(Double_t thickness = .8);
TGeoCompositeShape* through_hole_d(Double_t thickness = .8);
TGeoCompositeShape* through_hole_e(Double_t thickness = .8);

protected:
TGeoVolumeAssembly* mSupportVolume;
Double_t mSupportThickness;
Double_t mPCBThickness;
~Support() = default;
TGeoVolumeAssembly* create(Int_t kHalf, Int_t disk);

private:
void initParameters();
TGeoVolumeAssembly* mHalfDisk;
TGeoMedium* mSupportMedium;

Double_t mSupThickness; //Support Thickness
Double_t mSupRad[5]; // Radius of each support disk
Double_t mDiskGap; //gap between half disks
Double_t mPhi0;
Double_t mPhi1;
Double_t mT_delta; //Excess to remove to avoid coplanar surfaces that causes visualization glitches
Double_t mRaisedBoxHeight;
Double_t mFixBoxHeight;
Double_t mOuterCut[5]; //Distance of external disk cuts (oposite to beam pipe)
// this is the y origin on Guillamet's PDF blueprints

std::vector<shapeParam> mDiskBoxCuts[5]; // Box cuts on each disk
std::vector<shapeParam> mDiskRaisedBoxes[5]; //Raised boxes for each halfDisk
std::vector<shapeParam> mDiskFixBoxes[5]; //Fix boxes for each halfDisk (can be merged with mDiskRaisedBoxes)

Int_t mNumberOfVoids[5]; //Number of Voids (big holes) in each halfDisk support
Double_t (*mVoidVert[5])[4][2]; //Vertexes of Voids

Int_t mNumberOfM2Holes[5]; // Number of M2 Holes in each halfDisk support
Double_t (*mM2Holes[5])[2]; // M2 holes on halfdisk 00 and 01
Double_t mRad_M2;
Double_t mHeight_M2;

// ==== D2 H7 - 4 mm deep (on higher surface)
Int_t mNumberOfD2_hHoles[5];
Double_t (*mD2_hHoles[5])[2]; // D2 holes on raisedBoxes on each disk
Double_t mRad_D2_h;
Double_t mHeight_D2_h;

// ==== D 6.5 mm holes
Double_t (*mD65Holes[5])[2]; // Positions of D6.5 mm holes on disk
Int_t mTwoHoles; // Number of D6.5 mm Holes in each halfDisk support
Double_t mD65; //Radius

// ==== D6 H7 (6 mm diameter holes)
Double_t (*mD6Holes[5])[2]; // Positions of D6 mm holes on disk
Double_t mD6; // Radius

// ==== D8 H7 (8 mm diameter holes)
Int_t mNumberOfD8_Holes[5];
Double_t mD8; // Radius
Double_t (*mD8Holes[5])[2]; // Positions of D8 mm holes on disk

// ==== D3 H7 (3 mm diameter holes)
Double_t mD3; // Radius
Double_t (*mD3Holes[5])[2]; // Positions of D8 mm holes on disk

// ==== M3 H7 (?? mm diameter holes)
Int_t mNumberOfM3Holes[5]; // Number of M2 Holes in each halfDisk support
Double_t mM3; // Radius TODO: Verify this!
Double_t (*mM3Holes[5])[2]; // Positions of M3 holes on disk

// ==== D4.5 H9
Double_t mD45; // Radius
Double_t (*mD45Holes[5])[2]; // Positions of D4.5 mm holes on disk

// ==== D2 H7 - 4 mm deep (on lower surface)
Double_t mD2; // Radius
Double_t mHeight_D2;
Double_t (*mD2Holes[5])[2]; // Positions of D2 mm holes on disk

ClassDef(Support, 1);
};

//Template to reduce boilerplate for TGeo boolean operations
template <class L, class R, class T, class OP>
auto compositeOperation(L&& left, R&& right, T&& translation, OP&& op)
{
auto result = new OP(std::forward<L&&>(left), std::forward<R&&>(right), nullptr, std::forward<T&&>(translation));
return result;
}

//Template function to perform serial TGeo boolean operations
template <class L, class SHAPE, class EL, class OP>
auto serialBoolOperation(L&& base, SHAPE&& shape, EL&& elements, OP&& op)
{
TGeoCompositeShape* localCS = nullptr;
SHAPE* localshape;
TGeoTranslation* localTranslation;

for (auto par : elements) {
//Info("SerialBoolOperation", Form("params: %f %f %f %f %f %f,", par[0], par[1], par[2], par[3], par[4], par[5]), 0, 0);

localshape = new SHAPE(par[0], par[1], par[2], nullptr);
localTranslation = new TGeoTranslation(par[3], par[4], par[5]);

//The first subtraction needs a shape, the base shape
if (!localCS)
localCS = new TGeoCompositeShape(nullptr, compositeOperation(base, localshape, localTranslation, std::forward<OP>(op)));
else
localCS = new TGeoCompositeShape(nullptr, compositeOperation(localCS, localshape, localTranslation, std::forward<OP>(op)));
}
return localCS;
}

} // namespace mft
} // namespace o2

Expand Down
40 changes: 39 additions & 1 deletion Detectors/ITSMFT/MFT/base/src/HalfDisk.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include "MFTBase/Geometry.h"
#include "MFTBase/HeatExchanger.h"
#include "MFTBase/Support.h"
#include "MFTBase/PCBSupport.h"

using namespace o2::mft;

Expand All @@ -33,7 +34,7 @@ ClassImp(o2::mft::HalfDisk);

//_____________________________________________________________________________
HalfDisk::HalfDisk()
: TNamed(), mSupport(nullptr), mHeatExchanger(nullptr), mHalfDiskVolume(nullptr), mSegmentation(nullptr)
: TNamed(), mPCBSupport(nullptr), mSupport(nullptr), mHeatExchanger(nullptr), mHalfDiskVolume(nullptr), mSegmentation(nullptr)
{
}

Expand All @@ -42,6 +43,7 @@ HalfDisk::HalfDisk()
//_____________________________________________________________________________
HalfDisk::HalfDisk(HalfDiskSegmentation* segmentation)
: TNamed(segmentation->GetName(), segmentation->GetName()),
mPCBSupport(nullptr),
mSupport(nullptr),
mHeatExchanger(nullptr),
mSegmentation(segmentation)
Expand All @@ -63,6 +65,14 @@ HalfDisk::HalfDisk(HalfDiskSegmentation* segmentation)
TGeoVolumeAssembly* heatExchangerVol = createHeatExchanger();
mHalfDiskVolume->AddNode(heatExchangerVol, 1);

// Building Support
TGeoVolumeAssembly* supportVol = createSupport();
mHalfDiskVolume->AddNode(supportVol, 1);

// Building PCB
TGeoVolumeAssembly* PCBVol = createPCBSupport();
mHalfDiskVolume->AddNode(PCBVol, 1);

// Building Front Face of the Half Disk
createLadders();
}
Expand Down Expand Up @@ -92,6 +102,34 @@ TGeoVolumeAssembly* HalfDisk::createHeatExchanger()
return vol;
}

//_____________________________________________________________________________
TGeoVolumeAssembly* HalfDisk::createSupport()
{

Geometry* mftGeom = Geometry::instance();

mSupport = new Support();

TGeoVolumeAssembly* vol =
mSupport->create(mftGeom->getHalfID(GetUniqueID()), mftGeom->getDiskID(GetUniqueID()));

return vol;
}

//_____________________________________________________________________________
TGeoVolumeAssembly* HalfDisk::createPCBSupport()
{

Geometry* mftGeom = Geometry::instance();

mPCBSupport = new PCBSupport();

TGeoVolumeAssembly* vol =
mPCBSupport->create(mftGeom->getHalfID(GetUniqueID()), mftGeom->getDiskID(GetUniqueID()));

return vol;
}

/// \brief Build Ladders on the Half-disk

//_____________________________________________________________________________
Expand Down
1 change: 1 addition & 0 deletions Detectors/ITSMFT/MFT/base/src/MFTBaseLinkDef.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#pragma link C++ class o2::mft::Ladder + ;
#pragma link C++ class o2::mft::Flex + ;
#pragma link C++ class o2::mft::Support + ;
#pragma link C++ class o2::mft::PCBSupport + ;
#pragma link C++ class o2::mft::HeatExchanger + ;
#pragma link C++ class o2::mft::HalfCone + ;
#pragma link C++ class o2::mft::PowerSupplyUnit + ;
Expand Down
Loading