ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitEdm/DataFormats/src/DecayPart.cc
Revision: 1.5
Committed: Tue Sep 30 12:57:43 2008 UTC (16 years, 7 months ago) by bendavid
Content type: text/plain
Branch: MAIN
CVS Tags: Mit_004
Changes since 1.4: +63 -5 lines
Log Message:
Added DaughterData, StableData, DecayData classes, updated DecayPart to use them

File Contents

# User Rev Content
1 bendavid 1.5 // $Id: DecayPart.cc,v 1.4 2008/09/24 09:00:54 bendavid Exp $
2 loizides 1.1
3     #include "MitEdm/DataFormats/interface/BasePartAction.h"
4     #include "MitEdm/DataFormats/interface/DecayPart.h"
5    
6     using namespace std;
7     using namespace mitedm;
8    
9 bendavid 1.5 DecayPart::DecayPart() :
10     BasePart (0),
11     decayType_ (Fast),
12     prob_ (0),
13     chi2_ (0),
14     ndof_ (0),
15     fittedMass_ (0),
16     fittedMassError_(0),
17     lxy_ (0),
18     lxyError_ (0),
19     lxyToPv_ (0),
20     lxyToPvError_ (0),
21     dxy_ (0),
22     dxyError_ (0),
23     dxyToPv_ (0),
24     dxyToPvError_ (0),
25     lz_ (0),
26     lzError_ (0),
27     lzToPv_ (0),
28     lzToPvError_ (0),
29     cTau_ (0),
30     cTauError_ (0),
31     pt_ (0),
32     ptError_ (0),
33     fourMomentum_ (0,0,0,0),
34     position_ (0,0,0)
35     {
36     }
37    
38     DecayPart::DecayPart(int pid) :
39     BasePart (pid),
40     decayType_ (Fast),
41     prob_ (0),
42     chi2_ (0),
43     ndof_ (0),
44     fittedMass_ (0),
45     fittedMassError_(0),
46     lxy_ (0),
47     lxyError_ (0),
48     lxyToPv_ (0),
49     lxyToPvError_ (0),
50     dxy_ (0),
51     dxyError_ (0),
52     dxyToPv_ (0),
53     dxyToPvError_ (0),
54     lz_ (0),
55     lzError_ (0),
56     lzToPv_ (0),
57     lzToPvError_ (0),
58     cTau_ (0),
59     cTauError_ (0),
60     pt_ (0),
61     ptError_ (0),
62     fourMomentum_ (0,0,0,0),
63     position_ (0,0,0)
64     {
65     }
66    
67 bendavid 1.3 DecayPart::DecayPart(int pid, DecayType decayType) :
68     BasePart (pid),
69 loizides 1.1 decayType_ (decayType),
70     prob_ (0),
71     chi2_ (0),
72     ndof_ (0),
73     fittedMass_ (0),
74     fittedMassError_(0),
75     lxy_ (0),
76     lxyError_ (0),
77     lxyToPv_ (0),
78     lxyToPvError_ (0),
79     dxy_ (0),
80     dxyError_ (0),
81     dxyToPv_ (0),
82     dxyToPvError_ (0),
83     lz_ (0),
84     lzError_ (0),
85     lzToPv_ (0),
86     lzToPvError_ (0),
87     cTau_ (0),
88     cTauError_ (0),
89     pt_ (0),
90     ptError_ (0),
91     fourMomentum_ (0,0,0,0),
92 bendavid 1.2 position_ (0,0,0)
93 loizides 1.1 {
94     }
95    
96     void DecayPart::print(ostream &os) const
97     {
98 bendavid 1.3 os << " DecayPart::print - pid: " << pid_ << " mass: " << mass()
99 loizides 1.1 << " decayType: " << decayType_ << endl
100     << " Decays to \n";
101 bendavid 1.5 for (int i=0; i<nChild(); ++i) {
102     os << " "; getDaughterPtr(i)->print(os);
103 loizides 1.1 }
104     os << " -- end decays to -------\n";
105     os << " Vertex fit (c2,ndof,prob): " << chi2() << ", " << ndof() << ", " << prob() << "\n\n" ;
106     }
107    
108     void DecayPart::doAction(BasePartAction *action) const
109     {
110    
111     if (action->getActionType() == BasePartAction::NonRecursive) {
112     action->doAction(this);
113     return;
114     }
115    
116     if (action->getActionType() == BasePartAction::TopDown)
117     action->doAction(this);
118    
119 bendavid 1.5 for (int i=0; i<nChild(); ++i) {
120     action->incLevel(); getDaughterPtr(i)->doAction(action); action->decLevel();
121 loizides 1.1 }
122    
123     if (action->getActionType() == BasePartAction::BottomUp)
124     action->doAction(this);
125    
126     return;
127     }