| [807] | 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: A01HodoscopeHit.cc,v 1.11 2006/11/14 07:11:19 perl Exp $
|
|---|
| 27 | // --------------------------------------------------------------
|
|---|
| 28 | //
|
|---|
| 29 | #include "A01HodoscopeHit.hh"
|
|---|
| 30 | #include "G4VVisManager.hh"
|
|---|
| 31 | #include "G4Circle.hh"
|
|---|
| 32 | #include "G4Colour.hh"
|
|---|
| 33 | #include "G4AttDefStore.hh"
|
|---|
| 34 | #include "G4AttDef.hh"
|
|---|
| 35 | #include "G4AttValue.hh"
|
|---|
| 36 | #include "G4UIcommand.hh"
|
|---|
| 37 | #include "G4UnitsTable.hh"
|
|---|
| 38 | #include "G4VisAttributes.hh"
|
|---|
| 39 | #include "G4ios.hh"
|
|---|
| 40 |
|
|---|
| 41 | G4Allocator<A01HodoscopeHit> A01HodoscopeHitAllocator;
|
|---|
| 42 |
|
|---|
| 43 | A01HodoscopeHit::A01HodoscopeHit(G4int i,G4double t)
|
|---|
| 44 | {
|
|---|
| 45 | id = i;
|
|---|
| 46 | time = t;
|
|---|
| 47 | pLogV = 0;
|
|---|
| 48 | }
|
|---|
| 49 |
|
|---|
| 50 | A01HodoscopeHit::~A01HodoscopeHit()
|
|---|
| 51 | {;}
|
|---|
| 52 |
|
|---|
| 53 | A01HodoscopeHit::A01HodoscopeHit(const A01HodoscopeHit &right)
|
|---|
| 54 | : G4VHit() {
|
|---|
| 55 | id = right.id;
|
|---|
| 56 | time = right.time;
|
|---|
| 57 | pos = right.pos;
|
|---|
| 58 | rot = right.rot;
|
|---|
| 59 | pLogV = right.pLogV;
|
|---|
| 60 | }
|
|---|
| 61 |
|
|---|
| 62 | const A01HodoscopeHit& A01HodoscopeHit::operator=(const A01HodoscopeHit &right)
|
|---|
| 63 | {
|
|---|
| 64 | id = right.id;
|
|---|
| 65 | time = right.time;
|
|---|
| 66 | pos = right.pos;
|
|---|
| 67 | rot = right.rot;
|
|---|
| 68 | pLogV = right.pLogV;
|
|---|
| 69 | return *this;
|
|---|
| 70 | }
|
|---|
| 71 |
|
|---|
| 72 | int A01HodoscopeHit::operator==(const A01HodoscopeHit &/*right*/) const
|
|---|
| 73 | {
|
|---|
| 74 | return 0;
|
|---|
| 75 | }
|
|---|
| 76 |
|
|---|
| 77 | void A01HodoscopeHit::Draw()
|
|---|
| 78 | {
|
|---|
| 79 | G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
|
|---|
| 80 | if(pVVisManager)
|
|---|
| 81 | {
|
|---|
| 82 | G4Transform3D trans(rot.inverse(),pos);
|
|---|
| 83 | G4VisAttributes attribs;
|
|---|
| 84 | const G4VisAttributes* pVA = pLogV->GetVisAttributes();
|
|---|
| 85 | if(pVA) attribs = *pVA;
|
|---|
| 86 | G4Colour colour(0.,1.,1.);
|
|---|
| 87 | attribs.SetColour(colour);
|
|---|
| 88 | attribs.SetForceSolid(true);
|
|---|
| 89 | pVVisManager->Draw(*pLogV,attribs,trans);
|
|---|
| 90 | }
|
|---|
| 91 | }
|
|---|
| 92 |
|
|---|
| 93 | const std::map<G4String,G4AttDef>* A01HodoscopeHit::GetAttDefs() const
|
|---|
| 94 | {
|
|---|
| 95 | G4bool isNew;
|
|---|
| 96 | std::map<G4String,G4AttDef>* store
|
|---|
| 97 | = G4AttDefStore::GetInstance("A01HodoscopeHit",isNew);
|
|---|
| 98 | if (isNew) {
|
|---|
| 99 | G4String HitType("HitType");
|
|---|
| 100 | (*store)[HitType] = G4AttDef(HitType,"Hit Type","Physics","","G4String");
|
|---|
| 101 |
|
|---|
| 102 | G4String ID("ID");
|
|---|
| 103 | (*store)[ID] = G4AttDef(ID,"ID","Physics","","G4int");
|
|---|
| 104 |
|
|---|
| 105 | G4String Time("Time");
|
|---|
| 106 | (*store)[Time] = G4AttDef(Time,"Time","Physics","G4BestUnit","G4double");
|
|---|
| 107 |
|
|---|
| 108 | G4String Pos("Pos");
|
|---|
| 109 | (*store)[Pos] = G4AttDef(Pos, "Position",
|
|---|
| 110 | "Physics","G4BestUnit","G4ThreeVector");
|
|---|
| 111 |
|
|---|
| 112 | G4String LVol("LVol");
|
|---|
| 113 | (*store)[LVol] = G4AttDef(LVol,"Logical Volume","Physics","","G4String");
|
|---|
| 114 | }
|
|---|
| 115 | return store;
|
|---|
| 116 | }
|
|---|
| 117 |
|
|---|
| 118 | std::vector<G4AttValue>* A01HodoscopeHit::CreateAttValues() const
|
|---|
| 119 | {
|
|---|
| 120 | std::vector<G4AttValue>* values = new std::vector<G4AttValue>;
|
|---|
| 121 |
|
|---|
| 122 | values->push_back(G4AttValue("HitType","HodoscopeHit",""));
|
|---|
| 123 |
|
|---|
| 124 | values->push_back
|
|---|
| 125 | (G4AttValue("ID",G4UIcommand::ConvertToString(id),""));
|
|---|
| 126 |
|
|---|
| 127 | values->push_back
|
|---|
| 128 | (G4AttValue("Time",G4BestUnit(time,"Time"),""));
|
|---|
| 129 |
|
|---|
| 130 | values->push_back
|
|---|
| 131 | (G4AttValue("Pos",G4BestUnit(pos,"Length"),""));
|
|---|
| 132 |
|
|---|
| 133 | if (pLogV)
|
|---|
| 134 | values->push_back
|
|---|
| 135 | (G4AttValue("LVol",pLogV->GetName(),""));
|
|---|
| 136 | else
|
|---|
| 137 | values->push_back
|
|---|
| 138 | (G4AttValue("LVol"," ",""));
|
|---|
| 139 |
|
|---|
| 140 | return values;
|
|---|
| 141 | }
|
|---|
| 142 |
|
|---|
| 143 | void A01HodoscopeHit::Print()
|
|---|
| 144 | {
|
|---|
| 145 | G4cout << " Hodoscope[" << id << "] " << time/ns << " (nsec)" << G4endl;
|
|---|
| 146 | }
|
|---|
| 147 |
|
|---|
| 148 |
|
|---|
| 149 |
|
|---|