3 #include "StGammaPythiaEvent.h"
4 #include "StGammaPythiaEventMaker.h"
5 #include "StGammaEventMaker.h"
6 #include "StGammaEvent.h"
7 #include "StGammaScheduleMaker.h"
8 #include "StMuDSTMaker/COMMON/StMuDstMaker.h"
9 #include "StMuDSTMaker/COMMON/StMuDst.h"
10 #include "StMuDSTMaker/COMMON/StMuEvent.h"
11 #include "StMuDSTMaker/COMMON/StMuPrimaryVertex.h"
13 #include "StTriggerUtilities/StTriggerSimuMaker.h"
14 #include "StSpinPool/StSpinDbMaker/StSpinDbMaker.h"
21 StGammaEventMaker::StGammaEventMaker(
const char *name):
StMaker(name)
27 StGammaEventMaker::~StGammaEventMaker()
33 Int_t StGammaEventMaker::Init()
45 mPythiaMaker->SetPythia(mPythia);
46 mGammaEvent->SetPythia(mPythia);
50 muDstMaker =
dynamic_cast<StMuDstMaker*
>(GetMakerInheritsFrom(
"StMuDstMaker"));
53 return StMaker::Init();
61 mGammaEvent->Clear(opts);
73 if(!GetDataSet(
"MuDst"))
75 LOG_WARN <<
"No MuDst" << endm;
84 mGammaEvent->SetVertex(TVector3(pv->position().xyz()));
85 mGammaEvent->SetVertexRank(pv->ranking());
86 mGammaEvent->mFlags |= TPC_VERTEX;
90 mGammaEvent->SetVertex(TVector3(0.,0.,0.));
91 mGammaEvent->SetVertexRank(-100);
92 mGammaEvent->mFlags |= !(TPC_VERTEX);
97 mGammaEvent->SetMudstFileName( muDstMaker->
chain()->GetFile()->GetName() );
98 mGammaEvent->SetMagneticField(
StMuDst::event()->magneticField() );
99 mGammaEvent->SetTriggerIds(
StMuDst::event()->triggerIdCollection().nominal().triggerIds() );
100 mGammaEvent->SetBunchCrossing48bit(
StMuDst::event()->l0Trigger().bunchCrossingId() );
101 mGammaEvent->SetBunchCrossing7bit(
StMuDst::event()->l0Trigger().bunchCrossingId7bit( mGammaEvent->
runNumber() ) );
104 vector<unsigned int> simuTriggers;
110 for(
unsigned int i = 0; i < mRequestedTriggers.size(); ++i)
113 if(triggerSimu->isTrigger(mRequestedTriggers.at(i)))
115 simuTriggers.push_back(mRequestedTriggers.at(i));
116 cout <<
"StGammaEventMaker::Make() - " << mRequestedTriggers.at(i) <<
" fired!" << endl;
120 cout <<
"StGammaEventMaker::Make() - " << mRequestedTriggers.at(i) <<
" did not fire!" << endl;
127 mGammaEvent->SetSimuTriggerIds(simuTriggers);
134 mGammaEvent->SetValidDb(spinDb->
isValid());
135 mGammaEvent->SetSpin4( spinDb->
spin4usingBX48( mGammaEvent->bunchCrossing48bit() ) );
136 mGammaEvent->SetBunchCrossingStar( spinDb->BXstarUsingBX48( mGammaEvent->bunchCrossing48bit() ) );
138 if(spinDb->
isPolDirLong()) mGammaEvent->SetPolarizationType(StGammaEvent::kLongLong);
139 else if(spinDb->
isPolDirTrans()) mGammaEvent->SetPolarizationType(StGammaEvent::kTransTrans);
149 if(scheduler->nStamps()) mGammaEvent->
SetRunNumber(scheduler->index());
static StMuPrimaryVertex * primaryVertex()
return pointer to current primary vertex
Int_t runNumber() const
Return ith candidate.
bool isPolDirTrans()
true if all needed DB tables were found
bool isValid()
dump spinDb content for current time stamp
void Clear(Option_t *opts="")
User defined functions.
virtual void Clear(Option_t *option="")
User defined functions.
int spin4usingBX48(int bx48)
8bit spin information
static StMuEvent * event()
returns pointer to current StMuEvent (class holding the event wise information, e.g. event number, run number)
void SetRunNumber(Int_t run)
Add a new gamma candidate.
TChain * chain()
In read mode, returns pointer to the chain of .MuDst.root files that where selected.
bool isPolDirLong()
Returns true if beams are transversely polarized, false otherwise.