herwig is hosted by Hepforge, IPPP Durham
Herwig 7.3.0
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
23namespace Herwig {
24
25using namespace ThePEG;
26
33
34
40
44 tShowerParticlePtr parent;
45
49 Lorentz5Momentum p;
50
54 Lorentz5Momentum q;
55};
56
60typedef vector<JetKinStruct> JetKinVect;
61
65enum SystemType { UNDEFINED=-1, II, IF, F ,I };
66
70template<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
128public:
129
136 _finalFinalWeight(false), _minQ(MeV) {};
137
150 virtual bool reconstructHardJets(ShowerTreePtr hard,
151 const map<tShowerProgenitorPtr,
152 pair<Energy,double> > & pt,
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
191public:
192
200
206 void persistentInput(PersistentIStream & is, int version);
208
215 static void Init();
216
217public:
218
232 virtual bool reconstructTimeLikeJet(const tShowerParticlePtr particleJetParent,
233 const tShowerParticlePtr progenitor) const;
234
246 double solveKfactor( const Energy & root_s, const JetKinVect & jets ) const;
247
252 const Lorentz5Momentum & newq,
253 const Lorentz5Momentum & oldp) const;
254
263 void deepTransform(PPtr particle,const LorentzRotation & r,
264 bool match=true,PPtr original=PPtr()) const;
265
266protected:
267
272
281 bool reconstructSpaceLikeJet(const tShowerParticlePtr particleJetParent) const;
282
287 bool reconstructDecayJet(const tShowerParticlePtr particleJetParent) const;
289
299 void reconstructInitialFinalSystem(vector<ShowerProgenitorPtr>) const;
300
305 void reconstructFinalStateSystem(bool applyBoost,
306 const LorentzRotation & toRest,
307 const LorentzRotation & fromRest,
308 vector<ShowerProgenitorPtr>) const;
309
313 void reconstructGeneralSystem(vector<ShowerProgenitorPtr> & ShowerHardJets) const;
314
319 void reconstructFinalFirst(vector<ShowerProgenitorPtr> & ShowerHardJets) const;
320
325 void reconstructColourPartner(vector<ShowerProgenitorPtr> & ShowerHardJets) const;
326
330 void reconstructColourSinglets(vector<ShowerProgenitorPtr> & ShowerHardJets,
331 ShowerInteraction type) const;
332
337 void reconstructInitialInitialSystem(bool & applyBoost,
338 LorentzRotation & toRest,
339 LorentzRotation & fromRest,
340 vector<ShowerProgenitorPtr>) const;
342
353 const LorentzRotation & fromRest,
354 HardTreePtr,
355 vector<HardBranchingPtr>,
356 ShowerInteraction) const;
357
362 void deconstructInitialInitialSystem(bool & applyBoost,
363 LorentzRotation & toRest,
364 LorentzRotation & fromRest,
365 HardTreePtr,
366 vector<HardBranchingPtr>,
367 ShowerInteraction ) const;
368
374 vector<HardBranchingPtr>,
375 ShowerInteraction ) const;
376
377 bool deconstructGeneralSystem(HardTreePtr,
378 ShowerInteraction) const;
379
380 bool deconstructColourSinglets(HardTreePtr,
381 ShowerInteraction) const;
382
383 bool deconstructColourPartner(HardTreePtr,
384 ShowerInteraction) const;
386
391 void reconstructFinalFinalOffShell(JetKinVect orderedJets, Energy2 s,
392 bool recursive) const;
393
402 LorentzRotation solveBoost(const Lorentz5Momentum & newq,
403 const Lorentz5Momentum & oldq) const;
404
408 LorentzRotation solveBoostZ(const Lorentz5Momentum & newq,
409 const Lorentz5Momentum & oldq) const;
410
417 void boostChain(tPPtr p, const LorentzRotation & bv, tPPtr & parent) const;
418
427 Boost solveBoostBeta( const double k, const Lorentz5Momentum & newq,
428 const Lorentz5Momentum & oldp);
429
434 double getBeta(const double E, const double q,
435 const double Ep, const double qp) const
436 {return (q*E-qp*Ep)/(sqr(qp)+sqr(E));}
438
443
458 bool solveDecayKFactor(Energy mb,
459 const Lorentz5Momentum & n,
460 const Lorentz5Momentum & pjet,
461 const JetKinVect & jetKinematics,
462 ShowerParticlePtr partner,
463 Lorentz5Momentum ppartner[2],
464 double & k1,
465 double & k2,
466 Lorentz5Momentum & qt) const;
467
474 double inverseRescalingFactor(vector<Lorentz5Momentum> pout,
475 vector<Energy> mon,Energy roots) const;
476
487 bool inverseDecayRescalingFactor(vector<Lorentz5Momentum> pout,
488 vector<Energy> mon,Energy roots,
489 Lorentz5Momentum ppartner, Energy mbar,
490 double & k1, double & k2) const;
491
498 Energy momConsEq(double k, const Energy & root_s,
499 const JetKinVect & jets) const;
500
501
502 void findInitialBoost(const Lorentz5Momentum & pold, const Lorentz5Momentum & pnew,
503 LorentzRotation & toRest, LorentzRotation & fromRest) const;
505
510 template<typename Value> void findPartners(Value branch,set<Value> & done,
511 const set<Value> & branchings,
512 vector<Value> & jets) const;
513
517 bool addIntrinsicPt(vector<ShowerProgenitorPtr>) const;
518
522 Energy findMass(HardBranchingPtr) const;
523
527 vector<double> initialStateRescaling(double x1, double x2,
528 const Lorentz5Momentum & pold,
529 const vector<Lorentz5Momentum> & p,
530 const vector<Lorentz5Momentum> & pq,
531 const vector<Energy>& highespts) const;
532
536 vector<double> inverseInitialStateRescaling(double & x1, double & x2,
537 const Lorentz5Momentum & pold,
538 const vector<Lorentz5Momentum> & p,
539 const vector<Lorentz5Momentum> & pq) const;
540
544 template<typename Value >
545 typename ColourSinglet<Value>::VecType identifySystems(set<Value> jets,
546 unsigned int & nnun,unsigned int & nnii,
547 unsigned int & nnif,unsigned int & nnf,
548 unsigned int & nni) const;
549
553 template<typename Value>
554 void combineFinalState(vector<ColourSinglet<Value> > & systems) const;
555
556protected:
557
564 virtual IBPtr clone() const {return new_ptr(*this);}
565
570 virtual IBPtr fullclone() const {return new_ptr(*this);}
572
573protected:
574
582 virtual void doinit();
584
585private:
586
592
593private:
594
598 unsigned int _reconopt;
599
603 unsigned int _initialBoost;
604
609
614
619
624 Energy _minQ;
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 */
This class is responsible for the kinematical reconstruction after each showering step,...
void reconstructColourPartner(vector< ShowerProgenitorPtr > &ShowerHardJets) const
Reconstruction of a general coloured system doing colour parners.
void boostChain(tPPtr p, const LorentzRotation &bv, tPPtr &parent) const
Recursively boost the initial-state shower.
bool addIntrinsicPt(vector< ShowerProgenitorPtr >) const
Add the intrinsic to the system if needed.
bool reconstructDecayJet(const tShowerParticlePtr particleJetParent) const
Exactly similar to the previous one, but for a decay jet This methods returns false if there was no r...
double inverseRescalingFactor(vector< Lorentz5Momentum > pout, vector< Energy > mon, Energy roots) const
Compute the momentum rescaling factor needed to invert the shower.
vector< double > initialStateRescaling(double x1, double x2, const Lorentz5Momentum &pold, const vector< Lorentz5Momentum > &p, const vector< Lorentz5Momentum > &pq, const vector< Energy > &highespts) const
Calculate the initial-state rescaling factors.
map< tShowerProgenitorPtr, pair< Energy, double > > _intrinsic
Storage of the intrinsic .
void reconstructInitialInitialSystem(bool &applyBoost, LorentzRotation &toRest, LorentzRotation &fromRest, vector< ShowerProgenitorPtr >) const
Perform the reconstruction of a system with only final-state particles.
void persistentInput(PersistentIStream &is, int version)
Function used to read in object persistently.
void findPartners(Value branch, set< Value > &done, const set< Value > &branchings, vector< Value > &jets) const
Find the colour partners of a particle to identify the colour singlet systems for the reconstruction.
KinematicsReconstructor()
Default constructor.
vector< double > inverseInitialStateRescaling(double &x1, double &x2, const Lorentz5Momentum &pold, const vector< Lorentz5Momentum > &p, const vector< Lorentz5Momentum > &pq) const
Calculate the inverse of the initial-state rescaling factor.
bool solveDecayKFactor(Energy mb, const Lorentz5Momentum &n, const Lorentz5Momentum &pjet, const JetKinVect &jetKinematics, ShowerParticlePtr partner, Lorentz5Momentum ppartner[2], double &k1, double &k2, Lorentz5Momentum &qt) const
Methods to calculate the various scaling factors.
bool reconstructSpaceLikeJet(const tShowerParticlePtr particleJetParent) const
Methods to reconstruct the kinematics of individual jets.
void reconstructFinalFirst(vector< ShowerProgenitorPtr > &ShowerHardJets) const
Reconstruction of a general coloured system doing final-final, then initial-final and then initial-in...
void reconstructColourSinglets(vector< ShowerProgenitorPtr > &ShowerHardJets, ShowerInteraction type) const
Reconstruction based on colour singlet systems.
void deconstructInitialInitialSystem(bool &applyBoost, LorentzRotation &toRest, LorentzRotation &fromRest, HardTreePtr, vector< HardBranchingPtr >, ShowerInteraction) const
Perform the inverse reconstruction of a system with only initial-state particles.
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,...
LorentzRotation solveBoostZ(const Lorentz5Momentum &newq, const Lorentz5Momentum &oldq) const
Compute the boost to get from the the old momentum to the new.
PDVector _noRescaleVector
Particles which shouldn't have their masses rescaled as vector for the interface.
map< tPPtr, vector< LorentzRotation > > _boosts
Storage of the boosts applied to enable resetting after failure.
bool _finalFinalWeight
Option for FF kinematic factor.
virtual bool reconstructHardJets(ShowerTreePtr hard, const map< tShowerProgenitorPtr, pair< Energy, double > > &pt, ShowerInteraction type, bool switchRecon) const
Methods to reconstruct the kinematics of a scattering or decay process.
void deconstructFinalStateSystem(const LorentzRotation &toRest, const LorentzRotation &fromRest, HardTreePtr, vector< HardBranchingPtr >, ShowerInteraction) const
Methods to perform the inverse reconstruction of various types of colour singlet systems.
KinematicsReconstructor & operator=(const KinematicsReconstructor &)=delete
The assignment operator is private and must never be called.
unsigned int _finalStateReconOption
Option for the reconstruction of final state systems.
Energy findMass(HardBranchingPtr) const
Find the mass of a particle in the hard branching.
tShowerTreePtr _currentTree
Current ShowerTree.
unsigned int _initialBoost
Option for the boost for initial-initial reconstruction.
virtual IBPtr clone() const
Make a simple clone of this object.
Energy _minQ
Minimum invariant mass for initial-final dipoles to allow the reconstruction.
virtual void doinit()
Initialize this object after the setup phase before saving an EventGenerator to disk.
Boost solveBoostBeta(const double k, const Lorentz5Momentum &newq, const Lorentz5Momentum &oldp)
Given a 5-momentum and a scale factor, the method returns the Lorentz boost that transforms the 3-vec...
void deepTransform(PPtr particle, const LorentzRotation &r, bool match=true, PPtr original=PPtr()) const
Apply a transform to the particle and any child, including child ShowerTree objects.
void reconstructInitialFinalSystem(vector< ShowerProgenitorPtr >) const
Methods to perform the reconstruction of various types of colour singlet systems.
void reconstructGeneralSystem(vector< ShowerProgenitorPtr > &ShowerHardJets) const
Reconstruction of a general coloured system.
double solveKfactor(const Energy &root_s, const JetKinVect &jets) const
Given a vector of 5-momenta of jets, where the 3-momenta are the initial ones before showering and th...
unsigned int _initialStateReconOption
Option for the initial state reconstruction.
LorentzRotation solveBoost(const double k, const Lorentz5Momentum &newq, const Lorentz5Momentum &oldp) const
Compute the boost to get from the the old momentum to the new.
Energy momConsEq(double k, const Energy &root_s, const JetKinVect &jets) const
Check the rescaling conserves momentum.
unsigned int _reconopt
Option for handling the reconstruction.
static void Init()
The standard Init function used to initialize the interfaces.
void reconstructFinalStateSystem(bool applyBoost, const LorentzRotation &toRest, const LorentzRotation &fromRest, vector< ShowerProgenitorPtr >) const
Perform the reconstruction of a system with only final-state particles.
void reconstructFinalFinalOffShell(JetKinVect orderedJets, Energy2 s, bool recursive) const
Recursively treat the most off-shell paricle seperately for final-final reconstruction.
virtual bool deconstructHardJets(HardTreePtr, ShowerInteraction) const
Given the particles, with a history which we wish to interpret as a shower reconstruct the variables ...
bool inverseDecayRescalingFactor(vector< Lorentz5Momentum > pout, vector< Energy > mon, Energy roots, Lorentz5Momentum ppartner, Energy mbar, double &k1, double &k2) const
Compute the momentum rescaling factor needed to invert the shower.
map< tShowerTreePtr, vector< LorentzRotation > > _treeBoosts
Storage of the boosts applied to enable resetting after failure.
ColourSinglet< Value >::VecType identifySystems(set< Value > jets, unsigned int &nnun, unsigned int &nnii, unsigned int &nnif, unsigned int &nnf, unsigned int &nni) const
Find the colour singlet systems.
virtual bool reconstructTimeLikeJet(const tShowerParticlePtr particleJetParent, const tShowerParticlePtr progenitor) const
Given the particle (ShowerParticle object) that originates a forward (time-like) jet,...
void combineFinalState(vector< ColourSinglet< Value > > &systems) const
Combine final-state colour systems.
virtual bool reconstructDecayJets(ShowerTreePtr decay, ShowerInteraction type) const
Given in input a vector of the particles which initiated the showers the method does the reconstructi...
LorentzRotation solveBoost(const Lorentz5Momentum &newq, const Lorentz5Momentum &oldq) const
Various methods for the Lorentz transforms needed to do the rescalings.
virtual bool deconstructDecayJets(HardTreePtr, ShowerInteraction) const
Methods to invert the reconstruction of the shower for a scattering or decay process and calculate th...
virtual IBPtr fullclone() const
Make a clone of this object, possibly modifying the cloned object to make it sane.
set< cPDPtr > _noRescale
Particles which shouldn't have their masses rescaled as set for quick access.
void deconstructInitialFinalSystem(HardTreePtr, vector< HardBranchingPtr >, ShowerInteraction) const
Perform the inverse reconstruction of a system with only initial-state particles.
void persistentOutput(PersistentOStream &os) const
Function used to write out object persistently.
ShowerInteraction
Handy header file to be included in all Shower classes.
-*- C++ -*-
ColourSinglet< HardBranchingPtr > ColourSingletShower
Struct to store a colour singlet shower.
vector< JetKinStruct > JetKinVect
typedef for a vector of JetKinStruct
ColourSinglet< ShowerProgenitorPtr > ColourSingletSystem
Struct to store a colour singlet system of particles.
SystemType
Enum to identify types of colour singlet systems.
ThePEG::Ptr< Particle >::transient_pointer tPPtr
vector< PDPtr > PDVector
ThePEG::Ptr< InterfacedBase >::pointer IBPtr
ThePEG::Ptr< Particle >::pointer PPtr
constexpr auto sqr(const T &x) -> decltype(x *x)
SystemType type
The type of system.
vector< Value > jets
The jets in the system.
A simple struct to store the information we need on the showering.
Lorentz5Momentum q
Momentum of the particle after reconstruction.
Lorentz5Momentum p
Momentum of the particle before reconstruction.
tShowerParticlePtr parent
Parent particle of the jet.
Exception class used to communicate failure of kinematics reconstruction.