00001
00002
00003
00004
00005
00006
00007
00008 #include <map>
00009
00010 #include "StMuDst.h"
00011
00012 #include "StContainers.h"
00013 #include "StEvent/StEventTypes.h"
00014 #include "StEvent/StTriggerData.h"
00015 #include "StEvent/StTriggerData2003.h"
00016 #include "StEvent/StTriggerData2004.h"
00017 #include "StEvent/StTriggerData2005.h"
00018 #include "StEvent/StTriggerData2007.h"
00019 #include "StEvent/StTriggerData2008.h"
00020 #include "StEvent/StTriggerData2009.h"
00021
00022 #include "StarClassLibrary/StTimer.hh"
00023 #include "StMuDstMaker.h"
00024 #include "StMuEvent.h"
00025 #include "StMuPrimaryVertex.h"
00026 #include "StMuRpsCollection.h"
00027 #include "StMuMtdCollection.h"
00028 #include "StMuTrack.h"
00029 #include "StMuDebug.h"
00030 #include "StMuEmcUtil.h"
00031 #include "StMuFmsUtil.h"
00032 #include "StMuPmdUtil.h"
00034 #include "StBTofCollection.h"
00035 #include "StBTofRawHit.h"
00036 #include "StBTofHeader.h"
00037 #include "StBTofPidTraits.h"
00038 #include "StMuBTofHit.h"
00039 #include "TClonesArray.h"
00040 #include "TTree.h"
00041 #ifndef __NO_STRANGE_MUDST__
00042 #include "StStrangeMuDstMaker/StV0MuDst.hh"
00043 #include "StStrangeMuDstMaker/StXiMuDst.hh"
00044 #include "StStrangeMuDstMaker/StKinkMuDst.hh"
00045 #endif
00046 TClonesArray** StMuDst::arrays = 0;
00047 #ifndef __NO_STRANGE_MUDST__
00048 TClonesArray** StMuDst::strangeArrays= 0;
00049 #endif
00050 #include "StMuMcVertex.h"
00051 #include "StMuMcTrack.h"
00052 TClonesArray** StMuDst::mcArrays= 0;
00053 TClonesArray** StMuDst::emcArrays = 0;
00054 TClonesArray** StMuDst::fmsArrays = 0;
00055 TClonesArray** StMuDst::pmdArrays = 0;
00056 TClonesArray** StMuDst::tofArrays = 0;
00057 TClonesArray** StMuDst::btofArrays = 0;
00058 TClonesArray *StMuDst::mMuEmcCollectionArray = 0;
00059 StMuEmcCollection *StMuDst::mMuEmcCollection = 0;
00060 StMuFmsCollection *StMuDst::mMuFmsCollection = 0;
00061 TClonesArray *StMuDst::mMuPmdCollectionArray = 0;
00062 StMuPmdCollection *StMuDst::mMuPmdCollection = 0;
00063 StEmcCollection *StMuDst::mEmcCollection = 0;
00064 StFmsCollection *StMuDst::mFmsCollection = 0;
00065 TClonesArray** StMuDst::eztArrays = 0;
00066
00067 Int_t StMuDst::mCurrVertexId = 0;
00068 TObjArray* StMuDst::mCurrPrimaryTracks = 0;
00069
00070 StMuDst::StMuDst() {
00071 DEBUGMESSAGE("");
00072
00073 }
00074
00075
00076
00077
00078 void StMuDst::unset() {
00079 arrays = 0;
00080 #ifndef __NO_STRANGE_MUDST__
00081 strangeArrays = 0;
00082 #endif
00083 mcArrays = 0;
00084 emcArrays = 0;
00085 fmsArrays = 0;
00086 pmdArrays = 0;
00087 tofArrays = 0;
00088 btofArrays = 0;
00089 mMuEmcCollectionArray = 0;
00090 mMuEmcCollection = 0;
00091 mMuFmsCollection = 0;
00092 mMuPmdCollectionArray = 0;
00093 mMuPmdCollection = 0;
00094 mEmcCollection = 0;
00095 mFmsCollection = 0;
00096 eztArrays = 0;
00097 }
00098
00099
00100
00101 void StMuDst::set(StMuDstMaker* maker) {
00102 DEBUGMESSAGE2("");
00103 if (!maker) { DEBUGVALUE(maker); return;}
00104 arrays = maker->mArrays;
00105 #ifndef __NO_STRANGE_MUDST__
00106 strangeArrays = maker->mStrangeArrays;
00107 #endif
00108 mcArrays = maker->mMCArrays;
00109 emcArrays = maker->mEmcArrays;
00110 fmsArrays = maker->mFmsArrays;
00111 pmdArrays = maker->mPmdArrays;
00112 tofArrays = maker->mTofArrays;
00113 btofArrays = maker->mBTofArrays;
00114 mMuEmcCollectionArray = maker->mEmcCollectionArray;
00115 mMuEmcCollection = maker->mEmcCollection;
00116 mMuFmsCollection = maker->mFmsCollection;
00117 mMuPmdCollectionArray = maker->mPmdCollectionArray;
00118 mMuPmdCollection = maker->mPmdCollection;
00119 eztArrays = maker->mEztArrays;
00120
00121 #ifndef __NO_STRANGE_MUDST__
00122 StStrangeEvMuDst* ev = strangeEvent();
00123 int nV0s = v0s()->GetEntries(); for (int i=0;i<nV0s; i++) v0s(i)->SetEvent(ev);
00124 int nXis = xis()->GetEntries(); for (int i=0;i<nXis; i++) xis(i)->SetEvent(ev);
00125
00126 #endif
00127 }
00128
00129
00130
00131 void StMuDst::set(TClonesArray** theArrays,
00132 #ifndef __NO_STRANGE_MUDST__
00133 TClonesArray** theStrangeArrays,
00134 #endif
00135 TClonesArray** theMCArrays,
00136 TClonesArray** theEmcArrays,
00137 TClonesArray** theFmsArrays,
00138 TClonesArray** thePmdArrays,
00139 TClonesArray** theTofArrays,
00140 TClonesArray** theBTofArrays,
00141 TClonesArray* emc_arr,
00142 StMuEmcCollection *emc,
00143 StMuFmsCollection *fms,
00144 TClonesArray* pmd_arr,
00145 StMuPmdCollection *pmd,
00146 TClonesArray** theEztArrays)
00147 {
00148
00149
00150 DEBUGMESSAGE2("");
00151 arrays = theArrays;
00152 #ifndef __NO_STRANGE_MUDST__
00153 strangeArrays = theStrangeArrays;
00154 #endif
00155 mcArrays = theMCArrays;
00156 emcArrays = theEmcArrays;
00157 fmsArrays = theFmsArrays;
00158 pmdArrays = thePmdArrays;
00159 tofArrays = theTofArrays;
00160 btofArrays = theBTofArrays;
00161 mMuEmcCollectionArray = emc_arr;
00162 mMuEmcCollection = emc;
00163 mMuFmsCollection = fms;
00164 mMuPmdCollectionArray = pmd_arr;
00165 mMuPmdCollection = pmd;
00166 eztArrays = theEztArrays;
00167 }
00168
00169
00170
00171 void StMuDst::collectVertexTracks() {
00172 if (mCurrPrimaryTracks == 0)
00173 mCurrPrimaryTracks = new TObjArray();
00174 Int_t n_track = arrays[muPrimary]->GetEntriesFast();
00175 mCurrPrimaryTracks->Clear();
00176 for (Int_t i_track = 0; i_track < n_track; i_track++) {
00177 if (((StMuTrack*)arrays[muPrimary]->UncheckedAt(i_track))->vertexIndex() == mCurrVertexId)
00178 mCurrPrimaryTracks->AddLast(arrays[muPrimary]->UncheckedAt(i_track));
00179 }
00180 }
00181
00182
00183
00184 void StMuDst::setVertexIndex(Int_t vtx_id) {
00185 if (mCurrVertexId == vtx_id)
00186 return;
00187 mCurrVertexId = vtx_id;
00188 collectVertexTracks();
00189 }
00190
00191
00192
00193 void StMuDst::fixTrackIndices() {
00197 fixTrackIndices( arrays[muPrimary], arrays[muGlobal] );
00198 }
00199
00200
00201
00202 void StMuDst::fixTrackIndices(TClonesArray* primary, TClonesArray* global) {
00210
00211 if ( !(global&&primary) ) return;
00212 DEBUGMESSAGE1("");
00213 StTimer timer;
00214 timer.start();
00215
00216 static int warningPrinted = 0;
00217 if (!warningPrinted) {
00218 LOG_WARN << "WARNING: You are using " << __PRETTY_FUNCTION__
00219 << " which does not work properly "
00220 " for productions with FTPC >= SL04d and <= SL05g" << endm;
00221 warningPrinted = 1;
00222 }
00223 int nGlobals = global->GetEntries();
00224 int nPrimaries = primary->GetEntries();
00225
00226 map<short,unsigned short> globalIndex;
00227
00228 for (int i=0; i<nGlobals; i++) {
00229 StMuTrack *g = (StMuTrack*) global->UncheckedAt(i);
00230 if (g) {
00231 globalIndex[g->id()] = i+1;
00232 globalTracks(i)->setIndex2Global(i);
00233 }
00234 }
00235
00236 DEBUGVALUE2(primary->GetEntries());
00237 for (int i=0; i<nPrimaries; i++) {
00238 StMuTrack *p = (StMuTrack*) primary->UncheckedAt(i);
00239 if (p) {
00240 if (globalIndex[p->id()])
00241 p->setIndex2Global( globalIndex[ p->id() ]-1 );
00242 else
00243 p->setIndex2Global(-1);
00244 }
00245 }
00246 DEBUGVALUE2(timer.elapsedTime());
00247 }
00248
00249 void StMuDst::fixTrackIndicesG(int mult) {
00251
00252
00253 if (mult==0){
00254 if(!(fabs(event()->primaryVertexPosition().x()) < 1.e-5 && fabs(event()->primaryVertexPosition().y()) < 1.e-5 && fabs(event()->primaryVertexPosition().z()) < 1.e-5)){
00255 int startpos = 0;
00256 int tid, pid;
00257 if(!globalTracks()) return;
00258 for (int i=0;i<globalTracks()->GetEntries();i++){
00259 tid = globalTracks(i)->id();
00260 globalTracks(i)->setIndex2Global(-2);
00261 if(!primaryTracks()) return;
00262 for(int j=startpos;j<primaryTracks()->GetEntries();j++){
00263 pid = primaryTracks(j)->id();
00264 if(pid==tid) {
00265 globalTracks(i)->setIndex2Global(j);
00266 if (j==startpos) startpos++;
00267 break;
00268 }
00269 else if (pid > tid) break;
00270 }
00271 }
00272 }
00273 return;
00274 }
00275
00276 if(!primaryVertices()) return;
00277 const int Nvert = primaryVertices()->GetEntries();
00278 if(!Nvert) return;
00279 int curVer = currentVertexIndex();
00280 int startpos[Nvert];
00281 for(int i=0;i<Nvert;i++) startpos[i]=0;
00282 int tid, pid;
00283 if(!globalTracks()) return;
00284
00285 for (int i=0;i<globalTracks()->GetEntries();i++){
00286 tid = globalTracks(i)->id();
00287 globalTracks(i)->setIndex2Global(-2);
00288 globalTracks(i)->setVertexIndex(-2);
00289
00290 for(int j=0;j<Nvert;j++){
00291 if(globalTracks(i)->index2Global() >= 0) break;
00292 setVertexIndex(j);
00293 if(!primaryTracks()) continue;
00294 for(int k=startpos[j];k<primaryTracks()->GetEntries();k++){
00295 pid = primaryTracks(k)->id();
00296 if(pid==tid) {
00297 globalTracks(i)->setIndex2Global(k);
00298 globalTracks(i)->setVertexIndex(j);
00299 if (k==startpos[j]) startpos[j]++;
00300 break;
00301 }
00302 else if (pid > tid) break;
00303 }
00304 }
00305 }
00306 setVertexIndex(curVer);
00307 }
00308
00309
00310
00311 void StMuDst::fixTofTrackIndices() {
00315 fixTofTrackIndices( btofArrays[muBTofHit], arrays[muPrimary], arrays[muGlobal] );
00316 }
00317
00318
00319
00320 void StMuDst::fixTofTrackIndices(TClonesArray* btofHit, TClonesArray* primary, TClonesArray* global) {
00321
00322 if ( !(primary&&global&&btofHit) ) return;
00323 DEBUGMESSAGE1("");
00324 StTimer timer;
00325 timer.start();
00326
00327 int nPrimarys = primary->GetEntries();
00328 int nGlobals = global->GetEntries();
00329 int nBTofHits = btofHit->GetEntries();
00330
00331 map<short,unsigned short> tofIndex;
00332 map<short,unsigned short> globalIndex;
00333 map<short,unsigned short> primaryIndex;
00334
00335 for (int i=0; i<nBTofHits; i++) {
00336 StMuBTofHit *t = (StMuBTofHit*) btofHit->UncheckedAt(i);
00337 if (t) {
00338 tofIndex[t->associatedTrackId()] = i+1;
00339 }
00340 }
00341
00342 for (int i=0; i<nGlobals; i++) {
00343 StMuTrack *g = (StMuTrack*) global->UncheckedAt(i);
00344 if (g) {
00345 globalIndex[g->id()] = i+1;
00346
00347 if(tofIndex[g->id()])
00348 g->setIndex2BTofHit( tofIndex[g->id()]-1 );
00349 else
00350 g->setIndex2BTofHit(-1);
00351 }
00352 }
00353 for (int i=0; i<nPrimarys; i++) {
00354 StMuTrack *p = (StMuTrack*) primary->UncheckedAt(i);
00355 if (p) {
00356 primaryIndex[p->id()] = i+1;
00357
00358 if(tofIndex[p->id()])
00359 p->setIndex2BTofHit( tofIndex[p->id()]-1 );
00360 else
00361 p->setIndex2BTofHit(-1);
00362 }
00363 }
00364
00366 for (int i=0; i<nBTofHits; i++) {
00367 StMuBTofHit *t = (StMuBTofHit*) btofHit->UncheckedAt(i);
00368 if (t) {
00369 if(globalIndex[t->associatedTrackId()])
00370 t->setIndex2Global( globalIndex[t->associatedTrackId()]-1 );
00371 else
00372 t->setIndex2Global(-1);
00373
00374 if(primaryIndex[t->associatedTrackId()])
00375 t->setIndex2Primary( primaryIndex[t->associatedTrackId()]-1 );
00376 else
00377 t->setIndex2Primary(-1);
00378 }
00379 }
00380
00381 DEBUGVALUE2(timer.elapsedTime());
00382 }
00383
00384
00385
00386
00387
00388
00389
00390
00391
00392
00393
00394
00395
00396
00397
00398
00399 StEvent* StMuDst::createStEvent() {
00400 DEBUGMESSAGE1("");
00401 StTimer timer;
00402 timer.start();
00403
00404 StMuEvent* mu = event();
00405 if(!mu) return NULL;
00406 StEvent* ev = new StEvent();
00407
00408 ev->setInfo( new StEventInfo(mu->eventInfo()) );
00409 ev->setRunInfo( new StRunInfo(mu->runInfo()) );
00410 ev->setSummary( new StEventSummary(mu->eventSummary()) );
00411
00412
00413
00414
00415
00416
00417
00418
00419
00420 StTriggerDetectorCollection *trg_coll=new StTriggerDetectorCollection();
00421 trg_coll->vpd()=mu->vpdTriggerDetector();
00422 trg_coll->bbc()=mu->bbcTriggerDetector();
00423 trg_coll->ctb()=mu->ctbTriggerDetector();
00424 trg_coll->emc()=mu->emcTriggerDetector();
00425 trg_coll->fpd()=mu->fpdTriggerDetector();
00426 trg_coll->zdc()=mu->zdcTriggerDetector();
00427 ev->setTriggerDetectorCollection(trg_coll);
00428
00429 ev->setFpdCollection( new StFpdCollection(mu->fpdCollection()) );
00430
00431 ev->setL0Trigger ( new StL0Trigger(mu->l0Trigger()) );
00432
00433 ev->setL3Trigger ( new StL3Trigger() );
00434
00435 StPrimaryVertex* vp = new StPrimaryVertex();
00436 ev->addPrimaryVertex(vp);
00437 vp->setPosition( mu->eventSummary().primaryVertexPosition() );
00438
00439 int nGlobals = arrays[muGlobal]->GetEntries();
00440
00441 StSPtrVecTrackNode &trackNodes = ev->trackNodes();
00442 TArrayI global_indices(nGlobals);
00443
00444
00445 for (int i=0; i<nGlobals; i++) {
00446 if(globalTracks(i)) {
00447 StTrackNode *node = new StTrackNode();
00448 node->addTrack(createStTrack(globalTracks(i)));
00449 trackNodes.push_back(node);
00450 global_indices[i]=trackNodes.size()-1;
00451 }
00452 else {
00453 global_indices[i]=-1;
00454 }
00455 }
00456
00461
00462 TObjArray *prim_tracks=primaryTracks();
00463
00464 int nPrimaries = prim_tracks->GetEntries();
00465 for (int i=0; i<nPrimaries; i++) if(primaryTracks(i)) {
00466 StTrack* t = createStTrack((StMuTrack*)prim_tracks->At(i));
00467 Int_t global_idx=primaryTracks(i)->index2Global();
00468 if (global_idx >= 0 && global_indices[global_idx] >= 0)
00469 trackNodes[global_indices[global_idx]]->addTrack( t );
00470 else {
00471 StTrackNode *node=new StTrackNode();
00472 node->addTrack(t);
00473 trackNodes.push_back(node);
00474 }
00475 vp->addDaughter( t );
00476 }
00477
00482
00483
00484 int nStates = arrays[muState]->GetEntries();
00485 for (int i=0; i<nStates; i++) {
00486 StDetectorState* det = new StDetectorState(*detectorStates(i));
00487 ev->addDetectorState(det);
00488 }
00489
00490
00491
00492 static StMuEmcUtil* mEmcUtil = new StMuEmcUtil();
00493 StMuEmcCollection *emc = muEmcCollection();
00494 if(emc) {
00495 StEmcCollection *EMC = mEmcUtil->getEmc(emc);
00496 if(EMC) ev->setEmcCollection(EMC);
00497 }
00498
00499 static StMuFmsUtil* mFmsUtil = new StMuFmsUtil();
00500 StMuFmsCollection *fms = muFmsCollection();
00501 if(fms) {
00502 StFmsCollection *FMS = mFmsUtil->getFms(fms);
00503 if(FMS) ev->setFmsCollection(FMS);
00504 }
00505
00506 static StMuPmdUtil* mPmdUtil = new StMuPmdUtil();
00507 StMuPmdCollection *pmd = pmdCollection();
00508 if(pmd) {
00509 StPhmdCollection *PMD = mPmdUtil->getPmd(pmd);
00510 if(PMD) ev->setPhmdCollection(PMD);
00511 }
00512
00513
00514 StTofCollection *tofcoll = new StTofCollection();
00515 ev->setTofCollection(tofcoll);
00516 int nTofData = tofArrays[muTofData]->GetEntries();
00517 for(int i=0;i<nTofData;i++) {
00518 StTofData *aData;
00519 if(tofData(i)) {
00520 unsigned short id = tofData(i)->dataIndex();
00521 unsigned short adc = tofData(i)->adc();
00522 unsigned short tdc = tofData(i)->tdc();
00523 short tc = tofData(i)->tc();
00524 unsigned short sc = tofData(i)->sc();
00525
00526 aData = new StTofData(id, adc, tdc, tc, sc, 0, 0);
00527 } else {
00528 aData = new StTofData(0, 0, 0, 0, 0, 0, 0);
00529 }
00530 tofcoll->addData(aData);
00531 }
00532
00533 int nTofRawData = tofArrays[muTofRawData]->GetEntries();
00534 for(int i=0;i<nTofRawData;i++) {
00535 StTofRawData *aRawData;
00536 if(tofRawData(i)) {
00537 unsigned short tray = tofRawData(i)->tray();
00538 unsigned short leteFlag = tofRawData(i)->leteFlag();
00539 unsigned short channel = tofRawData(i)->channel();
00540 unsigned int tdc = tofRawData(i)->tdc();
00541 unsigned int triggertime = tofRawData(i)->triggertime();
00542 unsigned short quality = tofRawData(i)->quality();
00543 aRawData = new StTofRawData(leteFlag,tray,channel,tdc,triggertime,quality);
00544 } else {
00545 aRawData = new StTofRawData(0, 0, 0, 0, 0, 0);
00546 }
00547 tofcoll->addRawData(aRawData);
00548 }
00549
00550
00551 StBTofCollection *btofcoll = new StBTofCollection();
00552 ev->setBTofCollection(btofcoll);
00553 int nBTofRawHits = btofArrays[muBTofRawHit]->GetEntries();
00554 for(int i=0;i<nBTofRawHits;i++) {
00555 StBTofRawHit *aRawHit;
00556 if(btofRawHit(i)) {
00557 aRawHit = new StBTofRawHit(*(btofRawHit(i)));
00558 } else {
00559 aRawHit = new StBTofRawHit();
00560 }
00561 btofcoll->addRawHit(aRawHit);
00562 }
00563 if(btofHeader()) btofcoll->setHeader(new StBTofHeader(*(btofHeader())));
00564
00565 StTriggerIdCollection* triggerIdCollection = new StTriggerIdCollection();
00566 StTriggerId triggerId;
00567 triggerId = mu->triggerIdCollection().l1();
00568 if ( !StMuTriggerIdCollection::isEmpty( triggerId ) ) triggerIdCollection->setL1( new StTriggerId( triggerId ) );
00569 triggerId = mu->triggerIdCollection().l2();
00570 if ( !StMuTriggerIdCollection::isEmpty( triggerId ) ) triggerIdCollection->setL2( new StTriggerId( triggerId ) );
00571 triggerId = mu->triggerIdCollection().l3();
00572 if ( !StMuTriggerIdCollection::isEmpty( triggerId ) ) triggerIdCollection->setL3( new StTriggerId( triggerId ) );
00573 triggerId = mu->triggerIdCollection().nominal();
00574 if ( !StMuTriggerIdCollection::isEmpty( triggerId ) ) triggerIdCollection->setNominal( new StTriggerId( triggerId ) );
00575 ev->setTriggerIdCollection( triggerIdCollection );
00576
00577
00578 DEBUGVALUE2(timer.elapsedTime());
00579 return ev;
00580 }
00581
00582 #include "StarClassLibrary/SystemOfUnits.h"
00583 #include "StarClassLibrary/PhysicalConstants.h"
00584 StTrackGeometry* StMuDst::trackGeometry(int q, StPhysicalHelixD* h) {
00585 static StPhysicalHelixD nullHelix;
00586 StHelixModel* model=0;
00587 if (nullHelix==*h) return 0;
00588 if (fabs(h->curvature()) > 100) return 0;
00589 if (fabs(h->origin().x())>1000) return 0;
00590 if (fabs(h->origin().y())>1000) return 0;
00591 if (fabs(h->origin().z())>1000) return 0;
00592
00593 model = new StHelixModel(q, h->phase()+h->h()*pi/2, h->curvature(), h->dipAngle(), h->origin(),
00594 h->momentumAt(0,event()->runInfo().magneticField()*kilogauss), h->h());
00595 return model;
00596 }
00597
00598 StTrack* StMuDst::createStTrack(StMuTrack* track) {
00599 StTrack* t=0;
00600 StTrackGeometry *tg;
00601 if (track->bad()) return 0;
00602
00603 if (track->type() == primary) t = new StPrimaryTrack();
00604 if (track->type() == global) t = new StGlobalTrack();
00605 assert(t);
00606 t->setFlag( track->flag() );
00607 t->setKey( track->id() );
00608
00609 StPhysicalHelixD helix;
00610 helix = track->helix();
00611 tg = trackGeometry( track->charge(), &helix );
00612 if (tg) t->setGeometry( tg );
00613 helix = track->outerHelix();
00614 tg = trackGeometry( track->charge(), &helix );
00615 if (tg) t->setOuterGeometry( tg );
00616
00617 t->setLength(track->length());
00618 t->setImpactParameter(track->dca().mag());
00619 t->addPidTraits(new StDedxPidTraits(kTpcId, kTruncatedMeanId, track->nHitsDedx(), track->dEdx(),0));
00620 Float_t a[2],b[15];
00621 a[0]=track->chi2();
00622 a[1]=0;
00623 memset(b,0,15*sizeof(Float_t));
00624
00625 StTrackFitTraits traits(0,0,a,b);
00626 traits.setNumberOfFitPoints(track->nHitsFit(kTpcId),kTpcId);
00627 traits.setNumberOfFitPoints(track->nHitsFit(kFtpcEastId),kFtpcEastId);
00628 traits.setNumberOfFitPoints(track->nHitsFit(kFtpcWestId),kFtpcWestId);
00629 traits.setNumberOfFitPoints(track->nHitsFit(kSvtId),kSvtId);
00630 traits.setNumberOfFitPoints(track->nHitsFit(kSsdId),kSsdId);
00631
00632
00633 if (track->type() == primary && track->mNHitsFitTpc != 255)
00634 traits.setPrimaryVertexUsedInFit(kTRUE);
00635 t->setFitTraits(traits);
00636
00637 t->setNumberOfPossiblePoints(track->nHitsPoss(kTpcId),kTpcId);
00638 t->setNumberOfPossiblePoints(track->nHitsPoss(kFtpcEastId),kFtpcEastId);
00639 t->setNumberOfPossiblePoints(track->nHitsPoss(kFtpcWestId),kFtpcWestId);
00640 t->setNumberOfPossiblePoints(track->nHitsPoss(kSvtId),kSvtId);
00641 t->setNumberOfPossiblePoints(track->nHitsPoss(kSsdId),kSsdId);
00642
00643
00644 t->setTopologyMap( track->topologyMap() );
00645
00646
00647 t->addPidTraits(track->btofPidTraits().createBTofPidTraits());
00648
00649 return t;
00650 }
00651
00652 void StMuDst::Print(Option_t *option) const {
00653 StMuEvent *event = 0;
00654 if ((event = StMuDst::event())) {
00655 cout << "++++++++++++++ MuDst run " << event->runId() << " event " << event->eventId() << " ++++++++++++++" << endl;
00656 cout << endl << "primary vertex pos " << event->primaryVertexPosition() << endl;
00657 }
00658 else
00659 cout << "No event structure (StMuEvent) found!" << endl;
00660
00661
00662 cout << numberOfPrimaryVertices() << " vertices reconstructed" << endl;
00663 cout << numberOfPrimaryTracks() << " primary tracks, ";
00664 if (mCurrVertexId != 0)
00665 cout << "( note vtx_id " << mCurrVertexId << " ) " ;
00666 cout << numberOfGlobalTracks() << " global " << endl;
00667
00668 #ifndef __NO_STRANGE_MUDST__
00669 cout << numberOfV0s() << " V0s, " << numberOfXis() << " Xis "
00670 << numberOfKinks() << " kinks" << endl;
00671 #endif
00672 cout << endl;
00673 if (muEmcCollection())
00674 cout << "EMC data present" << endl;
00675 else
00676 cout << "No EMC data present" << endl;
00677 cout << endl;
00678 if (muFmsCollection())
00679 cout << "FMS data present" << endl;
00680 else
00681 cout << "No FMS data present" << endl;
00682 if (pmdCollection())
00683 cout << "PMD data present" << endl;
00684 else
00685 cout << "No PMD data present" << endl;
00686
00687 if (numberOfTofHit())
00688 cout << "TOF data present" << endl;
00689 else
00690 cout << "No TOF data present" << endl;
00691 cout << endl;
00692 }
00693
00694 void StMuDst::printVertices() {
00695 if (numberOfPrimaryVertices() == 0) {
00696 cout << "No vertices stored (for older data, check StMuEvent)" << endl;
00697 return;
00698 }
00699 cout << endl;
00700 cout << "+++++++++ vertex list ( " << numberOfPrimaryVertices() << " entries )" << endl << endl;
00701 for (UInt_t i_vtx = 0; i_vtx < numberOfPrimaryVertices(); i_vtx++) {
00702 cout << "+++ Vertex " << i_vtx << endl;
00703 primaryVertex(i_vtx)->Print();
00704 cout << endl;
00705 }
00706 }
00707
00708 void StMuDst::printPrimaryTracks() {
00709 if (numberOfPrimaryTracks() == 0) {
00710 cout << "No primary tracks found!" << endl;
00711 return;
00712 }
00713 cout << endl;
00714 cout << "+++++++++ PRIMARY track list ( " << numberOfPrimaryTracks() << " entries )" << endl << endl;
00715 for (UInt_t i_trk = 0; i_trk < numberOfPrimaryTracks(); i_trk++) {
00716 cout << "+++ Primary track " << i_trk << endl;
00717 primaryTracks(i_trk)->Print();
00718 cout << endl;
00719 }
00720 }
00721
00722 void StMuDst::printGlobalTracks() {
00723 if (numberOfGlobalTracks() == 0) {
00724 cout << "No global tracks found!" << endl;
00725 return;
00726 }
00727 cout << endl;
00728 cout << "+++++++++ GLOBAL track list ( " << numberOfGlobalTracks() << " entries )" << endl << endl;
00729 for (UInt_t i_trk = 0; i_trk < numberOfGlobalTracks(); i_trk++) {
00730 cout << "+++ Global track " << i_trk << endl;
00731 globalTracks(i_trk)->Print();
00732 cout << endl;
00733 }
00734 }
00735
00736 ClassImp(StMuDst)
00737
00738
00739
00740
00741
00742
00743
00744
00745
00746
00747
00748
00749
00750
00751
00752
00753
00754
00755
00756
00757
00758
00759
00760
00761
00762
00763
00764
00765
00766
00767
00768
00769
00770
00771
00772
00773
00774
00775
00776
00777
00778
00779
00780
00781
00782
00783
00784
00785
00786
00787
00788
00789
00790
00791
00792
00793
00794
00795
00796
00797
00798
00799
00800
00801
00802
00803
00804
00805
00806
00807
00808
00809
00810
00811
00812
00813
00814
00815
00816
00817
00818
00819
00820
00821
00822
00823
00824
00825
00826
00827
00828
00829
00830
00831
00832
00833
00834
00835
00836
00837
00838
00839
00840
00841
00842
00843
00844
00845
00846
00847
00848
00849
00850
00851
00852
00853
00854
00855
00856
00857
00858
00859
00860
00861
00862
00863
00864
00865
00866
00867
00868
00869
00870
00871
00872
00873
00874
00875
00876
00877
00878
00879
00880
00881
00882
00883
00884
00885
00886
00887
00888
00889
00890
00891
00892
00893
00894
00895
00896
00897
00898
00899
00900
00901
00902
00903
00904
00905
00906
00907
00908
00909
00910
00911
00912
00913
00914
00915
00916
00917
00918
00919
00920
00921
00922
00923
00924
00925
00926
00927
00928
00929
00930
00931
00932
00933
00934
00935
00936
00937
00938
00939
00940
00941
00942
00943
00944
00945