StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StjMCParticleListMaker.C
1 #include "StMaker.h"
2 
3 #include "StjMCParticleCut.h"
4 #include "StjMCParticleCutEta.h"
5 #include "StjMCParticleCutEtaForStatus.h"
6 #include "StjMCParticleCutStatus.h"
7 
8 #include "StjMCParticleListWriter.h"
9 
10 #include "StjMCMuDst.h"
11 
12 #include "StjMCParticleListCut.h"
13 
14 #include <TDirectory.h>
15 
17 
18 public:
19 
20  StjMCParticleListMaker(const Char_t *name, TDirectory* file, StMaker* uDstMaker)
21  : StMaker(name), _file(file), _uDstMaker(uDstMaker) { }
22  virtual ~StjMCParticleListMaker() { }
23 
24  const char* GetCVS() const
25  {static const char cvs[]="Tag $Name: $ $Id: StjMCParticleListMaker.C,v 1.4 2014/08/06 11:43:24 jeromel Exp $ built " __DATE__ " " __TIME__; return cvs;}
26 
27 private:
28 
29  TDirectory* _file;
30 
31  StMaker* _uDstMaker;
32 
33  StjMC* _mc;
34  StjMCParticleListCut _mcCut;
35 
36  StjMCParticleListWriter* _writer;
37 
38 public:
39 
40  Int_t Init()
41  {
42  _mc = new StjMCMuDst(_uDstMaker);
43 
44  // int goodStatus[] = {1, 3};
45  // _mcCut.addCut(new StjMCParticleCutStatus(2, goodStatus));
46  _mcCut.addCut(new StjMCParticleCutEtaForStatus(-3.0, 3.0, 2));
47  _mcCut.addCut(new StjMCParticleCutEtaForStatus(-3.0, 3.0, 1));
48 
49  _writer = new StjMCParticleListWriter("mcParticles", _file);
50 
51  return kStOk;
52  }
53 
54  Int_t Make()
55  {
56  StjMCParticleList theList = _mc->getMCParticleList();
57 
58  theList = _mcCut(theList);
59 
60  _writer->Fill(theList);
61 
62  return kStOk;
63  }
64 
65  Int_t Finish()
66  {
67  _writer->Finish();
68 
69  return kStOk;
70  }
71 
72  ClassDef(StjMCParticleListMaker, 0)
73 
74 };
StMaker(const char *name="", const char *dummy=0)
Constructor &amp; Destructor.
Definition: StMaker.cxx:188
Definition: StjMC.h:11
Definition: Stypes.h:41