Geant4  10.00.p02
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 69764 2013-05-14 09:59:36Z 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 
47 {pLogV=0;}
48 
50 : ZCellID(z), PhiCellID(phi), pLogV(logVol)
51 {;}
52 
54 {;}
55 
57  : G4VHit()
58 {
59  ZCellID = right.ZCellID;
60  PhiCellID = right.PhiCellID;
61  edep = right.edep;
62  pos = right.pos;
63  rot = right.rot;
64  pLogV = right.pLogV;
65 }
66 
68 {
69  ZCellID = right.ZCellID;
70  PhiCellID = right.PhiCellID;
71  edep = right.edep;
72  pos = right.pos;
73  rot = right.rot;
74  pLogV = right.pLogV;
75  return *this;
76 }
77 
79 {
80  return ((ZCellID==right.ZCellID)&&(PhiCellID==right.PhiCellID));
81 }
82 
83 std::map<G4String,G4AttDef> RE05CalorimeterHit::fAttDefs;
84 
86 {
88  if(pVVisManager)
89  {
90  G4Transform3D trans(rot,pos);
91  G4VisAttributes attribs;
92  const G4VisAttributes* pVA = pLogV->GetVisAttributes();
93  if(pVA) attribs = *pVA;
94  G4Colour colour(1.,0.,0.);
95  attribs.SetColour(colour);
96  attribs.SetForceSolid(true);
97  pVVisManager->Draw(*pLogV,attribs,trans);
98  }
99 }
100 
101 const std::map<G4String,G4AttDef>* RE05CalorimeterHit::GetAttDefs() const
102 {
103  // G4AttDefs have to have long life. Use static member...
104  if (fAttDefs.empty()) {
105  fAttDefs["HitType"] =
106  G4AttDef("HitType","Type of hit","Physics","","G4String");
107  fAttDefs["ZID"] = G4AttDef("ZID","Z Cell ID","Physics","","G4int");
108  fAttDefs["PhiID"] = G4AttDef("PhiID","Phi Cell ID","Physics","","G4int");
109  fAttDefs["EDep"] =
110  G4AttDef("EDep","Energy deposited","Physics","G4BestUnit","G4double");
111  }
112  return &fAttDefs;
113 }
114 
115 std::vector<G4AttValue>* RE05CalorimeterHit::CreateAttValues() const
116 {
117  // Create expendable G4AttsValues for picking...
118  std::vector<G4AttValue>* attValues = new std::vector<G4AttValue>;
119  attValues->push_back
120  (G4AttValue("HitType","RE05CalorimeterHit",""));
121  attValues->push_back
123  attValues->push_back
125  attValues->push_back
126  (G4AttValue("EDep",G4BestUnit(edep,"Energy"),""));
127  //G4cout << "Checking...\n" << G4AttCheck(attValues, GetAttDefs());
128  return attValues;
129 }
130 
132 {;}
133 
134 
virtual void Draw(const G4Circle &, const G4Transform3D &objectTransformation=G4Transform3D())=0
void SetColour(const G4Colour &)
Definition of the RE05CalorimeterHit class.
G4ThreadLocal G4Allocator< RE05CalorimeterHit > * RE05CalorimeterHitAllocator
static G4VVisManager * GetConcreteInstance()
G4double z
Definition: TRTMaterials.hh:39
static G4String ConvertToString(G4bool boolVal)
Definition: G4UIcommand.cc:357
Definition: G4VHit.hh:48
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
void SetForceSolid(G4bool)
#define G4ThreadLocal
Definition: tls.hh:52
int G4int
Definition: G4Types.hh:78
const G4LogicalVolume * pLogV
G4int operator==(const RE05CalorimeterHit &right) const
const G4VisAttributes * GetVisAttributes() const
HepGeom::Transform3D G4Transform3D
static std::map< G4String, G4AttDef > fAttDefs
virtual std::vector< G4AttValue > * CreateAttValues() const
G4RotationMatrix rot
virtual const std::map< G4String, G4AttDef > * GetAttDefs() const
const RE05CalorimeterHit & operator=(const RE05CalorimeterHit &right)