ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/DataTree/interface/ChargedParticle.h
Revision: 1.5
Committed: Fri Oct 31 17:41:44 2008 UTC (16 years, 6 months ago) by bendavid
Content type: text/plain
Branch: MAIN
CVS Tags: Mit_006
Changes since 1.4: +2 -1 lines
Log Message:
Added TrackerTrk accessor to ChargedParticle and StableParticle

File Contents

# User Rev Content
1 bendavid 1.1 //--------------------------------------------------------------------------------------------------
2 bendavid 1.5 // $Id: ChargedParticle.h,v 1.4 2008/09/10 03:33:26 loizides Exp $
3 bendavid 1.1 //
4     // ChargedParticle
5     //
6 loizides 1.3 // Abstract base class for particles which have a corresponding track.
7 bendavid 1.1 //
8     // Authors: C.Loizides, J.Bendavid
9     //--------------------------------------------------------------------------------------------------
10    
11 loizides 1.4 #ifndef MITANA_DATATREE_CHARGEDPARTICLE_H
12     #define MITANA_DATATREE_CHARGEDPARTICLE_H
13 bendavid 1.1
14     #include "MitAna/DataTree/interface/Particle.h"
15     #include "MitAna/DataTree/interface/Track.h"
16    
17     namespace mithep
18     {
19     class ChargedParticle : public Particle
20     {
21     public:
22     ChargedParticle() {}
23     ~ChargedParticle() {}
24    
25 loizides 1.3 Double_t Charge() const { return Trk()->Charge(); }
26 bendavid 1.1 Double_t E() const;
27 loizides 1.3 Double_t Eta() const { return Trk()->Mom().Eta(); }
28     virtual const Track *Trk() const = 0;
29 bendavid 1.5 virtual const Track *TrackerTrk() const = 0;
30 bendavid 1.1 FourVector Mom() const { return FourVector(Px(),Py(),Pz(),E()); }
31 loizides 1.3 Double_t Phi() const { return Trk()->Phi(); }
32     Double_t P() const { return Trk()->P(); }
33     Double_t Pt() const { return Trk()->Pt(); }
34     Double_t Px() const { return Trk()->Px(); }
35     Double_t Py() const { return Trk()->Py(); }
36     Double_t Pz() const { return Trk()->Pz(); }
37 bendavid 1.1
38 loizides 1.3 ClassDef(ChargedParticle, 1) // Charged particle class
39 bendavid 1.1 };
40     }
41    
42     //--------------------------------------------------------------------------------------------------
43     inline Double_t mithep::ChargedParticle::E() const
44     {
45 loizides 1.3 return TMath::Sqrt(Trk()->P()*Trk()->P() + Mass()*Mass());
46 bendavid 1.1 }
47     #endif