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

Retrieves all Tile Calo Cell objects. More...

#include <BadTileRetriever.h>

Inheritance diagram for JiveXML::BadTileRetriever:
Collaboration diagram for JiveXML::BadTileRetriever:

Public Member Functions

virtual StatusCode retrieve (ToolHandle< IFormatTool > &FormatTool) override
 Retrieve all the data.
const DataMap getBadTileData (const CaloCellContainer *cellContainer)
 Retrieve Tile 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 Member Functions

void calcTILELayerSub (Identifier &)

Private Attributes

const CaloCell_IDm_calocell_id {}
SG::ReadHandleKey< CaloCellContainerm_sgKey {this, "StoreGateKey", "AllCalo", "Name of the CaloCellContainer"}
Gaudi::Property< double > m_cellThreshold {this, "CellThreshold", 50.}
Gaudi::Property< int > m_cellEnergyPrec {this, "CellEnergyPrec", 3}
Gaudi::Property< bool > m_tile {this, "RetrieveTILE", true}
Gaudi::Property< bool > m_doBadTile {this, "DoBadTile", false}
DataVect m_sub

Detailed Description

Retrieves all Tile Calo Cell objects.

  • Properties
    • StoreGateKeyTile: default is 'AllCalo'. Don't change.
    • CallThreshold: default is 50 MeV
    • RetrieveTile: activate retriever, default is true
    • CellEnergyPrec: output precision, default is 3 digits
    • DoBadTile: write Tile bad cell, default is false
  • Retrieved Data
    • location in phi and eta
    • identifier and energy of each cell

Definition at line 37 of file BadTileRetriever.h.

Member Function Documentation

◆ calcTILELayerSub()

void JiveXML::BadTileRetriever::calcTILELayerSub ( Identifier & cellid)
private

Definition at line 109 of file BadTileRetriever.cxx.

110 {
111 if(m_calocell_id->is_tile_barrel(cellid))
112 {
113 if(m_calocell_id->is_tile_negative(cellid))
114 m_sub.emplace_back(2);
115 else
116 m_sub.emplace_back(3);
117 }
118 else if(m_calocell_id->is_tile_extbarrel(cellid))
119 {
120 if(m_calocell_id->is_tile_negative(cellid))
121 m_sub.emplace_back(0);
122 else
123 m_sub.emplace_back(5);
124 }
125 //else in ITC or scint
126 else
127 {
128 if(m_calocell_id->is_tile_negative(cellid))
129 m_sub.emplace_back(1);
130 else
131 m_sub.emplace_back(4);
132 }
133 }
const CaloCell_ID * m_calocell_id

◆ dataTypeName()

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

Return the name of the data type.

Definition at line 46 of file BadTileRetriever.h.

46{ return "BadTILE"; };

◆ getBadTileData()

const DataMap JiveXML::BadTileRetriever::getBadTileData ( const CaloCellContainer * cellContainer)

Retrieve Tile bad cell location and details.

Parameters
FormatToolthe tool that will create formated output from the DataMap

Definition at line 66 of file BadTileRetriever.cxx.

66 {
67 ATH_MSG_DEBUG( "getBadTileData()" );
68 char rndStr[30];
70 DataVect phi; phi.reserve(cellContainer->size());
71 DataVect eta; eta.reserve(cellContainer->size());
72 DataVect idVec; idVec.reserve(cellContainer->size());
73 DataVect energyVec; energyVec.reserve(cellContainer->size());
74 m_sub.clear();
75 //Loop Over CaloCellContainer to retrieve TileCell information
78 if (m_doBadTile==true) {
79 double energyGeV;
80 //int cellInd;
81 ATH_MSG_DEBUG( "Start iterator loop over cells" );
82 for(;it1!=it2;++it1){
83 if( !(*it1)->badcell() ) continue;
84 Identifier cellid = (*it1)->ID();
85 calcTILELayerSub(cellid);
86 energyGeV = (*it1)->energy()*(1./GeV);
87 energyVec.emplace_back( gcvt( energyGeV, m_cellEnergyPrec, rndStr) );
88 idVec.emplace_back( (Identifier::value_type)(*it1)->ID().get_compact() );
89 phi.emplace_back((*it1)->phi());
90 eta.emplace_back((*it1)->eta());
91 } // end cell iterator
92 } // doBadTile
93
94 // write values into DataMap
95 const auto nEntries = phi.size();
96 DataMap["phi"] = std::move(phi);
97 DataMap["eta"] = std::move(eta);
98 DataMap["sub"] = std::move(m_sub);
99 DataMap["id"] = std::move(idVec);
100 DataMap["energy"] = std::move(energyVec);
101 //Be verbose
102 ATH_MSG_DEBUG( dataTypeName() << " retrieved with " << nEntries << " entries" );
103 //All collections retrieved okay
104 return DataMap;
105 } // getTileData
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#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.
Gaudi::Property< bool > m_doBadTile
void calcTILELayerSub(Identifier &)
virtual std::string dataTypeName() const override
Return the name of the data type.
Gaudi::Property< int > m_cellEnergyPrec
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

◆ initialize()

StatusCode JiveXML::BadTileRetriever::initialize ( )
overridevirtual

Default AthAlgTool methods.

Initialise the Tool.

Definition at line 35 of file BadTileRetriever.cxx.

35 {
36 ATH_MSG_DEBUG( "Initialising Tool" );
37 ATH_CHECK( detStore()->retrieve (m_calocell_id, "CaloCell_ID") );
38 ATH_CHECK(m_sgKey.initialize());
39 return StatusCode::SUCCESS;
40 }
#define ATH_CHECK
Evaluate an expression and check for errors.
SG::ReadHandleKey< CaloCellContainer > m_sgKey
virtual StatusCode retrieve(ToolHandle< IFormatTool > &FormatTool) override
Retrieve all the data.

◆ retrieve()

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

Retrieve all the data.

Tile data retrieval from chosen collection.

Definition at line 45 of file BadTileRetriever.cxx.

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

Member Data Documentation

◆ m_calocell_id

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

Definition at line 53 of file BadTileRetriever.h.

53{};

◆ m_cellEnergyPrec

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

Definition at line 57 of file BadTileRetriever.h.

57{this, "CellEnergyPrec", 3};

◆ m_cellThreshold

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

Definition at line 56 of file BadTileRetriever.h.

56{this, "CellThreshold", 50.};

◆ m_doBadTile

Gaudi::Property<bool> JiveXML::BadTileRetriever::m_doBadTile {this, "DoBadTile", false}
private

Definition at line 59 of file BadTileRetriever.h.

59{this, "DoBadTile", false};

◆ m_sgKey

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

Definition at line 55 of file BadTileRetriever.h.

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

◆ m_sub

DataVect JiveXML::BadTileRetriever::m_sub
private

Definition at line 61 of file BadTileRetriever.h.

◆ m_tile

Gaudi::Property<bool> JiveXML::BadTileRetriever::m_tile {this, "RetrieveTILE", true}
private

Definition at line 58 of file BadTileRetriever.h.

58{this, "RetrieveTILE", true};

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