Project
Loading...
Searching...
No Matches
Segmentation.cxx
Go to the documentation of this file.
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
14
17#include <cstdio>
18
19namespace o2
20{
21
22namespace iotof
23{
24
25std::unique_ptr<o2::iotof::Segmentation> Segmentation::sInstance;
26
27Segmentation* Segmentation::Instance()
28{
29 if (!sInstance) {
30 sInstance = std::unique_ptr<Segmentation>(new Segmentation());
31 }
32 return sInstance.get();
33}
34
35Segmentation::Segmentation()
36{
37 if (sInstance) {
38 printf("Invalid use of public constructor: o2::iotof::Segmentation instance exists\n");
39 } else {
40 auto& iotofPars = IOTOFBaseParam::Instance();
41 const ChipSpecifics& mITofChipPars = iotofPars.iTofChipSpecifics;
42 const ChipSpecifics& mOTofChipPars = iotofPars.oTofChipSpecifics;
43
44 configChip(mITofChipPars, 0 /* subDetectorID for iTOF */);
45 configChip(mOTofChipPars, 1 /* subDetectorID for oTOF */);
46 }
47}
48
49void Segmentation::configChip(const int nCols, const int nRows, const float pitchCol, const float pitchRow, const float passiveEdgeReadOut,
50 const float passiveEdgeTop, const float passiveEdgeSide, const float sensorLayerThicknessEff, const float sensorLayerThickness, const int subDetectorID)
51{
52 if (subDetectorID == 0) {
53 mITofSpecsConfig = ChipSpecifics(nCols, nRows, pitchCol, pitchRow, passiveEdgeReadOut, passiveEdgeTop, passiveEdgeSide, sensorLayerThicknessEff, sensorLayerThickness);
54 } else if (subDetectorID == 1) {
55 mOTofSpecsConfig = ChipSpecifics(nCols, nRows, pitchCol, pitchRow, passiveEdgeReadOut, passiveEdgeTop, passiveEdgeSide, sensorLayerThicknessEff, sensorLayerThickness);
56 } else {
57 printf("Invalid subDetectorID %d. Must be 0 (iTOF) or 1 (oTOF). No configuration applied.\n", subDetectorID);
58 }
59}
60
61void Segmentation::configChip(const ChipSpecifics& specsConfig, const int subDetectorID)
62{
63 if (subDetectorID == 0) {
64 mITofSpecsConfig = specsConfig;
65 } else if (subDetectorID == 1) {
66 mOTofSpecsConfig = specsConfig;
67 } else {
68 printf("Invalid subDetectorID %d. Must be 0 (iTOF) or 1 (oTOF). No configuration applied.\n", subDetectorID);
69 }
70}
71
73{
74 // iTOF specs
75 printf("iTOF specs:\n");
76 printf("Pixel size: %.2f (along %d rows) %.2f (along %d columns) microns\n", mITofSpecsConfig.PitchRow * 1e4, mITofSpecsConfig.NRows, mITofSpecsConfig.PitchCol * 1e4, mITofSpecsConfig.NCols);
77 printf("Passive edges: bottom: %.2f, top: %.2f, left/right: %.2f microns\n", mITofSpecsConfig.PassiveEdgeReadOut * 1e4, mITofSpecsConfig.PassiveEdgeTop * 1e4, mITofSpecsConfig.PassiveEdgeSide * 1e4);
78 printf("Active/Total size: %.6f/%.6f (rows) %.6f/%.6f (cols) cm\n", mITofSpecsConfig.ActiveMatrixSizeRows(), mITofSpecsConfig.SensorSizeRows(), mITofSpecsConfig.ActiveMatrixSizeCols(), mITofSpecsConfig.SensorSizeCols());
79
80 // oTOF specs
81 printf("oTOF specs:\n");
82 printf("Pixel size: %.2f (along %d rows) %.2f (along %d columns) microns\n", mOTofSpecsConfig.PitchRow * 1e4, mOTofSpecsConfig.NRows, mOTofSpecsConfig.PitchCol * 1e4, mOTofSpecsConfig.NCols);
83 printf("Passive edges: bottom: %.2f, top: %.2f, left/right: %.2f microns\n", mOTofSpecsConfig.PassiveEdgeReadOut * 1e4, mOTofSpecsConfig.PassiveEdgeTop * 1e4, mOTofSpecsConfig.PassiveEdgeSide * 1e4);
84 printf("Active/Total size: %.6f/%.6f (rows) %.6f/%.6f (cols) cm\n", mOTofSpecsConfig.ActiveMatrixSizeRows(), mOTofSpecsConfig.SensorSizeRows(), mOTofSpecsConfig.ActiveMatrixSizeCols(), mOTofSpecsConfig.SensorSizeCols());
85}
86
87} // namespace iotof
88} // namespace o2
89
Definition of the Segmentation class.
ClassImp(o2::iotof::Segmentation)
ChipSpecifics mOTofSpecsConfig
void configChip(const int nCols, const int nRows, const float pitchCol, const float pitchRow, const float passiveEdgeReadOut, const float passiveEdgeTop, const float passiveEdgeSide, const float sensorLayerThicknessEff, const float sensorLayerThickness, const int subDetectorID)
ChipSpecifics mITofSpecsConfig
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
float ActiveMatrixSizeRows() const
float ActiveMatrixSizeCols() const