1 #include "StarEmbedMaker.h"
3 #include "StGenericVertexMaker/StGenericVertexMaker.h"
4 #include "StGenericVertexMaker/StFixedVertexFinder.h"
7 StarEmbedMaker::StarEmbedMaker() :
StarPrimaryMaker(), mFzdInput( true ), mFilename(), mFile(0), mTree(0), mCurrentEntry(0), mRun(0), mEvent(0), mVertexX(-9E9), mVertexY(-9E9), mVertexZ(-9E9), mSigmaX(-9E9), mSigmaY(-9E9), mSigmaZ(-9E9) {
10 StarEmbedMaker::~StarEmbedMaker() {
14 void StarEmbedMaker::SetInputFile(
const char* filename){
16 mFile = TFile::Open(mFilename.c_str()); assert(mFile);
17 mTree =
dynamic_cast<TTree*
>( mFile->Get(
"Tag") ); assert(mTree);
18 mTree->SetBranchAddress(
"EvtHddr.mRunNumber", &mRun );
19 mTree->SetBranchAddress(
"EvtHddr.mEventNumber", &mEvent );
20 mTree->SetBranchAddress(
"GlobalTag.primaryVertexX", &mVertexX );
21 mTree->SetBranchAddress(
"GlobalTag.primaryVertexY", &mVertexY );
22 mTree->SetBranchAddress(
"GlobalTag.primaryVertexZ", &mVertexZ );
23 mTree->SetBranchAddress(
"GlobalTag.sigmaPVX", &mSigmaX );
24 mTree->SetBranchAddress(
"GlobalTag.sigmaPVY", &mSigmaY );
25 mTree->SetBranchAddress(
"GlobalTag.sigmaPVZ", &mSigmaZ );
27 mVertexX = mVertexY = mVertexZ = mSigmaX = mSigmaY = mSigmaZ = -9E9;
30 void StarEmbedMaker::Clear(
const Option_t* opts )
33 mVertexX = mVertexY = mVertexZ = mSigmaX = mSigmaY = mSigmaZ = -9E9;
34 StarPrimaryMaker::Clear(opts);
51 mTree -> GetEntry( mCurrentEntry++ );
53 SetVertex( mVertexX, mVertexY, mVertexZ );
54 SetSigma ( mSigmaX, mSigmaY, mSigmaZ );
57 if ( 0 == mFzdInput ) {
64 auto* vertexMaker =
dynamic_cast<StGenericVertexMaker *
>( GetMaker(
"GenericVertex") ); assert(vertexMaker);
65 auto* vertexFinder =
dynamic_cast<StFixedVertexFinder *
>( vertexMaker->GetGenericFinder() ); assert(vertexFinder);
67 vertexFinder->SetVertexPosition( mVertexX, mVertexY, mVertexZ );
68 vertexFinder->SetVertexError ( mSigmaX, mSigmaY, mSigmaZ );
void SetSigma(Double_t sx, Double_t sy, Double_t sz, Double_t rho=0)
StGenericVertexFinder implementation for fixing vertex.
Main steering class for event generation.
void SetVertex(Double_t x, Double_t y, Double_t z)
Set the x, y and z vertex position.