Geant4  10.01.p02
RE01CalorimeterHit.cc
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
28 //
29 //
30 // $Id: RE01CalorimeterHit.cc 75295 2013-10-30 09:32:52Z gcosmo $
31 //
32 
33 #include "RE01CalorimeterHit.hh"
34 #include "G4ios.hh"
35 #include "G4VVisManager.hh"
36 #include "G4Colour.hh"
37 #include "G4AttDefStore.hh"
38 #include "G4AttDef.hh"
39 #include "G4AttValue.hh"
40 #include "G4UIcommand.hh"
41 #include "G4UnitsTable.hh"
42 #include "G4VisAttributes.hh"
43 #include "G4LogicalVolume.hh"
44 #include "G4SystemOfUnits.hh"
45 
47 
48 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
50  G4int z, G4int phi)
51  :G4VHit(), fZCellID(z), fPhiCellID(phi), fEdep(0.0),
52  fPos(0),fRot(0.,0.,0.),fPLogV(logVol),fEdepByATrack(0.0),fTrackInfo()
53 {;}
54 
55 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
57 {;}
58 
59 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
61 {
63  if(pVVisManager)
64  {
65  G4Transform3D trans(fRot,fPos);
66  G4VisAttributes attribs;
67  const G4VisAttributes* pVA = fPLogV->GetVisAttributes();
68  if(pVA) attribs = *pVA;
69  G4Colour colour(1.,0.,0.);
70  attribs.SetColour(colour);
71  attribs.SetForceWireframe(false);
72  attribs.SetForceSolid(true);
73  pVVisManager->Draw(*fPLogV,attribs,trans);
74  }
75 }
76 
77 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
78 const std::map<G4String,G4AttDef>* RE01CalorimeterHit::GetAttDefs() const
79 {
80  G4bool isNew;
81  std::map<G4String,G4AttDef>* store
82  = G4AttDefStore::GetInstance("RE01CalorimeterHit",isNew);
83  if (isNew) {
84  G4String hitType("HitType");
85  (*store)[hitType] = G4AttDef(hitType,"Hit Type","Physics","","G4String");
86 
87  G4String zCellID("ZCellID");
88  (*store)[zCellID] = G4AttDef(zCellID,"Z Cell ID","Physics","","G4int");
89 
90  G4String phiCellID("PhiCellID");
91  (*store)[phiCellID] = G4AttDef(phiCellID,"Phi Cell ID","Physics","","G4int");
92 
93  G4String energy("Energy");
94  (*store)[energy] = G4AttDef(energy,"Energy Deposited","Physics","G4BestUnit",
95  "G4double");
96 
97  G4String eTrack("ETrack");
98  (*store)[eTrack] = G4AttDef(eTrack,"Energy Deposited By Track","Physics",
99  "G4BestUnit","G4double");
100 
101  G4String pos("Pos");
102  (*store)[pos] = G4AttDef(pos, "Position",
103  "Physics","G4BestUnit","G4ThreeVector");
104 
105  G4String lvol("LVol");
106  (*store)[lvol] = G4AttDef(lvol,"Logical Volume","Physics","","G4String");
107  }
108 
109  return store;
110 }
111 
112 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
113 std::vector<G4AttValue>* RE01CalorimeterHit::CreateAttValues() const
114 {
115  std::vector<G4AttValue>* values = new std::vector<G4AttValue>;
116 
117  values->push_back(G4AttValue("HitType","RE01CalorimeterHit",""));
118 
119  values->push_back
121 
122  values->push_back
124 
125  values->push_back
126  (G4AttValue("Energy",G4BestUnit(fEdep,"Energy"),""));
127 
128  values->push_back
129  (G4AttValue("ETrack",G4BestUnit(fEdepByATrack,"Energy"),""));
130 
131  values->push_back
132  (G4AttValue("Pos",G4BestUnit(fPos,"Length"),""));
133 
134  if (fPLogV)
135  values->push_back
136  (G4AttValue("LVol",fPLogV->GetName(),""));
137  else
138  values->push_back
139  (G4AttValue("LVol"," ",""));
140 
141  return values;
142 }
143 
144 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
146 {
147  G4cout << "Cell[" << fZCellID << "," << fPhiCellID << "] "
148  << fEdep/GeV << " [GeV]" << G4endl;
149 }
150 
151 
virtual void Draw(const G4Circle &, const G4Transform3D &objectTransformation=G4Transform3D())=0
void SetColour(const G4Colour &)
Definition of the RE01CalorimeterHit class.
void SetForceWireframe(G4bool)
G4String GetName() const
G4ThreadLocal G4Allocator< RE01CalorimeterHit > * RE01CalorimeterHitAllocator
static G4VVisManager * GetConcreteInstance()
G4double z
Definition: TRTMaterials.hh:39
static G4String ConvertToString(G4bool boolVal)
Definition: G4UIcommand.cc:371
Definition: G4VHit.hh:48
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
void SetForceSolid(G4bool)
#define G4ThreadLocal
Definition: tls.hh:89
G4RotationMatrix fRot
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
bool G4bool
Definition: G4Types.hh:79
const G4VisAttributes * GetVisAttributes() const
HepGeom::Transform3D G4Transform3D
static const double GeV
Definition: G4SIunits.hh:196
RE01CalorimeterHit(G4LogicalVolume *logVol, G4int z, G4int phi)
virtual const std::map< G4String, G4AttDef > * GetAttDefs() const
G4double energy(const ThreeVector &p, const G4double m)
const G4LogicalVolume * fPLogV
#define G4endl
Definition: G4ios.hh:61
std::map< G4String, G4AttDef > * GetInstance(const G4String &storeKey, G4bool &isNew)
virtual std::vector< G4AttValue > * CreateAttValues() const
static const G4double pos