Back to home page

EIC code displayed by LXR

 
 

    


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

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  *       Filename:  CexmcTrackPointInfo.hh
0030  *
0031  *    Description:  single track point information
0032  *
0033  *        Version:  1.0
0034  *        Created:  16.11.2009 12:51:50
0035  *       Revision:  none
0036  *       Compiler:  gcc
0037  *
0038  *         Author:  Alexey Radkov (), 
0039  *        Company:  PNPI
0040  *
0041  * =============================================================================
0042  */
0043 
0044 #ifndef CEXMC_TRACK_POINT_INFO_HH
0045 #define CEXMC_TRACK_POINT_INFO_HH
0046 
0047 #include <iosfwd>
0048 #include <G4ThreeVector.hh>
0049 #include <G4ParticleDefinition.hh>
0050 #include <G4Allocator.hh>
0051 #include <G4UnitsTable.hh>
0052 #include <G4Types.hh>
0053 #include "CexmcCommon.hh"
0054 
0055 
0056 struct  CexmcTrackPointInfo
0057 {
0058   // explicit argument is only needed by G4THitsMap template,
0059   // it has no actual use here
0060   explicit CexmcTrackPointInfo( G4double  unused = 0. ) :
0061     momentumAmp ( unused ), trackId( CexmcInvalidTrackId )             
0062   {}
0063 
0064     CexmcTrackPointInfo( const G4ThreeVector &  positionLocal_,
0065                          const G4ThreeVector &  positionWorld_,
0066                          const G4ThreeVector &  directionLocal_,
0067                          const G4ThreeVector &  directionWorld_,
0068                          G4double  momentumAmp_,
0069                          const G4ParticleDefinition *  particle_,
0070                          G4int  trackId_, CexmcTrackType  trackType_ ) :
0071         positionLocal( positionLocal_ ), positionWorld( positionWorld_ ),
0072         directionLocal( directionLocal_ ), directionWorld( directionWorld_ ),
0073         momentumAmp( momentumAmp_ ), particle( particle_ ), trackId( trackId_ ),
0074         trackType( trackType_ )
0075     {}
0076 
0077     G4bool  IsValid( void ) const
0078     {
0079         return trackId != CexmcInvalidTrackId;
0080     }
0081 
0082     void *  operator new( size_t  size );
0083 
0084     void    operator delete( void *  obj );
0085 
0086     G4ThreeVector                 positionLocal;
0087 
0088     G4ThreeVector                 positionWorld;
0089 
0090     G4ThreeVector                 directionLocal;
0091 
0092     G4ThreeVector                 directionWorld;
0093 
0094     G4double                      momentumAmp;
0095 
0096     const G4ParticleDefinition *  particle;
0097 
0098     G4int                         trackId;
0099 
0100     CexmcTrackType                trackType;
0101 
0102     // following type cast operator is only needed by G4THitsMap template
0103     // (in PrintAll()), it has no actual use here
0104     operator G4double()
0105     {
0106         return 0;
0107     }
0108 };
0109 
0110 
0111 extern G4Allocator< CexmcTrackPointInfo >  trackPointInfoAllocator;
0112 
0113 
0114 inline void *  CexmcTrackPointInfo::operator new( size_t )
0115 {
0116     return trackPointInfoAllocator.MallocSingle();
0117 }
0118 
0119 
0120 inline void  CexmcTrackPointInfo::operator delete( void *  obj )
0121 {
0122     trackPointInfoAllocator.FreeSingle(
0123                             reinterpret_cast< CexmcTrackPointInfo * >( obj ) );
0124 }
0125 
0126 
0127 std::ostream &  operator<<( std::ostream &  out,
0128                             const CexmcTrackPointInfo &  trackPointInfo );
0129 
0130 
0131 #endif
0132