StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StjTrgRaiseThresholdEtJP.cxx
1 // $Id: StjTrgRaiseThresholdEtJP.cxx,v 1.2 2008/08/21 22:23:04 tai Exp $
2 // Copyright (C) 2008 Tai Sakuma <sakuma@bnl.gov>
3 #include "StjTrgRaiseThresholdEtJP.h"
4 
5 #include <iostream>
6 
8 
9 using namespace std;
10 
11 void StjTrgRaiseThresholdEtJP::read() const
12 {
13  _jetPatches.clear();
14  _jetPatchDsmAdc.clear();
15  _jetPatchAdc.clear();
16  _jetPatchEnergy.clear();
17  _jetPatchEt.clear();
18 
19  if( ! _src->soft() ) {
20  _passed = false;
21  return;
22  }
23 
24  vector<int> srcJetPatchs = _src->jetPatches();
25  vector<int> srcJetPatchDsmAdc = _src->jetPatchDsmAdc();
26  vector<unsigned int> srcJetPatchAdc = _src->jetPatchAdc();
27  vector<double> srcJetPatchEnergy = _src->jetPatchEnergy();
28  vector<double> srcJetPatchEt = _src->jetPatchEt();
29 
30  for(size_t i = 0; i != srcJetPatchs.size(); ++i) {
31  if(srcJetPatchEt[i] < _minEt) continue;
32 
33  _jetPatches.push_back(srcJetPatchs[i]);
34  _jetPatchDsmAdc.push_back(srcJetPatchDsmAdc[i]);
35  _jetPatchAdc.push_back(srcJetPatchAdc[i]);
36  _jetPatchEnergy.push_back(srcJetPatchEnergy[i]);
37  _jetPatchEt.push_back(srcJetPatchEt[i]);
38  }
39 
40  _passed = ( ! _jetPatches.empty() );
41 }
42 
43 bool StjTrgRaiseThresholdEtJP::soft() const
44 {
45  readIfNewEvent();
46  return _passed;
47 }
48 
49 vector<int> StjTrgRaiseThresholdEtJP::jetPatches()
50 {
51  readIfNewEvent();
52  return _jetPatches;
53 }
54 
55 vector<int> StjTrgRaiseThresholdEtJP::jetPatchDsmAdc()
56 {
57  readIfNewEvent();
58  return _jetPatchDsmAdc;
59 }
60 
61 vector<unsigned int> StjTrgRaiseThresholdEtJP::jetPatchAdc()
62 {
63  readIfNewEvent();
64  return _jetPatchAdc;
65 }
66 
67 vector<double> StjTrgRaiseThresholdEtJP::jetPatchEnergy()
68 {
69  readIfNewEvent();
70  return _jetPatchEnergy;
71 }
72 
73 vector<double> StjTrgRaiseThresholdEtJP::jetPatchEt()
74 {
75  readIfNewEvent();
76  return _jetPatchEt;
77 }
78