Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-03-28 07:51:13

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 RE02Run.hh
0027 /// \brief Definition of the RE02Run class
0028 
0029 #ifndef RE02Run_h
0030 #define RE02Run_h 1
0031 
0032 #include "G4Event.hh"
0033 #include "G4Run.hh"
0034 #include "G4THitsMap.hh"
0035 
0036 #include <vector>
0037 
0038 //---------------------------------------------------------------------
0039 /// User run class
0040 ///
0041 /// (Description)
0042 ///    An example implementation for the multi-functional-detector and
0043 ///   primitive scorers.
0044 ///    This RE02Run class has collections which accumulate event information
0045 ///   into run information.
0046 ///
0047 /// - constructor
0048 ///     gets HitsCollection names, collection IDs and HitsMaps of
0049 ///        primitive scorers from the muti-functional detector
0050 ///
0051 /// - void RecordEvent(const G4Event*)
0052 ///     accumulates HitsMaps over all events into a run HitsMap
0053 ///
0054 /// - G4int GetNumberOfHitsMap() const
0055 ///     gets the size of the run HitsMap
0056 ///
0057 /// - G4THitsMap<G4double>* GetHitsMap(G4int i)
0058 ///     gets a run HitsMap of the i-th primitive scorer
0059 ///
0060 /// - G4THitsMap<G4double>* GetHitsMap(const G4String& detName,
0061 ///                                  const G4String& colName)
0062 ///     gets a run HitsMap with the detName and the colName
0063 ///
0064 /// - G4THitsMap<G4double>* GetHitsMap(const G4String& fullName)
0065 ///     gets a run HitsMap with the fullName
0066 ///
0067 /// - void DumpAllScorer()
0068 ///     shows all HitsMap information of this run.
0069 ///     This method calls G4THisMap::PrintAll() for individual HitsMap.
0070 //---------------------------------------------------------------------
0071 class RE02Run : public G4Run
0072 {
0073   public:
0074     // constructor and destructor.
0075     //  vector of multifunctionaldetector name has to given to constructor.
0076     RE02Run(const std::vector<G4String> mfdName);
0077     virtual ~RE02Run();
0078 
0079   public:
0080     // virtual method from G4Run.
0081     // The method is overriden in this class for scoring.
0082     virtual void RecordEvent(const G4Event*);
0083     virtual void Merge(const G4Run*);
0084 
0085     // Access methods for scoring information.
0086     // - Number of HitsMap for this RUN.
0087     //   This is equal to number of collections.
0088     G4int GetNumberOfHitsMap() const { return fRunMap.size(); }
0089     // - Get HitsMap of this RUN.
0090     //   by sequential number, by multifucntional name and collection name,
0091     //   and by collection name with full path.
0092     G4THitsMap<G4double>* GetHitsMap(G4int i) { return fRunMap[i]; }
0093     G4THitsMap<G4double>* GetHitsMap(const G4String& detName, const G4String& colName);
0094     G4THitsMap<G4double>* GetHitsMap(const G4String& fullName);
0095     // - Dump All HitsMap of this RUN.
0096     //   This method calls G4THisMap::PrintAll() for individual HitsMap.
0097     void DumpAllScorer();
0098 
0099   private:
0100     std::vector<G4String> fCollName;
0101     std::vector<G4int> fCollID;
0102     std::vector<G4THitsMap<G4double>*> fRunMap;
0103 };
0104 
0105 //
0106 
0107 #endif