|
ATLAS Offline Software
|
Go to the documentation of this file.
7 #include "CLHEP/Units/SystemOfUnits.h"
11 #include "CaloDetDescr/CaloDetDescrElement.h"
19 #include "GaudiKernel/ThreadLocalContext.h"
35 m_calocell_id(nullptr)
38 declareInterface<IDataRetriever>(
this);
75 return StatusCode::SUCCESS;
115 return StatusCode::SUCCESS;
124 const std::string& datatype,
130 const EventContext& ctx = Gaudi::Hive::currentContext();
145 DataVect feedThrough; feedThrough.reserve(cellContainer->
size());
146 DataVect slotVec; slotVec.reserve(cellContainer->
size());
148 DataVect cellTimeVec; cellTimeVec.reserve(cellContainer->
size());
150 DataVect cellPedestal; cellPedestal.reserve(cellContainer->
size());
151 DataVect adc2Mev; adc2Mev.reserve(cellContainer->
size());
156 DataVect LArSampleIndexVec; LArSampleIndexVec.reserve(cellContainer->
size());
158 std::string LArSampleIndexStr=
"adcCounts multiple=\"0\"";
163 if (LArDigitCnt_raw_handle.
isValid()) {
164 LArDigitCnt = &(*LArDigitCnt_raw_handle);
166 else if (LArDigitCnt_esd_handle.
isValid()) {
167 LArDigitCnt = &(*LArDigitCnt_esd_handle);
176 ATH_MSG_ERROR(
"in getLArDigitData(), Could not retrieve LAr Pedestal" );
181 ATH_MSG_ERROR(
"in getLArDigitData(),Could not get LArOnlineID!" );
200 auto pCellIndex = std::make_unique<std::array<int, 200000>>();
206 double energyGeV,cellTime;
210 LArHardwareId =
digit->hardwareID();
211 if (!
cabling->isOnlineConnected(LArHardwareId))
continue;
213 LArId =
cabling->cnvToIdentifier(LArHardwareId);
220 nLArSamples =
digit->nsamples();
222 int largain =
digit->gain();
224 int slot = onlineId->
slot(LArHardwareId);
225 int larchan = onlineId->
channel(LArHardwareId);
226 float pedestal=larPedestal->
pedestal(LArHardwareId,largain);
240 bool maskChannel =
false;
247 if (maskChannel)
continue;
255 energyGeV = (*cellContainer)[
Index]->energy() * (1./
GeV);
257 idVec.push_back(
DataType((*cellContainer)[
Index]->
ID().get_compact() ));
261 cellTime = (*cellContainer)[
Index]->time();
263 cellPedestal.push_back(
DataType(pedvalue));
268 if (polynom_adc2mev.size()==0){
271 adc2Mev.push_back(
DataType(polynom_adc2mev[1]));
274 LArSampleIndexStr=
"adcCounts multiple=\""+
DataType(nLArSamples).toString()+
"\"";
282 energyGeV = (*cellContainer)[
Index]->energy() * (1./
GeV);
284 idVec.push_back(
DataType((*cellContainer)[
Index]->
ID().get_compact() ));
289 cellTime = (*cellContainer)[
Index]->time();
291 cellPedestal.push_back(
DataType(pedvalue));
296 if (polynom_adc2mev.size()==0)
299 adc2Mev.push_back(
DataType(polynom_adc2mev[1]));
301 LArSampleIndexStr=
"adcCounts multiple=\""+
DataType(nLArSamples).toString()+
"\"";
308 energyGeV = (*cellContainer)[
Index]->energy() * (1./
GeV);
310 idVec.push_back(
DataType((*cellContainer)[
Index]->
ID().get_compact() ));
323 cellTime = (*cellContainer)[
Index]->time();
325 cellPedestal.push_back(
DataType(pedvalue));
330 if (polynom_adc2mev.size()==0)
333 adc2Mev.push_back(
DataType(polynom_adc2mev[1]));
335 LArSampleIndexStr=
"adcCounts multiple=\""+
DataType(nLArSamples).toString()+
"\"";
364 HWIdentifier LArhwid =
cabling->createSignalChannelIDFromHash((*it1)->caloDDE()->calo_hash());
371 bool maskChannel =
false;
378 if (maskChannel)
continue;
381 energyGeV = (*it1)->energy()*(1./
GeV);
383 idVec.push_back(
DataType((*it1)->ID().get_compact() ));
388 cellTime = (*it1)->time();
391 int largain = (*it1)->gain();
393 float pedestal=larPedestal->
pedestal(LArhwid,largain);
396 cellPedestal.push_back(
DataType(pedvalue));
399 if (polynom_adc2mev.size()==0){
402 adc2Mev.push_back(
DataType(polynom_adc2mev[1]));
406 if (datatype ==
"LAr") {
408 phi.push_back(
DataType((*it1)->phi()));
409 eta.push_back(
DataType((*it1)->eta()));
411 LArSampleIndexStr=
"adcCounts multiple=\""+
DataType(nLArSamples).toString()+
"\"";
412 for(
int i=0;
i<nLArSamples;
i++) LArSampleIndexVec.push_back(
DataType(0)); }
415 else if (datatype ==
"HEC") {
417 phi.push_back(
DataType((*it1)->phi()));
418 eta.push_back(
DataType((*it1)->eta()));
420 LArSampleIndexStr=
"adcCounts multiple=\""+
DataType(nLArSamples).toString()+
"\"";
421 for(
int i=0;
i<nLArSamples;
i++) LArSampleIndexVec.push_back(
DataType(0)); }
424 else if (datatype ==
"FCAL") {
426 x.push_back(
DataType( (*it1)->x()*0.1 ));
427 y.push_back(
DataType( (*it1)->y()*0.1 ));
436 LArSampleIndexStr=
"adcCounts multiple=\""+
DataType(nLArSamples).toString()+
"\"";
437 for(
int i=0;
i<nLArSamples;
i++) LArSampleIndexVec.push_back(
DataType(0));
449 if(!(datatype==
"FCAL")){
450 DataMap[
"phi"] = std::move(phi);
451 DataMap[
"eta"] = std::move(eta);
460 DataMap[
"id"] = std::move(idVec);
462 DataMap[
"feedThrough"] = std::move(feedThrough);
463 DataMap[
"slot"] = std::move(slotVec);
466 DataMap[
"cellTime"] = std::move(cellTimeVec);
468 DataMap[
"cellPedestal"] = std::move(cellPedestal);
469 DataMap[
"adc2Mev"] = std::move(adc2Mev);
471 DataMap[LArSampleIndexStr] = LArSampleIndexVec;
487 if (posNeg<1 or posNeg>3)
return;
488 static constexpr std::array<int,3>
datatypes{2,3,0};
497 m_sub.emplace_back(1);
499 m_sub.emplace_back(0);
virtual float pedestal(const HWIdentifier &id, int gain) const =0
char data[hepevt_bytes_allocation_ATLAS]
const LArVectorProxy ADC2MEV(const HWIdentifier &id, int gain) const
SG::ReadHandleKey< CaloCellContainer > m_sgKey
Const iterator class for DataVector/DataList.
IdentifierHash calo_cell_hash(const Identifier cellId) const
create hash id from 'global' cell id
std::vector< Identifier > ID
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
LArDigitRetriever(const std::string &type, const std::string &name, const IInterface *parent)
Standard Constructor.
int pos_neg(const Identifier id) const
LAr field values (NOT_VALID == invalid request)
This class groups all DetDescr information related to a CaloCell. Provides a generic interface for al...
std::vector< DataType > DataVect
Defines a map with a key and a vector of DataType objects e.g.
const CaloCell_ID * m_calocell_id
CaloCellContainer::const_iterator beginConstCalo(CaloCell_ID::SUBCALO caloNum) const
get const iterators on cell of just one calo
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...
const std::string & key() const
Return the StoreGate ID for the referenced object.
bool is_tile(const Identifier id) const
test if the id belongs to the Tiles
std::map< std::string, DataVect > DataMap
SG::ReadHandleKey< LArDigitContainer > m_sgKeyLArDigit_esd
bool is_hec(const Identifier id) const
test if the id belongs to the HEC
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual std::string dataTypeName() const
Return the name of the data type.
void calcHECLayerSub(Identifier &)
bool is_em(const Identifier id) const
test if the id belongs to LArEM
int channel(const HWIdentifier id) const
Return the channel number of a hardware cell identifier channel = [0,127] in all FEB.
IndexedConstituentUserInfo::Index Index
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey
Liquid Argon digit base class.
Templated class to convert any object that is streamable in a ostringstream in a string.
bool is_fcal(const Identifier id) const
test if the id belongs to the FCAL - true also for MiniFCAL
std::vector< HWIdentifier >::iterator it1
const DataMap getLArDigitData(const CaloCellContainer *cellContainer, const std::string &datatype, CaloCell_ID::SUBCALO calotype)
Retrieve Tile cell location and details.
::StatusCode StatusCode
StatusCode definition for legacy code.
StatusCode initialize()
Default AthAlgTool methods.
SUBCALO
enumeration of sub calorimeters
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
void calcEMLayerSub(Identifier &)
virtual bool isValid() override final
Can the handle be successfully dereferenced?
This header is shared inbetween the C-style server thread and the C++ Athena ServerSvc.
SG::ReadCondHandleKey< LArADC2MeV > m_adc2mevKey
StatusCode initialize(bool used=true)
Container class for CaloCell.
virtual StatusCode retrieve(ToolHandle< IFormatTool > &FormatTool)
Retrieve all the data.
int feedthrough(const HWIdentifier id) const
Return the feedthrough of a hardware cell identifier : feedthrough = [0,31] Barrel - A/C side or H/...
bool m_doMaskLArChannelsM5
#define ATH_MSG_WARNING(x)
std::vector< Identifier::value_type > m_LArChannelsToIgnoreM5
CaloCellContainer::const_iterator endConstCalo(CaloCell_ID::SUBCALO caloNum) const
int findIndex(const IdentifierHash theHash) const
Return index of the cell with a given hash.
Container class for LArDigit.
SG::ReadHandleKey< LArDigitContainer > m_sgKeyLArDigit_raw
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
size_type size() const noexcept
Returns the number of elements in the collection.
Proxy for accessing a range of float values like a vector.