Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
B5EmCalorimeterHit Class Reference

#include <B5EmCalorimeterHit.hh>

Inheritance diagram for B5EmCalorimeterHit:
Collaboration diagram for B5EmCalorimeterHit:

Public Member Functions

 B5EmCalorimeterHit ()
 
 B5EmCalorimeterHit (G4int cellID)
 
 B5EmCalorimeterHit (const B5EmCalorimeterHit &right)
 
virtual ~B5EmCalorimeterHit ()
 
const B5EmCalorimeterHitoperator= (const B5EmCalorimeterHit &right)
 
int operator== (const B5EmCalorimeterHit &right) const
 
voidoperator new (size_t)
 
void operator delete (void *aHit)
 
virtual void Draw ()
 
virtual const std::map
< G4String, G4AttDef > * 
GetAttDefs () const
 
virtual std::vector< G4AttValue > * CreateAttValues () const
 
virtual void Print ()
 
void SetCellID (G4int z)
 
G4int GetCellID () const
 
void SetEdep (G4double de)
 
void AddEdep (G4double de)
 
G4double GetEdep () const
 
void SetPos (G4ThreeVector xyz)
 
G4ThreeVector GetPos () const
 
void SetRot (G4RotationMatrix rmat)
 
G4RotationMatrix GetRot () const
 
void SetLogV (G4LogicalVolume *val)
 
const G4LogicalVolumeGetLogV () const
 
- Public Member Functions inherited from G4VHit
 G4VHit ()
 
virtual ~G4VHit ()
 
G4int operator== (const G4VHit &right) const
 

Detailed Description

EM Calorimeter hit

It records:

  • the cell ID
  • the energy deposit
  • the cell logical volume, its position and rotation

Definition at line 52 of file B5EmCalorimeterHit.hh.

Constructor & Destructor Documentation

B5EmCalorimeterHit::B5EmCalorimeterHit ( )

Definition at line 50 of file B5EmCalorimeterHit.cc.

51 : G4VHit(),
52  fCellID(-1), fEdep(0.), fPos(0.), fPLogV(nullptr)
53 {}
G4VHit()
Definition: G4VHit.cc:34
B5EmCalorimeterHit::B5EmCalorimeterHit ( G4int  cellID)

Definition at line 57 of file B5EmCalorimeterHit.cc.

58 : G4VHit(),
59  fCellID(cellID), fEdep(0.), fPos(0.), fPLogV(nullptr)
60 {}
G4VHit()
Definition: G4VHit.cc:34
B5EmCalorimeterHit::B5EmCalorimeterHit ( const B5EmCalorimeterHit right)

Definition at line 69 of file B5EmCalorimeterHit.cc.

70 : G4VHit(),
71  fCellID(right.fCellID),
72  fEdep(right.fEdep),
73  fPos(right.fPos),
74  fRot(right.fRot),
75  fPLogV(right.fPLogV)
76 {}
G4VHit()
Definition: G4VHit.cc:34
B5EmCalorimeterHit::~B5EmCalorimeterHit ( )
virtual

Definition at line 64 of file B5EmCalorimeterHit.cc.

65 {}

Member Function Documentation

void B5EmCalorimeterHit::AddEdep ( G4double  de)
inline

Definition at line 75 of file B5EmCalorimeterHit.hh.

75 { fEdep += de; }
std::vector< G4AttValue > * B5EmCalorimeterHit::CreateAttValues ( ) const
virtual

Reimplemented from G4VHit.

Definition at line 149 of file B5EmCalorimeterHit.cc.

150 {
151  auto values = new std::vector<G4AttValue>;
152 
153  values
154  ->push_back(G4AttValue("HitType","EmCalorimeterHit",""));
155  values
156  ->push_back(G4AttValue("ID",G4UIcommand::ConvertToString(fCellID),""));
157  values
158  ->push_back(G4AttValue("Energy",G4BestUnit(fEdep,"Energy"),""));
159  values
160  ->push_back(G4AttValue("Pos",G4BestUnit(fPos,"Length"),""));
161 
162  if (fPLogV)
163  values->push_back(G4AttValue("LVol",fPLogV->GetName(),""));
164  else
165  values->push_back(G4AttValue("LVol"," ",""));
166 
167  return values;
168 }
static G4String ConvertToString(G4bool boolVal)
Definition: G4UIcommand.cc:372
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
const G4String & GetName() const

Here is the call graph for this function:

void B5EmCalorimeterHit::Draw ( )
virtual

Reimplemented from G4VHit.

Definition at line 100 of file B5EmCalorimeterHit.cc.

101 {
102  auto visManager = G4VVisManager::GetConcreteInstance();
103  if ( ! visManager || (fEdep==0.) ) return;
104 
105  // Draw a calorimeter cell with a color corresponding to its energy deposit
106  G4Transform3D trans(fRot.inverse(),fPos);
107  G4VisAttributes attribs;
108  auto pVA = fPLogV->GetVisAttributes();
109  if (pVA) attribs = *pVA;
110  auto rcol = fEdep/(0.7*GeV);
111  if (rcol>1.) rcol = 1.;
112  if (rcol<0.4) rcol = 0.4;
113  G4Colour colour(rcol,0.,0.);
114  attribs.SetColour(colour);
115  attribs.SetForceSolid(true);
116  visManager->Draw(*fPLogV,attribs,trans);
117 }
static G4VVisManager * GetConcreteInstance()
HepRotation inverse() const
const G4VisAttributes * GetVisAttributes() const
static constexpr double GeV
Definition: G4SIunits.hh:217

Here is the call graph for this function:

const std::map< G4String, G4AttDef > * B5EmCalorimeterHit::GetAttDefs ( ) const
virtual

Reimplemented from G4VHit.

Definition at line 121 of file B5EmCalorimeterHit.cc.

122 {
123  G4bool isNew;
124  auto store = G4AttDefStore::GetInstance("B5EmCalorimeterHit",isNew);
125 
126  if (isNew) {
127  (*store)["HitType"]
128  = G4AttDef("HitType","Hit Type","Physics","","G4String");
129 
130  (*store)["ID"]
131  = G4AttDef("ID","ID","Physics","","G4int");
132 
133  (*store)["Energy"]
134  = G4AttDef("Energy", "Energy Deposited", "Physics", "G4BestUnit",
135  "G4double");
136 
137  (*store)["Pos"]
138  = G4AttDef("Pos", "Position", "Physics","G4BestUnit",
139  "G4ThreeVector");
140 
141  (*store)["LVol"]
142  = G4AttDef("LVol","Logical Volume","Physics","","G4String");
143  }
144  return store;
145 }
bool G4bool
Definition: G4Types.hh:79
std::map< G4String, G4AttDef > * GetInstance(const G4String &storeKey, G4bool &isNew)

Here is the call graph for this function:

G4int B5EmCalorimeterHit::GetCellID ( ) const
inline

Definition at line 72 of file B5EmCalorimeterHit.hh.

72 { return fCellID; }
G4double B5EmCalorimeterHit::GetEdep ( ) const
inline

Definition at line 76 of file B5EmCalorimeterHit.hh.

76 { return fEdep; }
const G4LogicalVolume* B5EmCalorimeterHit::GetLogV ( ) const
inline

Definition at line 85 of file B5EmCalorimeterHit.hh.

85 { return fPLogV; }
G4ThreeVector B5EmCalorimeterHit::GetPos ( ) const
inline

Definition at line 79 of file B5EmCalorimeterHit.hh.

79 { return fPos; }
G4RotationMatrix B5EmCalorimeterHit::GetRot ( ) const
inline

Definition at line 82 of file B5EmCalorimeterHit.hh.

82 { return fRot; }
void B5EmCalorimeterHit::operator delete ( void aHit)
inline

Definition at line 107 of file B5EmCalorimeterHit.hh.

108 {
109  B5EmCalorimeterHitAllocator->FreeSingle((B5EmCalorimeterHit*) aHit);
110 }
G4ThreadLocal G4Allocator< B5EmCalorimeterHit > * B5EmCalorimeterHitAllocator
void * B5EmCalorimeterHit::operator new ( size_t  )
inline

Definition at line 99 of file B5EmCalorimeterHit.hh.

100 {
103  }
104  return (void*)B5EmCalorimeterHitAllocator->MallocSingle();
105 }
G4ThreadLocal G4Allocator< B5EmCalorimeterHit > * B5EmCalorimeterHitAllocator
const B5EmCalorimeterHit & B5EmCalorimeterHit::operator= ( const B5EmCalorimeterHit right)

Definition at line 80 of file B5EmCalorimeterHit.cc.

82 {
83  fCellID = right.fCellID;
84  fEdep = right.fEdep;
85  fPos = right.fPos;
86  fRot = right.fRot;
87  fPLogV = right.fPLogV;
88  return *this;
89 }
int B5EmCalorimeterHit::operator== ( const B5EmCalorimeterHit right) const

Definition at line 93 of file B5EmCalorimeterHit.cc.

94 {
95  return (fCellID==right.fCellID);
96 }
void B5EmCalorimeterHit::Print ( void  )
virtual

Reimplemented from G4VHit.

Definition at line 172 of file B5EmCalorimeterHit.cc.

173 {
174  G4cout << " Cell[" << fCellID << "] " << fEdep/MeV << " (MeV)" << G4endl;
175 }
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
static constexpr double MeV
Definition: G4SIunits.hh:214
void B5EmCalorimeterHit::SetCellID ( G4int  z)
inline

Definition at line 71 of file B5EmCalorimeterHit.hh.

71 { fCellID = z; }
tuple z
Definition: test.py:28
void B5EmCalorimeterHit::SetEdep ( G4double  de)
inline

Definition at line 74 of file B5EmCalorimeterHit.hh.

74 { fEdep = de; }
void B5EmCalorimeterHit::SetLogV ( G4LogicalVolume val)
inline

Definition at line 84 of file B5EmCalorimeterHit.hh.

84 { fPLogV = val; }
void B5EmCalorimeterHit::SetPos ( G4ThreeVector  xyz)
inline

Definition at line 78 of file B5EmCalorimeterHit.hh.

78 { fPos = xyz; }
void B5EmCalorimeterHit::SetRot ( G4RotationMatrix  rmat)
inline

Definition at line 81 of file B5EmCalorimeterHit.hh.

81 { fRot = rmat; }

The documentation for this class was generated from the following files: