herwig is hosted by Hepforge, IPPP Durham
Herwig 7.3.0
ShowerHandler.h
1// -*- C++ -*-
2//
3// ShowerHandler.h is a part of Herwig - A multi-purpose Monte Carlo event generator
4// Copyright (C) 2002-2019 The Herwig Collaboration
5//
6// Herwig is licenced under version 3 of the GPL, see COPYING for details.
7// Please respect the MCnet academic guidelines, see GUIDELINES for details.
8//
9#ifndef HERWIG_ShowerHandler_H
10#define HERWIG_ShowerHandler_H
11//
12// This is the declaration of the ShowerHandler class.
13//
14
15#include "ThePEG/Handlers/EventHandler.h"
16#include "ThePEG/Handlers/CascadeHandler.h"
17#include "ShowerVariation.h"
18#include "Herwig/PDF/HwRemDecayer.fh"
19#include "ThePEG/EventRecord/RemnantParticle.fh"
20#include "UEBase.h"
21#include "PerturbativeProcess.h"
22#include "Herwig/MatrixElement/Matchbox/Matching/HardScaleProfile.h"
23#include "ShowerHandler.fh"
24
25namespace Herwig {
26using namespace ThePEG;
27
41
42public:
43
47 typedef pair<tRemPPtr, tRemPPtr> RemPair;
48
49public:
50
55
59 virtual ~ShowerHandler();
60
61public:
62
67 virtual void cascade();
68
72 static const tShowerHandlerPtr currentHandler() {
74 return currentHandler_;
75 else
76 return tShowerHandlerPtr();
77 }
78
82 static bool currentHandlerIsSet() {
83 return currentHandler_;
84 }
85
86public:
87
92 virtual bool showerHardProcessVeto() const { return false; }
93
98 virtual bool isReshuffling() const { return true; }
99
104 virtual bool retConstituentMasses() const { return useConstituentMasses_; }
105
106
107
112 virtual bool canHandleMatchboxTrunc() const { return false; }
113
117 Energy pdfFreezingScale() const { return pdfFreezingScale_; }
118
122 PDFPtr getPDFA() const {return PDFA_;}
123
127 PDFPtr getPDFB() const {return PDFB_;}
128
132 bool firstInteraction() const {
133 if (!eventHandler()->currentCollision())return true;
134 return ( subProcess_ ==
135 eventHandler()->currentCollision()->primarySubProcess() );
136 }
137
141 tHwRemDecPtr remnantDecayer() const { return remDec_; }
142
149 void splitHardProcess(tPVector tagged, PerturbativeProcessPtr & hard,
150 DecayProcessMap & decay) const;
151
156
163 tDMPtr decay(PerturbativeProcessPtr,
165 bool radPhotons = false) const;
166
167
172 tDMPtr findDecayMode(const string & tag) const;
173
174
180
181 bool operator() (tcPDPtr p1, tcPDPtr p2) const;
182
183 };
184
185
190 typedef multiset<tcPDPtr,ParticleOrdering> OrderedParticles;
191
192
193public:
194
202 bool doRadiation() const {return doFSR_ || doISR_;}
203
207 bool doFSR() const { return doFSR_;}
208
212 bool doISR() const { return doISR_;}
214
215public:
216
224 bool hardScaleIsMuF() const { return maxPtIsMuF_; }
225
231 }
232
236 double renFac() const {
238 }
239
243 double facFac() const {
245 }
246
252 }
253
257 double hardScaleFactor() const {
258 return hardScaleFactor_;
259 }
265
269 Ptr<HardScaleProfile>::tptr profileScales() const { return hardScaleProfile_; }
270
274 virtual Energy hardScale() const;
275
279 virtual int showerPhaseSpaceOption() const {
280 assert(false && "not implemented in general");
281 return -1;
282 }
284
285public:
286
290 map<string,ShowerVariation>& showerVariations() {
291 return showerVariations_;
292 }
293
297 const map<string,ShowerVariation>& showerVariations() const {
298 return showerVariations_;
299 }
300
304 map<string,double>& currentWeights() {
305 return currentWeights_;
306 }
307
311 const map<string,double>& currentWeights() const {
312 return currentWeights_;
313 }
314
318 void reweight(double w) {
319 reweight_ = w;
320 }
321
325 double reweight() const {
326 return reweight_;
327 }
328
329public :
330
338 unsigned int spinCorrelations() const {
339 return spinOpt_;
340 }
341
345 virtual bool correlations() const {
346 return spinOpt_!=0;
347 }
349
350public:
351
357
365 const int tries;
366
368 ShowerTriesVeto(int t) : tries(t) {}
369 };
370
371public:
372
380
386 void persistentInput(PersistentIStream & is, int version);
388
395 static void Init();
396
397protected:
398
405 virtual tPPair cascade(tSubProPtr sub, XCPtr xcomb);
406
412 subProcess_ = sub;
413 }
414
419 void boostCollision(bool boost);
421
422protected:
423
432 currentHandler_ = tShowerHandlerPtr(this);
433 }
434
439 currentHandler_ = tShowerHandlerPtr();
440 }
442
443protected:
444
453 bool isMPIOn() const {
454 return MPIHandler_ && MPIHandler_->beamOK();
455 }
456
461 tUEBasePtr getMPIHandler() const {
462 assert(MPIHandler_);
463 return MPIHandler_;
464 }
465
470
476
482
483public:
484
489 bool decaysInShower(long id) const {
490 return ( particlesDecayInShower_.find( abs(id) ) !=
492 }
493
494protected:
495
506 void findDecayProducts(PPtr parent, PerturbativeProcessPtr hard, DecayProcessMap & decay) const;
507
514 void createDecayProcess(PPtr parent,PerturbativeProcessPtr hard, DecayProcessMap & decay) const;
516
525 assert(subProcess_);
526 return subProcess_;
527 }
528
533 return incoming_;
534 }
536
537protected:
538
542 //@
547
552
558
559protected:
560
565 unsigned int maxtry() const { return maxtry_; }
566
567protected:
568
576 bool includeSpaceTime() const {return includeSpaceTime_;}
577
581 Energy2 vMin() const {return vMin_;}
583
584protected:
585
592 virtual IBPtr clone() const;
593
598 virtual IBPtr fullclone() const;
600
601protected:
602
610 virtual void doinit();
611
616 virtual void doinitrun();
617
622 virtual void dofinish();
624
625private:
626
632
633private:
634
638 static tShowerHandlerPtr currentHandler_;
639
644 UEBasePtr MPIHandler_;
645
649 HwRemDecPtr remDec_;
650
651private:
652
661 unsigned int maxtry_;
662
667 unsigned int maxtryMPI_;
668
673 unsigned int maxtryDP_;
674
678 unsigned int maxtryDecay_;
680
681private:
682
691
696
701
707
712
716 Ptr<HardScaleProfile>::ptr hardScaleProfile_;
718
722 unsigned int spinOpt_;
723
724private:
725
734
739
744
750
751private:
752
761
770
775
780
785
789 pair <PDFPtr, PDFPtr> mpipdfs_;
790
794 pair <PDFPtr, PDFPtr> rempdfs_;
795
799 pair <PDFPtr, PDFPtr> remmpipdfs_;
801
802private:
803
811 bool doFSR_;
812
816 bool doISR_;
818
819private:
820
829
835
842
843private:
844
853
857 Energy2 vMin_;
859
860
861private:
862
867
872
877
879
880private:
881
889 map<string,ShowerVariation> showerVariations_;
890
894 string doAddVariation(string);
895
899 double reweight_;
900
904 map<string,double> currentWeights_;
906};
907
908}
909
910#endif /* HERWIG_ShowerHandler_H */
This class is the main driver of the shower: it is responsible for the proper handling of all other s...
Definition: ShowerHandler.h:40
bool isMPIOn() const
Return true if multiple parton interactions are switched on and can be used for this beam setup.
const map< string, ShowerVariation > & showerVariations() const
Return the shower variations.
double hardScaleFactor() const
The scale factor for the hard scale.
void splitHardProcess(tPVector tagged, PerturbativeProcessPtr &hard, DecayProcessMap &decay) const
Split the hard process into production and decays.
bool hardScaleIsMuF() const
Return true if maximum pt should be deduced from the factorization scale.
virtual bool showerHardProcessVeto() const
Hook to allow vetoing of event after showering hard sub-process as in e.g.
Definition: ShowerHandler.h:92
virtual bool canHandleMatchboxTrunc() const
Return true, if the shower handler can generate a truncated shower for POWHEG style events generated ...
tcStepPtr current_
Const pointer to the current step.
bool splitHardProcess_
Whether or not to split into hard and decay trees.
unsigned int spinOpt_
Option to include spin correlations.
map< string, ShowerVariation > & showerVariations()
Access the shower variations.
double renormalizationScaleFactor() const
The renormalization scale factor.
Energy2 vMin() const
The minimum virtuality for the space-time model.
virtual IBPtr clone() const
Make a simple clone of this object.
PDFPtr getPDFA() const
Get the local PDFs.
PDFPtr PDFA_
PDFs to be used for the various stages and related parameters.
virtual tPPair cascade(tSubProPtr sub, XCPtr xcomb)
The main method which manages the showering of a subprocess.
pair< PDFPtr, PDFPtr > remmpipdfs_
The MPI PDF's to be used for secondary scatters.
static tShowerHandlerPtr currentHandler_
pointer to "this", the current ShowerHandler.
bool isResolvedHadron(tPPtr)
Is a beam particle where hadronic structure is resolved.
ShowerHandler()
Default constructor.
unsigned int maxtryDecay_
Maximum number of attempts to generate a decay.
double renFac() const
The renormalization scale factor.
double reweight_
A reweighting factor applied by the showering.
bool doesSplitHardProcess() const
Information if the Showerhandler splits the hard process.
tUEBasePtr getMPIHandler() const
Access function for the MPIHandler, it should only be called after checking with isMPIOn.
void persistentInput(PersistentIStream &is, int version)
Function used to read in object persistently.
void reweight(double w)
Change the current reweighting factor.
const map< string, double > & currentWeights() const
Return the current Weights.
bool maxPtIsMuF_
True if maximum pt should be deduced from the factorization scale.
map< string, double > currentWeights_
The shower variation weights.
virtual IBPtr fullclone() const
Make a clone of this object, possibly modifying the cloned object to make it sane.
PDFPtr PDFARemnant_
The PDF for beam particle A for remnant splitting.
Energy pdfFreezingScale_
PDFs to be used for the various stages and related parameters.
bool useConstituentMasses_
Parameters for the constituent mass treatment.
tDMPtr decay(PerturbativeProcessPtr, DecayProcessMap &decay, bool radPhotons=false) const
Decay a particle.
virtual Energy hardScale() const
Return the relevant hard scale to be used in the profile scales.
bool restrictPhasespace_
True, if the phase space restrictions of the dipole shower should be applied.
void resetWeights()
Reset the current weights.
void persistentOutput(PersistentOStream &os) const
Function used to write out object persistently.
double hardScaleFactor_
The scale factor for the hard scale.
virtual void dofinish()
Finalize this object.
virtual int showerPhaseSpaceOption() const
Return information about shower phase space choices.
PDFPtr PDFBRemnant_
The PDF for beam particle B for remnant splitting.
tDMPtr findDecayMode(const string &tag) const
Cached lookup of decay modes.
pair< tRemPPtr, tRemPPtr > RemPair
Typedef for a pair of ThePEG::RemnantParticle pointers.
Definition: ShowerHandler.h:47
unsigned int maxtryDP_
Maximum number of attempts for the regeneration of an additional hard scattering, before this event i...
void combineWeights()
Weight handling for shower variations.
static bool currentHandlerIsSet()
pointer to "this", the current ShowerHandler.
Definition: ShowerHandler.h:82
void initializeWeights()
Initialise the weights in currentEvent()
bool decaysInShower(long id) const
Check if a particle decays in the shower.
virtual ~ShowerHandler()
Destructor.
unsigned int spinCorrelations() const
Access to switches for spin correlations.
virtual void doinitrun()
Initialize this object.
void setMPIPDFs()
Reset the PDF's after the hard collision has been showered.
double factorizationScaleFactor_
Factors for the various scales.
static const tShowerHandlerPtr currentHandler()
pointer to "this", the current ShowerHandler.
Definition: ShowerHandler.h:72
void createDecayProcess(PPtr parent, PerturbativeProcessPtr hard, DecayProcessMap &decay) const
Find decay products from the hard process and create decay processes.
bool includeSpaceTime() const
Parameters for the space-time model.
bool doISR_
Switch on or off initial state radiation.
void setCurrentHandler()
Set/unset the current shower handler.
PDFPtr PDFB_
The PDF for beam particle B.
bool doFSR() const
Switch on or off final state radiation.
bool doRadiation() const
Switch for any radiation.
map< string, double > & currentWeights()
Access the current Weights.
pair< PDFPtr, PDFPtr > mpipdfs_
The MPI PDF's to be used for secondary scatters.
vector< long > inputparticlesDecayInShower_
PDG codes of the particles which decay during showering this is a vector that is interfaced so they c...
tSubProPtr subProcess_
Const pointer to the currently handeled ThePEG::SubProcess.
virtual void doinit()
Initialize this object after the setup phase before saving an EventGenerator to disk.
void boostCollision(bool boost)
Boost all the particles in the collision so that the collision always occurs in the rest frame with t...
void prepareCascade(tSubProPtr sub)
Set up for the cascade.
double renormalizationScaleFactor_
The renormalization scale factor.
bool restrictPhasespace() const
Return true, if the phase space restrictions of the dipole shower should be applied.
void findDecayProducts(PPtr parent, PerturbativeProcessPtr hard, DecayProcessMap &decay) const
Members to handle splitting up of hard process and decays.
UEBasePtr MPIHandler_
a MPIHandler to administer the creation of several (semihard) partonic interactions.
tPPair incoming_
Storage of information about the current event.
map< string, ShowerVariation > showerVariations_
Parameters relevant for reweight and variations.
virtual bool correlations() const
Any correlations.
unsigned int maxtryMPI_
Maximum number of attempts for the regeneration of an additional scattering, before the number of sca...
Ptr< HardScaleProfile >::ptr hardScaleProfile_
The profile scales.
tPPair incomingBeams() const
Access to the incoming beam particles.
LorentzRotation boost_
Boost to get back to the lab.
bool doISR() const
Switch on or off initial state radiation.
unsigned int maxtry() const
Return the maximum number of attempts for showering a given subprocess.
unsigned int maxtry_
Maximum tries for various stages of the showering process.
Energy pdfFreezingScale() const
Get the PDF freezing scale.
bool includeSpaceTime_
Parameters for the space-time model.
HwRemDecPtr remDec_
Pointer to the HwRemDecayer.
virtual bool isReshuffling() const
Return true, if this cascade handler will perform reshuffling from hard process masses.
Definition: ShowerHandler.h:98
multiset< tcPDPtr, ParticleOrdering > OrderedParticles
A container for ordered particles required for constructing tags for decay mode lookup.
string doAddVariation(string)
Command to add a shower variation.
double facFac() const
The factorization scale factor.
tSubProPtr currentSubProcess() const
Return the currently used SubProcess.
static void Init()
The standard Init function used to initialize the interfaces.
int tagIntermediates_
Status code to tag intermediate state as after the showering; if zero no tagging will be performed.
PDFPtr getPDFB() const
Get the local PDFs.
virtual void cascade()
The main method which manages the multiple interactions and starts the shower by calling cascade(sub,...
double reweight() const
Return the current reweighting factor.
set< long > particlesDecayInShower_
PDG codes of the particles which decay during showering this is fast storage for use during running.
tHwRemDecPtr remnantDecayer() const
Return the remnant decayer.
RemPair getRemnants(PBIPair incbins)
Get the remnants from the ThePEG::PartonBinInstance es and do some checks.
Ptr< HardScaleProfile >::tptr profileScales() const
Return profile scales.
virtual bool retConstituentMasses() const
Return true, if this cascade handler will put the final state particles to their constituent mass.
bool firstInteraction() const
Return true if currently the primary subprocess is showered.
bool doFSR_
Switch on or off final state radiation.
void unSetCurrentHandler()
Unset the current handler.
Energy2 vMin_
The minimum virtuality for the space-time model.
ShowerHandler & operator=(const ShowerHandler &)=delete
The assignment operator is private and must never be called.
pair< PDFPtr, PDFPtr > rempdfs_
The MPI PDF's to be used for secondary scatters.
double factorizationScaleFactor() const
The factorization scale factor.
const tPVector & tagged() const
ThePEG::Ptr< XC >::pointer XCPtr
tStepPtr currentStep()
tEHPtr eventHandler() const
-*- C++ -*-
multimap< Energy, PerturbativeProcessPtr, std::greater< Energy > > DecayProcessMap
Typedef for map of PerturbativeProcess for decays.
ThePEG::Ptr< Particle >::transient_pointer tPPtr
ThePEG::Ptr< Step >::transient_const_pointer tcStepPtr
ThePEG::Ptr< InterfacedBase >::pointer IBPtr
pair< PBIPtr, PBIPtr > PBIPair
ThePEG::Ptr< DecayMode >::transient_pointer tDMPtr
ThePEG::Ptr< SubProcess >::transient_pointer tSubProPtr
vector< tPPtr > tPVector
pair< tPPtr, tPPtr > tPPair
ThePEG::Ptr< Particle >::pointer PPtr
ThePEG::Ptr< ParticleData >::transient_const_pointer tcPDPtr
ThePEG::Ptr< PDFBase >::pointer PDFPtr
struct that is used to catch exceptions which are thrown due to energy conservation issues of additio...
A struct to order the particles in the same way as in the DecayMode's.
struct that is used to catch exceptions which are thrown due to fact that the Shower has been invoked...
const int tries
variable to store the number of attempts