StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StGammaMaker.cxx
1 #include "StGammaMaker.h"
2 
3 using namespace std;
4 
5 ClassImp(StGammaMaker);
6 
8 // Constructor //
10 StGammaMaker::StGammaMaker(const char *name, detectorSwitch detector, analysisType analysis):
11 StMaker(name)
12 {
13 
14  LOG_DEBUG << "StGammaMaker()" << endm;
15 
16  // Instantiate switches
17  mUseBemc = true;
18  mUseEemc = true;
19 
20  if(detector == kBemc) mUseEemc = false;
21  if(detector == kEemc) mUseBemc = false;
22 
23  if(analysis == kData)
24  {
25  mSimu = false;
26  }
27  else
28  {
29  mSimu = true;
30  }
31 
32  // Fetch necessary makers already in the chain
33  if(mUseEemc)
34  {
35 
36  mMuDstMaker = dynamic_cast<StMuDstMaker*>(GetMakerInheritsFrom("StMuDstMaker"));
37  assert(mMuDstMaker);
38 
39  mEemcAnalysis = dynamic_cast<StEEmcA2EMaker*>(GetMakerInheritsFrom("StEEmcA2EMaker"));
40  assert(mEemcAnalysis);
41 
42  }
43  else
44  {
45  mMuDstMaker = NULL;
46  mEemcAnalysis = NULL;
47  }
48 
49  // Instantiate the entire gamma family
50  if(mSimu)
51  {
52  mAsymMaker = new StMCAsymMaker("mAsymMaker");
53  mPythiaMaker = new StGammaPythiaEventMaker("mGammaPythiaMaker");
54  mScheduleMaker = new StGammaScheduleMaker("mGammaScheduleMaker");
55  mScheduleMaker->rearrange();
56  }
57 
58  mEventMaker = new StGammaEventMaker("mGammaEventMaker");
59  mRawMaker = new StGammaRawMaker("mGammaRawMaker");
60  if(mUseBemc) mRawMaker->useBemc();
61  if(mUseEemc) mRawMaker->useEemc();
62 
63  if(mUseBemc) mBemcClusterMaker = new StBarrelEmcClusterMaker();
64  if(mUseEemc)
65  {
66  mEemcClusterMaker = new StMyClusterMaker("mEemcClusterMaker", mEemcAnalysis, mMuDstMaker);
67  mEemcClusterMaker->setEtaCut(1);
68  mEemcClusterMaker->setPhiCut(1);
69  }
70 
71  mCandidateMaker = new StGammaCandidateMaker("mGammaCandidateMaker");
72  if(mUseBemc) mCandidateMaker->useBemc();
73  if(mUseEemc) mCandidateMaker->useEemc();
74  mTreeMaker = new StGammaTreeMaker("mGammaTreeMaker");
75 
76 }
77 
79 // Maker Init //
81 Int_t StGammaMaker::Init()
82 {
83 
84  if(mSimu) LOG_INFO << "Preparing to run over simulation..." << endm;
85  if(!mSimu) LOG_INFO << "Preparing to run over data..." << endm;
86 
87  if(mUseBemc) LOG_INFO << "Including the BEMC" << endm;
88  if(mUseEemc) LOG_INFO << "Including the EEMC" << endm;
89 
90  return StMaker::Init();
91 
92 }
93 
94 void StGammaMaker::setSeedEnergyThreshold(double threshold)
95 {
96  if(mUseBemc) mBemcClusterMaker->setSeedThreshold(threshold);
97  if(mUseEemc) mEemcClusterMaker->setSeedEnergy(threshold);
98 }
99 
100 void StGammaMaker::setClusterEnergyThreshold(double threshold)
101 {
102  if(mUseBemc) mBemcClusterMaker->setClusterThreshold(threshold);
103 }
104 
105 void StGammaMaker::addTimestamp(int date, int time, double weight)
106 {
107 
108  if(mSimu)
109  {
110  mScheduleMaker->addTimestamp(date, time, weight);
111  }
112  else
113  {
114  LOG_WARN << "addTimestamp() - StGammaMaker not prepared for simulation, ignoring timestamp request!" << endm;
115  }
116 
117 }
EEmc ADC –&gt; energy maker.
void setSeedEnergy(Float_t e, Int_t layer=0)
Sets the minimum seed energy for each tower layer.