herwig is hosted by Hepforge, IPPP Durham
Herwig++  2.7.0
EventShapes2.h
00001 // -*- C++ -*-
00002 
00003 // (C) 2007-2009 Simon Plaetzer -- sp@particle.uni-karlsruhe.de
00004 // Copyright (C) 2002-2007 The Herwig Collaboration
00005 
00006 #ifndef Analysis2_EventShapes2_H
00007 #define Analysis2_EventShapes2_H
00008 //
00009 // This is the declaration of the EventShapes2 class.
00010 //
00011 
00012 #include "Analysis2Base.h"
00013 #include "ThePEG/Vectors/Lorentz5Vector.h"
00014 #include "ThePEG/Vectors/ThreeVector.h"
00015 #include "ThePEG/EventRecord/Particle.h"
00016 #include "EventShapes2.fh"
00017 
00018 namespace Analysis2 {
00019 
00020 using namespace ThePEG;
00021 
00029 class EventShapes2: public Analysis2Base {
00030 
00031 public:
00032 
00038   inline EventShapes2();
00039 
00043   virtual ~EventShapes2();
00045 
00046 public:
00047 
00053   virtual void analyze(const tPVector & particles);
00054 
00055 public:
00056 
00063   void persistentOutput(PersistentOStream & os) const;
00064 
00070   void persistentInput(PersistentIStream & is, int version);
00072 
00079   static void Init();
00080 
00081 protected:
00082 
00089   inline virtual IBPtr clone() const;
00090 
00095   inline virtual IBPtr fullclone() const;
00097 
00098 protected:
00099 
00103   inline void reset(const vector<Lorentz5Momentum> &part);
00104 
00112   inline double thrust();
00113 
00117   inline double thrustMajor();
00118 
00122   inline double thrustMinor();
00123 
00127   inline double oblateness(); 
00128 
00132   inline Axis thrustAxis();
00133 
00137   inline Axis majorAxis(); 
00138 
00142   inline Axis minorAxis(); 
00144 
00152   inline double CParameter();
00153 
00157   inline double DParameter();
00158 
00162   inline vector<double> linTenEigenValues();
00163 
00167   inline vector<Axis> linTenEigenVectors();
00169 
00177   inline double sphericity();
00178 
00182   inline double aplanarity();
00183 
00187   inline double planarity();
00188 
00192   inline Axis sphericityAxis();
00193 
00197   inline vector<double> sphericityEigenValues();
00198 
00202   inline vector<Axis> sphericityEigenVectors();
00204 
00212   inline double Mhigh2();
00213 
00217   inline double Mlow2();
00218 
00223   inline double Mdiff2();
00225 
00233   inline double Bmax();
00234 
00238   inline double Bmin();
00239 
00243   inline double Bsum();
00244 
00248   inline double Bdiff();
00250 
00258   inline double getX(const Lorentz5Momentum & p, const Energy & Ebeam);
00259 
00263   inline double getXi(const Lorentz5Momentum & p, const Energy & Ebeam);
00264 
00268   inline Energy getPt(const Lorentz5Momentum & p);
00269 
00273   inline double getRapidity(const Lorentz5Momentum & p);
00275 
00283   inline Energy ptInT(const Lorentz5Momentum & p);
00284 
00288   inline Energy ptOutT(const Lorentz5Momentum & p);
00289 
00293   inline double yT(const Lorentz5Momentum & p);
00294 
00298   inline Energy ptInS(const Lorentz5Momentum & p);
00299 
00303   inline Energy ptOutS(const Lorentz5Momentum & p);
00304 
00308   inline double yS(const Lorentz5Momentum & p);
00310 
00311 
00312 // If needed, insert declarations of virtual function defined in the
00313 // InterfacedBase class here (using ThePEG-interfaced-decl in Emacs).
00314 
00315 
00316 protected:
00317 
00320 
00326   virtual void doinit() throw(InitException);
00327 
00332   virtual void dofinish();
00333 
00334 private:
00335 
00344   inline void checkThrust();
00345 
00349   inline void checkLinTen();
00350 
00354   inline void checkSphericity();
00355 
00360   inline void checkHemispheres();
00362 
00370   inline void calcHemisphereMasses();
00371 
00375   void calculateThrust();
00376 
00383   void diagonalizeTensors(bool linear, bool cmboost);
00384 
00393   vector<double> eigenvalues(const double T[3][3]);
00394 
00398   Axis eigenvector(const double T[3][3], const double &lam);
00399 
00405   vector<Axis> eigenvectors(const double T[3][3], const vector<double> &lam);
00406 
00413   void calcT(const vector<Momentum3> &p, Energy2 &t, Axis &taxis);
00414 
00421   void calcM(const vector<Momentum3> &p, Energy2 &m, Axis &maxis);
00423 
00424 private:
00425 
00429   vector<Lorentz5Momentum> _pv; 
00430   
00438   vector<Axis> _thrustAxis;
00439 
00443   vector<Axis> _spherAxis; 
00444 
00448   vector<Axis> _linTenAxis; 
00450 
00458   vector<double> _thrust;
00459 
00463   vector<double> _spher;
00464 
00468   vector<double> _linTen;
00470 
00478   bool _thrustDone;
00479 
00483   bool _spherDone;
00484 
00488   bool _linTenDone;
00489 
00493   bool _hemDone; 
00495 
00499   bool _useCmBoost;
00500 
00508   double _mPlus;
00509 
00513   double _mMinus;
00515 
00523   double _bPlus;
00524 
00528   double _bMinus; 
00530 
00531 private:
00532 
00536   string _omthr;
00537 
00541   string _maj;
00542 
00546   string _min;
00547 
00551   string _obl;
00552 
00556   string _sph;
00557 
00561   string _apl;
00562 
00566   string _pla;
00567 
00571   string _c;
00572 
00576   string _d;
00577 
00581   string _mhi;
00582 
00586   string _mlo;
00587 
00591   string _mdiff;
00592 
00596   string _bmax;
00597 
00601   string _bmin;
00602 
00606   string _bsum;
00607 
00611   string _bdiff;
00612 
00617   static ClassDescription<EventShapes2> initEventShapes2;
00618 
00623   EventShapes2 & operator=(const EventShapes2 &);
00624 
00625 };
00626 
00627 }
00628 
00629 #include "ThePEG/Utilities/ClassTraits.h"
00630 
00631 namespace ThePEG {
00632 
00637 template <>
00638 struct BaseClassTrait<Analysis2::EventShapes2,1> {
00640   typedef Analysis2::Analysis2Base NthBase;
00641 };
00642 
00645 template <>
00646 struct ClassTraits<Analysis2::EventShapes2>
00647   : public ClassTraitsBase<Analysis2::EventShapes2> {
00649   static string className() { return "Analysis2::EventShapes2"; }
00657   static string library() { return "Analysis2.so"; }
00658 };
00659 
00662 }
00663 
00664 #include "EventShapes2.icc"
00665 #ifndef ThePEG_TEMPLATES_IN_CC_FILE
00666 // #include "EventShapes2.tcc"
00667 #endif
00668 
00669 #endif /* Analysis2_EventShapes2_H */