Bring AliFemto up to date with latest code developements
[u/mrichter/AliRoot.git] / PWG2 / FEMTOSCOPY / AliFemto / AliFemtoKink.cxx
1 ///////////////////////////////////////////////////////////////////////////
2 //                                                                       //
3 // AliFemtoKink: main class holding all the necessary information        //
4 // about a kink (before the identification) that is required during      //
5 // femtoscopic analysis. This class is filled with information from the  //
6 // input stream by the reader. A particle has a link back to the Kink    //
7 // it was created from, so we do not copy the information.               //
8 //                                                                       //
9 ///////////////////////////////////////////////////////////////////////////
10 /***********************************************************************
11  *
12  * $Id$
13  *
14  * Author: Mike Lisa, Ohio State, 23May2001
15  *
16  ***********************************************************************
17  *
18  * Description: Kink class with information gotten from the StKinkVertex
19  *              of Wenshen Deng and Spiros Margetis
20  *
21  ***********************************************************************
22  *
23  * $Log$
24  * Revision 1.4  2007/05/03 09:42:29  akisiel
25  * Fixing Effective C++ warnings
26  *
27  * Revision 1.3  2007/04/27 07:24:34  akisiel
28  * Make revisions needed for compilation from the main AliRoot tree
29  *
30  * Revision 1.1.1.1  2007/04/25 15:38:41  panos
31  * Importing the HBT code dir
32  *
33  * Revision 1.1.1.1  2007/03/07 10:14:49  mchojnacki
34  * First version on CVS
35  *
36  * Revision 1.4  2001/11/14 21:07:21  lisa
37  * Fixed several small things (mostly discarded const) that caused fatal errors with gcc2.95.3
38  *
39  * Revision 1.3  2001/09/05 21:55:23  laue
40  * typo fixed
41  *
42  * Revision 1.2  2001/06/21 19:15:46  laue
43  * Modified fiels:
44  *   CTH.h : new constructor added
45  *   AliFemtoEvent, AliFemtoKink, AliFemtoTrack : constructors from the persistent
46  *                                   (TTree) classes added
47  *   AliFemtoLikeSignAnalysis : minor changes, for debugging
48  *   AliFemtoTypes: split into different files
49  * Added files: for the new TTree muDst's
50  *   StExceptions.cxx StExceptions.h AliFemtoEnumeration.h
51  *   AliFemtoHelix.h AliFemtoHisto.h AliFemtoString.h AliFemtoTFile.h
52  *   AliFemtoTTreeEvent.cxx AliFemtoTTreeEvent.h AliFemtoTTreeKink.cxx
53  *   AliFemtoTTreeKink.h AliFemtoTTreeTrack.cxx AliFemtoTTreeTrack.h
54  *   AliFemtoTTreeV0.cxx AliFemtoTTreeV0.h AliFemtoVector.h
55  *
56  * Revision 1.1  2001/05/25 23:23:59  lisa
57  * Added in AliFemtoKink stuff
58  *
59  * 
60  *
61  ***********************************************************************/
62
63 #include "AliFemtoKink.h"
64 #include "phys_constants.h"
65 #include "AliFemtoTrack.h"
66 // -----------------------------------------------------------------------
67 AliFemtoKink::AliFemtoKink():
68   fDcaParentDaughter(0), fDcaDaughterPrimaryVertex(0), 
69   fDcaParentPrimaryVertex(0), fHitDistanceParentDaughter(0),  
70   fHitDistanceParentVertex(0),
71   fDecayAngle(0), fDecayAngleCM(0),             
72   fDaughter(),            
73   fParent(),               
74   fPosition(0,0,0)        
75 {/* no-op */}
76 // -----------------------------------------------------------------------
77 AliFemtoKink::AliFemtoKink(const AliFemtoKink& k):
78   fDcaParentDaughter(0), fDcaDaughterPrimaryVertex(0), 
79   fDcaParentPrimaryVertex(0), fHitDistanceParentDaughter(0),  
80   fHitDistanceParentVertex(0),
81   fDecayAngle(0), fDecayAngleCM(0),             
82   fDaughter(),            
83   fParent(),               
84   fPosition(0,0,0)        
85 { // copy constructor
86
87   fDcaParentDaughter          =   k.fDcaParentDaughter;           
88   fDcaDaughterPrimaryVertex   =   k.fDcaDaughterPrimaryVertex;    
89   fDcaParentPrimaryVertex     =   k.fDcaParentPrimaryVertex;      
90   fHitDistanceParentDaughter  =   k.fHitDistanceParentDaughter;   
91   fHitDistanceParentVertex    =   k.fHitDistanceParentVertex;     
92   fDeltaEnergy[0]             =   k.fDeltaEnergy[0];              
93   fDeltaEnergy[1]             =   k.fDeltaEnergy[1];              
94   fDeltaEnergy[2]             =   k.fDeltaEnergy[2];              
95   fDecayAngle                 =   k.fDecayAngle;                  
96   fDecayAngleCM               =   k.fDecayAngleCM;                
97   fDaughter                   =   k.fDaughter;                    
98   fParent                     =   k.fParent;                      
99   fPosition                   =   k.fPosition;                
100
101 }
102 // -----------------------------------------------------------------------
103
104
105 //--------------------- below here is ONLY star ----------------
106 #ifndef __NO_STAR_DEPENDENCE_ALLOWED__
107 #ifdef __ROOT__
108 #include "StEvent/StTrack.h"
109 #include "StEvent/StKinkVertex.h"
110 AliFemtoKink::AliFemtoKink( const StKinkVertex& SKV, AliFemtoThreeVector PrimaryVertex )
111
112
113   fDcaParentDaughter          = SKV.dcaParentDaughter();
114   fDcaDaughterPrimaryVertex   = SKV.dcaDaughterPrimaryVertex();
115   fDcaParentPrimaryVertex     = SKV.dcaParentPrimaryVertex();
116   fHitDistanceParentDaughter  = SKV.hitDistanceParentDaughter();
117   fHitDistanceParentVertex    = SKV.hitDistanceParentVertex();
118   fDeltaEnergy[0]             = SKV.dE(0);
119   fDeltaEnergy[1]             = SKV.dE(1);
120   fDeltaEnergy[2]             = SKV.dE(2);
121   fDecayAngle                 = SKV.decayAngle();
122   fDecayAngleCM               = SKV.decayAngleCM();
123
124   // now fill member AliFemtoTrack data...
125   const StTrack* StTrk;
126   AliFemtoTrack* HbtTrk;
127   // Daughter
128   StTrk = SKV.daughter(0);
129   HbtTrk = new AliFemtoTrack(StTrk,PrimaryVertex); // generate NEW HbtTrack from StTrack
130   fDaughter = *HbtTrk;                         // invoke copy ctr of AliFemtoTrack
131   delete HbtTrk;                               // get rid of the NEW HbtTrack - we are done with that
132   // Parent
133   StTrk = SKV.parent();
134   HbtTrk = new AliFemtoTrack(StTrk,PrimaryVertex); // generate NEW HbtTrack from StTrack
135   fParent = *HbtTrk;                           // invoke copy ctr of AliFemtoTrack
136   delete HbtTrk;                               // get rid of the NEW HbtTrack - we are done with that
137
138   // finally, the kink position
139   fPosition.setX(SKV.position().x());
140   fPosition.setY(SKV.position().y());
141   fPosition.setZ(SKV.position().z());
142
143 }
144
145 // mike removed all AliFemtoTTree stuff 21apr2006
146
147 #endif // __ROOT__
148 #endif  // __NO_STAR_DEPENDENCE_ALLOWED__