4 #include <StMuDSTMaker/COMMON/StMuDstMaker.h>
5 #include <StMuDSTMaker/COMMON/StMuDst.h>
6 #include <StMuDSTMaker/COMMON/StMuEvent.h>
9 #include <TDirectory.h>
23 :
StMaker(name), _file(file), _uDstMaker(uDstMaker)
28 const char* GetCVS()
const
29 {
static const char cvs[]=
"Tag $Name: $ $Id: StjMuDstFileNameMaker.C,v 1.2 2014/08/06 11:43:24 jeromel Exp $ built " __DATE__
" " __TIME__;
return cvs;}
41 Char_t _mudstName[256];
43 string getMuDstFileName()
45 string filepath(_uDstMaker->chain()->GetFile()->GetName());
46 char *chFilepath =
new char[filepath.size() + 1];
47 sprintf(chFilepath,
"%s", filepath.c_str());
48 string filename = basename(chFilepath);
58 _tree =
new TTree(
"mudstName",
"mudstName");
59 _tree->Branch(
"runNumber" , &_runNumber ,
"runNumber/I" );
60 _tree->Branch(
"eventId" , &_eventId ,
"eventId/I" );
61 _tree->Branch(
"vertexZ" , &_vertexZ ,
"vertexZ/D" );
62 _tree->Branch(
"mudstName" , &_mudstName ,
"mudstName[256]/C" );
68 string finlename = getMuDstFileName();
69 _runNumber = _uDstMaker->muDst()->event()->runId();
70 _eventId = _uDstMaker->muDst()->event()->eventId();
71 _vertexZ = _uDstMaker->muDst()->event()->primaryVertexPosition().z();
73 strcpy(_mudstName, finlename.c_str());
80 _tree->BuildIndex(
"runNumber",
"eventId");