StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StjMCParticleMaker.cxx
1 // $Id: StjMCParticleMaker.cxx,v 1.4 2008/08/22 17:32:52 tai Exp $
2 #include "StjMCParticleMaker.h"
3 
4 
5 #include "StjMCParticleCut.h"
6 #include "StjMCParticleCutEta.h"
7 #include "StjMCParticleCutEtaForStatus.h"
8 #include "StjMCParticleCutStatus.h"
9 
10 #include "StjMCParticleListWriter.h"
11 
12 #include "StjMCMuDst.h"
13 
14 #include "StjMCParticleListCut.h"
15 
16 #include <TDirectory.h>
17 
18 #include <iostream>
19 
20 using namespace std;
21 
22 ClassImp(StjMCParticleMaker)
23 
24 
25 StjMCParticleMaker::StjMCParticleMaker(const Char_t *name, TDirectory* file, StMaker* uDstMaker)
26  : StMaker(name)
27  , _file(file)
28  , _uDstMaker(uDstMaker)
29 { }
30 
31 Int_t StjMCParticleMaker::Init()
32 {
33  _mc = new StjMCMuDst(_uDstMaker);
34 
35  _mcCut = new StjMCParticleListCut();
36 
37  int goodStatus[] = {1, 3};
38  _mcCut->addCut(new StjMCParticleCutStatus(2, goodStatus));
39  _mcCut->addCut(new StjMCParticleCutEtaForStatus(-2.0, 2.0, 1));
40 
41  _writer = new StjMCParticleListWriter("mcParticles", _file);
42 
43  return kStOk;
44 }
45 
47 {
48  StjMCParticleList theList = _mc->getMCParticleList();
49 
50  theList = (*_mcCut)(theList);
51 
52  _writer->Fill(theList);
53 
54  return kStOk;
55 
56 }
57 
59 {
60  _writer->Finish();
61 
62  return kStOk;
63 }
Definition: Stypes.h:41