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 "StKinkVertex.h"
47 #include "StKinkMuDst.hh"
48 #include "StKinkMc.hh"
49 #include "StMcEventTypes.hh"
50 #include "StParticleDefinition.hh"
51 #include "StTrackDetectorInfo.h"
53 #include "StStrangeControllerInclude.h"
62 StKinkController::~StKinkController() {
65 Int_t StKinkController::MakeReadDst() {
68 PrintNumCand(
"read",entries);
74 Int_t StKinkController::MakeCreateDst(
StEvent& event) {
77 StSPtrVecKinkVertex& kinkVertices =
event.kinkVertices();
78 entries = kinkVertices.size();
79 Int_t asize = dataArray->GetSize();
80 if (entries > asize) dataArray->Expand(entries+increment);
82 for (Int_t i=0; i<entries; i++) {
88 PrintNumCand(
"found",entries);
94 Int_t StKinkController::MakeCreateMcDst(
StMcVertex* mcVert) {
96 mcKinkMapType* theMcKinkMap = 0;
97 mcTrackMapType* theMcTrackMap = 0;
99 theMcKinkMap = assocMaker->mcKinkMap();
100 theMcTrackMap = assocMaker->mcTrackMap();
102 if (!((assocMaker)&&(theMcKinkMap)&&(theMcTrackMap)))
return kStOk;
105 Int_t indexRecoArray = -1;
106 Int_t count = theMcKinkMap->count(mcVert);
107 StSPtrVecMcTrack& Daughters = mcVert->daughters();
109 for (StMcTrackIterator DTrackIt = Daughters.begin();
110 DTrackIt != Daughters.end(); DTrackIt++) {
111 if ((Int_t)(*DTrackIt)->particleDefinition()->charge()) {
112 Daughter = (*DTrackIt);
120 pair<mcKinkMapIter,mcKinkMapIter> mcKinkBounds =
121 theMcKinkMap->equal_range(mcVert);
124 rcKinkPartner = (*mcKinkBounds.first).second;
125 float x, y, z, delta, xd, yd, zd;
126 x = mcVert->position().x();
127 y = mcVert->position().y();
128 z = mcVert->position().z();
129 xd = x - rcKinkPartner->position().x();
130 yd = y - rcKinkPartner->position().y();
131 zd = z - rcKinkPartner->position().z();
132 delta = xd*xd + yd*yd + zd*zd;
135 for(mcKinkMapIter mcKinkMapIt = mcKinkBounds.first;
136 mcKinkMapIt != mcKinkBounds.second; ++mcKinkMapIt) {
138 if (temp != rcKinkPartner) {
139 xd = x - temp->position().x();
140 yd = y - temp->position().y();
141 zd = z - temp->position().z();
142 float delta2 = xd*xd + yd*yd + zd*zd;
143 if (delta2 < delta) { rcKinkPartner = temp; delta = delta2; }
146 x = rcKinkPartner->position().x();
147 y = rcKinkPartner->position().y();
148 z = rcKinkPartner->position().z();
150 for(Int_t i = 0; i < GetN(); i++) {
152 if( fabs(x - tmpKink->positionX()) < 0.00001 &&
153 fabs(y - tmpKink->positionY()) < 0.00001 &&
154 fabs(z - tmpKink->positionZ()) < 0.00001 )
155 { indexRecoArray = i;
break; }
157 new((*assocArray)[assocEntries++])
159 if(indexRecoArray!=-1) {
160 pair<mcTrackMapIter,mcTrackMapIter> mcTrackBounds =
161 theMcTrackMap->equal_range(Daughter);
163 for(mcTrackMapIter mcMapIt = mcTrackBounds.first;
164 mcMapIt != mcTrackBounds.second; ++mcMapIt) {
165 if ((*mcMapIt).second->commonTpcHits() > bestPairInfo->commonTpcHits())
166 bestPairInfo = (*mcMapIt).second;
168 if (mcTrackBounds.first != mcTrackBounds.second) {
169 kinkMc->SetHitInfo(bestPairInfo->commonTpcHits());
Monte Carlo Track class All information on a simulated track is stored in this class: kinematics...