rivet is hosted by Hepforge, IPPP Durham
ATLAS_2013_I1219109.cc
Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include "Rivet/Analysis.hh"
00003 #include "Rivet/Projections/FinalState.hh"
00004 #include "Rivet/Projections/WFinder.hh"
00005 #include "Rivet/Projections/VetoedFinalState.hh"
00006 #include "Rivet/Projections/FastJets.hh"
00007 #include "Rivet/Projections/HeavyHadrons.hh"
00008 
00009 namespace Rivet {
00010 
00011 
00012   /// @brief ATLAS W+b measurement
00013   class ATLAS_2013_I1219109: public Analysis {
00014   public:
00015 
00016     ATLAS_2013_I1219109(string name = "ATLAS_2013_I1219109")
00017       : Analysis(name)
00018     {
00019       // the electron mode is used by default
00020       _mode = 1;
00021     }
00022 
00023 
00024     void init() {
00025       FinalState fs;
00026       addProjection(fs, "FinalState");
00027 
00028       Cut cuts = Cuts::abseta < 2.5 && Cuts::pT >= 25*GeV;
00029 
00030       // W finder for electrons and muons
00031       WFinder wf(fs, cuts, _mode==3? PID::MUON : PID::ELECTRON, 0.0*GeV, MAXDOUBLE, 0.0, 0.1,
00032                  WFinder::CLUSTERNODECAY, WFinder::NOTRACK, WFinder::TRANSMASS);
00033       addProjection(wf, "WF");
00034 
00035       // jets
00036       VetoedFinalState jet_fs(fs);
00037       jet_fs.addVetoOnThisFinalState(getProjection<WFinder>("WF"));
00038       FastJets fj(jet_fs, FastJets::ANTIKT, 0.4);
00039       fj.useInvisibles();
00040       addProjection(fj, "Jets");
00041       addProjection(HeavyHadrons(Cuts::abseta < 2.5 && Cuts::pT > 5*GeV), "BHadrons");
00042 
00043 
00044       // book histograms
00045       _njet     = bookHisto1D(1, 1, _mode); // dSigma / dNjet
00046       _jet1_bPt = bookHisto1D(2, 1, _mode); // dSigma / dBjetPt for Njet = 1
00047       _jet2_bPt = bookHisto1D(2, 2, _mode); // dSigma / dBjetPt for Njet = 2
00048 
00049     }
00050 
00051 
00052     void analyze(const Event& event) {
00053 
00054       const double weight = event.weight();
00055 
00056       //  retrieve W boson candidate
00057       const WFinder& wf = applyProjection<WFinder>(event, "WF");
00058       if( wf.bosons().size() != 1 )  vetoEvent; // only one W boson candidate
00059       if( !(wf.mT() > 60.0*GeV) )    vetoEvent;
00060       //const Particle& Wboson  = wf.boson();
00061 
00062 
00063       // retrieve constituent neutrino
00064       const Particle& neutrino = wf.constituentNeutrino();
00065       if( !(neutrino.pT() > 25.0*GeV) )  vetoEvent;
00066 
00067       // retrieve constituent lepton
00068       const Particle& lepton = wf.constituentLepton();
00069 
00070       // count good jets, check if good jet contains B hadron
00071       const Particles& bHadrons = applyProjection<HeavyHadrons>(event, "BHadrons").bHadrons();
00072       const Jets& jets = applyProjection<JetAlg>(event, "Jets").jetsByPt(25*GeV);
00073       int goodjets = 0, bjets = 0;
00074       double bPt = 0.;
00075       foreach(const Jet& j, jets) {
00076         if( (j.abseta() < 2.1) && (deltaR(lepton, j) > 0.5) ) {
00077           // this jet passes the selection!
00078           ++goodjets;
00079           // j.bTagged() uses ghost association which is
00080           // more elegant, but not what has been used in
00081           // this analysis originally, will match B had-
00082           // rons in eta-phi space instead
00083           foreach(const Particle& b, bHadrons) {
00084             if( deltaR(j, b) < 0.3 ) {
00085               // jet matched to B hadron!
00086               if(!bPt)  bPt = j.pT() * GeV; // leading b-jet pT
00087               ++bjets; // count number of b-jets
00088               break;
00089             }
00090           }
00091         }
00092       }
00093       if( goodjets > 2 )  vetoEvent; // at most two jets
00094       if( !bjets )  vetoEvent; // at least one of them b-tagged
00095 
00096       double njets = double(goodjets);
00097       double ncomb = 3.0;
00098       _njet->fill(njets, weight);
00099       _njet->fill(ncomb, weight);
00100 
00101       if(     goodjets == 1)  _jet1_bPt->fill(bPt, weight);
00102       else if(goodjets == 2)  _jet2_bPt->fill(bPt, weight);
00103     }
00104 
00105 
00106     void finalize() {
00107 
00108       // Print summary info
00109       const double xs_pb(crossSection() / picobarn);
00110       const double sumw(sumOfWeights());
00111       MSG_INFO("Cross-Section/pb: " << xs_pb      );
00112       MSG_INFO("Sum of weights  : " << sumw       );
00113       MSG_INFO("nEvents         : " << numEvents());
00114 
00115       const double sf(xs_pb / sumw);
00116 
00117       scale(_njet,     sf);
00118       scale(_jet1_bPt, sf);
00119       scale(_jet2_bPt, sf);
00120     }
00121 
00122   protected:
00123 
00124     size_t _mode;
00125 
00126   private:
00127 
00128     Histo1DPtr _njet;
00129     Histo1DPtr _jet1_bPt;
00130     Histo1DPtr _jet2_bPt;
00131 
00132     bool _isMuon;
00133 
00134   };
00135 
00136   class ATLAS_2013_I1219109_EL : public ATLAS_2013_I1219109 {
00137   public:
00138     ATLAS_2013_I1219109_EL()
00139       : ATLAS_2013_I1219109("ATLAS_2013_I1219109_EL")
00140     {
00141       _mode = 2;
00142     }
00143   };
00144 
00145   class ATLAS_2013_I1219109_MU : public ATLAS_2013_I1219109 {
00146   public:
00147     ATLAS_2013_I1219109_MU()
00148       : ATLAS_2013_I1219109("ATLAS_2013_I1219109_MU")
00149     {
00150       _mode = 3;
00151     }
00152   };
00153 
00154   // The hook for the plugin system
00155   DECLARE_RIVET_PLUGIN(ATLAS_2013_I1219109);
00156   DECLARE_RIVET_PLUGIN(ATLAS_2013_I1219109_EL);
00157   DECLARE_RIVET_PLUGIN(ATLAS_2013_I1219109_MU);
00158 
00159 }