StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StjTrgDisableTower.h
1 // -*- mode: c++;-*-
2 // $Id: StjTrgDisableTower.h,v 1.2 2009/04/28 02:37:32 tai Exp $
3 // Copyright (C) 2008 Tai Sakuma <sakuma@bnl.gov>
4 #ifndef STJTRGDISABLETOWER_H
5 #define STJTRGDISABLETOWER_H
6 
7 #include <StjTrg.h>
8 
9 #include <set>
10 
11 class StjTrgDisableTower : public StjTrg {
12 
13 public:
14  StjTrgDisableTower(StjTrg* src, int badTowerId)
15  : _src(src)
16  , _badTowerIdSet(&badTowerId, &badTowerId + 1)
17  , _runNumber(-1), _eventId(-1) { }
18  StjTrgDisableTower(StjTrg* src, int nbadTowerIds, int* badTowerIds)
19  : _src(src)
20  , _badTowerIdSet(badTowerIds, badTowerIds + nbadTowerIds)
21  , _runNumber(-1), _eventId(-1) { }
22 virtual ~StjTrgDisableTower() { }
23 
24  int id() { return _src->id(); }
25 
26  int runNumber() { return _src->runNumber(); }
27  int eventId() { return _src->eventId(); }
28  bool hard() const { return _src->hard(); }
29  bool soft() const { return _src->soft(); }
30  bool passed() const { return _src->passed(); }
31  double prescale() { return _src->prescale(); }
32  double vertexZ() { return _src->vertexZ(); }
33 
34  virtual std::vector<int> towers() { return std::vector<int>(); }
35  virtual std::vector<int> towerDsmAdc() { return std::vector<int>(); }
36  virtual std::vector<unsigned int> towerAdc() { return std::vector<unsigned int>(); }
37  virtual std::vector<double> towerEnergy() { return std::vector<double>(); }
38  virtual std::vector<double> towerEt() { return std::vector<double>(); }
39 
40  virtual std::vector<int> jetPatches() { return std::vector<int>(); }
41  virtual std::vector<int> jetPatchDsmAdc() { return std::vector<int>(); }
42  virtual std::vector<unsigned int> jetPatchAdc() { return std::vector<unsigned int>(); }
43  virtual std::vector<double> jetPatchEnergy() { return std::vector<double>(); }
44  virtual std::vector<double> jetPatchEt() { return std::vector<double>(); }
45 
46 
47 protected:
48 
49  StjTrg* _src;
50 
51  std::set<int> _badTowerIdSet;
52 
53  void readIfNewEvent() const;
54 
55 private:
56 
57  bool isNewEvent() const;
58  virtual void read() const = 0;
59 
60  void readNewEvent() const;
61 
62  mutable int _runNumber;
63  mutable int _eventId;
64 
65 
66  ClassDef(StjTrgDisableTower, 1)
67 
68 };
69 
70 #endif // STJTRGDISABLETOWER_H
Definition: StjTrg.h:11