StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StBET4pMakerImpBuilder.cxx
1 // $Id: StBET4pMakerImpBuilder.cxx,v 1.12 2010/05/30 07:10:04 pibero Exp $
2 // Copyright (C) 2008 Tai Sakuma <sakuma@bnl.gov>
3 #include "StBET4pMakerImpBuilder.h"
4 #include "StBET4pMakerImp.h"
5 
6 #include "StjTPCMuDst.h"
7 #include "StjTPCRandomMuDst.h"
8 #include "StjBEMCMuDst.h"
9 #include "StjEEMCMuDst.h"
10 #include "StjTPCNull.h"
11 #include "StjBEMCNull.h"
12 #include "StjEEMCNull.h"
13 
14 #include "StjBEMCSockeVariation.h"
15 
16 #include "StjTPCTree.h"
17 #include "StjBEMCTree.h"
18 
19 #include "StjTrackListCut.h"
20 
21 #include "StjTrackCutDca.h"
22 #include "StjTrackCutDcaPtDependent.h"
23 #include "StjTrackCutEta.h"
24 #include "StjTrackCutPossibleHitRatio.h"
25 #include "StjTrackCutChi2.h"
26 #include "StjTrackCutLastPoint.h"
27 
28 #include "StjTowerEnergyListCut.h"
29 
30 #include "StjTowerEnergyCut2003BemcTower.h"
31 #include "StjTowerEnergyCutBemcWestOnly.h"
32 #include "StjTowerEnergyCutEnergy.h"
33 #include "StjTowerEnergyCutBemcStatus.h"
34 #include "StjTowerEnergyCutAdc.h"
35 
36 #include "StjTowerEnergyListVariation.h"
37 #include "StjTowerEnergyVariationEnergy.h"
38 
39 #include "StjAbstractTowerEnergyCorrectionForTracks.h"
40 
41 StBET4pMakerImp* StBET4pMakerImpBuilder::build(bool useTPC, bool useBEMC, bool useEEMC,
42  bool use2003Cuts, bool use2005Cuts, bool use2006Cuts, bool use2009Cuts,
43  bool useBEMCEnergyVariation, double bemcEnergyVariationRatio,
44  bool useRandomSelector,
45  StMuDstMaker* uDstMaker, bool doTowerSwapFix,
46  StjAbstractTowerEnergyCorrectionForTracks* correctTowerEnergyForTracks,
47  double randomSelectorProb, bool randomSelectorAt, unsigned int randomSelectorSeed)
48 {
49  StjTPC* tpc;
50  StjTrackListCut* tpcCut = new StjTrackListCut();
51  if( !useTPC ) {
52  tpc = new StjTPCNull();
53  } else {
54  if ( !useRandomSelector )
55  {
56  tpc = new StjTPCMuDst();
57  }
58  else
59  {
60  tpc = new StjTPCRandomMuDst(uDstMaker, randomSelectorProb, randomSelectorAt, randomSelectorSeed);
61  }
62  tpcCut->addCut(new StjTrackCutDca());
63  if(use2006Cuts) tpcCut->addCut(new StjTrackCutDcaPtDependent());
64  if(use2009Cuts) tpcCut->addCut(new StjTrackCutChi2);
65  tpcCut->addCut(new StjTrackCutEta());
66  tpcCut->addCut(new StjTrackCutPossibleHitRatio());
67  tpcCut->addCut(new StjTrackCutLastPoint);
68  }
69 
70  StjBEMC* bemc;
72  if( !useBEMC ) {
73  bemc = new StjBEMCNull();
74  } else {
75  bemc = new StjBEMCMuDst(doTowerSwapFix);
76 
77  if(use2003Cuts) bemcCut->addCut(new StjTowerEnergyCut2003BemcTower());
78  if(use2005Cuts) bemcCut->addCut(new StjTowerEnergyCutBemcWestOnly());
79  bemcCut->addCut(new StjTowerEnergyCutEnergy());
80  bemcCut->addCut(new StjTowerEnergyCutBemcStatus());
81  bemcCut->addCut(new StjTowerEnergyCutAdc());
82  }
83 
84  if( useBEMCEnergyVariation ) {
86  variation->addVariation(new StjTowerEnergyVariationEnergy(bemcEnergyVariationRatio));
87  bemc = new StjBEMCSockeVariation(bemc, variation);
88  }
89 
90  StjEEMC* eemc;
91  if( !useEEMC ) {
92  eemc = new StjEEMCNull();
93  } else {
94  eemc = new StjEEMCMuDst();
95  }
96 
97  StBET4pMakerImp* ret = new StBET4pMakerImp(tpc, tpcCut, bemc, bemcCut, correctTowerEnergyForTracks, eemc);
98 
99  return ret;
100 }
101 
Definition: StjTPC.h:12