Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-31 09:21:58

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 /// \file electromagnetic/TestEm11/include/doiPETRun.hh
0027 /// \brief Definition of the doiPETRun class
0028 //
0029 // $Id: doiPETRun.hh 71375 2013-06-14 07:39:33Z maire $
0030 //
0031 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0032 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0033 
0034 #ifndef doiPETRun_h
0035 #define doiPETRun_h 1
0036 
0037 #include "G4Run.hh"
0038 #include "G4VProcess.hh"
0039 #include "globals.hh"
0040 
0041 #include <iostream>
0042 #include <fstream>
0043 #include <sstream>
0044 #include <map>
0045 #include <set>
0046 class doiPETDetectorConstruction;
0047 class G4ParticleDefinition;
0048 class doiPETRunAction;
0049 
0050 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0051 class InteractionInformation; 
0052 class doiPETAnalysis;
0053 class doiPETRun : public G4Run
0054 {
0055 public:
0056     doiPETRun(/*doiPETDetectorConstruction**/);
0057     ~doiPETRun();
0058 
0059 public:
0060     //
0061     void GetIntractionInfomation(InteractionInformation*);
0062     void FindInteractingCrystal();
0063     void Clear();
0064     void OpenRun(G4String);
0065     void GetEventIDRun(G4int);
0066     void CalulateAcquisitionTime();
0067     void SetAnnihilationTime(G4double);
0068     void SetEventID(G4int);
0069     virtual void Merge(const G4Run*);
0070     G4ThreeVector CenterOfMassInteractionPos(const std::vector<G4int>&, const std::vector<G4double>&, G4double, const std::vector<G4ThreeVector>&);
0071     //void EndOfRun();     
0072 
0073 private:
0074 
0075     std::multimap< G4int, InteractionInformation* > mapBlockInteraction;
0076     std::set<G4int> setBlockInteraction;
0077     std::ofstream ofs;
0078 
0079     std::vector<G4int> crystalID_vec;
0080     std::vector<G4ThreeVector> posInter_vec;
0081     std::vector<G4double>edepInCry_vec;
0082 
0083     //center of mass interaction of position
0084     G4ThreeVector posInterInCrystal;
0085 
0086     G4int eventID;
0087     doiPETRunAction* fRunAction;
0088     doiPETAnalysis* fAnalysis;
0089     G4double totalEdep;
0090     G4int blockID, crystalID;
0091 
0092     G4double totalTime;
0093     G4double prev_totalTime;
0094     G4double timeInterval;
0095 
0096     G4ThreeVector interactionPos;
0097     //
0098     G4double interactionTime;
0099     G4double timeOfAnnihil;
0100 
0101     G4int numberofInteractions;
0102     G4double edep;
0103     G4double edepMax;
0104     G4double edep_AfterCrystalBlurring;
0105 
0106 };
0107 
0108 
0109 //The following is to get interaction information
0110 class InteractionInformation
0111 {
0112 
0113 public:
0114     InteractionInformation(){;};
0115     ~InteractionInformation(){;};
0116 
0117     //set energy deposition
0118     void SetEdep(G4double e) {edep=e;};
0119 
0120     //set block number
0121     void SetBlockNo(G4int n) {blockNo=n;};
0122 
0123     //set crystal ID (this is continuous numbering of crystals)
0124     void SetCrystalNo(G4int n) {crystalNo=n;};
0125 
0126     //set global time
0127     void SetGlobalTime(G4double t){globalTime=t;};
0128 
0129     //set interaction position with respect to the crystal axis (local position)
0130     void SetInteractionPositionInCrystal(G4ThreeVector pos){crystalPosition = pos;};
0131 
0132 
0133     G4double GetEdep() {return edep;};
0134     G4int GetBlockNo() {return blockNo;};
0135     G4int GetCrystalNo() {return crystalNo;};
0136     G4double GetGlobalTime() {return globalTime;};
0137 
0138     //Interaction position in the detector
0139     G4ThreeVector GetInteractionPositionInCrystal(){return crystalPosition;};
0140 
0141 
0142 private:
0143     G4double edep;
0144     G4double globalTime;
0145     G4int blockNo;
0146     G4int crystalNo;
0147     G4ThreeVector crystalPosition;
0148 
0149 };
0150 
0151 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0152 
0153 #endif
0154