ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/DataTree/src/CompositeParticle.cc
Revision: 1.8
Committed: Fri Mar 20 18:23:27 2009 UTC (16 years, 1 month ago) by loizides
Content type: text/plain
Branch: MAIN
CVS Tags: Mit_009, Mit_008
Changes since 1.7: +3 -3 lines
Log Message:
Cosmetics

File Contents

# User Rev Content
1 loizides 1.8 // $Id: CompositeParticle.cc,v 1.7 2009/02/18 15:38:55 loizides Exp $
2 loizides 1.1
3     #include "MitAna/DataTree/interface/CompositeParticle.h"
4    
5     ClassImp(mithep::CompositeParticle)
6    
7     using namespace mithep;
8    
9 loizides 1.2 //--------------------------------------------------------------------------------------------------
10 loizides 1.8 Bool_t CompositeParticle::HasDaughter(const Particle *p) const
11 loizides 1.5 {
12     // Return true if given particle is among daughters.
13    
14     if(!p) return kFALSE;
15    
16 bendavid 1.6 return fDaughters.HasObject(p);
17 loizides 1.5 }
18    
19     //--------------------------------------------------------------------------------------------------
20 loizides 1.2 Bool_t CompositeParticle::HasCommonDaughter(const CompositeParticle *p) const
21     {
22     // Return true if a common daughter exists.
23    
24     if(!p) return kFALSE;
25    
26 loizides 1.3 for (UInt_t i=0; i<p->NDaughters(); ++i)
27 loizides 1.5 if (HasDaughter(p->Daughter(i)))
28 loizides 1.2 return kTRUE;
29 loizides 1.1
30 loizides 1.2 return kFALSE;
31 loizides 1.1 }
32    
33 loizides 1.2 //--------------------------------------------------------------------------------------------------
34 loizides 1.8 Bool_t CompositeParticle::HasSameDaughters(const CompositeParticle *p) const
35 loizides 1.2 {
36     // Return true if daughters are the same.
37 loizides 1.1
38 loizides 1.2 if(!p) return kFALSE;
39 loizides 1.1
40 loizides 1.3 if (NDaughters()!= p->NDaughters())
41 loizides 1.2 return kFALSE;
42 loizides 1.1
43 loizides 1.3 for (UInt_t i=0; i<p->NDaughters(); ++i)
44 loizides 1.5 if (!HasDaughter(p->Daughter(i)))
45 loizides 1.2 return kFALSE;
46 loizides 1.1
47 loizides 1.2 return kTRUE;
48 loizides 1.1 }