ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/DataTree/src/CompositeParticle.cc
Revision: 1.7
Committed: Wed Feb 18 15:38:55 2009 UTC (16 years, 2 months ago) by loizides
Content type: text/plain
Branch: MAIN
CVS Tags: Mit_008pre2, Mit_008pre1
Changes since 1.6: +1 -25 lines
Log Message:
Reworked particle interface to cache FourVectorM

File Contents

# User Rev Content
1 loizides 1.7 // $Id: CompositeParticle.cc,v 1.6 2009/02/18 08:18:36 bendavid 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.5 Bool_t CompositeParticle::HasDaughter(const Particle* p) const
11     {
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     Bool_t CompositeParticle::HasSameDaughters(const CompositeParticle* p) const
35     {
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 }