|
[Rivet-svn] r2119 - in trunk/src: Analyses Projectionsblackhole at projects.hepforge.org blackhole at projects.hepforge.orgTue Dec 1 08:41:54 GMT 2009
Author: buckley Date: Tue Dec 1 08:41:53 2009 New Revision: 2119 Log: WFinder bug fixes Modified: trunk/src/Analyses/MC_LHC_WANALYSIS.cc trunk/src/Projections/WFinder.cc Modified: trunk/src/Analyses/MC_LHC_WANALYSIS.cc ============================================================================== --- trunk/src/Analyses/MC_LHC_WANALYSIS.cc Mon Nov 30 22:22:28 2009 (r2118) +++ trunk/src/Analyses/MC_LHC_WANALYSIS.cc Tue Dec 1 08:41:53 2009 (r2119) @@ -25,16 +25,17 @@ //@{ void init() { - const ChargedFinalState cfs; + const ChargedFinalState cfs(-2, 2, 200*MeV); addProjection(cfs, "CFS"); + /// @todo Handle muon-decay Ws as well - const WFinder wf(-MAXRAPIDITY, MAXRAPIDITY, 0.0*GeV, ELECTRON, 70.0*GeV, 90.0*GeV, 0.2); + const WFinder wf(-2, 2, 10.0*GeV, ELECTRON, 60.0*GeV, 100.0*GeV, 0.2); addProjection(wf, "WF"); - FastJets fastjets(wf.remainingFinalState(), FastJets::KT, 0.7); + FastJets fastjets(wf.remainingFinalState(), FastJets::KT, 1.0); addProjection(fastjets, "Jets"); - _hist_chargemulti = bookHistogram1D("track-n", 50, -0.5, 399.5); - _hist_chargept = bookHistogram1D("track-pt", 25, 0, 25); + _hist_chargemulti = bookHistogram1D("track-n", 50, -0.5, 999.5); + _hist_chargept = bookHistogram1D("track-pt", 20, 0, 20); /// @todo Use profile plots instead: _hist_chargemeanpt = bookHistogram1D("track-ptavg", 20, 0, 10); /// @todo Use profile plots instead (and this isn't really an "RMS") @@ -57,8 +58,8 @@ _hist_wminusmass = bookHistogram1D("wminus-m", 40, 60, 100); //_hist_weta_asymm = bookProfile1D("asymm-eta-w", 20, -5.0, 5.0); // - _hist_jetcount = bookHistogram1D("jet-n", 6, -0.5, 5.5); - _hist_jetpt = bookHistogram1D("jet-pt", 50, 20, 100); + // _hist_jetcount = bookHistogram1D("jet-n", 6, -0.5, 5.5); + // _hist_jetpt = bookHistogram1D("jet-pt", 50, 20, 100); } @@ -119,14 +120,15 @@ _hist_wpluscount->fill(n_wplus, weight); _hist_wminuscount->fill(n_wminus, weight); - // Jet part - const FastJets& fastjets = applyProjection<FastJets>(event, "Jets"); - const Jets jets = fastjets.jetsByPt(); - _hist_jetcount->fill(jets.size(), weight); - foreach (const Jet& j, jets) { - const double pT = j.momentum().pT(); - _hist_jetpt->fill(pT/GeV, weight); - } + // // Jet part + // const FastJets& fastjets = applyProjection<FastJets>(event, "Jets"); + // const Jets jets = fastjets.jetsByPt(); + // cout << jets.size() << endl; + // _hist_jetcount->fill(jets.size(), weight); + // foreach (const Jet& j, jets) { + // const double pT = j.momentum().pT(); + // _hist_jetpt->fill(pT/GeV, weight); + // } } @@ -156,8 +158,8 @@ scale(_hist_wmass, xsec_sumw); scale(_hist_wplusmass, xsec_sumw_plus); scale(_hist_wminusmass, xsec_sumw_minus); - scale(_hist_jetcount, xsec_sumw); - scale(_hist_jetpt, xsec_sumw); + // scale(_hist_jetcount, xsec_sumw); + // scale(_hist_jetpt, xsec_sumw); } //@} @@ -174,17 +176,17 @@ /// @name Histograms //@{ - AIDA::IHistogram1D* _hist_chargemulti; - AIDA::IHistogram1D* _hist_chargept; - AIDA::IHistogram1D* _hist_chargemeanpt; - AIDA::IHistogram1D* _hist_chargermspt; + AIDA::IHistogram1D *_hist_chargemulti; + AIDA::IHistogram1D *_hist_chargept; + AIDA::IHistogram1D *_hist_chargemeanpt; + AIDA::IHistogram1D *_hist_chargermspt; AIDA::IHistogram1D *_hist_wcount, *_hist_wpluscount, *_hist_wminuscount; AIDA::IHistogram1D *_hist_wpt, *_hist_wpluspt, *_hist_wminuspt; AIDA::IHistogram1D *_hist_weta, *_hist_wpluseta, *_hist_wminuseta; AIDA::IHistogram1D *_hist_wphi, *_hist_wplusphi, *_hist_wminusphi; AIDA::IHistogram1D *_hist_wmass, *_hist_wplusmass, *_hist_wminusmass; - AIDA::IHistogram1D* _hist_jetcount; - AIDA::IHistogram1D* _hist_jetpt; + // AIDA::IHistogram1D *_hist_jetcount; + // AIDA::IHistogram1D *_hist_jetpt; //@} }; Modified: trunk/src/Projections/WFinder.cc ============================================================================== --- trunk/src/Projections/WFinder.cc Mon Nov 30 22:22:28 2009 (r2118) +++ trunk/src/Projections/WFinder.cc Tue Dec 1 08:41:53 2009 (r2119) @@ -57,7 +57,7 @@ addProjection(fs, "FS"); assert(abs(pid) == ELECTRON || abs(pid) == MUON || abs(pid) == TAU); - PdgId nu_pid = -(abs(pid) + 1); + PdgId nu_pid = abs(pid) + 1; assert(abs(nu_pid) == NU_E || abs(nu_pid) == NU_MU || abs(nu_pid) == NU_TAU); std::vector<std::pair<long, long> > l_nu_ids; l_nu_ids += std::make_pair(abs(pid), -abs(nu_pid)); @@ -78,14 +78,12 @@ ///////////////////////////////////////////////////// - const FinalState& WFinder::remainingFinalState() const - { + const FinalState& WFinder::remainingFinalState() const { return getProjection<FinalState>("RFS"); } - const FinalState& WFinder::constituentsFinalState() const - { + const FinalState& WFinder::constituentsFinalState() const { return getProjection<FinalState>("IMFS"); } @@ -105,12 +103,15 @@ _theParticles.clear(); const FinalState& imfs = applyProjection<FinalState>(e, "IMFS"); - if (imfs.particles().size() != 2) return; + if (imfs.particles().size() != 2) { + getLog() << Log::DEBUG << "No W+- candidates found" << endl; + return; + } + FourMomentum pW = imfs.particles()[0].momentum() + imfs.particles()[1].momentum(); - const int w3charge = PID::threeCharge(imfs.particles()[0].pdgId()) + PID::threeCharge(imfs.particles()[1].pdgId()); + const int w3charge = PID::threeCharge(imfs.particles()[0]) + PID::threeCharge(imfs.particles()[1]); assert(abs(w3charge) == 3); - const int wcharge = sign(w3charge); - /// @todo Provide W charge method + const int wcharge = w3charge/3; stringstream msg; string wsign = (wcharge == 1) ? "+" : "-"; @@ -129,10 +130,8 @@ getLog() << Log::DEBUG << msg.str() << endl; // Make W Particle and insert into particles list - const PdgId wpid = (wcharge == 1) ? WPLUSBOSON : WPLUSBOSON; + const PdgId wpid = (wcharge == 1) ? WPLUSBOSON : WMINUSBOSON; _theParticles.push_back(Particle(wpid, pW)); - getLog() << Log::DEBUG << name() << " found " << _theParticles.size() - << " W candidates." << endl; }
More information about the Rivet-svn mailing list |