2828#include " TMathBase.h" // for Abs
2929#include < TMath.h> // for Sin, RadToDeg, DegToRad, Cos, Tan, etc
3030
31+ #include < TGeoBBox.h>
32+ #include < string>
3133#include < cstdio> // for snprintf
34+ #include < cmath>
3235
3336class TGeoMedium ;
3437
@@ -40,6 +43,18 @@ ClassImp(FT3Layer);
4043
4144FT3Layer::~FT3Layer () = default ;
4245
46+ TGeoMaterial* FT3Layer::carbonFiberMat = nullptr ;
47+ TGeoMedium* FT3Layer::medCarbonFiber = nullptr ;
48+
49+ TGeoMaterial* FT3Layer::kaptonMat = nullptr ;
50+ TGeoMedium* FT3Layer::kaptonMed = nullptr ;
51+
52+ TGeoMaterial* FT3Layer::waterMat = nullptr ;
53+ TGeoMedium* FT3Layer::waterMed = nullptr ;
54+
55+ TGeoMaterial* FT3Layer::foamMat = nullptr ;
56+ TGeoMedium* FT3Layer::medFoam = nullptr ;
57+
4358FT3Layer::FT3Layer (Int_t layerDirection, Int_t layerNumber, std::string layerName, Float_t z, Float_t rIn, Float_t rOut, Float_t Layerx2X0)
4459{
4560 // Creates a simple parametrized EndCap layer covering the given
@@ -59,10 +74,156 @@ FT3Layer::FT3Layer(Int_t layerDirection, Int_t layerNumber, std::string layerNam
5974 LOG (info) << " Layer z = " << mZ << " ; R_in = " << mInnerRadius << " ; R_out = " << mOuterRadius << " ; x2X0 = " << mx2X0 << " ; ChipThickness = " << mChipThickness ;
6075}
6176
77+ void FT3Layer::initialize_mat ()
78+ {
79+
80+ if (carbonFiberMat)
81+ return ;
82+
83+ carbonFiberMat = new TGeoMaterial (" CarbonFiber" , 12.0 , 6.0 , 1.6 );
84+ medCarbonFiber = new TGeoMedium (" CarbonFiber" , 1 , carbonFiberMat);
85+
86+ auto * itsC = new TGeoElement (" FT3_C" , " Carbon" , 6 , 12.0107 );
87+
88+ auto * itsFoam = new TGeoMixture (" FT3_Foam" , 1 );
89+ itsFoam->AddElement (itsC, 1 );
90+ itsFoam->SetDensity (0.17 );
91+
92+ medFoam = new TGeoMedium (" FT3_Foam" , 1 , itsFoam);
93+ foamMat = medFoam->GetMaterial ();
94+
95+ kaptonMat = new TGeoMaterial (" Kapton (cooling pipe)" , 13.84 , 6.88 , 1.346 );
96+ kaptonMed = new TGeoMedium (" Kapton (cooling pipe)" , 1 , kaptonMat);
97+
98+ waterMat = new TGeoMaterial (" Water" , 18.01528 , 8.0 , 1.064 );
99+ waterMed = new TGeoMedium (" Water" , 2 , waterMat);
100+ }
101+
102+ static double y_circle (double x, double radius)
103+ {
104+ return (x * x < radius * radius) ? std::sqrt (radius * radius - x * x) : 0 ;
105+ }
106+
107+ void FT3Layer::createSeparationLayer_waterCooling (TGeoVolume* motherVolume, const std::string& separationLayerName)
108+ {
109+
110+ FT3Layer::initialize_mat ();
111+
112+ double carbonFiberThickness = 0.01 ;
113+ double foamSpacingThickness = 0.5 ;
114+
115+ TGeoTube* carbonFiberLayer = new TGeoTube (mInnerRadius , mOuterRadius , carbonFiberThickness / 2 );
116+
117+ // volumes
118+ TGeoVolume* carbonFiberLayerVol1 = new TGeoVolume ((separationLayerName + " _CarbonFiber1" ).c_str (), carbonFiberLayer, medCarbonFiber);
119+ TGeoVolume* carbonFiberLayerVol2 = new TGeoVolume ((separationLayerName + " _CarbonFiber2" ).c_str (), carbonFiberLayer, medCarbonFiber);
120+
121+ carbonFiberLayerVol1->SetLineColor (kGray + 2 );
122+ carbonFiberLayerVol2->SetLineColor (kGray + 2 );
123+
124+ double zSeparation = foamSpacingThickness / 2.0 + carbonFiberThickness / 2.0 ;
125+
126+ motherVolume->AddNode (carbonFiberLayerVol1, 1 , new TGeoTranslation (0 , 0 , mZ - zSeparation));
127+ motherVolume->AddNode (carbonFiberLayerVol2, 1 , new TGeoTranslation (0 , 0 , mZ + zSeparation));
128+
129+ double pipeOuterRadius = 0.20 ;
130+ double kaptonThickness = 0.0025 ;
131+ double pipeInnerRadius = pipeOuterRadius - kaptonThickness;
132+ double pipeMaxLength = mOuterRadius * 2.0 ;
133+
134+ int name_it = 0 ;
135+
136+ // positions of the pipes depending on the overlap of the sensors inactive regions: (ALICE 3 dimensions)
137+ // partial:
138+ // std::vector<double> X_pos = {-63.2, -58.4, -53.6, -48.8, -44.0, -39.199999999999996, -34.4, -29.599999999999994, -24.799999999999997, -19.999999999999993, -15.199999999999998, -10.399999999999993, -5.599999999999998, -0.7999999999999936, 4.000000000000002, 8.800000000000006, 13.600000000000001, 18.400000000000006, 23.200000000000003, 28.000000000000007, 32.800000000000004, 37.60000000000001, 42.400000000000006, 47.20000000000001, 52.00000000000001, 56.80000000000001, 61.60000000000001, 66.4};
139+ // complete:
140+ // std::vector<double> X_pos = {-63.4, -58.8, -54.199999999999996, -49.599999999999994, -44.99999999999999, -40.39999999999999, -35.79999999999999, -31.199999999999992, -26.59999999999999, -21.999999999999993, -17.39999999999999, -12.799999999999994, -8.199999999999992, -3.5999999999999934, 1.000000000000008, 5.600000000000007, 10.200000000000008, 14.800000000000008, 19.40000000000001, 24.000000000000007, 28.60000000000001, 33.20000000000001, 37.80000000000001, 42.40000000000001, 47.000000000000014, 51.600000000000016, 56.20000000000002, 60.80000000000002, 65.40000000000002};
141+ std::vector<double > X_pos = {-62.3168 , -57.9836 , -53.650400000000005 , -49.317200000000014 , -44.984000000000016 , -40.65080000000002 , -36.31760000000002 , -31.984400000000026 , -27.65120000000003 , -23.318000000000037 , -18.98480000000004 , -14.651600000000043 , -10.318400000000047 , -5.98520000000005 , -1.6520000000000519 , 2.6811999999999445 , 7.014399999999941 , 11.347599999999936 , 15.680799999999934 , 20.01399999999993 , 24.347199999999926 , 28.68039999999992 , 33.013599999999926 , 37.34679999999992 , 41.980000000000004 , 46.613200000000006 , 51.246399999999994 , 55.87960000000001 , 60.5128 };
142+
143+ for (double xPos : X_pos) {
144+
145+ double pipeLength = pipeMaxLength;
146+ double yMax = 0.0 ;
147+
148+ TGeoRotation* rotation = new TGeoRotation ();
149+ rotation->RotateX (90 );
150+
151+ if (std::abs (xPos) < mInnerRadius ) {
152+ double yInner = std::abs (y_circle (xPos, mInnerRadius ));
153+ double yOuter = std::abs (y_circle (xPos, mOuterRadius ));
154+
155+ yMax = 2 * yOuter;
156+ pipeLength = yMax;
157+
158+ double positiveYLength = yOuter - yInner;
159+
160+ TGeoVolume* kaptonPipePos = new TGeoVolume ((separationLayerName + " _KaptonPipePos_" + std::to_string (name_it)).c_str (), new TGeoTube (pipeInnerRadius, pipeOuterRadius, positiveYLength / 2 ), kaptonMed);
161+ kaptonPipePos->SetLineColor (kGray );
162+ TGeoVolume* waterVolumePos = new TGeoVolume ((separationLayerName + " _WaterVolumePos_" + std::to_string (name_it)).c_str (), new TGeoTube (0.0 , pipeInnerRadius, positiveYLength / 2 ), waterMed);
163+ waterVolumePos->SetLineColor (kBlue );
164+
165+ motherVolume->AddNode (waterVolumePos, 1 , new TGeoCombiTrans (xPos, (yInner + yOuter) / 2.0 , mZ , rotation));
166+
167+ TGeoVolume* kaptonPipeNeg = new TGeoVolume ((separationLayerName + " _KaptonPipeNeg_" + std::to_string (name_it)).c_str (), new TGeoTube (pipeInnerRadius, pipeOuterRadius, positiveYLength / 2 ), kaptonMed);
168+ kaptonPipeNeg->SetLineColor (kGray );
169+ TGeoVolume* waterVolumeNeg = new TGeoVolume ((separationLayerName + " _WaterVolumeNeg_" + std::to_string (name_it)).c_str (), new TGeoTube (0.0 , pipeInnerRadius, positiveYLength / 2 ), waterMed);
170+ waterVolumeNeg->SetLineColor (kBlue );
171+
172+ motherVolume->AddNode (waterVolumeNeg, 1 , new TGeoCombiTrans (xPos, -(yInner + yOuter) / 2.0 , mZ , rotation));
173+
174+ motherVolume->AddNode (kaptonPipePos, 1 , new TGeoCombiTrans (xPos, (yInner + yOuter) / 2.0 , mZ , rotation));
175+ motherVolume->AddNode (kaptonPipeNeg, 1 , new TGeoCombiTrans (xPos, -(yInner + yOuter) / 2.0 , mZ , rotation));
176+
177+ } else {
178+
179+ double yOuter = std::abs (y_circle (xPos, mOuterRadius ));
180+ yMax = 2 * yOuter;
181+ pipeLength = yMax;
182+
183+ TGeoVolume* kaptonPipe = new TGeoVolume ((separationLayerName + " _KaptonPipe_" + std::to_string (name_it)).c_str (), new TGeoTube (pipeInnerRadius, pipeOuterRadius, pipeLength / 2 ), kaptonMed);
184+ kaptonPipe->SetLineColor (kGray );
185+ TGeoVolume* waterVolume = new TGeoVolume ((separationLayerName + " _WaterVolume_" + std::to_string (name_it)).c_str (), new TGeoTube (0.0 , pipeInnerRadius, pipeLength / 2 ), waterMed);
186+ waterVolume->SetLineColor (kBlue );
187+
188+ motherVolume->AddNode (waterVolume, 1 , new TGeoCombiTrans (xPos, 0 , mZ , rotation));
189+ motherVolume->AddNode (kaptonPipe, 1 , new TGeoCombiTrans (xPos, 0 , mZ , rotation));
190+ }
191+
192+ name_it++;
193+ }
194+ }
195+
196+ void FT3Layer::createSeparationLayer (TGeoVolume* motherVolume, const std::string& separationLayerName)
197+ {
198+
199+ FT3Layer::initialize_mat ();
200+
201+ double carbonFiberThickness = 0.01 ;
202+ double foamSpacingThickness = 1.0 ;
203+
204+ TGeoTube* carbonFiberLayer = new TGeoTube (mInnerRadius , mOuterRadius , carbonFiberThickness / 2 );
205+ TGeoTube* foamLayer = new TGeoTube (mInnerRadius , mOuterRadius , foamSpacingThickness / 2 );
206+
207+ // volumes
208+ TGeoVolume* carbonFiberLayerVol1 = new TGeoVolume ((separationLayerName + " _CarbonFiber1" ).c_str (), carbonFiberLayer, medCarbonFiber);
209+ TGeoVolume* foamLayerVol = new TGeoVolume ((separationLayerName + " _Foam" ).c_str (), foamLayer, medFoam);
210+ TGeoVolume* carbonFiberLayerVol2 = new TGeoVolume ((separationLayerName + " _CarbonFiber2" ).c_str (), carbonFiberLayer, medCarbonFiber);
211+
212+ carbonFiberLayerVol1->SetLineColor (kGray + 2 );
213+ foamLayerVol->SetLineColor (kBlack );
214+ foamLayerVol->SetFillColorAlpha (kBlack , 1.0 );
215+ carbonFiberLayerVol2->SetLineColor (kGray + 2 );
216+
217+ double zSeparation = foamSpacingThickness / 2.0 + carbonFiberThickness / 2.0 ;
218+
219+ motherVolume->AddNode (carbonFiberLayerVol1, 1 , new TGeoTranslation (0 , 0 , mZ - zSeparation));
220+ motherVolume->AddNode (foamLayerVol, 1 , new TGeoTranslation (0 , 0 , mZ ));
221+ motherVolume->AddNode (carbonFiberLayerVol2, 1 , new TGeoTranslation (0 , 0 , mZ + zSeparation));
222+ }
223+
62224void FT3Layer::createLayer (TGeoVolume* motherVolume)
63225{
64- if (mLayerNumber >= 0 ) {
65- // Create tube, set sensitive volume, add to mother volume
226+ if (mLayerNumber >= 0 && mLayerNumber < 3 ) {
66227
67228 std::string chipName = o2::ft3::GeometryTGeo::getFT3ChipPattern () + std::to_string (mLayerNumber ),
68229 sensName = Form (" %s_%d_%d" , GeometryTGeo::getFT3SensorPattern (), mDirection , mLayerNumber );
@@ -93,6 +254,21 @@ void FT3Layer::createLayer(TGeoVolume* motherVolume)
93254 LOG (info) << " Inserting " << layerVol->GetName () << " inside " << motherVolume->GetName ();
94255 motherVolume->AddNode (layerVol, 1 , FwdDiskCombiTrans);
95256
96- return ;
257+ } else if (mLayerNumber >= 3 ) {
258+
259+ FT3Module module ;
260+ std::string frontLayerName = " FT3Layer" + std::to_string (mLayerNumber ) + " _Front" ;
261+ std::string backLayerName = " FT3Layer" + std::to_string (mLayerNumber ) + " _Back" ;
262+ std::string separationLayerName = " SeparationLayer" + std::to_string (mLayerNumber );
263+
264+ TGeoVolume* separationLayerVol = new TGeoVolume (separationLayerName.c_str (), new TGeoTube (mInnerRadius , mOuterRadius , 2.5 ), gGeoManager ->GetMedium (" FT3_AIR$" ));
265+ separationLayerVol->SetLineColor (kGray );
266+
267+ // create disk faces
268+ module .createModule (mZ , mLayerNumber , mDirection , mInnerRadius , mOuterRadius , 0 ., " front" , " rectangular" , motherVolume);
269+ module .createModule (mZ , mLayerNumber , mDirection , mInnerRadius , mOuterRadius , 0 ., " back" , " rectangular" , motherVolume);
270+
271+ // createSeparationLayer_waterCooling(motherVolume, separationLayerName);
272+ createSeparationLayer (motherVolume, separationLayerName);
97273 }
98274}
0 commit comments