ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RE01CalorimeterHit.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file RE01CalorimeterHit.cc
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 //
31 
32 #include "RE01CalorimeterHit.hh"
33 #include "G4ios.hh"
34 #include "G4VVisManager.hh"
35 #include "G4Colour.hh"
36 #include "G4AttDefStore.hh"
37 #include "G4AttDef.hh"
38 #include "G4AttValue.hh"
39 #include "G4UIcommand.hh"
40 #include "G4UnitsTable.hh"
41 #include "G4VisAttributes.hh"
42 #include "G4LogicalVolume.hh"
43 #include "G4SystemOfUnits.hh"
44 
46 
47 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
49  G4int z, G4int phi)
50  :G4VHit(), fZCellID(z), fPhiCellID(phi), fEdep(0.0),
51  fPos(0),fRot(0.,0.,0.),fPLogV(logVol),fEdepByATrack(0.0),fTrackInfo()
52 {;}
53 
54 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
56 {;}
57 
58 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
60 {
62  if(pVVisManager)
63  {
64  G4Transform3D trans(fRot,fPos);
65  G4VisAttributes attribs;
66  const G4VisAttributes* pVA = fPLogV->GetVisAttributes();
67  if(pVA) attribs = *pVA;
68  G4Colour colour(1.,0.,0.);
69  attribs.SetColour(colour);
70  attribs.SetForceWireframe(false);
71  attribs.SetForceSolid(true);
72  pVVisManager->Draw(*fPLogV,attribs,trans);
73  }
74 }
75 
76 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
77 const std::map<G4String,G4AttDef>* RE01CalorimeterHit::GetAttDefs() const
78 {
79  G4bool isNew;
80  std::map<G4String,G4AttDef>* store
81  = G4AttDefStore::GetInstance("RE01CalorimeterHit",isNew);
82  if (isNew) {
83  G4String hitType("HitType");
84  (*store)[hitType] = G4AttDef(hitType,"Hit Type","Physics","","G4String");
85 
86  G4String zCellID("ZCellID");
87  (*store)[zCellID] = G4AttDef(zCellID,"Z Cell ID","Physics","","G4int");
88 
89  G4String phiCellID("PhiCellID");
90  (*store)[phiCellID] = G4AttDef(phiCellID,"Phi Cell ID","Physics","","G4int");
91 
92  G4String energy("Energy");
93  (*store)[energy] = G4AttDef(energy,"Energy Deposited","Physics","G4BestUnit",
94  "G4double");
95 
96  G4String eTrack("ETrack");
97  (*store)[eTrack] = G4AttDef(eTrack,"Energy Deposited By Track","Physics",
98  "G4BestUnit","G4double");
99 
100  G4String pos("Pos");
101  (*store)[pos] = G4AttDef(pos, "Position",
102  "Physics","G4BestUnit","G4ThreeVector");
103 
104  G4String lvol("LVol");
105  (*store)[lvol] = G4AttDef(lvol,"Logical Volume","Physics","","G4String");
106  }
107 
108  return store;
109 }
110 
111 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
112 std::vector<G4AttValue>* RE01CalorimeterHit::CreateAttValues() const
113 {
114  std::vector<G4AttValue>* values = new std::vector<G4AttValue>;
115 
116  values->push_back(G4AttValue("HitType","RE01CalorimeterHit",""));
117 
118  values->push_back
120 
121  values->push_back
123 
124  values->push_back
125  (G4AttValue("Energy",G4BestUnit(fEdep,"Energy"),""));
126 
127  values->push_back
128  (G4AttValue("ETrack",G4BestUnit(fEdepByATrack,"Energy"),""));
129 
130  values->push_back
131  (G4AttValue("Pos",G4BestUnit(fPos,"Length"),""));
132 
133  if (fPLogV)
134  values->push_back
135  (G4AttValue("LVol",fPLogV->GetName(),""));
136  else
137  values->push_back
138  (G4AttValue("LVol"," ",""));
139 
140  return values;
141 }
142 
143 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
145 {
146  G4cout << "Cell[" << fZCellID << "," << fPhiCellID << "] "
147  << fEdep/GeV << " [GeV]" << G4endl;
148 }
149 
150