ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/DataTree/interface/Photon.h
Revision: 1.5
Committed: Thu Jul 10 13:20:34 2008 UTC (16 years, 9 months ago) by bendavid
Content type: text/plain
Branch: MAIN
Changes since 1.4: +5 -3 lines
Log Message:
fixed potential memory leak

File Contents

# User Rev Content
1 loizides 1.1 //--------------------------------------------------------------------------------------------------
2 bendavid 1.5 // $Id: Photon.h,v 1.4 2008/07/03 08:22:18 loizides Exp $
3 loizides 1.1 //
4     // Photon
5     //
6     // Details to be worked out...
7     //
8 loizides 1.2 // Authors: J.Bendavid, C.Loizides
9 loizides 1.1 //--------------------------------------------------------------------------------------------------
10    
11     #ifndef DATATREE_PHOTON_H
12     #define DATATREE_PHOTON_H
13    
14 loizides 1.4 #include "MitAna/DataTree/interface/Types.h"
15 bendavid 1.3 #include "MitAna/DataTree/interface/Particle.h"
16     #include "MitAna/DataTree/interface/RefArray.h"
17     #include "MitAna/DataTree/interface/Conversion.h"
18 loizides 1.1
19     namespace mithep
20     {
21 bendavid 1.3 class Photon : public Particle
22 loizides 1.1 {
23     public:
24 bendavid 1.5 Photon() { SetClearBit(); }
25     Photon(Double_t px, Double_t py, Double_t pz, Double_t e) : fFourVector(px,py,pz,e) { SetClearBit(); }
26 loizides 1.1 ~Photon() {}
27 loizides 1.2
28 loizides 1.4 void AddConversion(Conversion *c);
29 bendavid 1.3 Int_t Charge() const { return 0; }
30     Bool_t IsConverted() const { return fConversions.GetEntries(); }
31     const Conversion *GetConversion(UInt_t i) const { return fConversions.At(i); }
32     UInt_t GetNConversions() const { return fConversions.GetEntries(); }
33     FourVector Mom() const { return fFourVector; }
34 loizides 1.2 void SetMom(Double_t px, Double_t py, Double_t pz, Double_t e);
35 loizides 1.1
36     protected:
37 bendavid 1.5 void Clear(Option_t */*option*/="") { fConversions.Reset(); }
38    
39 loizides 1.4 FourVector fFourVector; //four momentum vector
40 bendavid 1.3 RefArray<Conversion> fConversions; //references to associated conversion candidates
41 loizides 1.1
42 loizides 1.2 ClassDef(Photon,1) // Photon class
43 loizides 1.1 };
44     }
45 loizides 1.2
46     //--------------------------------------------------------------------------------------------------
47 loizides 1.4 inline void mithep::Photon::AddConversion(Conversion *c)
48     {
49     // Add a conversion object.
50    
51     fConversions.Add(c);
52     fConversions.Trim();
53     }
54    
55     //--------------------------------------------------------------------------------------------------
56 loizides 1.2 inline void mithep::Photon::SetMom(Double_t px, Double_t py, Double_t pz, Double_t e)
57     {
58     // Set four vector.
59    
60     fFourVector.SetXYZT(px, py, pz, e);
61     }
62 loizides 1.1 #endif