ATLAS Offline Software
Loading...
Searching...
No Matches
JiveXML::BadLArRetriever Class Reference

Retrieves all Calo Cluster objects. More...

#include <BadLArRetriever.h>

Inheritance diagram for JiveXML::BadLArRetriever:
Collaboration diagram for JiveXML::BadLArRetriever:

Public Member Functions

virtual StatusCode retrieve (ToolHandle< IFormatTool > &FormatTool) override
 Retrieve all the data.
const DataMap getBadLArData (const CaloCellContainer *cellContainer)
 Retrieve LAr bad cell location and details.
virtual std::string dataTypeName () const override
 Return the name of the data type.
virtual StatusCode initialize () override
 Default AthAlgTool methods.

Private Attributes

const CaloCell_IDm_calocell_id {}
SG::ReadCondHandleKey< LArOnOffIdMappingm_cablingKey {this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"}
SG::ReadHandleKey< CaloCellContainerm_sgKey {this, "StoreGateKey", "AllCalo", "Name of the CaloCellContainer"}
 for properties
Gaudi::Property< double > m_cellThreshold {this, "LArlCellThreshold", 50.}
Gaudi::Property< int > m_cellEnergyPrec {this, "CellEnergyPrec", 3}
Gaudi::Property< bool > m_lar {this, "RetrieveLAr", true}
Gaudi::Property< bool > m_doBadLAr {this, "DoBadLAr", false}
Gaudi::Property< bool > m_cellConditionCut {this, "CellConditionCut", false}

Detailed Description

Retrieves all Calo Cluster objects.

  • Properties
    • StoreGateKey: default is 'AllCalo'. Don't change.
    • LArlCellThreshold: default is 50 (MeV)
    • RetrieveLAr: general flag, default is true
    • CellConditionCut: default is false
      • CellEnergyPrec: precision in int, default is 3 digits
    • DoBadLAr: write LAr bad cell, default is false
  • Retrieved Data
    • location in phi and eta
    • identifier and energy of each cell

Definition at line 39 of file BadLArRetriever.h.

Member Function Documentation

◆ dataTypeName()

virtual std::string JiveXML::BadLArRetriever::dataTypeName ( ) const
inlineoverridevirtual

Return the name of the data type.

Definition at line 50 of file BadLArRetriever.h.

50{ return "BadLAr"; };

◆ getBadLArData()

const DataMap JiveXML::BadLArRetriever::getBadLArData ( const CaloCellContainer * cellContainer)

Retrieve LAr bad cell location and details.

Parameters
FormatToolthe tool that will create formated output from the DataMap

Definition at line 67 of file BadLArRetriever.cxx.

67 {
68
69 ATH_MSG_DEBUG( "getBadLArData()" );
70
72 const auto nCells = cellContainer->size();
73 DataVect phi; phi.reserve(nCells);
74 DataVect eta; eta.reserve(nCells);
75 DataVect energy; energy.reserve(nCells);
76 DataVect idVec; idVec.reserve(nCells);
77 DataVect channel; channel.reserve(nCells);
78 DataVect feedThrough; feedThrough.reserve(nCells);
79 DataVect slot; slot.reserve(nCells);
80
81
82 char rndStr[30]; // for rounding (3 digit precision)
85 SG::ReadCondHandle<LArOnOffIdMapping> cablingHdl{m_cablingKey};
86 const LArOnOffIdMapping* cabling{*cablingHdl};
87 const LArOnlineID* onlineId = nullptr;
88 if ( detStore()->retrieve(onlineId, "LArOnlineID").isFailure()) {
89 ATH_MSG_ERROR( "in getBadLArData(),Could not get LArOnlineID!" );
90 }
91
92 if (m_doBadLAr && cabling) {
93 double energyGeV;
94 ATH_MSG_DEBUG( "Start iterator loop over cells" );
95 for(;it1!=it2;++it1){
96 if( !(*it1)->badcell() ) continue;
97 if ((((*it1)->provenance()&0xFF)!=0xA5)&&m_cellConditionCut) continue; // check full conditions for LAr
98 HWIdentifier LArhwid = cabling->createSignalChannelIDFromHash((*it1)->caloDDE()->calo_hash());
99 energyGeV = (*it1)->energy()*(1./GeV);
100 if (energyGeV == 0) energyGeV = 0.001; // 1 MeV due to LegoCut > 0.0 (couldn't be >= 0.0)
101
102 energy.emplace_back( gcvt( energyGeV, m_cellEnergyPrec, rndStr) );
103 idVec.emplace_back((Identifier::value_type)(*it1)->ID().get_compact() );
104 phi.emplace_back((*it1)->phi());
105 eta.emplace_back((*it1)->eta());
106 channel.emplace_back(onlineId->channel(LArhwid));
107 feedThrough.emplace_back(onlineId->feedthrough(LArhwid));
108 slot.emplace_back(onlineId->slot(LArhwid));
109 } // end cell iterator
110 } // doBadLAr
111 // write values into DataMap
112 const auto nEntries = phi.size();
113 DataMap["phi"] = std::move(phi);
114 DataMap["eta"] = std::move(eta);
115 DataMap["energy"] = std::move(energy);
116 DataMap["id"] = std::move(idVec);
117 DataMap["channel"] = std::move(channel);
118 DataMap["feedThrough"] = std::move(feedThrough);
119 DataMap["slot"] = std::move(slot);
120 //Be verbose
121 ATH_MSG_DEBUG( dataTypeName() << " , collection: " << dataTypeName()
122 << " retrieved with " << nEntries << " entries" );
123
124 //All collections retrieved okay
125 return DataMap;
126
127 } // getBadLArData
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#define ATH_MSG_ERROR(x)
#define ATH_MSG_DEBUG(x)
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
DataModel_detail::const_iterator< DataVector > const_iterator
Definition DataVector.h:838
size_type size() const noexcept
Returns the number of elements in the collection.
virtual std::string dataTypeName() const override
Return the name of the data type.
Gaudi::Property< bool > m_cellConditionCut
virtual StatusCode retrieve(ToolHandle< IFormatTool > &FormatTool) override
Retrieve all the data.
Gaudi::Property< bool > m_doBadLAr
Gaudi::Property< int > m_cellEnergyPrec
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey
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
Definition DataType.h:59
std::vector< DataType > DataVect
Defines a map with a key and a vector of DataType objects e.g.
Definition DataType.h:58
setRawEt setRawPhi nCells

◆ initialize()

StatusCode JiveXML::BadLArRetriever::initialize ( )
overridevirtual

Default AthAlgTool methods.

Initialise the Tool.

Definition at line 28 of file BadLArRetriever.cxx.

28 {
29
30 ATH_MSG_DEBUG( "Initialising Tool" );
31 ATH_CHECK( detStore()->retrieve (m_calocell_id, "CaloCell_ID") );
32
33 ATH_CHECK(m_sgKey.initialize());
34 ATH_CHECK( m_cablingKey.initialize() );
35
36 return StatusCode::SUCCESS;
37 }
#define ATH_CHECK
Evaluate an expression and check for errors.
SG::ReadHandleKey< CaloCellContainer > m_sgKey
for properties
const CaloCell_ID * m_calocell_id

◆ retrieve()

StatusCode JiveXML::BadLArRetriever::retrieve ( ToolHandle< IFormatTool > & FormatTool)
overridevirtual

Retrieve all the data.

LAr data retrieval from default collection.

Definition at line 42 of file BadLArRetriever.cxx.

42 {
43
44 ATH_MSG_DEBUG( "in retrieve()" );
45
46 SG::ReadHandle<CaloCellContainer> cellContainer(m_sgKey);
47 if (!cellContainer.isValid()){
48 ATH_MSG_WARNING( "Could not retrieve Calorimeter Cells " );
49 }
50 else{
51 if(m_lar){
52 DataMap data = getBadLArData(&(*cellContainer));
53 ATH_CHECK( FormatTool->AddToEvent(dataTypeName(), m_sgKey.key(), &data) );
54 ATH_MSG_DEBUG( "Bad LAr retrieved" );
55 }
56 }
57
58 //LAr cells retrieved okay
59 return StatusCode::SUCCESS;
60 }
#define ATH_MSG_WARNING(x)
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
Gaudi::Property< bool > m_lar
const DataMap getBadLArData(const CaloCellContainer *cellContainer)
Retrieve LAr bad cell location and details.

Member Data Documentation

◆ m_cablingKey

SG::ReadCondHandleKey<LArOnOffIdMapping> JiveXML::BadLArRetriever::m_cablingKey {this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"}
private

Definition at line 57 of file BadLArRetriever.h.

57{this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"};

◆ m_calocell_id

const CaloCell_ID* JiveXML::BadLArRetriever::m_calocell_id {}
private

Definition at line 56 of file BadLArRetriever.h.

56{};

◆ m_cellConditionCut

Gaudi::Property<bool> JiveXML::BadLArRetriever::m_cellConditionCut {this, "CellConditionCut", false}
private

Definition at line 65 of file BadLArRetriever.h.

65{this, "CellConditionCut", false};

◆ m_cellEnergyPrec

Gaudi::Property<int> JiveXML::BadLArRetriever::m_cellEnergyPrec {this, "CellEnergyPrec", 3}
private

Definition at line 62 of file BadLArRetriever.h.

62{this, "CellEnergyPrec", 3};

◆ m_cellThreshold

Gaudi::Property<double> JiveXML::BadLArRetriever::m_cellThreshold {this, "LArlCellThreshold", 50.}
private

Definition at line 61 of file BadLArRetriever.h.

61{this, "LArlCellThreshold", 50.};

◆ m_doBadLAr

Gaudi::Property<bool> JiveXML::BadLArRetriever::m_doBadLAr {this, "DoBadLAr", false}
private

Definition at line 64 of file BadLArRetriever.h.

64{this, "DoBadLAr", false};

◆ m_lar

Gaudi::Property<bool> JiveXML::BadLArRetriever::m_lar {this, "RetrieveLAr", true}
private

Definition at line 63 of file BadLArRetriever.h.

63{this, "RetrieveLAr", true};

◆ m_sgKey

SG::ReadHandleKey<CaloCellContainer> JiveXML::BadLArRetriever::m_sgKey {this, "StoreGateKey", "AllCalo", "Name of the CaloCellContainer"}
private

for properties

Definition at line 60 of file BadLArRetriever.h.

60{this, "StoreGateKey", "AllCalo", "Name of the CaloCellContainer"};

The documentation for this class was generated from the following files: