ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
LArCalorimeter
LArSimEvent
src
LArHitContainer.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
LArSimEvent/LArHitContainer.h
"
6
#include <typeinfo>
7
#include <stdio.h>
8
9
#include <iostream>
10
11
LArHitContainer::LArHitContainer
(
const
std::string& collectionName)
12
:
AthenaHitsVector
<
LArHit
>(collectionName)
13
{
14
15
}
16
17
LArHitContainer::operator std::string ()
const
{
18
19
char
* stCounter =
new
char
[48] ;
20
char
* nameOfContainer =
new
char
[48] ;
21
22
const
char
* stname =
typeid
( *this ).name() ;
23
int
lname ;
24
sscanf( stname ,
"%80d%47s"
, &lname , nameOfContainer ) ;
25
26
std::string newline(
"\n"
) ;
27
std::string hitContainerString = nameOfContainer ;
28
hitContainerString +=
": content "
;
29
hitContainerString += newline ;
30
31
int
counter = 0 ;
32
33
for
(
const
LArHit
*
hit
: *
this
) {
// Loop over Hits
34
sprintf( stCounter ,
"%d"
, counter ) ;
35
36
hitContainerString +=
"LArHit["
;
37
hitContainerString += stCounter ;
38
hitContainerString +=
"] "
;
39
40
sprintf( stCounter ,
" ID = %x ; "
,
hit
->cellID().get_identifier32().get_compact() ) ;
41
hitContainerString += stCounter ;
42
43
sprintf( stCounter ,
" E= %f MeV ; "
,
hit
->energy() ) ;
44
hitContainerString += stCounter ;
45
sprintf( stCounter ,
" t= %f ns ; "
,
hit
->time() ) ;
46
hitContainerString += stCounter ;
47
48
// hitContainerString += (std::string) (*hit) ;
49
hitContainerString += newline ;
50
51
counter ++ ;
52
53
}
54
55
sprintf( stCounter ,
"%d"
, counter ) ;
56
hitContainerString += newline ;
57
hitContainerString +=
"Number of Hits in this container : "
;
58
hitContainerString += stCounter ;
59
60
61
delete
[] stCounter ;
62
delete
[] nameOfContainer ;
63
64
return
hitContainerString ;
65
66
}
hit
bool hit(const Container &ids, int pdgId)
Definition
JetIRCSafeLabelTool.cxx:64
LArHitContainer.h
AthenaHitsVector< LArHit >::AthenaHitsVector
AthenaHitsVector(const std::string &collectionName="DefaultCollectionName", AthHitVec::OwnershipPolicy ownPolicy=AthHitVec::OWN_ELEMENTS)
Definition
AthenaHitsVector.h:112
LArHitContainer::LArHitContainer
LArHitContainer(const std::string &collectionName="DefaultCollectionName")
Definition
LArHitContainer.cxx:11
LArHit
Class to store hit energy and time in LAr cell from G4 simulation.
Definition
LArHit.h:25
Generated on
for ATLAS Offline Software by
1.17.0