ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitEdm/DataFormats/interface/BasePart.h
Revision: 1.2
Committed: Thu Jul 31 13:29:35 2008 UTC (16 years, 9 months ago) by bendavid
Content type: text/plain
Branch: MAIN
CVS Tags: MITHEP_2_0_x
Changes since 1.1: +16 -8 lines
Log Message:
Cleaned up MitEdm classes

File Contents

# User Rev Content
1 loizides 1.1 //--------------------------------------------------------------------------------------------------
2 bendavid 1.2 // $Id: BasePart.h,v 1.1 2008/07/29 13:16:22 loizides Exp $
3 loizides 1.1 //
4     // BasePart
5     //
6     // Implementation of base particle class. It will provide basic functionality to the DecayPart and
7     // StablePart class. The use of this class is also for looping purposes. See the double dispatcher
8     // doAction(MyAction).
9     //
10     // Author List: Ch.Paus
11     //--------------------------------------------------------------------------------------------------
12    
13     #ifndef MITEDM_BASEPART_H
14     #define MITEDM_BASEPART_H
15    
16     #include <iostream>
17     #include <vector>
18 bendavid 1.2 #include "TParticlePDG.h"
19     #include "TDatabasePDG.h"
20 loizides 1.1
21     namespace mitedm
22     {
23     class BasePartAction;
24     class BasePart
25     {
26     public:
27     // Constructors
28 bendavid 1.2 BasePart() : pid_(0) {}
29     BasePart(int pid) : pid_(pid) {}
30 loizides 1.1 virtual ~BasePart() {}
31    
32     int pid () const { return pid_; }
33 bendavid 1.2 double mass () const;
34    
35     TParticlePDG *particlePdgEntry() const;
36 loizides 1.1
37     // Handle for recursive actions (have to implement it but should never be called)
38     virtual void doAction (BasePartAction *action) const {}
39     //virtual double charge () const = 0;
40    
41     virtual void print (std::ostream &os = std::cout) const;
42    
43     virtual int nChild () const { return 0; }
44     virtual
45     const BasePart* getChild (int i) const { return 0; }
46    
47     protected:
48     // General stuff
49     int pid_;
50     };
51     }
52 bendavid 1.2
53     //--------------------------------------------------------------------------------------------------
54     inline TParticlePDG *mitedm::BasePart::particlePdgEntry() const
55     {
56     // Return entry to pdg database for the PARTICLE.
57    
58     return TDatabasePDG::Instance()->GetParticle(pid_);
59     }
60 loizides 1.1 #endif