1 #include "StMuDSTMaker/COMMON/StMuDst.h"
2 #include "StMuDSTMaker/COMMON/StMuDstMaker.h"
3 #include "StMuDSTMaker/COMMON/StMuEvent.h"
4 #include "StMuDSTMaker/COMMON/StMuTriggerIdCollection.h"
5 #include "StEvent/StTriggerId.h"
7 #include "StGammaEventMaker.h"
8 #include "StGammaEvent.h"
10 #include "StSpinPool/StSpinDbMaker/StSpinDbMaker.h"
12 #include "StGammaSpinMaker.h"
19 StGammaSpinMaker::StGammaSpinMaker(
const Char_t *name):
StMaker(name), mSpinDb(0)
25 StGammaSpinMaker::~StGammaSpinMaker()
37 LOG_DEBUG <<
"Make() - No MuDst found!" << endm;
44 LOG_DEBUG <<
"Make() - No StGammaEventMaker found!" << endm;
51 LOG_DEBUG <<
"Make() - StGammaEventMaker contains no StGammaEvent!" << endm;
56 mGammaEvent->SetDsmVertex( mudst->
event()->bbcTriggerDetector().onlineTimeDifference() );
58 mSpinDb =
dynamic_cast<StSpinDbMaker*
>(GetMakerInheritsFrom(
"StSpinDbMaker"));
61 LOG_WARN <<
"Make() - No StSpinDbMaker found! No spin information will be stored." << endm;
67 LOG_WARN << Form(
"++++ spindb reports invalid for run=%i event=%i",
GetRunNumber(), GetEventNumber()) << endm;
78 UShort_t bx48 = (UShort_t)trig->bunchCrossingId();
79 UShort_t bx7 = (UShort_t)trig->bunchCrossingId7bit( event->runNumber() );
83 if( mSpinDb->isMaskedUsingBX48(bx48) )
return kStOK;
85 if( mSpinDb->offsetBX48minusBX7(bx48,bx7) != 0 )
87 LOG_WARN <<
" ++++ spindb indicates 7bit and 48bit bunch crossings are inconsistent... event invalid ++++" << endm;
94 mGammaEvent->SetValidDb(
true);
95 mGammaEvent->SetSpin4( (UShort_t)spin4 );
96 mGammaEvent->SetBunchCrossing7bit( (UShort_t)bx7 );
97 mGammaEvent->SetBunchCrossing48bit( (UShort_t)bx48 );
98 mGammaEvent->SetBunchCrossingStar( (UShort_t)bxStar );
100 if( mSpinDb->
isPolDirLong() ) mGammaEvent->SetPolarizationType( StGammaEvent::kLongLong );
101 if( mSpinDb->
isPolDirTrans() ) mGammaEvent->SetPolarizationType( StGammaEvent::kTransTrans );
bool isPolDirTrans()
true if all needed DB tables were found
bool isValid()
dump spinDb content for current time stamp
int spin4usingBX48(int bx48)
8bit spin information
int BXyellowUsingBX48(int bx48)
4bit spin information
static StMuEvent * event()
returns pointer to current StMuEvent (class holding the event wise information, e.g. event number, run number)
virtual Int_t GetRunNumber() const
Returns the current RunNumber.
Collection of trigger ids as stored in MuDst.
bool isPolDirLong()
Returns true if beams are transversely polarized, false otherwise.