Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RE05CalorimeterHit.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 //
26 // $Id: RE05CalorimeterHit.cc 98775 2016-08-09 14:30:39Z gcosmo $
27 //
30 //
31 
32 #include "RE05CalorimeterHit.hh"
33 #include "G4ios.hh"
34 #include "G4VVisManager.hh"
35 #include "G4Colour.hh"
36 #include "G4VisAttributes.hh"
37 #include "G4LogicalVolume.hh"
38 #include "G4UIcommand.hh"
39 #include "G4UnitsTable.hh"
40 #include "G4AttValue.hh"
41 #include "G4AttDef.hh"
42 #include "G4AttCheck.hh"
43 
45 
46 std::map<G4String,G4AttDef> RE05CalorimeterHit::fAttDefs;
47 
48 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
49 
51 : G4VHit(),
52  fZCellID(-1),fPhiCellID(-1),fEdep(0.),fPos(),fRot(),fLogV(0)
53 {}
54 
55 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
56 
58 : G4VHit(),
59  fZCellID(z), fPhiCellID(phi),fEdep(0.),fPos(),fRot(),fLogV(logVol)
60 {}
61 
62 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
63 
65 {}
66 
67 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
68 
70  : G4VHit()
71 {
72  fZCellID = right.fZCellID;
73  fPhiCellID = right.fPhiCellID;
74  fEdep = right.fEdep;
75  fPos = right.fPos;
76  fRot = right.fRot;
77  fLogV = right.fLogV;
78 }
79 
80 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
81 
83 {
84  fZCellID = right.fZCellID;
85  fPhiCellID = right.fPhiCellID;
86  fEdep = right.fEdep;
87  fPos = right.fPos;
88  fRot = right.fRot;
89  fLogV = right.fLogV;
90  return *this;
91 }
92 
93 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
94 
96 {
97  return ((fZCellID==right.fZCellID)&&(fPhiCellID==right.fPhiCellID));
98 }
99 
100 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
101 
103 {
105  if(pVVisManager)
106  {
107  G4Transform3D trans(fRot,fPos);
108  G4VisAttributes attribs;
109  const G4VisAttributes* pVA = fLogV->GetVisAttributes();
110  if(pVA) attribs = *pVA;
111  G4Colour colour(1.,0.,0.);
112  attribs.SetColour(colour);
113  attribs.SetForceSolid(true);
114  pVVisManager->Draw(*fLogV,attribs,trans);
115  }
116 }
117 
118 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
119 
120 const std::map<G4String,G4AttDef>* RE05CalorimeterHit::GetAttDefs() const
121 {
122  // G4AttDefs have to have long life. Use static member...
123  if (fAttDefs.empty()) {
124  fAttDefs["HitType"] =
125  G4AttDef("HitType","Type of hit","Physics","","G4String");
126  fAttDefs["ZID"] = G4AttDef("ZID","Z Cell ID","Physics","","G4int");
127  fAttDefs["PhiID"] = G4AttDef("PhiID","Phi Cell ID","Physics","","G4int");
128  fAttDefs["EDep"] =
129  G4AttDef("EDep","Energy defPosited","Physics","G4BestUnit","G4double");
130  }
131  return &fAttDefs;
132 }
133 
134 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
135 
136 std::vector<G4AttValue>* RE05CalorimeterHit::CreateAttValues() const
137 {
138  // Create expendable G4AttsValues for picking...
139  std::vector<G4AttValue>* attValues = new std::vector<G4AttValue>;
140  attValues->push_back
141  (G4AttValue("HitType","RE05CalorimeterHit",""));
142  attValues->push_back
143  (G4AttValue("ZID",G4UIcommand::ConvertToString(fZCellID),""));
144  attValues->push_back
145  (G4AttValue("PhiID",G4UIcommand::ConvertToString(fPhiCellID),""));
146  attValues->push_back
147  (G4AttValue("EDep",G4BestUnit(fEdep,"Energy"),""));
148  //G4cout << "Checking...\n" << G4AttCheck(attValues, GetAttDefs());
149  return attValues;
150 }
151 
152 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
153 
155 {}
156 
157 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
158 
virtual void Draw(const G4Circle &, const G4Transform3D &objectTransformation=G4Transform3D())=0
void SetColour(const G4Colour &)
Definition of the RE05CalorimeterHit class.
static G4VVisManager * GetConcreteInstance()
G4ThreadLocal G4Allocator< RE05CalorimeterHit > * RE05CalorimeterHitAllocator
static G4String ConvertToString(G4bool boolVal)
Definition: G4UIcommand.cc:372
Definition: G4VHit.hh:48
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
#define G4ThreadLocal
Definition: tls.hh:89
int G4int
Definition: G4Types.hh:78
void SetForceSolid(G4bool=true)
G4int operator==(const RE05CalorimeterHit &right) const
const G4VisAttributes * GetVisAttributes() const
virtual std::vector< G4AttValue > * CreateAttValues() const
tuple z
Definition: test.py:28
virtual const std::map< G4String, G4AttDef > * GetAttDefs() const
const RE05CalorimeterHit & operator=(const RE05CalorimeterHit &right)