|
ATLAS Offline Software
|
Go to the documentation of this file.
17 #include "GaudiKernel/MsgStream.h"
27 m_SubDetectors (
"LAr_All"),
28 m_EmBarrelHitContainerName (
"LArHitEMB"),
29 m_EmEndCapHitContainerName (
"LArHitEMEC"),
30 m_HecHitContainerName (
"LArHitHEC"),
31 m_ForWardHitContainerName (
"LArHitFCAL"),
32 m_larem_id(nullptr),m_larhec_id(nullptr),m_larfcal_id(nullptr)
132 return(StatusCode::FAILURE);
139 if (!(service(
"PileUpMergeSvc",
p_mergeSvc)).isSuccess() ||
142 return StatusCode::FAILURE;
146 ATH_MSG_INFO(
"PileUpMergeSvc successfully initialized");
153 if (
sc.isFailure()) {
154 ATH_MSG_ERROR(
"Unable to retrieve CaloIdManager from DetectoreStore");
155 return StatusCode::FAILURE;
161 return StatusCode::SUCCESS;
168 std::vector<double> eCells_EM;
169 std::vector<double> eCells_HEC;
170 std::vector<double> eCells_FCAL;
176 ATH_MSG_INFO(
" ncells " << ncells_em <<
" " << ncells_hec <<
" " << ncells_fcal);
179 eCells_EM.resize(ncells_em,0.);
181 eCells_HEC.resize(ncells_hec,0.);
183 eCells_FCAL.resize(ncells_fcal,0.);
198 if (
sc.isFailure()) {
206 if (
sc.isFailure()) {
215 if (
sc.isFailure()) {
223 if (
sc.isFailure()) {
234 for (
unsigned int iHitContainer=0;iHitContainer<
m_HitContainer.size();iHitContainer++)
256 return StatusCode::FAILURE;
260 TimedHitContList hitContList;
265 ,hitContList).isSuccess()) && hitContList.empty()) {
267 return StatusCode::FAILURE;
273 while (iFirstCont != iEndCont) {
280 while (f_cell != l_cell) {
281 double energy = (*f_cell)->energy();
288 if (idHash<ncells_em) eCells_EM[idHash] +=
energy;
292 if (idHash<ncells_hec) eCells_HEC[idHash] +=
energy;
296 if (idHash<ncells_fcal) eCells_FCAL[idHash] +=
energy;
304 ATH_MSG_INFO(
" total number of hits found " << nhit_tot);
311 for (
unsigned int i=0;
i<ncells_em;
i++) {
330 ATH_MSG_INFO(
" Number of hits filled in LArHitEM containers " << nhit);
335 for (
unsigned int i=0;
i<ncells_hec;
i++) {
346 ATH_MSG_INFO(
" Number of hits filled in LArHitHEC container " << nhit);
351 for (
unsigned int i=0;
i<ncells_fcal;
i++) {
354 double energy = eCells_FCAL[
i];
362 ATH_MSG_INFO(
" Number of hits filled in LArHitFCAL container " << nhit);
370 if (
sc.isFailure()) {
372 return(StatusCode::FAILURE);
378 if (
sc.isFailure()) {
380 return(StatusCode::FAILURE);
386 if (
sc.isFailure()) {
388 return(StatusCode::FAILURE);
394 if (
sc.isFailure()) {
396 return(StatusCode::FAILURE);
401 return StatusCode::SUCCESS;
408 ATH_MSG_DEBUG(
" LArHitMerger finalize completed successfully");
411 return StatusCode::SUCCESS;
virtual StatusCode initialize()
JetConstituentVector::iterator iterator
size_type channel_hash_max() const
One more than the largest channel (cell) hash code.
const LArEM_ID * m_larem_id
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
void finalize()
The method to be called at the end of event by SD.
const LArHEC_ID * m_larhec_id
const LArEM_ID * getEM_ID(void) const
std::string m_EmEndCapHitContainerName
IdentifierHash channel_hash(Identifier channelId) const
Convert a connected channel (cell) Identifier to a hash code.
LArHitMerger(const std::string &name, ISvcLocator *pSvcLocator)
std::string m_SubDetectors
PileUpMergeSvc * p_mergeSvc
std::string m_HecHitContainerName
Identifier channel_id(const ExpandedIdentifier &exp_id) const
Build a cell identifier from an expanded identifier.
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
boost::transform_iterator< make_const, typename CONT::const_iterator > const_iterator
std::list< value_t > type
type of the collection of timed data object
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
IdentifierHash channel_hash(Identifier channelId) const
create hash id from channel id
const LArHEC_ID * getHEC_ID(void) const
This class initializes the Calo (LAr and Tile) offline identifiers.
::StatusCode StatusCode
StatusCode definition for legacy code.
Identifier channel_id(const ExpandedIdentifier &exp_id) const
cell identifier for a channel from ExpandedIdentifier
const LArFCAL_ID * getFCAL_ID(void) const
std::string m_ForWardHitContainerName
const LArFCAL_ID * m_larfcal_id
IdentifierHash channel_hash(Identifier channelId) const
create hash id from channel id
virtual StatusCode execute()
Identifier channel_id(const ExpandedIdentifier &exp_id) const
channel identifier for a channel from ExpandedIdentifier
Class to store hit energy and time in LAr cell from G4 simulation.
virtual StatusCode finalize()
std::vector< bool > m_SubDetFlag
def time(flags, cells_name, *args, **kw)
bool is_em_barrel(const Identifier id) const
test if the id belongs to the EM barrel
the preferred mechanism to access information from the different event stores in a pileup job.
std::vector< std::string > m_HitContainer
const_iterator end() const
std::string m_EmBarrelHitContainerName
const_iterator begin() const
bool is_em_endcap(const Identifier id) const
test if the id belongs to the EM Endcap
StatusCode retrieveSubEvtsData(const KEY &dataKey, TIMEDDATA &timedData)
retrieve keyed DATA objs for all sub-events and attach a time to them
std::vector< int > m_CaloType