ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/DataTree/interface/TrackJet.h
Revision: 1.2
Committed: Wed Mar 28 12:15:34 2012 UTC (13 years, 1 month ago) by paus
Content type: text/plain
Branch: MAIN
Changes since 1.1: +16 -1 lines
Log Message:
Enable skimming.

File Contents

# Content
1 //--------------------------------------------------------------------------------------------------
2 // $Id: TrackJet.h,v 1.1 2010/02/21 23:42:00 bendavid Exp $
3 //
4 // TrackJet
5 //
6 // This class holds information about reconstructed jet based on tracks.
7 //
8 // Authors: J.Bendavid
9 //--------------------------------------------------------------------------------------------------
10
11 #ifndef MITANA_DATATREE_TRACKJET_H
12 #define MITANA_DATATREE_TRACKJET_H
13
14 #include "MitAna/DataTree/interface/Jet.h"
15 #include "MitAna/DataCont/interface/RefArray.h"
16 #include "MitAna/DataTree/interface/Track.h"
17 #include "MitAna/DataTree/interface/Vertex.h"
18
19 namespace mithep
20 {
21 class TrackJet : public Jet
22 {
23 public:
24 TrackJet() {}
25 TrackJet(Double_t px, Double_t py, Double_t pz, Double_t e) :
26 Jet(px,py,pz,e) {}
27
28 void AddTrack(const Track *t) { fTracks.Add(t); ClearCharge(); }
29 Bool_t HasTrack(const Track *t) const { return fTracks.HasObject(t); }
30 Jet *MakeCopy() const { return new TrackJet(*this); }
31 UInt_t NConstituents() const { return NTracks(); }
32 UInt_t NTracks() const { return fTracks.Entries(); }
33 EObjType ObjType() const { return kTrackJet; }
34 const Track *Trk(UInt_t i) const { return fTracks.At(i); }
35 const Vertex *Vtx() const { return fVertex.Obj(); }
36 void SetVertex(const Vertex *v) { fVertex = v; }
37
38 // Some structural tools
39 void Mark() const;
40
41 protected:
42 Double_t GetCharge() const;
43
44 RefArray<Track> fTracks; //tracks in the jet
45 Ref<Vertex> fVertex; //associated primary vertex
46
47 ClassDef(TrackJet, 1) // TrackJet class
48 };
49 }
50
51 //--------------------------------------------------------------------------------------------------
52 inline void mithep::TrackJet::Mark() const
53 {
54 // mark myself
55 mithep::DataObject::Mark();
56 // mark my dependencies if they are there
57 if (fVertex.IsValid())
58 fVertex.Obj()->Mark();
59 for (UInt_t i=0; i<fTracks.Entries(); i++)
60 fTracks.At(i)->Mark();
61 }
62
63 //--------------------------------------------------------------------------------------------------
64 inline Double_t mithep::TrackJet::GetCharge() const
65 {
66 // Return sum of charge of constituent tracks.
67
68 Double_t charge = 0;
69 for (UInt_t i=0; i<NTracks(); ++i)
70 charge += Trk(i)->Charge();
71
72 return charge;
73 }
74 #endif