126 {
127
128
130 const EventContext& ctx = Gaudi::Hive::currentContext();
131
132 char rndStr[30];
134
141
145 DataVect feedThrough; feedThrough.reserve(cellContainer->
size());
146 DataVect slotVec; slotVec.reserve(cellContainer->
size());
147
148 DataVect cellTimeVec; cellTimeVec.reserve(cellContainer->
size());
150 DataVect cellPedestal; cellPedestal.reserve(cellContainer->
size());
151 DataVect adc2Mev; adc2Mev.reserve(cellContainer->
size());
152
153
155
156 DataVect LArSampleIndexVec; LArSampleIndexVec.reserve(cellContainer->
size());
157
158 std::string LArSampleIndexStr="adcCounts multiple=\"0\"";
159
162 const LArDigitContainer* LArDigitCnt = nullptr;
163 if (LArDigitCnt_raw_handle.isValid()) {
164 LArDigitCnt = &(*LArDigitCnt_raw_handle);
165 }
166 else if (LArDigitCnt_esd_handle.isValid()) {
167 LArDigitCnt = &(*LArDigitCnt_esd_handle);
169 }
170 else {
172 }
173
174 const ILArPedestal* larPedestal = nullptr;
176 ATH_MSG_ERROR(
"in getLArDigitData(), Could not retrieve LAr Pedestal" );
177 }
178
179 const LArOnlineID* onlineId = nullptr;
181 ATH_MSG_ERROR(
"in getLArDigitData(),Could not get LArOnlineID!" );
182 }
183
184 SG::ReadCondHandle<LArADC2MeV> adc2mev (
m_adc2mevKey, ctx);
185
186
187
188
189
190 SG::ReadCondHandle<LArOnOffIdMapping> cablingHdl{
m_cablingKey, ctx};
191 const LArOnOffIdMapping*
cabling{*cablingHdl};
192 if(!cabling) {
195 }
196
197
199
200 auto pCellIndex = std::make_unique<std::array<int, 200000>>();
201 pCellIndex->fill(0);
202 int nLArSamples = 0;
203 HWIdentifier LArHardwareId;
204 Identifier LArId;
205
206 double energyGeV,cellTime;
207
208 for (const LArDigit* digit : *LArDigitCnt) {
209
210 LArHardwareId =
digit->hardwareID();
211 if (!
cabling->isOnlineConnected(LArHardwareId))
continue;
212
213 LArId =
cabling->cnvToIdentifier(LArHardwareId);
214 const IdentifierHash cellhash=
m_calocell_id->calo_cell_hash(LArId);
215
219
220 nLArSamples =
digit->nsamples();
221 std::vector<short> LArSamples =
digit->samples();
222 int largain =
digit->gain();
224 int slot = onlineId->
slot(LArHardwareId);
225 int larchan = onlineId->
channel(LArHardwareId);
226 float pedestal=larPedestal->
pedestal(LArHardwareId,largain);
227 float pedvalue=0;
229 else pedvalue = LArSamples[0];
230
231 LArVectorProxy polynom_adc2mev = adc2mev->ADC2MEV(LArId,largain);
232
235
237
238
240 bool maskChannel = false;
243 maskChannel = true;
244 break;
245 }
246 }
247 if (maskChannel) continue;
248 }
249
250
252
254
255 energyGeV = (*cellContainer)[
Index]->energy() * (1./
GeV);
257 idVec.push_back(
DataType((*cellContainer)[
Index]->
ID().get_compact() ));
260
261 cellTime = (*cellContainer)[
Index]->time();
263 cellPedestal.push_back(
DataType(pedvalue));
266 feedThrough.push_back(
DataType(FT));
268 if (polynom_adc2mev.size()==0){
270 }else{
271 adc2Mev.push_back(
DataType(polynom_adc2mev[1]));
272 }
274 LArSampleIndexStr=
"adcCounts multiple=\""+
DataType(nLArSamples).toString()+
"\"";
275 for(
int i=0;
i<nLArSamples;
i++) LArSampleIndexVec.push_back(
DataType(LArSamples[i]));
276 }
277 }
278
280
282 energyGeV = (*cellContainer)[
Index]->energy() * (1./
GeV);
284 idVec.push_back(
DataType((*cellContainer)[
Index]->
ID().get_compact() ));
287
288
289 cellTime = (*cellContainer)[
Index]->time();
291 cellPedestal.push_back(
DataType(pedvalue));
294 feedThrough.push_back(
DataType(FT));
296 if (polynom_adc2mev.size()==0)
298 else
299 adc2Mev.push_back(
DataType(polynom_adc2mev[1]));
301 LArSampleIndexStr=
"adcCounts multiple=\""+
DataType(nLArSamples).toString()+
"\"";
302 for(
int i=0;
i<nLArSamples;
i++) LArSampleIndexVec.push_back(
DataType(LArSamples[i]));
303 }
304 }
305
306 else if(datatype ==
"FCAL" &&
m_calocell_id->is_fcal(LArId)) {
307
308 energyGeV = (*cellContainer)[
Index]->energy() * (1./
GeV);
310 idVec.push_back(
DataType((*cellContainer)[
Index]->
ID().get_compact() ));
313
314 const CaloDetDescrElement* elt = (*cellContainer)[
Index]->caloDDE();
315
318
321
322
323 cellTime = (*cellContainer)[
Index]->time();
325 cellPedestal.push_back(
DataType(pedvalue));
328 feedThrough.push_back(
DataType(FT));
330 if (polynom_adc2mev.size()==0)
332 else
333 adc2Mev.push_back(
DataType(polynom_adc2mev[1]));
335 LArSampleIndexStr=
"adcCounts multiple=\""+
DataType(nLArSamples).toString()+
"\"";
336 for(
int i=0;
i<nLArSamples;
i++) LArSampleIndexVec.push_back(
DataType(LArSamples[i]));
337 }
338 }
339 }
340 }
341 }
342
343
344
345
347
350
351
352 for (;it1!=it2;++it1) {
353
354
356
357 Identifier cellid = (*it1)->ID();
358
359 const IdentifierHash cellhash=
m_calocell_id->calo_cell_hash(cellid);
362 continue;
363
364 HWIdentifier LArhwid =
cabling->createSignalChannelIDFromHash((*it1)->caloDDE()->calo_hash());
365
368
369
371 bool maskChannel = false;
374 maskChannel = true;
375 break;
376 }
377 }
378 if (maskChannel) continue;
379 }
380
381 energyGeV = (*it1)->energy()*(1./
GeV);
383 idVec.push_back(
DataType((*it1)->ID().get_compact() ));
387
388 cellTime = (*it1)->time();
391 int largain = (*it1)->gain();
392 float pedvalue=0;
393 float pedestal=larPedestal->
pedestal(LArhwid,largain);
395 else pedvalue = 0;
396 cellPedestal.push_back(
DataType(pedvalue));
397
398 LArVectorProxy polynom_adc2mev = adc2mev->ADC2MEV(cellid,largain);
399 if (polynom_adc2mev.size()==0){
401 }else{
402 adc2Mev.push_back(
DataType(polynom_adc2mev[1]));
403 }
404
405
406 if (datatype == "LAr") {
411 LArSampleIndexStr=
"adcCounts multiple=\""+
DataType(nLArSamples).toString()+
"\"";
412 for(
int i=0;
i<nLArSamples;
i++) LArSampleIndexVec.push_back(
DataType(0)); }
413 }
414
415 else if (datatype == "HEC") {
420 LArSampleIndexStr=
"adcCounts multiple=\""+
DataType(nLArSamples).toString()+
"\"";
421 for(
int i=0;
i<nLArSamples;
i++) LArSampleIndexVec.push_back(
DataType(0)); }
422 }
423
424 else if (datatype == "FCAL") {
425
426 x.push_back(
DataType( (*it1)->x()*0.1 ));
427 y.push_back(
DataType( (*it1)->y()*0.1 ));
428
429 const CaloDetDescrElement* elt = (*it1)->caloDDE();
432
436 LArSampleIndexStr=
"adcCounts multiple=\""+
DataType(nLArSamples).toString()+
"\"";
437 for(
int i=0;
i<nLArSamples;
i++) LArSampleIndexVec.push_back(
DataType(0));
438 }
439 }
440
441 }
442 }
443 }
444
445
446
447
449 if(!(datatype=="FCAL")){
452 } else {
457 }
458
459 DataMap[
"energy"] = std::move(energy);
460 DataMap[
"id"] = std::move(idVec);
461 DataMap[
"channel"] = std::move(channel);
462 DataMap[
"feedThrough"] = std::move(feedThrough);
463 DataMap[
"slot"] = std::move(slotVec);
464
465
466 DataMap[
"cellTime"] = std::move(cellTimeVec);
467 DataMap[
"cellGain"] = std::move(cellGain);
468 DataMap[
"cellPedestal"] = std::move(cellPedestal);
469 DataMap[
"adc2Mev"] = std::move(adc2Mev);
470
471 DataMap[LArSampleIndexStr] = std::move(LArSampleIndexVec);
472
473
475
476
478
479 }
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#define ATH_MSG_WARNING(x)
std::vector< Identifier > ID
IndexedConstituentUserInfo::Index Index
const ServiceHandle< StoreGateSvc > & detStore() const
CaloCellContainer::const_iterator beginConstCalo(CaloCell_ID::SUBCALO caloNum) const
get const iterators on cell of just one calo
CaloCellContainer::const_iterator endConstCalo(CaloCell_ID::SUBCALO caloNum) const
int findIndex(const IdentifierHash theHash) const
Return index of the cell with a given hash.
DataModel_detail::const_iterator< DataVector > const_iterator
size_type size() const noexcept
Returns the number of elements in the collection.
virtual float pedestal(const HWIdentifier &id, int gain) const =0
SG::ReadCondHandleKey< LArADC2MeV > m_adc2mevKey
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey
void calcHECLayerSub(Identifier &)
void calcEMLayerSub(Identifier &)
virtual std::string dataTypeName() const
Return the name of the data type.
SG::ReadHandleKey< LArDigitContainer > m_sgKeyLArDigit_esd
virtual StatusCode retrieve(ToolHandle< IFormatTool > &FormatTool)
Retrieve all the data.
SG::ReadHandleKey< LArDigitContainer > m_sgKeyLArDigit_raw
int feedthrough(const HWIdentifier id) const
Return the feedthrough of a hardware cell identifier : feedthrough = [0,31] Barrel - A/C side or H/...
int slot(const HWIdentifier id) const
Return the slot number of a hardware cell identifier: slot = [1,15] Slot-ID in top part of the crat...
int channel(const HWIdentifier id) const
Return the channel number of a hardware cell identifier channel = [0,127] in all FEB.
std::map< std::string, DataVect > DataMap
std::vector< DataType > DataVect
Defines a map with a key and a vector of DataType objects e.g.