ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/DataTree/interface/GenericParticle.h
Revision: 1.3
Committed: Thu Apr 9 11:24:45 2009 UTC (16 years, 1 month ago) by loizides
Content type: text/plain
Branch: MAIN
CVS Tags: Mit_009
Changes since 1.2: +10 -11 lines
Log Message:
Cleanup

File Contents

# Content
1 //--------------------------------------------------------------------------------------------------
2 // $Id: GenericParticle.h,v 1.2 2009/04/09 10:28:51 ceballos Exp $
3 //
4 // GenericParticle
5 //
6 // General particle class to be filled and used at analysis time.
7 // It provides an abstract interface to kinematical quantities computed by derived classes.
8 //
9 // Authors: G.Ceballos, C.Loizides
10 //--------------------------------------------------------------------------------------------------
11
12 #ifndef MITANA_DATATREE_GENERICPARTICLE_H
13 #define MITANA_DATATREE_GENERICPARTICLE_H
14
15 #include <TMath.h>
16 #include "MitAna/DataTree/interface/Particle.h"
17
18 namespace mithep
19 {
20 class GenericParticle : public Particle
21 {
22 public:
23 GenericParticle(): fQ(0), fObjType(kGenericParticle) {}
24 GenericParticle(Double_t px, Double_t py, Double_t pz, Double_t e, Double_t c) :
25 fMom(FourVector(px,py,pz,e)), fQ(c), fObjType(kGenericParticle) {}
26 GenericParticle(Double_t px, Double_t py, Double_t pz, Double_t e) :
27 fMom(FourVector(px,py,pz,e)), fQ(0), fObjType(kGenericParticle) {}
28 GenericParticle(FourVector &m, Double_t c) : fMom(m), fQ(c), fObjType(kGenericParticle) {}
29 GenericParticle(FourVectorM &m, Double_t c) : fMom(m), fQ(c), fObjType(kGenericParticle) {}
30
31 void Print(Option_t *opt="") const;
32 EObjType RecoObjType() const { return fObjType; }
33 void SetCharge(Double_t c) { fQ = c; }
34 void SetMom(Double_t px, Double_t py, Double_t pz, Double_t e);
35 void SetRecoObjType(EObjType t) { fObjType = t; }
36
37 protected:
38 Double_t GetCharge() const { return fQ; }
39 Double_t GetMass() const { return fMom.M(); }
40 void GetMom() const;
41
42 FourVectorM fMom; //momentum vector
43 Double_t fQ; //charge value
44 EObjType fObjType; //object type
45
46 ClassDef(GenericParticle, 1) // Generic particle class
47 };
48 }
49
50 //--------------------------------------------------------------------------------------------------
51 inline void mithep::GenericParticle::SetMom(Double_t px, Double_t py, Double_t pz, Double_t e)
52 {
53 // Set four vector.
54
55 fMom.SetXYZT(px, py, pz, e);
56 }
57
58 //--------------------------------------------------------------------------------------------------
59 inline void mithep::GenericParticle::GetMom() const
60 {
61 // Get momentum values.
62
63 fCachedMom = fMom;
64 }
65 #endif