ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitPhysics/FakeMods/interface/FakeObject.h
Revision: 1.2
Committed: Mon Jul 20 19:05:04 2009 UTC (15 years, 9 months ago) by loizides
Content type: text/plain
Branch: MAIN
CVS Tags: Mit_010
Changes since 1.1: +2 -2 lines
Log Message:
Changes for html docu

File Contents

# User Rev Content
1 loizides 1.1 //--------------------------------------------------------------------------------------------------
2 loizides 1.2 // $Id: FakeObject.h,v 1.1 2009/06/30 10:47:16 loizides Exp $
3 loizides 1.1 //
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 loizides 1.2 ClassDef(FakeObject, 1) // Fake object class
45 loizides 1.1 };
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