Revision: | 1.4 |
Committed: | Tue Aug 11 09:15:59 2009 UTC (15 years, 8 months ago) by loizides |
Content type: | text/plain |
Branch: | MAIN |
CVS Tags: | Mit_029c, Mit_029b, Mit_029a, Mit_028a, Mit_028, Mit_027, Mit_027a, Mit_025e, Mit_025d, Mit_025c, Mit_025b, Mit_025a, Mit_025, Mit_025pre2, Mit_024b, Mit_025pre1, Mit_024a, Mit_024, Mit_023, Mit_022a, Mit_022, Mit_020d, TMit_020d, Mit_020c, Mit_021, Mit_021pre2, Mit_021pre1, Mit_020b, Mit_020a, Mit_020, Mit_020pre1, Mit_018, Mit_017, Mit_017pre3, Mit_017pre2, Mit_017pre1, Mit_016, Mit_015b, Mit_015a, Mit_015, Mit_014e, Mit_014d, Mit_014c, Mit_014b, Mit_014a, Mit_014, Mit_014pre3, Mit_014pre2, Mit_014pre1, Mit_013d, Mit_013c, Mit_013b, Mit_013a, Mit_013, Mit_013pre1, Mit_012i, Mit_012g, Mit_012f, Mit_012e, Mit_012d, Mit_012c, Mit_012b, Mit_012a, Mit_012, Mit_011a, Mit_011, Mit_010a, HEAD |
Changes since 1.3: | +1 -2 lines |
Log Message: | Further cleanup |
# | Content |
---|---|
1 | //-------------------------------------------------------------------------------------------------- |
2 | // $Id: FakeObject.h,v 1.3 2009/08/10 16:07:26 phedex Exp $ |
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 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) // Fake object class |
45 | }; |
46 | } |
47 | |
48 | //-------------------------------------------------------------------------------------------------- |
49 | inline Double_t mithep::FakeObject::GetCharge() const |
50 | { |
51 | // Get charge of the fake object. Charge is calculated from the original particle. |
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 | #endif |