ATLAS Offline Software
Loading...
Searching...
No Matches
SrCaloCalibrationHitContainer.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5// 09-Feb-2004 WGS: The following code was duplicated from
6// CaloHitContainer.cxx and modified for CaloCalibrationHits.
7
9
10#include <cstdio>
11#include <iostream>
12#include <sstream>
13#include <typeinfo>
14#include <utility>
15
16#include "GaudiKernel/System.h"
17
19 const std::string& collectionName)
20 : AthenaHitsVector<CaloCalibrationHit>(collectionName) {}
21
23
24SrCaloCalibrationHitContainer::operator std::string() const {
25 std::string newline("\n");
26 std::ostringstream ss;
27 ss << System::typeinfoName(typeid(*this));
28 ss << ": content ";
29 ss << newline;
30
31 int counter = 0;
32
33 for (const CaloCalibrationHit* hit : *this) { // Loop over Hits
34 ss << "CaloCalibrationHit[";
35 ss << counter;
36 ss << "] ";
37
38 ss << " ID = " << std::hex << hit->cellID().get_identifier32().get_compact()
39 << std::dec << " ; ";
40
41 ss << " E=(" << hit->energy(0) << "," << hit->energy(1) << ","
42 << hit->energy(2) << "," << hit->energy(3) << ") MeV";
43
44 ss << newline;
45
46 counter++;
47 }
48
49 ss << newline;
50 ss << "Number of Hits in this container : ";
51 ss << counter;
52
53 return ss.str();
54}
static Double_t ss
AthenaHitsVector(const std::string &collectionName="DefaultCollectionName", AthHitVec::OwnershipPolicy ownPolicy=AthHitVec::OWN_ELEMENTS)
Class to store calorimeter calibration hit.
double energy(unsigned int i) const
Identifier cellID() const
value_type get_compact() const
Get the compact id.
Identifier32 get_identifier32() const
Get the 32-bit version Identifier, will be invalid if >32 bits needed.
SrCaloCalibrationHitContainer(const std::string &collectionName="DefaultCollectionName")
Constructor of SrCaloCalibrationHitContainer.
virtual ~SrCaloCalibrationHitContainer()
Destructor.