StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StHbtKink.cc
1 /***********************************************************************
2  *
3  * $Id: StHbtKink.cc,v 1.4 2001/11/14 21:07:21 lisa Exp $
4  *
5  * Author: Mike Lisa, Ohio State, 23May2001
6  *
7  ***********************************************************************
8  *
9  * Description: Kink class with information gotten from the StKinkVertex
10  * of Wenshen Deng and Spiros Margetis
11  *
12  ***********************************************************************
13  *
14  * $Log: StHbtKink.cc,v $
15  * Revision 1.4 2001/11/14 21:07:21 lisa
16  * Fixed several small things (mostly discarded const) that caused fatal errors with gcc2.95.3
17  *
18  * Revision 1.3 2001/09/05 21:55:23 laue
19  * typo fixed
20  *
21  * Revision 1.2 2001/06/21 19:15:46 laue
22  * Modified fiels:
23  * CTH.hh : new constructor added
24  * StHbtEvent, StHbtKink, StHbtTrack : constructors from the persistent
25  * (TTree) classes added
26  * StHbtLikeSignAnalysis : minor changes, for debugging
27  * StHbtTypes: split into different files
28  * Added files: for the new TTree muDst's
29  * StExceptions.cxx StExceptions.hh StHbtEnumeration.hh
30  * StHbtHelix.hh StHbtHisto.hh StHbtString.hh StHbtTFile.hh
31  * StHbtTTreeEvent.cxx StHbtTTreeEvent.h StHbtTTreeKink.cxx
32  * StHbtTTreeKink.h StHbtTTreeTrack.cxx StHbtTTreeTrack.h
33  * StHbtTTreeV0.cxx StHbtTTreeV0.h StHbtVector.hh
34  *
35  * Revision 1.1 2001/05/25 23:23:59 lisa
36  * Added in StHbtKink stuff
37  *
38  *
39  *
40  ***********************************************************************/
41 
42 #include "StHbtKink.hh"
43 #include "phys_constants.h"
44 #include "StHbtMaker/Infrastructure/StHbtTrack.hh"
45 // -----------------------------------------------------------------------
46 StHbtKink::StHbtKink(const StHbtKink& k){ // copy constructor
47 
48  mDcaParentDaughter = k.mDcaParentDaughter;
49  mDcaDaughterPrimaryVertex = k.mDcaDaughterPrimaryVertex;
50  mDcaParentPrimaryVertex = k.mDcaParentPrimaryVertex;
51  mHitDistanceParentDaughter = k.mHitDistanceParentDaughter;
52  mHitDistanceParentVertex = k.mHitDistanceParentVertex;
53  mDeltaEnergy[0] = k.mDeltaEnergy[0];
54  mDeltaEnergy[1] = k.mDeltaEnergy[1];
55  mDeltaEnergy[2] = k.mDeltaEnergy[2];
56  mDecayAngle = k.mDecayAngle;
57  mDecayAngleCM = k.mDecayAngleCM;
58  mDaughter = k.mDaughter;
59  mParent = k.mParent;
60  mPosition = k.mPosition;
61 
62 }
63 // -----------------------------------------------------------------------
64 #ifdef __ROOT__
65 #include "StEvent/StTrack.h"
66 #include "StEvent/StKinkVertex.h"
67 StHbtKink::StHbtKink( const StKinkVertex& SKV, StHbtThreeVector PrimaryVertex )
68 {
69 
70  mDcaParentDaughter = SKV.dcaParentDaughter();
71  mDcaDaughterPrimaryVertex = SKV.dcaDaughterPrimaryVertex();
72  mDcaParentPrimaryVertex = SKV.dcaParentPrimaryVertex();
73  mHitDistanceParentDaughter = SKV.hitDistanceParentDaughter();
74  mHitDistanceParentVertex = SKV.hitDistanceParentVertex();
75  mDeltaEnergy[0] = SKV.dE(0);
76  mDeltaEnergy[1] = SKV.dE(1);
77  mDeltaEnergy[2] = SKV.dE(2);
78  mDecayAngle = SKV.decayAngle();
79  mDecayAngleCM = SKV.decayAngleCM();
80 
81  // now fill member StHbtTrack data...
82  const StTrack* StTrk;
83  StHbtTrack* HbtTrk;
84  // Daughter
85  StTrk = SKV.daughter(0);
86  HbtTrk = new StHbtTrack(StTrk,PrimaryVertex); // generate NEW HbtTrack from StTrack
87  mDaughter = *HbtTrk; // invoke copy ctr of StHbtTrack
88  delete HbtTrk; // get rid of the NEW HbtTrack - we are done with that
89  // Parent
90  StTrk = SKV.parent();
91  HbtTrk = new StHbtTrack(StTrk,PrimaryVertex); // generate NEW HbtTrack from StTrack
92  mParent = *HbtTrk; // invoke copy ctr of StHbtTrack
93  delete HbtTrk; // get rid of the NEW HbtTrack - we are done with that
94 
95  // finally, the kink position
96  mPosition.setX(SKV.position().x());
97  mPosition.setY(SKV.position().y());
98  mPosition.setZ(SKV.position().z());
99 
100 }
101 
102 #include "StHbtMaker/Infrastructure/StHbtTTreeEvent.h"
103 #include "StHbtMaker/Infrastructure/StHbtTTreeKink.h"
104 #include "StHbtMaker/Infrastructure/StHbtTTreeTrack.h"
105 StHbtKink::StHbtKink( const StHbtTTreeEvent* e, const StHbtTTreeKink* k) {
106  mDcaParentDaughter = k->mDcaParentDaughter;
107  mDcaDaughterPrimaryVertex = k->mDcaDaughterPrimaryVertex;
108  mDcaParentPrimaryVertex = k->mDcaParentPrimaryVertex;
109  mHitDistanceParentDaughter = k->mHitDistanceParentDaughter;
110  mHitDistanceParentVertex = k->mHitDistanceParentVertex;
111  mDeltaEnergy[0] = k->mDeltaEnergy[0];
112  mDeltaEnergy[1] = k->mDeltaEnergy[1];
113  mDeltaEnergy[2] = k->mDeltaEnergy[2];
114  mDecayAngle = k->mDecayAngle;
115  mDecayAngleCM = k->mDecayAngleCM;
116  StHbtTrack mDaughter = StHbtTrack(e, &k->mDaughter);
117  StHbtTrack mParent= StHbtTrack(e, &k->mParent);
118  StHbtThreeVector mPosition = StHbtThreeVector(k->mPositionX,k->mPositionY,k->mPositionZ);
119 }
120 
121 
122 #endif // __ROOT__
123