Geant4 Cross Reference

Cross-Referencing   Geant4
Geant4/digits_hits/utils/src/G4ScoreQuantityMessenger.cc

Version: [ ReleaseNotes ] [ 1.0 ] [ 1.1 ] [ 2.0 ] [ 3.0 ] [ 3.1 ] [ 3.2 ] [ 4.0 ] [ 4.0.p1 ] [ 4.0.p2 ] [ 4.1 ] [ 4.1.p1 ] [ 5.0 ] [ 5.0.p1 ] [ 5.1 ] [ 5.1.p1 ] [ 5.2 ] [ 5.2.p1 ] [ 5.2.p2 ] [ 6.0 ] [ 6.0.p1 ] [ 6.1 ] [ 6.2 ] [ 6.2.p1 ] [ 6.2.p2 ] [ 7.0 ] [ 7.0.p1 ] [ 7.1 ] [ 7.1.p1 ] [ 8.0 ] [ 8.0.p1 ] [ 8.1 ] [ 8.1.p1 ] [ 8.1.p2 ] [ 8.2 ] [ 8.2.p1 ] [ 8.3 ] [ 8.3.p1 ] [ 8.3.p2 ] [ 9.0 ] [ 9.0.p1 ] [ 9.0.p2 ] [ 9.1 ] [ 9.1.p1 ] [ 9.1.p2 ] [ 9.1.p3 ] [ 9.2 ] [ 9.2.p1 ] [ 9.2.p2 ] [ 9.2.p3 ] [ 9.2.p4 ] [ 9.3 ] [ 9.3.p1 ] [ 9.3.p2 ] [ 9.4 ] [ 9.4.p1 ] [ 9.4.p2 ] [ 9.4.p3 ] [ 9.4.p4 ] [ 9.5 ] [ 9.5.p1 ] [ 9.5.p2 ] [ 9.6 ] [ 9.6.p1 ] [ 9.6.p2 ] [ 9.6.p3 ] [ 9.6.p4 ] [ 10.0 ] [ 10.0.p1 ] [ 10.0.p2 ] [ 10.0.p3 ] [ 10.0.p4 ] [ 10.1 ] [ 10.1.p1 ] [ 10.1.p2 ] [ 10.1.p3 ] [ 10.2 ] [ 10.2.p1 ] [ 10.2.p2 ] [ 10.2.p3 ] [ 10.3 ] [ 10.3.p1 ] [ 10.3.p2 ] [ 10.3.p3 ] [ 10.4 ] [ 10.4.p1 ] [ 10.4.p2 ] [ 10.4.p3 ] [ 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 /digits_hits/utils/src/G4ScoreQuantityMessenger.cc (Version 11.3.0) and /digits_hits/utils/src/G4ScoreQuantityMessenger.cc (Version 10.6.p2)


  1 //                                                  1 //
  2 // *******************************************      2 // ********************************************************************
  3 // * License and Disclaimer                         3 // * License and Disclaimer                                           *
  4 // *                                                4 // *                                                                  *
  5 // * The  Geant4 software  is  copyright of th      5 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
  6 // * the Geant4 Collaboration.  It is provided      6 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
  7 // * conditions of the Geant4 Software License      7 // * conditions of the Geant4 Software License,  included in the file *
  8 // * LICENSE and available at  http://cern.ch/      8 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
  9 // * include a list of copyright holders.           9 // * include a list of copyright holders.                             *
 10 // *                                               10 // *                                                                  *
 11 // * Neither the authors of this software syst     11 // * Neither the authors of this software system, nor their employing *
 12 // * institutes,nor the agencies providing fin     12 // * institutes,nor the agencies providing financial support for this *
 13 // * work  make  any representation or  warran     13 // * work  make  any representation or  warranty, express or implied, *
 14 // * regarding  this  software system or assum     14 // * regarding  this  software system or assume any liability for its *
 15 // * use.  Please see the license in the file      15 // * use.  Please see the license in the file  LICENSE  and URL above *
 16 // * for the full disclaimer and the limitatio     16 // * for the full disclaimer and the limitation of liability.         *
 17 // *                                               17 // *                                                                  *
 18 // * This  code  implementation is the result      18 // * This  code  implementation is the result of  the  scientific and *
 19 // * technical work of the GEANT4 collaboratio     19 // * technical work of the GEANT4 collaboration.                      *
 20 // * By using,  copying,  modifying or  distri     20 // * By using,  copying,  modifying or  distributing the software (or *
 21 // * any work based  on the software)  you  ag     21 // * any work based  on the software)  you  agree  to acknowledge its *
 22 // * use  in  resulting  scientific  publicati     22 // * use  in  resulting  scientific  publications,  and indicate your *
 23 // * acceptance of all terms of the Geant4 Sof     23 // * acceptance of all terms of the Geant4 Software license.          *
 24 // *******************************************     24 // ********************************************************************
 25 //                                                 25 //
 26 // G4ScoreQuantityMessenger                    <<  26 //
 27 //                                                 27 //
 28 // -------------------------------------------     28 // ---------------------------------------------------------------------
 29 // Modifications                                   29 // Modifications
 30 //  08-Oct-2010 T.Aso Remove unit of G4PSPassa <<  30 // 08-Oct-2010 T.Aso remove unit of G4PSPassageCellCurrent.
 31 //  24-Mar-2011 T.Aso Add StepChecker for debu <<  31 //  24-Mar-2011  T.Aso  Add StepChecker for debugging.
 32 //  24-Mar-2011 T.Aso Size and segmentation fo <<  32 //  24-Mar-2011  T.Aso  Size and segmentation for replicated cylinder.
 33 //  01-Jun-2012 T.Aso Support weighted/divided <<  33 //  01-Jun-2012  T.Aso  Support weighted/dividedByArea options 
 34 //                    in flatCurrent and flatF <<  34 //                      in flatCurrent and flatFulx commands.
 35 //  27-Mar-2013 T.Aso Unit option in the kinet <<  35 //  27-Mar-2013  T.Aso  Unit option in the kineticEnergy filter was 
                                                   >>  36 //                     supported.
                                                   >>  37 //                       
 36 // -------------------------------------------     38 // ---------------------------------------------------------------------
 37                                                    39 
 38 #include "G4ScoreQuantityMessenger.hh"             40 #include "G4ScoreQuantityMessenger.hh"
 39 #include "G4ScoringManager.hh"                     41 #include "G4ScoringManager.hh"
 40 #include "G4VScoringMesh.hh"                       42 #include "G4VScoringMesh.hh"
 41 #include "G4VPrimitiveScorer.hh"                   43 #include "G4VPrimitiveScorer.hh"
 42                                                    44 
 43 #include "G4PSCellCharge3D.hh"                     45 #include "G4PSCellCharge3D.hh"
 44 #include "G4PSCellFlux3D.hh"                       46 #include "G4PSCellFlux3D.hh"
 45 #include "G4PSCellFluxForCylinder3D.hh"            47 #include "G4PSCellFluxForCylinder3D.hh"
 46 #include "G4PSPassageCellFlux3D.hh"                48 #include "G4PSPassageCellFlux3D.hh"
 47 #include "G4PSPassageCellFluxForCylinder3D.hh"     49 #include "G4PSPassageCellFluxForCylinder3D.hh"
 48 #include "G4PSEnergyDeposit3D.hh"                  50 #include "G4PSEnergyDeposit3D.hh"
 49 #include "G4PSDoseDeposit3D.hh"                    51 #include "G4PSDoseDeposit3D.hh"
 50 #include "G4PSDoseDepositForCylinder3D.hh"         52 #include "G4PSDoseDepositForCylinder3D.hh"
 51 #include "G4PSNofStep3D.hh"                        53 #include "G4PSNofStep3D.hh"
 52 #include "G4PSNofSecondary3D.hh"                   54 #include "G4PSNofSecondary3D.hh"
 53 //                                                 55 //
 54 #include "G4PSTrackLength3D.hh"                    56 #include "G4PSTrackLength3D.hh"
 55 #include "G4PSPassageCellCurrent3D.hh"             57 #include "G4PSPassageCellCurrent3D.hh"
 56 #include "G4PSPassageTrackLength3D.hh"             58 #include "G4PSPassageTrackLength3D.hh"
 57 #include "G4PSFlatSurfaceCurrent3D.hh"             59 #include "G4PSFlatSurfaceCurrent3D.hh"
 58 #include "G4PSFlatSurfaceFlux3D.hh"                60 #include "G4PSFlatSurfaceFlux3D.hh"
 59 #include "G4PSSphereSurfaceCurrent3D.hh"           61 #include "G4PSSphereSurfaceCurrent3D.hh"
 60 #include "G4PSSphereSurfaceFlux3D.hh"              62 #include "G4PSSphereSurfaceFlux3D.hh"
 61 #include "G4PSCylinderSurfaceCurrent3D.hh"         63 #include "G4PSCylinderSurfaceCurrent3D.hh"
 62 #include "G4PSCylinderSurfaceFlux3D.hh"            64 #include "G4PSCylinderSurfaceFlux3D.hh"
 63 #include "G4PSVolumeFlux3D.hh"                 << 
 64 #include "G4PSNofCollision3D.hh"                   65 #include "G4PSNofCollision3D.hh"
 65 #include "G4PSPopulation3D.hh"                     66 #include "G4PSPopulation3D.hh"
 66 #include "G4PSTrackCounter3D.hh"                   67 #include "G4PSTrackCounter3D.hh"
 67 #include "G4PSTermination3D.hh"                    68 #include "G4PSTermination3D.hh"
 68 #include "G4PSMinKinEAtGeneration3D.hh"            69 #include "G4PSMinKinEAtGeneration3D.hh"
 69                                                    70 
 70 #include "G4PSCellCharge.hh"                       71 #include "G4PSCellCharge.hh"
 71 #include "G4PSCellFlux.hh"                         72 #include "G4PSCellFlux.hh"
 72 #include "G4PSPassageCellFlux.hh"                  73 #include "G4PSPassageCellFlux.hh"
 73 #include "G4PSEnergyDeposit.hh"                    74 #include "G4PSEnergyDeposit.hh"
 74 #include "G4PSDoseDeposit.hh"                      75 #include "G4PSDoseDeposit.hh"
 75 #include "G4PSNofStep.hh"                          76 #include "G4PSNofStep.hh"
 76 #include "G4PSNofSecondary.hh"                     77 #include "G4PSNofSecondary.hh"
 77 //                                                 78 //
 78 #include "G4PSTrackLength.hh"                      79 #include "G4PSTrackLength.hh"
 79 #include "G4PSPassageCellCurrent.hh"               80 #include "G4PSPassageCellCurrent.hh"
 80 #include "G4PSPassageTrackLength.hh"               81 #include "G4PSPassageTrackLength.hh"
 81 #include "G4PSFlatSurfaceCurrent.hh"               82 #include "G4PSFlatSurfaceCurrent.hh"
 82 #include "G4PSFlatSurfaceFlux.hh"                  83 #include "G4PSFlatSurfaceFlux.hh"
 83 #include "G4PSSphereSurfaceCurrent.hh"             84 #include "G4PSSphereSurfaceCurrent.hh"
 84 #include "G4PSSphereSurfaceFlux.hh"                85 #include "G4PSSphereSurfaceFlux.hh"
 85 #include "G4PSCylinderSurfaceCurrent.hh"           86 #include "G4PSCylinderSurfaceCurrent.hh"
 86 #include "G4PSCylinderSurfaceFlux.hh"              87 #include "G4PSCylinderSurfaceFlux.hh"
 87 #include "G4PSNofCollision.hh"                     88 #include "G4PSNofCollision.hh"
 88 #include "G4PSPopulation.hh"                       89 #include "G4PSPopulation.hh"
 89 #include "G4PSTrackCounter.hh"                     90 #include "G4PSTrackCounter.hh"
 90 #include "G4PSTermination.hh"                      91 #include "G4PSTermination.hh"
 91 #include "G4PSMinKinEAtGeneration.hh"              92 #include "G4PSMinKinEAtGeneration.hh"
 92                                                    93 
 93 //                                                 94 //
 94 // For debug purpose                               95 // For debug purpose
 95 #include "G4PSStepChecker3D.hh"                    96 #include "G4PSStepChecker3D.hh"
 96                                                    97 
 97 #include "G4SDChargedFilter.hh"                    98 #include "G4SDChargedFilter.hh"
 98 #include "G4SDNeutralFilter.hh"                    99 #include "G4SDNeutralFilter.hh"
 99 #include "G4SDKineticEnergyFilter.hh"             100 #include "G4SDKineticEnergyFilter.hh"
100 #include "G4SDParticleFilter.hh"                  101 #include "G4SDParticleFilter.hh"
101 #include "G4SDParticleWithEnergyFilter.hh"        102 #include "G4SDParticleWithEnergyFilter.hh"
102                                                   103 
103 #include "G4UIdirectory.hh"                       104 #include "G4UIdirectory.hh"
104 #include "G4UIcmdWithoutParameter.hh"             105 #include "G4UIcmdWithoutParameter.hh"
105 #include "G4UIcmdWithAnInteger.hh"                106 #include "G4UIcmdWithAnInteger.hh"
106 #include "G4UIcmdWithAString.hh"                  107 #include "G4UIcmdWithAString.hh"
107 #include "G4UIcmdWithABool.hh"                    108 #include "G4UIcmdWithABool.hh"
108 #include "G4UIcmdWithADoubleAndUnit.hh"           109 #include "G4UIcmdWithADoubleAndUnit.hh"
109 #include "G4UIcmdWith3VectorAndUnit.hh"           110 #include "G4UIcmdWith3VectorAndUnit.hh"
110 #include "G4UIcommand.hh"                         111 #include "G4UIcommand.hh"
111 #include "G4UIparameter.hh"                       112 #include "G4UIparameter.hh"
112 #include "G4Tokenizer.hh"                         113 #include "G4Tokenizer.hh"
113 #include "G4UnitsTable.hh"                        114 #include "G4UnitsTable.hh"
114                                                   115 
115 G4ScoreQuantityMessenger::G4ScoreQuantityMesse    116 G4ScoreQuantityMessenger::G4ScoreQuantityMessenger(G4ScoringManager* SManager)
116   : fSMan(SManager)                            << 117 :fSMan(SManager)
117 {                                                 118 {
118   QuantityCommands();                             119   QuantityCommands();
119   FilterCommands();                               120   FilterCommands();
120 }                                                 121 }
121                                                   122 
122 void G4ScoreQuantityMessenger::QuantityCommand << 
123 {                                              << 
124   G4UIparameter* param;                        << 
125                                                << 
126   //                                           << 
127   // Quantity commands                         << 
128   quantityDir = new G4UIdirectory("/score/quan << 
129   quantityDir->SetGuidance("Scoring quantity o << 
130   //                                           << 
131   qTouchCmd = new G4UIcmdWithAString("/score/q << 
132   qTouchCmd->SetGuidance(                      << 
133     "Assign previously defined quantity to the << 
134   qTouchCmd->SetParameterName("qname", false); << 
135   //                                           << 
136   qGetUnitCmd = new G4UIcmdWithoutParameter("/ << 
137   qGetUnitCmd->SetGuidance("Print output unit  << 
138   //                                           << 
139   qSetUnitCmd = new G4UIcmdWithAString("/score << 
140   qSetUnitCmd->SetGuidance("Set output unit of << 
141   qSetUnitCmd->SetParameterName("unit", false) << 
142                                                << 
143   // Primitive Scorers                         << 
144   qeDepCmd = new G4UIcommand("/score/quantity/ << 
145   qeDepCmd->SetGuidance("Energy deposit scorer << 
146   qeDepCmd->SetGuidance("[usage] /score/quanti << 
147   qeDepCmd->SetGuidance("  qname  :(String) sc << 
148   qeDepCmd->SetGuidance("  unit   :(String) un << 
149   param = new G4UIparameter("qname", 's', fals << 
150   qeDepCmd->SetParameter(param);               << 
151   param = new G4UIparameter("unit", 's', true) << 
152   param->SetDefaultUnit("MeV");                << 
153   qeDepCmd->SetParameter(param);               << 
154   //                                           << 
155   qCellChgCmd = new G4UIcommand("/score/quanti << 
156   qCellChgCmd->SetGuidance("Cell charge scorer << 
157   qCellChgCmd->SetGuidance("[usage] /score/qua << 
158   qCellChgCmd->SetGuidance("  qname  :(String) << 
159   qCellChgCmd->SetGuidance("  unit   :(String) << 
160   param = new G4UIparameter("qname", 's', fals << 
161   qCellChgCmd->SetParameter(param);            << 
162   param = new G4UIparameter("unit", 's', true) << 
163   param->SetDefaultUnit("e+");                 << 
164   qCellChgCmd->SetParameter(param);            << 
165   //                                           << 
166   qCellFluxCmd = new G4UIcommand("/score/quant << 
167   qCellFluxCmd->SetGuidance("Cell flux scorer. << 
168   qCellFluxCmd->SetGuidance("[usage] /score/qu << 
169   qCellFluxCmd->SetGuidance("  qname  :(String << 
170   qCellFluxCmd->SetGuidance("  unit   :(String << 
171   param = new G4UIparameter("qname", 's', fals << 
172   qCellFluxCmd->SetParameter(param);           << 
173   param = new G4UIparameter("unit", 's', true) << 
174   param->SetDefaultValue("percm2");            << 
175   qCellFluxCmd->SetParameter(param);           << 
176   //                                           << 
177   qPassCellFluxCmd = new G4UIcommand("/score/q << 
178   qPassCellFluxCmd->SetGuidance("Passage cell  << 
179   qPassCellFluxCmd->SetGuidance(               << 
180     "[usage] /score/quantity/passageCellFlux q << 
181   qPassCellFluxCmd->SetGuidance("  qname  :(St << 
182   qPassCellFluxCmd->SetGuidance("  unit   :(St << 
183   param = new G4UIparameter("qname", 's', fals << 
184   qPassCellFluxCmd->SetParameter(param);       << 
185   param = new G4UIparameter("unit", 's', true) << 
186   param->SetDefaultValue("percm2");            << 
187   qPassCellFluxCmd->SetParameter(param);       << 
188   //                                           << 
189   qdoseDepCmd = new G4UIcommand("/score/quanti << 
190   qdoseDepCmd->SetGuidance("Dose deposit score << 
191   qdoseDepCmd->SetGuidance("[usage] /score/qua << 
192   qdoseDepCmd->SetGuidance("  qname  :(String) << 
193   qdoseDepCmd->SetGuidance("  unit   :(String) << 
194   param = new G4UIparameter("qname", 's', fals << 
195   qdoseDepCmd->SetParameter(param);            << 
196   param = new G4UIparameter("unit", 's', true) << 
197   param->SetDefaultUnit("Gy");                 << 
198   qdoseDepCmd->SetParameter(param);            << 
199   //                                           << 
200   qnOfStepCmd = new G4UIcommand("/score/quanti << 
201   qnOfStepCmd->SetGuidance("Number of step sco << 
202   qnOfStepCmd->SetGuidance("[usage] /score/qua << 
203   qnOfStepCmd->SetGuidance("[usage] /score/qua << 
204   qnOfStepCmd->SetGuidance("  qname  :(String) << 
205   qnOfStepCmd->SetGuidance("  bflag  :(Bool) S << 
206   qnOfStepCmd->SetGuidance("          at geome << 
207   param = new G4UIparameter("qname", 's', fals << 
208   qnOfStepCmd->SetParameter(param);            << 
209   param = new G4UIparameter("bflag", 'b', true << 
210   param->SetDefaultValue("false");             << 
211   qnOfStepCmd->SetParameter(param);            << 
212   //                                           << 
213   qnOfSecondaryCmd = new G4UIcommand("/score/q << 
214   qnOfSecondaryCmd->SetGuidance("Number of sec << 
215   qnOfSecondaryCmd->SetGuidance("[usage] /scor << 
216   qnOfSecondaryCmd->SetGuidance("  qname  :(St << 
217   param = new G4UIparameter("qname", 's', fals << 
218   qnOfSecondaryCmd->SetParameter(param);       << 
219   //                                           << 
220   qTrackLengthCmd = new G4UIcommand("/score/qu << 
221   qTrackLengthCmd->SetGuidance("Track length s << 
222   qTrackLengthCmd->SetGuidance(                << 
223     "[usage] /score/quantity/trackLength qname << 
224   qTrackLengthCmd->SetGuidance("  qname  :(Str << 
225   qTrackLengthCmd->SetGuidance("  wflag  :(Boo << 
226   qTrackLengthCmd->SetGuidance("  kflag  :(Boo << 
227   qTrackLengthCmd->SetGuidance("  vflag  :(Boo << 
228   qTrackLengthCmd->SetGuidance("  unit   :(Str << 
229   param = new G4UIparameter("qname", 's', fals << 
230   qTrackLengthCmd->SetParameter(param);        << 
231   param = new G4UIparameter("wflag", 'b', true << 
232   param->SetDefaultValue("false");             << 
233   qTrackLengthCmd->SetParameter(param);        << 
234   param = new G4UIparameter("kflag", 'b', true << 
235   param->SetDefaultValue("false");             << 
236   qTrackLengthCmd->SetParameter(param);        << 
237   param = new G4UIparameter("vflag", 'b', true << 
238   param->SetDefaultValue("false");             << 
239   qTrackLengthCmd->SetParameter(param);        << 
240   param = new G4UIparameter("unit", 's', true) << 
241   param->SetDefaultValue("mm");                << 
242   qTrackLengthCmd->SetParameter(param);        << 
243   //                                           << 
244   qPassCellCurrCmd =                           << 
245     new G4UIcommand("/score/quantity/passageCe << 
246   qPassCellCurrCmd->SetGuidance("Passage cell  << 
247   qPassCellCurrCmd->SetGuidance(               << 
248     "[usage] /score/quantity/passageCellCurren << 
249   qPassCellCurrCmd->SetGuidance("  qname  :(St << 
250   qPassCellCurrCmd->SetGuidance("  wflag  :(Bo << 
251   param = new G4UIparameter("qname", 's', fals << 
252   qPassCellCurrCmd->SetParameter(param);       << 
253   param = new G4UIparameter("wflag", 'b', true << 
254   param->SetDefaultValue("true");              << 
255   qPassCellCurrCmd->SetParameter(param);       << 
256   //                                           << 
257   qPassTrackLengthCmd =                        << 
258     new G4UIcommand("/score/quantity/passageTr << 
259   qPassTrackLengthCmd->SetGuidance("Passage tr << 
260   qPassTrackLengthCmd->SetGuidance(            << 
261     "[usage] /score/quantity/passageTrackLengt << 
262   qPassTrackLengthCmd->SetGuidance("  qname  : << 
263   qPassTrackLengthCmd->SetGuidance("  wflag  : << 
264   qPassTrackLengthCmd->SetGuidance("  unit   : << 
265   param = new G4UIparameter("qname", 's', fals << 
266   qPassTrackLengthCmd->SetParameter(param);    << 
267   param = new G4UIparameter("wflag", 'b', true << 
268   param->SetDefaultValue("true");              << 
269   qPassTrackLengthCmd->SetParameter(param);    << 
270   param = new G4UIparameter("unit", 's', true) << 
271   param->SetDefaultUnit("mm");                 << 
272   qPassTrackLengthCmd->SetParameter(param);    << 
273   //                                           << 
274   qFlatSurfCurrCmd =                           << 
275     new G4UIcommand("/score/quantity/flatSurfa << 
276   qFlatSurfCurrCmd->SetGuidance("Flat surface  << 
277   qFlatSurfCurrCmd->SetGuidance(               << 
278     "[usage] /score/quantity/flatSurfaceCurren << 
279   qFlatSurfCurrCmd->SetGuidance("  qname  :(St << 
280   qFlatSurfCurrCmd->SetGuidance("  dflag  :(In << 
281   qFlatSurfCurrCmd->SetGuidance("         : 0  << 
282   qFlatSurfCurrCmd->SetGuidance("         : 1  << 
283   qFlatSurfCurrCmd->SetGuidance("         : 2  << 
284   qFlatSurfCurrCmd->SetGuidance("  wflag  :(Bo << 
285   qFlatSurfCurrCmd->SetGuidance("  aflag  :(Bo << 
286   qFlatSurfCurrCmd->SetGuidance("  unit   :(St << 
287   param = new G4UIparameter("qname", 's', fals << 
288   qFlatSurfCurrCmd->SetParameter(param);       << 
289   param = new G4UIparameter("dflag", 'i', true << 
290   param->SetDefaultValue("0");                 << 
291   qFlatSurfCurrCmd->SetParameter(param);       << 
292   param = new G4UIparameter("wflag", 'b', true << 
293   param->SetDefaultValue("true");              << 
294   qFlatSurfCurrCmd->SetParameter(param);       << 
295   param = new G4UIparameter("aflag", 'b', true << 
296   param->SetDefaultValue("true");              << 
297   qFlatSurfCurrCmd->SetParameter(param);       << 
298   param = new G4UIparameter("unit", 's', true) << 
299   param->SetDefaultValue("percm2");            << 
300   qFlatSurfCurrCmd->SetParameter(param);       << 
301   //                                           << 
302   qFlatSurfFluxCmd = new G4UIcommand("/score/q << 
303   qFlatSurfFluxCmd->SetGuidance("Flat surface  << 
304   qFlatSurfFluxCmd->SetGuidance(               << 
305     "[usage] /score/quantity/flatSurfaceFlux q << 
306   qFlatSurfFluxCmd->SetGuidance("  qname  :(St << 
307   qFlatSurfFluxCmd->SetGuidance("  dflag  :(In << 
308   qFlatSurfFluxCmd->SetGuidance("         : 0  << 
309   qFlatSurfFluxCmd->SetGuidance("         : 1  << 
310   qFlatSurfFluxCmd->SetGuidance("         : 2  << 
311   qFlatSurfFluxCmd->SetGuidance("  wflag  :(Bo << 
312   qFlatSurfFluxCmd->SetGuidance("  aflag  :(Bo << 
313   qFlatSurfFluxCmd->SetGuidance("  unit   :(St << 
314   param = new G4UIparameter("qname", 's', fals << 
315   qFlatSurfFluxCmd->SetParameter(param);       << 
316   param = new G4UIparameter("dflag", 'i', true << 
317   param->SetDefaultValue("0");                 << 
318   qFlatSurfFluxCmd->SetParameter(param);       << 
319   param = new G4UIparameter("wflag", 'b', true << 
320   param->SetDefaultValue("true");              << 
321   qFlatSurfFluxCmd->SetParameter(param);       << 
322   param = new G4UIparameter("aflag", 'b', true << 
323   param->SetDefaultValue("true");              << 
324   qFlatSurfFluxCmd->SetParameter(param);       << 
325   param = new G4UIparameter("unit", 's', true) << 
326   param->SetDefaultValue("percm2");            << 
327   qFlatSurfFluxCmd->SetParameter(param);       << 
328   //                                           << 
329                                                << 
330   qVolFluxCmd = new G4UIcommand("/score/quanti << 
331   qVolFluxCmd->SetGuidance("Volume flux scorer << 
332   qVolFluxCmd->SetGuidance(                    << 
333     "This scorer scores the number of particle << 
334     "without normalized by the surface area.") << 
335   qVolFluxCmd->SetGuidance(                    << 
336     "[usage] /score/quantity/volumeFlux qname  << 
337   qVolFluxCmd->SetGuidance("  qname  :(String) << 
338   qVolFluxCmd->SetGuidance("  divcos :(Bool) d << 
339                            "is the incident an << 
340   qVolFluxCmd->SetGuidance(                    << 
341     "  dflag  :(Int) direction, 1 : inward (de << 
342   param = new G4UIparameter("qname", 's', fals << 
343   qVolFluxCmd->SetParameter(param);            << 
344   param = new G4UIparameter("divcos", 'b', tru << 
345   param->SetDefaultValue(0);                   << 
346   qVolFluxCmd->SetParameter(param);            << 
347   param = new G4UIparameter("dflag", 'i', true << 
348   param->SetParameterRange("dflag>=1 && dflag< << 
349   param->SetDefaultValue(1);                   << 
350   qVolFluxCmd->SetParameter(param);            << 
351                                                << 
352   qNofCollisionCmd = new G4UIcommand("/score/q << 
353   qNofCollisionCmd->SetGuidance("Number of col << 
354   qNofCollisionCmd->SetGuidance(               << 
355     "[usage] /score/quantity/nOfCollision qnam << 
356   qNofCollisionCmd->SetGuidance("  qname  :(St << 
357   param = new G4UIparameter("qname", 's', fals << 
358   qNofCollisionCmd->SetParameter(param);       << 
359   param = new G4UIparameter("wflag", 'b', true << 
360   param->SetDefaultValue("false");             << 
361   qNofCollisionCmd->SetParameter(param);       << 
362   //                                           << 
363   qPopulationCmd = new G4UIcommand("/score/qua << 
364   qPopulationCmd->SetGuidance("Population scor << 
365   qPopulationCmd->SetGuidance("[usage] /score/ << 
366   qPopulationCmd->SetGuidance("  qname  :(Stri << 
367   qPopulationCmd->SetGuidance("  wflag  :(Bool << 
368   param = new G4UIparameter("qname", 's', fals << 
369   qPopulationCmd->SetParameter(param);         << 
370   param = new G4UIparameter("wflag", 'b', true << 
371   param->SetDefaultValue("false");             << 
372   qPopulationCmd->SetParameter(param);         << 
373                                                << 
374   //                                           << 
375   qTrackCountCmd = new G4UIcommand("/score/qua << 
376   qTrackCountCmd->SetGuidance("Number of track << 
377   qTrackCountCmd->SetGuidance(                 << 
378     "[usage] /score/quantity/nOfTrack qname df << 
379   qTrackCountCmd->SetGuidance("  qname  :(Stri << 
380   qTrackCountCmd->SetGuidance("  dflag  :(Int) << 
381   qTrackCountCmd->SetGuidance("         : 0 =  << 
382   qTrackCountCmd->SetGuidance("         : 1 =  << 
383   qTrackCountCmd->SetGuidance("         : 2 =  << 
384   qTrackCountCmd->SetGuidance("  wflag  :(Bool << 
385   param = new G4UIparameter("qname", 's', fals << 
386   qTrackCountCmd->SetParameter(param);         << 
387   param = new G4UIparameter("dflag", 'i', true << 
388   param->SetDefaultValue("0");                 << 
389   qTrackCountCmd->SetParameter(param);         << 
390   param = new G4UIparameter("wflag", 'b', true << 
391   param->SetDefaultValue("false");             << 
392   qTrackCountCmd->SetParameter(param);         << 
393                                                << 
394   //                                           << 
395   qTerminationCmd = new G4UIcommand("/score/qu << 
396   qTerminationCmd->SetGuidance("Number of term << 
397   qTerminationCmd->SetGuidance(                << 
398     "[usage] /score/quantity/nOfTerminatedTrac << 
399   qTerminationCmd->SetGuidance("  qname  :(Str << 
400   qTerminationCmd->SetGuidance("  wflag  :(Boo << 
401   param = new G4UIparameter("qname", 's', fals << 
402   qTerminationCmd->SetParameter(param);        << 
403   param = new G4UIparameter("wflag", 'b', true << 
404   param->SetDefaultValue("false");             << 
405   qTerminationCmd->SetParameter(param);        << 
406                                                << 
407   //                                           << 
408   qMinKinEAtGeneCmd =                          << 
409     new G4UIcommand("/score/quantity/minKinEAt << 
410   qMinKinEAtGeneCmd->SetGuidance("Min Kinetic  << 
411   qMinKinEAtGeneCmd->SetGuidance(              << 
412     "[usage] /score/quantity/minKinEAtGenerati << 
413   qMinKinEAtGeneCmd->SetGuidance("  qname  :(S << 
414   qMinKinEAtGeneCmd->SetGuidance("  unit   :(S << 
415   param = new G4UIparameter("qname", 's', fals << 
416   qMinKinEAtGeneCmd->SetParameter(param);      << 
417   param = new G4UIparameter("unit", 's', true) << 
418   param->SetDefaultUnit("MeV");                << 
419   qMinKinEAtGeneCmd->SetParameter(param);      << 
420   //                                           << 
421   qStepCheckerCmd = new G4UIcommand("/score/qu << 
422   qStepCheckerCmd->SetGuidance("Display a comm << 
423   qStepCheckerCmd->SetGuidance("[usage] /score << 
424   qStepCheckerCmd->SetGuidance("  qname  :(Str << 
425   param = new G4UIparameter("qname", 's', fals << 
426   qStepCheckerCmd->SetParameter(param);        << 
427 }                                              << 
428                                                << 
429 void G4ScoreQuantityMessenger::FilterCommands(    123 void G4ScoreQuantityMessenger::FilterCommands()
430 {                                                 124 {
431   G4UIparameter* param;                           125   G4UIparameter* param;
432                                                   126 
433   //                                              127   //
434   // Filter commands                           << 128   // Filter commands 
435   filterDir = new G4UIdirectory("/score/filter    129   filterDir = new G4UIdirectory("/score/filter/");
436   filterDir->SetGuidance("  Scoring filter com    130   filterDir->SetGuidance("  Scoring filter commands.");
437   //                                              131   //
438   fchargedCmd = new G4UIcmdWithAString("/score << 132   fchargedCmd = new G4UIcmdWithAString("/score/filter/charged",this);
439   fchargedCmd->SetGuidance("Charged particle f    133   fchargedCmd->SetGuidance("Charged particle filter.");
440   fchargedCmd->SetParameterName("fname", false << 134   fchargedCmd->SetParameterName("fname",false);
441   //                                              135   //
442   fneutralCmd = new G4UIcmdWithAString("/score << 136   fneutralCmd = new G4UIcmdWithAString("/score/filter/neutral",this);
443   fneutralCmd->SetGuidance("Neutral particle f    137   fneutralCmd->SetGuidance("Neutral particle filter.");
444   fneutralCmd->SetParameterName("fname", false << 138   fneutralCmd->SetParameterName("fname",false);
445   //                                              139   //
446   fkinECmd = new G4UIcommand("/score/filter/ki << 140   fkinECmd = new G4UIcommand("/score/filter/kineticEnergy",this);
447   fkinECmd->SetGuidance("Kinetic energy filter    141   fkinECmd->SetGuidance("Kinetic energy filter.");
448   fkinECmd->SetGuidance(                       << 142   fkinECmd->SetGuidance("[usage] /score/filter/kineticEnergy fname Elow Ehigh unit");
449     "[usage] /score/filter/kineticEnergy fname << 
450   fkinECmd->SetGuidance("  fname     :(String)    143   fkinECmd->SetGuidance("  fname     :(String) Filter Name ");
451   fkinECmd->SetGuidance("  Elow      :(Double)    144   fkinECmd->SetGuidance("  Elow      :(Double) Lower edge of kinetic energy");
452   fkinECmd->SetGuidance("  Ehigh     :(Double)    145   fkinECmd->SetGuidance("  Ehigh     :(Double) Higher edge of kinetic energy");
453   fkinECmd->SetGuidance("  unit      :(String)    146   fkinECmd->SetGuidance("  unit      :(String) unit of given kinetic energy");
454   param = new G4UIparameter("fname", 's', fals << 147   param = new G4UIparameter("fname",'s',false);
455   fkinECmd->SetParameter(param);                  148   fkinECmd->SetParameter(param);
456   param = new G4UIparameter("elow", 'd', true) << 149   param = new G4UIparameter("elow",'d',true);
457   param->SetDefaultValue("0.0");                  150   param->SetDefaultValue("0.0");
458   fkinECmd->SetParameter(param);                  151   fkinECmd->SetParameter(param);
459   param = new G4UIparameter("ehigh", 'd', true << 152   param = new G4UIparameter("ehigh",'d',true);
460   fkinECmd->SetParameter(param);                  153   fkinECmd->SetParameter(param);
461   G4String smax = DtoS(DBL_MAX);                  154   G4String smax = DtoS(DBL_MAX);
462   param->SetDefaultValue(smax);                   155   param->SetDefaultValue(smax);
463   param = new G4UIparameter("unit", 's', true) << 156   param = new G4UIparameter("unit",'s',true);
464   param->SetDefaultUnit("keV");                   157   param->SetDefaultUnit("keV");
465   fkinECmd->SetParameter(param);                  158   fkinECmd->SetParameter(param);
466   //                                              159   //
467   fparticleCmd = new G4UIcommand("/score/filte << 160   fparticleCmd = new G4UIcommand("/score/filter/particle",this);
468   fparticleCmd->SetGuidance("Particle filter."    161   fparticleCmd->SetGuidance("Particle filter.");
469   fparticleCmd->SetGuidance("[usage] /score/fi    162   fparticleCmd->SetGuidance("[usage] /score/filter/particle fname p0 .. pn");
470   fparticleCmd->SetGuidance("  fname     :(Str    163   fparticleCmd->SetGuidance("  fname     :(String) Filter Name ");
471   fparticleCmd->SetGuidance("  p0 .. pn  :(Str    164   fparticleCmd->SetGuidance("  p0 .. pn  :(String) particle names");
472   param = new G4UIparameter("fname", 's', fals << 165   param = new G4UIparameter("fname",'s',false);
473   fparticleCmd->SetParameter(param);              166   fparticleCmd->SetParameter(param);
474   param = new G4UIparameter("particlelist", 's << 167   param = new G4UIparameter("particlelist",'s',false);
475   param->SetDefaultValue("");                     168   param->SetDefaultValue("");
476   fparticleCmd->SetParameter(param);              169   fparticleCmd->SetParameter(param);
477   //                                              170   //
478   //                                              171   //
479   //                                              172   //
480   fparticleKinECmd =                           << 173   fparticleKinECmd = new G4UIcommand("/score/filter/particleWithKineticEnergy",this);
481     new G4UIcommand("/score/filter/particleWit << 
482   fparticleKinECmd->SetGuidance("Particle with    174   fparticleKinECmd->SetGuidance("Particle with kinetic energy filter.");
483   fparticleKinECmd->SetGuidance(               << 175   fparticleKinECmd->SetGuidance("[usage] /score/filter/particleWithKineticEnergy fname Elow Ehigh unit p0 .. pn");
484     "[usage] /score/filter/particleWithKinetic << 
485     ".. pn");                                  << 
486   fparticleKinECmd->SetGuidance("  fname     :    176   fparticleKinECmd->SetGuidance("  fname     :(String) Filter Name ");
487   fparticleKinECmd->SetGuidance(               << 177   fparticleKinECmd->SetGuidance("  Elow      :(Double) Lower edge of kinetic energy");
488     "  Elow      :(Double) Lower edge of kinet << 178   fparticleKinECmd->SetGuidance("  Ehigh     :(Double) Higher edge of kinetic energy");
489   fparticleKinECmd->SetGuidance(               << 179   fparticleKinECmd->SetGuidance("  unit      :(String) unit of given kinetic energy");
490     "  Ehigh     :(Double) Higher edge of kine << 
491   fparticleKinECmd->SetGuidance(               << 
492     "  unit      :(String) unit of given kinet << 
493   fparticleKinECmd->SetGuidance("  p0 .. pn  :    180   fparticleKinECmd->SetGuidance("  p0 .. pn  :(String) particle names");
494   param = new G4UIparameter("fname", 's', fals << 181   param = new G4UIparameter("fname",'s',false);
495   fparticleKinECmd->SetParameter(param);          182   fparticleKinECmd->SetParameter(param);
496   param = new G4UIparameter("elow", 'd', false << 183   param = new G4UIparameter("elow",'d',false);
497   param->SetDefaultValue("0.0");                  184   param->SetDefaultValue("0.0");
498   fparticleKinECmd->SetParameter(param);          185   fparticleKinECmd->SetParameter(param);
499   param = new G4UIparameter("ehigh", 'd', true << 186   param = new G4UIparameter("ehigh",'d',true);
500   param->SetDefaultValue(smax);                   187   param->SetDefaultValue(smax);
501   fparticleKinECmd->SetParameter(param);          188   fparticleKinECmd->SetParameter(param);
502   param = new G4UIparameter("unit", 's', true) << 189   param = new G4UIparameter("unit",'s',true);
503   param->SetDefaultUnit("keV");                   190   param->SetDefaultUnit("keV");
504   fparticleKinECmd->SetParameter(param);          191   fparticleKinECmd->SetParameter(param);
505   param = new G4UIparameter("particlelist", 's << 192   param = new G4UIparameter("particlelist",'s',false);
506   param->SetDefaultValue("");                     193   param->SetDefaultValue("");
507   fparticleKinECmd->SetParameter(param);          194   fparticleKinECmd->SetParameter(param);
508   //                                              195   //
509   //                                              196   //
510 }                                                 197 }
511                                                   198 
512 G4ScoreQuantityMessenger::~G4ScoreQuantityMess    199 G4ScoreQuantityMessenger::~G4ScoreQuantityMessenger()
513 {                                                 200 {
514   delete quantityDir;                          << 201     delete         quantityDir;
515   delete qTouchCmd;                            << 202     delete         qTouchCmd;
516   delete qGetUnitCmd;                          << 203     delete         qGetUnitCmd;
517   delete qSetUnitCmd;                          << 204     delete         qSetUnitCmd;
518                                                   205 
519   //                                           << 206     //
520   delete qCellChgCmd;                          << 207     delete    qCellChgCmd;
521   delete qCellFluxCmd;                         << 208     delete    qCellFluxCmd;
522   delete qPassCellFluxCmd;                     << 209     delete    qPassCellFluxCmd;
523   delete qeDepCmd;                             << 210     delete    qeDepCmd;
524   delete qdoseDepCmd;                          << 211     delete    qdoseDepCmd;
525   delete qnOfStepCmd;                          << 212     delete    qnOfStepCmd;
526   delete qnOfSecondaryCmd;                     << 213     delete    qnOfSecondaryCmd;
527   //                                           << 214     //
528   delete qTrackLengthCmd;                      << 215     delete          qTrackLengthCmd;
529   delete qPassCellCurrCmd;                     << 216     delete          qPassCellCurrCmd;
530   delete qPassTrackLengthCmd;                  << 217     delete          qPassTrackLengthCmd;
531   delete qFlatSurfCurrCmd;                     << 218     delete          qFlatSurfCurrCmd;
532   delete qFlatSurfFluxCmd;                     << 219     delete          qFlatSurfFluxCmd;
533   delete qVolFluxCmd;                          << 220 //    delete          qSphereSurfCurrCmd;
534                                                << 221 //    delete          qSphereSurfFluxCmd;
535   delete qNofCollisionCmd;                     << 222 //    delete          qCylSurfCurrCmd;
536   delete qPopulationCmd;                       << 223 //    delete          qCylSurfFluxCmd;
537   delete qTrackCountCmd;                       << 224     delete          qNofCollisionCmd;
538   delete qTerminationCmd;                      << 225     delete          qPopulationCmd;
539   delete qMinKinEAtGeneCmd;                    << 226     delete          qTrackCountCmd;
540   //                                           << 227     delete          qTerminationCmd;
541   delete qStepCheckerCmd;                      << 228     delete          qMinKinEAtGeneCmd;
542   //                                           << 229     //
543   delete filterDir;                            << 230     delete          qStepCheckerCmd;
544   delete fchargedCmd;                          << 231     //
545   delete fneutralCmd;                          << 232     delete   filterDir;
546   delete fkinECmd;                             << 233     delete   fchargedCmd;
547   delete fparticleCmd;                         << 234     delete   fneutralCmd;
548   delete fparticleKinECmd;                     << 235     delete   fkinECmd;
                                                   >> 236     delete   fparticleCmd;
                                                   >> 237     delete   fparticleKinECmd;
549 }                                                 238 }
550                                                   239 
551 void G4ScoreQuantityMessenger::SetNewValue(G4U << 240 void G4ScoreQuantityMessenger::SetNewValue(G4UIcommand * command,G4String newVal)
552                                            G4S << 
553 {                                                 241 {
554   using MeshShape = G4VScoringMesh::MeshShape; << 242       using MeshShape = G4VScoringMesh::MeshShape;
555                                                   243 
556   G4ExceptionDescription ed;                   << 244       G4ExceptionDescription ed;
557                                                   245 
558   //                                           << 246       //
559   // Get Current Mesh                          << 247       // Get Current Mesh
560   //                                           << 248       //
561   G4VScoringMesh* mesh = fSMan->GetCurrentMesh << 249       G4VScoringMesh* mesh = fSMan->GetCurrentMesh();
562   if(mesh == nullptr)                          << 250       if(!mesh)
563   {                                            << 
564     ed << "ERROR : No mesh is currently open.  << 
565           "Command ignored.";                  << 
566     command->CommandFailed(ed);                << 
567     return;                                    << 
568   }                                            << 
569   // Mesh type                                 << 
570   auto shape = mesh->GetShape();               << 
571   // Tokens                                    << 
572   G4TokenVec token;                            << 
573   FillTokenVec(newVal, token);                 << 
574   //                                           << 
575   // Commands for Current Mesh                 << 
576   if(command == qTouchCmd)                     << 
577   {                                            << 
578     mesh->SetCurrentPrimitiveScorer(newVal);   << 
579   }                                            << 
580   else if(command == qGetUnitCmd)              << 
581   {                                            << 
582     G4cout << "Unit:  " << mesh->GetCurrentPSU << 
583   }                                            << 
584   else if(command == qSetUnitCmd)              << 
585   {                                            << 
586     mesh->SetCurrentPSUnit(newVal);            << 
587   }                                            << 
588   else if(command == qCellChgCmd)              << 
589   {                                            << 
590     if(CheckMeshPS(mesh, token[0], command))   << 
591     {                                          << 
592       G4PSCellCharge* ps = nullptr;            << 
593       if(shape == MeshShape::realWorldLogVol | << 
594       {                                        << 
595         ps = new G4PSCellCharge(token[0], mesh << 
596       }                                        << 
597       else                                     << 
598       {                                        << 
599         ps = new G4PSCellCharge3D(token[0]);   << 
600       }                                        << 
601       ps->SetUnit(token[1]);                   << 
602       mesh->SetPrimitiveScorer(ps);            << 
603     }                                          << 
604   }                                            << 
605   else if(command == qCellFluxCmd)             << 
606   {                                            << 
607     if(CheckMeshPS(mesh, token[0], command))   << 
608     {                                          << 
609       G4PSCellFlux* ps = nullptr;              << 
610       if(shape == MeshShape::box)              << 
611       {                                           251       {
612         ps = new G4PSCellFlux3D(token[0]);     << 252         ed << "ERROR : No mesh is currently open. Open/create a mesh first. Command ignored.";
613       }                                        << 
614       else if(shape == MeshShape::cylinder)    << 
615       {                                        << 
616         auto  pps =                            << 
617           new G4PSCellFluxForCylinder3D(token[ << 
618         pps->SetCylinderSize(mesh->GetSize(),m << 
619         G4int nSeg[3];                         << 
620         mesh->GetNumberOfSegments(nSeg);       << 
621         pps->SetNumberOfSegments(nSeg);        << 
622         ps = pps;                              << 
623       }                                        << 
624       else if(shape == MeshShape::realWorldLog << 
625       {                                        << 
626         ed << "Cell flux for real world volume << 
627               "ignored.";                      << 
628         command->CommandFailed(ed);               253         command->CommandFailed(ed);
629         return;                                   254         return;
630       }                                           255       }
631       else if(shape == MeshShape::probe)       << 256       // Mesh type
632       {                                        << 257       auto shape = mesh->GetShape();
633         ps = new G4PSCellFlux(token[0]);       << 258       // Tokens
634       }                                        << 259       G4TokenVec token;
635       ps->SetUnit(token[1]);                   << 260       FillTokenVec(newVal,token);
636       mesh->SetPrimitiveScorer(ps);            << 261       //
637     }                                          << 262       // Commands for Current Mesh
638   }                                            << 263       if(command==qTouchCmd) {
639   else if(command == qPassCellFluxCmd)         << 264               mesh->SetCurrentPrimitiveScorer(newVal);
640   {                                            << 265       } else if(command == qGetUnitCmd ){
641     if(CheckMeshPS(mesh, token[0], command))   << 266           G4cout << "Unit:  "<< mesh->GetCurrentPSUnit() <<G4endl;
642     {                                          << 267       } else if(command == qSetUnitCmd ){
643       G4PSPassageCellFlux* ps = nullptr;       << 268           mesh->SetCurrentPSUnit(newVal);
644       if(shape == MeshShape::box)              << 269       } else if(command== qCellChgCmd) {
645       {                                        << 270           if ( CheckMeshPS(mesh,token[0],command) ){
646         ps = new G4PSPassageCellFlux3D(token[0 << 271               G4PSCellCharge* ps = nullptr;
647       }                                        << 272               if(shape==MeshShape::realWorldLogVol)
648       else if(shape == MeshShape::cylinder)    << 273               { ps = new G4PSCellCharge(token[0],mesh->GetCopyNumberLevel()); }
649       {                                        << 274               else
650         auto  pps =                            << 275               { ps = new G4PSCellCharge3D(token[0]); }
651           new G4PSPassageCellFluxForCylinder3D << 276               ps->SetUnit(token[1]);
652         pps->SetCylinderSize(mesh->GetSize(),m << 277               mesh->SetPrimitiveScorer(ps);
653         G4int nSeg[3];                         << 278           }
654         mesh->GetNumberOfSegments(nSeg);       << 279       } else if(command== qCellFluxCmd) {
655         pps->SetNumberOfSegments(nSeg);        << 280           if ( CheckMeshPS(mesh,token[0],command) ){
656         ps = pps;                              << 281             G4PSCellFlux* ps = nullptr;
657       }                                        << 282             if( shape==MeshShape::box ) {
658       else if(shape == MeshShape::realWorldLog << 283               ps = new G4PSCellFlux3D(token[0]);
659       {                                        << 284             } else if( shape==MeshShape::cylinder ) {
660         ed << "Passing cell flux for real worl << 285               G4PSCellFluxForCylinder3D* pps = new G4PSCellFluxForCylinder3D(token[0]);
661               "Command ignored.";              << 286               G4ThreeVector msize = mesh->GetSize(); // gevin in R Z N/A
662         command->CommandFailed(ed);            << 287               pps->SetCylinderSize(msize[0],msize[1]); // given in dr dz
663         return;                                << 288               G4int nSeg[3];
664       }                                        << 289               mesh->GetNumberOfSegments(nSeg);
665       else if(shape == MeshShape::probe)       << 290               pps->SetNumberOfSegments(nSeg);
666       {                                        << 291               ps = pps;
667         ps = new G4PSPassageCellFlux(token[0]) << 292             } else if(shape==MeshShape::realWorldLogVol) {
668       }                                        << 293               ed<<"Cell flux for real world volume is not yet supported. Command ignored.";
669       ps->SetUnit(token[1]);                   << 294               command->CommandFailed(ed);
670       mesh->SetPrimitiveScorer(ps);            << 295               return;
671     }                                          << 296             }
672   }                                            << 297             ps->SetUnit(token[1]);
673   else if(command == qeDepCmd)                 << 298             mesh->SetPrimitiveScorer(ps);
674   {                                            << 299           }
675     if(CheckMeshPS(mesh, token[0], command))   << 300       } else if(command== qPassCellFluxCmd) {
676     {                                          << 301           if ( CheckMeshPS(mesh,token[0],command) ){
677       G4PSEnergyDeposit* ps = nullptr;         << 302             G4PSPassageCellFlux* ps = nullptr;
678       if(shape == MeshShape::realWorldLogVol | << 303             if( shape==MeshShape::box ) {
679       {                                        << 304               ps = new G4PSPassageCellFlux3D(token[0]);
680         ps = new G4PSEnergyDeposit(token[0], m << 305             } else if( shape==MeshShape::cylinder ) {
681       }                                        << 306               G4PSPassageCellFluxForCylinder3D* pps = new G4PSPassageCellFluxForCylinder3D(token[0]);
682       else                                     << 307               G4ThreeVector msize = mesh->GetSize();  // gevin in R Z N/A
683       {                                        << 308               pps->SetCylinderSize(msize[0],msize[1]); // given in dr dz
684         ps = new G4PSEnergyDeposit3D(token[0]) << 309               G4int nSeg[3];
685       }                                        << 310               mesh->GetNumberOfSegments(nSeg);
686       ps->SetUnit(token[1]);                   << 311               pps->SetNumberOfSegments(nSeg);
687       mesh->SetPrimitiveScorer(ps);            << 312               ps = pps;
688     }                                          << 313             } else if(shape==MeshShape::realWorldLogVol) {
689   }                                            << 314               ed<<"Passing cell flux for real world volume is not yet supported. Command ignored.";
690   else if(command == qdoseDepCmd)              << 315               command->CommandFailed(ed);
691   {                                            << 316               return;
692     if(CheckMeshPS(mesh, token[0], command))   << 317             }
693     {                                          << 318             ps->SetUnit(token[1]);
694       G4PSDoseDeposit* ps = nullptr;           << 319             mesh->SetPrimitiveScorer(ps);
695       if(shape == MeshShape::box)              << 320           }
696       {                                        << 321       } else if(command==qeDepCmd) {
697         ps = new G4PSDoseDeposit3D(token[0]);  << 322           if ( CheckMeshPS(mesh,token[0],command) ){
698       }                                        << 323               G4PSEnergyDeposit* ps = nullptr;
699       else if(shape == MeshShape::cylinder)    << 324               if(shape==MeshShape::realWorldLogVol)
700       {                                        << 325               { ps =new G4PSEnergyDeposit(token[0],mesh->GetCopyNumberLevel()); }
701         auto  pps =                            << 326               else
702           new G4PSDoseDepositForCylinder3D(tok << 327               { ps =new G4PSEnergyDeposit3D(token[0]); }
703         pps->SetUnit(token[1]);                << 328               ps->SetUnit(token[1]);
704         pps->SetCylinderSize(mesh->GetSize(),m << 329               mesh->SetPrimitiveScorer(ps);
705         G4int nSeg[3];                         << 330           }
706         mesh->GetNumberOfSegments(nSeg);       << 331       } else if(command== qdoseDepCmd) {
707         pps->SetNumberOfSegments(nSeg);        << 332           if ( CheckMeshPS(mesh,token[0],command) ){
708         ps = pps;                              << 333             G4PSDoseDeposit* ps = nullptr;
709       }                                        << 334             if( shape==MeshShape::box ) {
710       else if(shape == MeshShape::realWorldLog << 335               ps = new G4PSDoseDeposit3D(token[0]);
711       {                                        << 336             } else if( shape==MeshShape::cylinder ) {
712         ps = new G4PSDoseDeposit(token[0], mes << 337               G4PSDoseDepositForCylinder3D* pps = new G4PSDoseDepositForCylinder3D(token[0]);
713       }                                        << 338               pps->SetUnit(token[1]);
714       ps->SetUnit(token[1]);                   << 339               G4ThreeVector msize = mesh->GetSize(); // gevin in R Z N/A
715       mesh->SetPrimitiveScorer(ps);            << 340               pps->SetCylinderSize(msize[0],msize[1]); // given in dr dz
716     }                                          << 341               G4int nSeg[3];
717   }                                            << 342               mesh->GetNumberOfSegments(nSeg);
718   else if(command == qnOfStepCmd)              << 343               pps->SetNumberOfSegments(nSeg);
719   {                                            << 344               ps = pps;
720     if(CheckMeshPS(mesh, token[0], command))   << 345             } else if(shape==MeshShape::realWorldLogVol) {
721     {                                          << 346               ps = new G4PSDoseDeposit(token[0],mesh->GetCopyNumberLevel());
722       G4PSNofStep* ps = nullptr;               << 347             }
723       if(shape == MeshShape::realWorldLogVol | << 348             ps->SetUnit(token[1]);
724       {                                        << 349             mesh->SetPrimitiveScorer(ps);
725         ps = new G4PSNofStep(token[0], mesh->G << 350           }
726       }                                        << 351       } else if(command== qnOfStepCmd) {
727       else                                     << 352           if ( CheckMeshPS(mesh,token[0],command) ){
728       {                                        << 353               G4PSNofStep* ps = nullptr;
729         ps = new G4PSNofStep3D(token[0]);      << 354               if(shape==MeshShape::realWorldLogVol)
730       }                                        << 355               { ps = new G4PSNofStep(token[0],mesh->GetCopyNumberLevel()); }
731       ps->SetBoundaryFlag(StoB(token[1]));     << 356               else
732       mesh->SetPrimitiveScorer(ps);            << 357               { ps = new G4PSNofStep3D(token[0]); }
733     }                                          << 358               ps->SetBoundaryFlag(StoB(token[1]));
734   }                                            << 359               mesh->SetPrimitiveScorer(ps);
735   else if(command == qnOfSecondaryCmd)         << 360           }
736   {                                            << 361       } else if(command== qnOfSecondaryCmd) {
737     if(CheckMeshPS(mesh, token[0], command))   << 362           if ( CheckMeshPS(mesh,token[0],command) ){
738     {                                          << 363               G4PSNofSecondary* ps = nullptr;
739       G4PSNofSecondary* ps = nullptr;          << 364               if(shape==MeshShape::realWorldLogVol)
740       if(shape == MeshShape::realWorldLogVol | << 365               { ps = new G4PSNofSecondary(token[0],mesh->GetCopyNumberLevel()); }
741       {                                        << 366               else
742         ps = new G4PSNofSecondary(token[0], me << 367               { ps = new G4PSNofSecondary3D(token[0]); }
743       }                                        << 368               mesh->SetPrimitiveScorer(ps);
744       else                                     << 369           }
745       {                                        << 370       } else if(command== qTrackLengthCmd) {
746         ps = new G4PSNofSecondary3D(token[0]); << 371           if ( CheckMeshPS(mesh,token[0],command) ){
747       }                                        << 372               G4PSTrackLength* ps = nullptr;
748       mesh->SetPrimitiveScorer(ps);            << 373               if(shape==MeshShape::realWorldLogVol)
749     }                                          << 374               { ps = new G4PSTrackLength(token[0],mesh->GetCopyNumberLevel()); }
750   }                                            << 375               else
751   else if(command == qTrackLengthCmd)          << 376               { ps = new G4PSTrackLength3D(token[0]); }
752   {                                            << 377               ps->Weighted(StoB(token[1]));
753     if(CheckMeshPS(mesh, token[0], command))   << 378               ps->MultiplyKineticEnergy(StoB(token[2]));
754     {                                          << 379               ps->DivideByVelocity(StoB(token[3]));
755       G4PSTrackLength* ps = nullptr;           << 380               ps->SetUnit(token[4]);
756       if(shape == MeshShape::realWorldLogVol | << 381               mesh->SetPrimitiveScorer(ps);
757       {                                        << 382           }
758         ps = new G4PSTrackLength(token[0], mes << 383       } else if(command== qPassCellCurrCmd){
759       }                                        << 384           if( CheckMeshPS(mesh,token[0],command) ) {
760       else                                     << 385               G4PSPassageCellCurrent* ps = nullptr;
761       {                                        << 386               if(shape==MeshShape::realWorldLogVol)
762         ps = new G4PSTrackLength3D(token[0]);  << 387               { ps = new G4PSPassageCellCurrent(token[0],mesh->GetCopyNumberLevel()); }
763       }                                        << 388               else
764       ps->Weighted(StoB(token[1]));            << 389               { ps = new G4PSPassageCellCurrent3D(token[0]); }
765       ps->MultiplyKineticEnergy(StoB(token[2]) << 390               ps->Weighted(StoB(token[1]));
766       ps->DivideByVelocity(StoB(token[3]));    << 391               mesh->SetPrimitiveScorer(ps);
767       ps->SetUnit(token[4]);                   << 392           }
768       mesh->SetPrimitiveScorer(ps);            << 393       } else if(command== qPassTrackLengthCmd){
769     }                                          << 394           if( CheckMeshPS(mesh,token[0],command) ) {
770   }                                            << 395               G4PSPassageTrackLength* ps = nullptr;
771   else if(command == qPassCellCurrCmd)         << 396               if(shape==MeshShape::realWorldLogVol)
772   {                                            << 397               { ps = new G4PSPassageTrackLength(token[0],mesh->GetCopyNumberLevel()); }
773     if(CheckMeshPS(mesh, token[0], command))   << 398               else
774     {                                          << 399               { ps = new G4PSPassageTrackLength3D(token[0]); }
775       G4PSPassageCellCurrent* ps = nullptr;    << 400               ps->Weighted(StoB(token[1]));
776       if(shape == MeshShape::realWorldLogVol | << 401               ps->SetUnit(token[2]);
777       {                                        << 402               mesh->SetPrimitiveScorer(ps);
778         ps = new G4PSPassageCellCurrent(token[ << 403           }
                                                   >> 404       } else if(command== qFlatSurfCurrCmd){
                                                   >> 405           if( CheckMeshPS(mesh,token[0],command)) {
                                                   >> 406               G4PSFlatSurfaceCurrent* ps = nullptr;
                                                   >> 407               if(shape==MeshShape::realWorldLogVol)
                                                   >> 408               { ps = new G4PSFlatSurfaceCurrent(token[0],StoI(token[1]),mesh->GetCopyNumberLevel()); }
                                                   >> 409               else
                                                   >> 410               { ps = new G4PSFlatSurfaceCurrent3D(token[0],StoI(token[1])); }
                                                   >> 411               ps->Weighted(StoB(token[2]));
                                                   >> 412               ps->DivideByArea(StoB(token[3]));
                                                   >> 413               if ( StoB(token[3]) ){
                                                   >> 414                 ps->SetUnit(token[4]);
                                                   >> 415               }else{
                                                   >> 416                 ps->SetUnit("");
                                                   >> 417               }
                                                   >> 418               mesh->SetPrimitiveScorer(ps);
                                                   >> 419           }
                                                   >> 420       } else if(command== qFlatSurfFluxCmd){
                                                   >> 421           if( CheckMeshPS(mesh, token[0],command )) {
                                                   >> 422               G4PSFlatSurfaceFlux* ps = nullptr;
                                                   >> 423               if(shape==MeshShape::realWorldLogVol)
                                                   >> 424               { ps = new G4PSFlatSurfaceFlux(token[0],StoI(token[1]),mesh->GetCopyNumberLevel()); }
                                                   >> 425               else
                                                   >> 426               { ps = new G4PSFlatSurfaceFlux3D(token[0],StoI(token[1])); }
                                                   >> 427               ps->Weighted(StoB(token[2]));
                                                   >> 428               ps->DivideByArea(StoB(token[3]));
                                                   >> 429               if ( StoB(token[3]) ){
                                                   >> 430                 ps->SetUnit(token[4]);
                                                   >> 431               }else{
                                                   >> 432                 ps->SetUnit("");
                                                   >> 433               }
                                                   >> 434               mesh->SetPrimitiveScorer(ps);
                                                   >> 435           }
                                                   >> 436 //    } else if(command== qSphereSurfCurrCmd){
                                                   >> 437 //        if( CheckMeshPS(mesh, token[0],command )) {
                                                   >> 438 //            G4PSSphereSurfaceCurrent3D* ps = 
                                                   >> 439 //              new G4PSSphereSurfaceCurrent3D(token[0],StoI(token[1]));
                                                   >> 440 //            ps->Weighted(StoB(token[2]));
                                                   >> 441 //            ps->DivideByArea(StoB(token[3]));
                                                   >> 442 //            if ( StoB(token[3]) ){
                                                   >> 443 //              ps->SetUnit(token[4]);
                                                   >> 444 //            }else{
                                                   >> 445 //              ps->SetUnit("");
                                                   >> 446 //            }
                                                   >> 447 //            mesh->SetPrimitiveScorer(ps);
                                                   >> 448 //        }
                                                   >> 449 //   } else if(command== qSphereSurfFluxCmd){
                                                   >> 450 //        if( CheckMeshPS(mesh,token[0],command)) {
                                                   >> 451 //            G4PSSphereSurfaceFlux3D* ps = new G4PSSphereSurfaceFlux3D(token[0], StoI(token[1]));
                                                   >> 452 //            ps->Weighted(StoB(token[2]));
                                                   >> 453 //            ps->DivideByArea(StoB(token[3]));
                                                   >> 454 //            if ( StoB(token[3]) ){
                                                   >> 455 //              ps->SetUnit(token[4]);
                                                   >> 456 //            }else{
                                                   >> 457 //              ps->SetUnit("");
                                                   >> 458 //            }
                                                   >> 459 //            mesh->SetPrimitiveScorer(ps);
                                                   >> 460 //        }
                                                   >> 461 //   } else if(command== qCylSurfCurrCmd){
                                                   >> 462 //        if( CheckMeshPS(mesh, token[0],command ) ) {
                                                   >> 463 //            G4PSCylinderSurfaceCurrent3D* ps = 
                                                   >> 464 //              new G4PSCylinderSurfaceCurrent3D(token[0],StoI(token[1]));
                                                   >> 465 //            ps->Weighted(StoB(token[2]));
                                                   >> 466 //            ps->DivideByArea(StoB(token[3]));
                                                   >> 467 //            if ( StoB(token[3]) ){
                                                   >> 468 //              ps->SetUnit(token[4]);
                                                   >> 469 //            }else{
                                                   >> 470 //              ps->SetUnit("");
                                                   >> 471 //            }
                                                   >> 472 //            ps->SetUnit(token[4]);
                                                   >> 473 //            mesh->SetPrimitiveScorer(ps);
                                                   >> 474 //        }
                                                   >> 475 //   } else if(command== qCylSurfFluxCmd){
                                                   >> 476 //        if( CheckMeshPS(mesh, token[0],command ) {
                                                   >> 477 //            G4PSCylinerSurfaceFlux3D* ps =new G4PSCylinderSurfaceFlux3D(token[0], StoI(token[1]));
                                                   >> 478 //            ps->Weighted(StoB(token[2]));
                                                   >> 479 //            ps->DivideByArea(StoB(token[3]));
                                                   >> 480 //            if ( StoB(token[3]) ){
                                                   >> 481 //              ps->SetUnit(token[4]);
                                                   >> 482 //            }else{
                                                   >> 483 //              ps->SetUnit("");
                                                   >> 484 //            }
                                                   >> 485 //            mesh->SetPrimitiveScorer(ps);
                                                   >> 486 //        }
                                                   >> 487       } else if(command== qNofCollisionCmd){
                                                   >> 488           if( CheckMeshPS(mesh,token[0],command)) {
                                                   >> 489               G4PSNofCollision* ps = nullptr;
                                                   >> 490               if(shape==MeshShape::realWorldLogVol)
                                                   >> 491               { ps = new G4PSNofCollision3D(token[0],mesh->GetCopyNumberLevel()); }
                                                   >> 492               else
                                                   >> 493               { ps = new G4PSNofCollision3D(token[0]); }
                                                   >> 494               ps->Weighted(StoB(token[1]));
                                                   >> 495               mesh->SetPrimitiveScorer(ps);
                                                   >> 496           }
                                                   >> 497       } else if(command== qPopulationCmd){
                                                   >> 498           if( CheckMeshPS(mesh,token[0],command) ) {
                                                   >> 499               G4PSPopulation* ps = nullptr;
                                                   >> 500               if(shape==MeshShape::realWorldLogVol)
                                                   >> 501               { ps = new G4PSPopulation(token[0],mesh->GetCopyNumberLevel()); }
                                                   >> 502               else
                                                   >> 503               { ps = new G4PSPopulation3D(token[0]); }
                                                   >> 504               ps->Weighted(StoB(token[1]));
                                                   >> 505               mesh->SetPrimitiveScorer(ps);
                                                   >> 506           }
                                                   >> 507       } else if(command== qTrackCountCmd){
                                                   >> 508           if( CheckMeshPS(mesh,token[0],command)) {
                                                   >> 509               G4PSTrackCounter* ps = nullptr;
                                                   >> 510               if(shape==MeshShape::realWorldLogVol)
                                                   >> 511               { ps = new G4PSTrackCounter(token[0],StoI(token[1]),mesh->GetCopyNumberLevel()); }
                                                   >> 512               else
                                                   >> 513               { ps = new G4PSTrackCounter3D(token[0],StoI(token[1])); }
                                                   >> 514               ps->Weighted(StoB(token[2]));
                                                   >> 515               mesh->SetPrimitiveScorer(ps);
                                                   >> 516           }
                                                   >> 517       } else if(command== qTerminationCmd){
                                                   >> 518           if( CheckMeshPS(mesh,token[0],command)) {
                                                   >> 519               G4PSTermination* ps = nullptr;
                                                   >> 520               if(shape==MeshShape::realWorldLogVol)
                                                   >> 521               { ps = new G4PSTermination(token[0],mesh->GetCopyNumberLevel()); }
                                                   >> 522               else
                                                   >> 523               { ps = new G4PSTermination3D(token[0]); }
                                                   >> 524               ps->Weighted(StoB(token[1]));
                                                   >> 525               mesh->SetPrimitiveScorer(ps);
                                                   >> 526           }
                                                   >> 527 
                                                   >> 528       } else if(command== qMinKinEAtGeneCmd){
                                                   >> 529           if( CheckMeshPS(mesh,token[0],command) ){
                                                   >> 530               G4PSMinKinEAtGeneration* ps = nullptr;
                                                   >> 531               if(shape==MeshShape::realWorldLogVol)
                                                   >> 532               { ps = new G4PSMinKinEAtGeneration(token[0],mesh->GetCopyNumberLevel()); }
                                                   >> 533               else
                                                   >> 534               { ps = new G4PSMinKinEAtGeneration3D(token[0]); }
                                                   >> 535               ps->SetUnit(token[1]);
                                                   >> 536               mesh->SetPrimitiveScorer(ps);
                                                   >> 537           }
                                                   >> 538       } else if(command== qStepCheckerCmd){
                                                   >> 539           if( CheckMeshPS(mesh,token[0],command) ){
                                                   >> 540               G4PSStepChecker* ps = nullptr;
                                                   >> 541               if(shape==MeshShape::realWorldLogVol)
                                                   >> 542               { ps = new G4PSStepChecker(token[0],mesh->GetCopyNumberLevel()); }
                                                   >> 543               else
                                                   >> 544               { ps = new G4PSStepChecker3D(token[0]); }
                                                   >> 545               mesh->SetPrimitiveScorer(ps);
                                                   >> 546           }
                                                   >> 547 
                                                   >> 548             //
                                                   >> 549             // Filters 
                                                   >> 550             // 
                                                   >> 551       }else if(command== fchargedCmd){
                                                   >> 552             if(!mesh->IsCurrentPrimitiveScorerNull()) {
                                                   >> 553               mesh->SetFilter(new G4SDChargedFilter(token[0])); 
                                                   >> 554             } else {
                                                   >> 555               ed << "WARNING[" << fchargedCmd->GetCommandPath()
                                                   >> 556                  << "] : Current quantity is not set. Set or touch a quantity first.";
                                                   >> 557               command->CommandFailed(ed);
                                                   >> 558             }
                                                   >> 559       }else if(command== fneutralCmd){
                                                   >> 560             if(!mesh->IsCurrentPrimitiveScorerNull()) {
                                                   >> 561               mesh->SetFilter(new G4SDNeutralFilter(token[0])); 
                                                   >> 562             } else {
                                                   >> 563               ed << "WARNING[" << fneutralCmd->GetCommandPath()
                                                   >> 564                  << "] : Current quantity is not set. Set or touch a quantity first.";
                                                   >> 565               command->CommandFailed(ed);
                                                   >> 566             }
                                                   >> 567       }else if(command== fkinECmd){
                                                   >> 568             if(!mesh->IsCurrentPrimitiveScorerNull()) {
                                                   >> 569               G4String& name = token[0];
                                                   >> 570               G4double elow  = StoD(token[1]);
                                                   >> 571               G4double ehigh = StoD(token[2]);
                                                   >> 572               G4double unitVal = G4UnitDefinition::GetValueOf(token[3]);
                                                   >> 573               mesh->SetFilter(new G4SDKineticEnergyFilter(name,elow*unitVal,ehigh*unitVal));
                                                   >> 574             } else {
                                                   >> 575               ed << "WARNING[" << fkinECmd->GetCommandPath()
                                                   >> 576                  << "] : Current quantity is not set. Set or touch a quantity first.";
                                                   >> 577               command->CommandFailed(ed);
                                                   >> 578             }
                                                   >> 579       }else if(command== fparticleKinECmd){
                                                   >> 580             if(!mesh->IsCurrentPrimitiveScorerNull()) {
                                                   >> 581               FParticleWithEnergyCommand(mesh,token); 
                                                   >> 582             } else {
                                                   >> 583               ed << "WARNING[" << fparticleKinECmd->GetCommandPath()
                                                   >> 584                  << "] : Current quantity is not set. Set or touch a quantity first.";
                                                   >> 585               command->CommandFailed(ed);
                                                   >> 586             }
                                                   >> 587       } else if(command==fparticleCmd) {
                                                   >> 588             if(!mesh->IsCurrentPrimitiveScorerNull()) {
                                                   >> 589               FParticleCommand(mesh,token);
                                                   >> 590             } else {
                                                   >> 591               ed << "WARNING[" << fparticleCmd->GetCommandPath()
                                                   >> 592                  << "] : Current quantity is not set. Set or touch a quantity first.";
                                                   >> 593               command->CommandFailed(ed);
                                                   >> 594             }
779       }                                           595       }
780       else                                     << 
781       {                                        << 
782         ps = new G4PSPassageCellCurrent3D(toke << 
783       }                                        << 
784       ps->Weighted(StoB(token[1]));            << 
785       mesh->SetPrimitiveScorer(ps);            << 
786     }                                          << 
787   }                                            << 
788   else if(command == qPassTrackLengthCmd)      << 
789   {                                            << 
790     if(CheckMeshPS(mesh, token[0], command))   << 
791     {                                          << 
792       G4PSPassageTrackLength* ps = nullptr;    << 
793       if(shape == MeshShape::realWorldLogVol | << 
794       {                                        << 
795         ps = new G4PSPassageTrackLength(token[ << 
796       }                                        << 
797       else                                     << 
798       {                                        << 
799         ps = new G4PSPassageTrackLength3D(toke << 
800       }                                        << 
801       ps->Weighted(StoB(token[1]));            << 
802       ps->SetUnit(token[2]);                   << 
803       mesh->SetPrimitiveScorer(ps);            << 
804     }                                          << 
805   }                                            << 
806   else if(command == qFlatSurfCurrCmd)         << 
807   {                                            << 
808     if(CheckMeshPS(mesh, token[0], command))   << 
809     {                                          << 
810       G4PSFlatSurfaceCurrent* ps = nullptr;    << 
811       if(shape == MeshShape::realWorldLogVol | << 
812       {                                        << 
813         ps = new G4PSFlatSurfaceCurrent(token[ << 
814                                         mesh-> << 
815       }                                        << 
816       else                                     << 
817       {                                        << 
818         ps = new G4PSFlatSurfaceCurrent3D(toke << 
819       }                                        << 
820       ps->Weighted(StoB(token[2]));            << 
821       ps->DivideByArea(StoB(token[3]));        << 
822       if(StoB(token[3]))                       << 
823       {                                        << 
824         ps->SetUnit(token[4]);                 << 
825       }                                        << 
826       else                                     << 
827       {                                        << 
828         ps->SetUnit("");                       << 
829       }                                        << 
830       mesh->SetPrimitiveScorer(ps);            << 
831     }                                          << 
832   }                                            << 
833   else if(command == qFlatSurfFluxCmd)         << 
834   {                                            << 
835     if(CheckMeshPS(mesh, token[0], command))   << 
836     {                                          << 
837       G4PSFlatSurfaceFlux* ps = nullptr;       << 
838       if(shape == MeshShape::realWorldLogVol | << 
839       {                                        << 
840         ps = new G4PSFlatSurfaceFlux(token[0], << 
841                                      mesh->Get << 
842       }                                        << 
843       else                                     << 
844       {                                        << 
845         ps = new G4PSFlatSurfaceFlux3D(token[0 << 
846       }                                        << 
847       ps->Weighted(StoB(token[2]));            << 
848       ps->DivideByArea(StoB(token[3]));        << 
849       if(StoB(token[3]))                       << 
850       {                                        << 
851         ps->SetUnit(token[4]);                 << 
852       }                                        << 
853       else                                     << 
854       {                                        << 
855         ps->SetUnit("");                       << 
856       }                                        << 
857       mesh->SetPrimitiveScorer(ps);            << 
858     }                                          << 
859   }                                            << 
860   else if(command == qVolFluxCmd)              << 
861   {                                            << 
862     if(CheckMeshPS(mesh, token[0], command))   << 
863     {                                          << 
864       G4PSVolumeFlux* ps = nullptr;            << 
865       if(shape == MeshShape::realWorldLogVol | << 
866       {                                        << 
867         ps = new G4PSVolumeFlux(token[0], StoI << 
868                                 mesh->GetCopyN << 
869       }                                        << 
870       else                                     << 
871       {                                        << 
872         ps = new G4PSVolumeFlux3D(token[0], St << 
873       }                                        << 
874       ps->SetDivCos(StoI(token[1]) != 0);      << 
875       mesh->SetPrimitiveScorer(ps);            << 
876     }                                          << 
877   }                                            << 
878   else if(command == qNofCollisionCmd)         << 
879   {                                            << 
880     if(CheckMeshPS(mesh, token[0], command))   << 
881     {                                          << 
882       G4PSNofCollision* ps = nullptr;          << 
883       if(shape == MeshShape::realWorldLogVol | << 
884       {                                        << 
885         ps = new G4PSNofCollision3D(token[0],  << 
886       }                                        << 
887       else                                     << 
888       {                                        << 
889         ps = new G4PSNofCollision3D(token[0]); << 
890       }                                        << 
891       ps->Weighted(StoB(token[1]));            << 
892       mesh->SetPrimitiveScorer(ps);            << 
893     }                                          << 
894   }                                            << 
895   else if(command == qPopulationCmd)           << 
896   {                                            << 
897     if(CheckMeshPS(mesh, token[0], command))   << 
898     {                                          << 
899       G4PSPopulation* ps = nullptr;            << 
900       if(shape == MeshShape::realWorldLogVol | << 
901       {                                        << 
902         ps = new G4PSPopulation(token[0], mesh << 
903       }                                        << 
904       else                                     << 
905       {                                        << 
906         ps = new G4PSPopulation3D(token[0]);   << 
907       }                                        << 
908       ps->Weighted(StoB(token[1]));            << 
909       mesh->SetPrimitiveScorer(ps);            << 
910     }                                          << 
911   }                                            << 
912   else if(command == qTrackCountCmd)           << 
913   {                                            << 
914     if(CheckMeshPS(mesh, token[0], command))   << 
915     {                                          << 
916       G4PSTrackCounter* ps = nullptr;          << 
917       if(shape == MeshShape::realWorldLogVol | << 
918       {                                        << 
919         ps = new G4PSTrackCounter(token[0], St << 
920                                   mesh->GetCop << 
921       }                                        << 
922       else                                     << 
923       {                                        << 
924         ps = new G4PSTrackCounter3D(token[0],  << 
925       }                                        << 
926       ps->Weighted(StoB(token[2]));            << 
927       mesh->SetPrimitiveScorer(ps);            << 
928     }                                          << 
929   }                                            << 
930   else if(command == qTerminationCmd)          << 
931   {                                            << 
932     if(CheckMeshPS(mesh, token[0], command))   << 
933     {                                          << 
934       G4PSTermination* ps = nullptr;           << 
935       if(shape == MeshShape::realWorldLogVol | << 
936       {                                        << 
937         ps = new G4PSTermination(token[0], mes << 
938       }                                        << 
939       else                                     << 
940       {                                        << 
941         ps = new G4PSTermination3D(token[0]);  << 
942       }                                        << 
943       ps->Weighted(StoB(token[1]));            << 
944       mesh->SetPrimitiveScorer(ps);            << 
945     }                                          << 
946   }                                            << 
947   else if(command == qMinKinEAtGeneCmd)        << 
948   {                                            << 
949     if(CheckMeshPS(mesh, token[0], command))   << 
950     {                                          << 
951       G4PSMinKinEAtGeneration* ps = nullptr;   << 
952       if(shape == MeshShape::realWorldLogVol | << 
953       {                                        << 
954         ps = new G4PSMinKinEAtGeneration(token << 
955       }                                        << 
956       else                                     << 
957       {                                        << 
958         ps = new G4PSMinKinEAtGeneration3D(tok << 
959       }                                        << 
960       ps->SetUnit(token[1]);                   << 
961       mesh->SetPrimitiveScorer(ps);            << 
962     }                                          << 
963   }                                            << 
964   else if(command == qStepCheckerCmd)          << 
965   {                                            << 
966     if(CheckMeshPS(mesh, token[0], command))   << 
967     {                                          << 
968       G4PSStepChecker* ps = nullptr;           << 
969       if(shape == MeshShape::realWorldLogVol | << 
970       {                                        << 
971         ps = new G4PSStepChecker(token[0], mes << 
972       }                                        << 
973       else                                     << 
974       {                                        << 
975         ps = new G4PSStepChecker3D(token[0]);  << 
976       }                                        << 
977       mesh->SetPrimitiveScorer(ps);            << 
978     }                                          << 
979                                                << 
980     //                                         << 
981     // Filters                                 << 
982     //                                         << 
983   }                                            << 
984   else if(command == fchargedCmd)              << 
985   {                                            << 
986     if(!mesh->IsCurrentPrimitiveScorerNull())  << 
987     {                                          << 
988       mesh->SetFilter(new G4SDChargedFilter(to << 
989     }                                          << 
990     else                                       << 
991     {                                          << 
992       ed << "WARNING[" << fchargedCmd->GetComm << 
993          << "] : Current quantity is not set.  << 
994       command->CommandFailed(ed);              << 
995     }                                          << 
996   }                                            << 
997   else if(command == fneutralCmd)              << 
998   {                                            << 
999     if(!mesh->IsCurrentPrimitiveScorerNull())  << 
1000     {                                         << 
1001       mesh->SetFilter(new G4SDNeutralFilter(t << 
1002     }                                         << 
1003     else                                      << 
1004     {                                         << 
1005       ed << "WARNING[" << fneutralCmd->GetCom << 
1006          << "] : Current quantity is not set. << 
1007       command->CommandFailed(ed);             << 
1008     }                                         << 
1009   }                                           << 
1010   else if(command == fkinECmd)                << 
1011   {                                           << 
1012     if(!mesh->IsCurrentPrimitiveScorerNull()) << 
1013     {                                         << 
1014       G4String& name   = token[0];            << 
1015       G4double elow    = StoD(token[1]);      << 
1016       G4double ehigh   = StoD(token[2]);      << 
1017       G4double unitVal = G4UnitDefinition::Ge << 
1018       mesh->SetFilter(                        << 
1019         new G4SDKineticEnergyFilter(name, elo << 
1020     }                                         << 
1021     else                                      << 
1022     {                                         << 
1023       ed << "WARNING[" << fkinECmd->GetComman << 
1024          << "] : Current quantity is not set. << 
1025       command->CommandFailed(ed);             << 
1026     }                                         << 
1027   }                                           << 
1028   else if(command == fparticleKinECmd)        << 
1029   {                                           << 
1030     if(!mesh->IsCurrentPrimitiveScorerNull()) << 
1031     {                                         << 
1032       FParticleWithEnergyCommand(mesh, token) << 
1033     }                                         << 
1034     else                                      << 
1035     {                                         << 
1036       ed << "WARNING[" << fparticleKinECmd->G << 
1037          << "] : Current quantity is not set. << 
1038       command->CommandFailed(ed);             << 
1039     }                                         << 
1040   }                                           << 
1041   else if(command == fparticleCmd)            << 
1042   {                                           << 
1043     if(!mesh->IsCurrentPrimitiveScorerNull()) << 
1044     {                                         << 
1045       FParticleCommand(mesh, token);          << 
1046     }                                         << 
1047     else                                      << 
1048     {                                         << 
1049       ed << "WARNING[" << fparticleCmd->GetCo << 
1050          << "] : Current quantity is not set. << 
1051       command->CommandFailed(ed);             << 
1052     }                                         << 
1053   }                                           << 
1054 }                                                596 }
1055                                                  597 
1056 G4String G4ScoreQuantityMessenger::GetCurrent << 598 G4String G4ScoreQuantityMessenger::GetCurrentValue(G4UIcommand * /*command*/)
1057 {                                                599 {
1058   G4String val;                                  600   G4String val;
1059                                                  601 
1060   return val;                                    602   return val;
1061 }                                                603 }
1062                                                  604 
1063 void G4ScoreQuantityMessenger::FillTokenVec(c << 605 void G4ScoreQuantityMessenger::FillTokenVec(G4String newValues, G4TokenVec& token){
1064                                             G << 
1065 {                                             << 
1066   G4Tokenizer next(newValues);                << 
1067   G4String val;                               << 
1068   while(!(val = next()).empty())              << 
1069   {  // Loop checking 12.18.2015 M.Asai       << 
1070     token.push_back(val);                     << 
1071   }                                           << 
1072 }                                             << 
1073                                                  606 
1074 void G4ScoreQuantityMessenger::FParticleComma << 607     G4Tokenizer next(newValues);
1075                                               << 608     G4String val;
1076 {                                             << 609     while ( !(val = next()).isNull() ) { // Loop checking 12.18.2015 M.Asai
1077   //                                          << 610         token.push_back(val);
1078   // Filter name                              << 611     }
1079   G4String name = token[0];                   << 
1080   //                                          << 
1081   // particle list                            << 
1082   std::vector<G4String> pnames;               << 
1083   for(G4int i = 1; i < (G4int) token.size();  << 
1084   {                                           << 
1085     pnames.push_back(token[i]);               << 
1086   }                                           << 
1087   //                                          << 
1088   // Attach Filter                            << 
1089   mesh->SetFilter(new G4SDParticleFilter(name << 
1090 }                                                612 }
1091                                                  613 
1092 void G4ScoreQuantityMessenger::FParticleWithE << 614 
1093                                               << 615 void G4ScoreQuantityMessenger::FParticleCommand(G4VScoringMesh* mesh, G4TokenVec& token){
1094 {                                             << 616     //
1095   G4String& name   = token[0];                << 617     // Filter name
1096   G4double elow    = StoD(token[1]);          << 618     G4String name = token[0];
1097   G4double ehigh   = StoD(token[2]);          << 619     //
1098   G4double unitVal = G4UnitDefinition::GetVal << 620     // particle list
1099   auto  filter =                              << 621     std::vector<G4String> pnames;
1100     new G4SDParticleWithEnergyFilter(name, el << 622     for ( G4int i = 1; i<(G4int)token.size(); i++){
1101   for(G4int i = 4; i < (G4int) token.size();  << 623         pnames.push_back(token[i]);
1102   {                                           << 624     }
1103     filter->add(token[i]);                    << 625     //
1104   }                                           << 626     // Attach Filter
1105   mesh->SetFilter(filter);                    << 627     mesh->SetFilter(new G4SDParticleFilter(name,pnames));
                                                   >> 628 }    
                                                   >> 629 
                                                   >> 630 void G4ScoreQuantityMessenger::FParticleWithEnergyCommand(G4VScoringMesh* mesh,G4TokenVec& token){
                                                   >> 631     G4String& name = token[0];
                                                   >> 632     G4double  elow = StoD(token[1]);
                                                   >> 633     G4double  ehigh= StoD(token[2]);
                                                   >> 634     G4double  unitVal = G4UnitDefinition::GetValueOf(token[3]);
                                                   >> 635     G4SDParticleWithEnergyFilter* filter = 
                                                   >> 636         new G4SDParticleWithEnergyFilter(name,elow*unitVal,ehigh*unitVal);
                                                   >> 637     for ( G4int i = 4; i < (G4int)token.size(); i++){
                                                   >> 638         filter->add(token[i]);
                                                   >> 639     }
                                                   >> 640     mesh->SetFilter(filter);
1106 }                                                641 }
1107                                                  642 
1108 G4bool G4ScoreQuantityMessenger::CheckMeshPS( << 643 G4bool G4ScoreQuantityMessenger::CheckMeshPS(G4VScoringMesh* mesh, G4String& psname,
1109                                               << 644                                              G4UIcommand* command){
1110                                               << 645     if(!mesh->FindPrimitiveScorer(psname)) {
1111 {                                             << 646         return true;
1112   if(!mesh->FindPrimitiveScorer(psname))      << 647     } else {
1113   {                                           << 648         G4ExceptionDescription ed;
1114     return true;                              << 649         ed << "WARNING[" << qTouchCmd->GetCommandPath()
1115   }                                           << 650            << "] : Quantity name, \"" << psname << "\", is already existing.";
1116                                               << 651         command->CommandFailed(ed);
1117   G4ExceptionDescription ed;                  << 652         mesh->SetNullToCurrentPrimitiveScorer();
1118   ed << "WARNING[" << qTouchCmd->GetCommandPa << 653         return false;
1119      << psname << "\", is already existing."; << 654     }
1120   command->CommandFailed(ed);                 << 
1121   mesh->SetNullToCurrentPrimitiveScorer();    << 
1122   return false;                               << 
1123 }                                                655 }
1124                                                  656