StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StjTrgRaiseThresholdEtHT.cxx
1 // $Id: StjTrgRaiseThresholdEtHT.cxx,v 1.2 2008/08/21 22:23:03 tai Exp $
2 // Copyright (C) 2008 Tai Sakuma <sakuma@bnl.gov>
3 #include "StjTrgRaiseThresholdEtHT.h"
4 
5 #include <iostream>
6 
8 
9 using namespace std;
10 
11 void StjTrgRaiseThresholdEtHT::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  if(srcTowerEt[i] < _minEt) continue;
32 
33  _towers.push_back(srcTowers[i]);
34  _towerDsmAdc.push_back(srcTowerDsmAdc[i]);
35  _towerAdc.push_back(srcTowerAdc[i]);
36  _towerEnergy.push_back(srcTowerEnergy[i]);
37  _towerEt.push_back(srcTowerEt[i]);
38  }
39 
40  _passed = ( ! _towers.empty() );
41 }
42 
43 bool StjTrgRaiseThresholdEtHT::soft() const
44 {
45  readIfNewEvent();
46  return _passed;
47 }
48 
49 vector<int> StjTrgRaiseThresholdEtHT::towers()
50 {
51  readIfNewEvent();
52  return _towers;
53 }
54 
55 vector<int> StjTrgRaiseThresholdEtHT::towerDsmAdc()
56 {
57  readIfNewEvent();
58  return _towerDsmAdc;
59 }
60 
61 vector<unsigned int> StjTrgRaiseThresholdEtHT::towerAdc()
62 {
63  readIfNewEvent();
64  return _towerAdc;
65 }
66 
67 vector<double> StjTrgRaiseThresholdEtHT::towerEnergy()
68 {
69  readIfNewEvent();
70  return _towerEnergy;
71 }
72 
73 vector<double> StjTrgRaiseThresholdEtHT::towerEt()
74 {
75  readIfNewEvent();
76  return _towerEt;
77 }
78