CID 21398: Big parameter passed by value (PASS_BY_VALUE)
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 29 May 2013 12:39:27 +0000 (12:39 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 29 May 2013 12:39:27 +0000 (12:39 +0000)
PYTHIA8/pythia8175/include/MergingHooks.h
PYTHIA8/pythia8175/src/MergingHooks.cxx
PYTHIA8/pythia8175/src/Pythia.cxx

index ac61e1c..40abdee 100644 (file)
@@ -490,7 +490,7 @@ protected:
 
   // Functions for internal use inside Pythia source code
   // Initialize.
-  void init( Settings settings, Info* infoPtrIn, 
+  void init( Settings* settings, Info* infoPtrIn, 
     ParticleData* particleDataPtrIn, PartonSystems* partonSystemsPtrIn,
     ostream& os = cout);
 
index dc33aa4..3bac993 100644 (file)
@@ -1798,7 +1798,7 @@ void HardProcess::clear() {
 
 // Initialise MergingHooks class
 
-void MergingHooks::init( Settings settings, Info* infoPtrIn, 
+void MergingHooks::init( Settings* settings, Info* infoPtrIn, 
   ParticleData* particleDataPtrIn, PartonSystems* partonSystemsPtrIn,
   ostream& os){
 
@@ -1808,62 +1808,62 @@ void MergingHooks::init( Settings settings, Info* infoPtrIn,
   partonSystemsPtr      = partonSystemsPtrIn;
 
   // Initialise AlphaS objects for reweighting
-  double alphaSvalueFSR = settings.parm("TimeShower:alphaSvalue");
-  int    alphaSorderFSR = settings.mode("TimeShower:alphaSorder");
+  double alphaSvalueFSR = settings->parm("TimeShower:alphaSvalue");
+  int    alphaSorderFSR = settings->mode("TimeShower:alphaSorder");
   AlphaS_FSRSave.init(alphaSvalueFSR,alphaSorderFSR);
-  double alphaSvalueISR = settings.parm("SpaceShower:alphaSvalue");
-  int    alphaSorderISR = settings.mode("SpaceShower:alphaSorder");
+  double alphaSvalueISR = settings->parm("SpaceShower:alphaSvalue");
+  int    alphaSorderISR = settings->mode("SpaceShower:alphaSorder");
   AlphaS_ISRSave.init(alphaSvalueISR,alphaSorderISR);
 
   // Initialise AlphaS objects for reweighting
-  int    alphaEMFSRorder = settings.mode("TimeShower:alphaEMorder");
-  AlphaEM_FSRSave.init(alphaEMFSRorder, &settings);
+  int    alphaEMFSRorder = settings->mode("TimeShower:alphaEMorder");
+  AlphaEM_FSRSave.init(alphaEMFSRorder, settings);
 
   // Initialise merging switches
-  doUserMergingSave     =  settings.flag("Merging:doUserMerging");
+  doUserMergingSave     =  settings->flag("Merging:doUserMerging");
   // Initialise automated MadGraph kT merging
-  doMGMergingSave       =  settings.flag("Merging:doMGMerging");
+  doMGMergingSave       =  settings->flag("Merging:doMGMerging");
   // Initialise kT merging
-  doKTMergingSave       =  settings.flag("Merging:doKTMerging");
+  doKTMergingSave       =  settings->flag("Merging:doKTMerging");
   // Initialise evolution-pT merging
-  doPTLundMergingSave   =  settings.flag("Merging:doPTLundMerging");
+  doPTLundMergingSave   =  settings->flag("Merging:doPTLundMerging");
   // Initialise \Delta_R_{ij}, pT_i Q_{ij} merging
-  doCutBasedMergingSave =  settings.flag("Merging:doCutBasedMerging");
+  doCutBasedMergingSave =  settings->flag("Merging:doCutBasedMerging");
   // Initialise exact definition of kT
-  ktTypeSave            =  settings.mode("Merging:ktType");
+  ktTypeSave            =  settings->mode("Merging:ktType");
 
   // Initialise NL3 switches.
-  doNL3TreeSave         =  settings.flag("Merging:doNL3Tree");
-  doNL3LoopSave         =  settings.flag("Merging:doNL3Loop");
-  doNL3SubtSave         =  settings.flag("Merging:doNL3Subt");
+  doNL3TreeSave         =  settings->flag("Merging:doNL3Tree");
+  doNL3LoopSave         =  settings->flag("Merging:doNL3Loop");
+  doNL3SubtSave         =  settings->flag("Merging:doNL3Subt");
   bool doNL3            = doNL3TreeSave || doNL3LoopSave || doNL3SubtSave;
 
   // Initialise UNLOPS switches.
-  doUNLOPSTreeSave      =  settings.flag("Merging:doUNLOPSTree");
-  doUNLOPSLoopSave      =  settings.flag("Merging:doUNLOPSLoop");
-  doUNLOPSSubtSave      =  settings.flag("Merging:doUNLOPSSubt");
-  doUNLOPSSubtNLOSave   =  settings.flag("Merging:doUNLOPSSubtNLO");
+  doUNLOPSTreeSave      =  settings->flag("Merging:doUNLOPSTree");
+  doUNLOPSLoopSave      =  settings->flag("Merging:doUNLOPSLoop");
+  doUNLOPSSubtSave      =  settings->flag("Merging:doUNLOPSSubt");
+  doUNLOPSSubtNLOSave   =  settings->flag("Merging:doUNLOPSSubtNLO");
   bool doUNLOPS         = doUNLOPSTreeSave || doUNLOPSLoopSave
                        || doUNLOPSSubtSave || doUNLOPSSubtNLOSave;
 
   // Initialise UMEPS switches
-  doUMEPSTreeSave      =  settings.flag("Merging:doUMEPSTree");
-  doUMEPSSubtSave      =  settings.flag("Merging:doUMEPSSubt");
-  nReclusterSave       =  settings.mode("Merging:nRecluster");
+  doUMEPSTreeSave      =  settings->flag("Merging:doUMEPSTree");
+  doUMEPSSubtSave      =  settings->flag("Merging:doUMEPSSubt");
+  nReclusterSave       =  settings->mode("Merging:nRecluster");
   bool doUMEPS         =  doUMEPSTreeSave || doUMEPSSubtSave;
 
   // Flag to only do phase space cut.
-  doEstimateXSection   =  settings.flag("Merging:doXSectionEstimate");
+  doEstimateXSection   =  settings->flag("Merging:doXSectionEstimate");
 
   // Get core process from user input
-  processSave           = settings.word("Merging:Process");
+  processSave           = settings->word("Merging:Process");
 
   // Clear hard process
   hardProcess.clear();
 
   // Initialise input event.
   inputEvent.init("(hard process)", particleDataPtr);
-  doRemoveDecayProducts = settings.flag("Merging:mayRemoveDecayProducts");
+  doRemoveDecayProducts = settings->flag("Merging:mayRemoveDecayProducts");
 
   // Initialise the hard process
   if ( doMGMergingSave )
@@ -1872,45 +1872,45 @@ void MergingHooks::init( Settings settings, Info* infoPtrIn,
     hardProcess.initOnProcess(processSave, particleDataPtr);
 
   // Parameters for reconstruction of evolution scales
-  includeMassiveSave        = settings.flag("Merging:includeMassive");
-  enforceStrongOrderingSave = settings.flag("Merging:enforceStrongOrdering");
-  scaleSeparationFactorSave = settings.parm("Merging:scaleSeparationFactor");
-  orderInRapiditySave       = settings.flag("Merging:orderInRapidity");
+  includeMassiveSave        = settings->flag("Merging:includeMassive");
+  enforceStrongOrderingSave = settings->flag("Merging:enforceStrongOrdering");
+  scaleSeparationFactorSave = settings->parm("Merging:scaleSeparationFactor");
+  orderInRapiditySave       = settings->flag("Merging:orderInRapidity");
 
   // Parameters for choosing history probabilistically
-  nonJoinedNormSave     = settings.parm("Merging:nonJoinedNorm");
-  fsrInRecNormSave      = settings.parm("Merging:fsrInRecNorm");
-  pickByFullPSave       = settings.flag("Merging:pickByFullP");
-  pickByPoPT2Save       = settings.flag("Merging:pickByPoPT2");
-  includeRedundantSave  = settings.flag("Merging:includeRedundant");
+  nonJoinedNormSave     = settings->parm("Merging:nonJoinedNorm");
+  fsrInRecNormSave      = settings->parm("Merging:fsrInRecNorm");
+  pickByFullPSave       = settings->flag("Merging:pickByFullP");
+  pickByPoPT2Save       = settings->flag("Merging:pickByPoPT2");
+  includeRedundantSave  = settings->flag("Merging:includeRedundant");
 
   // Parameters for scale choices
   unorderedScalePrescipSave   =
-    settings.mode("Merging:unorderedScalePrescrip");
+    settings->mode("Merging:unorderedScalePrescrip");
   unorderedASscalePrescipSave =
-    settings.mode("Merging:unorderedASscalePrescrip");
+    settings->mode("Merging:unorderedASscalePrescrip");
   unorderedPDFscalePrescipSave =
-    settings.mode("Merging:unorderedPDFscalePrescrip");
+    settings->mode("Merging:unorderedPDFscalePrescrip");
   incompleteScalePrescipSave  =
-    settings.mode("Merging:incompleteScalePrescrip");
+    settings->mode("Merging:incompleteScalePrescrip");
 
   // Parameter for allowing swapping of one colour index while reclustering
   allowColourShufflingSave  =
-    settings.flag("Merging:allowColourShuffling");
+    settings->flag("Merging:allowColourShuffling");
 
   // Parameters to allow setting hard process scales to default (dynamical)
   // Pythia values.
-  resetHardQRenSave     =  settings.flag("Merging:usePythiaQRenHard");
-  resetHardQFacSave     =  settings.flag("Merging:usePythiaQFacHard");
+  resetHardQRenSave     =  settings->flag("Merging:usePythiaQRenHard");
+  resetHardQFacSave     =  settings->flag("Merging:usePythiaQFacHard");
 
   // Parameters for choosing history by sum(|pT|)
-  pickBySumPTSave       = settings.flag("Merging:pickBySumPT");
-  herwigAcollFSRSave    = settings.parm("Merging:aCollFSR");
-  herwigAcollISRSave    = settings.parm("Merging:aCollISR");
+  pickBySumPTSave       = settings->flag("Merging:pickBySumPT");
+  herwigAcollFSRSave    = settings->parm("Merging:aCollFSR");
+  herwigAcollISRSave    = settings->parm("Merging:aCollISR");
 
   // Information on the shower cut-off scale
-  pT0ISRSave            = settings.parm("SpaceShower:pT0Ref");
-  pTcutSave             = settings.parm("SpaceShower:pTmin");
+  pT0ISRSave            = settings->parm("SpaceShower:pT0Ref");
+  pTcutSave             = settings->parm("SpaceShower:pTmin");
   pTcutSave             = max(pTcutSave,pT0ISRSave);
 
   // Initialise CKKWL weight
@@ -1923,41 +1923,41 @@ void MergingHooks::init( Settings settings, Info* infoPtrIn,
   tmsValueSave = 0.;
   tmsListSave.resize(0);
 
-  kFactor0jSave         = settings.parm("Merging:kFactor0j");
-  kFactor1jSave         = settings.parm("Merging:kFactor1j");
-  kFactor2jSave         = settings.parm("Merging:kFactor2j");
+  kFactor0jSave         = settings->parm("Merging:kFactor0j");
+  kFactor1jSave         = settings->parm("Merging:kFactor1j");
+  kFactor2jSave         = settings->parm("Merging:kFactor2j");
 
-  muFSave               = settings.parm("Merging:muFac");
-  muRSave               = settings.parm("Merging:muRen");
-  muFinMESave           = settings.parm("Merging:muFacInME");
-  muRinMESave           = settings.parm("Merging:muRenInME");
+  muFSave               = settings->parm("Merging:muFac");
+  muRSave               = settings->parm("Merging:muRen");
+  muFinMESave           = settings->parm("Merging:muFacInME");
+  muRinMESave           = settings->parm("Merging:muRenInME");
 
-  doWClusteringSave     = settings.flag("Merging:allowWClustering");
-  doSQCDClusteringSave  = settings.flag("Merging:allowSQCDClustering");
+  doWClusteringSave     = settings->flag("Merging:allowWClustering");
+  doSQCDClusteringSave  = settings->flag("Merging:allowSQCDClustering");
 
   // Save merging scale on maximal number of jets
   if (  doKTMergingSave || doUserMergingSave || doPTLundMergingSave
     || doUMEPS ) {
     // Read merging scale (defined in kT) from input parameter.
-    tmsValueSave    = settings.parm("Merging:TMS");
-    nJetMaxSave     = settings.mode("Merging:nJetMax");
+    tmsValueSave    = settings->parm("Merging:TMS");
+    nJetMaxSave     = settings->mode("Merging:nJetMax");
     nJetMaxNLOSave  = -1;
   } else if (doMGMergingSave) {
     // Read merging scale (defined in kT) from LHE file.
     tmsValueSave    = hardProcess.tms;
-    nJetMaxSave     = settings.mode("Merging:nJetMax");
+    nJetMaxSave     = settings->mode("Merging:nJetMax");
     nJetMaxNLOSave  = -1;
   } else if (doCutBasedMergingSave) { 
 
     // Save list of cuts defining the merging scale.
-    nJetMaxSave     = settings.mode("Merging:nJetMax");
+    nJetMaxSave     = settings->mode("Merging:nJetMax");
     nJetMaxNLOSave  = -1;
     // Write tms cut values to list of cut values,
     // ordered by DeltaR_{ij}, pT_{i}, Q_{ij}.
     tmsListSave.resize(0);
-    double drms     = settings.parm("Merging:dRijMS");
-    double ptms     = settings.parm("Merging:pTiMS");
-    double qms      = settings.parm("Merging:QijMS");
+    double drms     = settings->parm("Merging:dRijMS");
+    double ptms     = settings->parm("Merging:pTiMS");
+    double qms      = settings->parm("Merging:QijMS");
     tmsListSave.push_back(drms);
     tmsListSave.push_back(ptms);
     tmsListSave.push_back(qms);
@@ -1965,9 +1965,9 @@ void MergingHooks::init( Settings settings, Info* infoPtrIn,
   }
 
   if ( doNL3 || doUNLOPS || doEstimateXSection ) {
-    tmsValueSave    = settings.parm("Merging:TMS");
-    nJetMaxSave     = settings.mode("Merging:nJetMax");
-    nJetMaxNLOSave  = settings.mode("Merging:nJetMaxNLO");
+    tmsValueSave    = settings->parm("Merging:TMS");
+    nJetMaxSave     = settings->mode("Merging:nJetMax");
+    nJetMaxNLOSave  = settings->mode("Merging:nJetMaxNLO");
   }
 
   bool writeBanner =  doKTMergingSave || doMGMergingSave
index de60fce..2b5d7ea 100644 (file)
@@ -524,7 +524,7 @@ bool Pythia::init() {
 
   // Initialise merging hooks.
   if ( doMerging && (hasMergingHooks || hasOwnMergingHooks) )
-    mergingHooksPtr->init( settings, &info, &particleData, &partonSystems );
+    mergingHooksPtr->init( &settings, &info, &particleData, &partonSystems );
 
   // Initialize the random number generator.
   if ( settings.flag("Random:setSeed") )