ATLAS Offline Software
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 
25 = default;
26 
27 CaloCalibrationHitContainer::operator std::string () const
28 {
29  std::string newline( "\n" ) ;
30  std::ostringstream ss;
31  ss << System::typeinfoName(typeid(*this));
32  ss << ": content " ;
33  ss << newline ;
34 
35  int counter = 0 ;
36 
37  for (const CaloCalibrationHit* hit : *this) { // Loop over Hits
38  ss << "CaloCalibrationHit[" ;
39  ss << counter;
40  ss << "] " ;
41 
42  ss << " ID = " << std::hex << hit->cellID().get_identifier32().get_compact()
43  << std::dec << " ; ";
44 
45  ss << " E=("
46  << hit->energy(0) << ","
47  << hit->energy(1) << ","
48  << hit->energy(2) << ","
49  << hit->energy(3) << ") MeV";
50 
51  ss << newline ;
52 
53  counter ++ ;
54 
55  }
56 
57  ss << newline ;
58  ss << "Number of Hits in this container : " ;
59  ss << counter;
60 
61 
62  return ss.str() ;
63 }
PowhegControl_ttHplus_NLO.ss
ss
Definition: PowhegControl_ttHplus_NLO.py:83
Identifier::get_identifier32
Identifier32 get_identifier32() const
Get the 32-bit version Identifier, will be invalid if >32 bits needed.
Identifier32::get_compact
value_type get_compact() const
Get the compact id.
Definition: Identifier32.h:44
CaloCalibrationHitContainer.h
CaloCalibrationHitContainer::CaloCalibrationHitContainer
CaloCalibrationHitContainer(const std::string &collectionName="DefaultCollectionName")
Constructor of CaloCalibrationHitContainer.
Definition: CaloCalibrationHitContainer.cxx:18
Athena::typeinfoName
std::string typeinfoName(const std::type_info &ti)
Convert a type_info to a demangled string.
Definition: AthenaKernel/src/ClassName.cxx:23
CaloCalibrationHit::cellID
Identifier cellID() const
Definition: CaloCalibrationHit.h:118
CaloCalibrationHit
Class to store calorimeter calibration hit.
Definition: CaloCalibrationHit.h:23
CaloCalibrationHitContainer::~CaloCalibrationHitContainer
virtual ~CaloCalibrationHitContainer()
Destructor.
CaloCalibrationHit::energy
double energy(unsigned int i) const
Definition: CaloCalibrationHit.h:143
AthenaHitsVector
Definition: AthenaHitsVector.h:39
test_pyathena.counter
counter
Definition: test_pyathena.py:15
calibdata.newline
newline
Definition: calibdata.py:526