void ClosestLepton::AddLepton(const Lepton& lepton) { INFO0; if (Close<Lepton>(lepton)(jet_) && lepton.Pt() > Pt()) lepton_ = lepton; }
void ChargedHiggsTauNu::analyzeGen(Event*e, string systname) { // no systematics shifts for this if (systname !="" and systname != "NONE") return; string label = GetLabel(e); Weight* w = e->GetWeight(); // make sure we don't book sf or corrections here double mcWeight=w->GetBareMCWeight() * w->GetBarePUWeight()* w->GetBareMCXsec() * w->GetBareLumi() / w->GetBareNevents(); Fill("ChargedHiggsTauNu/Gen/CutFlow_"+label,systname,0,mcWeight); // find the H+ int iHpm=-1; int iTau=-1; int iLFromTau=-1; // find leptonic taus int iIsoL = -1; // is there an isolated lepton ? for(unsigned i = 0 ; ;++i) { GenParticle *g = e->GetGenParticle(i); if (g==NULL) break; //exit condition int apdg = abs(g->GetPdgId()); if (iHpm <0 and apdg == 37 ) { iHpm = i; } if (iTau <0 and apdg == 15 ) { iTau = i; } if (iLFromTau <0 and (apdg == 11 or apdg == 13) and e->GenParticleDecayedFrom(i,15) ) { iLFromTau = i; } if (iIsoL <0 and (apdg == 11 or apdg == 13) and g->IsPromptFinalState() and g->Pt() >10 and abs(g->Eta())<2.4){ float iso = 0.0; for(unsigned j = 0 ; ;++j) { if (i == j ) continue; // no double counting; GenParticle *g2 = e->GetGenParticle(j); if (g2 == NULL) break; if (not g2->IsPromptFinalState()) continue; if (g2->IsDressed() ) continue; // no dressed leptons if (g2->DeltaR(g) >0.1) continue; iso += g2->Pt(); } if (iso<10) iIsoL = i; } } bool lepVeto=false; if (e->Nleps() ==0 ) lepVeto=true; else if( e->GetMuon(0) == NULL){ // no 10 GeV muon if (e->GetElectron(0) !=NULL and e->GetElectron(0)->Pt() <15) lepVeto=true; // pt ordered } vector<Lepton*> miniIsoLeptons; bool lepVetoMiniIso=true; for(unsigned il=0 ; ;++il) { Lepton *l = e->GetBareLepton(il); if (l == NULL) break; // exit strategy // selection if (l->Pt() <10 ) continue; //l->SetIsoRelCut(0.25); if (abs(l->Eta()) >2.4) continue; //medium id if( not l->GetMediumId() ) continue; //MINI-ISO if( l->MiniIsolation() >0.4 ) continue;//loose // for muons require tracker and global if (l->IsMuonDirty() and not l->GetTrackerMuon()) continue; if (l->IsMuonDirty() and not l->GetGlobalMuon()) continue; // selected leptons miniIsoLeptons.push_back(l); lepVetoMiniIso=false; } // sort miniIsoLeptons by pt std::sort(miniIsoLeptons.begin(),miniIsoLeptons.end(),[](Lepton const *a, Lepton const *b ){return a->Pt() > b->Pt();}); if (iHpm >=0 ) Fill("ChargedHiggsTauNu/Gen/CutFlow_"+label,systname,1,mcWeight); if (iHpm >=0 and iTau>=0 ) Fill("ChargedHiggsTauNu/Gen/CutFlow_"+label,systname,2,mcWeight); if (iHpm >=0 and iTau>=0 and iLFromTau<0){ Fill("ChargedHiggsTauNu/Gen/CutFlow_"+label,systname,3,mcWeight); if (iIsoL <0) Fill("ChargedHiggsTauNu/Gen/CutFlow_"+label,systname,4,mcWeight); if (lepVeto) Fill("ChargedHiggsTauNu/Gen/CutFlow_"+label,systname,5,mcWeight); if (lepVetoMiniIso ) Fill("ChargedHiggsTauNu/Gen/CutFlow_"+label,systname,6,mcWeight); } }