93 {
94
95
97 const EventContext& ctx = Gaudi::Hive::currentContext();
98
99 char rndStr[30];
101
108
112 DataVect feedThrough; feedThrough.reserve(cellContainer->
size());
113 DataVect slotVec; slotVec.reserve(cellContainer->
size());
114
115 DataVect cellTimeVec; cellTimeVec.reserve(cellContainer->
size());
117 DataVect cellPedestal; cellPedestal.reserve(cellContainer->
size());
118 DataVect adc2Mev; adc2Mev.reserve(cellContainer->
size());
119
120
122
123 DataVect LArSampleIndexVec; LArSampleIndexVec.reserve(cellContainer->
size());
124
125 std::string LArSampleIndexStr="adcCounts multiple=\"0\"";
126
129 const LArDigitContainer* LArDigitCnt = nullptr;
130 if (LArDigitCnt_raw_handle.isValid()) {
131 LArDigitCnt = &(*LArDigitCnt_raw_handle);
132 }
133 else if (LArDigitCnt_esd_handle.isValid()) {
134 LArDigitCnt = &(*LArDigitCnt_esd_handle);
136 }
137 else {
139 }
140
141 const ILArPedestal* larPedestal = nullptr;
142 if ( detStore()->
retrieve(larPedestal).isFailure()){
143 ATH_MSG_ERROR(
"in getLArDigitData(), Could not retrieve LAr Pedestal" );
144 }
145
146 const LArOnlineID* onlineId = nullptr;
147 if ( detStore()->
retrieve(onlineId,
"LArOnlineID").isFailure()) {
148 ATH_MSG_ERROR(
"in getLArDigitData(),Could not get LArOnlineID!" );
149 }
150
151 SG::ReadCondHandle<LArADC2MeV> adc2mev (
m_adc2mevKey, ctx);
152
153
154
155
156
157 SG::ReadCondHandle<LArOnOffIdMapping> cablingHdl{
m_cablingKey, ctx};
158 const LArOnOffIdMapping*
cabling{*cablingHdl};
159 if(!cabling) {
162 }
163
164
166
167 auto pCellIndex = std::make_unique<std::array<int, 200000>>();
168 pCellIndex->fill(0);
169 int nLArSamples = 0;
170 HWIdentifier LArHardwareId;
171 Identifier LArId;
172
173 double energyGeV,cellTime;
174
175 for (const LArDigit* digit : *LArDigitCnt) {
176
177 LArHardwareId =
digit->hardwareID();
178 if (!
cabling->isOnlineConnected(LArHardwareId))
continue;
179
180 LArId =
cabling->cnvToIdentifier(LArHardwareId);
181 const IdentifierHash cellhash=
m_calocell_id->calo_cell_hash(LArId);
182
186
187 nLArSamples =
digit->nsamples();
188 std::vector<short> LArSamples =
digit->samples();
189 int largain =
digit->gain();
191 int slot = onlineId->
slot(LArHardwareId);
192 int larchan = onlineId->
channel(LArHardwareId);
193 float pedestal=larPedestal->
pedestal(LArHardwareId,largain);
194 float pedvalue=0;
196 else pedvalue = LArSamples[0];
197
198 LArVectorProxy polynom_adc2mev = adc2mev->ADC2MEV(LArId,largain);
199
202
204
205
207 bool maskChannel = false;
210 maskChannel = true;
211 break;
212 }
213 }
214 if (maskChannel) continue;
215 }
216
217
219
221
222 energyGeV = (*cellContainer)[
Index]->energy() * (1./
GeV);
224 idVec.push_back(
DataType((*cellContainer)[
Index]->
ID().get_compact() ));
227
228 cellTime = (*cellContainer)[
Index]->time();
230 cellPedestal.push_back(
DataType(pedvalue));
233 feedThrough.push_back(
DataType(FT));
235 if (polynom_adc2mev.size()==0){
237 }else{
238 adc2Mev.push_back(
DataType(polynom_adc2mev[1]));
239 }
241 LArSampleIndexStr=
"adcCounts multiple=\""+
DataType(nLArSamples).toString()+
"\"";
242 for(
int i=0;
i<nLArSamples;
i++) LArSampleIndexVec.push_back(
DataType(LArSamples[i]));
243 }
244 }
245
247
249 energyGeV = (*cellContainer)[
Index]->energy() * (1./
GeV);
251 idVec.push_back(
DataType((*cellContainer)[
Index]->
ID().get_compact() ));
254
255
256 cellTime = (*cellContainer)[
Index]->time();
258 cellPedestal.push_back(
DataType(pedvalue));
261 feedThrough.push_back(
DataType(FT));
263 if (polynom_adc2mev.size()==0)
265 else
266 adc2Mev.push_back(
DataType(polynom_adc2mev[1]));
268 LArSampleIndexStr=
"adcCounts multiple=\""+
DataType(nLArSamples).toString()+
"\"";
269 for(
int i=0;
i<nLArSamples;
i++) LArSampleIndexVec.push_back(
DataType(LArSamples[i]));
270 }
271 }
272
273 else if(datatype ==
"FCAL" &&
m_calocell_id->is_fcal(LArId)) {
274
275 energyGeV = (*cellContainer)[
Index]->energy() * (1./
GeV);
277 idVec.push_back(
DataType((*cellContainer)[
Index]->
ID().get_compact() ));
280
281 const CaloDetDescrElement* elt = (*cellContainer)[
Index]->caloDDE();
282
285
288
289
290 cellTime = (*cellContainer)[
Index]->time();
292 cellPedestal.push_back(
DataType(pedvalue));
295 feedThrough.push_back(
DataType(FT));
297 if (polynom_adc2mev.size()==0)
299 else
300 adc2Mev.push_back(
DataType(polynom_adc2mev[1]));
302 LArSampleIndexStr=
"adcCounts multiple=\""+
DataType(nLArSamples).toString()+
"\"";
303 for(
int i=0;
i<nLArSamples;
i++) LArSampleIndexVec.push_back(
DataType(LArSamples[i]));
304 }
305 }
306 }
307 }
308 }
309
310
311
312
314
317
318
319 for (;it1!=it2;++it1) {
320
321
323
324 Identifier cellid = (*it1)->ID();
325
326 const IdentifierHash cellhash=
m_calocell_id->calo_cell_hash(cellid);
329 continue;
330
331 HWIdentifier LArhwid =
cabling->createSignalChannelIDFromHash((*it1)->caloDDE()->calo_hash());
332
335
336
338 bool maskChannel = false;
341 maskChannel = true;
342 break;
343 }
344 }
345 if (maskChannel) continue;
346 }
347
348 energyGeV = (*it1)->energy()*(1./
GeV);
350 idVec.push_back(
DataType((*it1)->ID().get_compact() ));
354
355 cellTime = (*it1)->time();
358 int largain = (*it1)->gain();
359 float pedvalue=0;
360 float pedestal=larPedestal->
pedestal(LArhwid,largain);
362 else pedvalue = 0;
363 cellPedestal.push_back(
DataType(pedvalue));
364
365 LArVectorProxy polynom_adc2mev = adc2mev->ADC2MEV(cellid,largain);
366 if (polynom_adc2mev.size()==0){
368 }else{
369 adc2Mev.push_back(
DataType(polynom_adc2mev[1]));
370 }
371
372
373 if (datatype == "LAr") {
378 LArSampleIndexStr=
"adcCounts multiple=\""+
DataType(nLArSamples).toString()+
"\"";
379 for(
int i=0;
i<nLArSamples;
i++) LArSampleIndexVec.push_back(
DataType(0)); }
380 }
381
382 else if (datatype == "HEC") {
387 LArSampleIndexStr=
"adcCounts multiple=\""+
DataType(nLArSamples).toString()+
"\"";
388 for(
int i=0;
i<nLArSamples;
i++) LArSampleIndexVec.push_back(
DataType(0)); }
389 }
390
391 else if (datatype == "FCAL") {
392
393 x.push_back(
DataType( (*it1)->x()*0.1 ));
394 y.push_back(
DataType( (*it1)->y()*0.1 ));
395
396 const CaloDetDescrElement* elt = (*it1)->caloDDE();
399
403 LArSampleIndexStr=
"adcCounts multiple=\""+
DataType(nLArSamples).toString()+
"\"";
404 for(
int i=0;
i<nLArSamples;
i++) LArSampleIndexVec.push_back(
DataType(0));
405 }
406 }
407
408 }
409 }
410 }
411
412
413
414
416 if(!(datatype=="FCAL")){
419 } else {
424 }
425
426 DataMap[
"energy"] = std::move(energy);
427 DataMap[
"id"] = std::move(idVec);
428 DataMap[
"channel"] = std::move(channel);
429 DataMap[
"feedThrough"] = std::move(feedThrough);
430 DataMap[
"slot"] = std::move(slotVec);
431
432
433 DataMap[
"cellTime"] = std::move(cellTimeVec);
434 DataMap[
"cellGain"] = std::move(cellGain);
435 DataMap[
"cellPedestal"] = std::move(cellPedestal);
436 DataMap[
"adc2Mev"] = std::move(adc2Mev);
437
438 DataMap[LArSampleIndexStr] = std::move(LArSampleIndexVec);
439
440
442
443
445
446 }
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#define ATH_MSG_WARNING(x)
IndexedConstituentUserInfo::Index Index
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
Gaudi::Property< bool > m_cellConditionCut
Gaudi::Property< bool > m_doLArDigit
Gaudi::Property< double > m_cellThreshold
SG::ReadCondHandleKey< LArADC2MeV > m_adc2mevKey
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey
virtual std::string dataTypeName() const override
Return the name of the data type.
Gaudi::Property< bool > m_doHECDigit
void calcHECLayerSub(Identifier &)
void calcEMLayerSub(Identifier &)
Gaudi::Property< bool > m_doFCalDigit
Gaudi::Property< bool > m_doMaskLArChannelsM5
virtual StatusCode retrieve(ToolHandle< IFormatTool > &FormatTool) override
Retrieve all the data.
Gaudi::Property< int > m_cellTimePrec
Gaudi::Property< std::vector< Identifier::value_type > > m_LArChannelsToIgnoreM5
Gaudi::Property< int > m_cellEnergyPrec
SG::ReadHandleKey< LArDigitContainer > m_sgKeyLArDigit_esd
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.
ID
//////////////////////////////////////// JetAlgorithmType::ID defines most common physics jet finding...