Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-17 07:51:43

0001 // ********************************************************************
0002 // * License and Disclaimer                                           *
0003 // *                                                                  *
0004 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0005 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0006 // * conditions of the Geant4 Software License,  included in the file *
0007 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0008 // * include a list of copyright holders.                             *
0009 // *                                                                  *
0010 // * Neither the authors of this software system, nor their employing *
0011 // * institutes,nor the agencies providing financial support for this *
0012 // * work  make  any representation or  warranty, express or implied, *
0013 // * regarding  this  software system or assume any liability for its *
0014 // * use.  Please see the license in the file  LICENSE  and URL above *
0015 // * for the full disclaimer and the limitation of liability.         *
0016 // *                                                                  *
0017 // * This  code  implementation is the result of  the  scientific and *
0018 // * technical work of the GEANT4 collaboration.                      *
0019 // * By using,  copying,  modifying or  distributing the software (or *
0020 // * any work based  on the software)  you  agree  to acknowledge its *
0021 // * use  in  resulting  scientific  publications,  and indicate your *
0022 // * acceptance of all terms of the Geant4 Software license.          *
0023 // ********************************************************************
0024 //
0025 /// \file MicroElecHitSey.cc
0026 /// \brief Implementation of the MicroElecHitSey class
0027 //
0028 //-
0029 
0030 #ifndef __MICROELECHITSEY_H__
0031 #define __MICROELECHITSEY_H__ 1
0032 
0033 #include "G4VHit.hh"
0034 #include "G4THitsCollection.hh"
0035 #include "G4Allocator.hh"
0036 #include "G4ThreeVector.hh"
0037 
0038 class MicroElecHitSey : public G4VHit
0039 {
0040     
0041     public:
0042 
0043         MicroElecHitSey();
0044         ~MicroElecHitSey();
0045 
0046         MicroElecHitSey(const MicroElecHitSey&);
0047 
0048         const MicroElecHitSey& operator=(const MicroElecHitSey&);
0049         int operator==(const MicroElecHitSey&) const;
0050 
0051         inline void* operator new(size_t);
0052         inline void  operator delete(void*);
0053 
0054         void Print();
0055 
0056     public:
0057 
0058         void SetNbPrim          (G4int nbprim)      { NbPrim=nbprim;                };
0059         void SetNbSec           (G4int nbsec)       { NbSec = nbsec;                };
0060         void SetNbSup50         (G4int nbsup50)     { NbSup50 = nbsup50;            };
0061         void SetPDGEncoding     (G4int pdgencoding) { PDGEncoding = pdgencoding;    };
0062         void SetParentID        (G4int parent)      { ParentID = parent;            };
0063         void SetTrackID         (G4int track)       { trackID = track;              };
0064         void SetParticleType    (G4String nameT)    { ParticleType = nameT;         };
0065         void SetParticleName    (G4String name)     { ParticleName = name;          };
0066         void SetVolumeName      (G4String nameV)    { VolumeName = nameV;           };
0067         void SetZ               (G4int z)           { Z = z;                        };
0068         void SetA               (G4int a)           { A = a;                        };
0069         void SetVertexKineticEnergy (G4double VQ)   { VertexKineticEnergy = VQ;     };
0070         void SetVertexPos(G4ThreeVector xyz)        { VertexPos = xyz;              };
0071         void SetVertexMomentum(G4ThreeVector xyz)   { VertexMomentum = xyz;         };
0072         void SetPreStepKineticEnergy (G4double Q)   { PreStepKineticEnergy = Q;     };
0073         void SetPostStepKineticEnergy (G4double Q)  { PostStepKineticEnergy = Q;    };
0074         void SetEdep            (G4double de)       { Edep = de;                    };
0075         void SetNi_Edep         (G4double NIde)     { Ni_Edep = NIde;               };
0076         void SetStepLength      (G4double length)   { StepLength = length;          };
0077         void SetPrePos              (G4ThreeVector xyz) { PrePos = xyz;             };
0078         void SetPostPos             (G4ThreeVector xyz) { PostPos = xyz;            };
0079         void SetPreStepMomentum     (G4ThreeVector xyz) { PreStepMomentum = xyz;    };
0080         void SetPostStepMomentum    (G4ThreeVector xyz) { PostStepMomentum = xyz;   };
0081             
0082         
0083         G4int           GetNbPrim()             { return NbPrim;                };
0084         G4int           GetNbSec()              { return NbSec;                 };
0085         G4int           GetNbSup50()            { return NbSup50;               };
0086         G4int           GetPDGEncoding ()       { return PDGEncoding;           };
0087         G4int           GetParentID ()          { return ParentID;              };
0088         G4int           GetTrackID ()           { return trackID;               };
0089         G4String        GetParticleType ()      { return ParticleType;          };
0090         G4String        GetParticleName ()      { return ParticleName;          };
0091         G4String        GetVolumeName ()        { return VolumeName;            };
0092         G4int           GetZ ()                 { return Z;                     };
0093         G4int           GetA ()                 { return A;                     };
0094         G4double        GetVertexKineticEnergy (){ return VertexKineticEnergy;  };
0095         G4ThreeVector GetVertexPos()            { return VertexPos;             };
0096         G4ThreeVector GetVertexMomentum()       { return VertexMomentum ;       };
0097         G4double        GetPreStepKineticEnergy(){ return PreStepKineticEnergy; };
0098         G4double        GetPostStepKineticEnergy(){ return PostStepKineticEnergy;};
0099         G4double        GetEdep ()              { return Edep;                  };
0100         G4double        GetNi_Edep ()           { return Ni_Edep;               };
0101         G4ThreeVector   GetPrePos ()            { return PrePos;                };
0102         G4ThreeVector   GetPostPos ()           { return PostPos;               };
0103         G4ThreeVector   GetPreStepMomentum ()   { return PreStepMomentum;       };
0104         G4ThreeVector   GetPostStepMomentum ()  { return PostStepMomentum;      };
0105         G4double        GetStepLength ()        { return StepLength;            };
0106             
0107     //-------------------
0108     //New due to the use of touchables to identify the different sensitive detectors
0109         void SetVolumeCopyNumber(int value){VolumeCopyNumber = value;};
0110         G4int GetVolumeCopyNumber(){return VolumeCopyNumber;};
0111             
0112     private:
0113 
0114         G4int           NbPrim;
0115         G4int           NbSec;
0116         G4int           NbSup50;
0117         G4int           PDGEncoding;
0118         G4int           ParentID;
0119         G4int           trackID;
0120         G4String        ParticleType;
0121         G4String        ParticleName;
0122         G4String        VolumeName;
0123         G4int           Z;
0124         G4int           A;
0125         G4double        VertexKineticEnergy;
0126         G4double        PreStepKineticEnergy;
0127         G4double        PostStepKineticEnergy;
0128         G4double        Edep;
0129         G4double        Ni_Edep;
0130         G4double        StepLength;
0131         G4ThreeVector   PrePos;
0132         G4ThreeVector   PostPos;
0133         G4ThreeVector   VertexPos;
0134         G4ThreeVector   PreStepMomentum;
0135         G4ThreeVector   PostStepMomentum;
0136         G4ThreeVector   VertexMomentum;
0137 
0138     //-------------------
0139     //New due to the use of touchables to identify the different sensitive detectors
0140         G4int VolumeCopyNumber;
0141     
0142 };
0143 
0144 typedef G4THitsCollection<MicroElecHitSey> MicroElecHitSeyCollection;
0145 extern G4ThreadLocal G4Allocator<MicroElecHitSey>* MicroElecHitSeyAllocator;
0146 inline void* MicroElecHitSey::operator new(size_t){
0147     void *aHit;
0148     if (!MicroElecHitSeyAllocator) { MicroElecHitSeyAllocator = new G4Allocator<MicroElecHitSey>; }
0149     aHit = (void *) MicroElecHitSeyAllocator->MallocSingle();
0150     return aHit;
0151 }
0152 inline void MicroElecHitSey::operator delete(void *aHit){MicroElecHitSeyAllocator->FreeSingle((MicroElecHitSey*) aHit);}
0153 #endif