Back to home page

EIC code displayed by LXR

 
 

    


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

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:  CexmcEventAction.hh
0030  *
0031  *    Description:  event action
0032  *
0033  *        Version:  1.0
0034  *        Created:  27.10.2009 22:41:29
0035  *       Revision:  none
0036  *       Compiler:  gcc
0037  *
0038  *         Author:  Alexey Radkov (), 
0039  *        Company:  PNPI
0040  *
0041  * =============================================================================
0042  */
0043 
0044 #ifndef CEXMC_EVENT_ACTION_HH
0045 #define CEXMC_EVENT_ACTION_HH
0046 
0047 #include <G4UserEventAction.hh>
0048 #include "CexmcAngularRange.hh"
0049 
0050 class  G4Event;
0051 class  CexmcPhysicsManager;
0052 class  CexmcEnergyDepositDigitizer;
0053 struct  CexmcEnergyDepositStore;
0054 class  CexmcTrackPointsDigitizer;
0055 struct  CexmcTrackPointsStore;
0056 class  CexmcEventActionMessenger;
0057 struct  CexmcProductionModelData;
0058 class  CexmcChargeExchangeReconstructor;
0059 
0060 
0061 class  CexmcEventAction : public G4UserEventAction
0062 {
0063     public:
0064         explicit CexmcEventAction( CexmcPhysicsManager *  physicsManager,
0065                                    G4int  verbose = 0 );
0066 
0067         virtual ~CexmcEventAction();
0068 
0069     public:
0070         void      BeginOfEventAction( const G4Event *  event );
0071 
0072         void      EndOfEventAction( const G4Event *  event );
0073 
0074     public:
0075         void      BeamParticleChangeHook( void );
0076 
0077         void      SetVerboseOnCexmcLevel( G4int  value );
0078 
0079         void      SetVerboseDrawLevel( G4int  value );
0080 
0081         CexmcChargeExchangeReconstructor *  GetReconstructor( void );
0082 
0083     private:
0084         void  PrintReconstructedData(
0085                         const CexmcAngularRangeList &  angularRanges,
0086                         const CexmcAngularRange &  angularGap ) const;
0087 
0088 #ifdef CEXMC_USE_ROOT
0089         void  FillEDTHistos( const CexmcEnergyDepositStore *  edStore,
0090                 const CexmcAngularRangeList &  triggeredAngularRanges ) const;
0091 
0092         void  FillTPTHistos( const CexmcTrackPointsStore *  tpStore,
0093                 const CexmcProductionModelData &  pmData,
0094                 const CexmcAngularRangeList &  triggeredAngularRanges ) const;
0095 
0096         void  FillRTHistos( G4bool  reconstructorHasFullTrigger,
0097                 const CexmcEnergyDepositStore *  edStore,
0098                 const CexmcTrackPointsStore *  tpStore,
0099                 const CexmcProductionModelData &  pmData,
0100                 const CexmcAngularRangeList &  triggeredAngularRanges ) const;
0101 #endif
0102 
0103         void  DrawTrajectories( const G4Event *  event );
0104 
0105         void  DrawTrackPoints( const CexmcTrackPointsStore *  tpStore ) const;
0106 
0107         void  DrawReconstructionData( void );
0108 
0109         void  UpdateRunHits( const CexmcAngularRangeList &  aRangesReal,
0110                              const CexmcAngularRangeList &  aRangesRec,
0111                              G4bool  tpDigitizerHasTriggered,
0112                              G4bool  edDigitizerHasTriggered,
0113                              G4bool  edDigitizerMonitorHasTriggered,
0114                              G4bool  reconstructorHasTriggered,
0115                              const CexmcAngularRange &  aGap );
0116 
0117 #ifdef CEXMC_USE_PERSISTENCY
0118         void  SaveEvent( const G4Event *  event,
0119                          G4bool  edDigitizerMonitorHasTriggered,
0120                          const CexmcEnergyDepositStore *  edStore,
0121                          const CexmcTrackPointsStore *  tpStore,
0122                          const CexmcProductionModelData &  pmData );
0123 
0124         void  SaveEventFast( const G4Event *  event,
0125                              G4bool  tpDigitizerHasTriggered,
0126                              G4bool  edDigitizerHasTriggered,
0127                              G4bool  edDigitizerMonitorHasTriggered,
0128                              G4double  opCosThetaSCM );
0129 #endif
0130 
0131     public:
0132         static CexmcEnergyDepositStore *  MakeEnergyDepositStore(
0133                             const CexmcEnergyDepositDigitizer *  digitizer );
0134 
0135         static CexmcTrackPointsStore *  MakeTrackPointsStore(
0136                             const CexmcTrackPointsDigitizer *  digitizer );
0137 
0138         static void  PrintEnergyDeposit(
0139                             const CexmcEnergyDepositStore *  edStore );
0140 
0141         static void  PrintTrackPoints(
0142                             const CexmcTrackPointsStore *  tpStore );
0143 
0144         static void  PrintProductionModelData(
0145                             const CexmcAngularRangeList &  angularRanges,
0146                             const CexmcProductionModelData &  pmData );
0147 
0148     private:
0149         CexmcPhysicsManager *               physicsManager;
0150 
0151         CexmcChargeExchangeReconstructor *  reconstructor;
0152 
0153 #ifdef CEXMC_USE_ROOT
0154   G4double                            opKinEnergy;
0155 #endif
0156 
0157     private:
0158         G4int                               verbose;
0159 
0160         G4int                               verboseDraw;
0161 
0162         CexmcEventActionMessenger *         messenger;
0163 };
0164 
0165 
0166 inline void  CexmcEventAction::SetVerboseOnCexmcLevel( G4int  value )
0167 {
0168     verbose = value;
0169 }
0170 
0171 
0172 inline void  CexmcEventAction::SetVerboseDrawLevel( G4int  value )
0173 {
0174     verboseDraw = value;
0175 }
0176 
0177 
0178 inline CexmcChargeExchangeReconstructor *
0179                                     CexmcEventAction::GetReconstructor( void )
0180 {
0181     return reconstructor;
0182 }
0183 
0184 
0185 #endif
0186