22 #include "CLHEP/Random/RandFlat.h"
29 ToolHandle<ITRT_StrawStatusSummaryTool> sumTool
35 m_averageNoiseLevel(-1.0),
36 m_crosstalk_noiselevel(-1.0),
37 m_crosstalk_noiselevel_other_end(-1.0),
38 m_UseGasMix(UseGasMix),
39 m_sumTool(std::move(sumTool))
56 tmp +=
it->second.noiselevel;
75 unsigned int strawcount(0);
76 unsigned int nBAA[3][3] = {{0}};
77 unsigned int nBAC[3][3] = {{0}};
78 unsigned int nECA[14][3] = {{0}};
79 unsigned int nECC[14][3] = {{0}};
83 const double strawLength((*it)->strawLength());
93 case -2: endcap = 1; isneg = 1;
break;
94 case -1: endcap = 0; isneg = 1;
break;
95 case 1: endcap = 0; isneg = 0;
break;
96 case 2: endcap = 1; isneg = 0;
break;
98 std::cout <<
"TRTDigitization::TRTDigCondBase::createListOfValidStraws "
99 <<
"FATAL - identifier problems - skipping detector element!!" << std::endl;
103 for (
unsigned int iStraw(0); iStraw <(*it)->nStraws(); ++iStraw) {
106 const int hitid(hitid_helper->
buildHitId( endcap, isneg, ringwheel, phisector,
layer, iStraw));
108 const int statusHT =
m_sumTool->getStatusHT(strawId, Gaudi::Hive::currentContext());
112 double noiselevel, relative_noiseamplitude;
113 setStrawStateInfo( strawId, strawLength, noiselevel, relative_noiseamplitude, rndmEngine );
117 strawstate.noiseamplitude= relative_noiseamplitude;
124 if (
side==+1 && ringwheel>=0 && ringwheel<=2 ) nBAA[ringwheel][strawGasType]++;
125 if (
side==-1 && ringwheel>=0 && ringwheel<=2 ) nBAC[ringwheel][strawGasType]++;
126 if (
side==+2 && ringwheel>=0 && ringwheel<=13 ) nECA[ringwheel][strawGasType]++;
127 if (
side==-2 && ringwheel>=0 && ringwheel<=13 ) nECC[ringwheel][strawGasType]++;
140 ATH_MSG_ERROR(
"TRTDigCondBase::initialize it seems that ALL straws are dead/masked! This wont work.");
147 if (
m_UseGasMix==0) std::cout <<
"TRTDigCondBase INFO Gas Geometry: UseGasMix==0; using StatusHT to determine the gas geometry." << std::endl;
148 if (
m_UseGasMix==1) std::cout <<
"TRTDigCondBase INFO Gas Geometry: UseGasMix==1; expect Xenon in the entire detector." << std::endl;
149 if (
m_UseGasMix==2) std::cout <<
"TRTDigCondBase INFO Gas Geometry: UseGasMix==2; expect Krypton in the entire detector." << std::endl;
150 if (
m_UseGasMix==3) std::cout <<
"TRTDigCondBase INFO Gas Geometry: UseGasMix==3; expect Argon in the entire detector." << std::endl;
151 if ( m_UseGasMix<0 || m_UseGasMix>3) {
152 std::cout <<
"TRTDigCondBase ERROR Gas Geometry: UseGasMix==" <<
m_UseGasMix <<
", must be 0,1,2or 3!" << std::endl;
155 std::cout <<
"TRTDigCondBase INFO Gas Geometry: strawcount=" << strawcount << std::endl;
157 std::cout <<
"TRTDigCondBase INFO Gas Geometry: BA_A[Xe] = " << nBAA[0][0] <<
" " << nBAA[1][0] <<
" " << nBAA[2][0] << std::endl;
158 std::cout <<
"TRTDigCondBase INFO Gas Geometry: BA_A[Kr] = " << nBAA[0][1] <<
" " << nBAA[1][1] <<
" " << nBAA[2][1] << std::endl;
159 std::cout <<
"TRTDigCondBase INFO Gas Geometry: BA_A[Ar] = " << nBAA[0][2] <<
" " << nBAA[1][2] <<
" " << nBAA[2][2] << std::endl;
161 std::cout <<
"TRTDigCondBase INFO Gas Geometry: BA_C[Xe] = " << nBAC[0][0] <<
" " << nBAC[1][0] <<
" " << nBAC[2][0] << std::endl;
162 std::cout <<
"TRTDigCondBase INFO Gas Geometry: BA_C[Kr] = " << nBAC[0][1] <<
" " << nBAC[1][1] <<
" " << nBAC[2][1] << std::endl;
163 std::cout <<
"TRTDigCondBase INFO Gas Geometry: BA_C[Ar] = " << nBAC[0][2] <<
" " << nBAC[1][2] <<
" " << nBAC[2][2] << std::endl;
165 std::cout <<
"TRTDigCondBase INFO Gas Geometry: EC_A[Xe] = ";
for (
auto &
i : nECA) std::cout <<
i[0] <<
" "; std::cout << std::endl;
166 std::cout <<
"TRTDigCondBase INFO Gas Geometry: EC_A[Kr] = ";
for (
auto &
i : nECA) std::cout <<
i[1] <<
" "; std::cout << std::endl;
167 std::cout <<
"TRTDigCondBase INFO Gas Geometry: EC_A[Ar] = ";
for (
auto &
i : nECA) std::cout <<
i[2] <<
" "; std::cout << std::endl;
169 std::cout <<
"TRTDigCondBase INFO Gas Geometry: EC_C[Xe] = ";
for (
auto &
i : nECC) std::cout <<
i[0] <<
" "; std::cout << std::endl;
170 std::cout <<
"TRTDigCondBase INFO Gas Geometry: EC_C[Kr] = ";
for (
auto &
i : nECC) std::cout <<
i[1] <<
" "; std::cout << std::endl;
171 std::cout <<
"TRTDigCondBase INFO Gas Geometry: EC_C[Ar] = ";
for (
auto &
i : nECC) std::cout <<
i[2] <<
" "; std::cout << std::endl;
184 if ( CLHEP::RandFlat::shoot(randengine, 0.0, 1.0) < noiselvl ) {
196 return CLHEP::RandFlat::shoot(randengine, 0.0, 1.0) <
noise;
202 return CLHEP::RandFlat::shoot(randengine, 0.0, 1.0) <
noise;