StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StjeBemcEnergySumCalculatorBuilder.cxx
1 // $Id: StjeBemcEnergySumCalculatorBuilder.cxx,v 1.4 2010/05/30 07:10:04 pibero Exp $
2 // Copyright (C) 2008 Tai Sakuma <sakuma@bnl.gov>
3 #include "StjeBemcEnergySumCalculatorBuilder.h"
4 #include "StjeBemcEnergySumCalculator.h"
5 
6 #include "StjBEMCMuDst.h"
7 #include "StjTowerEnergyListCut.h"
8 
9 #include "StjTowerEnergyCut2003BemcTower.h"
10 #include "StjTowerEnergyCutBemcWestOnly.h"
11 #include "StjTowerEnergyCutEnergy.h"
12 #include "StjTowerEnergyCutBemcStatus.h"
13 #include "StjTowerEnergyCutAdc.h"
14 
15 StjeBemcEnergySumCalculator* StjeBemcEnergySumCalculatorBuilder::build(bool useBEMC, bool use2003Cuts, bool use2005Cuts, StMuDstMaker* uDstMaker, bool doTowerSwapFix)
16 {
17  if(!useBEMC) return new StjeBemcEnergySumCalculatorNull;
18 
19  StjBEMCMuDst* bemc = new StjBEMCMuDst(doTowerSwapFix);
21  if(use2003Cuts) bemcCut->addCut(new StjTowerEnergyCut2003BemcTower());
22  if(use2005Cuts) bemcCut->addCut(new StjTowerEnergyCutBemcWestOnly());
23  bemcCut->addCut(new StjTowerEnergyCutEnergy());
24  bemcCut->addCut(new StjTowerEnergyCutBemcStatus());
25  bemcCut->addCut(new StjTowerEnergyCutAdc());
26 
27  return new StjeBemcEnergySumCalculatorImp(bemc, bemcCut);
28 }