StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StjFourVecCutTrgBJP.cxx
1 // $Id: StjFourVecCutTrgBJP.cxx,v 1.1 2008/11/27 07:29:51 tai Exp $
2 // Copyright (C) 2008 Tai Sakuma <sakuma@bnl.gov>
3 #include "StjFourVecCutTrgBJP.h"
4 
5 #include <StjTrgBEMCJetPatchTowerIdMap.h>
6 
7 #include <StjTrg.h>
8 
9 #include <vector>
10 #include <algorithm>
11 #include <iostream>
12 
13 ClassImp(StjFourVecCutTrgBJP)
14 
15 using namespace std;
16 
17 bool StjFourVecCutTrgBJP::operator()(const StjFourVec& p4)
18 {
19  if(p4.type != 2) return true;
20  if(p4.detectorId != 9) return true;
21  int jp = _jetPatchTowerMap->getJetPatchIdForTower(p4.towerId);
22  vector<int> jetPatches = _trg->jetPatches();
23  vector<int>::const_iterator it = find(jetPatches.begin(), jetPatches.end(), jp);
24  if(it == jetPatches.end()) return true;
25  return false;
26 }