00001
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
00017
00018
00019
00020
00021
00022 class CDF_2006_S6653332 : public Analysis {
00023 public:
00024
00025
00026 CDF_2006_S6653332()
00027 : Analysis("CDF_2006_S6653332"),
00028 _Rjet(0.7), _JetPtCut(20.), _JetEtaCut(1.5),
00029 _sumWeightsWithZ(0.0), _sumWeightsWithZJet(0.0)
00030 {
00031 setBeams(PROTON, ANTIPROTON);
00032 setNeedsCrossSection(true);
00033 }
00034
00035
00036
00037
00038
00039 void init() {
00040 const FinalState fs(-3.6, 3.6);
00041 addProjection(fs, "FS");
00042
00043
00044
00045 vector<pair<PdgId,PdgId> > vids;
00046 vids.push_back(make_pair(ELECTRON, POSITRON));
00047 vids.push_back(make_pair(MUON, ANTIMUON));
00048 FinalState fs2(-3.6, 3.6);
00049 InvMassFinalState invfs(fs2, vids, 76*GeV, 106*GeV);
00050 addProjection(invfs, "INVFS");
00051
00052
00053 VetoedFinalState vfs(fs);
00054 vfs.addVetoOnThisFinalState(invfs);
00055 addProjection(vfs, "VFS");
00056 addProjection(FastJets(vfs, FastJets::CDFMIDPOINT, 0.7), "Jets");
00057
00058
00059 _sigmaBJet = bookHistogram1D(1, 1, 1);
00060 _ratioBJetToZ = bookHistogram1D(2, 1, 1);
00061 _ratioBJetToJet = bookHistogram1D(3, 1, 1);
00062 }
00063
00064
00065
00066 void analyze(const Event& event) {
00067
00068
00069 const InvMassFinalState& invMassFinalState = applyProjection<InvMassFinalState>(event, "INVFS");
00070 const ParticleVector& ZDecayProducts = invMassFinalState.particles();
00071
00072
00073 if (ZDecayProducts.size() < 2) vetoEvent;
00074 _sumWeightsWithZ += event.weight();
00075
00076 FourMomentum Zmom = ZDecayProducts[0].momentum() + ZDecayProducts[1].momentum();
00077
00078
00079
00080 ParticleVector bquarks;
00081
00082 for (GenEvent::particle_const_iterator p = event.genEvent().particles_begin();
00083 p != event.genEvent().particles_end(); ++p) {
00084 if ( fabs((*p)->pdg_id()) == BQUARK ) {
00085 bquarks.push_back(Particle(**p));
00086 }
00087 }
00088
00089
00090 const FastJets& jetpro = applyProjection<FastJets>(event, "Jets");
00091 getLog() << Log::DEBUG << "Jet multiplicity before any pT cut = " << jetpro.size() << endl;
00092
00093 const PseudoJets& jets = jetpro.pseudoJetsByPt();
00094 getLog() << Log::DEBUG << "jetlist size = " << jets.size() << endl;
00095
00096 int numBJet = 0;
00097 int numJet = 0;
00098
00099
00100 for (PseudoJets::const_iterator jt = jets.begin(); jt != jets.end(); ++jt) {
00101
00102 if (jt->perp() > _JetPtCut && fabs(jt->rapidity()) <= _JetEtaCut) {
00103 ++numJet;
00104
00105
00106
00107 bool bjet = false;
00108 foreach (const Particle& bquark, bquarks) {
00109 if (deltaR(jt->rapidity(), jt->phi(), bquark.momentum().rapidity(),bquark.momentum().azimuthalAngle()) <= _Rjet) {
00110 bjet = true;
00111 break;
00112 }
00113 }
00114 if (bjet) {
00115 numBJet++;
00116 }
00117 }
00118 }
00119
00120 if (numJet > 0) _sumWeightsWithZJet += event.weight();
00121 if (numBJet > 0) {
00122 _sigmaBJet->fill(1960.0,event.weight());
00123 _ratioBJetToZ->fill(1960.0,event.weight());
00124 _ratioBJetToJet->fill(1960.0,event.weight());
00125 }
00126
00127 }
00128
00129
00130
00131 void finalize() {
00132 getLog() << Log::DEBUG << "Total sum of weights = " << sumOfWeights() << endl;
00133 getLog() << Log::DEBUG << "Sum of weights for Z production in mass range = " << _sumWeightsWithZ << endl;
00134 getLog() << Log::DEBUG << "Sum of weights for Z+jet production in mass range = " << _sumWeightsWithZJet << endl;
00135
00136 _sigmaBJet->scale(crossSection()/sumOfWeights());
00137 _ratioBJetToZ->scale(1.0/_sumWeightsWithZ);
00138 _ratioBJetToJet->scale(1.0/_sumWeightsWithZJet);
00139 }
00140
00141
00142
00143
00144 private:
00145
00146
00147
00148
00149 double _Rjet;
00150 double _JetPtCut;
00151 double _JetEtaCut;
00152
00153 double _sumWeightsWithZ;
00154 double _sumWeightsWithZJet;
00155
00156
00157
00158
00159
00160 AIDA::IHistogram1D* _sigmaBJet;
00161 AIDA::IHistogram1D* _ratioBJetToZ;
00162 AIDA::IHistogram1D* _ratioBJetToJet;
00163
00164
00165 };
00166
00167
00168
00169 AnalysisBuilder<CDF_2006_S6653332> plugin_CDF_2006_S6653332;
00170
00171 }