20 #include "StEventTypes.h"
22 #include "StThreeVectorF.hh"
23 #include "StMeasuredPoint.h"
24 #include "StDedxPidTraits.h"
25 #include "StBTofPidTraits.h"
26 #include "StTrackPidTraits.h"
27 #include "StBTofPidTraits.h"
28 #include "StBTofCollection.h"
29 #include "StBTofHit.h"
30 #include "StBTofHeader.h"
31 #include "StarClassLibrary/StParticleTypes.hh"
32 #include "StarClassLibrary/StParticleDefinition.hh"
33 #include "StMuDSTMaker/COMMON/StMuUtilities.h"
34 #include "StMuDSTMaker/COMMON/StMuPrimaryVertex.h"
35 #include "StMuDSTMaker/COMMON/StMuDst.h"
36 #include "StMuDSTMaker/COMMON/StMuEvent.h"
37 #include "StMuDSTMaker/COMMON/StMuDstMaker.h"
38 #include "StMuDSTMaker/COMMON/StMuTrack.h"
40 #include "StTrackGeometry.h"
41 #include "StDcaGeometry.h"
42 #include "StParticleTypes.hh"
43 #include "StTpcDedxPidAlgorithm.h"
45 #include "StAssociationMaker/StTrackPairInfo.hh"
46 #include "StEventUtilities/StuRefMult.hh"
47 #include "PhysicalConstants.h"
48 #include "StPhysicalHelixD.hh"
53 #include "StMemoryInfo.hh"
54 #include "StMessMgr.h"
56 #include "tables/St_g2t_vertex_Table.h"
57 #include "tables/St_vertexSeed_Table.h"
59 #include "StBTofUtil/tofPathLength.hh"
60 #include "StBTofUtil/StBTofGeometry.h"
61 #include "StBTofUtil/StBTofDaqMap.h"
62 #include "StBTofUtil/StBTofHitCollection.h"
63 #include "StMuDSTMaker/COMMON/StMuDstMaker.h"
64 #include "StMuDSTMaker/COMMON/StMuDst.h"
65 #include "StMuDSTMaker/COMMON/StMuBTofHit.h"
66 #include "StMuDSTMaker/COMMON/StMuTrack.h"
67 #include "StMuDSTMaker/COMMON/StMuPrimaryVertex.h"
68 #include "StMuDSTMaker/COMMON/StMuBTofPidTraits.h"
69 #include "StMuDSTMaker/COMMON/StMuTriggerIdCollection.h"
72 #include "StBTofNtupleMaker.h"
80 mTupleFileName=outname;
82 doPrintMemoryInfo = kFALSE;
83 doPrintCpuInfo = kFALSE;
96 if(!mUseEventVertex) {
102 if (mTupleFileName!=
"") bookNtuples();
113 Int_t StBTofNtupleMaker::InitRun(
int runnumber) {
115 if(mUseEventVertex)
return kStOK;
124 TDataSet* dbDataSet = this->GetDataBase(
"Calibrations/rhic");
127 vertexSeed_st* vSeed = ((St_vertexSeed*) (dbDataSet->FindObject(
"vertexSeed")))->GetTable();
135 LOG_INFO <<
"StTofrNtupleMaker -- No Database for beamline" << endm;
138 LOG_INFO <<
"BeamLine Constraint (StTofrNtupleMaker): " << endm;
139 LOG_INFO <<
"x(z) = " << x0 <<
" + " << dxdz <<
" * z" << endm;
140 LOG_INFO <<
"y(z) = " << y0 <<
" + " << dydz <<
" * z" << endm;
146 double pt = 88889999;
147 double nxy=::sqrt(dxdz*dxdz + dydz*dydz);
149 LOG_WARN <<
"StTofrNtupleMaker:: Beam line must be tilted!" << endm;
163 Int_t StBTofNtupleMaker::FinishRun(
int runnumber)
165 if(mBeamHelix)
delete mBeamHelix;
174 if (!(mTupleFileName==
"")){
177 LOG_INFO <<
"StBTofNtupleMaker::Finish() ntuple file "
178 << mTupleFileName <<
" closed." << endm;
185 LOG_INFO <<
"StBTofNtupleMaker -- statistics" << endm;
186 LOG_INFO <<
" accepted events : " << mAcceptedEvents << endm;
187 LOG_INFO <<
" pVPD entries : " << mPvpdEntries << endm;
188 LOG_INFO <<
" BTof entries/events : " << mBTofEntries <<
"/" << mBTofEvents << endm;
196 LOG_INFO <<
"StBTofNtupleMaker -- welcome" << endm;
198 if(!mMuDstIn) processStEvent();
205 void StBTofNtupleMaker::processStEvent() {
210 if (!mEvent||!mEvent->btofCollection()) {
211 LOG_INFO <<
"StBTofNtupleMaker -- nothing to do ... bye-bye"<< endm;
217 if (doPrintCpuInfo) timer.start();
218 if (doPrintMemoryInfo) StMemoryInfo::instance()->snapshot();
225 if(Debug()) { LOG_INFO<<
"runId: "<<mEvent->runId()<<
" evtId: "<<mEvent->id()<<endm; }
229 if(mEvent->primaryVertex()) {
230 pVtx = mEvent->primaryVertex()->position();
234 mCellData.vertexX = pVtx.x();
235 mCellData.vertexY = pVtx.y();
236 mCellData.vertexZ = pVtx.z();
240 mCellData.run = mEvent->runId();
241 mCellData.evt = mEvent->id();
250 if(Debug()&&theTof) { LOG_INFO <<
"got btof Collection"<<endm; }
254 LOG_WARN <<
" No TOF header ... bye-bye" << endm;
257 if(Debug()&&tofHeader) { LOG_INFO <<
"got tof Header"<<endm; }
258 mCellData.tStart = tofHeader->tStart();
259 mCellData.tDiff = tofHeader->tDiff();
260 mCellData.vpdVz = tofHeader->vpdVz();
263 for(
int i=0;i<19;i++){
264 mCellData.vpdLeEast[i] = 0;
265 mCellData.vpdTotEast[i] = 0;
266 mCellData.vpdLeWest[i] = 0;
267 mCellData.vpdTotWest[i] = 0;
270 unsigned int vpdEast=0, vpdWest=0, nVpdEast=0, nVpdWest=0;
272 if (theTof && theTof->hitsPresent()){
274 StSPtrVecBTofHit& hits = theTof->tofHits();
275 if(Debug()) { LOG_INFO << hits.size() <<
" hits"<<endm; }
276 for(
size_t i=0;i<hits.size();i++) {
278 int trayId = aHit->tray();
280 if(Debug()) { LOG_INFO <<
"tray Id = "<<trayId<<endm; }
282 int tubeId = aHit->cell()-1;
283 mCellData.vpdLeEast[tubeId] = aHit->leadingEdgeTime();
284 mCellData.vpdTotEast[tubeId] = aHit->tot();
285 vpdEast += 1<<tubeId;
288 }
else if(trayId==121) {
289 int tubeId = aHit->cell()-1;
290 mCellData.vpdLeWest[tubeId] = aHit->leadingEdgeTime();
291 mCellData.vpdTotWest[tubeId] = aHit->tot();
292 vpdWest += 1<<tubeId;
295 else if(trayId<=120&&trayId>=0) {
296 mCellData.tray[ntofhits] = aHit->tray();
297 mCellData.module[ntofhits] = aHit->module();
298 mCellData.cell[ntofhits] = aHit->cell();
299 mCellData.leTime[ntofhits] = aHit->leadingEdgeTime();
300 mCellData.tot[ntofhits] = aHit->tot();
302 if(Debug()) { LOG_INFO <<
"tray/module/cell/letime/tot="<<aHit->tray()<<
"/"<<aHit->module()<<
"/"<<aHit->cell()<<
"/"<<aHit->leadingEdgeTime()<<
"/"<<aHit->tot()<<endm; }
304 StTrack *thisTrack = aHit->associatedTrack();
305 if(!thisTrack)
continue;
306 if(Debug()&&thisTrack) { LOG_INFO <<
" got associated track"<<endm; }
308 if(Debug()) { LOG_INFO <<
"got global track"<<endm; }
311 if(mUseEventVertex) {
313 if(!pTrack)
continue;
314 if(pTrack->vertex()!=mEvent->primaryVertex())
continue;
315 theDcaGeometry = pTrack->geometry();
317 theDcaGeometry = globalTrack->geometry();
320 if(Debug()) { LOG_INFO <<
"got DcaGeometry"<<endm; }
323 mCellData.trackId[ntofhits] = (Int_t) thisTrack->key();
324 mCellData.charge[ntofhits] = theDcaGeometry->charge();
325 mCellData.pt[ntofhits] = momentum.perp();
326 mCellData.eta[ntofhits] = momentum.pseudoRapidity();
327 mCellData.phi[ntofhits] = momentum.phi();
331 StSPtrVecTrackPidTraits& traits = thisTrack->pidTraits();
332 for (
unsigned int it=0;it<traits.size();it++){
333 if (traits[it]->detector() == kTpcId){
335 if (pid && pid->method() ==kTruncatedMeanId){
336 mCellData.dedx[ntofhits] = pid->mean()*1e6;
337 mCellData.nHitsDedx[ntofhits] = pid->numberOfPoints();
339 }
else if (traits[it]->detector() == kTofId) {
342 mCellData.matchFlag[ntofhits] = tofpid->
matchFlag();
343 mCellData.yLocal[ntofhits] = tofpid->yLocal();
344 mCellData.zLocal[ntofhits] = tofpid->zLocal();
345 mCellData.thetaLocal[ntofhits] = tofpid->thetaLocal();
346 globalPos = tofpid->position();
347 mCellData.xGlobal[ntofhits] = globalPos.x();
348 mCellData.yGlobal[ntofhits] = globalPos.y();
349 mCellData.zGlobal[ntofhits] = globalPos.z();
351 mCellData.tofCorr[ntofhits] = tofpid->timeOfFlight();
352 mCellData.length[ntofhits] = tofpid->pathLength();
353 mCellData.beta[ntofhits] = tofpid->beta();
358 if(thisTrack->detectorInfo()) {
359 mCellData.nHits[ntofhits] = thisTrack->detectorInfo()->numberOfPoints(kTpcId);
361 mCellData.nHits[ntofhits] = 0;
363 mCellData.nHitsFit[ntofhits] = thisTrack->fitTraits().numberOfFitPoints(kTpcId);
368 static StElectron* Electron = StElectron::instance();
369 static StPionPlus* Pion = StPionPlus::instance();
370 static StKaonPlus* Kaon = StKaonPlus::instance();
371 static StProton* Proton = StProton::instance();
375 mCellData.nSigE[ntofhits] = fabsMin(PidAlgorithm.numberOfSigma(Electron), __SIGMA_SCALE__);
376 mCellData.nSigPi[ntofhits] = fabsMin(PidAlgorithm.numberOfSigma(Pion),__SIGMA_SCALE__);
377 mCellData.nSigK[ntofhits] = fabsMin(PidAlgorithm.numberOfSigma(Kaon),__SIGMA_SCALE__);
378 mCellData.nSigP[ntofhits] = fabsMin(PidAlgorithm.numberOfSigma(Proton),__SIGMA_SCALE__);
382 if(mUseEventVertex) {
383 double s = globalTrack->geometry()->helix().
pathLength(pVtx,
false);
384 StThreeVectorD dca3D = globalTrack->geometry()->helix().at(s) - pVtx;
385 mCellData.dcaX[ntofhits] = dca3D.x();
386 mCellData.dcaY[ntofhits] = dca3D.y();
387 mCellData.dcaZ[ntofhits] = dca3D.z();
389 mCellData.length[ntofhits] = tofPathLength(&pVtx, &globalPos, theDcaGeometry->helix().curvature());
394 mCellData.dcaX[ntofhits] = dcatof.x();
395 mCellData.dcaY[ntofhits] = dcatof.y();
396 mCellData.dcaZ[ntofhits] = tofPos.z();
398 LOG_INFO<<
" tofPos(x,y,z) = "<<tofPos.x()<<
","<<tofPos.y()<<
","<<tofPos.z()<<endm;
399 LOG_INFO<<
" beamPos(x,y,z) = "<<beamPos.x()<<
","<<beamPos.y()<<
","<<beamPos.z()<<endm;
400 LOG_INFO<<
" dca (x,y,z) = "<<dcatof.x()<<
","<<dcatof.y()<<
","<<dcatof.z()<<endm;
401 LOG_INFO<<
" 2D dca = "<<sqrt(pow(dcatof.x(),2)+pow(dcatof.y(),2))<<endm;
402 LOG_INFO<<
" 2D signed dca = "<<theDcaGeometry->helix().geometricSignedDistance(beamPos.x(),beamPos.y())<<endm;
405 mCellData.length[ntofhits] = tofPathLength(&tofPos, &globalPos, theDcaGeometry->helix().curvature());
408 if(Debug()) { LOG_INFO <<
"pathLength="<< mCellData.length[ntofhits] <<endm; }
414 mCellData.nTofHits = ntofhits;
415 mCellData.vpdEast = vpdEast;
416 mCellData.vpdWest = vpdWest;
417 mCellData.numberOfVpdEast = nVpdEast;
418 mCellData.numberOfVpdWest = nVpdWest;
420 if(Debug()) { LOG_INFO <<
" Three are " << ntofhits <<
" tof hits in this event! " << endm; }
421 mBTofEntries = ntofhits;
425 if (doPrintMemoryInfo) {
426 StMemoryInfo::instance()->snapshot();
427 StMemoryInfo::instance()->print();
429 if (doPrintCpuInfo) {
431 LOG_INFO <<
"CPU time for StEventMaker::Make(): "
432 << timer.elapsedTime() <<
" sec\n" << endm;
437 void StBTofNtupleMaker::processMuDst() {
441 LOG_WARN <<
" No MuDstMaker ... bye-bye" << endm;
444 mMuDst = mudstMaker->
muDst();
446 LOG_WARN <<
" No MuDst ... bye-bye" << endm;
452 if (doPrintCpuInfo) timer.start();
453 if (doPrintMemoryInfo) StMemoryInfo::instance()->snapshot();
459 Bool_t istrigger = 0;
463 if(Debug()) { LOG_INFO<<
"runId: "<<mMuEvent->runId()<<
" evtId: "<<mMuEvent->eventId()<<endm; }
464 mCellData.run = mMuEvent->runId();
465 mCellData.evt = mMuEvent->eventId();
466 istrigger = ((mMuEvent->triggerIdCollection().nominal().isTrigger(7))||(mMuEvent->triggerIdCollection().nominal().isTrigger(250107)));
477 mCellData.vertexX = pVtx.x();
478 mCellData.vertexY = pVtx.y();
479 mCellData.vertexZ = pVtx.z();
484 LOG_WARN <<
" No TOF Header ... bye-bye" << endm;
487 if(Debug()&&tofHeader) { LOG_INFO <<
"got tof Header"<<endm; }
488 mCellData.tStart = tofHeader->tStart();
489 mCellData.tDiff = tofHeader->tDiff();
490 mCellData.vpdVz = tofHeader->vpdVz();
493 for(
int i=0;i<19;i++){
494 mCellData.vpdLeEast[i] = 0;
495 mCellData.vpdTotEast[i] = 0;
496 mCellData.vpdLeWest[i] = 0;
497 mCellData.vpdTotWest[i] = 0;
500 unsigned int vpdEast=0, vpdWest=0, nVpdEast=0, nVpdWest=0;
501 int nMax = mMuDst->numberOfBTofHit();
503 if(Debug()) { LOG_INFO << nMax <<
" hits"<<endm; }
504 for(
int i=0;i<nMax;i++) {
506 int trayId = aHit->tray();
508 if(Debug()) { LOG_INFO <<
"tray Id = "<<trayId<<endm; }
510 int tubeId = aHit->cell()-1;
511 mCellData.vpdLeEast[tubeId] = aHit->leadingEdgeTime();
512 mCellData.vpdTotEast[tubeId] = aHit->tot();
513 vpdEast += 1<<tubeId;
516 }
else if(trayId==121) {
517 int tubeId = aHit->cell()-1;
518 mCellData.vpdLeWest[tubeId] = aHit->leadingEdgeTime();
519 mCellData.vpdTotWest[tubeId] = aHit->tot();
520 vpdWest += 1<<tubeId;
523 else if(trayId<=120&&trayId>=0) {
524 StMuTrack *globalTrack = aHit->globalTrack();
525 if(!globalTrack)
continue;
526 if(Debug()) { LOG_INFO <<
"got global track"<<endm; }
528 mCellData.tray[ntofhits] = aHit->tray();
529 mCellData.module[ntofhits] = aHit->module();
530 mCellData.cell[ntofhits] = aHit->cell();
531 mCellData.leTime[ntofhits] = aHit->leadingEdgeTime();
532 mCellData.tot[ntofhits] = aHit->tot();
534 if(Debug()) { LOG_INFO <<
"tray/module/cell/letime/tot="<<aHit->tray()<<
"/"<<aHit->module()<<
"/"<<aHit->cell()<<
"/"<<aHit->leadingEdgeTime()<<
"/"<<aHit->tot()<<endm; }
538 if(mUseEventVertex) {
539 pTrack = aHit->primaryTrack();
540 if(!pTrack)
continue;
547 mCellData.trackId[ntofhits] = (Int_t) globalTrack->
id();
548 mCellData.charge[ntofhits] = globalTrack->
charge();
549 mCellData.pt[ntofhits] = momentum.perp();
550 mCellData.eta[ntofhits] = momentum.pseudoRapidity();
551 mCellData.phi[ntofhits] = momentum.phi();
553 mCellData.dedx[ntofhits] = globalTrack->
dEdx()*1e6;
554 mCellData.nHitsDedx[ntofhits] = globalTrack->
nHitsDedx();
558 mCellData.matchFlag[ntofhits] = tofpid.
matchFlag();
559 mCellData.yLocal[ntofhits] = tofpid.yLocal();
560 mCellData.zLocal[ntofhits] = tofpid.zLocal();
561 mCellData.thetaLocal[ntofhits] = tofpid.thetaLocal();
562 globalPos = tofpid.position();
563 mCellData.xGlobal[ntofhits] = globalPos.x();
564 mCellData.yGlobal[ntofhits] = globalPos.y();
565 mCellData.zGlobal[ntofhits] = globalPos.z();
568 mCellData.length[ntofhits] = tofpid.pathLength();
569 mCellData.beta[ntofhits] = tofpid.beta();
571 mCellData.nHits[ntofhits] = globalTrack->
nHits();
572 mCellData.nHitsFit[ntofhits] = globalTrack->
nHitsFit(kTpcId);
575 mCellData.nSigPi[ntofhits] = globalTrack->
nSigmaPion();
576 mCellData.nSigK[ntofhits] = globalTrack->
nSigmaKaon();
577 mCellData.nSigP[ntofhits] = globalTrack->
nSigmaProton();
580 if(mUseEventVertex) {
581 mCellData.dcaX[ntofhits] = pTrack->
dcaGlobal().x();
582 mCellData.dcaY[ntofhits] = pTrack->
dcaGlobal().y();
583 mCellData.dcaZ[ntofhits] = pTrack->
dcaGlobal().z();
585 mCellData.length[ntofhits] = tofPathLength(&pVtx, &globalPos, pTrack->
helix().curvature());
591 mCellData.dcaX[ntofhits] = dcatof.x();
592 mCellData.dcaY[ntofhits] = dcatof.y();
593 mCellData.dcaZ[ntofhits] = tofPos.z();
595 LOG_INFO<<
" tofPos(x,y,z) = "<<tofPos.x()<<
","<<tofPos.y()<<
","<<tofPos.z()<<endm;
596 LOG_INFO<<
"beamPos(x,y,z) = "<<beamPos.x()<<
","<<beamPos.y()<<
","<<beamPos.z()<<endm;
597 LOG_INFO<<
" dca (x,y,z) = "<<dcatof.x()<<
","<<dcatof.y()<<
","<<dcatof.z()<<endm;
598 LOG_INFO<<
" 2D dca = "<<sqrt(pow(dcatof.x(),2)+pow(dcatof.y(),2))<<endm;
599 LOG_INFO<<
" 2D signed dca = "<<helix.geometricSignedDistance(beamPos.x(),beamPos.y())<<endm;
602 mCellData.length[ntofhits] = tofPathLength(&tofPos, &globalPos, helix.curvature());
605 if(Debug()) LOG_INFO <<
"pathLength="<< mCellData.length[ntofhits] <<endm;
610 mCellData.nTofHits = ntofhits;
611 mCellData.vpdEast = vpdEast;
612 mCellData.vpdWest = vpdWest;
613 mCellData.numberOfVpdEast = nVpdEast;
614 mCellData.numberOfVpdWest = nVpdWest;
616 if(Debug()) { LOG_INFO <<
" Three are " << ntofhits <<
" tof hits in this event! " << endm; }
617 mBTofEntries = ntofhits;
621 if (doPrintMemoryInfo) {
622 StMemoryInfo::instance()->snapshot();
623 StMemoryInfo::instance()->print();
625 if (doPrintCpuInfo) {
627 LOG_INFO <<
"CPU time for StEventMaker::Make(): "
628 << timer.elapsedTime() <<
" sec\n" << endm;
634 void StBTofNtupleMaker::bookNtuples(){
635 mTupleFile =
new TFile(mTupleFileName.c_str(),
"RECREATE");
636 LOG_INFO <<
"StBTofNtupleMaker::bookNtuples() file "
637 << mTupleFileName <<
" opened" << endm;
640 mCellTuple =
new TTree(
"tof",
"BTof cell data");
641 mCellTuple->SetAutoSave(1000);
642 mCellTuple->Branch(
"run",&mCellData.run,
"run/I");
643 mCellTuple->Branch(
"evt",&mCellData.evt,
"evt/I");
645 mCellTuple->Branch(
"vertexX",&mCellData.vertexX,
"vertexX/F");
646 mCellTuple->Branch(
"vertexY",&mCellData.vertexY,
"vertexY/F");
647 mCellTuple->Branch(
"vertexZ",&mCellData.vertexZ,
"vertexZ/F");
648 mCellTuple->Branch(
"vpdEast",&mCellData.vpdEast,
"vpdEast/I");
649 mCellTuple->Branch(
"vpdWest",&mCellData.vpdWest,
"vpdWest/I");
650 mCellTuple->Branch(
"numberOfVpdEast",&mCellData.numberOfVpdEast,
"numberOfVpdEast/I");
651 mCellTuple->Branch(
"numberOfVpdWest",&mCellData.numberOfVpdWest,
"numberOfVpdWest/I");
652 mCellTuple->Branch(
"tDiff",&mCellData.tDiff,
"tDiff/F");
653 mCellTuple->Branch(
"tStart",&mCellData.tStart,
"tStart/D");
654 mCellTuple->Branch(
"vpdVz",&mCellData.vpdVz,
"vpdVz/F");
656 mCellTuple->Branch(
"vpdLeEast",&mCellData.vpdLeEast,
"vpdLeEast[19]/D");
657 mCellTuple->Branch(
"vpdLeWest",&mCellData.vpdLeWest,
"vpdLeWest[19]/D");
658 mCellTuple->Branch(
"vpdTotEast",&mCellData.vpdTotEast,
"vpdTotEast[19]/D");
659 mCellTuple->Branch(
"vpdTotWest",&mCellData.vpdTotWest,
"vpdTotWest[19]/D");
660 mCellTuple->Branch(
"nTofHits",&mCellData.nTofHits,
"nTofHits/I");
661 mCellTuple->Branch(
"tray",&mCellData.tray,
"tray[nTofHits]/I");
662 mCellTuple->Branch(
"module",&mCellData.module,
"module[nTofHits]/I");
663 mCellTuple->Branch(
"cell",&mCellData.cell,
"cell[nTofHits]/I");
664 mCellTuple->Branch(
"leTime",&mCellData.leTime,
"leTime[nTofHits]/D");
665 mCellTuple->Branch(
"tot",&mCellData.tot,
"tot[nTofHits]/D");
666 mCellTuple->Branch(
"matchFlag",&mCellData.matchFlag,
"matchFlag/I");
667 mCellTuple->Branch(
"yLocal",&mCellData.yLocal,
"yLocal[nTofHits]/F");
668 mCellTuple->Branch(
"zLocal",&mCellData.zLocal,
"zLocal[nTofHits]/F");
669 mCellTuple->Branch(
"thetaLocal",&mCellData.thetaLocal,
"thetaLocal[nTofHits]/F");
670 mCellTuple->Branch(
"xGlobal",&mCellData.xGlobal,
"xGlobal[nTofHits]/F");
671 mCellTuple->Branch(
"yGlobal",&mCellData.yGlobal,
"yGlobal[nTofHits]/F");
672 mCellTuple->Branch(
"zGlobal",&mCellData.zGlobal,
"zGlobal[nTofHits]/F");
673 mCellTuple->Branch(
"trackId",&mCellData.trackId,
"trackId[nTofHits]/I");
674 mCellTuple->Branch(
"charge",&mCellData.charge,
"charge[nTofHits]/I");
675 mCellTuple->Branch(
"pt",&mCellData.pt,
"pt[nTofHits]/F");
676 mCellTuple->Branch(
"eta",&mCellData.eta,
"eta[nTofHits]/F");
677 mCellTuple->Branch(
"phi",&mCellData.phi,
"phi[nTofHits]/F");
678 mCellTuple->Branch(
"dcaX",&mCellData.dcaX,
"dcaX[nTofHits]/F");
679 mCellTuple->Branch(
"dcaY",&mCellData.dcaY,
"dcaY[nTofHits]/F");
680 mCellTuple->Branch(
"dcaZ",&mCellData.dcaZ,
"dcaZ[nTofHits]/F");
681 mCellTuple->Branch(
"length",&mCellData.length,
"length[nTofHits]/F");
682 mCellTuple->Branch(
"nHits",&mCellData.nHits,
"nHits[nTofHits]/I");
683 mCellTuple->Branch(
"nHitsFit",&mCellData.nHitsFit,
"nHitsFit[nTofHits]/I");
684 mCellTuple->Branch(
"nHitsDedx",&mCellData.nHitsDedx,
"nHitsDedx[nTofHits]/I");
685 mCellTuple->Branch(
"dedx",&mCellData.dedx,
"dedx[nTofHits]/F");
686 mCellTuple->Branch(
"nSigE",&mCellData.nSigE,
"nSigE[nTofHits]/F");
687 mCellTuple->Branch(
"nSigPi",&mCellData.nSigPi,
"nSigPi[nTofHits]/F");
688 mCellTuple->Branch(
"nSigK",&mCellData.nSigK,
"nSigK[nTofHits]/F");
689 mCellTuple->Branch(
"nSigP",&mCellData.nSigP,
"nSigP[nTofHits]/F");
690 mCellTuple->Branch(
"tofCorr",&mCellData.tofCorr,
"tofCorr[nTofHits]/F");
691 mCellTuple->Branch(
"beta",&mCellData.beta,
"beta[nTofHits]/F");
static StMuPrimaryVertex * primaryVertex()
return pointer to current primary vertex
static StMuBTofHit * btofHit(int i)
returns pointer to the i-th muBTofHit
Int_t vertexIndex() const
Returns index of associated primary vertex.
pair< double, double > pathLengths(const StHelix &, double minStepSize=10 *micrometer, double minRange=10 *centimeter) const
path lengths at dca between two helices
short id() const
Returns the track id(or key), is unique for a track node, i.e. global and primary tracks have the sam...
UShort_t nHitsDedx() const
Return number of hits used for dEdx.
unsigned char matchFlag() const
Matching information.
~StBTofNtupleMaker()
default empty destructor
pair< double, double > pathLength(double r) const
path length at given r (cylindrical r)
StPhysicalHelixD helix() const
Returns inner helix (first measured point)
UShort_t nHitsFit() const
Return total number of hits used in fit.
Short_t charge() const
Returns charge.
unsigned char matchFlag() const
Matching information.
Double_t nSigmaPion() const
Returns Craig's distance to the calculated dE/dx band for pions in units of sigma.
Double_t nSigmaElectron() const
Returns Craig's distance to the calculated dE/dx band for electrons in units of sigma.
static StMuEvent * event()
returns pointer to current StMuEvent (class holding the event wise information, e.g. event number, run number)
const StThreeVectorF & momentum() const
Returns 3-momentum at dca to primary vertex.
Int_t Init()
initialize ntuple and daqmap, and reset counters
UShort_t nHits() const
Bingchu.
float timeOfFlight() const
timing for PID
Double_t dEdx() const
Returns measured dE/dx value.
static StBTofHeader * btofHeader()
returns pointer to the btofHeader - dongx
Double_t nSigmaProton() const
Returns Craig's distance to the calculated dE/dx band for protons in units of sigma.
Int_t Make()
get tofr slat, pvpd rawdata and global data from StEvent and store in flat TTrees (ntuples) ...
StThreeVectorF dcaGlobal(Int_t vtx_id=-1) const
Returns 3D distance of closest approach to primary vertex of associated global track.
Double_t nSigmaKaon() const
Returns Craig's distance to the calculated dE/dx band for kaons in units of sigma.
StBTofNtupleMaker(const Char_t *name, const Char_t *outname)
constructor sets default parameters
Int_t Finish()
write and close the ntuple file