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