ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ExGflashSensitiveDetector.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file ExGflashSensitiveDetector.cc
1 // ********************************************************************
2 // * License and Disclaimer *
3 // * *
4 // * The Geant4 software is copyright of the Copyright Holders of *
5 // * the Geant4 Collaboration. It is provided under the terms and *
6 // * conditions of the Geant4 Software License, included in the file *
7 // * LICENSE and available at http://cern.ch/geant4/license . These *
8 // * include a list of copyright holders. *
9 // * *
10 // * Neither the authors of this software system, nor their employing *
11 // * institutes,nor the agencies providing financial support for this *
12 // * work make any representation or warranty, express or implied, *
13 // * regarding this software system or assume any liability for its *
14 // * use. Please see the license in the file LICENSE and URL above *
15 // * for the full disclaimer and the limitation of liability. *
16 // * *
17 // * This code implementation is the result of the scientific and *
18 // * technical work of the GEANT4 collaboration. *
19 // * By using, copying, modifying or distributing the software (or *
20 // * any work based on the software) you agree to acknowledge its *
21 // * use in resulting scientific publications, and indicate your *
22 // * acceptance of all terms of the Geant4 Software license. *
23 // ********************************************************************
24 //
25 //
28 //
29 // Created by Joanna Weng 26.11.2004
31 #include "ExGflashHit.hh"
32 #include "G4GFlashSpot.hh"
34 #include "G4VPhysicalVolume.hh"
35 #include "G4Step.hh"
36 #include "G4VTouchable.hh"
37 #include "G4TouchableHistory.hh"
38 
39 //WARNING : You have to use also G4VGFlashSensitiveDetector() as base class
40 
41 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
42 
45  // : G4VSensitiveDetector(name), G4VGFlashSensitiveDetector(), fDetector(det), fHCID(-1)
47 {
48  G4String caloname="ExGflashCollection";
49  collectionName.insert(caloname);
50 }
51 
52 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
53 
55 {}
56 
57 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
58 
60 {
61  if(fHCID<0){ fHCID = GetCollectionID(0); }
65 }
66 
67 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
68 
70 {}
71 
72 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
73 
75 {
77  if(e<=0.)return false;
78 
79  ExGflashHit* caloHit=new ExGflashHit();
80  caloHit->SetEdep(e);
81  caloHit->SetPos(aStep->GetPreStepPoint()->GetPosition());
82  fCaloHitsCollection->insert(caloHit);
83 
84  return true;
85 }
86 
87 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
88 
89 // Separate GFLASH interface
91 { //cout<<"This is ProcessHits GFLASH"<<endl;
92  G4double e=aSpot->GetEnergySpot()->GetEnergy();
93  if(e<=0.)return false;
94 
95  // G4VPhysicalVolume* pCurrentVolume = aSpot->GetTouchableHandle()->GetVolume();
96 
97  ExGflashHit* caloHit=new ExGflashHit();
98  caloHit->SetEdep(e);
99  caloHit->SetPos(aSpot->GetEnergySpot()->GetPosition());
100  fCaloHitsCollection->insert(caloHit);
101  // if (ROhist){;}
102 
103  return true;
104 }
105 
106 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......