-
Notifications
You must be signed in to change notification settings - Fork 419
/
V3Layer.cxx
3807 lines (3123 loc) · 143 KB
/
V3Layer.cxx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// 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 V3Layer.cxx
/// \brief Implementation of the V3Layer class
/// \author Mario Sitta <sitta@to.infn.it>
/// \author Chinorat Kobdaj (kobdaj@g.sut.ac.th)
#include "ITSSimulation/V3Layer.h"
#include "ITSBase/GeometryTGeo.h"
#include "ITSSimulation/Detector.h"
#include "ITSMFTSimulation/AlpideChip.h"
#include "ITSMFTBase/SegmentationAlpide.h"
#include "FairLogger.h" // for LOG
#include <TGeoArb8.h> // for TGeoArb8
#include <TGeoBBox.h> // for TGeoBBox
#include <TGeoCone.h> // for TGeoConeSeg, TGeoCone
#include <TGeoPcon.h> // for TGeoPcon
#include <TGeoManager.h> // for TGeoManager, gGeoManager
#include <TGeoMatrix.h> // for TGeoCombiTrans, TGeoRotation, etc
#include <TGeoTrd1.h> // for TGeoTrd1
#include <TGeoTube.h> // for TGeoTube, TGeoTubeSeg
#include <TGeoVolume.h> // for TGeoVolume, TGeoVolumeAssembly
#include <TGeoXtru.h> // for TGeoXtru
#include <TGeoCompositeShape.h> // for TGeoCompositeShape
#include "TMathBase.h" // for Abs
#include <TMath.h> // for Sin, RadToDeg, DegToRad, Cos, Tan, etc
#include <cstdio> // for snprintf
class TGeoMedium;
using namespace TMath;
using namespace o2::its;
using namespace o2::itsmft;
using AlpideChip = o2::itsmft::AlpideChip;
// General Parameters
const Int_t V3Layer::sNumberOfInnerLayers = 3;
// Inner Barrel Parameters
const Int_t V3Layer::sIBChipsPerRow = 9;
const Int_t V3Layer::sIBNChipRows = 1;
const Double_t V3Layer::sIBChipZGap = 150.0 * sMicron;
const Double_t V3Layer::sIBModuleZLength = 27.12 * sCm;
const Double_t V3Layer::sIBFPCWiderXPlus = 850.0 * sMicron;
const Double_t V3Layer::sIBFPCWiderXNeg = 300.0 * sMicron;
const Double_t V3Layer::sIBFlexCableAlThick = 25.0 * sMicron;
const Double_t V3Layer::sIBFPCAlGNDWidth = (4.1 + 11.15) * sMm;
const Double_t V3Layer::sIBFPCAlAnodeWidth1 = 13.0 * sMm;
const Double_t V3Layer::sIBFPCAlAnodeWidth2 = 14.7 * sMm;
const Double_t V3Layer::sIBFlexCableKapThick = 75.0 * sMicron;
const Double_t V3Layer::sIBFlexCablePolyThick = 20.0 * sMicron;
const Double_t V3Layer::sIBFlexCapacitorXWid = 0.2 * sMm;
const Double_t V3Layer::sIBFlexCapacitorYHi = 0.2 * sMm;
const Double_t V3Layer::sIBFlexCapacitorZLen = 0.4 * sMm;
const Double_t V3Layer::sIBColdPlateWidth = 15.4 * sMm;
const Double_t V3Layer::sIBColdPlateZLen = 290.0 * sMm;
const Double_t V3Layer::sIBGlueThick = 50.0 * sMicron;
const Double_t V3Layer::sIBCarbonFleeceThick = 20.0 * sMicron;
const Double_t V3Layer::sIBCarbonPaperThick = 30.0 * sMicron;
const Double_t V3Layer::sIBCarbonPaperWidth = 12.5 * sMm;
const Double_t V3Layer::sIBCarbonPaperZLen = 280.0 * sMm;
const Double_t V3Layer::sIBK13D2UThick = 70.0 * sMicron;
const Double_t V3Layer::sIBCoolPipeInnerD = 1.024 * sMm;
const Double_t V3Layer::sIBCoolPipeThick = 25.4 * sMicron;
const Double_t V3Layer::sIBCoolPipeXDist = 5.0 * sMm;
const Double_t V3Layer::sIBCoolPipeZLen = 302.0 * sMm;
const Double_t V3Layer::sIBTopVertexWidth1 = 0.258 * sMm;
const Double_t V3Layer::sIBTopVertexWidth2 = 0.072 * sCm;
const Double_t V3Layer::sIBTopVertexHeight = 0.04 * sCm;
const Double_t V3Layer::sIBTopVertexAngle = 60.0; // Deg
const Double_t V3Layer::sIBSideVertexWidth = 0.05 * sCm;
const Double_t V3Layer::sIBSideVertexHeight = 0.074 * sCm;
const Double_t V3Layer::sIBTopFilamentSide = 0.04 * sCm;
const Double_t V3Layer::sIBTopFilamentAlpha = 109.8; // Deg
const Double_t V3Layer::sIBTopFilamentInterZ = 15.0 * sMm;
const Double_t V3Layer::sIBEndSupportThick = 0.149 * sMm;
const Double_t V3Layer::sIBEndSupportZLen = 2.5 * sMm;
const Double_t V3Layer::sIBEndSupportXUp = 1.0 * sMm;
const Double_t V3Layer::sIBEndSupportOpenPhi = 120.0; // Deg
const Double_t V3Layer::sIBConnectorXWidth = 10.0 * sMm;
const Double_t V3Layer::sIBConnectorYTot = 4.7 * sMm;
const Double_t V3Layer::sIBConnectBlockZLen = 16.5 * sMm;
const Double_t V3Layer::sIBConnBodyYHeight = 2.5 * sMm;
const Double_t V3Layer::sIBConnTailYShift = 0.9 * sMm;
const Double_t V3Layer::sIBConnTailYMid = 2.5 * sMm;
const Double_t V3Layer::sIBConnTailZLen = 2.5 * sMm;
const Double_t V3Layer::sIBConnTailOpenPhi = 120.0; // Deg
const Double_t V3Layer::sIBConnRoundHoleD = 2.0 * sMm;
const Double_t V3Layer::sIBConnRoundHoleZ = (9.0 - 4.0) * sMm;
const Double_t V3Layer::sIBConnSquareHoleX = 2.0 * sMm;
const Double_t V3Layer::sIBConnSquareHoleZ = 2.8 * sMm;
const Double_t V3Layer::sIBConnSquareHoleZPos = 9.0 * sMm;
const Double_t V3Layer::sIBConnInsertHoleD = 2.0 * sMm;
const Double_t V3Layer::sIBConnInsertHoleZPos = 9.0 * sMm;
const Double_t V3Layer::sIBConnTubeHole1D = 1.6 * sMm;
const Double_t V3Layer::sIBConnTubeHole1ZLen = 3.0 * sMm;
const Double_t V3Layer::sIBConnTubeHole1ZLen2 = 2.7 * sMm;
const Double_t V3Layer::sIBConnTubeHole2D = 1.2 * sMm;
const Double_t V3Layer::sIBConnTubeHole3XPos = 1.0 * sMm;
const Double_t V3Layer::sIBConnTubeHole3ZPos = 14.5 * sMm;
const Double_t V3Layer::sIBConnTubesXDist = 5.0 * sMm;
const Double_t V3Layer::sIBConnTubesYPos = 1.25 * sMm;
const Double_t V3Layer::sIBConnInsertD = 2.0 * sMm;
const Double_t V3Layer::sIBConnInsertHeight = 2.3 * sMm;
const Double_t V3Layer::sIBConnSideHole1D = 1.0 * sMm;
const Double_t V3Layer::sIBConnSideHole1YPos = 1.25 * sMm;
const Double_t V3Layer::sIBConnSideHole1ZPos = 11.5 * sMm;
const Double_t V3Layer::sIBConnSideHole1XWid = 1.0 * sMm;
const Double_t V3Layer::sIBConnSideHole2YPos = 1.25 * sMm;
const Double_t V3Layer::sIBConnSideHole2ZPos = 11.0 * sMm;
const Double_t V3Layer::sIBConnSideHole2XWid = 1.0 * sMm;
const Double_t V3Layer::sIBConnSideHole2YWid = 1.0 * sMm;
const Double_t V3Layer::sIBConnSideHole2ZWid = 1.0 * sMm;
const Double_t V3Layer::sIBConnectAFitExtD = 1.65 * sMm;
const Double_t V3Layer::sIBConnectAFitIntD = 1.19 * sMm;
const Double_t V3Layer::sIBConnectAFitZLen = 12.5 * sMm;
const Double_t V3Layer::sIBConnectAFitZOut = 10.0 * sMm;
const Double_t V3Layer::sIBConnPlugInnerD = 0.8 * sMm;
const Double_t V3Layer::sIBConnPlugTotLen = 1.7 * sMm;
const Double_t V3Layer::sIBConnPlugInnerLen = 1.0 * sMm;
const Double_t V3Layer::sIBStaveHeight = 0.5 * sCm;
// Outer Barrel Parameters
const Int_t V3Layer::sOBChipsPerRow = 7;
const Int_t V3Layer::sOBNChipRows = 2;
const Double_t V3Layer::sOBChipThickness = 100.0 * sMicron;
const Double_t V3Layer::sOBHalfStaveWidth = 3.01 * sCm;
const Double_t V3Layer::sOBModuleGap = 200.0 * sMicron;
const Double_t V3Layer::sOBChipXGap = 150.0 * sMicron;
const Double_t V3Layer::sOBChipZGap = 150.0 * sMicron;
const Double_t V3Layer::sOBFlexCableXWidth = 3.3 * sCm;
const Double_t V3Layer::sOBFlexCableAlThick = 0.005 * sCm;
const Double_t V3Layer::sOBFlexCableKapThick = 75.0 * sMicron;
const Double_t V3Layer::sOBFPCSoldMaskThick = 30.0 * sMicron;
const Double_t V3Layer::sOBFPCCopperThick = 18.0 * sMicron;
const Double_t V3Layer::sOBFPCCuAreaFracGnd = 0.954; // F.Benotto
const Double_t V3Layer::sOBFPCCuAreaFracSig = 0.617; // F.Benotto
const Double_t V3Layer::sOBGlueFPCThick = 50 * sMicron;
const Double_t V3Layer::sOBGlueColdPlThick = 80 * sMicron;
const Double_t V3Layer::sOBPowerBusXWidth = 3.04 * sCm;
const Double_t V3Layer::sOBPowerBusAlThick = 100.0 * sMicron;
const Double_t V3Layer::sOBPowerBusAlFrac = 0.90; // L.Greiner
const Double_t V3Layer::sOBPowerBusDielThick = 50.0 * sMicron;
const Double_t V3Layer::sOBPowerBusKapThick = 27.5 * sMicron;
const Double_t V3Layer::sOBBiasBusXWidth = 7.7 * sMm;
const Double_t V3Layer::sOBBiasBusAlThick = 25.0 * sMicron;
const Double_t V3Layer::sOBBiasBusAlFrac = 0.90; // L.Greiner
const Double_t V3Layer::sOBBiasBusDielThick = 50.0 * sMicron;
const Double_t V3Layer::sOBBiasBusKapThick = 25.0 * sMicron;
const Double_t V3Layer::sOBColdPlateXWidth = 3.04 * sCm;
const Double_t V3Layer::sOBColdPlateZLenML = 87.55 * sCm;
const Double_t V3Layer::sOBColdPlateZLenOL = 150.15 * sCm;
const Double_t V3Layer::sOBColdPlateThick = 0.012 * sCm;
const Double_t V3Layer::sOBHalfStaveYPos = 2.067 * sCm;
const Double_t V3Layer::sOBHalfStaveYTrans = 1.76 * sMm;
const Double_t V3Layer::sOBHalfStaveXOverlap = 7.2 * sMm;
const Double_t V3Layer::sOBGraphiteFoilThick = 30.0 * sMicron;
const Double_t V3Layer::sOBCarbonFleeceThick = 20.0 * sMicron;
const Double_t V3Layer::sOBCoolTubeInnerD = 2.05 * sMm;
const Double_t V3Layer::sOBCoolTubeThick = 32.0 * sMicron;
const Double_t V3Layer::sOBCoolTubeXDist = 10.0 * sMm;
const Double_t V3Layer::sOBCPConnectorXWidth = 16.0 * sMm;
const Double_t V3Layer::sOBCPConnBlockZLen = 15.0 * sMm;
const Double_t V3Layer::sOBCPConnBlockYHei = 3.6 * sMm;
const Double_t V3Layer::sOBCPConnHollowZLen = 3.0 * sMm;
const Double_t V3Layer::sOBCPConnHollowYHei = 0.9 * sMm;
const Double_t V3Layer::sOBCPConnSquareHoleX = 4.0 * sMm;
const Double_t V3Layer::sOBCPConnSquareHoleZ = 5.0 * sMm;
const Double_t V3Layer::sOBCPConnSqrHoleZPos = 4.0 * sMm;
const Double_t V3Layer::sOBCPConnSqrInsertRZ = 3.5 * sMm;
const Double_t V3Layer::sOBCPConnRoundHoleD = 4.0 * sMm;
const Double_t V3Layer::sOBCPConnRndHoleZPos = 7.0 * sMm;
const Double_t V3Layer::sOBCPConnTubesXDist = 10.0 * sMm;
const Double_t V3Layer::sOBCPConnTubesYPos = 1.8 * sMm;
const Double_t V3Layer::sOBCPConnTubeHole1D = 2.6 * sMm;
const Double_t V3Layer::sOBCPConnTubeHole1Z = 3.5 * sMm;
const Double_t V3Layer::sOBCPConnTubeHole2D = 2.2 * sMm;
const Double_t V3Layer::sOBCPConnFitHoleD = 2.8 * sMm;
const Double_t V3Layer::sOBCPConnTubeHole3XP = 1.0 * sMm;
const Double_t V3Layer::sOBCPConnTubeHole3ZP = 2.0 * sMm;
const Double_t V3Layer::sOBCPConnInstZThick = 1.0 * sMm;
const Double_t V3Layer::sOBCPConnInsertYHei = 3.4 * sMm;
const Double_t V3Layer::sOBCPConnAFitExtD = 2.8 * sMm;
const Double_t V3Layer::sOBCPConnAFitThick = 0.3 * sMm;
const Double_t V3Layer::sOBCPConnAFitZLen = 17.0 * sMm;
const Double_t V3Layer::sOBCPConnAFitZIn = 3.0 * sMm;
const Double_t V3Layer::sOBCPConnPlugInnerD = 0.8 * sMm;
const Double_t V3Layer::sOBCPConnPlugTotLen = 1.7 * sMm;
const Double_t V3Layer::sOBCPConnPlugThick = 0.5 * sMm;
const Double_t V3Layer::sOBSpaceFrameZLen[2] = {900.0 * sMm, 1526.0 * sMm};
const Int_t V3Layer::sOBSpaceFrameNUnits[2] = {23, 39};
const Double_t V3Layer::sOBSpaceFrameUnitLen = 39.1 * sMm;
const Double_t V3Layer::sOBSpaceFrameWidth = 42.44 * sMm;
const Double_t V3Layer::sOBSpaceFrameHeight = 36.45 * sMm;
const Double_t V3Layer::sOBSpaceFrameTopVL = 4.0 * sMm;
const Double_t V3Layer::sOBSpaceFrameTopVH = 0.35 * sMm;
const Double_t V3Layer::sOBSpaceFrameSideVL = 4.5 * sMm;
const Double_t V3Layer::sOBSpaceFrameSideVH = 0.35 * sMm;
const Double_t V3Layer::sOBSpaceFrameVAlpha = 60.0; // deg
const Double_t V3Layer::sOBSpaceFrameVBeta = 68.0; // deg
const Double_t V3Layer::sOBSFrameBaseRibDiam = 1.33 * sMm;
const Double_t V3Layer::sOBSFrameBaseRibPhi = 54.0; // deg
const Double_t V3Layer::sOBSFrameSideRibDiam = 1.25 * sMm;
const Double_t V3Layer::sOBSFrameSideRibPhi = 70.0; // deg
const Double_t V3Layer::sOBSFrameULegLen = 14.2 * sMm;
const Double_t V3Layer::sOBSFrameULegWidth = 1.5 * sMm;
const Double_t V3Layer::sOBSFrameULegHeight1 = 2.7 * sMm;
const Double_t V3Layer::sOBSFrameULegHeight2 = 5.0 * sMm;
const Double_t V3Layer::sOBSFrameULegThick = 0.3 * sMm;
const Double_t V3Layer::sOBSFrameULegXPos = 12.9 * sMm;
const Double_t V3Layer::sOBSFrameConnWidth = 42.0 * sMm;
const Double_t V3Layer::sOBSFrameConnTotLen = 29.0 * sMm;
const Double_t V3Layer::sOBSFrameConnTotHei = 4.8 * sMm;
const Double_t V3Layer::sOBSFrameConnTopLen = 14.0 * sMm;
const Double_t V3Layer::sOBSFrameConnInsWide = 36.869 * sMm;
const Double_t V3Layer::sOBSFrameConnInsBase = 39.6 * sMm;
const Double_t V3Layer::sOBSFrameConnInsHei = 2.8 * sMm;
const Double_t V3Layer::sOBSFrameConnHoleZPos = 7.0 * sMm;
const Double_t V3Layer::sOBSFrameConnHoleZDist = 15.0 * sMm;
const Double_t V3Layer::sOBSFrameConnTopHoleD = 3.0 * sMm;
const Double_t V3Layer::sOBSFrConnTopHoleXDist = 24.0 * sMm;
const Double_t V3Layer::sOBSFrameConnAHoleWid = 4.0 * sMm;
const Double_t V3Layer::sOBSFrameConnAHoleLen = 5.0 * sMm;
const Double_t V3Layer::sOBSFrConnASideHoleD = 3.0 * sMm;
const Double_t V3Layer::sOBSFrConnASideHoleL = 2.5 * sMm;
const Double_t V3Layer::sOBSFrConnASideHoleY = 2.3 * sMm;
const Double_t V3Layer::sOBSFrameConnCHoleZPos = 3.0 * sMm;
const Double_t V3Layer::sOBSFrConnCHoleXDist = 32.0 * sMm;
const Double_t V3Layer::sOBSFrConnCTopHoleD = 4.0 * sMm;
const Double_t V3Layer::sOBSFrameConnInsHoleD = 5.0 * sMm;
const Double_t V3Layer::sOBSFrameConnInsHoleX = 25.8 * sMm;
ClassImp(V3Layer);
#define SQ(A) (A) * (A)
V3Layer::V3Layer()
: V11Geometry(),
mLayerNumber(0),
mPhi0(0),
mLayerRadius(0),
mSensorThickness(0),
mChipThickness(0),
mStaveWidth(0),
mStaveTilt(0),
mNumberOfStaves(0),
mNumberOfModules(0),
mNumberOfChips(0),
mChipTypeID(0),
mIsTurbo(0),
mBuildLevel(0),
mStaveModel(Detector::kIBModelDummy),
mAddGammaConv(kFALSE),
mGammaConvDiam(0),
mGammaConvXPos(0),
mIBModuleZLength(0),
mOBModuleZLength(0)
{
for (int i = kNHLevels; i--;) {
mHierarchy[i] = 0;
}
}
V3Layer::V3Layer(Int_t lay, Bool_t turbo, Int_t debug)
: V11Geometry(debug),
mLayerNumber(lay),
mPhi0(0),
mLayerRadius(0),
mSensorThickness(0),
mChipThickness(0),
mStaveWidth(0),
mStaveTilt(0),
mNumberOfStaves(0),
mNumberOfModules(0),
mNumberOfChips(0),
mChipTypeID(0),
mIsTurbo(turbo),
mBuildLevel(0),
mStaveModel(Detector::kIBModelDummy),
mAddGammaConv(kFALSE),
mGammaConvDiam(0),
mGammaConvXPos(0),
mIBModuleZLength(0),
mOBModuleZLength(0)
{
for (int i = kNHLevels; i--;) {
mHierarchy[i] = 0;
}
}
V3Layer::~V3Layer() = default;
void V3Layer::createLayer(TGeoVolume* motherVolume)
{
const Int_t nameLen = 30;
char volumeName[nameLen];
Double_t xpos, ypos, zpos;
Double_t alpha;
// Check if the user set the proper parameters
if (mLayerRadius <= 0) {
LOG(FATAL) << "Wrong layer radius " << mLayerRadius;
}
if (mNumberOfStaves <= 0) {
LOG(FATAL) << "Wrong number of staves " << mNumberOfStaves;
}
if (mNumberOfChips <= 0) {
LOG(FATAL) << "Wrong number of chips " << mNumberOfChips;
}
if (mLayerNumber >= sNumberOfInnerLayers && mNumberOfModules <= 0) {
LOG(FATAL) << "Wrong number of modules " << mNumberOfModules;
}
if (mChipThickness <= 0) {
LOG(FATAL) << "Chip thickness wrong or not set " << mChipThickness;
}
if (mSensorThickness <= 0) {
LOG(FATAL) << "Sensor thickness wrong or not set " << mSensorThickness;
}
if (mSensorThickness > mChipThickness) {
LOG(FATAL) << "Sensor thickness " << mSensorThickness << " is greater than chip thickness " << mChipThickness;
}
// If a Turbo layer is requested, do it and exit
if (mIsTurbo) {
createLayerTurbo(motherVolume);
return;
}
// First create the stave container
alpha = (360. / (2 * mNumberOfStaves)) * DegToRad();
// mStaveWidth = mLayerRadius*Tan(alpha);
snprintf(volumeName, nameLen, "%s%d", GeometryTGeo::getITSLayerPattern(), mLayerNumber);
TGeoVolume* layerVolume = new TGeoVolumeAssembly(volumeName);
layerVolume->SetUniqueID(mChipTypeID);
// layerVolume->SetVisibility(kFALSE);
layerVolume->SetVisibility(kTRUE);
layerVolume->SetLineColor(1);
TGeoVolume* stavVol = createStave();
// Now build up the layer
alpha = 360. / mNumberOfStaves;
Double_t r = mLayerRadius + (static_cast<TGeoBBox*>(stavVol->GetShape()))->GetDY();
for (Int_t j = 0; j < mNumberOfStaves; j++) {
Double_t phi = j * alpha + mPhi0;
xpos = r * cosD(phi); // r*sinD(-phi);
ypos = r * sinD(phi); // r*cosD(-phi);
zpos = 0.;
phi += 90;
layerVolume->AddNode(stavVol, j, new TGeoCombiTrans(xpos, ypos, zpos, new TGeoRotation("", phi, 0, 0)));
}
// Finally put everything in the mother volume
motherVolume->AddNode(layerVolume, 1, nullptr);
// geometry is served
return;
}
void V3Layer::createLayerTurbo(TGeoVolume* motherVolume)
{
const Int_t nameLen = 30;
char volumeName[nameLen];
Double_t xpos, ypos, zpos;
Double_t alpha;
// Check if the user set the proper (remaining) parameters
if (mStaveWidth <= 0) {
LOG(FATAL) << "Wrong stave width " << mStaveWidth;
}
if (Abs(mStaveTilt) > 45) {
LOG(WARNING) << "Stave tilt angle (" << mStaveTilt << ") greater than 45deg";
}
snprintf(volumeName, nameLen, "%s%d", GeometryTGeo::getITSLayerPattern(), mLayerNumber);
TGeoVolume* layerVolume = new TGeoVolumeAssembly(volumeName);
layerVolume->SetUniqueID(mChipTypeID);
layerVolume->SetVisibility(kTRUE);
layerVolume->SetLineColor(1);
TGeoVolume* stavVol = createStave();
// Now build up the layer
alpha = 360. / mNumberOfStaves;
Double_t r = mLayerRadius /* +chip thick ?! */;
for (Int_t j = 0; j < mNumberOfStaves; j++) {
Double_t phi = j * alpha + mPhi0;
xpos = r * cosD(phi); // r*sinD(-phi);
ypos = r * sinD(phi); // r*cosD(-phi);
zpos = 0.;
phi += 90;
layerVolume->AddNode(stavVol, j,
new TGeoCombiTrans(xpos, ypos, zpos, new TGeoRotation("", phi - mStaveTilt, 0, 0)));
}
// Finally put everything in the mother volume
motherVolume->AddNode(layerVolume, 1, nullptr);
return;
}
TGeoVolume* V3Layer::createStave(const TGeoManager* /*mgr*/)
{
//
// Creates the actual Stave
//
// Input:
// mgr : the GeoManager (used only to get the proper material)
//
// Output:
//
// Return:
//
// Created: 22 Jun 2011 Mario Sitta
// Updated: 18 Dec 2013 Mario Sitta Handle IB and OB
// Updated: 12 Jan 2015 Mario Sitta Fix overlap with new OB space frame
// (by moving the latter, not the sensors to avoid
// spoiling their position in space)
// Updated: 03 Mar 2015 Mario Sitta Fix chip position
// Updated: 16 Mar 2017 Mario Sitta AliceO2 version
// Updated: 10 Jan 2018 Mario Sitta Compute all dimensions using
// AlpideChip as basis
//
const Int_t nameLen = 30;
char volumeName[nameLen];
Double_t xpos, ypos;
Double_t alpha;
// First create all needed shapes
alpha = (360. / (2 * mNumberOfStaves)) * DegToRad();
// The stave
snprintf(volumeName, nameLen, "%s%d", GeometryTGeo::getITSStavePattern(), mLayerNumber);
TGeoVolume* staveVol = new TGeoVolumeAssembly(volumeName);
staveVol->SetVisibility(kTRUE);
staveVol->SetLineColor(2);
TGeoVolume* mechStaveVol = nullptr;
// Now build up the stave
if (mLayerNumber < sNumberOfInnerLayers) {
TGeoVolume* modVol = createStaveInnerB();
ypos = (static_cast<TGeoBBox*>(modVol->GetShape()))->GetDY() - mChipThickness; // = 0 if not kIBModel4
staveVol->AddNode(modVol, 0, new TGeoTranslation(0, ypos, 0));
mHierarchy[kHalfStave] = 1;
// Mechanical stave structure
mechStaveVol = createStaveStructInnerB();
if (mechStaveVol) {
ypos = (static_cast<TGeoBBox*>(modVol->GetShape()))->GetDY() - ypos;
if (mStaveModel != Detector::kIBModel4) {
ypos += (static_cast<TGeoBBox*>(mechStaveVol->GetShape()))->GetDY();
}
staveVol->AddNode(mechStaveVol, 1, new TGeoCombiTrans(0, -ypos, 0, new TGeoRotation("", 0, 0, 180)));
}
} else {
TGeoVolume* hstaveVol = createStaveOuterB();
if (mStaveModel == Detector::kOBModel0) { // Create simplified stave struct as in v0
staveVol->AddNode(hstaveVol, 0);
mHierarchy[kHalfStave] = 1;
} else { // (if mStaveModel) Create new stave struct as in TDR
xpos = (static_cast<TGeoBBox*>(hstaveVol->GetShape()))->GetDX() - sOBHalfStaveXOverlap / 2;
// ypos is now a parameter to avoid HS displacement wrt nominal radii
ypos = sOBHalfStaveYPos;
staveVol->AddNode(hstaveVol, 0, new TGeoTranslation(-xpos, ypos + sOBHalfStaveYTrans, 0));
staveVol->AddNode(hstaveVol, 1, new TGeoTranslation(xpos, ypos, 0));
mHierarchy[kHalfStave] = 2; // RS
mechStaveVol = createSpaceFrameOuterB();
if (mechStaveVol) {
if (mBuildLevel < 6) { // Carbon
staveVol->AddNode(mechStaveVol, 1,
new TGeoCombiTrans(0, -sOBSFrameULegHeight1, 0, new TGeoRotation("", 180, 0, 0)));
}
}
}
}
staveVol->GetShape()->ComputeBBox(); // RS: enfore recompting of BBox
// Done, return the stave
return staveVol;
}
TGeoVolume* V3Layer::createStaveInnerB(const TGeoManager* mgr)
{
Double_t xmod, ymod, zmod;
const Int_t nameLen = 30;
char volumeName[nameLen];
// First we create the module (i.e. the HIC with 9 chips)
TGeoVolume* moduleVol = createModuleInnerB();
// Then we create the fake halfstave and the actual stave
xmod = (static_cast<TGeoBBox*>(moduleVol->GetShape()))->GetDX();
ymod = (static_cast<TGeoBBox*>(moduleVol->GetShape()))->GetDY();
zmod = (static_cast<TGeoBBox*>(moduleVol->GetShape()))->GetDZ();
TGeoBBox* hstave = new TGeoBBox(xmod, ymod, zmod);
TGeoMedium* medAir = mgr->GetMedium("ITS_AIR$");
snprintf(volumeName, nameLen, "%s%d", GeometryTGeo::getITSHalfStavePattern(), mLayerNumber);
TGeoVolume* hstaveVol = new TGeoVolume(volumeName, hstave, medAir);
// Finally build it up
hstaveVol->AddNode(moduleVol, 0);
mHierarchy[kModule] = 1;
// Done, return the stave structure
return hstaveVol;
}
TGeoVolume* V3Layer::createModuleInnerB(const TGeoManager* mgr)
{
Double_t xtot, ytot, ztot, xchip, zchip, ymod;
Double_t xpos, ypos, zpos;
Bool_t dummyChip;
const Int_t nameLen = 30;
char chipName[nameLen], sensName[nameLen], volumeName[nameLen];
// For material budget studies
if (mBuildLevel < 6) {
dummyChip = kFALSE; // will be made of Si
} else {
dummyChip = kTRUE; // will be made of Air
}
// First create the single chip
snprintf(chipName, nameLen, "%s%d", GeometryTGeo::getITSChipPattern(), mLayerNumber);
snprintf(sensName, nameLen, "%s%d", GeometryTGeo::getITSSensorPattern(), mLayerNumber);
ymod = 0.5 * mChipThickness;
TGeoVolume* chipVol = AlpideChip::createChip(ymod, mSensorThickness / 2, chipName, sensName, dummyChip);
xchip = (static_cast<TGeoBBox*>(chipVol->GetShape()))->GetDX();
zchip = (static_cast<TGeoBBox*>(chipVol->GetShape()))->GetDZ();
mIBModuleZLength = 2 * zchip * sIBChipsPerRow + (sIBChipsPerRow - 1) * sIBChipZGap;
// Then create the Glue, the Kapton and the two Aluminum cables
xtot = xchip + (sIBFPCWiderXPlus + sIBFPCWiderXNeg) / 2;
ztot = mIBModuleZLength / 2;
TGeoBBox* glue = new TGeoBBox(xchip, sIBGlueThick / 2, ztot);
TGeoBBox* kapCable = new TGeoBBox(xtot, sIBFlexCableKapThick / 2, ztot);
TGeoVolume* aluGndCableVol = createIBFPCAlGnd(xtot, ztot);
TGeoVolume* aluAnodeCableVol = createIBFPCAlAnode(xtot, ztot);
// Finally create the module and populate it with the chips
// (and the FPC Kapton and Aluminum in the most recent IB model)
Double_t ygnd = (static_cast<TGeoBBox*>(aluGndCableVol->GetShape()))->GetDY();
Double_t yano = (static_cast<TGeoBBox*>(aluAnodeCableVol->GetShape()))->GetDY();
ytot = ymod;
if (mStaveModel == Detector::kIBModel4) {
ytot += (sIBGlueThick / 2 + ygnd + sIBFlexCableKapThick / 2 + yano + sIBFlexCapacitorYHi / 2);
}
TGeoBBox* module = new TGeoBBox(xtot, ytot, ztot);
// Now the volumes
TGeoMedium* medAir = mgr->GetMedium("ITS_AIR$");
TGeoMedium* medKapton = mgr->GetMedium("ITS_KAPTON(POLYCH2)$");
TGeoMedium* medGlue = mgr->GetMedium("ITS_GLUE_IBFPC$");
snprintf(volumeName, nameLen, "%s%d", GeometryTGeo::getITSModulePattern(), mLayerNumber);
TGeoVolume* modVol = new TGeoVolume(volumeName, module, medAir);
TGeoVolume* glueVol = new TGeoVolume("FPCGlue", glue, medGlue);
glueVol->SetLineColor(kBlack);
glueVol->SetFillColor(kBlack);
TGeoVolume* kapCableVol = new TGeoVolume("FPCKapton", kapCable, medKapton);
kapCableVol->SetLineColor(kBlue);
kapCableVol->SetFillColor(kBlue);
// Build up the module
// Chips are rotated by 180deg around Y axis
// in order to have the correct X and Z axis orientation
xpos = -xtot + (static_cast<TGeoBBox*>(chipVol->GetShape()))->GetDX() + sIBFPCWiderXNeg;
ypos = -ytot + ymod; // = 0 if not kIBModel4
for (Int_t j = 0; j < sIBChipsPerRow; j++) {
zpos = ztot - j * (2 * zchip + sIBChipZGap) - zchip;
modVol->AddNode(chipVol, j, new TGeoCombiTrans(xpos, ypos, zpos, new TGeoRotation("", 0, 180, 180)));
mHierarchy[kChip]++;
}
if (mStaveModel == Detector::kIBModel4) {
ypos += (ymod + glue->GetDY());
if (mBuildLevel < 2) { // Glue
modVol->AddNode(glueVol, 1, new TGeoTranslation(xpos, ypos, 0));
}
ypos += glue->GetDY();
if (mBuildLevel < 4) { // Kapton
ypos += ygnd;
modVol->AddNode(aluGndCableVol, 1, new TGeoTranslation(0, ypos, 0));
ypos += (ygnd + kapCable->GetDY());
modVol->AddNode(kapCableVol, 1, new TGeoTranslation(0, ypos, 0));
ypos += (kapCable->GetDY() + yano);
modVol->AddNode(aluAnodeCableVol, 1, new TGeoTranslation(0, ypos, 0));
ypos += yano;
}
}
// Add the capacitors
createIBCapacitors(modVol, zchip, ypos);
// Done, return the module
return modVol;
}
void V3Layer::createIBCapacitors(TGeoVolume* modvol, Double_t zchip, Double_t yzero, const TGeoManager* mgr)
{
//
// Adds the capacitors to the IB FPC
//
// Created: 13 Feb 2018 Mario Sitta
// Updated: 03 Apr 2019 Mario Sitta Fix positions (180' rotation)
//
// Position of the various capacitors (A.Junique private communication
// where: X_capacitor = Z_module , Y_capacitor = X_module)
// Capacitors (different groups)
const Double_t xGroup1A = 4265.9 * sMicron;
const Double_t zGroup1A[2] = {-7142.9 * sMicron, 7594.1 * sMicron};
const Double_t xGroup1B = 690.9 * sMicron;
const Double_t zGroup1B = -7142.9 * sMicron;
const Double_t xGroup2 = 6300.0 * sMicron;
const Double_t zGroup2 = 15075.0 * sMicron;
const Double_t xGroup3 = 5575.0 * sMicron;
const Double_t zGroup3 = 131900.0 * sMicron;
const Double_t xGroup4[2] = {5600.0 * sMicron, 5575.0 * sMicron};
const Double_t zGroup4[sIBChipsPerRow] = {275.0 * sMicron, 250.0 * sMicron, 275.0 * sMicron,
250.0 * sMicron, 250.0 * sMicron, 300.0 * sMicron,
250.0 * sMicron, 300.0 * sMicron, 250.0 * sMicron};
const Int_t nGroup5A = 5, nGroup5B = 4;
const Double_t xGroup5A[2] = {1400.0 * sMicron, 1350.0 * sMicron};
const Double_t zGroup5A[nGroup5A] = {-112957.5 * sMicron, -82854.5 * sMicron, 7595.5 * sMicron, 37745.5 * sMicron,
128194.1 * sMicron};
const Double_t xGroup5B = 1100.0 * sMicron;
const Double_t zGroup5B[nGroup5B] = {-51525.0 * sMicron, -21375.0 * sMicron, 69075.0 * sMicron, 99225.0 * sMicron};
// Resistors
const Int_t nResist = 2;
const Double_t xResist = -7975.0 * sMicron;
const Double_t zResist[nResist] = {114403.0 * sMicron, 119222.0 * sMicron};
Double_t xpos, ypos, zpos;
Int_t nCapacitors;
TGeoVolume *capacitor, *resistor;
// Check whether we already have the volume, otherwise create it
// (so as to avoid creating multiple copies of the very same volume
// for each layer)
capacitor = mgr->GetVolume("IBFPCCapacitor");
if (!capacitor) {
TGeoBBox* capsh = new TGeoBBox(sIBFlexCapacitorXWid / 2, sIBFlexCapacitorYHi / 2, sIBFlexCapacitorZLen / 2);
TGeoMedium* medCeramic = mgr->GetMedium("ITS_CERAMIC$");
capacitor = new TGeoVolume("IBFPCCapacitor", capsh, medCeramic);
capacitor->SetLineColor(kBlack);
capacitor->SetFillColor(kBlack);
TGeoBBox* ressh = new TGeoBBox(sIBFlexCapacitorXWid / 2, // Resistors have
sIBFlexCapacitorYHi / 2, // the same dim's
sIBFlexCapacitorZLen / 2); // as capacitors
resistor = new TGeoVolume("IBFPCResistor", ressh, medCeramic);
resistor->SetLineColor(kBlack);
resistor->SetFillColor(kBlack);
} else { // Volumes already defined, get them
resistor = mgr->GetVolume("IBFPCResistor");
}
// Place all the capacitors (they are really a lot...)
ypos = yzero + sIBFlexCapacitorYHi / 2;
xpos = xGroup1A;
for (Int_t j = 0; j < sIBChipsPerRow; j++) {
zpos = -mIBModuleZLength / 2 + j * (2 * zchip + sIBChipZGap) + zchip + zGroup1A[0];
modvol->AddNode(capacitor, 2 * j + 1, new TGeoTranslation(-xpos, ypos, -zpos));
zpos = -mIBModuleZLength / 2 + j * (2 * zchip + sIBChipZGap) + zchip + zGroup1A[1];
modvol->AddNode(capacitor, 2 * j + 2, new TGeoTranslation(-xpos, ypos, -zpos));
}
nCapacitors = 2 * sIBChipsPerRow;
xpos = xGroup1B;
for (Int_t j = 0; j < sIBChipsPerRow; j++) {
zpos = -mIBModuleZLength / 2 + j * (2 * zchip + sIBChipZGap) + zchip + zGroup1B;
modvol->AddNode(capacitor, j + 1 + nCapacitors, new TGeoTranslation(-xpos, ypos, -zpos));
}
nCapacitors += sIBChipsPerRow;
xpos = xGroup2;
// We have only 8 in these group, missing the central one
for (Int_t j = 0; j < sIBChipsPerRow - 1; j++) {
zpos = -mIBModuleZLength / 2 + j * (2 * zchip + sIBChipZGap) + zchip + zGroup2;
modvol->AddNode(capacitor, j + 1 + nCapacitors, new TGeoTranslation(-xpos, ypos, -zpos));
}
nCapacitors += (sIBChipsPerRow - 1);
xpos = xGroup3;
zpos = zGroup3;
modvol->AddNode(capacitor, 1 + nCapacitors, new TGeoTranslation(-xpos, ypos, -zpos));
nCapacitors++;
for (Int_t j = 0; j < sIBChipsPerRow; j++) {
if (j == (sIBChipsPerRow - 1)) {
xpos = xGroup4[1];
} else {
xpos = xGroup4[0];
}
zpos = -mIBModuleZLength / 2 + j * (2 * zchip + sIBChipZGap) + zchip + zGroup4[j];
modvol->AddNode(capacitor, j + 1 + nCapacitors, new TGeoTranslation(-xpos, ypos, -zpos));
}
nCapacitors += sIBChipsPerRow;
for (Int_t j = 0; j < nGroup5A; j++) {
if (j == 0) {
xpos = xGroup5A[0];
} else {
xpos = xGroup5A[1];
}
zpos = zGroup5A[j];
modvol->AddNode(capacitor, j + 1 + nCapacitors, new TGeoTranslation(-xpos, ypos, -zpos));
}
nCapacitors += nGroup5A;
xpos = xGroup5B;
for (Int_t j = 0; j < nGroup5B; j++) {
zpos = zGroup5B[j];
modvol->AddNode(capacitor, j + 1 + nCapacitors, new TGeoTranslation(-xpos, ypos, -zpos));
}
// Place the resistors
xpos = xResist;
for (Int_t j = 0; j < nResist; j++) {
zpos = zResist[j];
modvol->AddNode(resistor, j + 1, new TGeoTranslation(-xpos, ypos, -zpos));
}
}
TGeoVolume* V3Layer::createIBFPCAlGnd(const Double_t xcable, const Double_t zcable, const TGeoManager* mgr)
{
//
// Create the IB FPC Aluminum Ground cable
//
// Created: 20 Oct 2017 Mario Sitta
//
Double_t ytot, ypos;
// First create all needed shapes
ytot = sIBFlexCablePolyThick + sIBFlexCableAlThick;
TGeoBBox* coverlay = new TGeoBBox(xcable, ytot / 2, zcable);
TGeoBBox* aluminum = new TGeoBBox(xcable, sIBFlexCableAlThick / 2, zcable);
// Then the volumes
TGeoMedium* medKapton = mgr->GetMedium("ITS_KAPTON(POLYCH2)$");
TGeoMedium* medAluminum = mgr->GetMedium("ITS_ALUMINUM$");
TGeoVolume* coverlayVol = new TGeoVolume("FPCCoverlayGround", coverlay, medKapton);
coverlayVol->SetLineColor(kBlue);
coverlayVol->SetFillColor(kBlue);
TGeoVolume* aluminumVol = new TGeoVolume("FPCAluminumGround", aluminum, medAluminum);
aluminumVol->SetLineColor(kCyan);
aluminumVol->SetFillColor(kCyan);
ypos = coverlay->GetDY() - aluminum->GetDY();
if (mBuildLevel < 1) { // Aluminum
coverlayVol->AddNode(aluminumVol, 1, new TGeoTranslation(0, ypos, 0));
}
return coverlayVol;
}
TGeoVolume* V3Layer::createIBFPCAlAnode(const Double_t xcable, const Double_t zcable, const TGeoManager* mgr)
{
//
// Create the IB FPC Aluminum Anode cable
//
//
// Created: 20 Oct 2017 Mario Sitta
// Updated: 03 Apr 2019 Mario Sitta Fix Al position (180' rotation)
//
Double_t ytot, ypos;
Double_t xtru[4], ytru[4];
// First create all needed shapes
ytot = sIBFlexCablePolyThick + sIBFlexCableAlThick;
TGeoBBox* coverlay = new TGeoBBox(xcable, ytot / 2, zcable);
// A trapezoid
xtru[0] = -sIBFPCAlAnodeWidth2 / 2;
ytru[0] = -zcable;
xtru[1] = sIBFPCAlAnodeWidth2 / 2;
ytru[1] = ytru[0];
xtru[2] = xtru[0] + sIBFPCAlAnodeWidth1;
ytru[2] = zcable;
xtru[3] = xtru[0];
ytru[3] = ytru[2];
TGeoXtru* aluminum = new TGeoXtru(2);
aluminum->DefinePolygon(4, xtru, ytru);
aluminum->DefineSection(0, -sIBFlexCableAlThick / 2);
aluminum->DefineSection(1, sIBFlexCableAlThick / 2);
// Then the volumes
TGeoMedium* medKapton = mgr->GetMedium("ITS_KAPTON(POLYCH2)$");
TGeoMedium* medAluminum = mgr->GetMedium("ITS_ALUMINUM$");
TGeoVolume* coverlayVol = new TGeoVolume("FPCCoverlayAnode", coverlay, medKapton);
coverlayVol->SetLineColor(kBlue);
coverlayVol->SetFillColor(kBlue);
TGeoVolume* aluminumVol = new TGeoVolume("FPCAluminumAnode", aluminum, medAluminum);
aluminumVol->SetLineColor(kCyan);
aluminumVol->SetFillColor(kCyan);
ypos = -coverlay->GetDY() + aluminum->GetZ(1);
if (mBuildLevel < 1) { // Aluminum
coverlayVol->AddNode(aluminumVol, 1, new TGeoCombiTrans(0, ypos, 0, new TGeoRotation("", 0, -90, 0)));
}
return coverlayVol;
}
TGeoVolume* V3Layer::createStaveStructInnerB(const TGeoManager* mgr)
{
//
// Create the mechanical stave structure
//
// Created: 22 Mar 2013 Chinorat Kobdaj
// Updated: 26 Apr 2013 Mario Sitta
// Updated: 04 Apr 2017 Mario Sitta O2 version - All models obsolete except last one
// Updated: 25 Jan 2018 Mario Sitta Stave width is now a constant
//
TGeoVolume* mechStavVol = nullptr;
switch (mStaveModel) {
case Detector::kIBModelDummy:
mechStavVol = createStaveModelInnerBDummy(mgr);
break;
case Detector::kIBModel0:
case Detector::kIBModel1:
case Detector::kIBModel21:
case Detector::kIBModel22:
case Detector::kIBModel3:
LOG(FATAL) << "Stave model " << mStaveModel << " obsolete and no longer supported";
break;
case Detector::kIBModel4:
mechStavVol = createStaveModelInnerB4(mgr);
break;
default:
LOG(FATAL) << "Unknown stave model " << mStaveModel;
break;
}
return mechStavVol;
}
TGeoVolume* V3Layer::createStaveModelInnerBDummy(const TGeoManager*) const
{
//
// Create dummy stave
//
// Created: 22 Mar 2013 Chinorat Kobdaj
// Updated: 26 Apr 2013 Mario Sitta
// Updated: 04 Apr 2017 Mario Sitta O2 version
//
// Done, return the stave structur
return nullptr;
}
// model4
//________________________________________________________________________
TGeoVolume* V3Layer::createStaveModelInnerB4(const TGeoManager* mgr)
{
//
// Create the mechanical stave structure for Model 4 of TDR
//
// Input:
// mgr : the GeoManager (used only to get the proper material)
//
// Output:
//
// Return:
//
// Created: 04 Dec 2014 Mario Sitta
// Updated: 03 Mar 2015 Mario Sitta FPC in right position (beyond chip)
// Updated: 06 Mar 2015 Mario Sitta Space Frame corrected (C.G. data)
// Updated: 30 Apr 2015 Mario Sitta End-stave connectors added
// Updated: 04 Apr 2017 Mario Sitta O2 version
// Updated: 25 Jan 2018 Mario Sitta Stave width is now a constant
// Updated: 03 Feb 2018 Mario Sitta To last drawings (ALIITSUP0051)
//
// Local parameters
const Double_t xstave = sIBColdPlateWidth / 2;
Double_t layerHeight = 0.;
Double_t rPipeMin = sIBCoolPipeInnerD / 2;
Double_t rPipeMax = rPipeMin + sIBCoolPipeThick;
const Int_t nv = 16;
Double_t xv[nv], yv[nv]; // The stave container Xtru
Double_t xlen, ylen, zlen, ztot;
Double_t xpos, ypos, zpos, ylay, yposPipe;
Double_t beta, gamma, theta;
// First create all needed shapes
ztot = sIBColdPlateZLen / 2;
TGeoBBox* glue = new TGeoBBox(xstave, sIBGlueThick / 2, ztot);
TGeoBBox* fleecbot = new TGeoBBox(xstave, sIBCarbonFleeceThick / 2, ztot);
TGeoBBox* cfplate = new TGeoBBox(xstave, sIBK13D2UThick / 2, ztot);
TGeoTube* pipe = new TGeoTube(rPipeMin, rPipeMax, sIBCoolPipeZLen / 2);
TGeoTube* water = new TGeoTube(0., rPipeMin, sIBCoolPipeZLen / 2);
TGeoTubeSeg* cpaptub = new TGeoTubeSeg(rPipeMax, rPipeMax + sIBCarbonPaperThick, sIBCarbonPaperZLen / 2, 0, 180);
TGeoBBox* cpapvert = new TGeoBBox(sIBCarbonPaperThick / 2, pipe->GetRmax() / 2, sIBCarbonPaperZLen / 2);
xlen = sIBCoolPipeXDist / 2 - pipe->GetRmax() - sIBCarbonPaperThick;
TGeoBBox* cpapmid = new TGeoBBox(xlen, sIBCarbonPaperThick / 2, sIBCarbonPaperZLen / 2);
xlen = sIBCarbonPaperWidth / 2 - sIBCoolPipeXDist / 2 - pipe->GetRmax() - sIBCarbonPaperThick;
TGeoBBox* cpaplr = new TGeoBBox(xlen / 2, sIBCarbonPaperThick / 2, sIBCarbonPaperZLen / 2);
TGeoTubeSeg* fleecpipe = new TGeoTubeSeg(cpaptub->GetRmax(), cpaptub->GetRmax() + sIBCarbonFleeceThick, ztot, 0, 180);
TGeoBBox* fleecvert = new TGeoBBox(sIBCarbonFleeceThick / 2, (pipe->GetRmax() - sIBCarbonPaperThick) / 2, ztot);
xlen = sIBCoolPipeXDist / 2 - pipe->GetRmax() - sIBCarbonPaperThick - sIBCarbonFleeceThick;
TGeoBBox* fleecmid = new TGeoBBox(xlen, sIBCarbonFleeceThick / 2, ztot);
xlen = xstave - sIBCoolPipeXDist / 2 - pipe->GetRmax() - sIBCarbonPaperThick - sIBCarbonFleeceThick;
TGeoBBox* fleeclr = new TGeoBBox(xlen / 2, sIBCarbonFleeceThick / 2, ztot);
// The total height of the layer can now be computed
layerHeight = 2 * (glue->GetDY() + fleecbot->GetDY() + cfplate->GetDY() + cpaplr->GetDY() + fleeclr->GetDY());
// The spaceframe structure
TGeoTrd1* topv = new TGeoTrd1(sIBTopVertexWidth1 / 2, sIBTopVertexWidth2 / 2, ztot, sIBTopVertexHeight / 2);
xv[0] = 0;
yv[0] = 0;
xv[1] = sIBSideVertexWidth;
yv[1] = yv[0];
xv[2] = xv[0];
yv[2] = sIBSideVertexHeight;
TGeoXtru* sidev = new TGeoXtru(2);
sidev->DefinePolygon(3, xv, yv);