ATLAS Offline Software
TRTParametersForEndCapHits.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // Class header
7 
8 // Package headers
10 
11 // Athena headers
12 #include "TRT_G4Utilities/TRTOutputFile.hh"
13 #include "TRT_G4Utilities/TRTParameters.hh"
14 
15 // STL headers
16 #include <fstream>
17 
18 // Called by TRTSensitiveDetector::InitializeHitProcessing
19 
21 (TRTProcessingOfEndCapHits* pProcessing): m_pProcessingOfEndCapHits(pProcessing),
22  m_verboseLevel(pProcessing->m_verboseLevel)
23 {
24  m_pParameters = TRTParameters::GetPointer();
25 
26  m_printMessages = m_pParameters->GetInteger("PrintMessages"); //FIXME not used?
27 
28 
29  if (m_verboseLevel>5) { G4cout << "######### Constructor TRTParametersForEndCapHits" << G4endl; }
30 
31  this->DefineParameters();
32 
33  if (m_pParameters->GetInteger("PrintParametersForEndCapHits"))
34  this->PrintParameters();
35 
36  if (m_verboseLevel>5) { G4cout << "######### Constructor TRTParametersForEndCapHits done" << G4endl; }
37 
38 }
39 
40 
41 // Called by TRTSensitiveDetector::InitializeHitProcessing
42 
44 {
45  if (m_verboseLevel>5) { G4cout << "######### Destructor TRTParametersForEndCapHits" << G4endl; }
46  if (m_verboseLevel>5) { G4cout << "######### Destructor TRTParametersForEndCapHits done" << G4endl; }
47 }
48 
49 
50 // Called by TRTParametersForEndCapHits
51 
53 {
54 
55  if (m_verboseLevel>5) { G4cout << "######### TRTParametersForEndCapHits::DefineParameters" << G4endl; }
56 
57  int numberOfStrawsInPlanesAB =
58  m_pParameters->GetInteger("NumberOfStrawsInPlanesAB");
59  int numberOfStrawsInPlaneC =
60  m_pParameters->GetInteger("NumberOfStrawsInPlaneC");
61 
62  m_pProcessingOfEndCapHits->m_numberOfStrawsInPlanesAB = numberOfStrawsInPlanesAB;
63  m_pProcessingOfEndCapHits->m_numberOfStrawsInPlaneC = numberOfStrawsInPlaneC;
64 
65  int numberOfWheelsA
66  = m_pParameters->GetInteger("NumberOfWheelsA");
67  int numberOfWheelsB = m_pParameters->GetInteger("NumberOfWheelsB");
68  // int numberOfWheelsC = m_pParameters->GetInteger("NumberOfWheelsC"); // There were no c-wheels ever built :(
69 
70  int numberOfWheelsAB = numberOfWheelsA + numberOfWheelsB;
71 
73 
74  int numberOfIdentifierSectors =
75  m_pParameters->GetInteger("NumberOfIdentifierSectors");
77  numberOfStrawsInPlanesAB / numberOfIdentifierSectors;
79  numberOfStrawsInPlaneC / numberOfIdentifierSectors;
80 
81  if (m_pParameters->GetInteger("SectorsABC"))
82  {
83  int numberOfSectorsAB = m_pParameters->GetInteger("NumberOfSectorsAB");
84  int numberOfSectorsC = m_pParameters->GetInteger("NumberOfSectorsC");
85  int numberOfStrawsInSectorsAB = numberOfStrawsInPlanesAB /
86  numberOfSectorsAB;
87  int numberOfStrawsInSectorC = numberOfStrawsInPlaneC / numberOfSectorsC;
89  numberOfStrawsInSectorsAB;
90  m_pProcessingOfEndCapHits->m_numberOfStrawsInSectorC = numberOfStrawsInSectorC;
92  numberOfStrawsInSectorsAB / 2 - 1;
94  numberOfStrawsInSectorC / 2 - 1;
95  }
96 
97 
98  if (m_verboseLevel>5) { G4cout << "######### TRTParametersForEndCapHits::DefineParameters done" << G4endl; }
99 
100 }
101 
102 
103 // Called by TRTParametersForEndCapHits
104 
106 {
107  if (m_verboseLevel>5) { G4cout << "######### Method TRTParametersForEndCapHits::PrintParameters" << G4endl; }
108 
109  int wheelsC = m_pParameters->GetInteger("WheelsC");
110 
111  TRTOutputFile* pOutputFile = TRTOutputFile::GetPointer();
112 
113  std::ofstream& output = pOutputFile->GetReference();
114 
115  output << std::endl;
116  output << "***** TRTParametersForEndCapHits::PrintParameters *****"
117  << std::endl;
118 
119  output << "Parameters of end-cap straws:" << std::endl;
120  output << " numberOfStrawsInPlanesAB="
122  if (wheelsC)
123  output << " numberOfStrawsInPlaneC="
125 
126  output << " numberOfStrawsInIDSectorsAB="
128  if (wheelsC)
129  output << " numberOfStrawsInIDSectorC="
131 
132 
133  if (m_pParameters->GetInteger("SectorsABC"))
134  {
135  output << " numberOfStrawsInSectorsAB="
137  if (wheelsC)
138  output << " numberOfStrawsInSectorC="
140 
141  output << " initialStrawIDInSectorsAB="
143  if (wheelsC)
144  output << " initialStrawIDInSectorC="
146  }
147 
148  output << std::endl << "Parameters of end-cap wheels:" << std::endl;
149 
150  output << " numberOfWheelsAB=" << m_pProcessingOfEndCapHits->m_numberOfWheelsAB
151  << std::endl;
152 
153  output << std::endl;
154 
155  if (m_verboseLevel>5) { G4cout << "######### Method TRTParametersForEndCapHits::PrintParameters done" << G4endl; }
156 
157 }
TRTProcessingOfEndCapHits
Definition: TRTProcessingOfEndCapHits.h:16
TRTParametersForEndCapHits.h
TRTProcessingOfEndCapHits.h
TRTProcessingOfEndCapHits::m_initialStrawIDInSectorC
int m_initialStrawIDInSectorC
Definition: TRTProcessingOfEndCapHits.h:44
TRTProcessingOfEndCapHits::m_numberOfWheelsAB
int m_numberOfWheelsAB
Definition: TRTProcessingOfEndCapHits.h:39
TRTProcessingOfEndCapHits::m_numberOfStrawsInPlanesAB
int m_numberOfStrawsInPlanesAB
Definition: TRTProcessingOfEndCapHits.h:36
TRTParametersForEndCapHits::PrintParameters
void PrintParameters() const
Definition: TRTParametersForEndCapHits.cxx:105
TRTProcessingOfEndCapHits::m_numberOfStrawsInSectorC
int m_numberOfStrawsInSectorC
Definition: TRTProcessingOfEndCapHits.h:42
TRTProcessingOfEndCapHits::m_numberOfStrawsInSectorsAB
int m_numberOfStrawsInSectorsAB
Definition: TRTProcessingOfEndCapHits.h:41
TRTParametersForEndCapHits::m_pParameters
const TRTParameters * m_pParameters
Definition: TRTParametersForEndCapHits.h:25
TRTParametersForEndCapHits::DefineParameters
void DefineParameters() const
Definition: TRTParametersForEndCapHits.cxx:52
TRTParametersForEndCapHits::~TRTParametersForEndCapHits
~TRTParametersForEndCapHits()
Definition: TRTParametersForEndCapHits.cxx:43
TRTParametersForEndCapHits::m_printMessages
int m_printMessages
Definition: TRTParametersForEndCapHits.h:23
TRTParametersForEndCapHits::m_pProcessingOfEndCapHits
TRTProcessingOfEndCapHits * m_pProcessingOfEndCapHits
Definition: TRTParametersForEndCapHits.h:26
TRTProcessingOfEndCapHits::m_initialStrawIDInSectorsAB
int m_initialStrawIDInSectorsAB
Definition: TRTProcessingOfEndCapHits.h:43
merge.output
output
Definition: merge.py:17
TRTParametersForEndCapHits::TRTParametersForEndCapHits
TRTParametersForEndCapHits(TRTProcessingOfEndCapHits *)
Definition: TRTParametersForEndCapHits.cxx:21
TRTParametersForEndCapHits::m_verboseLevel
int m_verboseLevel
Definition: TRTParametersForEndCapHits.h:28
TRTProcessingOfEndCapHits::m_numberOfStrawsInPlaneC
int m_numberOfStrawsInPlaneC
Definition: TRTProcessingOfEndCapHits.h:37
TRTProcessingOfEndCapHits::m_numberOfStrawsInIDSectorC
int m_numberOfStrawsInIDSectorC
Definition: TRTProcessingOfEndCapHits.h:47
TRTProcessingOfEndCapHits::m_numberOfStrawsInIDSectorsAB
int m_numberOfStrawsInIDSectorsAB
Definition: TRTProcessingOfEndCapHits.h:46