Exemple #1
0
const ElectronCollection TopPairEMuReferenceSelection::signalElectrons(const EventPtr event) const {

	const MuonCollection muons(goodMuons(event));
	const ElectronCollection electrons(goodElectrons(event));
	ElectronCollection signalElectrons;


	double ptMax = 0;
	int storeIndexA = -1;

//	    cout << "loop for max pt, muons: " << muons.size() << "electrons: " << electrons.size() << endl;
	if(electrons.size() >= 1 && muons.size() >= 1){
		for (unsigned int indexA = 0; indexA < electrons.size(); ++indexA) {
		const ElectronPointer electron(electrons.at(indexA));
				for (unsigned int indexB = 0; indexB < muons.size(); ++indexB) {
					const MuonPointer muon(muons.at(indexB));
					if((electron->charge()*muon->charge() < 0) && ((electron->pt()+muon->pt())>ptMax)){
						ptMax = electron->pt()+muon->pt();
						storeIndexA = indexA;
					}
				}
	}
	
	if(storeIndexA != -1)
    		signalElectrons.push_back(electrons.at(storeIndexA));

	}

	return signalElectrons;

}
Exemple #2
0
bool TopPairEMuReferenceSelection::passesZmassVeto(const EventPtr event) const {

	const ElectronCollection electrons(signalElectrons(event));
	const MuonCollection muons(signalMuons(event));
	ElectronCollection electronColl;
	MuonCollection muonColl;

	
	double ptMax = 0;
	int storeIndexA = -1;
	int storeIndexB = -1;
	if(electrons.size() >= 1 && muons.size() >= 1){
		for (unsigned int indexA = 0; indexA < electrons.size(); ++indexA) {
		const ElectronPointer electron(electrons.at(indexA));
				for (unsigned int indexB = 0; indexB < muons.size(); ++indexB) {
					const MuonPointer muon(muons.at(indexB));
					if((electron->charge() == -muon->charge()) && ((electron->pt()+muon->pt())>ptMax)){
						ptMax = electron->pt()+muon->pt();
						storeIndexA = indexA;
						storeIndexB = indexB;
					}
				}

		if(storeIndexA != storeIndexB){
		
			electronColl.push_back(electrons.at(storeIndexA));
			muonColl.push_back(muons.at(storeIndexB));	
		}

		}
	}
	
	ElectronPointer electron = electronColl.front();
	MuonPointer muon = muonColl.front();
	
	double mass = 0;

 	ParticlePointer dilepton;
 	dilepton = ParticlePointer(new Particle(*electron + *muon));
 	mass = dilepton->mass();
	

	return mass < 76 || mass > 106;

}