ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/DataTree/interface/GenericParticle.h
Revision: 1.2
Committed: Thu Apr 9 10:28:51 2009 UTC (16 years ago) by ceballos
Content type: text/plain
Branch: MAIN
Changes since 1.1: +4 -1 lines
Log Message:
new GenParticle object

File Contents

# User Rev Content
1 ceballos 1.1 //--------------------------------------------------------------------------------------------------
2 ceballos 1.2 // $Id: GenericParticle.h,v 1.1 2009/04/09 10:26:18 ceballos Exp $
3 ceballos 1.1 //
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 ceballos 1.2 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 ceballos 1.1 GenericParticle(FourVector &m, Double_t c) : fMom(m), fQ(c), fObjType(kGenericParticle) {}
29 ceballos 1.2 GenericParticle(FourVector &m) : fMom(m), fQ(0), fObjType(kGenericParticle) {}
30 ceballos 1.1
31     EObjType ObjType() const { return fObjType; }
32     void Print(Option_t *opt="") const;
33    
34     void SetMom(Double_t px, Double_t py, Double_t pz, Double_t e);
35     void SetCharge(Double_t c) { fQ = c; }
36     void SetObjType(EObjType t) { fObjType = t; }
37    
38     protected:
39     Double_t GetCharge() const { return fQ; }
40     Double_t GetMass() const { return fMom.M(); }
41     void GetMom() const;
42    
43     FourVectorM fMom; //momentum vector
44     Double_t fQ; //charge value
45     EObjType fObjType; //object type
46    
47     ClassDef(GenericParticle, 1) // Generic GenericParticle class
48     };
49     }
50    
51     //--------------------------------------------------------------------------------------------------
52     inline void mithep::GenericParticle::SetMom(Double_t px, Double_t py, Double_t pz, Double_t e)
53     {
54     // Set four vector.
55    
56     fMom.SetXYZT(px, py, pz, e);
57     }
58    
59     //--------------------------------------------------------------------------------------------------
60     inline void mithep::GenericParticle::GetMom() const
61     {
62     // Get momentum values
63    
64     fCachedMom = fMom;
65     }
66     #endif