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 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

# User Rev Content
1 ceballos 1.1 //--------------------------------------------------------------------------------------------------
2 loizides 1.3 // $Id: GenericParticle.h,v 1.2 2009/04/09 10:28:51 ceballos Exp $
3 ceballos 1.1 //
4     // GenericParticle
5     //
6 loizides 1.3 // 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 ceballos 1.1 //
9 loizides 1.3 // Authors: G.Ceballos, C.Loizides
10 ceballos 1.1 //--------------------------------------------------------------------------------------------------
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 loizides 1.3 GenericParticle(FourVectorM &m, Double_t c) : fMom(m), fQ(c), fObjType(kGenericParticle) {}
30 ceballos 1.1
31     void Print(Option_t *opt="") const;
32 loizides 1.3 EObjType RecoObjType() const { return fObjType; }
33     void SetCharge(Double_t c) { fQ = c; }
34 ceballos 1.1 void SetMom(Double_t px, Double_t py, Double_t pz, Double_t e);
35 loizides 1.3 void SetRecoObjType(EObjType t) { fObjType = t; }
36 ceballos 1.1
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 loizides 1.3 ClassDef(GenericParticle, 1) // Generic particle class
47 ceballos 1.1 };
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 loizides 1.3 // Get momentum values.
62 ceballos 1.1
63     fCachedMom = fMom;
64     }
65     #endif