StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StjTrgDisableTowerHT.cxx
1 // $Id: StjTrgDisableTowerHT.cxx,v 1.1 2008/09/21 19:11:46 tai Exp $
2 // Copyright (C) 2008 Tai Sakuma <sakuma@bnl.gov>
3 #include "StjTrgDisableTowerHT.h"
4 
5 #include <iostream>
6 
7 ClassImp(StjTrgDisableTowerHT)
8 
9 using namespace std;
10 
11 void StjTrgDisableTowerHT::read() const
12 {
13  _towers.clear();
14  _towerDsmAdc.clear();
15  _towerAdc.clear();
16  _towerEnergy.clear();
17  _towerEt.clear();
18 
19  if( ! _src->soft() ) {
20  _passed = false;
21  return;
22  }
23 
24  vector<int> srcTowers = _src->towers();
25  vector<int> srcTowerDsmAdc = _src->towerDsmAdc();
26  vector<unsigned int> srcTowerAdc = _src->towerAdc();
27  vector<double> srcTowerEnergy = _src->towerEnergy();
28  vector<double> srcTowerEt = _src->towerEt();
29 
30  for(size_t i = 0; i != srcTowers.size(); ++i) {
31  _towers.push_back(srcTowers[i]);
32  _towerDsmAdc.push_back(srcTowerDsmAdc[i]);
33  _towerAdc.push_back(srcTowerAdc[i]);
34  if( _badTowerIdSet.count(srcTowers[i]) )
35  {
36  _towerEnergy.push_back(0.0);
37  _towerEt.push_back(0.0);
38  }
39  else
40  {
41  _towerEnergy.push_back(srcTowerEnergy[i]);
42  _towerEt.push_back(srcTowerEt[i]);
43  }
44  }
45 
46  _passed = ( ! _towers.empty() );
47 }
48 
49 bool StjTrgDisableTowerHT::soft() const
50 {
51  readIfNewEvent();
52  return _passed;
53 }
54 
55 vector<int> StjTrgDisableTowerHT::towers()
56 {
57  readIfNewEvent();
58  return _towers;
59 }
60 
61 vector<int> StjTrgDisableTowerHT::towerDsmAdc()
62 {
63  readIfNewEvent();
64  return _towerDsmAdc;
65 }
66 
67 vector<unsigned int> StjTrgDisableTowerHT::towerAdc()
68 {
69  readIfNewEvent();
70  return _towerAdc;
71 }
72 
73 vector<double> StjTrgDisableTowerHT::towerEnergy()
74 {
75  readIfNewEvent();
76  return _towerEnergy;
77 }
78 
79 vector<double> StjTrgDisableTowerHT::towerEt()
80 {
81  readIfNewEvent();
82  return _towerEt;
83 }
84