7 src_(iConfig.getParameter<
edm::InputTag>(
"src")),
8 idMotherX_(iConfig.getParameter<vector<
int> >(
"idMotherX")),
9 idDaughterF_(iConfig.getParameter<vector<
int> >(
"idDaughterF")),
10 idMotherY_(iConfig.getParameter<vector<
int> >(
"idMotherY")),
11 idDaughterG_(iConfig.getParameter<vector<
int> >(
"idDaughterG")),
12 xTotal_(0), xSumPt_(0.), xSumR_(0.), xSumCtau_(0.), totalEvents_(0),rejectedEvents_(0)
25 unsigned int numX = 0;
26 unsigned int numY = 0;
27 unsigned int numXorY = 0;
34 if (isXtoFFbar) numX++;
39 if (numX >= 1)
return true;
45 if (isYtoGGbar) numY++;
46 if (isXtoFFbar || isYtoGGbar) numXorY++;
49 if (numX >= 1 && numY >= 1 && numXorY >= 2)
return true;
60 const vector<int>& idMother,
61 const vector<int>& idDaughter) {
63 bool isXtoFFbar =
false;
64 int pdgIdMoth = moth->pdgId();
67 if (this->
found(idMother, pdgIdMoth)) {
69 bool foundFbar =
false;
70 unsigned int nDau = moth->numberOfDaughters();
72 for (
unsigned int i = 0;
i < nDau;
i++) {
74 int pdgIdDau = dau->pdgId();
75 if (this->
found(idDaughter, -pdgIdDau)) foundFbar =
true;
76 if (this->
found(idDaughter, pdgIdDau)) {foundF =
true;
81 rho = dau->vertex().Rho();
83 for (
unsigned int j = 0; j < dau->numberOfDaughters(); j++) {
85 if (granddau->pdgId() == pdgIdDau) rho = granddau->vertex().Rho();
89 if (foundF && foundFbar) isXtoFFbar =
true;
97 xSumCtau_ += rho*(moth->mass()/(moth->pt()+0.01));
105 cout<<
"=== XtoFFbarFilter statistics of selected X->ffbar or Y->ggbar"<<endl;
110 cout<<
"=== WARNING: NONE FOUND !"<<endl;
bool found(const std::vector< int > &v, int j)
XtoFFbarFilter(const edm::ParameterSet &)
unsigned int rejectedEvents_
std::vector< int > idMotherX_
std::vector< int > idMotherY_
unsigned int totalEvents_
std::vector< int > idDaughterG_
edm::Handle< reco::GenParticleCollection > genParticles_
std::vector< int > idDaughterF_
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
bool filter(edm::Event &iEvent, const edm::EventSetup &iSetup) override
bool foundXtoFFbar(const reco::GenParticleRef &moth, const std::vector< int > &idMotherX, const std::vector< int > &idDaughterF)