ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitEdm/DataFormats/interface/BasePart.h
Revision: 1.1
Committed: Tue Jul 29 13:16:22 2008 UTC (16 years, 9 months ago) by loizides
Content type: text/plain
Branch: MAIN
Log Message:
Have our dedicated edm classes in MitEdm/DataFormats.

File Contents

# User Rev Content
1 loizides 1.1 //--------------------------------------------------------------------------------------------------
2     // $Id: $
3     //
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    
19     namespace mitedm
20     {
21     class BasePartAction;
22     class BasePart
23     {
24     public:
25     // Constructors
26     BasePart() : pid_(0), mass_(0) {}
27     BasePart(int pid);
28     BasePart(int pid, double mass);
29     BasePart(const BasePart &b);
30     // Destructor
31     virtual ~BasePart() {}
32    
33     int pid () const { return pid_; }
34     double mass () const { return mass_; }
35    
36     // Handle for recursive actions (have to implement it but should never be called)
37     virtual void doAction (BasePartAction *action) const {}
38     //virtual double charge () const = 0;
39    
40     virtual void print (std::ostream &os = std::cout) const;
41    
42     virtual int nChild () const { return 0; }
43     virtual
44     const BasePart* getChild (int i) const { return 0; }
45    
46     protected:
47     // General stuff
48     int pid_;
49     double mass_;
50     };
51     }
52     #endif