CDF_2006_S6653332.cc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include "Rivet/Analysis.hh"
00003 #include "Rivet/RivetAIDA.hh"
00004 #include "Rivet/Tools/Logging.hh"
00005 #include "Rivet/Tools/ParticleIdUtils.hh"
00006 #include "Rivet/Projections/FinalState.hh"
00007 #include "Rivet/Projections/VetoedFinalState.hh"
00008 #include "Rivet/Projections/ChargedFinalState.hh"
00009 #include "Rivet/Projections/InvMassFinalState.hh"
00010 #include "Rivet/Projections/FastJets.hh"
00011 #include "Rivet/Projections/ChargedLeptons.hh"
00012 
00013 namespace Rivet {
00014 
00015 
00016   /* @brief CDF Run II analysis: jet \f$ p_T \f$ and \f$ \eta \f$
00017    *   distributions in Z + (b) jet production
00018    * @author Lars Sonnenschein
00019    *
00020    * This CDF analysis provides \f$ p_T \f$ and \f$ \eta \f$ distributions of
00021    * jets in Z + (b) jet production, before and after tagging.
00022    */
00023   class CDF_2006_S6653332 : public Analysis {
00024   public:
00025 
00026     /// Constructor
00027     CDF_2006_S6653332()
00028       : Analysis("CDF_2006_S6653332"),
00029         _Rjet(0.7), _JetPtCut(20.), _JetEtaCut(1.5),
00030         _sumWeightsWithZ(0.0), _sumWeightsWithZJet(0.0)
00031     {
00032       setBeams(PROTON, ANTIPROTON);
00033       setNeedsCrossSection(true);
00034     }
00035 
00036 
00037     /// @name Analysis methods
00038     //@{
00039 
00040     void init() {
00041       const FinalState fs(-3.6, 3.6);
00042       addProjection(fs, "FS");
00043    
00044       // Create a final state with any e+e- or mu+mu- pair with
00045       // invariant mass 76 -> 106 GeV and ET > 20 (Z decay products)
00046       vector<pair<PdgId,PdgId> > vids;
00047       vids.push_back(make_pair(ELECTRON, POSITRON));
00048       vids.push_back(make_pair(MUON, ANTIMUON));
00049       FinalState fs2(-3.6, 3.6);
00050       InvMassFinalState invfs(fs2, vids, 76*GeV, 106*GeV);
00051       addProjection(invfs, "INVFS");
00052    
00053       // Make a final state without the Z decay products for jet clustering
00054       VetoedFinalState vfs(fs);
00055       vfs.addVetoOnThisFinalState(invfs);
00056       addProjection(vfs, "VFS");
00057       addProjection(FastJets(vfs, FastJets::CDFMIDPOINT, 0.7), "Jets");
00058 
00059       // Book histograms
00060       _sigmaBJet = bookHistogram1D(1, 1, 1);
00061       _ratioBJetToZ = bookHistogram1D(2, 1, 1);
00062       _ratioBJetToJet = bookHistogram1D(3, 1, 1);
00063     }
00064 
00065 
00066     /// Do the analysis
00067     void analyze(const Event& event) {
00068       // Check we have an l+l- pair that passes the kinematic cuts
00069       // Get the Z decay products (mu+mu- or e+e- pair)
00070       const InvMassFinalState& invMassFinalState = applyProjection<InvMassFinalState>(event, "INVFS");
00071       const ParticleVector&  ZDecayProducts =  invMassFinalState.particles();
00072    
00073       // Make sure we have at least 2 Z decay products (mumu or ee)
00074       if (ZDecayProducts.size() < 2) vetoEvent;
00075       _sumWeightsWithZ += event.weight();
00076       // @todo: write out a warning if there are more than two decay products
00077       FourMomentum Zmom = ZDecayProducts[0].momentum() +  ZDecayProducts[1].momentum();
00078    
00079       // Put all b-quarks in a vector
00080       /// @todo Use jet contents rather than accessing quarks directly
00081       ParticleVector bquarks;
00082       /// @todo Use nicer looping
00083       for (GenEvent::particle_const_iterator p = event.genEvent().particles_begin();
00084            p != event.genEvent().particles_end(); ++p) {
00085         if ( fabs((*p)->pdg_id()) == BQUARK ) {
00086           bquarks.push_back(Particle(**p));
00087         }
00088       }
00089    
00090       // Get jets
00091       const FastJets& jetpro = applyProjection<FastJets>(event, "Jets");
00092       getLog() << Log::DEBUG << "Jet multiplicity before any pT cut = " << jetpro.size() << endl;
00093    
00094       const PseudoJets& jets = jetpro.pseudoJetsByPt();
00095       getLog() << Log::DEBUG << "jetlist size = " << jets.size() << endl;
00096    
00097       int numBJet = 0;
00098       int numJet  = 0;
00099       // for each b-jet plot the ET and the eta of the jet, normalise to the total cross section at the end
00100       // for each event plot N jet and pT(Z), normalise to the total cross section at the end
00101       for (PseudoJets::const_iterator jt = jets.begin(); jt != jets.end(); ++jt) {
00102         // select jets that pass the kinematic cuts
00103         if (jt->perp() > _JetPtCut && fabs(jt->rapidity()) <= _JetEtaCut) {
00104           ++numJet;
00105           // Does the jet contain a b-quark?
00106           /// @todo Use jet contents rather than accessing quarks directly
00107        
00108           bool bjet = false;
00109           foreach (const Particle& bquark,  bquarks) {
00110             if (deltaR(jt->rapidity(), jt->phi(), bquark.momentum().rapidity(),bquark.momentum().azimuthalAngle()) <= _Rjet) {
00111               bjet = true;
00112               break;
00113             }
00114           } // end loop around b-jets
00115           if (bjet) {
00116             numBJet++;
00117           }
00118         }
00119       } // end loop around jets
00120    
00121       if (numJet > 0)    _sumWeightsWithZJet += event.weight();
00122       if (numBJet > 0) {
00123         _sigmaBJet->fill(1960.0,event.weight());
00124         _ratioBJetToZ->fill(1960.0,event.weight());
00125         _ratioBJetToJet->fill(1960.0,event.weight());
00126       }
00127    
00128     }
00129  
00130 
00131     /// Finalize
00132     void finalize() {
00133       getLog() << Log::DEBUG << "Total sum of weights = " << sumOfWeights() << endl;
00134       getLog() << Log::DEBUG << "Sum of weights for Z production in mass range = " << _sumWeightsWithZ << endl;
00135       getLog() << Log::DEBUG << "Sum of weights for Z+jet production in mass range = " << _sumWeightsWithZJet << endl;
00136    
00137       _sigmaBJet->scale(crossSection()/sumOfWeights());
00138       _ratioBJetToZ->scale(1.0/_sumWeightsWithZ);
00139       _ratioBJetToJet->scale(1.0/_sumWeightsWithZJet);
00140     }
00141  
00142         //@}
00143 
00144 
00145   private:
00146 
00147     /// @name Cuts and counters
00148     //@{
00149 
00150     double _Rjet;
00151     double _JetPtCut;
00152     double _JetEtaCut;
00153 
00154     double _sumWeightsWithZ;
00155     double _sumWeightsWithZJet;
00156 
00157     //@}
00158 
00159     /// @name Histograms
00160     //@{
00161     AIDA::IHistogram1D* _sigmaBJet;
00162     AIDA::IHistogram1D* _ratioBJetToZ;
00163     AIDA::IHistogram1D* _ratioBJetToJet;
00164     //@}
00165  
00166   };
00167 
00168 
00169   // This global object acts as a hook for the plugin system
00170   AnalysisBuilder<CDF_2006_S6653332> plugin_CDF_2006_S6653332;
00171 
00172 }