Revision: | 1.13 |
Committed: | Mon Oct 18 02:08:48 2010 UTC (14 years, 6 months ago) by bendavid |
Content type: | text/plain |
Branch: | MAIN |
CVS Tags: | Mit_032, Mit_031, Mit_025c_branch2, Mit_025c_branch1, Mit_030, Mit_029c, Mit_029b, Mit_030_pre1, Mit_029a, Mit_029, Mit_029_pre1, Mit_028a, Mit_025c_branch0, Mit_028, Mit_027a, Mit_027, Mit_026, 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, HEAD |
Branch point for: | Mit_025c_branch |
Changes since 1.12: | +2 -2 lines |
Log Message: | fix uninitialized variable |
# | Content |
---|---|
1 | //-------------------------------------------------------------------------------------------------- |
2 | // $Id: ChargedParticle.h,v 1.12 2010/10/18 01:33:09 bendavid Exp $ |
3 | // |
4 | // ChargedParticle |
5 | // |
6 | // Abstract base class for particles which have a corresponding track. |
7 | // |
8 | // Authors: C.Loizides, J.Bendavid |
9 | //-------------------------------------------------------------------------------------------------- |
10 | |
11 | #ifndef MITANA_DATATREE_CHARGEDPARTICLE_H |
12 | #define MITANA_DATATREE_CHARGEDPARTICLE_H |
13 | |
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() : fCorrectedNExpectedHitsInner(0) {} |
23 | |
24 | EObjType ObjType() const { return kChargedParticle; } |
25 | virtual const Track *TrackerTrk() const { return Trk(); } |
26 | virtual const Track *Trk() const { return 0; } |
27 | Int_t CorrectedNExpectedHitsInner() const { return fCorrectedNExpectedHitsInner; } |
28 | void SetCorrectedNExpectedHitsInner(Int_t n) { fCorrectedNExpectedHitsInner = n; } |
29 | |
30 | protected: |
31 | Double_t GetCharge() const; |
32 | void GetMom() const; |
33 | Int_t fCorrectedNExpectedHitsInner; //corrected NExpectedHitsInner |
34 | |
35 | ClassDef(ChargedParticle, 2) // Charged particle class |
36 | }; |
37 | } |
38 | |
39 | //-------------------------------------------------------------------------------------------------- |
40 | 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 | { |
54 | // Get momentum values from track. |
55 | |
56 | const mithep::Track *trk = Trk(); |
57 | if (trk) |
58 | fCachedMom.SetCoordinates(trk->Pt(),trk->Eta(),trk->Phi(),GetMass()); |
59 | else |
60 | fCachedMom.SetCoordinates(0,0,0,GetMass()); |
61 | } |
62 | #endif |