ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/DataTree/interface/Photon.h
Revision: 1.6
Committed: Sun Jul 13 08:37:50 2008 UTC (16 years, 9 months ago) by loizides
Content type: text/plain
Branch: MAIN
Changes since 1.5: +7 -14 lines
Log Message:
Indicate on construction time how many refs to particles one expects to reduce copying of TRefs in the TRefArray.

File Contents

# User Rev Content
1 loizides 1.1 //--------------------------------------------------------------------------------------------------
2 loizides 1.6 // $Id: Photon.h,v 1.5 2008/07/10 13:20:34 bendavid 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 loizides 1.6 Photon() : fConversions(2) { SetClearBit(); }
25     Photon(Double_t px, Double_t py, Double_t pz, Double_t e) :
26     fFourVector(px,py,pz,e) { SetClearBit(); }
27 loizides 1.1 ~Photon() {}
28 loizides 1.2
29 loizides 1.6 void AddConversion(Conversion *c) { fConversions.Add(c); }
30 bendavid 1.3 Int_t Charge() const { return 0; }
31     Bool_t IsConverted() const { return fConversions.GetEntries(); }
32     const Conversion *GetConversion(UInt_t i) const { return fConversions.At(i); }
33     UInt_t GetNConversions() const { return fConversions.GetEntries(); }
34     FourVector Mom() const { return fFourVector; }
35 loizides 1.2 void SetMom(Double_t px, Double_t py, Double_t pz, Double_t e);
36 loizides 1.6 void Trim() { fConversions.Trim(); }
37 loizides 1.1
38     protected:
39 loizides 1.6 void Clear(Option_t */*option*/="") { fConversions.Destroy(); }
40 bendavid 1.5
41 loizides 1.4 FourVector fFourVector; //four momentum vector
42 bendavid 1.3 RefArray<Conversion> fConversions; //references to associated conversion candidates
43 loizides 1.1
44 loizides 1.2 ClassDef(Photon,1) // Photon class
45 loizides 1.1 };
46     }
47 loizides 1.2
48     //--------------------------------------------------------------------------------------------------
49     inline void mithep::Photon::SetMom(Double_t px, Double_t py, Double_t pz, Double_t e)
50     {
51     // Set four vector.
52    
53     fFourVector.SetXYZT(px, py, pz, e);
54     }
55 loizides 1.1 #endif