12 #include "StEvent/StEvent.h"
13 #include "StEvent/StTrack.h"
14 #include "StEvent/StTrackNode.h"
15 #include "StEvent/StRichSpectra.h"
16 #include "StEvent/StDetectorState.h"
17 #include "StEvent/StEventTypes.h"
18 #include "StEvent/StRunInfo.h"
19 #include "StEvent/StEventInfo.h"
20 #include "StEvent/StDcaGeometry.h"
21 #include "StEvent/StFgtCollection.h"
22 #include "StEvent/StFgtStrip.h"
23 #include "StEvent/StFgtHit.h"
25 #include "StFgtUtil/StFgtConsts.h"
26 #include "StEventUtilities/StuRefMult.hh"
27 #include "StEventUtilities/StuProbabilityPidAlgorithm.h"
29 #include "StarClassLibrary/StPhysicalHelixD.hh"
30 #include "StarClassLibrary/StTimer.hh"
31 #include "StarClassLibrary/StMatrixF.hh"
33 #include "StIOMaker/StIOMaker.h"
34 #include "StTreeMaker/StTreeMaker.h"
35 #ifndef __NO_STRANGE_MUDST__
37 #include "StStrangeMuDstMaker/StStrangeEvMuDst.hh"
38 #include "StStrangeMuDstMaker/StV0MuDst.hh"
39 #include "StStrangeMuDstMaker/StV0Mc.hh"
40 #include "StStrangeMuDstMaker/StXiMuDst.hh"
41 #include "StStrangeMuDstMaker/StXiMc.hh"
42 #include "StStrangeMuDstMaker/StKinkMuDst.hh"
43 #include "StStrangeMuDstMaker/StKinkMc.hh"
44 #include "StStrangeMuDstMaker/StStrangeCuts.hh"
47 #include "StMuException.hh"
48 #include "StMuEvent.h"
49 #include "StMuPrimaryVertex.h"
50 #include "StMuRpsCollection.h"
51 #include "StMuMtdCollection.h"
52 #include "StMuMtdRawHit.h"
53 #include "StMuMtdHit.h"
54 #include "StMuMtdHeader.h"
55 #include "StMuTrack.h"
56 #include "StMuDebug.h"
58 #include "StMuFilter.h"
59 #include "StMuL3Filter.h"
60 #include "StMuChainMaker.h"
61 #include "StMuEmcCollection.h"
62 #include "StMuEmcUtil.h"
63 #include "StMuFmsCollection.h"
64 #include "StMuFmsUtil.h"
65 #include "StMuFmsHit.h"
66 #include "StMuRHICfCollection.h"
67 #include "StMuRHICfUtil.h"
68 #include "StMuRHICfHit.h"
69 #include "StMuRHICfPoint.h"
70 #include "StMuFcsCollection.h"
71 #include "StMuFcsUtil.h"
72 #include "StMuFcsHit.h"
73 #include "StMuFttCollection.h"
74 #include "StMuFttUtil.h"
75 #include "StMuFttRawHit.h"
76 #include "StMuFstCollection.h"
77 #include "StMuFwdTrack.h"
78 #include "StMuFwdTrackUtil.h"
79 #include "StMuFwdTrackCollection.h"
80 #include "StMuFstUtil.h"
81 #include "StMuFstRawHit.h"
82 #include "StMuFstHit.h"
83 #include "StMuEpdHit.h"
84 #include "StMuEpdHitCollection.h"
85 #include "StEvent/StEpdCollection.h"
86 #include "StMuEpdUtil.h"
87 #include "StMuETofCollection.h"
88 #include "StMuETofHeader.h"
89 #include "StMuETofDigi.h"
90 #include "StMuETofHit.h"
91 #include "StMuFgtStrip.h"
92 #include "StMuFgtCluster.h"
93 #include "StMuFgtStripAssociation.h"
94 #include "StMuFgtAdc.h"
95 #include "StMuPmdCollection.h"
96 #include "StMuPmdUtil.h"
97 #include "StMuPmdHit.h"
98 #include "StMuPmdCluster.h"
99 #include "StMuTofHit.h"
100 #include "StMuTofHitCollection.h"
101 #include "StMuTofUtil.h"
103 #include "StEvent/StBTofCollection.h"
104 #include "StEvent/StBTofRawHit.h"
105 #include "StEvent/StBTofHeader.h"
106 #include "StEvent/StETofCollection.h"
108 #include "StMuBTofHit.h"
109 #include "StMuBTofHitCollection.h"
110 #include "StMuBTofUtil.h"
111 #include "StMuPrimaryTrackCovariance.h"
112 #include "StMuEzTree.h"
113 #include "EztEventHeader.h"
114 #include "EztEmcRawData.h"
115 #include "EztTrigBlob.h"
116 #include "EztFpdBlob.h"
118 #include "StMuDstMaker.h"
125 #include "TStreamerInfo.h"
126 #include "TClonesArray.h"
127 #include "TEventList.h"
130 #include "StMuMcVertex.h"
131 #include "StMuMcTrack.h"
132 #include "StG2TrackVertexMap.h"
138 #if !(ST_NO_NAMESPACES)
139 using namespace units;
155 mStEvent(0), mStMuDst(0),
156 #ifndef __NO_STRANGE_MUDST__
157 mStStrangeMuDstMaker(0),
159 mIOMaker(0), mTreeMaker(0),
160 mIoMode(1), mIoNameMode((int)ioTreeMaker), mEventList(0),
161 mTrackType(256), mReadTracks(1),
162 mReadV0s(1), mReadXis(1), mReadKinks(1), mFinish(0),
163 mTrackFilter(0), mL3TrackFilter(0),
165 mChain (0), mTTree(0),
166 mSplit(99), mCompression(9), mBufferSize(65536*4), mVtxList(100),
167 mProbabilityPidAlgorithm(0), mEmcCollectionArray(0), mEmcCollection(0),
168 mFmsCollection(0),mRHICfCollection(0),mFcsCollection(0),mFttCollection(0),mFstCollection(0),mFwdTrackCollection(0), mPmdCollectionArray(0), mPmdCollection(0)
177 if (mIoMode==ioRead) openRead();
193 if ( ! mStMuDst || ! mEmcUtil || ! mFmsUtil || ! mRHICfUtil || !mFcsUtil || ! mPmdUtil || ! mTofUtil || !
mBTofUtil || ! mEpdUtil || ! mEzTree )
194 throw StMuExceptionNullPointer(
"StMuDstMaker:: constructor. Something went horribly wrong, cannot allocate pointers",__PRETTYF__);
203 FORCEDDEBUGMESSAGE(
"ATTENTION: use standard MuFilter");
204 FORCEDDEBUGMESSAGE(
"ATTENTION: use standard l3 MuFilter");
218 mArrays = mAArrays + 0;
219 #ifndef __NO_STRANGE_MUDST__
220 mStrangeArrays = mArrays + __NARRAYS__;
221 mMCArrays = mStrangeArrays + __NSTRANGEARRAYS__;
223 mMCArrays = mArrays + __NARRAYS__;
225 mEmcArrays = mMCArrays + __NMCARRAYS__;
226 mPmdArrays = mEmcArrays + __NEMCARRAYS__;
227 mFmsArrays = mPmdArrays + __NPMDARRAYS__;
228 mRHICfArrays = mFmsArrays + __NFMSARRAYS__;
229 mFcsArrays = mRHICfArrays + __NRHICFARRAYS__;
230 mFttArrays = mFcsArrays + __NFCSARRAYS__;
231 mFstArrays = mFttArrays + __NFTTARRAYS__;
232 mFwdTrackArrays = mFstArrays + __NFSTARRAYS__;
233 mTofArrays = mFwdTrackArrays + __NFWDTRACKARRAYS__;
236 mEpdArrays = mETofArrays + __NETOFARRAYS__;
237 mMtdArrays = mEpdArrays + __NEPDARRAYS__;
238 mFgtArrays = mMtdArrays + __NMTDARRAYS__;
239 mEztArrays = mFgtArrays + __NFGTARRAYS__;
244 const int ezIndex=__NARRAYS__+
245 #ifndef __NO_STRANGE_MUDST__
261 __NMTDARRAYS__+__NFGTARRAYS__;
263 for (
int i=0; i<ezIndex; i++) {
264 mAArrays[i]->Clear(
"C");
268 for (
int i=ezIndex; i<__NALLARRAYS__; i++) {
269 mAArrays[i]->Delete();
276 memset(mAArrays,0,
sizeof(
void*)*__NALLARRAYS__);
277 memset(mStatusArrays,(
char)1,
sizeof(mStatusArrays) );
279 memset(&mStatusArrays[__NARRAYS__+
280 #ifndef __NO_STRANGE_MUDST__
297 __NFGTARRAYS__],(
char)0,__NEZTARRAYS__);
336 #ifndef __NO_STRANGE_MUDST__
337 static const char *specNames[]={
"MuEventAll",
"StrangeAll",
"MCAll",
"EmcAll",
"PmdAll",
"FMSAll",
"RHICfAll",
"FcsAll",
"FttAll",
"FstAll",
"TofAll",
"BTofAll",
"ETofAll",
"EpdAll",
"MTDAll",
"FgtAll",
"EztAll",0};
339 static const char *specNames[]={
"MuEventAll",
"MCAll",
"EmcAll",
"PmdAll",
"FMSAll",
"RHICfAll",
"FcsAll",
"FttAll",
"FstAll",
"TofAll",
"BTofAll",
"ETofAll",
"EpdAll",
"MTDAll",
"FgtAll",
"EztAll",0};
341 static const int specIndex[]={
343 #ifndef __NO_STRANGE_MUDST__
346 __NMCARRAYS__,__NEMCARRAYS__,__NPMDARRAYS__,__NFMSARRAYS__,__NRHICFARRAYS__,__NFCSARRAYS__,__NFTTARRAYS__,__NFSTARRAYS__,__NFWDTRACKARRAYS__,__NTOFARRAYS__,__NBTOFARRAYS__,__NETOFARRAYS__,__NEPDARRAYS__,__NMTDARRAYS__,__NFGTARRAYS__,__NEZTARRAYS__,-1};
351 int species_start = 0;
353 for (
int i=0;specNames[i];i++) {
354 species_start += specIndex[i];
355 num = specIndex[i+1];
356 int cm = strcmp(arrType,specNames[i]);
365 char *sta=mStatusArrays+species_start;
366 memset(sta,status,num);
367 LOG_INFO <<
"StMuDstMaker::SetStatus \"" << arrType <<
"\" to status=" << status <<
" array indices (" << species_start <<
" -> " << species_start + num <<
")" << endm;
369 setBranchAddresses(mChain);
373 if ( strncmp(arrType,
"Strange",7) != 0 && strncmp(arrType,
"St",2)==0) arrType+=2;
375 TRegexp re(arrType,1);
376 for (
int i=0;i<__NALLARRAYS__;i++) {
378 if (re.Index(StMuArrays::arrayNames[i],&len) < 0)
continue;
379 LOG_INFO <<
"StMuDstMaker::SetStatus " << status <<
" to " << StMuArrays::arrayNames[i] << endm;
380 mStatusArrays[i]=status;
383 setBranchAddresses(mChain);
388 StMuDstMaker::StMuDstMaker(
int mode,
int nameMode,
const char* dirName,
const char* fileName,
const char* filter,
int maxFiles,
const char* name) :
390 mStEvent(0), mStMuDst(0),
391 #ifndef __NO_STRANGE_MUDST__
392 mStStrangeMuDstMaker(0),
394 mIOMaker(0), mTreeMaker(0),
395 mIoMode(mode), mIoNameMode(nameMode),
396 mDirName(dirName), mFileName(fileName), mFilter(filter),
397 mMaxFiles(maxFiles), mEventList(0),
398 mTrackType(256), mReadTracks(1),
399 mReadV0s(1), mReadXis(1), mReadKinks(1), mFinish(0),
400 mTrackFilter(0), mL3TrackFilter(0), mCurrentFile(0),
401 mSplit(99), mCompression(9), mBufferSize(65536*4),
402 mProbabilityPidAlgorithm(0), mEmcCollectionArray(0), mEmcCollection(0),
403 mFmsCollection(0), mRHICfCollection(0), mFcsCollection(0), mFttCollection(0), mFstCollection(0), mFwdTrackCollection(0), mPmdCollectionArray(0), mPmdCollection(0)
409 if (mIoMode==ioRead) openRead();
469 if (mStMuDst && mStMuDst->TestBit(kCanDelete)) SafeDelete(mStMuDst);
470 SafeDelete(mTofUtil);
472 SafeDelete(mEpdUtil);
473 DEBUGMESSAGE3(
"after arrays");
474 saveDelete(mProbabilityPidAlgorithm);
475 saveDelete(mTrackFilter);
476 saveDelete(mL3TrackFilter);
477 DEBUGMESSAGE3(
"after filter");
478 if (mIoMode== ioWrite ) closeWrite();
479 if (mIoMode== ioRead ) closeRead();
480 DEBUGMESSAGE3(
"after close");
483 SafeDelete(mEmcCollectionArray);
484 SafeDelete(mPmdCollectionArray);
485 DEBUGMESSAGE3(
"out");
495 StMuEvent::Class()->IgnoreTObjectStreamer();
496 StMuL3EventSummary::Class()->IgnoreTObjectStreamer();
497 #ifndef __NO_STRANGE_MUDST__
498 StStrangeMuDst::Class()->IgnoreTObjectStreamer();
499 StStrangeAssoc::Class()->IgnoreTObjectStreamer();
500 StV0MuDst::Class()->IgnoreTObjectStreamer();
501 StXiMuDst::Class()->IgnoreTObjectStreamer();
502 StKinkMuDst::Class()->IgnoreTObjectStreamer();
503 StV0Mc::Class()->IgnoreTObjectStreamer();
504 StXiMc::Class()->IgnoreTObjectStreamer();
505 StKinkMc::Class()->IgnoreTObjectStreamer();
507 StMuMcVertex::Class()->IgnoreTObjectStreamer();
508 StMuMcTrack::Class()->IgnoreTObjectStreamer();
509 StMuTrack::Class()->IgnoreTObjectStreamer();
510 StMuPrimaryVertex::Class()->IgnoreTObjectStreamer();
512 StMuPrimaryTrackCovariance::Class()->IgnoreTObjectStreamer();
513 StMuHelix::Class()->IgnoreTObjectStreamer();
514 StMuEmcHit::Class()->IgnoreTObjectStreamer();
515 StMuEmcTowerData::Class()->IgnoreTObjectStreamer();
516 StMuPmdHit::Class()->IgnoreTObjectStreamer();
517 StMuPmdCluster::Class()->IgnoreTObjectStreamer();
518 EztEventHeader::Class()->IgnoreTObjectStreamer();
519 EztTrigBlob::Class()->IgnoreTObjectStreamer();
520 EztFpdBlob::Class()->IgnoreTObjectStreamer();
521 EztEmcRawData::Class()->IgnoreTObjectStreamer();
522 StMuFgtStrip::Class()->IgnoreTObjectStreamer();
523 StMuFgtCluster::Class()->IgnoreTObjectStreamer();
524 StMuFgtStripAssociation::Class()->IgnoreTObjectStreamer();
525 StMuFgtAdc::Class()->IgnoreTObjectStreamer();
532 for (
int i=0; i<__NALLARRAYS__; i++) {
533 DEBUGVALUE2(mAArrays[i]);
535 DEBUGVALUE2(mAArrays[i]);
544 TClonesArray* StMuDstMaker::clonesArray(TClonesArray*& p,
const char* type,
int size,
int& counter) {
548 p =
new TClonesArray(type, size);
565 mIOMaker = (
StIOMaker*)GetMaker(
"IOMaker");
566 mTreeMaker = (
StTreeMaker*)GetMaker(
"outputStream");
567 #ifndef __NO_STRANGE_MUDST__
570 TDataSet *muDstSet = AddObj(mStMuDst,
".const");
571 if (muDstSet ) muDstSet ->SetName(
"muDst");
583 const int fmsClusterIndex = __NARRAYS__ +
584 #ifndef __NO_STRANGE_MUDST__
588 __NMCARRAYS__ + __NEMCARRAYS__ + __NPMDARRAYS__ + 1;
589 mAArrays[fmsClusterIndex]->Clear(
"C");
593 if(mStMuDst->
event()) mStMuDst->
event()->fmsTriggerDetector().clearFlag();
595 DEBUGMESSAGE3(
"out");
609 int returnStarCode =
kStOK;
612 if (mIoMode == ioWrite) returnStarCode = MakeWrite();
613 else if (mIoMode == ioRead) returnStarCode = MakeRead();
614 DEBUGVALUE2(timer.elapsedTime());
615 return returnStarCode;
622 Int_t StMuDstMaker::MakeRead(
const StUKey &RunEvent)
629 Int_t StMuDstMaker::MakeRead()
631 int returnStarCode =
kStOK;
632 if (mIoMode == ioRead) {
636 catch(StMuExceptionEOF e) {
645 return returnStarCode;
651 Int_t StMuDstMaker::MakeWrite(){
652 int returnStarCode =
kStOK;
653 if (mIoMode == ioWrite) {
657 catch(StMuExceptionEOF e) {
666 return returnStarCode;
673 mStEvent = (
StEvent*) GetInputDS(
"StEvent");
675 DEBUGMESSAGE2(
"no StEvent");
676 throw StMuExceptionNullPointer(
"no StEvent",__PRETTYF__);
680 if (mProbabilityPidAlgorithm) SafeDelete(mProbabilityPidAlgorithm);
695 void StMuDstMaker::write(){
705 string ioMakerFileName;
706 string theFileName(
"/dev/null");
707 DEBUGVALUE2(mIoNameMode);
708 switch (mIoNameMode) {
710 DEBUGMESSAGE2(
"===> ioFix\n");
711 theFileName = buildFileName( mDirName+
"/", basename(mFileName),
".MuDst.root");
714 DEBUGMESSAGE2(
"===> ioIOMaker\n");
715 ioMakerFileName = string(mIOMaker->GetFile());
716 DEBUGVALUE2(ioMakerFileName);
717 theFileName = buildFileName( mDirName+
"/", basename(ioMakerFileName),
".MuDst.root");
721 ioMakerFileName = mTreeMaker->GetTree()->GetBaseName();
722 theFileName = buildFileName(dirname(ioMakerFileName),basename(ioMakerFileName),
".MuDst.root");
725 DEBUGMESSAGE(
"do not know where to get the filename from");
728 DEBUGVALUE2(theFileName.c_str());
730 if (theFileName != mCurrentFileName) {
733 mCurrentFileName = theFileName;
736 DEBUGMESSAGE2(
"now fill tree");
737 mTTree->Fill(); THack::IsTreeWritable(mTTree);
738 DEBUGMESSAGE2(
"tree filled");
748 for (
int i=0; i<10; i++) {
749 LOG_INFO <<
"why are you calling the Finish() again ???????" << endl;
750 LOG_INFO <<
"are you the stupid chain destructor ???????????" << endl;
754 if (mIoMode== ioWrite ) closeWrite();
755 if (mIoMode== ioRead ) closeRead();
758 DEBUGMESSAGE3(
"out");
763 if (mIoMode== ioWrite )
return mCurrentFileName.c_str();
764 if (mIoMode== ioRead && mChain && mChain->GetFile())
765 return mChain->GetFile()->GetName();
770 void StMuDstMaker::setBranchAddresses() {
771 setBranchAddresses(mChain);
774 void StMuDstMaker::setBranchAddresses(TChain* chain) {
777 chain->SetBranchStatus(
"*",0);
779 Int_t emc_oldformat=0;
780 Int_t pmd_oldformat=0;
782 for (
int i=0; i<__NALLARRAYS__; i++) {
783 if (mStatusArrays[i]==0)
continue;
784 const char *bname=StMuArrays::arrayNames[i];
785 TBranch *tb = chain->GetBranch(bname);
787 #ifndef __NO_STRANGE_MUDST__
788 if (i >= __NARRAYS__+__NSTRANGEARRAYS__+__NMCARRAYS__ &&
789 i < __NARRAYS__+__NSTRANGEARRAYS__+__NMCARRAYS__+__NEMCARRAYS__) {
794 if (i >= __NARRAYS__+__NSTRANGEARRAYS__+__NMCARRAYS__+__NEMCARRAYS__ &&
795 i < __NARRAYS__+__NSTRANGEARRAYS__+__NMCARRAYS__+__NEMCARRAYS__+__NPMDARRAYS__) {
800 if (i >= __NARRAYS__+__NMCARRAYS__ &&
801 i < __NARRAYS__+__NMCARRAYS__+__NEMCARRAYS__) {
806 if (i >= __NARRAYS__+__NMCARRAYS__+__NEMCARRAYS__ &&
807 i < __NARRAYS__+__NMCARRAYS__+__NEMCARRAYS__+__NPMDARRAYS__) {
812 Warning(
"setBranchAddresses",
"Branch name %s does not exist",bname);
815 ts = bname; ts +=
"*";
816 chain->SetBranchStatus (ts,1);
817 if (strstr(
"MuEvent",bname) && mChain->GetBranch(
"MuEvent.mQA.fX")) {
820 mChain->SetBranchStatus(
"MuEvent.mQA*",0);
821 mChain->SetBranchStatus(
"MuEvent.mQB*",0);
822 mChain->SetBranchStatus(
"MuEvent.mQNegEastA*",0);
823 mChain->SetBranchStatus(
"MuEvent.mQNegEastB*",0);
824 mChain->SetBranchStatus(
"MuEvent.mQPosEastA*",0);
825 mChain->SetBranchStatus(
"MuEvent.mQPosEastB*",0);
826 mChain->SetBranchStatus(
"MuEvent.mQNegWestA*",0);
827 mChain->SetBranchStatus(
"MuEvent.mQNegWestB*",0);
828 mChain->SetBranchStatus(
"MuEvent.mQPosWestA*",0);
829 mChain->SetBranchStatus(
"MuEvent.mQPosWestB*",0);
831 chain->SetBranchAddress(bname,mAArrays+i);
832 assert(tb->GetAddress() == (
char*)(mAArrays+i));
835 TBranch *branch=chain->GetBranch(
"EmcCollection");
837 Warning(
"setBranchAddresses",
"Using backward compatibility mode for EMC");
838 if (!mEmcCollectionArray) {
839 mEmcCollectionArray=
new TClonesArray(
"StMuEmcCollection",1);
841 chain->SetBranchStatus(
"EmcCollection*",1);
842 chain->SetBranchAddress(
"EmcCollection",&mEmcCollectionArray);
843 StMuEmcHit::Class()->IgnoreTObjectStreamer(0);
847 else if (!mEmcCollection) {
853 if (!mFmsCollection) {
855 connectFmsCollection();
859 if (!mRHICfCollection) {
861 connectRHICfCollection();
865 if (!mFcsCollection) {
867 connectFcsCollection();
871 if (!mFttCollection) {
873 connectFttCollection();
877 if (!mFstCollection) {
879 connectFstCollection();
883 if (!mFwdTrackCollection) {
885 connectFwdTrackCollection();
891 TBranch *branch=chain->GetBranch(
"PmdCollection");
893 Warning(
"setBranchAddresses",
"Using backward compatibility mode for PMD");
894 if (!mPmdCollectionArray) {
895 mPmdCollectionArray=
new TClonesArray(
"StMuPmdCollection",1);
897 chain->SetBranchStatus(
"PmdCollection*",1);
898 chain->SetBranchAddress(
"PmdCollection",&mPmdCollectionArray);
899 StMuPmdCluster::Class()->IgnoreTObjectStreamer(0);
903 else if (!mPmdCollection) {
905 connectPmdCollection();
908 mTTree = mChain->GetTree();
913 int StMuDstMaker::openRead() {
914 DEBUGVALUE2(mDirName.c_str());
915 DEBUGVALUE2(mFileName.c_str());
916 DEBUGVALUE2(mFilter.c_str());
919 mChain = chainMaker.make(mDirName, mFileName, mFilter, mMaxFiles);
923 setBranchAddresses(mChain);
933 void StMuDstMaker::read(){
935 DEBUGMESSAGE2(
"ATTENTION: No StMuChain ... results won't be exciting (nothing to do)");
936 throw StMuExceptionNullPointer(
"No input files",__PRETTYF__);
941 if (mChain->GetCurrentFile()) {
942 DEBUGVALUE2(mChain->GetCurrentFile()->GetName());
946 int bytes = mChain->GetEntry(mEventCounter++);
948 DEBUGVALUE3(mEventCounter);
949 if ( mEventCounter >= mChain->GetEntriesFast() )
throw StMuExceptionEOF(
"end of input",__PRETTYF__);
950 bytes = mChain->GetEntry(mEventCounter++);
955 int bytes = mChain->GetEntry( mEventList->GetEntry( mEventCounter++ ) );
957 DEBUGVALUE3(mEventCounter);
958 if ( mEventCounter >= mEventList->GetN() )
throw StMuExceptionEOF(
"end of event list",__PRETTYF__);
959 bytes = mChain->GetEntry( mEventList->GetEntry( mEventCounter++ ) );
963 if (GetDebug()>1) printArrays();
973 void StMuDstMaker::closeRead(){
975 if (mChain) mChain->Delete();
982 DEBUGVALUE2(fileName.c_str());
984 DEBUGMESSAGE2(
"now create file");
985 mCurrentFile =
new TFile(fileName.c_str(),
"RECREATE",
"StMuDst");
987 if (mCurrentFile->IsZombie())
throw StMuExceptionNullPointer(
"no file openend",__PRETTYF__);
989 mCurrentFile->SetCompressionLevel(mCompression);
992 DEBUGMESSAGE2(
"now create trees and branches");
994 int bufsize = mBufferSize;
995 if (mSplit) bufsize /= 4;
997 mTTree =
new TTree(
"MuDst",
"StMuDst",mSplit);
999 #if ROOT_VERSION_CODE < ROOT_VERSION(5,26,0)
1000 Long64_t MAXLONG=100000000000LL;
1001 LOG_INFO <<
"Tree size MAX will be " << (float) MAXLONG/1000/1000/1000 <<
" GB " << endm;
1002 mTTree->SetMaxTreeSize(MAXLONG);
1005 DEBUGMESSAGE2(
"all arrays");
1006 for (
int i=0; i<__NALLARRAYS__; i++) {
1007 if (mStatusArrays[i]==0)
continue;
1008 mTTree->Branch(StMuArrays::arrayNames[i],&mAArrays[i], bufsize, mSplit);
1010 mCurrentFileName = fileName;
1015 void StMuDstMaker::closeWrite(){
1016 DEBUGMESSAGE(__PRETTYF__);
1017 if (mTTree && mCurrentFile) {
1018 LOG_INFO <<
" ##### " << __PRETTYF__ << endm;
1019 LOG_INFO <<
" ##### File=" << mCurrentFile->GetName() <<
" ";
1020 LOG_INFO <<
" NumberOfEvents= " << mTTree->GetEntries() <<
" ";
1021 LOG_INFO <<
" ##### " << endm;
1026 mCurrentFile->Write();
1027 mCurrentFile->Close();
1048 fillL3AlgorithmInfo(ev);
1049 fillDetectorStates(ev);
1088 fillTracks(ev,mTrackFilter);
1096 fillL3Tracks(ev, mL3TrackFilter);
1103 #ifndef __NO_STRANGE_MUDST__
1104 if (mStStrangeMuDstMaker) {
1120 mStMuDst->
set(
this);
1135 if (!ev)
throw StMuExceptionNullPointer(
"no StEvent",__PRETTYF__);
1138 if (!cut || cut->
pass(ev)) {
1140 addType(mArrays[muEvent],ev,typeOfEvent);
1143 DEBUGVALUE2(timer.elapsedTime());
1148 void StMuDstMaker::fillEmc(
StEvent* ev) {
1151 if (!emccol)
return;
1155 TClonesArray *tca = mEmcArrays[muEmcTow];
1157 if (!mEmcCollection) {
1160 mStMuDst->
set(
this);
1162 mEmcUtil->fillMuEmc(mEmcCollection,emccol);
1165 DEBUGVALUE2(timer.elapsedTime());
1169 void StMuDstMaker::fillFms(
StEvent* ev) {
1172 if (!fmscol)
return;
1176 if (!mFmsCollection) {
1178 connectFmsCollection();
1179 mStMuDst->
set(
this);
1181 LOG_DEBUG <<
"StMuDSTMaker filling StMuFmsCollection from StEvent" << endm;
1182 mFmsUtil->fillMuFms(mFmsCollection,fmscol);
1185 DEBUGVALUE2(timer.elapsedTime());
1189 void StMuDstMaker::fillRHICf(
StEvent* ev) {
1192 if (!rhicfcol)
return;
1196 if (!mRHICfCollection) {
1197 LOG_INFO <<
"no find a RHICfCollection !!! " << endm;
1199 connectRHICfCollection();
1200 mStMuDst->
set(
this);
1202 LOG_DEBUG <<
"StMuDSTMaker filling StMuRHICfCollection from StEvent" << endm;
1203 mRHICfUtil->fillMuRHICf(mRHICfCollection,rhicfcol);
1206 DEBUGVALUE2(timer.elapsedTime());
1210 void StMuDstMaker::fillFcs(
StEvent* ev) {
1213 if (!fcscol)
return;
1218 if (!mFcsCollection) {
1220 connectFcsCollection();
1221 mStMuDst->
set(
this);
1224 mFcsUtil->fillMuFcs(mFcsCollection,fcscol);
1227 DEBUGVALUE2(timer.elapsedTime());
1231 void StMuDstMaker::fillFtt(
StEvent* ev) {
1234 if (!fttcol)
return;
1238 if (!mFttCollection) {
1240 connectFttCollection();
1241 mStMuDst->
set(
this);
1243 mFttUtil->fillMuFtt(mFttCollection,fttcol);
1246 DEBUGVALUE2(timer.elapsedTime());
1250 void StMuDstMaker::fillFst(
StEvent* ev) {
1253 if (!fstcol)
return;
1257 if (!mFstCollection) {
1259 connectFstCollection();
1260 mStMuDst->
set(
this);
1265 if (IAttr(
"fstMuRawHit")){
1269 mFstUtil->fillMuFst(mFstCollection,fstcol,fstevtcol);
1272 DEBUGVALUE2(timer.elapsedTime());
1276 void StMuDstMaker::fillFwdTrack(
StEvent* ev) {
1278 LOG_INFO <<
"StMuDstMaker::fillFwdTrack(StEvent* ev)" << endm;
1280 if (!fwdcol)
return;
1284 LOG_INFO <<
"StMuDSTMaker filling StMuFwdTrackCollection from StEvent" << endm;
1286 if (!mFwdTrackCollection) {
1288 LOG_INFO <<
"Connecting StMuFwdTrackCollection" << endm;
1289 connectFwdTrackCollection();
1290 mStMuDst->
set(
this);
1293 mFwdTrackUtil->fillMuFwdTrack(mFwdTrackCollection,fwdcol,mFcsUtil);
1296 DEBUGVALUE2(timer.elapsedTime());
1300 void StMuDstMaker::fillPmd(
StEvent* ev) {
1303 if (!phmdColl)
return;
1307 if (!mPmdCollection) {
1309 connectPmdCollection();
1310 mStMuDst->
set(
this);
1312 mPmdUtil->fillMuPmd(phmdColl,mPmdCollection);
1315 DEBUGVALUE2(timer.elapsedTime());
1321 void StMuDstMaker::fillTof(
StEvent* ev) {
1325 if( !ev || !tofcol || (!tofcol->dataPresent()&&!tofcol->rawdataPresent()) )
1332 mTofUtil->fillMuTofHit(&muTofHitColl, tofcol);
1333 for(
size_t i=0; i < muTofHitColl.size(); i++) {
1335 addType( mTofArrays[muTofHit], *tofMuHit );
1339 StSPtrVecTofData &tofData = tofcol->tofData();
1340 for(
size_t i=0; i < tofData.size(); i++) {
1341 addType( mTofArrays[muTofData], *tofData[i] );
1346 StSPtrVecTofRawData &tofRawData = tofcol->tofRawData();
1347 for(
size_t i=0; i < tofRawData.size(); i++) {
1348 addType( mTofArrays[muTofRawData], *tofRawData[i] );
1352 DEBUGVALUE2(timer.elapsedTime());
1361 if( !ev || !btofcol || !btofcol->rawHitsPresent() )
1368 mBTofUtil->fillMuBTofHit(&muBTofHitColl, btofcol);
1369 for(
size_t i=0; i < muBTofHitColl.size(); i++) {
1375 StSPtrVecBTofRawHit &btofRawHits = btofcol->tofRawHits();
1376 for(
size_t i=0; i < btofRawHits.size(); i++) {
1377 addType(
mBTofArrays[muBTofRawHit], *btofRawHits[i] );
1385 DEBUGVALUE2(timer.elapsedTime());
1392 DEBUGMESSAGE2(
"" );
1404 for(
size_t i=0; i < (size_t) muETofColl.digisPresent(); i++ ) {
1406 if( !pDigi )
continue;
1407 addType( mETofArrays[ muETofDigi ], *pDigi );
1411 for(
size_t i=0; i < (size_t) muETofColl.hitsPresent(); i++ ) {
1413 if( !pHit )
continue;
1414 addType( mETofArrays[ muETofHit ], *pHit );
1420 addType( mETofArrays[ muETofHeader ], *pHeader );
1424 DEBUGVALUE2( timer.elapsedTime() );
1428 void StMuDstMaker::fillEpd(
StEvent* ev){
1431 if (!epdcol)
return;
1437 mEpdUtil->fillMuEpdHit(&muEpdHitColl, epdcol);
1438 for(
size_t i=0; i < muEpdHitColl.size(); i++){
1440 addType( mEpdArrays[muEpdHit], *epdMuHit);
1443 DEBUGVALUE2(timer.elapsedTime());
1458 void StMuDstMaker::fillFgt(
StEvent* ev) {
1462 fgtCollPtr = ev->fgtCollection();
1466 assert( mFgtArrays );
1467 assert( mFgtArrays[muFgtStrips] );
1468 assert( mFgtArrays[muFgtClusters] );
1469 assert( mFgtArrays[muFgtStripAssociations] );
1476 std::map< Int_t, Int_t > stripGeoIdIdxMap;
1477 std::map< Int_t, Int_t >::iterator stripGeoIdIdxIter;
1480 for( UShort_t discIdx = 0; discIdx < kFgtNumDiscs; ++discIdx ){
1483 const StSPtrVecFgtStrip& stripVec = fgtCollPtr->mStripCollection[ discIdx ].getStripVec();
1484 for( const_StFgtStripIterator stripIter = stripVec.begin(); stripIter != stripVec.end(); ++stripIter ){
1485 Short_t stripType = (*stripIter)->getClusterSeedType();
1488 if( stripType == kFgtSeedType1 ||
1489 stripType == kFgtSeedType2 ||
1490 stripType == kFgtSeedType3 ||
1491 stripType == kFgtSeedType4 ||
1492 stripType == kFgtSeedType5 ||
1493 stripType == kFgtSeedTypeMax ||
1494 stripType == kFgtClusterPart ||
1495 stripType == kFgtNextToDeadGuy ||
1496 stripType == kFgtClusterEndUp ||
1497 stripType == kFgtClusterEndDown ||
1498 stripType == kFgtStripShared ||
1499 stripType == kFgtClusterTooBig ||
1500 stripType == kFgtClusterSeedInSeaOfNoise ||
1501 stripType == kFgtNextToCluster ||
1502 stripType == kFgtKeepStrip){
1511 Int_t nTBend = nTBstart + fgtCollPtr->getNumTimeBins();
1515 for( Int_t tb = nTBstart; tb < nTBend; ++tb ){
1517 StMuFgtAdc fgtAdc( (*stripIter)->getAdc( tb ), tb );
1519 Int_t adcIdx = addType( mFgtArrays[muFgtAdcs], fgtAdc );
1522 if( tb == nTBstart ){
1525 fgtStrip.setAdcInfo( adcIdx, nTBend-nTBstart );
1530 Int_t idx = addType( mFgtArrays[muFgtStrips], fgtStrip );
1533 stripGeoIdIdxMap[ (*stripIter)->getGeoId() ] = idx;
1539 stripWeightMap_t::const_iterator wIter;
1542 const StSPtrVecFgtHit& hitVec = fgtCollPtr->mHitCollection[ discIdx ].getHitVec();
1543 for( const_StFgtHitIterator hitIter = hitVec.begin(); hitIter != hitVec.end(); ++hitIter ){
1544 if( (*hitIter)->charge() > 0 ){
1546 Int_t clusIdx = addType( mFgtArrays[muFgtClusters], *(*hitIter), clusterClassType );
1549 const stripWeightMap_t& wMap = (*hitIter)->getStripWeightMap();
1553 for( wIter = wMap.begin(); wIter != wMap.end(); ++wIter ){
1555 Int_t geoId = wIter->first->getGeoId();
1556 Float_t weight = wIter->second;
1559 stripGeoIdIdxIter = stripGeoIdIdxMap.find( geoId );
1562 assert( stripGeoIdIdxIter != stripGeoIdIdxMap.end() );
1564 Int_t stripIdx = stripGeoIdIdxIter->second;
1570 Int_t associationIdx = addType( mFgtArrays[muFgtStripAssociations], association );
1578 clusPtr->setFirstStripAssociationIndex( associationIdx );
1587 void StMuDstMaker::fillMtd(
StEvent* ev) {
1598 for(
size_t i=0; i < (size_t)mMTD.hitsPresent(); i++) {
1600 addType( mMtdArrays[muMTDHit], *mtdHit );
1603 for(
size_t i=0; i < (size_t)mMTD.rawHitsPresent(); i++) {
1605 addType( mMtdArrays[muMTDRawHit], *mtdHit );
1608 if(mtdHead) addType(mMtdArrays[muMTDHeader],*mtdHead);
1612 DEBUGVALUE2(timer.elapsedTime());
1620 char *eztArrayStatus=&mStatusArrays[__NARRAYS__+
1621 #ifndef __NO_STRANGE_MUDST__
1624 __NMCARRAYS__+__NEMCARRAYS__+__NPMDARRAYS__+__NFMSARRAYS__+__NRHICFARRAYS__+__NFCSARRAYS__+__NFTTARRAYS__+__NFSTARRAYS__+__NFWDTRACKARRAYS__+
1625 __NTOFARRAYS__+__NBTOFARRAYS__+__NETOFARRAYS__+__NEPDARRAYS__+__NMTDARRAYS__+__NFGTARRAYS__];
1626 if(eztArrayStatus[muEztHead]){
1628 addType(mEztArrays[muEztHead], *header);
1631 if(eztArrayStatus[muEztTrig]) {
1634 addType(mEztArrays[muEztTrig], *trig);
1637 if(eztArrayStatus[muEztFpd]) {
1639 addType(mEztArrays[muEztFpd], *fpd);
1642 if(eztArrayStatus[muEztETow] || eztArrayStatus[muEztESmd]) {
1645 gMessMgr->Message(
"",
"W") <<
GetName()<<
"::fillEzt(), missing StEmcCollection, EEMC raw data NOT saved in muDst" <<endm;
1649 if(eztArrayStatus[muEztETow]) {
1651 addType(mEztArrays[muEztETow], *ETow);
1654 if(eztArrayStatus[muEztESmd]) {
1656 addType(mEztArrays[muEztESmd], *ESmd);
1665 void StMuDstMaker::fillL3AlgorithmInfo(
StEvent* ev) {
1667 if ( !ev->l3Trigger() )
return;
1668 if ( !ev->l3Trigger()->l3EventSummary())
return;
1673 int n = l3->numberOfAlgorithms();
1674 for (
int i=0; i<n; i++) {
1675 if (l3->algorithms()[i]->accept())
1676 addType( mArrays[muAccept], *l3->algorithms()[i] );
1678 addType( mArrays[muReject], *l3->algorithms()[i] );
1681 DEBUGVALUE2(timer.elapsedTime());
1686 void StMuDstMaker::fillVertices(
StEvent* ev) {
1692 Int_t n_vtx = ev->numberOfPrimaryVertices();
1695 for (Int_t i_vtx=0; i_vtx < n_vtx; i_vtx++) {
1697 addType( mArrays[muPrimaryVertex], vtx, typeOfVertex );
1698 mVtxList.AddAtAndExpand(ev->primaryVertex(i_vtx),i_vtx);
1701 DEBUGVALUE2(timer.elapsedTime());
1705 void StMuDstMaker::fillpp2pp(
StEvent* ev) {
1713 if (rps) addType( mArrays[mupp2pp], *rps, typeOfRps );
1715 DEBUGVALUE2(timer.elapsedTime());
1727 StSPtrVecTrackNode& nodes= ev->trackNodes();
1728 DEBUGVALUE2(nodes.size());
1729 for (StSPtrVecTrackNodeConstIterator iter=nodes.begin(); iter!=nodes.end(); iter++) {
1730 addTrackNode(ev, *iter, cut, mArrays[muGlobal], mArrays[muPrimary], mArrays[muOther], mArrays[muCovGlobTrack], mArrays[muCovPrimTrack],
false);
1733 DEBUGVALUE2(timer.elapsedTime());
1740 if (!ev->l3Trigger())
return;
1744 StSPtrVecTrackNode& nodes= ev->l3Trigger()->trackNodes();
1745 DEBUGVALUE2(nodes.size());
1746 for (StSPtrVecTrackNodeConstIterator iter=nodes.begin(); iter!=nodes.end(); iter++) {
1747 addTrackNode(ev, *iter, cut, mArrays[muL3], 0, 0, 0, 0,
true );
1750 DEBUGVALUE2(timer.elapsedTime());
1755 void StMuDstMaker::fillDetectorStates(
StEvent* ev) {
1762 addType( mArrays[muState], *state );
1766 DEBUGVALUE2(timer.elapsedTime());
1772 TClonesArray* gTCA, TClonesArray* pTCA, TClonesArray* oTCA, TClonesArray* covgTCA, TClonesArray* covpTCA,
bool l3) {
1777 int index2Global =-1;
1779 const StTrack *pr_tr = node->track(primary);
1782 vtx = pr_tr->vertex();
1784 vtx = ev->primaryVertex();
1786 tr= node->track(global);
1787 if (tr && !tr->bad()) index2Global =
addTrack(gTCA, ev, tr, vtx, cut, -1, l3, covgTCA, covpTCA);
1791 tr = node->track(primary);
1792 if (tr && !tr->bad())
addTrack(pTCA, ev, tr, tr->vertex(), cut, index2Global, l3, covgTCA, covpTCA);
1796 size_t nEntries = node->entries();
1797 for (
size_t j=0; j<nEntries; j++) {
1798 tr = node->track(j);
1799 if (tr && !tr->bad() && (tr->type()!=global) && (tr->type()!=primary) ) {
1800 addTrack(oTCA, ev, tr, tr->vertex(), cut, index2Global, l3);
1809 TClonesArray* covgTCA, TClonesArray* covpTCA) {
1813 int index2RichSpectra=-1;
1815 int counter = tca->GetEntries();
1817 if (cut && !cut->
pass(track))
throw StMuExceptionBadValue(
"failed track cut",__PRETTYF__);
1822 index2RichSpectra = addType( mArrays[muRich], *rich );
1824 StMuTrack *muTrack =
new((*tca)[counter])
StMuTrack(event, track, vtx, index2Global, index2RichSpectra, l3, &mVtxList);
1825 if (track->type() == primary) {
1827 Int_t countCOVPTCA = covpTCA->GetEntries();
1829 const StMatrixF covMatrix = track->fitTraits().covariantMatrix();
1833 const Float_t* cov = track->fitTraits().covariance();
1840 if (track->type() == global) {
1842 Int_t countCOVGTCA = covgTCA->GetEntries();
1854 IFDEBUG3(e.print());
1863 const StPtrVecTrackPidTraits& traits = track->pidTraits(kRichId);
1864 for (StPtrVecTrackPidTraitsConstIterator traitIter=traits.begin();traitIter!=traits.end();++traitIter) {
1866 if (pid)
return pid->getRichSpectra();
1870 #ifndef __NO_STRANGE_MUDST__
1874 if (!maker)
throw StMuExceptionNullPointer(
"no StrangeMuDstMaker",__PRETTYF__);
1886 addType(maker->GetEvClonesArray(), mStrangeArrays[0],ev);
1887 addType(maker->GetEvMcArray(), mStrangeArrays[1],ev);
1889 addType(maker->GetV0ClonesArray(), mStrangeArrays[2],v0);
1890 addType(maker->GetV0McArray(), mStrangeArrays[3],v0Mc);
1891 addType(maker->GetV0AssocArray(), mStrangeArrays[4],assoc);
1893 addType(maker->GetXiClonesArray(), mStrangeArrays[5],xi);
1894 addType(maker->GetXiMcArray(), mStrangeArrays[6],xiMc);
1895 addType(maker->GetXiAssocArray(), mStrangeArrays[7],assoc);
1897 addType(maker->GetKinkClonesArray(),mStrangeArrays[8],kink);
1898 addType(maker->GetKinkMcArray(), mStrangeArrays[9],kinkMc);
1899 addType(maker->GetKinkAssocArray(), mStrangeArrays[10],assoc);
1901 addType(maker->GetCutsArray(), mStrangeArrays[11],strangeCut);
1906 void StMuDstMaker::fillMC() {
1907 St_g2t_track *g2t_track = (St_g2t_track *) GetDataSet(
"geant/g2t_track");
if (!g2t_track)
return;
1908 St_g2t_vertex *g2t_vertex = (St_g2t_vertex *) GetDataSet(
"geant/g2t_vertex");
if (!g2t_vertex)
return;
1909 StG2TrackVertexMap::instance(g2t_track,g2t_vertex);
1910 mStEvent->setIdTruth();
1913 g2t_vertex_st *
vertex = g2t_vertex->GetTable();
1914 UInt_t NV = g2t_vertex->GetNRows();
1915 for (UInt_t i = 0; i < NV; i++) addType(mMCArrays[MCVertex], vertex[i], mcvx);
1916 g2t_track_st *track = g2t_track->GetTable();
1917 UInt_t NT = g2t_track->GetNRows();
1918 for (UInt_t i = 0; i < NT; i++) {
1919 if (track[i].pt<=1e-3) track[i].pt = -999;
1920 addType(mMCArrays[MCTrack], track[i], mctr);
1928 int StMuDstMaker::addType(TClonesArray* tcaFrom, TClonesArray* &tcaTo ,T *t) {
1929 if (tcaFrom && tcaTo) {
1930 int n = tcaFrom->GetEntries();
1931 int counter = tcaTo->GetEntries();
1932 for (
int i=0; i<n;i++) {
1934 new((*tcaTo)[counter++]) T( *(T*)(
void*)tcaFrom->UncheckedAt(i) );
1955 int StMuDstMaker::addType(TClonesArray* tcaTo ,T &t) {
1958 counter = tcaTo->GetEntries();
1959 new((*tcaTo)[counter]) T( t );
1966 template <
class T,
class U>
1967 int StMuDstMaker::addType(TClonesArray* tcaTo ,U &u,T *t) {
1970 counter = tcaTo->GetEntries();
1972 new((*tcaTo)[counter]) T(u);
1979 string StMuDstMaker::buildFileName(
string dir,
string fileName,
string extention){
1980 DEBUGMESSAGE3(dir.c_str());
1981 DEBUGMESSAGE3(fileName.c_str());
1982 DEBUGMESSAGE3(extention.c_str());
1983 fileName = dir + fileName + extention;
1984 while (fileName.find(
"//")!=string::npos) {
1985 int pos = fileName.find(
"//");
1986 fileName.erase(pos,1);
1993 string StMuDstMaker::basename(
string s){
1994 DEBUGVALUE3(s.c_str());
1996 DEBUGVALUE3(name.c_str());
1998 pos = name.find_last_of(
"/");
1999 if (pos!=string::npos ) name.erase(0, pos );
2000 DEBUGVALUE3(name.c_str());
2001 pos = name.find_last_of(
".");
2002 if (pos!=string::npos ) name.erase(pos,name.length()-pos );
2003 DEBUGVALUE3(name.c_str());
2004 pos = name.find_last_of(
".");
2005 if (pos!=string::npos ) name.erase(pos,name.length()-pos );
2006 DEBUGVALUE3(name.c_str());
2012 string StMuDstMaker::dirname(
string s){
2014 DEBUGVALUE3(name.c_str());
2016 pos = name.find_last_of(
"/");
2018 if (pos != string::npos ) name.erase(pos, name.length());
2019 if (name == s) name =
".";
2027 std::ostringstream flnm;
2030 const char *PIDtable=
"PIDTableP01gl.root";
2032 flnm << getenv(
"STAR") <<
"/StarDb/dEdxModel/" << PIDtable << ends;
2033 FORCEDDEBUGMESSAGE(
"ATTENTION: pid table hardwired to " << flnm.str() );
2036 flnm << file << ends;
2037 FORCEDDEBUGMESSAGE(
"Using pid table to user value " << flnm.str() );
2041 if (mProbabilityPidAlgorithm)
2042 mProbabilityPidAlgorithm->readParametersFromFile(flnm.str());
2047 void StMuDstMaker::printArrays()
2051 for (
int i=0; i<__NALLARRAYS__; i++) {
2052 if (mStatusArrays[i]==0)
continue;
2054 printf(
" Array %s\t = %s::%s(%d)\n",
2055 StMuArrays::arrayNames[i],
2056 tcl->ClassName(),tcl->GetName(),tcl->GetEntriesFast());
2061 void StMuDstMaker::fillHddr()
2070 hd->SetRunNumber(ei.runId()) ;
2071 hd->SetEventType(ei.type().Data());
2072 hd->SetTriggerMask(ei.triggerMask()) ;
2074 hd->SetBunchCrossingNumber(ei.bunchCrossingNumber(0),ei.bunchCrossingNumber(1));
2075 hd->SetCenterOfMassEnergy(ri.centerOfMassEnergy());
2084 hd->SetGMTime((
unsigned int)ei.time());
2085 hd->SetProdDateTime(ri.productionTime());
2087 hd->SetEventSize(ei.eventSize());
2088 hd->SetEventNumber(ei.id()) ;
2094 mEmcCollection->setTowerData((
StMuEmcTowerData*)(*(mEmcArrays[muEmcTow]))[0]);
2095 mEmcCollection->setPrsArray(2,mEmcArrays[muEmcPrs]);
2096 mEmcCollection->setSmdArray(3,mEmcArrays[muEmcSmde]);
2097 mEmcCollection->setSmdArray(4,mEmcArrays[muEmcSmdp]);
2098 mEmcCollection->setPrsArray(6,mEmcArrays[muEEmcPrs]);
2099 mEmcCollection->setSmdArray(7,mEmcArrays[muEEmcSmdu]);
2100 mEmcCollection->setSmdArray(8,mEmcArrays[muEEmcSmdv]);
2103 void StMuDstMaker::connectFmsCollection() {
2104 mFmsCollection->setFmsHitArray(mFmsArrays[muFmsHit]);
2105 mFmsCollection->setFmsClusterArray(mFmsArrays[muFmsCluster]);
2106 mFmsCollection->setFmsPointArray(mFmsArrays[muFmsPoint]);
2107 mFmsCollection->setFmsInfoArray(mFmsArrays[muFmsInfo]);
2110 void StMuDstMaker::connectRHICfCollection() {
2111 mRHICfCollection->setRHICfRawHitArray(mRHICfArrays[muRHICfRawHit]);
2112 mRHICfCollection->setRHICfHitArray(mRHICfArrays[muRHICfHit]);
2113 mRHICfCollection->setRHICfPointArray(mRHICfArrays[muRHICfPoint]);
2116 void StMuDstMaker::connectFcsCollection() {
2117 LOG_INFO <<
"Setting Fcs arrays" << endm;
2118 mFcsCollection->setFcsHitArray(mFcsArrays[muFcsHit]);
2119 mFcsCollection->setFcsClusterArray(mFcsArrays[muFcsCluster]);
2120 mFcsCollection->setFcsPointArray(mFcsArrays[muFcsPoint]);
2121 mFcsCollection->setFcsInfoArray(mFcsArrays[muFcsInfo]);
2124 void StMuDstMaker::connectFttCollection() {
2125 LOG_INFO <<
"Setting Ftt arrays" << endm;
2126 mFttCollection->setFttHitArray(mFttArrays[muFttRawHit]);
2127 mFttCollection->setFttClusterArray(mFttArrays[muFttCluster]);
2128 mFttCollection->setFttPointArray(mFttArrays[muFttPoint]);
2131 void StMuDstMaker::connectFstCollection() {
2132 LOG_INFO <<
"Setting Fst arrays" << endm;
2133 mFstCollection->setFstRawHitArray(mFstArrays[muFstRawHit]);
2134 mFstCollection->setFstHitArray(mFstArrays[muFstHit]);
2137 void StMuDstMaker::connectFwdTrackCollection() {
2138 LOG_INFO <<
"Setting FwdTrack arrays" << endm;
2139 mFwdTrackCollection->setFwdTrackArray(mFwdTrackArrays[muFwdTrack]);
2142 void StMuDstMaker::connectPmdCollection() {
2143 mPmdCollection->setPmdHitArray(mPmdArrays[muPmdHit]);
2144 mPmdCollection->setCpvHitArray(mPmdArrays[muCpvHit]);
2145 mPmdCollection->setPmdClusterArray(mPmdArrays[muPmdCluster]);
2146 mPmdCollection->setCpvClusterArray(mPmdArrays[muCpvCluster]);
void fillEzt(StEvent *ev)
static void fixMtdTrackIndices(TClonesArray *mtdHit, TClonesArray *primary, TClonesArray *global)
static void set(StMuDstMaker *maker)
set the pointers to the TClonesArrays
void connectEmcCollection()
routine to set up connection between mEmcCollection and Emc arrays
void fillStrange(StStrangeMuDstMaker *)
static const char * arrayTypes[__NALLARRAYS__]
< names of the classes, the TClonesArrays are arrays of this type
StMuDstMaker(const char *name="MuDst")
Default constructor.
void setProbabilityPidFile(const char *file=NULL)
Set the file from where the PID probability tables should be read.
virtual void Clear(Option_t *option="")
User defined functions.
virtual const char * GetFile() const
Returns name of current input or output file, depending on mode (GetFileName does the same...
static void collectVertexTracks()
Helper function to collect tracks for the current prim vertex.
static void fixTrackIndicesG(int mult=1)
void setL3TrackFilter(StMuCut *c)
Set the track filter used for L3 tracks when creating muDsts from StEvent and writing to disk...
static void fixETofTrackIndices(TClonesArray *btofHit, TClonesArray *primary, TClonesArray *global)
bool pass(const StEvent *)
called by user code, returns true if argument passes cuts, else false
void setTrackFilter(StMuCut *c)
Set the track filter used for all tracks (except the L3 tracks) when creating muDsts from StEvent and...
StMuBTofUtil * mBTofUtil
dongx
static void fixTofTrackIndices(TClonesArray *btofHit, TClonesArray *primary, TClonesArray *global)
dongx
TClonesArray ** mBTofArrays
dongx
static StMuEvent * event()
returns pointer to current StMuEvent (class holding the event wise information, e.g. event number, run number)
Stores information for tiles in STAR Event Plane Detector.
static int arrayCounters[__NALLARRAYS__]
< number of entries in current event, currently not used
virtual const char * GetName() const
special overload
static void setProbabilityPidCentrality(Double_t cent)
Sets the centrality for calculating Aihong's pid.
virtual void openWrite(string fileName)
protected:
void SetStatus(const char *arrType, int status)
static void setProbabilityPidAlgorithm(StuProbabilityPidAlgorithm *)
Sets the StuProbabilityPidAlgorithm. Important in order to calculate Aihong's pids.
void fillBTof(StEvent *ev)
dongx
static int arraySizes[__NALLARRAYS__]
< maximum sizes of the TClonesArrays
void addTrackNode(const StEvent *ev, const StTrackNode *node, StMuCut *cut, TClonesArray *gTCA=0, TClonesArray *pTCA=0, TClonesArray *oTCA=0, TClonesArray *covgTCA=0, TClonesArray *covpTCA=0, bool l3=false)
void setIndex2Cov(Int_t i)
Bingchu.
void fillETof(StEvent *ev)
jdb & fseck
static void setVertexIndex(Int_t vtx_id)
Set the index number of the current primary vertex (used by both primaryTracks() functions and for St...
int addTrack(TClonesArray *tca, const StEvent *event, const StTrack *track, const StVertex *vtx, StMuCut *cut, int index2Global, bool l3=false, TClonesArray *covgTCA=0, TClonesArray *covpTCA=0)