ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/DataTree/interface/PFJet.h
Revision: 1.8
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.7: +5 -6 lines
Log Message:
Version with working skimming and last 4.4 tag.

File Contents

# Content
1 //--------------------------------------------------------------------------------------------------
2 // $Id: PFJet.h,v 1.7 2012/03/28 12:15:34 paus Exp $
3 //
4 // PFJet
5 //
6 // This class holds information about reconstructed jet based on pf candidates.
7 //
8 // Authors: J.Bendavid
9 //--------------------------------------------------------------------------------------------------
10
11 #ifndef MITANA_DATATREE_PFJET_H
12 #define MITANA_DATATREE_PFJET_H
13
14 #include "MitAna/DataTree/interface/Jet.h"
15 #include "MitAna/DataCont/interface/RefArray.h"
16 #include "MitAna/DataTree/interface/PFCandidate.h"
17
18 namespace mithep
19 {
20 class PFJet : public Jet
21 {
22 public:
23 PFJet() : fChargedHadronEnergy(0), fNeutralHadronEnergy(0), fChargedEmEnergy(0),
24 fNeutralEmEnergy(0), fMuonEnergy(0), fChargedMultiplicity(0),
25 fNeutralMultiplicity(0), fMuonMultiplicity(0) {}
26 PFJet(Double_t px, Double_t py, Double_t pz, Double_t e) :
27 Jet(px,py,pz,e),
28 fChargedHadronEnergy(0), fNeutralHadronEnergy(0), fChargedEmEnergy(0),
29 fNeutralEmEnergy(0), fMuonEnergy(0), fChargedMultiplicity(0),
30 fNeutralMultiplicity(0), fMuonMultiplicity(0) {}
31
32 void AddPFCand(const PFCandidate *p) { fPFCands.Add(p); ClearCharge();}
33 Double_t ChargedEmEnergy() const { return fChargedEmEnergy; }
34 Double_t ChargedHadronEnergy() const { return fChargedHadronEnergy; }
35 Double_t MuonEnergy() const { return fMuonEnergy; }
36 UInt_t ChargedMultiplicity() const { return fChargedMultiplicity; }
37 Bool_t HasPFCand(const PFCandidate *p) const { return fPFCands.HasObject(p); }
38 Jet *MakeCopy() const { return new PFJet(*this); }
39 UInt_t NConstituents() const { return NPFCands(); }
40 Double_t NeutralEmEnergy() const { return fNeutralEmEnergy; }
41 Double_t NeutralHadronEnergy() const { return fNeutralHadronEnergy; }
42 UInt_t NeutralMultiplicity() const { return fNeutralMultiplicity; }
43 UInt_t NPFCands() const { return fPFCands.Entries(); }
44 UInt_t MuonMultiplicity() const { return fMuonMultiplicity; }
45 EObjType ObjType() const { return kPFJet; }
46 const PFCandidate *PFCand(UInt_t i) const { return fPFCands.At(i); }
47 void SetChargedEmEnergy(Double_t e) { fChargedEmEnergy = e; }
48 void SetChargedHadronEnergy(Double_t e) { fChargedHadronEnergy = e; }
49 void SetChargedMuEnergy(Double_t e) { fMuonEnergy = e; }
50 void SetChargedMultiplicity(UInt_t n) { fChargedMultiplicity = n; }
51 void SetMuonMultiplicity(UInt_t n) { fMuonMultiplicity = n; }
52 void SetNeutralEmEnergy(Double_t e) { fNeutralEmEnergy = e; }
53 void SetNeutralHadronEnergy(Double_t e) { fNeutralHadronEnergy = e; }
54 void SetNeutralMultiplicity(UInt_t n) { fNeutralMultiplicity = n; }
55
56 // Some structural tools
57 void Mark(UInt_t i=1) const;
58
59 protected:
60 Double_t GetCharge() const;
61
62 Double32_t fChargedHadronEnergy; //[0,0,14]charged hadron energy
63 Double32_t fNeutralHadronEnergy; //[0,0,14]neutral hadron energy
64 Double32_t fChargedEmEnergy; //[0,0,14]charged em energy
65 Double32_t fNeutralEmEnergy; //[0,0,14]neutral em energy
66 Double32_t fMuonEnergy; //[0,0,14]muon energy
67 UInt_t fChargedMultiplicity; //number of charged constituents
68 UInt_t fNeutralMultiplicity; //number of neutral constituents
69 UInt_t fMuonMultiplicity; //number of muon constituents
70 RefArray<PFCandidate> fPFCands; //pf candidates in the jet
71
72 ClassDef(PFJet, 1) // PFJet class
73 };
74 }
75
76 //--------------------------------------------------------------------------------------------------
77 inline void mithep::PFJet::Mark(UInt_t ib) const
78 {
79 // mark myself
80 mithep::DataObject::Mark(ib);
81 // mark my dependencies if they are there
82 fPFCands.Mark(ib);
83 }
84
85 //--------------------------------------------------------------------------------------------------
86 inline Double_t mithep::PFJet::GetCharge() const
87 {
88 // Return sum of charge of constituent PFCandidates.
89
90 Double_t charge = 0;
91 for (UInt_t i=0; i<NPFCands(); ++i)
92 charge += PFCand(i)->Charge();
93
94 return charge;
95 }
96 #endif