40 #include "StEvent/StEvent.h"
41 #include "StMcEventMaker/StMcEventMaker.h"
42 #include "StAssociationMaker/StAssociationMaker.h"
43 #include "StAssociationMaker/StTrackPairInfo.hh"
45 #include "StGlobalTrack.h"
46 #include "StXiVertex.h"
47 #include "StXiMuDst.hh"
49 #include "StMcEventTypes.hh"
50 #include "StParticleDefinition.hh"
51 #include "StTrackDetectorInfo.h"
53 #include "StStrangeControllerInclude.h"
61 StXiController::~StXiController() {
64 Int_t StXiController::MakeReadDst() {
69 for (j = 0; j<entries; j++) {
73 PrintNumCand(
"read",entries);
78 Int_t mc_entries = GetNMc();
79 for (j = 0; j<mc_entries; j++) {
92 StSPtrVecXiVertex& xiVertices =
event.xiVertices();
93 entries = xiVertices.size();
94 Int_t asize = dataArray->GetSize();
95 if (entries > asize) dataArray->Expand(entries+increment);
98 for (Int_t i=0; i<entries; i++) {
103 new((*dataArray)[j++])
StXiMuDst(xiVertex,v0Vertex,ev);
108 PrintNumCand(
"found",entries);
109 if (nBad) gMessMgr->Warning() <<
"StXiController: " << nBad
110 <<
"with missing V0 vertices" << endm;
116 Int_t StXiController::MakeCreateMcDst(
StMcVertex* mcVert) {
118 mcXiMapType* theMcXiMap = 0;
119 mcTrackMapType* theMcTrackMap = 0;
121 theMcXiMap = assocMaker->mcXiMap();
122 theMcTrackMap = assocMaker->mcTrackMap();
124 if (!((assocMaker)&&(theMcXiMap)&&(theMcTrackMap)))
return kStOk;
129 Int_t indexRecoArray = -1;
130 Int_t count = theMcXiMap->count(mcVert);
131 StSPtrVecMcTrack& Daughters = mcVert->daughters();
133 for (StMcTrackIterator DTrackIt = Daughters.begin();
134 DTrackIt != Daughters.end(); DTrackIt++) {
135 if ((Int_t)(*DTrackIt)->particleDefinition()->charge())
138 V0daughter = (*DTrackIt);
142 StXiMc* xiMc =
new((*mcArray)[mcEntries++])
StXiMc(mcVert,Bach,ev);
146 StMcVertex* v0Vertex = V0daughter->stopVertex();
148 Int_t before = v0Cont->GetNMc();
149 v0Cont->MakeCreateMcDst(v0Vertex);
150 Int_t after = v0Cont->GetNMc();
151 if (!(before==after)) xiMc->SetV0Index(before);
156 pair<mcXiMapIter,mcXiMapIter> mcXiBounds =
157 theMcXiMap->equal_range(mcVert);
159 for(mcXiMapIter mcXiMapIt = mcXiBounds.first;
160 mcXiMapIt != mcXiBounds.second; ++mcXiMapIt) {
161 rcXiPartner = (*mcXiMapIt).second;
162 float x, y, z, delta, xd, yd, zd;
163 x = mcVert->position().x();
164 y = mcVert->position().y();
165 z = mcVert->position().z();
166 xd = x - rcXiPartner->position().x();
167 yd = y - rcXiPartner->position().y();
168 zd = z - rcXiPartner->position().z();
169 delta = xd*xd + yd*yd + zd*zd;
172 for(mcXiMapIter mcXiMapIt = mcXiBounds.first;
173 mcXiMapIt != mcXiBounds.second; ++mcXiMapIt) {
175 if (temp != rcXiPartner) {
176 xd = x - temp->position().x();
177 yd = y - temp->position().y();
178 zd = z - temp->position().z();
179 float delta2 = xd*xd + yd*yd + zd*zd;
180 if (delta2 < delta) { rcXiPartner = temp; delta = delta2; }
183 x = rcXiPartner->position().x();
184 y = rcXiPartner->position().y();
185 z = rcXiPartner->position().z();
187 for(Int_t i = 0; i <= GetN(); i++) {
189 if( fabs(x - tmpXi->decayVertexXiX()) < 0.00001 &&
190 fabs(y - tmpXi->decayVertexXiY()) < 0.00001 &&
192 { indexRecoArray = i;
break; }
195 new((*assocArray)[assocEntries++])
197 if(indexRecoArray!=-1) {
198 pair<mcTrackMapIter,mcTrackMapIter> mcTrackBounds =
199 theMcTrackMap->equal_range(Bach);
201 for(mcTrackMapIter mcMapIt = mcTrackBounds.first;
202 mcMapIt != mcTrackBounds.second; ++mcMapIt) {
203 if ((*mcMapIt).second->commonTpcHits() > bestPairInfo->commonTpcHits())
204 bestPairInfo = (*mcMapIt).second;
206 if (mcTrackBounds.first != mcTrackBounds.second) {
207 xiMc->SetHitInfo(bestPairInfo->commonTpcHits());
Monte Carlo Track class All information on a simulated track is stored in this class: kinematics...
StStrangeEvMuDst * GetMcEvent()
Event information.
virtual void SetEvent(StStrangeEvMuDst *)
Set pointer to event information.
Int_t event() const
Event number.
Float_t decayVertexXiZ() const
Coordinates of decay vertex.