3 #include "StjTrgSoftEtThresholdBJP.h"
5 #include "StjTowerEnergyCutEnergy.h"
6 #include "StjTowerEnergyCutBemcStatus.h"
7 #include "StjTowerEnergyPrint.h"
8 #include "StjTowerEnergyCutBemcStatus.h"
9 #include "StjTowerEnergyCutEnergy.h"
10 #include "StjTowerEnergyCutEt.h"
11 #include "StjTowerEnergyCutAdc.h"
13 #include "StjTrgBEMCJetPatchTowerIdMap.h"
30 : _bemc(bemc), _jpTowerMap(jpTowerMap), _minEt(minEt), _runNumber(-1), _eventId(-1)
38 bool StjTrgSoftEtThresholdBJP::isNewEvent()
40 if(_runNumber != _trg->runNumber())
return true;
41 if(_eventId != _trg->eventId())
return true;
45 void StjTrgSoftEtThresholdBJP::read()
47 _runNumber = _trg->runNumber();
48 _eventId = _trg->eventId();
51 _jetPatchDsmAdc.clear();
53 _jetPatchEnergy.clear();
56 StjTowerEnergyList energyList = _bemc->getEnergyList();
57 energyList = _cut(energyList);
59 map<int, StjTowerEnergyList> jpMap;
61 for(StjTowerEnergyList::const_iterator it = energyList.begin(); it != energyList.end(); ++it) {
62 int jpid = _jpTowerMap->getJetPatchIdForTower((*it).towerId);
63 if(jpid == -1)
continue;
64 jpMap[jpid].push_back(*it);
67 for(map<int, StjTowerEnergyList>::const_iterator it = jpMap.begin(); it != jpMap.end(); ++it) {
68 int jpid = (*it).first;
69 const StjTowerEnergyList& energyList = (*it).second;
70 double Et = computeEtSum(energyList);
71 if(Et <= _minEt)
continue;
72 _jetPatches.push_back(jpid);
73 _jetPatchDsmAdc.push_back(0);
74 _jetPatchAdc.push_back(0);
75 _jetPatchEnergy.push_back(0);
76 _jetPatchEt.push_back(Et);
79 _passed = ( ! _jetPatches.empty() );
83 double StjTrgSoftEtThresholdBJP::computeEtSum(
const StjTowerEnergyList& energyList)
86 for(StjTowerEnergyList::const_iterator it = energyList.begin(); it != energyList.end(); ++it) {
88 vec3.SetPtEtaPhi((*it).towerR, (*it).towerEta, (*it).towerPhi);
89 ret += ((*it).energy)*TMath::Sin(vec3.Theta());
94 bool StjTrgSoftEtThresholdBJP::soft()
96 if(isNewEvent()) read();
100 vector<int> StjTrgSoftEtThresholdBJP::jetPatches()
102 if(isNewEvent()) read();
106 vector<int> StjTrgSoftEtThresholdBJP::jetPatchDsmAdc()
108 if(isNewEvent()) read();
109 return _jetPatchDsmAdc;
112 vector<unsigned int> StjTrgSoftEtThresholdBJP::jetPatchAdc()
114 if(isNewEvent()) read();
118 vector<double> StjTrgSoftEtThresholdBJP::jetPatchEnergy()
120 if(isNewEvent()) read();
121 return _jetPatchEnergy;
124 vector<double> StjTrgSoftEtThresholdBJP::jetPatchEt()
126 if(isNewEvent()) read();