Geant4  10.02.p03
B5EmCalorimeterHit Class Reference

#include <B5EmCalorimeterHit.hh>

Inheritance diagram for B5EmCalorimeterHit:
Collaboration diagram for B5EmCalorimeterHit:

Public Member Functions

 B5EmCalorimeterHit ()
 
 B5EmCalorimeterHit (G4int z)
 
 B5EmCalorimeterHit (const B5EmCalorimeterHit &right)
 
virtual ~B5EmCalorimeterHit ()
 
const B5EmCalorimeterHitoperator= (const B5EmCalorimeterHit &right)
 
int operator== (const B5EmCalorimeterHit &right) const
 
void * operator 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
 

Private Attributes

G4int fCellID
 
G4double fEdep
 
G4ThreeVector fPos
 
G4RotationMatrix fRot
 
const G4LogicalVolumefPLogV
 

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() [1/3]

B5EmCalorimeterHit::B5EmCalorimeterHit ( )

Definition at line 50 of file B5EmCalorimeterHit.cc.

51 : G4VHit(), fCellID(-1), fEdep(0.), fPos(0), fPLogV(0)
52 {}
G4VHit()
Definition: G4VHit.cc:34
const G4LogicalVolume * fPLogV

◆ B5EmCalorimeterHit() [2/3]

B5EmCalorimeterHit::B5EmCalorimeterHit ( G4int  z)

Definition at line 56 of file B5EmCalorimeterHit.cc.

57 : G4VHit(), fCellID(z), fEdep(0.), fPos(0), fPLogV(0)
58 {}
G4VHit()
Definition: G4VHit.cc:34
const G4LogicalVolume * fPLogV

◆ B5EmCalorimeterHit() [3/3]

B5EmCalorimeterHit::B5EmCalorimeterHit ( const B5EmCalorimeterHit right)

Definition at line 67 of file B5EmCalorimeterHit.cc.

68 : G4VHit() {
69  fCellID = right.fCellID;
70  fEdep = right.fEdep;
71  fPos = right.fPos;
72  fRot = right.fRot;
73  fPLogV = right.fPLogV;
74 }
G4VHit()
Definition: G4VHit.cc:34
G4RotationMatrix fRot
const G4LogicalVolume * fPLogV

◆ ~B5EmCalorimeterHit()

B5EmCalorimeterHit::~B5EmCalorimeterHit ( )
virtual

Definition at line 62 of file B5EmCalorimeterHit.cc.

63 {}

Member Function Documentation

◆ AddEdep()

void B5EmCalorimeterHit::AddEdep ( G4double  de)
inline

Definition at line 75 of file B5EmCalorimeterHit.hh.

75 { fEdep += de; }
Here is the caller graph for this function:

◆ CreateAttValues()

std::vector< G4AttValue > * B5EmCalorimeterHit::CreateAttValues ( ) const
virtual

Reimplemented from G4VHit.

Definition at line 149 of file B5EmCalorimeterHit.cc.

150 {
151  std::vector<G4AttValue>* 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:371
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
const G4LogicalVolume * fPLogV
const G4String & GetName() const
Here is the call graph for this function:

◆ Draw()

void B5EmCalorimeterHit::Draw ( )
virtual

Reimplemented from G4VHit.

Definition at line 98 of file B5EmCalorimeterHit.cc.

99 {
101  if (pVVisManager&&(fEdep>0.))
102  {
103  // Draw a calorimeter cell with a color corresponding to its energy deposit
104  G4Transform3D trans(fRot.inverse(),fPos);
105  G4VisAttributes attribs;
106  const G4VisAttributes* pVA = fPLogV->GetVisAttributes();
107  if (pVA) attribs = *pVA;
108  G4double rcol = fEdep/(0.7*GeV);
109  if (rcol>1.) rcol = 1.;
110  if (rcol<0.4) rcol = 0.4;
111  G4Colour colour(rcol,0.,0.);
112  attribs.SetColour(colour);
113  attribs.SetForceSolid(true);
114  pVVisManager->Draw(*fPLogV,attribs,trans);
115  }
116 }
virtual void Draw(const G4Circle &, const G4Transform3D &objectTransformation=G4Transform3D())=0
static G4VVisManager * GetConcreteInstance()
G4RotationMatrix fRot
const G4LogicalVolume * fPLogV
const G4VisAttributes * GetVisAttributes() const
static const double GeV
Definition: G4SIunits.hh:214
HepRotation inverse() const
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:

◆ GetAttDefs()

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

Reimplemented from G4VHit.

Definition at line 120 of file B5EmCalorimeterHit.cc.

121 {
122  G4bool isNew;
123  std::map<G4String,G4AttDef>* store
124  = 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:

◆ GetCellID()

G4int B5EmCalorimeterHit::GetCellID ( ) const
inline

Definition at line 72 of file B5EmCalorimeterHit.hh.

72 { return fCellID; }

◆ GetEdep()

G4double B5EmCalorimeterHit::GetEdep ( ) const
inline

Definition at line 76 of file B5EmCalorimeterHit.hh.

76 { return fEdep; }
Here is the caller graph for this function:

◆ GetLogV()

const G4LogicalVolume* B5EmCalorimeterHit::GetLogV ( ) const
inline

Definition at line 85 of file B5EmCalorimeterHit.hh.

85 { return fPLogV; }
const G4LogicalVolume * fPLogV
Here is the caller graph for this function:

◆ GetPos()

G4ThreeVector B5EmCalorimeterHit::GetPos ( ) const
inline

Definition at line 79 of file B5EmCalorimeterHit.hh.

79 { return fPos; }

◆ GetRot()

G4RotationMatrix B5EmCalorimeterHit::GetRot ( ) const
inline

Definition at line 82 of file B5EmCalorimeterHit.hh.

82 { return fRot; }
G4RotationMatrix fRot

◆ operator delete()

void B5EmCalorimeterHit::operator delete ( void *  aHit)
inline

Definition at line 106 of file B5EmCalorimeterHit.hh.

107 {
108  B5EmCalorimeterHitAllocator->FreeSingle((B5EmCalorimeterHit*) aHit);
109 }
G4ThreadLocal G4Allocator< B5EmCalorimeterHit > * B5EmCalorimeterHitAllocator

◆ operator new()

void * B5EmCalorimeterHit::operator new ( size_t  )
inline

Definition at line 99 of file B5EmCalorimeterHit.hh.

100 {
103  return (void*)B5EmCalorimeterHitAllocator->MallocSingle();
104 }
G4ThreadLocal G4Allocator< B5EmCalorimeterHit > * B5EmCalorimeterHitAllocator

◆ operator=()

const B5EmCalorimeterHit & B5EmCalorimeterHit::operator= ( const B5EmCalorimeterHit right)

Definition at line 78 of file B5EmCalorimeterHit.cc.

80 {
81  fCellID = right.fCellID;
82  fEdep = right.fEdep;
83  fPos = right.fPos;
84  fRot = right.fRot;
85  fPLogV = right.fPLogV;
86  return *this;
87 }
G4RotationMatrix fRot
const G4LogicalVolume * fPLogV

◆ operator==()

int B5EmCalorimeterHit::operator== ( const B5EmCalorimeterHit right) const

Definition at line 91 of file B5EmCalorimeterHit.cc.

92 {
93  return (fCellID==right.fCellID);
94 }

◆ Print()

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 }
static const double MeV
Definition: G4SIunits.hh:211
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61

◆ SetCellID()

void B5EmCalorimeterHit::SetCellID ( G4int  z)
inline

Definition at line 71 of file B5EmCalorimeterHit.hh.

◆ SetEdep()

void B5EmCalorimeterHit::SetEdep ( G4double  de)
inline

Definition at line 74 of file B5EmCalorimeterHit.hh.

74 { fEdep = de; }

◆ SetLogV()

void B5EmCalorimeterHit::SetLogV ( G4LogicalVolume val)
inline

Definition at line 84 of file B5EmCalorimeterHit.hh.

84 { fPLogV = val; }
const G4LogicalVolume * fPLogV
Here is the caller graph for this function:

◆ SetPos()

void B5EmCalorimeterHit::SetPos ( G4ThreeVector  xyz)
inline

Definition at line 78 of file B5EmCalorimeterHit.hh.

78 { fPos = xyz; }
Here is the caller graph for this function:

◆ SetRot()

void B5EmCalorimeterHit::SetRot ( G4RotationMatrix  rmat)
inline

Definition at line 81 of file B5EmCalorimeterHit.hh.

81 { fRot = rmat; }
G4RotationMatrix fRot
Here is the caller graph for this function:

Member Data Documentation

◆ fCellID

G4int B5EmCalorimeterHit::fCellID
private

Definition at line 88 of file B5EmCalorimeterHit.hh.

◆ fEdep

G4double B5EmCalorimeterHit::fEdep
private

Definition at line 89 of file B5EmCalorimeterHit.hh.

◆ fPLogV

const G4LogicalVolume* B5EmCalorimeterHit::fPLogV
private

Definition at line 92 of file B5EmCalorimeterHit.hh.

◆ fPos

G4ThreeVector B5EmCalorimeterHit::fPos
private

Definition at line 90 of file B5EmCalorimeterHit.hh.

◆ fRot

G4RotationMatrix B5EmCalorimeterHit::fRot
private

Definition at line 91 of file B5EmCalorimeterHit.hh.


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