82{
94
96 const double minEnergy=1
e-9;
98 Identifier cellid((unsigned int) 0);
100 double energyConv=0.0;
101 float SampFrac=0.0;
102
103 int countFastCell=0;
104
105 double eLArEMRead=0.0;
106 double eLArHECRead=0.0;
107 double eLArFCALRead=0.0;
108 double eTileRead=0.0;
109
110 double eLArEMConv=0.0;
111 double eLArHECConv=0.0;
112 double eLArFCALConv=0.0;
113 double eTileConv=0.0;
114
115 SG::ReadCondHandle<ILArfSampl> fSamplHdl(
m_fSamplKey, ctx);
116 const ILArfSampl* fSampl=*fSamplHdl;
117
120 for(;it1!=it2;++it1)
121 {
123
124 cellid=(*it1)->ID();
126 SampFrac=fSampl->
FSAMPL(cellid);
127 energyConv=
energy*SampFrac;
128
130 eLArEMConv+=energyConv;
131
132 ATH_MSG_DEBUG(
"ReadFastCell id= "<<cellid<<
"E= "<<energy<<
" SampFrac= "<<SampFrac);
133 if(energyConv > minEnergy)
134 {
136 {
138 {
140 embHitContainer->push_back(
new LArHit(cellid,energyConv,
hitTime));
141 }
143 {
145 emecHitContainer->push_back(
new LArHit(cellid,energyConv,
hitTime));
146 }
147 }
148 }
149 countFastCell++;
150 }
151
154
155 countFastCell=0;
156 for(;it1!=it2;++it1)
157 {
159
160 cellid=(*it1)->ID();
162 SampFrac=fSampl->
FSAMPL(cellid);
163 energyConv=
energy*SampFrac;
164
166 eLArHECConv+=energyConv;
167
168 ATH_MSG_DEBUG(
"ReadFastCell id= "<<cellid<<
"E= "<<energy<<
"SampFrac= "<<SampFrac);
169
170 if(energyConv>minEnergy)
171 {
173 {
175 hecHitContainer->push_back(
new LArHit(cellid,energyConv,
hitTime));
176 }
177 }
178 countFastCell++;
179 }
180
183 countFastCell=0;
184 for(;it1!=it2;++it1)
185 {
187 cellid=(*it1)->ID();
189 SampFrac=fSampl->
FSAMPL(cellid);
190 energyConv=
energy*SampFrac;
191
193 eLArHECConv+=energyConv;
194
195 ATH_MSG_DEBUG(
"ReadFastCell id= "<<cellid<<
"E="<<energy<<
"SampFrac="<<SampFrac);
196 if(energyConv>minEnergy)
197 {
199 {
201 fcalHitContainer->push_back(
new LArHit(cellid,energyConv,
hitTime));
202 }
203 }
204 countFastCell++;
205 }
206
208 ATH_CHECK( tileSamplingFraction.isValid() );
209
212
213 countFastCell=0;
214 Identifier pmt_id0((unsigned int) 0);
215 Identifier pmt_id1((unsigned int) 0);
216
217 for(;it1!=it2;++it1)
218 {
220 cellid=(*it1)->ID();
222
225
228 int drawerIdx =
m_tileHWID->drawerIdx(channel_id);
229 SampFrac = tileSamplingFraction->getSamplingFraction(drawerIdx, channel);
230 energyConv=
energy/SampFrac;
231
233 eTileConv+=energyConv;
234
235 ATH_MSG_DEBUG(
"ReadFastCell id= "<<cellid<<
"E="<<energy<<
"SampFrac"<<SampFrac);
237 if(energyConv>minEnergy)
238 {
240 {
242 if(
m_tileID->is_tile_gapscin(cellid))
243 {
244 tileHitVector->push_back(TileHit(pmt_id0,energyConv,
hitTime));
245 }
246 else
247 {
248 tileHitVector->push_back(TileHit(pmt_id0,energyConv/2.0,
hitTime));
249 tileHitVector->push_back(TileHit(pmt_id1,energyConv/2.0,
hitTime));
250 }
251 }
252 }
253 countFastCell++;
254 }
255 ATH_MSG_DEBUG(
"eReadTot= "<<eLArEMRead+eLArHECRead+eLArFCALRead+eTileRead);
256 ATH_MSG_DEBUG(
"eLArEMRead= "<<eLArEMRead<<
" eLArHECRead= "<<eLArHECRead<<
" eLArFCALRead= "<<eLArFCALRead<<
" eTileRead= "<<eTileRead);
257 ATH_MSG_DEBUG(
"eConvTot= "<<eLArEMConv+eLArHECConv+eLArFCALConv+eTileConv);
258 ATH_MSG_DEBUG(
"eLArEMConv= "<<eLArEMConv<<
" eLArHECConv= "<<eLArHECConv<<
"eLArFCALConv"<<eLArFCALConv<<
"eTileConv"<<eTileConv);
259
261 ATH_MSG_DEBUG(embHitContainer.name()<<
" : "<<embHitContainer->size()<<
" hits ");
262 ATH_MSG_DEBUG(emecHitContainer.name()<<
" : "<<emecHitContainer->size()<<
" hits ");
263 ATH_MSG_DEBUG(fcalHitContainer.name()<<
" : "<<fcalHitContainer->size()<<
" hits ");
264 ATH_MSG_DEBUG(hecHitContainer.name()<<
" : "<<hecHitContainer->size()<<
" hits ");
265 ATH_MSG_DEBUG(tileHitVector.name()<<
" : "<<tileHitVector->size()<<
" hits ");
266
267 return StatusCode::SUCCESS;
268}
float hitTime(const AFP_SIDSimHit &hit)
DataModel_detail::const_iterator< DataVector > const_iterator
virtual const float & FSAMPL(const HWIdentifier &id) const =0
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())