CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch9/src/TopQuarkAnalysis/TopTools/interface/TopologyWorker.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 //
00003 // Package:    TopTools
00004 // Class:      TopologyWorker
00005 // 
00014 #ifndef __TOPTOOLSTOPOLOGYWORKER__
00015 #define __TOPTOOLSTOPOLOGYWORKER__
00016 
00017 #include "TF1.h"
00018 #include "TMath.h"
00019 #include "TClass.h"
00020 #include "TString.h"
00021 #include "TRandom.h"
00022 #include "TMatrixD.h"
00023 #include "TLorentzVector.h"
00024 
00025 
00026 class TopologyWorker
00027 {
00028 public:
00029   TopologyWorker(){;}
00030   TopologyWorker(bool boost);
00031   virtual ~TopologyWorker(){;}
00032 
00033   void clear(void){m_np=0;m_np2=0;return;}
00034   
00035   void setPartList(TObjArray* e1, TObjArray* e2);
00036   void setVerbose(bool loud){m_verbose=loud; return;}
00037   
00038   void     setThMomPower(double tp);
00039   double   getThMomPower();
00040   void     setFast(int nf);
00041   int      getFast();
00042   
00043   TVector3 thrustAxis();
00044   TVector3 majorAxis();
00045   TVector3 minorAxis();
00046   
00047   TVector3 thrust(); 
00048   // thrust :: Corresponding thrust, major, and minor value.
00049   
00050   double oblateness();
00051   double get_sphericity();
00052   double get_aplanarity();
00053   double get_h10();
00054   double get_h20();
00055   double get_h30();
00056   double get_h40();
00057   double get_h50();
00058   double get_h60();
00059 
00060 
00061   void planes_sphe(double& pnorm,double& p2, double& p3);
00062   void planes_sphe_wei(double& pnorm,double& p2, double& p3);
00063   void planes_thrust(double& pnorm,double& p2, double& p3);
00064   void sumangles(float& sdeta, float& sdr);
00065   
00066   double get_ht() {return m_ht;}
00067   double get_ht3() {return m_ht3;}
00068   double get_et0() {return m_et0;}
00069   double get_sqrts() {return m_sqrts;}
00070   double get_njetW() {return m_njetsweighed;}
00071   double get_et56() {return m_et56;}
00072   double get_centrality() { return m_centrality;}
00073   
00074 private:        
00075   bool m_verbose;
00076   void getetaphi(double px, double py, double pz, double& eta, double& phi);
00077   double ulAngle(double x, double y);
00078   double sign(double a, double b);
00079   void     ludbrb(TMatrix *mom, 
00080                   double the, 
00081                   double phi, 
00082                   double bx, 
00083                   double by,
00084                   double bz);
00085   
00086   int iPow(int man, int exp);
00087   
00088   double m_dSphMomPower; 
00089   // PARU(41): Power of momentum dependence in sphericity finder.
00090   
00091   double m_dDeltaThPower;
00092   // PARU(42): Power of momentum dependence in thrust finder.   
00093   
00094   int m_iFast; 
00095   // MSTU(44): # of initial fastest particles choosen to start search.
00096   
00097   double m_dConv;
00098   // PARU(48): Convergence criteria for axis maximization.
00099   
00100   int m_iGood;
00101   // MSTU(45): # different starting configurations that must
00102   // converge before axis is accepted as correct.       
00103   
00104   TMatrix m_dAxes;
00105   // data: results
00106   // m_dAxes[1] is the Thrust axis.
00107   // m_dAxes[2] is the Major axis.
00108   // m_dAxes[3] is the Minor axis.
00109   
00110   TVector3 m_ThrustAxis;
00111   TVector3 m_MajorAxis;
00112   TVector3 m_MinorAxis;
00113   TVector3 m_Thrust;
00114   
00115   TRandom m_random;
00116   
00117   TMatrix m_mom;
00118   TMatrix m_mom2;
00119   
00120   double m_dThrust[4];
00121   double m_dOblateness;
00122   int m_np;
00123   int m_np2;
00124   bool m_sanda_called;
00125   bool m_fowo_called;
00126   bool m_boost;
00127   bool m_sumangles_called;
00128   double m_sph;
00129   double m_apl;
00130   double m_h10;
00131   double m_h20;
00132   double m_h30;
00133   double m_h40;
00134   double m_h50;
00135   double m_h60;
00136   double m_ht;
00137   double m_ht3;
00138   double m_et0;
00139   double m_sqrts;
00140   double m_njetsweighed;
00141   double m_et56;
00142   double m_centrality;
00143   
00144   void sanda();
00145   void fowo();
00146   static int m_maxpart;
00147   
00148   void CalcWmul();
00149   void CalcSqrts();
00150   void CalcHTstuff();
00151   double CalcPt(int i) { return sqrt(pow(m_mom(i,1),2)+pow(m_mom(i,2),2));}
00152   double CalcPt2(int i)  { return sqrt(pow(m_mom2(i,1),2)+pow(m_mom2(i,2),2));}
00153   double CalcEta(int i) {double eta, phi;getetaphi(m_mom(i,1),m_mom(i,2),m_mom(i,3),eta,phi); return eta;}
00154   double CalcEta2(int i) {double eta, phi; getetaphi(m_mom2(i,1),m_mom2(i,2),m_mom2(i,3),eta,phi); return eta;}
00155   
00156 };
00157 
00158 class LessThan {
00159    public :
00160      // retrieve tru info MC stuff
00161   bool operator () (const TLorentzVector & tl1, const TLorentzVector &
00162                     tl2)
00163     const {
00164     return tl2.Pt() < tl1.Pt();
00165   }
00166 };
00167 #endif
00168 
00169 
00170 
00171