ATLAS Offline Software
Loading...
Searching...
No Matches
CaloCalibrationHitContainer.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2023 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#include "GaudiKernel/System.h"
10#include <cstdio>
11#include <typeinfo>
12
13#include <iostream>
14#include <sstream>
15#include <utility>
16
17
19: AthenaHitsVector<CaloCalibrationHit>(collectionName)
20{
21
22}
23
24CaloCalibrationHitContainer::operator std::string () const
25{
26 std::string newline( "\n" ) ;
27 std::ostringstream ss;
28 ss << System::typeinfoName(typeid(*this));
29 ss << ": content " ;
30 ss << newline ;
31
32 int counter = 0 ;
33
34 for (const CaloCalibrationHit* hit : *this) { // Loop over Hits
35 ss << "CaloCalibrationHit[" ;
36 ss << counter;
37 ss << "] " ;
38
39 ss << " ID = " << std::hex << hit->cellID().get_identifier32().get_compact()
40 << std::dec << " ; ";
41
42 ss << " E=("
43 << hit->energy(0) << ","
44 << hit->energy(1) << ","
45 << hit->energy(2) << ","
46 << hit->energy(3) << ") MeV";
47
48 ss << newline ;
49
50 counter ++ ;
51
52 }
53
54 ss << newline ;
55 ss << "Number of Hits in this container : " ;
56 ss << counter;
57
58
59 return ss.str() ;
60}
static Double_t ss
AthenaHitsVector(const std::string &collectionName="DefaultCollectionName", AthHitVec::OwnershipPolicy ownPolicy=AthHitVec::OWN_ELEMENTS)
CaloCalibrationHitContainer(const std::string &collectionName="DefaultCollectionName")
Constructor of CaloCalibrationHitContainer.
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.