Ejemplo n.º 1
0
bool TopPairEMuReferenceSelection::isGoodPhoton(const PhotonPointer photon, const EventPtr event) const {
	
	bool passesEtAndEta = photon->et() > 25 && fabs(photon->eta()) < 1.4442 && !photon->isInCrack();
	bool passesSafeElectronVeto = photon->ConversionSafeElectronVeto();
	bool passesHOverE = photon->SingleTowerHoE() < 0.05; // same for EE and EB
	
//	bool passesShowerShape = false;
//	bool passesPFChargedIso = false;
	bool passesPFNeutralIso = false;
	bool passesPFPhotonIso = false;
	bool passesphoSCChIso = false;
//	bool passesphoSCNuIso = false;
//	bool passesphoSCPhIso = false;
	
	if (photon->isInBarrelRegion()) {
//		passesShowerShape = photon->sigmaIEtaIEta() < 0.012;
//		passesPFChargedIso = photon->RhoCorrectedPFChargedHadronIso(event->rho()) < 2.6;
		passesPFNeutralIso = photon->RhoCorrectedPFNeutralHadronIso(event->rho()) < 7.5 + 0.04 * photon->pt(); //3.5
		passesPFPhotonIso = photon->RhoCorrectedPFPhotonIso(event->rho()) < 5 + 0.005 * photon->pt(); //1.3
		passesphoSCChIso = photon->RhoCorrectedSCChIso(event->rho()) < 5;
//		passesphoSCNuIso = photon->RhoCorrectedSCNuIso(event->rho()) < 3.5 + 0.04 * photon->pt();
//		passesphoSCPhIso = photon->RhoCorrectedSCPhIso(event->rho()) < 1.3 + 0.005 * photon->pt();
	} else if (photon->isInEndCapRegion()) {
//		passesShowerShape = photon->sigmaIEtaIEta() < 0.034;
//		passesPFChargedIso = photon->RhoCorrectedPFChargedHadronIso(event->rho()) < 2.3;
		passesPFNeutralIso = photon->RhoCorrectedPFNeutralHadronIso(event->rho()) < 2.9 + 0.04 * photon->pt();
		passesPFPhotonIso = photon->RhoCorrectedPFPhotonIso(event->rho()) < 1.5 + 0.005 * photon->pt();
		passesphoSCChIso = photon->RhoCorrectedSCChIso(event->rho()) < 2.3;
//		passesphoSCNuIso = photon->RhoCorrectedSCNuIso(event->rho()) < 2.9 + 0.04 * photon->pt();
//		passesphoSCPhIso = photon->RhoCorrectedSCPhIso(event->rho()) < 1.5 + 0.005 * photon->pt();
	}
	
	const ElectronCollection electrons(goodElectrons(event));
	const MuonCollection muons(goodMuons(event));
	const JetCollection jets(event->Jets());;

	   bool passesDeltaRgammaMuons = false;

	 	for (unsigned int index = 0; index < muons.size(); ++index) {
	 			const MuonPointer muon(muons.at(index));
	 			passesDeltaRgammaMuons = photon->deltaR(muon) > 0.3;
				
				if(photon->deltaR(muon) < 0.3)
				break;
	 	}

	 	bool passesDeltaRgammaElectrons = false;

	 	 	for (unsigned int index = 0; index < electrons.size(); ++index) {
	 	 		const ElectronPointer electron(electrons.at(index));
	 	 		passesDeltaRgammaElectrons = photon->deltaR(electron) > 0.3;
					
				if(photon->deltaR(electron) < 0.3)
				break;	
	  	}
		
	bool passesDeltaRgammaJets = false;
	
	for (unsigned int index = 0; index < jets.size(); ++index) { 
			const JetPointer jet(jets.at(index));
			passesDeltaRgammaJets = photon->deltaR(jet) > 0.3;
	}	
		
	bool passesDeltaRjetsElectrons = false;

	 for (unsigned int index = 0; index < electrons.size(); ++index) {
	 		const ElectronPointer electron(electrons.at(index));
			for(unsigned int jindex = 0; jindex<jets.size(); ++jindex){
				const JetPointer jet(jets[jindex]);
	 			passesDeltaRjetsElectrons = electron->deltaR(jet) > 0.3;
			}	

	}

	bool passesDeltaRjetsMuons = false;

	 for (unsigned int index = 0; index < muons.size(); ++index) {
	 		const MuonPointer muon(muons.at(index));
			for(unsigned int jindex = 0; jindex<jets.size(); ++jindex){
				const JetPointer jet(jets[jindex]);
	 			passesDeltaRjetsMuons = muon->deltaR(jet) > 0.3;
			}	

	}

	return passesEtAndEta && passesSafeElectronVeto && passesHOverE /*&& passesShowerShape*/  && passesPFNeutralIso && passesPFPhotonIso && passesphoSCChIso && passesDeltaRgammaElectrons && 
	passesDeltaRgammaMuons && passesDeltaRgammaJets && passesDeltaRjetsMuons && passesDeltaRjetsElectrons; 
}
Ejemplo n.º 2
0
bool TopPairEMuReferenceSelection::isNminusOnePhoton(const PhotonPointer photon, const EventPtr event, TString cut) const {

	const ElectronCollection electrons(goodElectrons(event));
	const MuonCollection muons(goodMuons(event));
	const JetCollection jets(event->Jets());

	bool passesEtAndEta = photon->et() > 25 && fabs(photon->eta()) < 2.5 && !photon->isInCrack();
	bool passesSafeElectronVeto = photon->ConversionSafeElectronVeto();
	bool passesHOverE = photon->SingleTowerHoE() < 0.05; // same for EE and EB
	
	bool passesShowerShape = false;
//	bool passesPFChargedIso = false;
	bool passesPFNeutralIso = false;
	bool passesPFPhotonIso = false;
	bool passesphoSCChIso = false;

	bool backgroundShape = false;
	
	if (photon->isInBarrelRegion()) {
		passesShowerShape = photon->sigmaIEtaIEta() < 0.012;
//		passesPFChargedIso = photon->RhoCorrectedPFChargedHadronIso(event->rho()) < 2.6;
		passesPFNeutralIso = photon->RhoCorrectedPFNeutralHadronIso(event->rho()) < 3.5 + 0.04 * photon->pt();
		passesPFPhotonIso = photon->RhoCorrectedPFPhotonIso(event->rho()) < 1.3 + 0.005 * photon->pt();
		passesphoSCChIso = photon->RhoCorrectedSCChIso(event->rho()) < 20;

		backgroundShape = photon->sigmaIEtaIEta() > 0.012 && photon->sigmaIEtaIEta() < 0.029;
		
	} else if (photon->isInEndCapRegion()) {
		passesShowerShape = photon->sigmaIEtaIEta() < 0.034;
//		passesPFChargedIso = photon->RhoCorrectedPFChargedHadronIso(event->rho()) < 2.3;
		passesPFNeutralIso = photon->RhoCorrectedPFNeutralHadronIso(event->rho()) < 2.9 + 0.04 * photon->pt();
		passesPFPhotonIso = photon->RhoCorrectedPFPhotonIso(event->rho()) < 1.5 + 0.005 * photon->pt();
		passesphoSCChIso = photon->RhoCorrectedSCChIso(event->rho()) < 20;
		
		backgroundShape = photon->sigmaIEtaIEta() > 0.012 && photon->sigmaIEtaIEta() < 0.029;
	}


	   bool passesDeltaRgammaMuons = false;

	 	for (unsigned int index = 0; index < muons.size(); ++index) {
	 			const MuonPointer muon(muons.at(index));
	 			passesDeltaRgammaMuons = photon->deltaR(muon) > 0.5;
				
				if(photon->deltaR(muon) < 0.5)
				break;
	 	}

	 	bool passesDeltaRgammaElectrons = false;

	 	 	for (unsigned int index = 0; index < electrons.size(); ++index) {
	 	 		const ElectronPointer electron(electrons.at(index));
	 	 		passesDeltaRgammaElectrons = photon->deltaR(electron) > 0.7;
					
				if(photon->deltaR(electron) < 0.7)
				break;	
	  	}
		
	bool passesDeltaRgammaJets = false;
	
	for (unsigned int index = 0; index < jets.size(); ++index) { 
			const JetPointer jet(jets.at(index));
			passesDeltaRgammaJets = photon->deltaR(jet) > 0.7;
	}	
		
	bool passesDeltaRjetsElectrons = false;

	 for (unsigned int index = 0; index < electrons.size(); ++index) {
	 		const ElectronPointer electron(electrons.at(index));
			for(unsigned int jindex = 0; jindex<jets.size(); ++jindex){
				const JetPointer jet(jets[jindex]);
	 			passesDeltaRjetsElectrons = electron->deltaR(jet) > 0.5;
			}	

	}

	bool passesDeltaRjetsMuons = false;

	 for (unsigned int index = 0; index < muons.size(); ++index) {
	 		const MuonPointer muon(muons.at(index));
			for(unsigned int jindex = 0; jindex<jets.size(); ++jindex){
				const JetPointer jet(jets[jindex]);
	 			passesDeltaRjetsMuons = muon->deltaR(jet) > 0.5;
			}	

	}

		if(cut == "passesEtAndEta")
			return passesSafeElectronVeto && passesHOverE && passesShowerShape && passesPFNeutralIso && passesPFPhotonIso && passesDeltaRgammaElectrons && 
			passesDeltaRgammaMuons && passesDeltaRgammaJets && passesDeltaRjetsMuons && passesDeltaRjetsElectrons && passesphoSCChIso;
		else if(cut == "passesHOverE")
			return passesEtAndEta && passesSafeElectronVeto && passesShowerShape && passesPFNeutralIso && passesPFPhotonIso && passesDeltaRgammaElectrons && 
			passesDeltaRgammaMuons && passesDeltaRgammaJets && passesDeltaRjetsMuons && passesDeltaRjetsElectrons && passesphoSCChIso;
		else if(cut == "passesShowerShape")
			return passesEtAndEta && passesSafeElectronVeto && passesHOverE && passesPFNeutralIso && passesPFPhotonIso && passesDeltaRgammaElectrons && 
			passesDeltaRgammaMuons && passesDeltaRgammaJets && passesDeltaRjetsMuons && passesDeltaRjetsElectrons && passesphoSCChIso;
		else if(cut == "passesPFNeutralIso")
			return passesEtAndEta && passesSafeElectronVeto && passesHOverE && passesShowerShape && passesPFPhotonIso && passesDeltaRgammaElectrons && 
			passesDeltaRgammaMuons && passesDeltaRgammaJets && passesDeltaRjetsMuons && passesDeltaRjetsElectrons && passesphoSCChIso;
		else if(cut == "passesPFPhotonIso")
			return passesEtAndEta && passesSafeElectronVeto && passesHOverE && passesShowerShape && passesPFNeutralIso && passesDeltaRgammaElectrons && 
			passesDeltaRgammaMuons && passesDeltaRgammaJets && passesDeltaRjetsMuons && passesDeltaRjetsElectrons && passesphoSCChIso;
		else if(cut == "passesphoSCChIso")
			return passesEtAndEta && passesSafeElectronVeto && passesHOverE && backgroundShape && passesPFNeutralIso && passesPFPhotonIso &&
			passesDeltaRgammaElectrons && passesDeltaRgammaMuons && passesDeltaRgammaJets && passesDeltaRjetsMuons && passesDeltaRjetsElectrons;
		else if(cut == "passesDeltaRgammaMuons" && cut == "passesDeltaRgammaElectrons")
			return passesEtAndEta && passesSafeElectronVeto && passesHOverE && passesShowerShape && passesPFNeutralIso && passesPFPhotonIso && 
			passesDeltaRgammaJets && passesDeltaRjetsMuons && passesDeltaRjetsElectrons && passesphoSCChIso;
		else if(cut == "passesDeltaRjetsElectrons" && cut == "passesDeltaRjetsMuons")
			return passesEtAndEta && passesSafeElectronVeto && passesHOverE && passesShowerShape && passesPFNeutralIso && passesPFPhotonIso &&
			passesDeltaRgammaJets && passesDeltaRgammaMuons && passesDeltaRgammaElectrons && passesphoSCChIso;
		else if(cut == "passesDeltaRgammaJets")	
			return passesEtAndEta && passesSafeElectronVeto && passesHOverE && passesShowerShape && passesPFNeutralIso && passesPFPhotonIso && 
			passesDeltaRgammaElectrons && passesDeltaRgammaMuons && passesDeltaRjetsMuons && passesDeltaRjetsElectrons && passesphoSCChIso;
		else if(cut == "backgroundShape")
			return passesEtAndEta && passesSafeElectronVeto && passesHOverE && passesPFNeutralIso && passesPFPhotonIso && passesDeltaRgammaElectrons && 
			passesDeltaRgammaMuons && passesDeltaRjetsMuons && passesDeltaRjetsElectrons && passesphoSCChIso && passesDeltaRgammaJets && backgroundShape;
		else	
			return passesEtAndEta && passesSafeElectronVeto && passesHOverE && passesShowerShape && passesPFNeutralIso && passesPFPhotonIso && passesDeltaRgammaElectrons && passesDeltaRgammaMuons &&
			passesDeltaRgammaJets && passesDeltaRjetsMuons && passesDeltaRjetsElectrons && passesphoSCChIso;



}