1 |
loizides |
1.1 |
//--------------------------------------------------------------------------------------------------
|
2 |
|
|
// $Id: $
|
3 |
|
|
//
|
4 |
|
|
// FakeObject
|
5 |
|
|
//
|
6 |
|
|
// Class for particles which have been faked from a fakeable object
|
7 |
|
|
//
|
8 |
|
|
// Authors: S.Xie
|
9 |
|
|
//--------------------------------------------------------------------------------------------------
|
10 |
|
|
|
11 |
|
|
#ifndef MITPHYSICS_FAKEMODS_FAKEOBJECT_H
|
12 |
|
|
#define MITPHYSICS_FAKEMODS_FAKEOBJECT_H
|
13 |
|
|
|
14 |
|
|
#include "MitAna/DataTree/interface/Particle.h"
|
15 |
|
|
|
16 |
|
|
namespace mithep
|
17 |
|
|
{
|
18 |
|
|
class FakeObject : public Particle
|
19 |
|
|
{
|
20 |
|
|
public:
|
21 |
|
|
FakeObject() {}
|
22 |
|
|
~FakeObject() {}
|
23 |
|
|
|
24 |
|
|
const Particle *FakeParticle() const { return fParticle; }
|
25 |
|
|
Bool_t FakeTag() const { return fFakeTag; }
|
26 |
|
|
Bool_t MCTag() const { return fMCTag; }
|
27 |
|
|
EObjType ObjType() const { return fFakeType; }
|
28 |
|
|
|
29 |
|
|
void SetFakeType(EObjType type) { fFakeType = type; }
|
30 |
|
|
void SetFakeTag(Bool_t tag) { fFakeTag = tag; }
|
31 |
|
|
void SetMCTag(Bool_t tag) { fMCTag = tag; }
|
32 |
|
|
void SetParticle(const Particle *p) { fParticle = p; ClearMom(); ClearCharge(); }
|
33 |
|
|
|
34 |
|
|
protected:
|
35 |
|
|
Double_t GetCharge() const;
|
36 |
|
|
Double_t GetMass() const { return fParticle->Mass(); }
|
37 |
|
|
void GetMom() const;
|
38 |
|
|
|
39 |
|
|
Bool_t fFakeTag; //!whether the fake object passed lepton ID criteria
|
40 |
|
|
Bool_t fMCTag; //!whether the fake object was a true fake in Monte Carlo
|
41 |
|
|
EObjType fFakeType; //!the type of object it faked
|
42 |
|
|
const Particle *fParticle; //!pointer to the original particle
|
43 |
|
|
|
44 |
|
|
ClassDef(FakeObject, 1) // Charged particle class
|
45 |
|
|
};
|
46 |
|
|
}
|
47 |
|
|
|
48 |
|
|
//--------------------------------------------------------------------------------------------------
|
49 |
|
|
inline Double_t mithep::FakeObject::GetCharge() const
|
50 |
|
|
{
|
51 |
|
|
// Get charge from track.
|
52 |
|
|
|
53 |
|
|
if (fParticle)
|
54 |
|
|
return fParticle->Charge();
|
55 |
|
|
else
|
56 |
|
|
return 0;
|
57 |
|
|
}
|
58 |
|
|
|
59 |
|
|
//--------------------------------------------------------------------------------------------------
|
60 |
|
|
inline void mithep::FakeObject::GetMom() const
|
61 |
|
|
{
|
62 |
|
|
// Get momentum of the electron. We use an explicitly stored three vector, with the pdg mass,
|
63 |
|
|
// since the momentum vector may be computed non-trivially in cmssw
|
64 |
|
|
if (fParticle) {
|
65 |
|
|
fCachedMom.SetCoordinates(fParticle->Pt(),fParticle->Eta(),
|
66 |
|
|
fParticle->Phi(),fParticle->Mass());
|
67 |
|
|
} else {
|
68 |
|
|
fCachedMom.SetCoordinates(0,0,0,0);
|
69 |
|
|
}
|
70 |
|
|
}
|
71 |
|
|
|
72 |
|
|
#endif
|