rivet is hosted by Hepforge, IPPP Durham
ATLAS_2010_S8919674.cc
Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include "Rivet/Analysis.hh"
00003 #include "Rivet/RivetYODA.hh"
00004 #include "Rivet/Tools/Logging.hh"
00005 #include "Rivet/Projections/IdentifiedFinalState.hh"
00006 #include "Rivet/Projections/VetoedFinalState.hh"
00007 #include "Rivet/Projections/MissingMomentum.hh"
00008 #include "Rivet/Projections/FastJets.hh"
00009 #include "Rivet/Projections/ClusteredPhotons.hh"
00010 #include "Rivet/Projections/LeadingParticlesFinalState.hh"
00011 
00012 namespace Rivet {
00013 
00014 
00015   class ATLAS_2010_S8919674 : public Analysis {
00016   public:
00017 
00018     /// @name Constructors etc.
00019     //@{
00020 
00021     /// Constructor
00022     ATLAS_2010_S8919674()
00023       : Analysis("ATLAS_2010_S8919674")
00024     {    }
00025 
00026     //@}
00027 
00028 
00029   public:
00030 
00031     /// @name Analysis methods
00032     //@{
00033 
00034     /// Book histograms and initialise projections before the run
00035     void init() {
00036 
00037       /// Initialise and register projections (selections on the final state)
00038       // projection to find the electrons
00039       std::vector<std::pair<double, double> > eta_e;
00040       eta_e.push_back(make_pair(-2.47,-1.52));
00041       eta_e.push_back(make_pair(-1.37,1.37));
00042       eta_e.push_back(make_pair(1.52,2.47));
00043       IdentifiedFinalState elecs(eta_e, 20.0*GeV);
00044       elecs.acceptIdPair(ELECTRON);
00045       addProjection(elecs, "elecs");
00046       // projection for finding the photons which have to be clustered into
00047       // the lepton later
00048       ClusteredPhotons cphotons_e(FinalState(), elecs, 0.1);
00049       addProjection(cphotons_e, "cphotons_e");
00050 
00051       // projection to find the muons
00052       std::vector<std::pair<double, double> > eta_m;
00053       eta_m.push_back(make_pair(-2.4,2.4));
00054       IdentifiedFinalState muons(eta_m, 20.0*GeV);
00055       muons.acceptIdPair(MUON);
00056       addProjection(muons, "muons");
00057       // projection for finding the photons which have to be clustered into
00058       // the lepton later
00059       ClusteredPhotons cphotons_m(FinalState(), muons, 0.1);
00060       addProjection(cphotons_m, "cphotons_m");
00061 
00062       // Leading neutrinos for Etmiss
00063       FinalState fs;
00064       LeadingParticlesFinalState muon_neutrino(fs);
00065       muon_neutrino.addParticleIdPair(NU_MU);
00066       muon_neutrino.setLeadingOnly(true);
00067       addProjection(muon_neutrino, "muon_neutrino");
00068       LeadingParticlesFinalState elec_neutrino(fs);
00069       elec_neutrino.addParticleIdPair(NU_E);
00070       elec_neutrino.setLeadingOnly(true);
00071       addProjection(elec_neutrino, "elec_neutrino");
00072 
00073       // Input for the jets: No neutrinos, no muons, and no electron which
00074       // passed the electron cuts ("elecs" finalstate from above)
00075       VetoedFinalState veto;
00076       veto.addVetoOnThisFinalState(elecs);
00077       veto.addVetoPairId(MUON);
00078       veto.vetoNeutrinos();
00079       FastJets jets(veto, FastJets::ANTIKT, 0.4);
00080       addProjection(jets, "jets");
00081 
00082 
00083 
00084       /// book histograms
00085       _h_el_njet_inclusive = bookHisto1D(1,1,1);
00086       _h_mu_njet_inclusive = bookHisto1D(2,1,1);
00087 
00088       _h_el_pT_jet1 = bookHisto1D(5,1,1);
00089       _h_mu_pT_jet1 = bookHisto1D(6,1,1);
00090 
00091       _h_el_pT_jet2 = bookHisto1D(7,1,1);
00092       _h_mu_pT_jet2 = bookHisto1D(8,1,1);
00093     }
00094 
00095 
00096     /// Perform the per-event analysis
00097     void analyze(const Event& event) {
00098       const double weight = event.weight();
00099 
00100       const FinalState& elecs = applyProjection<FinalState>(event, "elecs");
00101       ParticleVector elec_neutrino=applyProjection<FinalState>(event, "elec_neutrino").particles();
00102       if (elecs.size()==1 && elec_neutrino.size()>0) {
00103         FourMomentum lepton=elecs.particles()[0].momentum();
00104         foreach (const Particle& photon,
00105                  applyProjection<FinalState>(event, "cphotons_e").particles()) {
00106           lepton+=photon.momentum();
00107         }
00108         FourMomentum p_miss = elec_neutrino[0].momentum();
00109         double mT=sqrt(2.0*lepton.pT()*p_miss.Et()*(1.0-cos(lepton.phi()-p_miss.phi())));
00110         if (p_miss.Et()>25.0*GeV && mT>40.0*GeV) {
00111           Jets jets;
00112           foreach (const Jet& jet, applyProjection<FastJets>(event, "jets").jetsByPt(20.0*GeV)) {
00113             if (fabs(jet.eta())<2.8 && deltaR(lepton, jet.momentum())>0.5) {
00114               jets.push_back(jet);
00115             }
00116           }
00117 
00118           _h_el_njet_inclusive->fill(0, weight);
00119           if (jets.size()>=1) {
00120             _h_el_njet_inclusive->fill(1, weight);
00121             _h_el_pT_jet1->fill(jets[0].momentum().pT(), weight);
00122           }
00123           if (jets.size()>=2) {
00124             _h_el_njet_inclusive->fill(2, weight);
00125             _h_el_pT_jet2->fill(jets[1].momentum().pT(), weight);
00126           }
00127           if (jets.size()>=3) {
00128             _h_el_njet_inclusive->fill(3, weight);
00129           }
00130         }
00131       }
00132 
00133       const FinalState& muons = applyProjection<FinalState>(event, "muons");
00134       ParticleVector muon_neutrino=applyProjection<FinalState>(event, "muon_neutrino").particles();
00135       if (muons.size()==1 && muon_neutrino.size()>0) {
00136         FourMomentum lepton=muons.particles()[0].momentum();
00137         foreach (const Particle& photon,
00138                  applyProjection<FinalState>(event, "cphotons_m").particles()) {
00139           lepton+=photon.momentum();
00140         }
00141         FourMomentum p_miss = muon_neutrino[0].momentum();
00142         double mT=sqrt(2.0*lepton.pT()*p_miss.Et()*(1.0-cos(lepton.phi()-p_miss.phi())));
00143         if (p_miss.Et()>25.0*GeV && mT>40.0*GeV) {
00144           Jets jets;
00145           foreach (const Jet& jet, applyProjection<FastJets>(event, "jets").jetsByPt(20.0*GeV)) {
00146             if (fabs(jet.eta())<2.8 && deltaR(lepton, jet.momentum())>0.5) {
00147               jets.push_back(jet);
00148             }
00149           }
00150 
00151           _h_mu_njet_inclusive->fill(0, weight);
00152           if (jets.size()>=1) {
00153             _h_mu_njet_inclusive->fill(1, weight);
00154             _h_mu_pT_jet1->fill(jets[0].momentum().pT(), weight);
00155           }
00156           if (jets.size()>=2) {
00157             _h_mu_njet_inclusive->fill(2, weight);
00158             _h_mu_pT_jet2->fill(jets[1].momentum().pT(), weight);
00159           }
00160           if (jets.size()>=3) {
00161             _h_mu_njet_inclusive->fill(3, weight);
00162           }
00163           if (jets.size()>=4) {
00164             _h_mu_njet_inclusive->fill(4, weight);
00165           }
00166         }
00167       }
00168 
00169     }
00170 
00171 
00172     /// Normalise histograms etc., after the run
00173     void finalize() {
00174       double normfac=crossSection()/sumOfWeights();
00175       scale(_h_el_njet_inclusive, normfac);
00176       scale(_h_mu_njet_inclusive, normfac);
00177       scale(_h_el_pT_jet1, normfac);
00178       scale(_h_mu_pT_jet1, normfac);
00179       scale(_h_el_pT_jet2, normfac);
00180       scale(_h_mu_pT_jet2, normfac);
00181     }
00182 
00183     //@}
00184 
00185 
00186   private:
00187 
00188     /// @name Histograms
00189     //@{
00190 
00191     Histo1DPtr _h_el_njet_inclusive;
00192     Histo1DPtr _h_mu_njet_inclusive;
00193     Histo1DPtr _h_el_pT_jet1;
00194     Histo1DPtr _h_mu_pT_jet1;
00195     Histo1DPtr _h_el_pT_jet2;
00196     Histo1DPtr _h_mu_pT_jet2;
00197     //@}
00198 
00199   };
00200 
00201 
00202 
00203   // The hook for the plugin system
00204   DECLARE_RIVET_PLUGIN(ATLAS_2010_S8919674);
00205 
00206 }