StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StHbtStrangeMuDstEventReader.cxx
1 /***************************************************************************
2  *
3  * $Id: StHbtStrangeMuDstEventReader.cxx,v 1.2 2001/06/21 19:18:42 laue Exp $
4  *
5  * Author: Frank Laue, Ohio State, laue@mps.ohio-state.edu
6  ***************************************************************************
7  *
8  * Description: part of STAR HBT Framework: StHbtMaker package
9  * This is the HbtEventReader class to be used when reading the
10  * StStrangeMuDsts produced by the STAR Strangeness group
11  *
12  ***************************************************************************
13  *
14  * $Log: StHbtStrangeMuDstEventReader.cxx,v $
15  * Revision 1.2 2001/06/21 19:18:42 laue
16  * Modified Files: (to match the changed base classes)
17  * StHbtAsciiReader.cxx StHbtAsciiReader.h
18  * StHbtAssociationReader.cxx StHbtAssociationReader.h
19  * StHbtBinaryReader.cxx StHbtBinaryReader.h
20  * StHbtGstarTxtReader.cxx StHbtGstarTxtReader.h
21  * StHbtStrangeMuDstEventReader.cxx
22  * StHbtStrangeMuDstEventReader.h StStandardHbtEventReader.cxx
23  * Added Files: new reader
24  * StHbtTTreeReader.cxx StHbtTTreeReader.h
25  *
26  * Revision 1.1 2000/12/13 20:45:00 laue
27  * New reader to read directly from the StStrangeMuDstMaker's V0 files
28  *
29  *
30  **************************************************************************/
31 #include "StHbtMaker/Reader/StHbtStrangeMuDstEventReader.h"
32 
33 #include "StChain.h"
34 
35 #include <math.h>
36 
37 
38 #include "StHbtMaker/Reader/StHbtGstarTxtReader.h"
39 #include "StHbtMaker/Base/StHbtEventCut.h"
40 #include "StHbtMaker/Base/StHbtTrackCut.h"
41 #include "StHbtMaker/Base/StHbtV0Cut.h"
42 #include "StHbtMaker/Base/StHbtKinkCut.h"
43 
44 #include "SystemOfUnits.h" // has "tesla" in it
45 #include "StHbtMaker/Infrastructure/StHbtV0Collection.hh"
47 #include "StStrangeMuDstMaker/StStrangeEvMuDst.hh"
48 #include "StStrangeMuDstMaker/StV0MuDst.hh"
49 
50 #ifdef __ROOT__
52 #endif
53 
54 #if !(ST_NO_NAMESPACES)
55  using namespace units;
56 #endif
57 
58 
59 //__________________
61  mReaderStatus = 0; // "good"
62  mStrangeMuDstMaker =0;
63 }
64 //__________________
66  mReaderStatus = 0; // "good"
67 }
68 //__________________
69 StHbtStrangeMuDstEventReader::~StHbtStrangeMuDstEventReader(){
70  if (mEventCut) delete mEventCut;
71  if (mV0Cut) delete mV0Cut;
72 }
73 //__________________
74 StHbtString StHbtStrangeMuDstEventReader::Report(){
75  StHbtString temp = "\n This is the StHbtStrangeMuDstEventReader\n";
76  temp += "---> EventCuts in Reader: ";
77  if (mEventCut) {
78  temp += mEventCut->Report();
79  }
80  else {
81  temp += "NONE";
82  }
83  temp += "\n---> V0Cuts in Reader: ";
84  if (mV0Cut) {
85  temp += mV0Cut->Report();
86  }
87  else {
88  temp += "NONE";
89  }
90  temp += "\n";
91  return temp;
92 }
93 //__________________
94 StHbtEvent* StHbtStrangeMuDstEventReader::ReturnHbtEvent(){
95 #ifdef STHBTDEBUG
96  cout << " StHbtStrangeMuDstEventReader::ReturnHbtEvent()" << endl;
97 #endif
98  StStrangeEvMuDst* strangeEvMuDst = mStrangeMuDstMaker->GetEvent();
99  if (!strangeEvMuDst){
100  cout << " StHbtStrangeMuDstEventReader::ReturnHbtEvent() - No StrangeEvMuDst !!! " << endl;
101  return 0;
102  }
103 
104  StHbtEvent* hbtEvent = new StHbtEvent;
105  StHbtThreeVector vp = StHbtThreeVector(strangeEvMuDst->primaryVertexX(),strangeEvMuDst->primaryVertexY(),strangeEvMuDst->primaryVertexZ());
106  cout << " StHbtStrangeMuDstEventReader::ReturnHbtEvent() - primary vertex : " << vp << endl;
107  hbtEvent->SetPrimVertPos(vp);
108  hbtEvent->SetNumberOfTracks(strangeEvMuDst->primaryTracks());
109  hbtEvent->SetEventNumber(strangeEvMuDst->event());
110 
111  // By now, all event-wise information has been extracted and stored in hbtEvent
112  // see if it passes any front-loaded event cut
113  if (mEventCut){
114  if (!(mEventCut->Pass(hbtEvent))){ // event failed! - return null pointer (but leave Reader status flag as "good")
115  delete hbtEvent;
116  return 0;
117  }
118  }
119 
120  for( int i= 0; i < mStrangeMuDstMaker->GetNV0(); i++){
121  StV0MuDst* v0FromMuDst = mStrangeMuDstMaker->GetV0(i);
122  //v0FromMuDst->UpdateV0();
123  StHbtV0* hbtV0 = new StHbtV0;
124  hbtV0->SetdecayLengthV0(v0FromMuDst->decayLengthV0());
125  hbtV0->SetdecayVertexV0X(v0FromMuDst->decayVertexV0X());
126  hbtV0->SetdecayVertexV0Y(v0FromMuDst->decayVertexV0Y());
127  hbtV0->SetdecayVertexV0Z(v0FromMuDst->decayVertexV0Z());
128  hbtV0->SetdcaV0Daughters(v0FromMuDst->dcaV0Daughters());
129  hbtV0->SetdcaV0ToPrimVertex(v0FromMuDst->dcaV0ToPrimVertex());
130  hbtV0->SetdcaPosToPrimVertex(v0FromMuDst->dcaPosToPrimVertex());
131  hbtV0->SetdcaNegToPrimVertex(v0FromMuDst->dcaNegToPrimVertex());
132  hbtV0->SetmomPosX(v0FromMuDst->momPosX());
133  hbtV0->SetmomPosY(v0FromMuDst->momPosY());
134  hbtV0->SetmomPosZ(v0FromMuDst->momPosZ());
135  hbtV0->SetmomNegX(v0FromMuDst->momNegX());
136  hbtV0->SetmomNegY(v0FromMuDst->momNegY());
137  hbtV0->SetmomNegZ(v0FromMuDst->momNegZ());
138 #ifdef STHBTDEBUG
139  cout << " hist pos ";
140  cout << v0FromMuDst->topologyMapPos().numberOfHits(kTpcId);
141  cout << " hist neg ";
142  cout << v0FromMuDst->topologyMapNeg().numberOfHits(kTpcId) << endl;
143 #endif
144  hbtV0->SettpcHitsPos(v0FromMuDst->topologyMapPos().numberOfHits(kTpcId));
145  hbtV0->SettpcHitsNeg(v0FromMuDst->topologyMapNeg().numberOfHits(kTpcId));
146  hbtV0->SetTrackTopologyMapPos(0,v0FromMuDst->topologyMapPos().data(0));
147  hbtV0->SetTrackTopologyMapPos(1,v0FromMuDst->topologyMapPos().data(1));
148  hbtV0->SetTrackTopologyMapNeg(0,v0FromMuDst->topologyMapNeg().data(0));
149  hbtV0->SetTrackTopologyMapNeg(1,v0FromMuDst->topologyMapNeg().data(1));
150  hbtV0->SetkeyPos(v0FromMuDst->keyPos());
151  hbtV0->SetkeyNeg(v0FromMuDst->keyNeg());
152 #ifdef STHBTDEBUG
153  cout << " keyPos " << v0FromMuDst->keyPos() << endl;
154  cout << " keyNeg " << v0FromMuDst->keyNeg() << endl;
155 #endif
156  hbtV0->SetmomV0X(v0FromMuDst->momV0X());
157  hbtV0->SetmomV0Y(v0FromMuDst->momV0Y());
158  hbtV0->SetmomV0Z(v0FromMuDst->momV0Z());
159 #ifdef STHBTDEBUG
160  cout << " alpha ";
161  cout << v0FromMuDst->alphaV0();
162  cout << " ptArm ";
163  cout << v0FromMuDst->ptArmV0() << endl;
164 #endif
165  hbtV0->SetalphaV0(v0FromMuDst->alphaV0());
166  hbtV0->SetptArmV0(v0FromMuDst->ptArmV0());
167  hbtV0->SeteLambda(v0FromMuDst->eLambda());
168  hbtV0->SeteK0Short(v0FromMuDst->eK0Short());
169  hbtV0->SetePosProton(v0FromMuDst->ePosProton());
170  hbtV0->SetePosPion(v0FromMuDst->ePosPion());
171  hbtV0->SeteNegPion(v0FromMuDst->eNegPion());
172  hbtV0->SeteNegProton(v0FromMuDst->eNegProton());
173  hbtV0->SetmassLambda(v0FromMuDst->massLambda());
174  hbtV0->SetmassAntiLambda(v0FromMuDst->massAntiLambda());
175  hbtV0->SetmassK0Short(v0FromMuDst->massK0Short());
176  hbtV0->SetrapLambda(v0FromMuDst->rapLambda());
177  hbtV0->SetrapK0Short(v0FromMuDst->rapK0Short());
178  hbtV0->SetcTauLambda(v0FromMuDst->cTauLambda());
179  hbtV0->SetcTauK0Short(v0FromMuDst->cTauK0Short());
180  hbtV0->SetptV0(v0FromMuDst->ptV0());
181  hbtV0->SetptotV0(v0FromMuDst->ptotV0());
182  hbtV0->SetptPos(v0FromMuDst->ptPos());
183  hbtV0->SetptotPos(v0FromMuDst->ptotPos());
184  hbtV0->SetptNeg(v0FromMuDst->ptNeg());
185  hbtV0->SetptotNeg(v0FromMuDst->ptotNeg());
186  hbtV0->SetdedxPos(v0FromMuDst->dedxPos());
187  hbtV0->SetdedxNeg(v0FromMuDst->dedxNeg());
188 
189 
190  // By now, all track-wise information has been extracted and stored in hbtTrack
191  // see if it passes any front-loaded event cut
192  if (mV0Cut){
193  if (!(mV0Cut->Pass(hbtV0))){ // track failed - delete it and skip the push_back
194  delete hbtV0;
195  continue;
196  }
197  }
198 
199 
200  hbtEvent->V0Collection()->push_back(hbtV0);
201  } // end of loop over strangeness groups v0's
202  //Store total number of v0s in v0Mudst so can start from there next time
203 #ifdef STHBTDEBUG
204  cout << " StHbtStrangeMuDstEventReader::ReturnHbtEvent() - " << hbtEvent->V0Collection()->size();
205  cout << " V0s pushed in collection " << endl;
206 #endif
207  printf(" StHbtStrangeMuDstEventReader::ReturnHbtEvent() - %8i(%i) V0s pushed into collection \n",
208  hbtEvent->V0Collection()->size(),
209  mStrangeMuDstMaker->GetNV0());
210 
211  // There might be event cuts that modify the collections of Tracks or V0 in the event.
212  // These cuts have to be done after the event is built. That's why we have the event cut
213  // at this point for the second time.
214  // An example of this kind of cuts will be an cut that removes spit tracks from the event.
215  if (mEventCut){
216  if (!(mEventCut->Pass(hbtEvent))){ // event failed! - return null pointer (but leave Reader status flag as "good")
217  delete hbtEvent;
218  return 0;
219  }
220  }
221 
222  return hbtEvent;
223 }
224 
225 
226 
227 
228 
229 
230 
231 
232 
233 
234 
235 
236 
237 
238 
239 
240 
241 
242 
243 
244 
Float_t momPosZ() const
Momentum components of pos. daughter.
Definition: StV0MuDst.hh:124
Float_t ptotV0()
Total momentum.
Definition: StV0I.hh:463
Float_t ePosProton()
Energy of pos. daughter assuming proton.
Definition: StV0I.hh:384
Float_t dcaV0ToPrimVertex() const
DCA of v0 to primary vertex.
Definition: StV0MuDst.hh:116
Float_t massAntiLambda()
Mass assuming antilambda hypothesis.
Definition: StV0I.hh:409
Int_t keyNeg() const
Neg. daughter track key.
Definition: StV0MuDst.hh:133
Float_t dcaPosToPrimVertex() const
DCA of pos v0 daughter to pri vertex.
Definition: StV0MuDst.hh:118
Float_t ptV0()
Transverse momentum.
Definition: StV0I.hh:459
Float_t ptotPos()
Total momentum of pos. daughter.
Definition: StV0I.hh:447
Float_t massLambda()
Mass assuming lambda hypothesis.
Definition: StV0I.hh:405
Float_t rapK0Short()
Rapidity assuming k-short.
Definition: StV0I.hh:429
Float_t eNegPion()
Energy of neg. daughter assuming pion.
Definition: StV0I.hh:396
virtual Float_t decayLengthV0() const
3-d decay distance
Definition: StV0I.hh:298
Int_t keyPos() const
Pos. daughter track key.
Definition: StV0MuDst.hh:132
StTrackTopologyMap & topologyMapPos()
Pos. daughter track topology map.
Definition: StV0MuDst.hh:128
Float_t eNegProton()
Energy of neg. daughter assuming antiproton.
Definition: StV0I.hh:388
Float_t ptArmV0()
Armenteros-Podolanski variables.
Definition: StV0I.hh:359
Float_t eK0Short()
Energy assuming k-short hypothesis.
Definition: StV0I.hh:372
Float_t dcaNegToPrimVertex() const
DCA of neg v0 daughter to pri vertex.
Definition: StV0MuDst.hh:120
Float_t dedxNeg() const
dE/dX of neg. daughter
Definition: StV0MuDst.hh:146
Float_t cTauLambda()
Lifetime (ctau) assuming (anti)lambda.
Definition: StV0I.hh:435
Float_t cTauK0Short()
Lifetime (ctau) assuming k-short.
Definition: StV0I.hh:439
Float_t ptPos()
Transverse momentum of pos. daughter.
Definition: StV0I.hh:443
Float_t ptotNeg()
Total momentum of neg. daughter.
Definition: StV0I.hh:455
Float_t momV0Z() const
Momentum components of V0.
Definition: StV0MuDst.hh:136
Float_t dedxPos() const
dE/dX of pos. daughter
Definition: StV0MuDst.hh:145
StTrackTopologyMap & topologyMapNeg()
Neg. daughter track topology map.
Definition: StV0MuDst.hh:130
StHbtStrangeMuDstEventReader()
this is the chain where the StStrangeMuDstMaker is
Float_t ptNeg()
Transverse momentum of neg. daughter.
Definition: StV0I.hh:451
Float_t rapLambda()
Rapidity assuming (anti)lambda.
Definition: StV0I.hh:423
Float_t eLambda()
Energy assuming lambda hypothesis.
Definition: StV0I.hh:368
Float_t dcaV0Daughters() const
DCA of v0 daughters at decay vertex.
Definition: StV0MuDst.hh:114
Float_t primaryVertexZ() const
Primary vtx position coordinates.
Float_t massK0Short()
Mass assuming k-short hypothesis.
Definition: StV0I.hh:413
Float_t ePosPion()
Energy of pos. daughter assuming pion.
Definition: StV0I.hh:392
Float_t decayVertexV0Z() const
Coordinates of decay vertex.
Definition: StV0MuDst.hh:113
Int_t event() const
Event number.
Float_t momNegZ() const
Momentum components of neg. daughter.
Definition: StV0MuDst.hh:127