12 #include "TRT_G4Utilities/TRTOutputFile.hh"
13 #include "TRT_G4Utilities/TRTParameters.hh"
16 #include "G4ThreeVector.hh"
25 m_verboseLevel(pProcessing->m_verboseLevel)
31 if (
m_verboseLevel>5) { G4cout <<
"##### Constructor TRTParametersForBarrelHits" << G4endl; }
35 if (
m_pParameters->GetInteger(
"PrintParametersForBarrelHits"))
38 if (
m_verboseLevel>5) { G4cout <<
"##### Constructor TRTParametersForBarrelHits done" << G4endl; }
46 if (
m_verboseLevel>5) { G4cout <<
"##### Destructor TRTParametersForBarrelHits" << G4endl; }
47 if (
m_verboseLevel>5) { G4cout <<
"##### Destructor TRTParametersForBarrelHits done" << G4endl; }
55 if (
m_verboseLevel>5) { G4cout <<
"######### Method TRTParametersForBarrelHits::DefineParameters" << G4endl; }
58 int numberOfStrawLayersA =
60 int numberOfStrawLayersB =
62 int numberOfStrawLayersC =
66 int* numberOfStrawsInLayersA =
new int[numberOfStrawLayersA];
67 m_pParameters->GetIntegerArray(
"NumberOfStrawsInLayersA", numberOfStrawLayersA,
68 numberOfStrawsInLayersA);
70 int* integralDistributionOfStrawsA =
new int[numberOfStrawLayersA];
71 integralDistributionOfStrawsA[0] = numberOfStrawsInLayersA[0];
73 for (
i = 1;
i < numberOfStrawLayersA; ++
i)
74 integralDistributionOfStrawsA[
i] = integralDistributionOfStrawsA[
i - 1] +
75 numberOfStrawsInLayersA[
i];
77 for (
i = 0;
i < numberOfStrawLayersA; ++
i)
79 integralDistributionOfStrawsA[
i];
81 delete [] numberOfStrawsInLayersA;
84 int* numberOfStrawsInLayersB =
new int[numberOfStrawLayersB];
85 m_pParameters->GetIntegerArray(
"NumberOfStrawsInLayersB", numberOfStrawLayersB,
86 numberOfStrawsInLayersB);
88 int* integralDistributionOfStrawsB =
new int[numberOfStrawLayersB];
89 integralDistributionOfStrawsB[0] = numberOfStrawsInLayersB[0];
90 for (
i = 1;
i < numberOfStrawLayersB; ++
i)
91 integralDistributionOfStrawsB[
i] = integralDistributionOfStrawsB[
i - 1] +
92 numberOfStrawsInLayersB[
i];
94 for (
i = 0;
i < numberOfStrawLayersB; ++
i)
96 integralDistributionOfStrawsB[
i];
98 delete [] numberOfStrawsInLayersB;
101 int* numberOfStrawsInLayersC =
new int[numberOfStrawLayersC];
102 m_pParameters->GetIntegerArray(
"NumberOfStrawsInLayersC", numberOfStrawLayersC,
103 numberOfStrawsInLayersC);
105 int* integralDistributionOfStrawsC =
new int[numberOfStrawLayersC];
106 integralDistributionOfStrawsC[0] = numberOfStrawsInLayersC[0];
107 for (
i = 1;
i < numberOfStrawLayersC; ++
i)
108 integralDistributionOfStrawsC[
i] = integralDistributionOfStrawsC[
i - 1] +
109 numberOfStrawsInLayersC[
i];
111 for (
i = 0;
i < numberOfStrawLayersC; ++
i)
113 integralDistributionOfStrawsC[
i];
115 delete [] numberOfStrawsInLayersC;
123 if (
i + 1 > integralDistributionOfStrawsA[layerID])
131 if (
i + 1 > integralDistributionOfStrawsB[layerID])
139 if (
i + 1 > integralDistributionOfStrawsC[layerID])
145 delete [] integralDistributionOfStrawsA;
146 delete [] integralDistributionOfStrawsB;
147 delete [] integralDistributionOfStrawsC;
150 if (
m_verboseLevel>5) { G4cout <<
"######### Method TRTParametersForBarrelHits::DefineParameters done" << G4endl; }
160 if (
m_verboseLevel>5) { G4cout <<
"######### Method TRTParametersForBarrelHits::PrintParameters" << G4endl; }
162 TRTOutputFile* pOutputFile = TRTOutputFile::GetPointer();
164 std::ofstream&
output = pOutputFile->GetReference();
167 output <<
"***** TRTParametersForBarrelHits::PrintParameters *****"
170 output <<
"Parameters of barrel straws:" << std::endl;
178 output <<
" numberOfStrawsA=" << numberOfStrawsA << std::endl;
179 output <<
" numberOfStrawsB=" << numberOfStrawsB << std::endl;
180 output <<
" numberOfStrawsC=" << numberOfStrawsC << std::endl;
188 output <<
" numberOfStrawLayersA=" << numberOfStrawLayersA << std::endl;
189 output <<
" numberOfStrawLayersB=" << numberOfStrawLayersB << std::endl;
190 output <<
" numberOfStrawLayersC=" << numberOfStrawLayersC << std::endl;
192 output << std::endl <<
"Integral distributions of straws in layers:"
196 for (
i = 0;
i < numberOfStrawLayersA; ++
i)
197 output <<
" integralDistributionOfStrawsA[" <<
i <<
"]="
202 for (
i = 0;
i < numberOfStrawLayersB; ++
i)
203 output <<
" integralDistributionOfStrawsB[" <<
i <<
"]="
208 for (
i = 0;
i < numberOfStrawLayersC; ++
i)
209 output <<
" integralDistributionOfStrawsC[" <<
i <<
"]="
214 m_pParameters->GetInteger(
"PrintParametersForBarrelHits") == 2)
216 output << std::endl <<
"Arrays barrel straw ID to layer ID:" << std::endl;
223 for (
i = 0;
i < numberOfStrawsA; ++
i)
224 output <<
" strawIDToLayerIDA[" <<
i <<
"]="
228 for (
i = 0;
i < numberOfStrawsB; ++
i)
229 output <<
" strawIDToLayerIDB[" <<
i <<
"]="
233 for (
i = 0;
i < numberOfStrawsC; ++
i)
234 output <<
" strawIDToLayerIDC[" <<
i <<
"]="
240 if (
m_verboseLevel>5) { G4cout <<
"######### Method TRTParametersForBarrelHits::PrintParameters done" << G4endl; }