Example #1
0
const PhotonCollection TopPairEMuReferenceSelection::AllPhotonsPreSelection(const EventPtr event) const {
	
	const PhotonCollection allPhotons(event->Photons());
	PhotonCollection AllPhotonsPreSelection;
	for (unsigned int index = 0; index < allPhotons.size(); ++index) {
		const PhotonPointer photon(allPhotons.at(index));
		AllPhotonsPreSelection.push_back(photon);
	}
	
	return AllPhotonsPreSelection; 
}
Example #2
0
const PhotonCollection TopPairEMuReferenceSelection::signalPhotons(const EventPtr event) const {

	const PhotonCollection allPhotons(event->Photons());
	PhotonCollection goodIsolatedPhotons;
	for (unsigned int index = 0; index < allPhotons.size(); ++index) {
		const PhotonPointer photon(allPhotons.at(index));
		if (isGoodPhoton(photon, event)){
			goodIsolatedPhotons.push_back(photon);
		}
	}

	return goodIsolatedPhotons;

} 
Example #3
0
const PhotonCollection TopPairEMuReferenceSelection::nMinusOnePhotons(const EventPtr event, TString cut) const {

	const PhotonCollection allPhotons(event->Photons());
	PhotonCollection nMinusOnePhotons;
	for (unsigned int index = 0; index < allPhotons.size(); ++index) {
		const PhotonPointer photon(allPhotons.at(index));
		if (isNminusOnePhoton(photon, event, cut)){
			nMinusOnePhotons.push_back(photon);
		}
	}

	return nMinusOnePhotons;

}
void PhotonAnalyser::analyse(const EventPtr event){

	histMan_->setCurrentHistogramFolder(histogramFolder_ + "/AllPhotons");

	//const ElectronCollection electrons = topEERefSelection_->goodElectrons(event);
	//const MuonCollection muons = topMuMuRefSelection_->goodMuons(event);

	weight_ = event->weight() * prescale_ * scale_;
	const JetCollection jets = event->Jets();
	const ElectronCollection electrons = event->Electrons();
	const PhotonCollection photons = event->Photons();
	const MuonCollection muons = event->Muons();

	histMan_->H1D_BJetBinned("Number_Of_Photons")->Fill(photons.size(), weight_);

	for (unsigned int index = 0; index < photons.size(); ++index) {
		const PhotonPointer photon(photons.at(index));
		histMan_->H1D_BJetBinned("Photon_Pt")->Fill(photon->pt(), weight_);
		histMan_->H1D_BJetBinned("Photon_Eta")->Fill(photon->eta(), weight_);
		histMan_->H1D_BJetBinned("Photon_AbsEta")->Fill(fabs(photon->eta()), weight_);
		histMan_->H1D_BJetBinned("Photon_Phi")->Fill(photon->phi(), weight_);
		histMan_->H1D_BJetBinned("Photon_ET")->Fill(photon->et(), weight_);
		
		if (photon->isInEndCapRegion()){
			histMan_->H1D_BJetBinned("Photon_sigma_ietaieta_endcap")->Fill(photon->sigmaIEtaIEta(), weight_);
			histMan_->H1D_BJetBinned("Photon_PFChargedHadronIso_endcap")->Fill(photon->PFChargedHadronIso(), weight_);
			histMan_->H1D_BJetBinned("Photon_PFNeutralHadronIso_endcap")->Fill(photon->PFNeutralHadronIso(), weight_);
			histMan_->H1D_BJetBinned("Photon_PFPhotonIso_endcap")->Fill(photon->PFPhotonIso(), weight_);
			histMan_->H1D_BJetBinned("Photon_RhoCorrectedPFChargedHadronIso_endcap")->Fill(photon->RhoCorrectedPFChargedHadronIso(event->rho()), weight_);
			histMan_->H1D_BJetBinned("Photon_RhoCorrectedPFNeutralHadronIso_endcap")->Fill(photon->RhoCorrectedPFNeutralHadronIso(event->rho()), weight_);
			histMan_->H1D_BJetBinned("Photon_RhoCorrectedPFPhotonIso_endcap")->Fill(photon->RhoCorrectedPFPhotonIso(event->rho()), weight_);
			histMan_->H1D_BJetBinned("Photon_SCChIso_endcap")->Fill(photon->phoSCChIso(), weight_);
			histMan_->H1D_BJetBinned("Photon_SCNuIso_endcap")->Fill(photon->phoSCNuIso(), weight_);
			histMan_->H1D_BJetBinned("Photon_SCPhIso_endcap")->Fill(photon->phoSCPhIso(), weight_);
			histMan_->H1D_BJetBinned("Photon_RhoCorrectedSCChIso_endcap")->Fill(photon->RhoCorrectedSCChIso(event->rho()), weight_);
			histMan_->H1D_BJetBinned("Photon_RhoCorrectedSCNuIso_endcap")->Fill(photon->RhoCorrectedSCNuIso(event->rho()), weight_);
			histMan_->H1D_BJetBinned("Photon_RhoCorrectedSCPhIso_endcap")->Fill(photon->RhoCorrectedSCPhIso(event->rho()), weight_);
			
			histMan_->H2D_BJetBinned("RhoCorrectedSCFRChIso_v._Sigma_ietaieta_endcap")->Fill(photon->RhoCorrectedSCChIso(event->rho()), photon->sigmaIEtaIEta(), weight_);
			
		} else if (photon->isInBarrelRegion()) {
			histMan_->H1D_BJetBinned("Photon_sigma_ietaieta_barrel")->Fill(photon->sigmaIEtaIEta(), weight_);
			histMan_->H1D_BJetBinned("Photon_PFChargedHadronIso_barrel")->Fill(photon->PFChargedHadronIso(), weight_);
			histMan_->H1D_BJetBinned("Photon_PFNeutralHadronIso_barrel")->Fill(photon->PFNeutralHadronIso(), weight_);
			histMan_->H1D_BJetBinned("Photon_PFPhotonIso_barrel")->Fill(photon->PFPhotonIso(), weight_);
			histMan_->H1D_BJetBinned("Photon_RhoCorrectedPFChargedHadronIso_barrel")->Fill(photon->RhoCorrectedPFChargedHadronIso(event->rho()), weight_);
			histMan_->H1D_BJetBinned("Photon_RhoCorrectedPFNeutralHadronIso_barrel")->Fill(photon->RhoCorrectedPFNeutralHadronIso(event->rho()), weight_);
			histMan_->H1D_BJetBinned("Photon_RhoCorrectedPFPhotonIso_barrel")->Fill(photon->RhoCorrectedPFPhotonIso(event->rho()), weight_);
			histMan_->H1D_BJetBinned("Photon_SCChIso_barrel")->Fill(photon->phoSCChIso(), weight_);
			histMan_->H1D_BJetBinned("Photon_SCNuIso_barrel")->Fill(photon->phoSCNuIso(), weight_);
			histMan_->H1D_BJetBinned("Photon_SCPhIso_barrel")->Fill(photon->phoSCPhIso(), weight_);
			histMan_->H1D_BJetBinned("Photon_RhoCorrectedSCChIso_barrel")->Fill(photon->RhoCorrectedSCChIso(event->rho()), weight_);
			histMan_->H1D_BJetBinned("Photon_RhoCorrectedSCNuIso_barrel")->Fill(photon->RhoCorrectedSCNuIso(event->rho()), weight_);
			histMan_->H1D_BJetBinned("Photon_RhoCorrectedSCPhIso_barrel")->Fill(photon->RhoCorrectedSCPhIso(event->rho()), weight_);
			histMan_->H1D_BJetBinned("Photon_RandConeChIso_barrel")->Fill(photon->phoRandConeChIso(), weight_);
			histMan_->H1D_BJetBinned("Photon_RandConeNuIso_barrel")->Fill(photon->phoRandConeNuIso(), weight_);
			histMan_->H1D_BJetBinned("Photon_RandConePhIso_barrel")->Fill(photon->phoRandConePhIso(), weight_);
			
			histMan_->H2D_BJetBinned("RhoCorrectedSCFRChIso_v._Sigma_ietaieta_barrel")->Fill(photon->RhoCorrectedSCChIso(event->rho()), photon->sigmaIEtaIEta(), weight_);
		}
			
		histMan_->H1D_BJetBinned("Photon_HadOverEM")->Fill(photon->HadOverEm(), weight_);
		histMan_->H1D_BJetBinned("Photon_EcalIso")->Fill(photon->ecalIsolation(), weight_);
		histMan_->H1D_BJetBinned("Photon_HcalIso")->Fill(photon->hcalIsolation(), weight_);
		histMan_->H1D_BJetBinned("Photon_HcalIso2012")->Fill(photon->hcalIsolation2012(), weight_);
		histMan_->H1D_BJetBinned("Photon_TrckIso")->Fill(photon->trackerIsolation(), weight_);
		histMan_->H1D_BJetBinned("Photon_SCeta")->Fill(photon->superClusterEta(), weight_);
		histMan_->H1D_BJetBinned("Photon_SCphi")->Fill(photon->superClusterPhi(), weight_);
		histMan_->H1D_BJetBinned("Photon_SCenergy")->Fill(photon->superClusterEnergy(), weight_);
		histMan_->H1D_BJetBinned("Photon_SCSeedEnergy")->Fill(photon->superClusterSeedEnergy(), weight_);
		histMan_->H1D_BJetBinned("Photon_E3x3")->Fill(photon->Ecal3x3Cluster(), weight_);
		histMan_->H1D_BJetBinned("Photon_E5x5")->Fill(photon->Ecal5x5Cluster(), weight_);
		histMan_->H1D_BJetBinned("Photon_TrkVeto")->Fill(photon->TrackVeto(), weight_);
		histMan_->H1D_BJetBinned("Photon_ConvSEVeto")->Fill(photon->ConversionSafeElectronVeto(), weight_);
		histMan_->H1D_BJetBinned("Photon_HtowoE")->Fill(photon->SingleTowerHoE(), weight_);
		histMan_->H1D_BJetBinned("Photon_PFChargedHadronIso")->Fill(photon->PFChargedHadronIso(), weight_);
		histMan_->H1D_BJetBinned("Photon_PFNeutralHadronIso")->Fill(photon->PFNeutralHadronIso(), weight_);
		histMan_->H1D_BJetBinned("Photon_PFPhotonIso")->Fill(photon->PFPhotonIso(), weight_);
		histMan_->H1D_BJetBinned("Photon_SCChIso")->Fill(photon->phoSCChIso(), weight_);
		histMan_->H1D_BJetBinned("Photon_SCNuIso")->Fill(photon->phoSCNuIso(), weight_);
		histMan_->H1D_BJetBinned("Photon_SCPhIso")->Fill(photon->phoSCPhIso(), weight_);
		histMan_->H1D_BJetBinned("Photon_RandConeChIso")->Fill(photon->phoRandConeChIso(), weight_);
		histMan_->H1D_BJetBinned("Photon_RandConeNuIso")->Fill(photon->phoRandConeNuIso(), weight_);
		histMan_->H1D_BJetBinned("Photon_RandConePhIso")->Fill(photon->phoRandConePhIso(), weight_);
		histMan_->H1D_BJetBinned("Photon_RhoCorrectedSCChIso")->Fill(photon->RhoCorrectedSCChIso(event->rho()), weight_);
		histMan_->H1D_BJetBinned("Photon_RhoCorrectedSCNuIso")->Fill(photon->RhoCorrectedSCNuIso(event->rho()), weight_);
		histMan_->H1D_BJetBinned("Photon_RhoCorrectedSCPhIso")->Fill(photon->RhoCorrectedSCPhIso(event->rho()), weight_);
		
		histMan_->H2D_BJetBinned("RhoCorrectedSCFRChIso_v._Sigma_ietaieta")->Fill(photon->RhoCorrectedSCChIso(event->rho()), photon->sigmaIEtaIEta(), weight_);
		
		for (unsigned int index = 0; index < jets.size(); ++index) { 
			const JetPointer jet(jets.at(index));
			histMan_->H1D_BJetBinned("Photon_deltaR_jets")->Fill(photon->deltaR(jet), weight_);
		}
		
		for (unsigned int index = 0; index < electrons.size(); ++index) { 
			const ElectronPointer electron(electrons.at(index));
			histMan_->H1D_BJetBinned("Photon_deltaR_electrons")->Fill(photon->deltaR(electron), weight_);
		}
	
		for (unsigned int index = 0; index < muons.size(); ++index) { 
			const MuonPointer muon(muons.at(index));
			histMan_->H1D_BJetBinned("Photon_deltaR_muons")->Fill(photon->deltaR(muon), weight_);
		}
	}

}