Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /geant4/examples/advanced/underground_physics/src/DMXPmtSD.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 // PmtSD (sensitive PMT) program
0040 // --------------------------------------------------------------
0041 
0042 #include "DMXPmtSD.hh"
0043 
0044 #include "DMXDetectorConstruction.hh"
0045 
0046 #include "G4VPhysicalVolume.hh"
0047 #include "G4Step.hh"
0048 #include "G4VTouchable.hh"
0049 #include "G4TouchableHistory.hh"
0050 #include "G4SDManager.hh"
0051 #include "G4UImanager.hh"
0052 #include "G4ios.hh"
0053 
0054 
0055 DMXPmtSD::DMXPmtSD(G4String name) 
0056   :G4VSensitiveDetector(name) {
0057 
0058   G4String HCname="pmtCollection";
0059   collectionName.insert(HCname);
0060 }
0061 
0062 
0063 DMXPmtSD::~DMXPmtSD() {;}
0064 
0065 
0066 ////////////////////////////////////////////////////////////////////////////
0067 void DMXPmtSD::Initialize(G4HCofThisEvent*) {
0068 
0069   pmtCollection = new DMXPmtHitsCollection
0070     (SensitiveDetectorName,collectionName[0]); 
0071 
0072   HitID = -1;
0073 
0074 
0075 }
0076 
0077 
0078 
0079 ////////////////////////////////////////////////////////////////////////////
0080 G4bool DMXPmtSD::ProcessHits
0081   (G4Step* aStep, G4TouchableHistory*){
0082 
0083   // make known hit position
0084   DMXPmtHit* aPmtHit = new DMXPmtHit();
0085   aPmtHit->SetPos(aStep->GetPostStepPoint()->GetPosition());
0086   aPmtHit->SetTime(aStep->GetPostStepPoint()->GetGlobalTime());
0087   HitID = pmtCollection->insert(aPmtHit);
0088 
0089   return true;
0090  
0091 }
0092 
0093 
0094 
0095 ////////////////////////////////////////////////////////////////////////////
0096 void DMXPmtSD::EndOfEvent(G4HCofThisEvent* HCE) {
0097 
0098   G4String HCname = collectionName[0];
0099 
0100   static G4int HCID = -1;
0101   if(HCID<0)
0102     HCID = G4SDManager::GetSDMpointer()->GetCollectionID(HCname);
0103   HCE->AddHitsCollection(HCID,pmtCollection);
0104   
0105   G4int nHits = pmtCollection->entries();
0106   if (verboseLevel>=1) {
0107     G4cout << "     PMT collection: " << nHits << " hits" << G4endl;
0108     if (verboseLevel>=2)
0109       pmtCollection->PrintAllHits();
0110   }
0111 
0112 
0113 }
0114 
0115 
0116 ////////////////////////////////////////////////////////////////////////////
0117 void DMXPmtSD::clear()    {;}
0118 
0119 
0120 void DMXPmtSD::DrawAll()  {;}
0121 
0122 
0123 void DMXPmtSD::PrintAll() {;}
0124 
0125 
0126 
0127