Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /geant4/examples/advanced/underground_physics/src/DMXPmtHit.cc was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 //
0027 // --------------------------------------------------------------
0028 //   GEANT 4 - Underground Dark Matter Detector Advanced Example
0029 //
0030 //      For information related to this code contact: Alex Howard
0031 //      e-mail: alexander.howard@cern.ch
0032 // --------------------------------------------------------------
0033 // Comments
0034 //
0035 //                  Underground Advanced
0036 //               by A. Howard and H. Araujo 
0037 //                    (27th November 2001)
0038 //
0039 // PmtHit (sensitive detector) program
0040 // --------------------------------------------------------------
0041 
0042 #include "DMXPmtHit.hh"
0043 
0044 #include "G4UnitsTable.hh"
0045 #include "G4VVisManager.hh"
0046 #include "G4Circle.hh"
0047 #include "G4Colour.hh"
0048 #include "G4VisAttributes.hh"
0049 
0050 #include <iomanip>
0051 
0052 G4ThreadLocal G4Allocator<DMXPmtHit> *DMXPmtHitsAllocator;
0053 
0054 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0055 
0056 DMXPmtHit::DMXPmtHit() {
0057   
0058   pos = G4ThreeVector(0., 0., 0.);
0059   time=0.;
0060 
0061 }
0062 
0063 
0064 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0065 
0066 DMXPmtHit::~DMXPmtHit() {;}
0067 
0068 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0069 
0070 DMXPmtHit::DMXPmtHit(const DMXPmtHit& right) : G4VHit(right) {
0071 
0072   pos  = right.pos;
0073   time = right.time;
0074 
0075 }
0076 
0077 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0078 
0079 const DMXPmtHit& DMXPmtHit::operator=(const DMXPmtHit& right) {
0080 
0081   pos  = right.pos;
0082   time = right.time;
0083 
0084   return *this;
0085 
0086 }
0087 
0088 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0089 
0090 G4bool DMXPmtHit::operator==(const DMXPmtHit& right) const {
0091 
0092   return (this==&right) ? true : false;
0093 
0094 }
0095 
0096 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0097 
0098 void DMXPmtHit::Draw()  {
0099 
0100   G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
0101 
0102   if(pVVisManager) {
0103     G4Circle circle(pos);
0104     circle.SetScreenSize(0.002);
0105     circle.SetFillStyle(G4Circle::filled);
0106     G4Colour colour(1.,1.,0.);
0107     G4VisAttributes attribs(colour);
0108     circle.SetVisAttributes(attribs);
0109     pVVisManager->Draw(circle);
0110   }
0111 
0112 
0113 }
0114 
0115 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0116 
0117 void DMXPmtHit::Print() {
0118 
0119   //  G4cout << "      PMT hit: " << G4BestUnit(pos,"Length") << G4endl;
0120 
0121   G4cout << "      PMT hit: " << std::setw(5) << G4BestUnit(time,"Time") 
0122      << ", at " << G4BestUnit(pos,"Length") << G4endl;
0123 
0124 
0125 }
0126 
0127 
0128