Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:16:57

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 
0029 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0030 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0031 
0032 #include <iostream>
0033 
0034 
0035 #include "FCALEMModuleSD.hh"
0036 
0037 #include "FCALCalorHit.hh"
0038 
0039 #include "FCALTestbeamSetup.hh"
0040 #include "FCALEMModule.hh"
0041 #include "FCALSteppingAction.hh"
0042 
0043 #include "G4SystemOfUnits.hh"
0044 #include "G4VPhysicalVolume.hh"
0045 #include "G4Step.hh"
0046 #include "G4Track.hh"
0047 #include "G4VTouchable.hh"
0048 #include "G4TouchableHistory.hh"
0049 #include "G4SDManager.hh"
0050 
0051 #include "G4ios.hh"
0052 
0053 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0054 
0055 FCALEMModuleSD::FCALEMModuleSD(G4String name) : G4VSensitiveDetector(name),
0056                         Init_state(0)
0057 {
0058   EmModule = new FCALEMModule();
0059 }
0060 
0061 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0062 
0063 FCALEMModuleSD::~FCALEMModuleSD()
0064 {
0065   delete EmModule;
0066 }
0067 
0068 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0069 
0070 void FCALEMModuleSD::Initialize(G4HCofThisEvent*)
0071 {
0072   if (Init_state==0) 
0073     {
0074       EmModule->InitializeGeometry();
0075       Init_state++;
0076     };
0077 
0078   for (G4int j=0 ; j<1131 ; j++) {EvisF1Tile[j] = 0.;}    
0079 }
0080 
0081 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0082 
0083 G4bool FCALEMModuleSD::ProcessHits(G4Step* aStep,G4TouchableHistory*)
0084 {
0085   
0086   G4double edep = aStep->GetTotalEnergyDeposit();
0087   if (edep==0.) return false;
0088 
0089   G4TouchableHistory* theTouchable
0090     = (G4TouchableHistory*)(aStep->GetPreStepPoint()->GetTouchable());  
0091   G4VPhysicalVolume* physVol = theTouchable->GetVolume();
0092 
0093 
0094   if(strcmp(physVol->GetName(),"F1LArGapPhysical")==0){
0095     G4int F1LArGapId = physVol->GetCopyNo();
0096     G4int F1TileId = EmModule->GetF1TileID(F1LArGapId);
0097     EvisF1Tile[F1TileId] = EvisF1Tile[F1TileId] + edep;
0098   };
0099 
0100   return true;
0101 }
0102 
0103 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0104 
0105 void FCALEMModuleSD::EndOfEvent(G4HCofThisEvent*)
0106 {
0107   G4int NF1Tile = 0;
0108   G4int i=0;
0109   for (i=1; i <= 1130; i++){
0110     if(EvisF1Tile[i] > 0.) {
0111       NF1Tile++;
0112     }
0113   }
0114 
0115   G4cout << "Number of F1 Tiles with Positive energy : " << NF1Tile <<  G4endl;
0116 
0117 
0118 }
0119   
0120 
0121 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0122 
0123 void FCALEMModuleSD::clear()
0124 {} 
0125 
0126 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0127 
0128 void FCALEMModuleSD::DrawAll()
0129 {} 
0130 
0131 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0132 
0133 void FCALEMModuleSD::PrintAll()
0134 {} 
0135 
0136 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0137