1 |
ceballos |
1.1 |
//--------------------------------------------------------------------------------------------------
|
2 |
loizides |
1.4 |
// $Id: GenericParticle.h,v 1.3 2009/04/09 11:24:45 loizides 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 |
loizides |
1.4 |
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 |
ceballos |
1.1 |
|
35 |
|
|
void Print(Option_t *opt="") const;
|
36 |
loizides |
1.3 |
EObjType RecoObjType() const { return fObjType; }
|
37 |
loizides |
1.4 |
void SetCharge(Double_t c) { fQ = c; ClearCharge(); }
|
38 |
ceballos |
1.1 |
void SetMom(Double_t px, Double_t py, Double_t pz, Double_t e);
|
39 |
loizides |
1.3 |
void SetRecoObjType(EObjType t) { fObjType = t; }
|
40 |
ceballos |
1.1 |
|
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 |
loizides |
1.3 |
ClassDef(GenericParticle, 1) // Generic particle class
|
51 |
ceballos |
1.1 |
};
|
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 |
loizides |
1.4 |
ClearMom();
|
61 |
ceballos |
1.1 |
}
|
62 |
|
|
|
63 |
|
|
//--------------------------------------------------------------------------------------------------
|
64 |
|
|
inline void mithep::GenericParticle::GetMom() const
|
65 |
|
|
{
|
66 |
loizides |
1.3 |
// Get momentum values.
|
67 |
ceballos |
1.1 |
|
68 |
|
|
fCachedMom = fMom;
|
69 |
|
|
}
|
70 |
|
|
#endif
|