ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/DataTree/interface/GenericParticle.h
Revision: 1.1
Committed: Thu Apr 9 10:26:18 2009 UTC (16 years, 1 month ago) by ceballos
Content type: text/plain
Branch: MAIN
Log Message:
new GenParticle object

File Contents

# Content
1 //--------------------------------------------------------------------------------------------------
2 // $Id: GenericParticle.h,v 1.31 2009/04/06 09:50:49 loizides Exp $
3 //
4 // GenericParticle
5 //
6 // General GenericParticle class. It provides an abstract interface to kinematical quantities
7 // computed by derived classes.
8 //
9 // Authors: 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(FourVector &m, Double_t c) : fMom(m), fQ(c), fObjType(kGenericParticle) {}
27
28 EObjType ObjType() const { return fObjType; }
29 void Print(Option_t *opt="") const;
30
31 void SetMom(Double_t px, Double_t py, Double_t pz, Double_t e);
32 void SetCharge(Double_t c) { fQ = c; }
33 void SetObjType(EObjType t) { fObjType = t; }
34
35 protected:
36 Double_t GetCharge() const { return fQ; }
37 Double_t GetMass() const { return fMom.M(); }
38 void GetMom() const;
39
40 FourVectorM fMom; //momentum vector
41 Double_t fQ; //charge value
42 EObjType fObjType; //object type
43
44 ClassDef(GenericParticle, 1) // Generic GenericParticle class
45 };
46 }
47
48 //--------------------------------------------------------------------------------------------------
49 inline void mithep::GenericParticle::SetMom(Double_t px, Double_t py, Double_t pz, Double_t e)
50 {
51 // Set four vector.
52
53 fMom.SetXYZT(px, py, pz, e);
54 }
55
56 //--------------------------------------------------------------------------------------------------
57 inline void mithep::GenericParticle::GetMom() const
58 {
59 // Get momentum values
60
61 fCachedMom = fMom;
62 }
63 #endif