2 #include "StBET4pMaker.h"
3 #include "StBET4pMakerImp.h"
4 #include "StBET4pMakerImpBuilder.h"
5 #include "StMuDSTMaker/COMMON/StMuTypes.hh"
7 #include "StjeTrackListToStMuTrackFourVecList.h"
8 #include "StjeTowerEnergyListToStMuTrackFourVecList.h"
10 #include "StjeBemcEnergySumCalculator.h"
11 #include "StjeBemcEnergySumCalculatorBuilder.h"
13 #include "StEmcADCtoEMaker/StEmcADCtoEMaker.h"
14 #include "StjTowerEnergyCorrectionForTracksMip.h"
25 , _uDstMaker(uDstMaker), _doTowerSwapFix(doTowerSwapFix)
27 , _useTPC(true), _useBEMC(true), _useEEMC(false)
28 , _use2003Cuts(false), _use2005Cuts(false), _use2006Cuts(false), _use2009Cuts(false)
29 , _useBEMCEnergySum(true)
30 , _useRandomSelector(false)
31 , _useBEMCEnergyVariation(false), _bemcEnergyVariationRatio(0.05)
33 , _bemcEnergySumCalculator(0)
36 , _randomSelectorProb(1.0), _randomSelectorAt(false)
37 , _randomSelectorSeed(0)
40 Int_t StBET4pMaker::Init()
43 _imp = impBuilder.build(_useTPC, _useBEMC, _useEEMC, _use2003Cuts, _use2005Cuts, _use2006Cuts, _use2009Cuts, _useBEMCEnergyVariation, _bemcEnergyVariationRatio, _useRandomSelector, _uDstMaker, _doTowerSwapFix, _correctTowerEnergyForTracks, _randomSelectorProb, _randomSelectorAt, _randomSelectorSeed);
47 _bemcEnergySumCalculator = bemcEnergySumCalculatorBuilder.build(_useBEMCEnergySum && _useBEMC, _use2003Cuts, _use2005Cuts, _uDstMaker, _doTowerSwapFix);
48 _bemcEnergySumCalculator->Init();
50 return StMaker::Init();
56 for (
size_t i = 0; i < _vertexNodes.size(); ++i) {
59 for (
size_t j = 0; j < node.tracks.size(); ++j) {
60 delete node.tracks[j];
68 _bemcEnergySumCalculator->Clear();
75 if(isBemcCorrupted())
return kStOk;
77 _bemcEnergySumCalculator->Make();
79 if (_bemcEnergySumCalculator->sumEmcEt() > 500.)
return kStOk;
85 for (
unsigned int vertexIndex = 0; vertexIndex < StMuDst::numberOfPrimaryVertices(); ++vertexIndex) {
88 if (vertex->ranking() > 0) {
93 pair<StjTrackList,StjTowerEnergyList> trackAndEnergyList = _imp->getTrackAndEnergyList();
95 FourList tpc4pList = _track2four(trackAndEnergyList.first);
96 node.tracks.insert(node.tracks.end(),tpc4pList.begin(),tpc4pList.end());
98 FourList energy4pList = _energy2four(trackAndEnergyList.second);
99 node.tracks.insert(node.tracks.end(),energy4pList.begin(),energy4pList.end());
109 bool StBET4pMaker::isBemcCorrupted()
const
111 if(
StEmcADCtoEMaker* adc2e = dynamic_cast<StEmcADCtoEMaker*>(const_cast<StBET4pMaker*>(
this)->GetMaker(
"Eread")))
112 return adc2e->isCorrupted();
117 int StBET4pMaker::nDylanPoints()
const
119 return _bemcEnergySumCalculator->nDylanPoints();
122 double StBET4pMaker::sumEmcEt()
const
124 return _bemcEnergySumCalculator->sumEmcEt();
static StMuPrimaryVertex * primaryVertex()
return pointer to current primary vertex
virtual void Clear(Option_t *option="")
User defined functions.
void Clear(Option_t *opt="")
User defined functions.
static Int_t currentVertexIndex()
Get the index number of the current primary vertex.
static void setVertexIndex(Int_t vtx_id)
Set the index number of the current primary vertex (used by both primaryTracks() functions and for St...