ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/DataTree/interface/TrackJet.h
Revision: 1.3
Committed: Thu Mar 29 23:41:55 2012 UTC (13 years, 1 month ago) by paus
Content type: text/plain
Branch: MAIN
CVS Tags: Mit_032, Mit_031, Mit_030, Mit_029c, Mit_029b, Mit_030_pre1, Mit_029a, Mit_029, Mit_029_pre1, Mit_028a, Mit_028, Mit_027a, Mit_027, Mit_026, Mit_025e, HEAD
Changes since 1.2: +6 -7 lines
Log Message:
Version with working skimming and last 4.4 tag.

File Contents

# User Rev Content
1 bendavid 1.1 //--------------------------------------------------------------------------------------------------
2 paus 1.3 // $Id: TrackJet.h,v 1.2 2012/03/28 12:15:34 paus Exp $
3 bendavid 1.1 //
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 paus 1.2 // Some structural tools
39 paus 1.3 void Mark(UInt_t i=1) const;
40 paus 1.2
41 bendavid 1.1 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 paus 1.3 inline void mithep::TrackJet::Mark(UInt_t ib) const
53 paus 1.2 {
54     // mark myself
55 paus 1.3 mithep::DataObject::Mark(ib);
56 paus 1.2 // mark my dependencies if they are there
57     if (fVertex.IsValid())
58 paus 1.3 fVertex.Obj()->Mark(ib);
59     fTracks.Mark(ib);
60 paus 1.2 }
61    
62     //--------------------------------------------------------------------------------------------------
63 bendavid 1.1 inline Double_t mithep::TrackJet::GetCharge() const
64     {
65     // Return sum of charge of constituent tracks.
66    
67     Double_t charge = 0;
68     for (UInt_t i=0; i<NTracks(); ++i)
69     charge += Trk(i)->Charge();
70    
71     return charge;
72     }
73     #endif