herwig is hosted by Hepforge, IPPP Durham
Herwig  7.2.1
KinematicsReconstructor.h
1 // -*- C++ -*-
2 //
3 // KinematicsReconstructor.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_KinematicsReconstructor_H
10 #define HERWIG_KinematicsReconstructor_H
11 //
12 // This is the declaration of the KinematicsReconstructor class.
13 //
14 
15 #include "ThePEG/Interface/Interfaced.h"
16 #include "Herwig/Shower/QTilde/Base/ShowerParticle.h"
17 #include "Herwig/Shower/QTilde/Base/ShowerProgenitor.h"
18 #include "Herwig/Shower/QTilde/Base/ShowerTree.h"
19 #include "Herwig/Shower/QTilde/Base/HardTree.h"
20 #include "KinematicsReconstructor.fh"
21 #include <cassert>
22 
23 namespace Herwig {
24 
25 using namespace ThePEG;
26 
33 
34 
39 struct JetKinStruct {
40 
44  tShowerParticlePtr parent;
45 
49  Lorentz5Momentum p;
50 
54  Lorentz5Momentum q;
55 };
56 
60 typedef vector<JetKinStruct> JetKinVect;
61 
65 enum SystemType { UNDEFINED=-1, II, IF, F ,I };
66 
70 template<typename Value> struct ColourSinglet {
71 
72  typedef vector<ColourSinglet<Value> > VecType;
73 
74  ColourSinglet() : type(UNDEFINED) {}
75 
76  ColourSinglet(SystemType intype,Value inpart)
77  : type(intype),jets(1,inpart) {}
78 
83 
87  vector<Value> jets;
88 
89 };
90 
95 
100 
127 
128 public:
129 
133  KinematicsReconstructor() : _reconopt(0), _initialBoost(0),
134  _finalStateReconOption(0),
135  _initialStateReconOption(0),
136  _finalFinalWeight(false), _minQ(MeV) {};
137 
150  virtual bool reconstructHardJets(ShowerTreePtr hard,
151  const map<tShowerProgenitorPtr,
152  pair<Energy,double> > & pt,
153  ShowerInteraction type,
154  bool switchRecon) const;
155 
164  virtual bool reconstructDecayJets(ShowerTreePtr decay,
165  ShowerInteraction type) const;
167 
181  virtual bool deconstructDecayJets(HardTreePtr,ShowerInteraction) const;
182 
188  virtual bool deconstructHardJets(HardTreePtr,ShowerInteraction) const;
190 
191 public:
192 
199  void persistentOutput(PersistentOStream & os) const;
200 
206  void persistentInput(PersistentIStream & is, int version);
208 
215  static void Init();
216 
217 protected:
218 
236  virtual bool reconstructTimeLikeJet(const tShowerParticlePtr particleJetParent) const;
237 
246  bool reconstructSpaceLikeJet(const tShowerParticlePtr particleJetParent) const;
247 
252  bool reconstructDecayJet(const tShowerParticlePtr particleJetParent) const;
254 
264  void reconstructInitialFinalSystem(vector<ShowerProgenitorPtr>) const;
265 
270  void reconstructFinalStateSystem(bool applyBoost,
271  const LorentzRotation & toRest,
272  const LorentzRotation & fromRest,
273  vector<ShowerProgenitorPtr>) const;
274 
278  void reconstructGeneralSystem(vector<ShowerProgenitorPtr> & ShowerHardJets) const;
279 
284  void reconstructFinalFirst(vector<ShowerProgenitorPtr> & ShowerHardJets) const;
285 
290  void reconstructColourPartner(vector<ShowerProgenitorPtr> & ShowerHardJets) const;
291 
295  void reconstructColourSinglets(vector<ShowerProgenitorPtr> & ShowerHardJets,
296  ShowerInteraction type) const;
297 
302  void reconstructInitialInitialSystem(bool & applyBoost,
303  LorentzRotation & toRest,
304  LorentzRotation & fromRest,
305  vector<ShowerProgenitorPtr>) const;
307 
317  void deconstructFinalStateSystem(const LorentzRotation & toRest,
318  const LorentzRotation & fromRest,
319  HardTreePtr,
320  vector<HardBranchingPtr>,
321  ShowerInteraction) const;
322 
327  void deconstructInitialInitialSystem(bool & applyBoost,
328  LorentzRotation & toRest,
329  LorentzRotation & fromRest,
330  HardTreePtr,
331  vector<HardBranchingPtr>,
332  ShowerInteraction ) const;
333 
338  void deconstructInitialFinalSystem(HardTreePtr,
339  vector<HardBranchingPtr>,
340  ShowerInteraction ) const;
341 
342  bool deconstructGeneralSystem(HardTreePtr,
343  ShowerInteraction) const;
344 
345  bool deconstructColourSinglets(HardTreePtr,
346  ShowerInteraction) const;
347 
348  bool deconstructColourPartner(HardTreePtr,
349  ShowerInteraction) const;
351 
356  void reconstructFinalFinalOffShell(JetKinVect orderedJets, Energy2 s,
357  bool recursive) const;
358 
367  LorentzRotation solveBoost(const double k,
368  const Lorentz5Momentum & newq,
369  const Lorentz5Momentum & oldp) const;
370 
374  LorentzRotation solveBoost(const Lorentz5Momentum & newq,
375  const Lorentz5Momentum & oldq) const;
376 
380  LorentzRotation solveBoostZ(const Lorentz5Momentum & newq,
381  const Lorentz5Momentum & oldq) const;
382 
389  void boostChain(tPPtr p, const LorentzRotation & bv, tPPtr & parent) const;
390 
399  Boost solveBoostBeta( const double k, const Lorentz5Momentum & newq,
400  const Lorentz5Momentum & oldp);
401 
406  double getBeta(const double E, const double q,
407  const double Ep, const double qp) const
408  {return (q*E-qp*Ep)/(sqr(qp)+sqr(E));}
410 
426  double solveKfactor( const Energy & root_s, const JetKinVect & jets ) const;
427 
442  bool solveDecayKFactor(Energy mb,
443  const Lorentz5Momentum & n,
444  const Lorentz5Momentum & pjet,
445  const JetKinVect & jetKinematics,
446  ShowerParticlePtr partner,
447  Lorentz5Momentum ppartner[2],
448  double & k1,
449  double & k2,
450  Lorentz5Momentum & qt) const;
451 
458  double inverseRescalingFactor(vector<Lorentz5Momentum> pout,
459  vector<Energy> mon,Energy roots) const;
460 
471  bool inverseDecayRescalingFactor(vector<Lorentz5Momentum> pout,
472  vector<Energy> mon,Energy roots,
473  Lorentz5Momentum ppartner, Energy mbar,
474  double & k1, double & k2) const;
475 
482  Energy momConsEq(double k, const Energy & root_s,
483  const JetKinVect & jets) const;
484 
485 
486  void findInitialBoost(const Lorentz5Momentum & pold, const Lorentz5Momentum & pnew,
487  LorentzRotation & toRest, LorentzRotation & fromRest) const;
489 
494  template<typename Value> void findPartners(Value branch,set<Value> & done,
495  const set<Value> & branchings,
496  vector<Value> & jets) const;
497 
501  bool addIntrinsicPt(vector<ShowerProgenitorPtr>) const;
502 
511  void deepTransform(PPtr particle,const LorentzRotation & r,
512  bool match=true,PPtr original=PPtr()) const;
513 
517  Energy findMass(HardBranchingPtr) const;
518 
522  vector<double> initialStateRescaling(double x1, double x2,
523  const Lorentz5Momentum & pold,
524  const vector<Lorentz5Momentum> & p,
525  const vector<Lorentz5Momentum> & pq,
526  const vector<Energy>& highespts) const;
527 
531  vector<double> inverseInitialStateRescaling(double & x1, double & x2,
532  const Lorentz5Momentum & pold,
533  const vector<Lorentz5Momentum> & p,
534  const vector<Lorentz5Momentum> & pq) const;
535 
539  template<typename Value >
540  typename ColourSinglet<Value>::VecType identifySystems(set<Value> jets,
541  unsigned int & nnun,unsigned int & nnii,
542  unsigned int & nnif,unsigned int & nnf,
543  unsigned int & nni) const;
544 
548  template<typename Value>
549  void combineFinalState(vector<ColourSinglet<Value> > & systems) const;
550 
551 protected:
552 
559  virtual IBPtr clone() const {return new_ptr(*this);}
560 
565  virtual IBPtr fullclone() const {return new_ptr(*this);}
567 
568 protected:
569 
577  virtual void doinit();
579 
580 private:
581 
586  KinematicsReconstructor & operator=(const KinematicsReconstructor &) = delete;
587 
588 private:
589 
593  unsigned int _reconopt;
594 
598  unsigned int _initialBoost;
599 
604 
609 
614 
619  Energy _minQ;
620 
624  mutable tShowerParticlePtr _progenitor;
625 
629  mutable map<tShowerProgenitorPtr,pair<Energy,double> > _intrinsic;
630 
634  mutable tShowerTreePtr _currentTree;
635 
641 
646  set<cPDPtr> _noRescale;
647 
651  mutable map<tPPtr,vector<LorentzRotation> > _boosts;
652 
656  mutable map<tShowerTreePtr,vector<LorentzRotation> > _treeBoosts;
657 };
658 
659 }
660 
661 #endif /* HERWIG_KinematicsReconstructor_H */
ThePEG::Ptr< Particle >::pointer PPtr
This class is responsible for the kinematical reconstruction after each showering step...
Energy _minQ
Minimum invariant mass for initial-final dipoles to allow the reconstruction.
unsigned int _initialBoost
Option for the boost for initial-initial reconstruction.
ShowerInteraction
Handy header file to be included in all Shower classes.
tShowerTreePtr _currentTree
Current ShowerTree.
ThePEG::Ptr< InterfacedBase >::pointer IBPtr
virtual IBPtr fullclone() const
Make a clone of this object, possibly modifying the cloned object to make it sane.
constexpr auto sqr(const T &x) -> decltype(x *x)
Lorentz5Momentum q
Momentum of the particle after reconstruction.
tShowerParticlePtr _progenitor
The progenitor of the jet currently being reconstructed.
ColourSinglet< ShowerProgenitorPtr > ColourSingletSystem
Struct to store a colour singlet system of particles.
unsigned int _initialStateReconOption
Option for the initial state reconstruction.
SystemType type
The type of system.
map< tShowerProgenitorPtr, pair< Energy, double > > _intrinsic
Storage of the intrinsic .
vector< JetKinStruct > JetKinVect
typedef for a vector of JetKinStruct
vector< Value > jets
The jets in the system.
ThePEG::Ptr< Particle >::transient_pointer tPPtr
double getBeta(const double E, const double q, const double Ep, const double qp) const
Compute boost parameter along z axis to get (Ep, any perp, qp) from (E, same perp, q).
tShowerParticlePtr parent
Parent particle of the jet.
PDVector _noRescaleVector
Particles which shouldn&#39;t have their masses rescaled as vector for the interface. ...
A simple struct to store the information we need on the showering.
map< tPPtr, vector< LorentzRotation > > _boosts
Storage of the boosts applied to enable resetting after failure.
bool _finalFinalWeight
Option for FF kinematic factor.
set< cPDPtr > _noRescale
Particles which shouldn&#39;t have their masses rescaled as set for quick access.
Lorentz5Momentum p
Momentum of the particle before reconstruction.
-*- C++ -*-
vector< PDPtr > PDVector
matcher< Density > match(const Generator< Density > &gen)
Indicate that the argument density should be matched to the previous one in a piecewise definition...
SystemType
Enum to identify types of colour singlet systems.
ColourSinglet< HardBranchingPtr > ColourSingletShower
Struct to store a colour singlet shower.
KinematicsReconstructor()
Default constructor.
virtual IBPtr clone() const
Make a simple clone of this object.
unsigned int _reconopt
Option for handling the reconstruction.
unsigned int _finalStateReconOption
Option for the reconstruction of final state systems.
map< tShowerTreePtr, vector< LorentzRotation > > _treeBoosts
Storage of the boosts applied to enable resetting after failure.
Exception class used to communicate failure of kinematics reconstruction.