|
| 1 | +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. |
| 2 | +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. |
| 3 | +// All rights not expressly granted are reserved. |
| 4 | +// |
| 5 | +// This software is distributed under the terms of the GNU General Public |
| 6 | +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". |
| 7 | +// |
| 8 | +// In applying this license CERN does not waive the privileges and immunities |
| 9 | +// granted to it by virtue of its status as an Intergovernmental Organization |
| 10 | +// or submit itself to any jurisdiction. |
| 11 | + |
| 12 | + |
| 13 | +/// \file FT3Materials.h |
| 14 | +/// \brief Materials of the FT3 detector, and access to the media made from them |
| 15 | + |
| 16 | +#ifndef FT3MATERIALS_H |
| 17 | +#define FT3MATERIALS_H |
| 18 | + |
| 19 | +#include <array> |
| 20 | +#include <unordered_map> |
| 21 | +#include <TColor.h> |
| 22 | + |
| 23 | +class TGeoMedium; |
| 24 | + |
| 25 | +namespace o2::ft3 |
| 26 | +{ |
| 27 | +namespace Materials |
| 28 | +{ |
| 29 | +// The name FT3 registers itself under with the MaterialManager. getMedium() |
| 30 | +// looks media up under this key, so it has to be the same name the Detector |
| 31 | +// hands to DetImpl<Detector>. |
| 32 | +constexpr const char* moduleName = "FT3"; |
| 33 | + |
| 34 | +/* |
| 35 | + * Materials of the FT3 detector. |
| 36 | + * |
| 37 | + * Everything the simulation needs to know about a material lives in the |
| 38 | + * materials map below, keyed by its FT3-local ID: composition, density, |
| 39 | + * transport parameters and the colour its volumes are drawn in. |
| 40 | + * Detector::createMaterials() registers the whole map with the MaterialManager, |
| 41 | + * and FT3Module/FT3Layer reach the media through getMedium() below, so no ID, |
| 42 | + * density or colour is ever written out by hand. |
| 43 | + */ |
| 44 | +enum class MaterialID : unsigned { |
| 45 | + Air = 1, |
| 46 | + Silicon, |
| 47 | + Copper, |
| 48 | + Kapton, |
| 49 | + CarbonFiber, |
| 50 | + Epoxy, |
| 51 | + Aluminum, |
| 52 | + Foam, |
| 53 | + Water |
| 54 | +}; |
| 55 | + |
| 56 | +// Transport parameters of a medium, in the order expected by Detector::Medium() |
| 57 | +struct TrackingParams { |
| 58 | + float tmaxfd; // maximum field-induced angular deviation per step, degrees |
| 59 | + float stemax; // maximum step length, cm |
| 60 | + float deemax; // maximum fractional energy loss per step |
| 61 | + float epsil; // tracking precision, cm |
| 62 | + float stmin; // minimum step length, cm |
| 63 | +}; |
| 64 | + |
| 65 | +constexpr TrackingParams sensitiveTracking = {0.1f, 0.0075f, 0.1f, 1.0e-4f, 0.0f}; |
| 66 | +constexpr TrackingParams passiveTracking = {0.1f, 1.0f, 0.1f, 1.0e-4f, 0.0f}; |
| 67 | + |
| 68 | +// Maximum number of elements any of the mixtures below is built from |
| 69 | +constexpr unsigned maxMaterialComponents = 4; |
| 70 | +using ComponentArray = std::array<float, maxMaterialComponents>; |
| 71 | + |
| 72 | +struct MaterialProperties { |
| 73 | + const char* name; |
| 74 | + int colour; // ROOT colour every volume made of this material is drawn in |
| 75 | + float density; // g/cm3 |
| 76 | + // Radiation and nuclear interaction length, cm. Only single elements carry |
| 77 | + // them: Mixture() derives both from the composition and takes no such |
| 78 | + // arguments. A non-positive value lets the transport engine compute it. |
| 79 | + float radl; |
| 80 | + float absl; |
| 81 | + int nComponents; // 0: single element; > 0: mixture by weight; < 0: mixture by atom count |
| 82 | + ComponentArray a; // mass numbers; only a[0] is used for a single element |
| 83 | + ComponentArray z; // atomic numbers; only z[0] is used for a single element |
| 84 | + ComponentArray w; // weight fractions or atom counts; unused for a single element |
| 85 | + TrackingParams tracking; |
| 86 | +}; |
| 87 | + |
| 88 | +/* |
| 89 | + * Silicon, copper and carbon fibre are shared with TRK and are kept numerically |
| 90 | + * identical to its SILICON$, COPPER$ and CARBONFIBER$ (TRK Detector::createMaterials()), |
| 91 | + * down to the radiation lengths. Kapton, epoxy and aluminium have no TRK |
| 92 | + * counterpart: TRK models the flex as the effective FPC$ mixture instead. |
| 93 | + */ |
| 94 | +inline const std::unordered_map<MaterialID, MaterialProperties> materials = { |
| 95 | + // Air volumes get their colour set individually where they are built |
| 96 | + {MaterialID::Air, {"Air", kWhite, 1.20479e-3f, 0.0f, 0.0f, 4, {12.0107f, 14.0067f, 15.9994f, 39.948f}, {6.0f, 7.0f, 8.0f, 18.0f}, {0.000124f, 0.755267f, 0.231781f, 0.012827f}, passiveTracking}}, |
| 97 | + {MaterialID::Silicon, {"Silicon", kGreen, 2.33f, 9.36f, 999.0f, 0, {28.086f}, {14.0f}, {}, sensitiveTracking}}, |
| 98 | + // Copper planes of the end-of-stave cards: X0 = 1.436 cm |
| 99 | + {MaterialID::Copper, {"Copper", kOrange, 8.96f, 1.436f, 999.0f, 0, {63.546f}, {29.0f}, {}, passiveTracking}}, |
| 100 | + // Kapton: C22 H10 N2 O5, by weight fraction. Also the cooling pipe material. |
| 101 | + {MaterialID::Kapton, {"Kapton", kYellow, 1.346f, 0.0f, 0.0f, 4, {12.0107f, 1.00794f, 14.0067f, 15.999f}, {6.0f, 1.0f, 7.0f, 8.0f}, {0.5641f, 0.2564f, 0.0513f, 0.1282f}, passiveTracking}}, |
| 102 | + // Carbon fibre: density tuned so X0 ~ 27 cm, as in TRK |
| 103 | + // TODO: Check with Rene the exact type of carbon fiber |
| 104 | + {MaterialID::CarbonFiber, {"CarbonFiber", kGray + 1, 1.45f, 27.0f, 999.0f, 0, {12.0107f}, {6.0f}, {}, passiveTracking}}, |
| 105 | + // Epoxy: C18 H19 O3, by atom count (negative nComponents) |
| 106 | + {MaterialID::Epoxy, {"Epoxy", kBlue, 2.186f, 0.0f, 0.0f, -3, {12.0107f, 1.00794f, 15.999f}, {6.0f, 1.0f, 8.0f}, {18.0f, 19.0f, 3.0f}, passiveTracking}}, |
| 107 | + // No TRK counterpart; X0 and lambda are left to the transport engine |
| 108 | + {MaterialID::Aluminum, {"Aluminum", kBlack, 2.7f, 0.0f, 0.0f, 0, {26.98f}, {13.0f}, {}, passiveTracking}}, |
| 109 | + // Carbon foam core of the disk separation layer |
| 110 | + {MaterialID::Foam, {"Foam", kBlack, 0.17f, 0.0f, 0.0f, 0, {12.0107f}, {6.0f}, {}, passiveTracking}}, |
| 111 | + // Coolant inside the kapton pipes |
| 112 | + {MaterialID::Water, {"Water", kBlue, 1.064f, 0.0f, 0.0f, 0, {18.01528f}, {8.0f}, {}, passiveTracking}}}; |
| 113 | +// The inactive rim of a sensor is made of silicon as well, but is drawn |
| 114 | +// separately so that it can be told apart from the active area. |
| 115 | +const int SiInactiveColor = kRed; |
| 116 | +} // namespace Materials |
| 117 | + |
| 118 | +/// Retrieve one of the media registered by Detector::createMaterials(). |
| 119 | +/// |
| 120 | +/// A free function rather than a member of Detector: the media live in the |
| 121 | +/// MaterialManager singleton keyed by Materials::moduleName, not in the |
| 122 | +/// detector object, so the lookup needs no Detector instance. |
| 123 | +TGeoMedium* getMedium(Materials::MaterialID id); |
| 124 | +} // namespace o2::ft3 |
| 125 | + |
| 126 | +#endif // FT3MATERIALS_H |
0 commit comments