1 |
loizides |
1.1 |
//--------------------------------------------------------------------------------------------------
|
2 |
loizides |
1.3 |
// $Id: BasePart.h,v 1.2 2008/07/31 13:29:35 bendavid 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 |
|
|
#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
|