7#include "CaloEvent/CaloClusterContainer.h"
10#include "CaloGeoHelpers/CaloSampling.h"
12#include "CLHEP/Units/SystemOfUnits.h"
27 declareInterface<IDataRetriever>(
this);
30 "Collection to be first in output, shown in Atlantis without switching");
32 "Other collections to be retrieved. If list left empty, all available retrieved");
51 if (
sc.isFailure() ) {
64 ATH_MSG_DEBUG(
"Trying to retrieve CaloCalTopoCluster (for non-calib)" );
65 StatusCode sc3 =
evtStore()->retrieve(ccc,
"CaloCalTopoCluster");
66 if (sc3.isFailure() ) {
67 ATH_MSG_WARNING(
"Collection CaloCalTopoCluster (for non-calib) not found in SG " );
70 if ( FormatTool->AddToEvent(
dataTypeName(),
"BasicEnergyCaloCalTopoCluster", &
data).isFailure()){
71 ATH_MSG_WARNING(
"Collection CaloCalTopoCluster (for non-calib) not found in SG " );
80 ATH_MSG_WARNING(
"Unable to retrieve iterator for AODCaloCluster collection" );
85 std::string::size_type position =
iterator.key().find(
"HLTAutoKey",0);
103 std::vector<std::string>::const_iterator keyIter;
105 StatusCode
sc =
evtStore()->retrieve( ccc, (*keyIter) );
106 if (!
sc.isFailure()) {
109 if ( FormatTool->AddToEvent(
dataTypeName(), (*keyIter), &
data).isFailure()){
118 return StatusCode::SUCCESS;
143 std::string
label=
"";
146 float eInSample = 0.;
147 float eInSampleFull = 0.;
149 float rawemfrac = 0.;
153 std::string tagCells;
154 tagCells =
"cells multiple=\"1.0\"";
157 for (; itr != ccc->
end(); ++itr) {
162 for (s=0;s<CaloSampling::Unknown; s++){
166 eInSample += (*itr)->eSample(CaloSampling::EMB1);
167 eInSample += (*itr)->eSample(CaloSampling::EMB2);
168 eInSample += (*itr)->eSample(CaloSampling::EMB3);
169 eInSample += (*itr)->eSample(CaloSampling::EME1);
170 eInSample += (*itr)->eSample(CaloSampling::EME2);
171 eInSample += (*itr)->eSample(CaloSampling::EME3);
172 eInSample += (*itr)->eSample(CaloSampling::FCAL1);
174 emfrac = eInSample/eInSampleFull;
177 if ( emfrac > 1.0 ) emfrac = 1.;
178 if ( emfrac < 0.0 ) emfrac = 0.;
179 emfracVec.push_back( emfrac );
181 label =
"AllMeV_SumEMSampl=" +
DataType( eInSample ).toString() +
182 "_SumAllSampl=" +
DataType( eInSampleFull ).toString() +
183 "_basicEnergy=" +
DataType( (*itr)->getBasicEnergy()).toString() +
184 "_calcEMFrac=" +
DataType( rawemfrac ).toString()+
185 "_outEMFrac=" +
DataType( emfrac ).toString();
189 labelVec.push_back(
label );
195 phi.emplace_back((*itr)->phi());
196 eta.emplace_back((*itr)->eta());
198 et.emplace_back((*itr)->et()/CLHEP::GeV);
200 et.emplace_back( (((*itr)->getBasicEnergy()/CLHEP::GeV)*((*itr)->sinTh())) );
203 numCells.emplace_back(
"0" );
204 cells.emplace_back(
"0" );
205 idVec.emplace_back( ++
id );
210 const auto nEntries =
phi.size();
214 DataMap[tagCells] = std::move(cells);
215 DataMap[
"numCells"] = std::move(numCells);
216 DataMap[
"id"] = std::move(idVec);
217 DataMap[
"emfrac"] = std::move(emfracVec);
218 DataMap[
"label"] = std::move(labelVec);
222 <<
" retrieved with " << nEntries <<
" entries");
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#define ATH_MSG_WARNING(x)
char data[hepevt_bytes_allocation_ATLAS]
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
ServiceHandle< StoreGateSvc > & evtStore()
Storable container for CaloCluster.
DataModel_detail::const_iterator< DataVector > const_iterator
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
size_type size() const noexcept
Returns the number of elements in the collection.
virtual StatusCode retrieve(ToolHandle< IFormatTool > &FormatTool)
Retrieve all the data.
virtual std::string dataTypeName() const
Return the name of the data type.
const DataMap getData(const CaloClusterContainer *, bool calibFlag)
Retrieve basic parameters, mainly four-vectors.
std::string m_sgKeyFavourite
AODCaloClusterRetriever(const std::string &type, const std::string &name, const IInterface *parent)
Standard Constructor.
std::vector< std::string > m_otherKeys
const std::string m_typeName
a const_iterator facade to DataHandle.
std::string label(const std::string &format, int i)
This header is shared inbetween the C-style server thread and the C++ Athena ServerSvc.
std::map< std::string, DataVect > DataMap
std::vector< DataType > DataVect
Defines a map with a key and a vector of DataType objects e.g.
Extra patterns decribing particle interation process.