ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/DataTree/interface/CompositeParticle.h
Revision: 1.5
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.4: +6 -5 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.5 // $Id: CompositeParticle.h,v 1.4 2008/07/03 08:22:17 loizides Exp $
3 loizides 1.1 //
4     // Composite Particle
5     //
6 loizides 1.4 // A composite particle class that holds other (daughter) particles.
7 loizides 1.1 //
8 loizides 1.2 // Authors: J.Bendavid, C.Loizides
9 loizides 1.1 //--------------------------------------------------------------------------------------------------
10    
11     #ifndef DATATREE_COMPOSITEPARTICLE_H
12     #define DATATREE_COMPOSITEPARTICLE_H
13    
14 loizides 1.2 #include "MitAna/DataTree/interface/Types.h"
15 loizides 1.1 #include "MitAna/DataTree/interface/RefArray.h"
16     #include "MitAna/DataTree/interface/Particle.h"
17    
18     namespace mithep
19     {
20     class CompositeParticle : public Particle
21     {
22     public:
23 loizides 1.5 CompositeParticle(UInt_t rsv=0) : fDaughters(rsv) { SetClearBit(); }
24 loizides 1.1 ~CompositeParticle() {}
25    
26 loizides 1.5 void AddDaughter(Particle *p) { fDaughters.Add(p); }
27 loizides 1.2 Int_t Charge() const;
28     const Particle *GetDaughter(UInt_t i) const { return fDaughters.At(i); }
29     UInt_t GetNDaughters() const { return fDaughters.GetEntries(); }
30     Bool_t HasCommonDaughter(const CompositeParticle *p) const;
31     Bool_t HasSameDaughters(const CompositeParticle *p) const;
32     Bool_t IsDaughter(const Particle *p) const;
33     FourVector Mom() const;
34 loizides 1.5 void Trim() { fDaughters.Trim(); }
35    
36 loizides 1.1 protected:
37 loizides 1.5 void Clear(Option_t */*option*/="") { fDaughters.Destroy(); }
38 loizides 1.3
39 loizides 1.2 RefArray<Particle> fDaughters; //references to daughter particles
40 loizides 1.1
41 loizides 1.2 ClassDef(CompositeParticle, 1) // Composite particle class
42 loizides 1.1 };
43     }
44     #endif