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 10.5 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

Diff markup

Differences between /examples/extended/runAndEvent/RE06/src/RE06Run.cc (Version 11.3.0) and /examples/extended/runAndEvent/RE06/src/RE06Run.cc (Version 8.1.p1)


  1 //                                                  1 
  2 // *******************************************    
  3 // * License and Disclaimer                       
  4 // *                                              
  5 // * The  Geant4 software  is  copyright of th    
  6 // * the Geant4 Collaboration.  It is provided    
  7 // * conditions of the Geant4 Software License    
  8 // * LICENSE and available at  http://cern.ch/    
  9 // * include a list of copyright holders.         
 10 // *                                              
 11 // * Neither the authors of this software syst    
 12 // * institutes,nor the agencies providing fin    
 13 // * work  make  any representation or  warran    
 14 // * regarding  this  software system or assum    
 15 // * use.  Please see the license in the file     
 16 // * for the full disclaimer and the limitatio    
 17 // *                                              
 18 // * This  code  implementation is the result     
 19 // * technical work of the GEANT4 collaboratio    
 20 // * By using,  copying,  modifying or  distri    
 21 // * any work based  on the software)  you  ag    
 22 // * use  in  resulting  scientific  publicati    
 23 // * acceptance of all terms of the Geant4 Sof    
 24 // *******************************************    
 25 //                                                
 26 /// \file RE06/src/RE06Run.cc                     
 27 /// \brief Implementation of the RE06Run class    
 28 //                                                
 29 //                                                
 30                                                   
 31 #include "RE06Run.hh"                             
 32                                                   
 33 #include "G4Event.hh"                             
 34 #include "G4HCofThisEvent.hh"                     
 35 #include "G4SDManager.hh"                         
 36                                                   
 37 //....oooOO0OOooo........oooOO0OOooo........oo    
 38                                                   
 39 RE06Run::RE06Run() : G4Run()                      
 40 {                                                 
 41   G4String detName[6] = {"Calor-A_abs", "Calor    
 42                          "Calor-B_gap", "Calor    
 43                                                   
 44   G4String primNameSum[6] = {"eDep", "nGamma",    
 45                                                   
 46   G4String primNameMin[3] = {"minEkinGamma", "    
 47                                                   
 48   G4String paraName[3] = {"Calor-AP_para", "Ca    
 49                                                   
 50   G4SDManager* SDMan = G4SDManager::GetSDMpoin    
 51   G4String fullName;                              
 52   size_t i, j;                                    
 53   for (i = 0; i < 6; i++) {                       
 54     for (j = 0; j < 6; j++) {                     
 55       fullName = detName[i] + "/" + primNameSu    
 56       fColIDSum[i][j] = SDMan->GetCollectionID    
 57     }                                             
 58     for (j = 0; j < 3; j++) {                     
 59       fullName = detName[i] + "/" + primNameMi    
 60       fColIDMin[i][j] = SDMan->GetCollectionID    
 61     }                                             
 62   }                                               
 63   for (i = 0; i < 3; i++) {                       
 64     for (j = 0; j < 6; j++) {                     
 65       fullName = paraName[i] + "/" + primNameS    
 66       fColIDPara[i][j] = SDMan->GetCollectionI    
 67     }                                             
 68   }                                               
 69 }                                                 
 70                                                   
 71 //....oooOO0OOooo........oooOO0OOooo........oo    
 72                                                   
 73 RE06Run::~RE06Run()                               
 74 {                                                 
 75   ;                                               
 76 }                                                 
 77                                                   
 78 //....oooOO0OOooo........oooOO0OOooo........oo    
 79                                                   
 80 void RE06Run::RecordEvent(const G4Event* evt)     
 81 {                                                 
 82   G4HCofThisEvent* HCE = evt->GetHCofThisEvent    
 83   if (!HCE) return;                               
 84   numberOfEvent++;                                
 85   size_t i, j;                                    
 86   for (i = 0; i < 6; i++) {                       
 87     for (j = 0; j < 6; j++) {                     
 88       G4THitsMap<G4double>* evtMap = (G4THitsM    
 89       fMapSum[i][j] += *evtMap;                   
 90     }                                             
 91                                                   
 92     for (j = 0; j < 3; j++) {                     
 93       G4THitsMap<G4double>* evtMap = (G4THitsM    
 94       std::map<G4int, G4double*>::iterator itr    
 95       for (; itr != evtMap->GetMap()->end(); i    
 96         G4int key = (itr->first);                 
 97         G4double val = *(itr->second);            
 98         G4double* mapP = fMapMin[i][j][key];      
 99         if (mapP && (val > *mapP)) continue;      
100         fMapMin[i][j].set(key, val);              
101       }                                           
102     }                                             
103   }                                               
104   for (i = 0; i < 3; i++) {                       
105     for (j = 0; j < 6; j++) {                     
106       G4THitsMap<G4double>* evtMap = (G4THitsM    
107       fMapPara[i][j] += *evtMap;                  
108     }                                             
109   }                                               
110 }                                                 
111                                                   
112 //....oooOO0OOooo........oooOO0OOooo........oo    
113 void RE06Run::Merge(const G4Run* aRun)            
114 {                                                 
115   const RE06Run* localRun = static_cast<const     
116                                                   
117   for (G4int i = 0; i < 6; i++) {                 
118     for (G4int j = 0; j < 6; j++) {               
119       fMapSum[i][j] += localRun->fMapSum[i][j]    
120     }                                             
121                                                   
122     for (G4int j = 0; j < 3; j++) {               
123       std::map<G4int, G4double*>::iterator itr    
124       for (; itr != localRun->fMapMin[i][j].Ge    
125         G4int key = itr->first;                   
126         G4double val = *(itr->second);            
127         G4double* mapP = fMapMin[i][j][key];      
128         if (!mapP || val < *mapP) fMapMin[i][j    
129       }                                           
130     }                                             
131   }                                               
132                                                   
133   for (G4int i = 0; i < 3; i++) {                 
134     for (G4int j = 0; j < 6; j++) {               
135       fMapPara[i][j] += localRun->fMapPara[i][    
136     }                                             
137   }                                               
138                                                   
139   G4Run::Merge(aRun);                             
140 }                                                 
141                                                   
142 //....oooOO0OOooo........oooOO0OOooo........oo    
143 G4double RE06Run::GetTotal(const G4THitsMap<G4    
144 {                                                 
145   G4double tot = 0.;                              
146   if (map.GetSize() == 0) return tot;             
147   std::map<G4int, G4double*>::iterator itr = m    
148   for (; itr != map.GetMap()->end(); itr++) {     
149     tot += *(itr->second);                        
150   }                                               
151   return tot;                                     
152 }                                                 
153                                                   
154 //....oooOO0OOooo........oooOO0OOooo........oo    
155                                                   
156 G4double RE06Run::FindMinimum(const G4THitsMap    
157 {                                                 
158   G4double val = DBL_MAX;                         
159                                                   
160   if (map.GetSize() == 0) return val;             
161   std::map<G4int, G4double*>::iterator itr = m    
162   for (; itr != map.GetMap()->end(); itr++) {     
163     if (val > *(itr->second)) val = *(itr->sec    
164   }                                               
165   return val;                                     
166 }                                                 
167                                                   
168 //....oooOO0OOooo........oooOO0OOooo........oo    
169