ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/DataTree/interface/CompositeParticle.h
Revision: 1.3
Committed: Wed Jul 2 21:46:01 2008 UTC (16 years, 10 months ago) by loizides
Content type: text/plain
Branch: MAIN
Changes since 1.2: +5 -3 lines
Log Message:
Reset size after every add, costly but only done at filling time.

File Contents

# User Rev Content
1 loizides 1.1 //--------------------------------------------------------------------------------------------------
2 loizides 1.3 // $Id: CompositeParticle.h,v 1.2 2008/07/01 08:56:49 loizides Exp $
3 loizides 1.1 //
4     // Composite Particle
5     //
6     // Details to be worked out...
7     //
8 loizides 1.2 // Authors: J.Bendavid, C.Loizides
9 loizides 1.1 //
10     //--------------------------------------------------------------------------------------------------
11    
12     #ifndef DATATREE_COMPOSITEPARTICLE_H
13     #define DATATREE_COMPOSITEPARTICLE_H
14    
15 loizides 1.2 #include "MitAna/DataTree/interface/Types.h"
16 loizides 1.1 #include "MitAna/DataTree/interface/RefArray.h"
17     #include "MitAna/DataTree/interface/Particle.h"
18    
19     namespace mithep
20     {
21     class CompositeParticle : public Particle
22     {
23     public:
24 loizides 1.3 CompositeParticle() { SetBit(14); }
25 loizides 1.1 ~CompositeParticle() {}
26    
27 loizides 1.3 void AddDaughter(Particle *p) { fDaughters.Add(p); fDaughters.Trim(); }
28 loizides 1.2 Int_t Charge() const;
29     const Particle *GetDaughter(UInt_t i) const { return fDaughters.At(i); }
30     UInt_t GetNDaughters() const { return fDaughters.GetEntries(); }
31     Bool_t HasCommonDaughter(const CompositeParticle *p) const;
32     Bool_t HasSameDaughters(const CompositeParticle *p) const;
33     Bool_t IsDaughter(const Particle *p) const;
34     FourVector Mom() const;
35 loizides 1.1
36     protected:
37 loizides 1.3 void Clear(Option_t */*option*/="") { fDaughters.Reset(); }
38    
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