ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitEdm/DataFormats/interface/BasePart.h
Revision: 1.4
Committed: Sat Sep 27 05:48:24 2008 UTC (16 years, 7 months ago) by loizides
Content type: text/plain
Branch: MAIN
CVS Tags: Mit_008pre2, Mit_008pre1, Mit_006b, Mit_006a, Mit_006, Mit_005, Mit_004
Changes since 1.3: +14 -20 lines
Log Message:
Cleanup

File Contents

# User Rev Content
1 loizides 1.1 //--------------------------------------------------------------------------------------------------
2 loizides 1.4 // $Id: BasePart.h,v 1.3 2008/08/29 00:27:21 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 loizides 1.3 // Authors: C.Paus
11 loizides 1.1 //--------------------------------------------------------------------------------------------------
12    
13 loizides 1.4 #ifndef MITEDM_DATAFORMATS_BASEPART_H
14     #define MITEDM_DATAFORMATS_BASEPART_H
15 loizides 1.1
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 loizides 1.4
25 loizides 1.1 class BasePart
26     {
27     public:
28 bendavid 1.2 BasePart() : pid_(0) {}
29     BasePart(int pid) : pid_(pid) {}
30 loizides 1.1 virtual ~BasePart() {}
31    
32 loizides 1.4 int pid() const { return pid_; }
33     double mass() const;
34     TParticlePDG *particlePdgEntry() const;
35     virtual double charge() const { return 0.; }
36 loizides 1.1 // Handle for recursive actions (have to implement it but should never be called)
37 loizides 1.4 virtual void doAction(BasePartAction *action) const {}
38     virtual void print(std::ostream &os = std::cout) const;
39     virtual int nChild() const { return 0; }
40     virtual const BasePart *getChild(int i) const { return 0; }
41 loizides 1.1
42     protected:
43 loizides 1.4 int pid_;
44 loizides 1.1 };
45     }
46 bendavid 1.2
47     //--------------------------------------------------------------------------------------------------
48     inline TParticlePDG *mitedm::BasePart::particlePdgEntry() const
49     {
50 loizides 1.4 // Return entry to pdg database for the particle.
51 bendavid 1.2
52     return TDatabasePDG::Instance()->GetParticle(pid_);
53     }
54 loizides 1.1 #endif