TtbarHypothesis::TtbarHypothesis(const LeptonPointer& elec, const ParticlePointer& neut, const JetPointer& lepBJet, const JetPointer& hadBJet, const JetPointer& hadWJet1, const JetPointer& hadWJet2) : totalChi2(99999.), leptonicChi2(99999.), hadronicChi2(99999.), globalChi2(99999.), hadronicTop(), leptonicTop(), leptonicW( new Particle(*elec + *neut)), hadronicW(new Particle(*hadWJet1 + *hadWJet2)), resonance(), neutrinoFromW( neut), leptonicBjet(lepBJet), hadronicBJet(hadBJet), jet1FromW(hadWJet1), jet2FromW(hadWJet2), leptonFromW( elec), met(new MET(neut->px(), neut->py())) { }
double Event::MT(const ParticlePointer particle, const METPointer met) { double energySquared = pow(particle->et() + met->et(), 2); double momentumSquared = pow(particle->px() + met->px(), 2) + pow(particle->py() + met->py(), 2); double MTSquared = energySquared - momentumSquared; if (MTSquared > 0) return sqrt(MTSquared); else return -1; }
TtbarHypothesis::TtbarHypothesis(const LeptonPointer& elec, const ParticlePointer& neut, const JetPointer& lepBJet, const JetPointer& hadBJet, const JetPointer& hadWJet1, const JetPointer& hadWJet2) : totalChi2(99999.), // leptonicChi2(99999.), // hadronicChi2(99999.), // globalChi2(99999.), // discriminator(999999), // hadronicTop(), // leptonicTop(), // leptonicW(new Particle(*elec + *neut)), // hadronicW(new Particle(*hadWJet1 + *hadWJet2)), // resonance(), // neutrinoFromW(neut), // leptonicBjet(lepBJet), // hadronicBJet(hadBJet), // jet1FromW(hadWJet1), // jet2FromW(hadWJet2), // leptonFromW(elec), // met(new MET(neut->px(), neut->py())), // decayChannel(Decay::unknown) { }
void PseudoTopAnalyser::analyse(const EventPtr event) { weight_ = event->weight(); treeMan_->setCurrentFolder(histogramFolder_); // Store gen selection criteria treeMan_->Fill("isSemiLeptonicElectron", event->isSemiLeptonicElectron()); treeMan_->Fill("isSemiLeptonicMuon", event->isSemiLeptonicMuon()); const PseudoTopParticlesPointer pseudoTopParticles = event->PseudoTopParticles(); const MCParticleCollection pseudoTops = pseudoTopParticles->getPseudoTops(); const MCParticlePointer pseudoLeptonicW = pseudoTopParticles->getPseudoLeptonicW(); const MCParticlePointer pseudoLepton = pseudoTopParticles->getPseudoLepton(); const ParticleCollection allPseudoLeptons = pseudoTopParticles->getAllPseudoLeptons(); const MCParticleCollection pseudoBs = pseudoTopParticles->getPseudoBs(); const ParticlePointer pseudoMET = pseudoTopParticles->getPseudoMET(); const ParticlePointer pseudoNeutrino = pseudoTopParticles->getPseudoNeutrino(); const JetCollection pseudoJets = pseudoTopParticles->getPseudoJets(); ParticleCollection pseudoTopsForTTbar; // // Only consider events with two pseudo tops // if ( pseudoTops.size() != 2 ) return; // // Also only consider events that are semi leptonic at the pseudo top level // if ( !pseudoTopParticles->isSemiLeptonic() ) return; // Check if event passes event selection (at pseudo top level) if ( passesEventSelection( pseudoLepton, pseudoNeutrino, pseudoJets, pseudoBs, allPseudoLeptons, pseudoMET ) ) { treeMan_->Fill("passesGenEventSelection",1); } else { treeMan_->Fill("passesGenEventSelection",0); } // // TOP VARIABLES // Top reco at particle level performed // // Store info on top for ( unsigned int ptIndex = 0; ptIndex < pseudoTops.size(); ++ ptIndex ) { // cout << "Getting pseudo top number : " << ptIndex << endl; const ParticlePointer pseudoTop = pseudoTops[ptIndex]; pseudoTopsForTTbar.push_back( pseudoTop ); treeMan_->Fill("pseudoTop_pT", pseudoTop->pt() ); treeMan_->Fill("pseudoTop_y", pseudoTop->rapidity() ); } if( pseudoTopsForTTbar.size() == 2 ) { // Store info on ttbar ParticlePointer pseudoTTbar( new Particle( *pseudoTopsForTTbar[0] + *pseudoTopsForTTbar[1] ) ); treeMan_->Fill("pseudoTTbar_pT", pseudoTTbar->pt() ); treeMan_->Fill("pseudoTTbar_y", pseudoTTbar->rapidity() ); treeMan_->Fill("pseudoTTbar_m", pseudoTTbar->mass() ); } // Store info on Bs if ( pseudoBs.size() == 2 ) { unsigned int leadingPsuedoBIndex = 0; if ( pseudoBs[1]->pt() > pseudoBs[0]->pt() ) { leadingPsuedoBIndex = 1; } unsigned int subleadingPsuedoBIndex = ( leadingPsuedoBIndex == 0 ) ? 1 : 0; treeMan_->Fill("pseudoB_pT", pseudoBs[leadingPsuedoBIndex]->pt() ); treeMan_->Fill("pseudoB_eta", pseudoBs[leadingPsuedoBIndex]->eta() ); treeMan_->Fill("pseudoB_pT", pseudoBs[subleadingPsuedoBIndex]->pt() ); treeMan_->Fill("pseudoB_eta", pseudoBs[subleadingPsuedoBIndex]->eta() ); // for ( unsigned int pbIndex = 0; pbIndex < pseudoBs.size(); ++pbIndex ) { // treeMan_->Fill("pseudoB_pT", pseudoBs[pbIndex]->pt() ); // treeMan_->Fill("pseudoB_eta", pseudoBs[pbIndex]->eta() ); // } } // // GLOBAL VARIABLES // No top reco at particle level // if ( allPseudoLeptons.size() > 0 ) { // Store info on lepton treeMan_->Fill("pseudoLepton_pT", allPseudoLeptons[0]->pt() ); treeMan_->Fill("pseudoLepton_eta", allPseudoLeptons[0]->eta() ); } // Store pseudo MET if ( pseudoMET != 0 ) { treeMan_->Fill("pseudoMET", pseudoMET->et() ); METAlgorithm::value metType = (METAlgorithm::value) 0; const METPointer met(event->MET(metType)); if ( pseudoMET->et() <= 0 && met->et() > 0 ) { } treeMan_->Fill("pseudoMET_mass", pseudoMET->mass() ); } // Store pseudo HT treeMan_->Fill("pseudoHT", event->HT( pseudoJets ) ); // Store pseudo ST if ( allPseudoLeptons.size() > 0 ) { treeMan_->Fill("pseudoST", event->ST( pseudoJets, allPseudoLeptons[0], METPointer( new MET( pseudoMET->px(), pseudoMET->py() )) ) ); } // Store pseudo MT and WPT // These are from the W reconstructed from the pseudo particles // i.e. use the neutrino assocaited with the W rather than the more "global" MET if ( pseudoLeptonicW != 0 ) { treeMan_->Fill("pseudoWPT_reco", pseudoLeptonicW->pt() ); } if ( pseudoMET != 0 && allPseudoLeptons.size() > 0 ) { double WPT = event->WPT( allPseudoLeptons[0], METPointer( new MET( pseudoMET->px(), pseudoMET->py() )) ); treeMan_->Fill("pseudoWPT", WPT ); double MT = event->MT( allPseudoLeptons[0], METPointer( new MET( pseudoMET->px(), pseudoMET->py() )) ); treeMan_->Fill("pseudoMT", MT ); } }