ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/DataTree/interface/PFJet.h
(Generate patch)

Comparing UserCode/MitAna/DataTree/interface/PFJet.h (file contents):
Revision 1.5 by bendavid, Wed Sep 9 03:38:26 2009 UTC vs.
Revision 1.7 by paus, Wed Mar 28 12:15:34 2012 UTC

# Line 29 | Line 29 | namespace mithep
29                  fNeutralEmEnergy(0), fMuonEnergy(0), fChargedMultiplicity(0),
30                  fNeutralMultiplicity(0), fMuonMultiplicity(0) {}
31  
32 <      void                  AddPFCand(const PFCandidate *p)       { fPFCands.Add(p);               }
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;            }
# Line 53 | Line 53 | namespace mithep
53        void                  SetNeutralHadronEnergy(Double_t e)    { fNeutralHadronEnergy = e;      }
54        void                  SetNeutralMultiplicity(UInt_t n)      { fNeutralMultiplicity = n;      }
55  
56 +      // Some structural tools
57 +      void                  Mark()                          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
# Line 68 | Line 72 | namespace mithep
72      ClassDef(PFJet, 1) // PFJet class
73    };
74   }
75 +
76 + //--------------------------------------------------------------------------------------------------
77 + inline void mithep::PFJet::Mark() const
78 + {
79 +  // mark myself
80 +  mithep::DataObject::Mark();
81 +  // mark my dependencies if they are there
82 +  for (UInt_t i=0; i<fPFCands.Entries(); i++)
83 +    fPFCands.At(i)->Mark();
84 + }
85 +
86 + //--------------------------------------------------------------------------------------------------
87 + inline Double_t mithep::PFJet::GetCharge() const
88 + {
89 +  // Return sum of charge of constituent PFCandidates.
90 +
91 +  Double_t charge = 0;
92 +  for (UInt_t i=0; i<NPFCands(); ++i)
93 +    charge += PFCand(i)->Charge();
94 +  
95 +  return charge;
96 + }
97   #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines