ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitPhysics/Utils/src/DiTauSystem.cc
Revision: 1.8
Committed: Tue May 24 13:33:49 2011 UTC (13 years, 11 months ago) by klute
Content type: text/plain
Branch: MAIN
CVS Tags: Mit_029c, Mit_029b, Mit_029a, Mit_028a, Mit_028, Mit_027, Mit_027a, Mit_025e, Mit_025d, Mit_025c, Mit_025b, Mit_025a, Mit_025, Mit_025pre2, Mit_024b, Mit_025pre1, Mit_024a, Mit_024, Mit_023, Mit_022a, Mit_022, HEAD
Changes since 1.7: +28 -1 lines
Log Message:
added pzeta stuff

File Contents

# Content
1 // $Id: DiTauSystem.cc,v 1.7 2009/07/20 04:55:33 loizides Exp $
2
3 #include "MitPhysics/Utils/interface/DiTauSystem.h"
4 #include "MitCommon/MathTools/interface/MathUtils.h"
5 #include "MitAna/DataTree/interface/CompositeParticle.h"
6 #include "MitAna/DataTree/interface/Met.h"
7 #include "MitAna/DataTree/interface/Particle.h"
8
9 ClassImp(mithep::DiTauSystem)
10
11 using namespace mithep;
12
13 //--------------------------------------------------------------------------------------------------
14 DiTauSystem::DiTauSystem(const Particle *t1, const Particle *t2, const Met *met) :
15 fT1(t1),
16 fT2(t2),
17 fMet(met),
18 fRecoMass(0),
19 fVisMass(0),
20 fMT(0),
21 fETll(0),
22 fETnn(0)
23 {
24 // Constructor.
25
26 Init();
27 }
28
29 //--------------------------------------------------------------------------------------------------
30 void DiTauSystem::Init()
31 {
32 // Calculate the kinematical variables.
33
34 CompositeParticle tt;
35 tt.AddDaughter(fT1);
36 tt.AddDaughter(fT2);
37
38 CompositeParticle higgs;
39 higgs.AddDaughter(fT1);
40 higgs.AddDaughter(fT2);
41 higgs.AddDaughter(fMet);
42
43 Double_t xvar[3];
44 xvar[0] = higgs.Px()*fT2->Py()-higgs.Py()*fT2->Px();
45 xvar[1] = higgs.Py()*fT1->Px()-higgs.Px()*fT1->Py();
46 xvar[2] = fT1->Px()*fT2->Py()-fT1->Py()*fT2->Px();
47
48 for (Int_t i=0; i<2; ++i)
49 xvar[i]==0 ? fXTau[i]=0 : fXTau[i]=xvar[2]/xvar[i];
50
51 fVisMass = tt.Mass();
52 if (fXTau[0] > 0 && fXTau[1] > 0)
53 fRecoMass = fVisMass / TMath::Sqrt(fXTau[0]*fXTau[1]);
54 else
55 fRecoMass = 0;
56
57 Double_t visMassS = fVisMass*fVisMass;
58 Double_t ptll = tt.Pt();
59 Double_t ptmis = fMet->Pt();
60 if (visMassS > 0) {
61 fETll = TMath::Sqrt(ptll*ptll + visMassS);
62 fETnn = TMath::Sqrt(ptmis*ptmis + visMassS);
63 fMT = (fETll+fETnn)*(fETll+fETnn)-(ptll+ptmis)*(ptll+ptmis);
64 (fMT > 0) ? fMT=TMath::Sqrt(fMT) : fMT=0;
65 }
66
67 Double_t phi1 = fT1->Phi();
68 Double_t phi2 = fT2->Phi();
69 Double_t dphi = MathUtils::DeltaPhi(phi1, phi2);
70 Double_t dphiHalf = dphi/2.;
71 Double_t projPhi = 0;
72 if ( phi1 > phi2 )
73 if ( phi1 - phi2 < TMath::Pi() )
74 projPhi = phi1 - dphiHalf;
75 else
76 projPhi = phi1 + dphiHalf;
77 else
78 if ( phi2 - phi1 < TMath::Pi() )
79 projPhi = phi2 - dphiHalf;
80 else
81 projPhi = phi2 + dphiHalf;
82
83 Double_t projX = cos(projPhi);
84 Double_t projY = sin(projPhi);
85
86 fProj = higgs.Px()*projX + higgs.Py()*projY;
87 fProjVis = tt.Px()*projX + tt.Py()*projY;
88 fProjMet = fMet->Px()*projX + fMet->Py()*projY;
89 fProjPhi = projPhi;
90 fHt = fMet->Pt()+ fT1->Pt() + fT2->Pt();
91
92 }