ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/DataTree/interface/ChargedParticle.h
Revision: 1.12
Committed: Mon Oct 18 01:33:09 2010 UTC (14 years, 6 months ago) by bendavid
Content type: text/plain
Branch: MAIN
Changes since 1.11: +5 -2 lines
Log Message:
Add corrected expected hits inner for electrons and muons

File Contents

# User Rev Content
1 bendavid 1.1 //--------------------------------------------------------------------------------------------------
2 bendavid 1.12 // $Id: ChargedParticle.h,v 1.11 2009/10/30 14:16:00 bendavid Exp $
3 bendavid 1.1 //
4     // ChargedParticle
5     //
6 loizides 1.3 // Abstract base class for particles which have a corresponding track.
7 bendavid 1.1 //
8     // Authors: C.Loizides, J.Bendavid
9     //--------------------------------------------------------------------------------------------------
10    
11 loizides 1.4 #ifndef MITANA_DATATREE_CHARGEDPARTICLE_H
12     #define MITANA_DATATREE_CHARGEDPARTICLE_H
13 bendavid 1.1
14     #include "MitAna/DataTree/interface/Particle.h"
15     #include "MitAna/DataTree/interface/Track.h"
16    
17     namespace mithep
18     {
19     class ChargedParticle : public Particle
20     {
21     public:
22     ChargedParticle() {}
23    
24 loizides 1.9 EObjType ObjType() const { return kChargedParticle; }
25     virtual const Track *TrackerTrk() const { return Trk(); }
26 bendavid 1.11 virtual const Track *Trk() const { return 0; }
27 bendavid 1.12 Int_t CorrectedNExpectedHitsInner() const { return fCorrectedNExpectedHitsInner; }
28     void SetCorrectedNExpectedHitsInner(Int_t n) { fCorrectedNExpectedHitsInner = n; }
29 loizides 1.8
30     protected:
31     Double_t GetCharge() const;
32     void GetMom() const;
33 bendavid 1.12 Int_t fCorrectedNExpectedHitsInner; //corrected NExpectedHitsInner
34 loizides 1.7
35 bendavid 1.12 ClassDef(ChargedParticle, 2) // Charged particle class
36 bendavid 1.1 };
37     }
38    
39     //--------------------------------------------------------------------------------------------------
40 loizides 1.8 inline Double_t mithep::ChargedParticle::GetCharge() const
41     {
42     // Get charge from track.
43    
44     const mithep::Track *trk = Trk();
45     if (trk)
46     return trk->Charge();
47     else
48     return 0;
49     }
50    
51     //--------------------------------------------------------------------------------------------------
52     inline void mithep::ChargedParticle::GetMom() const
53 bendavid 1.1 {
54 loizides 1.8 // Get momentum values from track.
55 loizides 1.6
56 loizides 1.8 const mithep::Track *trk = Trk();
57     if (trk)
58     fCachedMom.SetCoordinates(trk->Pt(),trk->Eta(),trk->Phi(),GetMass());
59     else
60 loizides 1.10 fCachedMom.SetCoordinates(0,0,0,GetMass());
61 bendavid 1.1 }
62     #endif