1 |
//--------------------------------------------------------------------------------------------------
|
2 |
// $Id: TrackJet.h,v 1.2 2012/03/28 12:15:34 paus 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(UInt_t i=1) 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(UInt_t ib) const
|
53 |
{
|
54 |
// mark myself
|
55 |
mithep::DataObject::Mark(ib);
|
56 |
// mark my dependencies if they are there
|
57 |
if (fVertex.IsValid())
|
58 |
fVertex.Obj()->Mark(ib);
|
59 |
fTracks.Mark(ib);
|
60 |
}
|
61 |
|
62 |
//--------------------------------------------------------------------------------------------------
|
63 |
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
|