Line data Source code
1 : //--------------------------------------------------------------------------
2 : //
3 : // Environment:
4 : // This software is part of the EvtGen package developed jointly
5 : // for the BaBar and CLEO collaborations. If you use all or part
6 : // of it, please give an appropriate acknowledgement.
7 : //
8 : // Copyright Information: See EvtGen/COPYRIGHT
9 : // Copyright (C) 1998 Caltech, UCSB
10 : //
11 : // Module: EvtGen/EvtId.hh
12 : //
13 : // Description:Class for particle Id used in EvtGen.
14 : //
15 : // Modification history:
16 : //
17 : // DJL/RYD May 26, 1998 Module created
18 : //
19 : //------------------------------------------------------------------------
20 :
21 : #ifndef EVTID_HH
22 : #define EVTID_HH
23 :
24 : #include <iostream>
25 : #include <string>
26 :
27 : class EvtId {
28 :
29 : public:
30 :
31 : //need a default constructor
32 0 : EvtId():_id(-1),_alias(-1){}
33 :
34 0 : EvtId(int id,int alias):_id(id),_alias(alias){}
35 :
36 : friend std::ostream& operator<<(std::ostream& s, const EvtId& v);
37 :
38 0 : int operator==(const EvtId& id) const { return _id==id._id; }
39 0 : int operator!=(const EvtId& id) const { return _id!=id._id; }
40 0 : int operator<(const EvtId& id) const { return _id<id._id; }
41 :
42 : int isConjugate(const EvtId & id) const;
43 :
44 0 : int getId() const { return _id;}
45 :
46 0 : int getAlias() const { return _alias;}
47 :
48 0 : int isAlias() const { return _id!=_alias;}
49 :
50 : std::string getName() const;
51 :
52 : private:
53 :
54 : //particle number 0..n. The order of particles are determined
55 : //by the order in pdt.table
56 : int _id;
57 : //if the particle is an alias to another particle alias!=id
58 : //The only place where the alias should be used is for looking
59 : //up decays in the decay table.
60 : int _alias;
61 :
62 : };
63 :
64 : #endif
|