CDF_2008_S7782535.cc
Go to the documentation of this file.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/FastJets.hh"
00008 #include "Rivet/Projections/JetShape.hh"
00009
00010 namespace Rivet {
00011
00012
00013
00014 class CDF_2008_S7782535 : public Analysis {
00015 public:
00016
00017
00018 CDF_2008_S7782535() : Analysis("CDF_2008_S7782535")
00019 {
00020 }
00021
00022
00023
00024
00025
00026 void init() {
00027
00028 const FinalState fs(-3.6, 3.6);
00029 addProjection(fs, "FS");
00030 FastJets jetproj(fs, FastJets::CDFMIDPOINT, 0.7);
00031 jetproj.useInvisibles();
00032 addProjection(jetproj, "Jets");
00033
00034
00035 _ptedges += 52, 80, 104, 142, 300;
00036 for (size_t i = 0; i < 4; ++i) {
00037 stringstream ss; ss << "JetShape" << i;
00038 const string pname = ss.str();
00039 _jsnames_pT[i] = pname;
00040 const JetShape jsp(jetproj, 0.0, 0.7, 7, _ptedges[i], _ptedges[i+1], 0.0, 0.7, RAPIDITY);
00041 addProjection(jsp, pname);
00042 _h_Psi_pT[i] = bookProfile1D(i+1, 2, 1);
00043 }
00044 _h_OneMinusPsi_vs_pT = bookDataPointSet(5, 1, 1);
00045 }
00046
00047
00048
00049 void analyze(const Event& event) {
00050 const Jets& jets = applyProjection<FastJets>(event, "Jets").jets(_ptedges.front()*GeV, _ptedges.back()*GeV,
00051 0.0, 0.7, RAPIDITY);
00052 MSG_DEBUG("Jet multiplicity before any pT cut = " << jets.size());
00053 if (jets.size() == 0) {
00054 MSG_DEBUG("No jets found in required pT range");
00055 vetoEvent;
00056 }
00057
00058
00059 Jets bjets;
00060 foreach (const Jet& j, jets) {
00061 if (j.containsBottom()) bjets += j;
00062 }
00063 if (bjets.empty()) {
00064 MSG_DEBUG("No b-jet axes in acceptance");
00065 vetoEvent;
00066 }
00067
00068
00069 Jets bjets_ptbinned[4];
00070 foreach (const Jet& bj, bjets) {
00071 const FourMomentum pbj = bj.momentum();
00072 const int ipt = index_between(pbj.pT(), _ptedges);
00073 if (ipt == -1) continue;
00074 bjets_ptbinned[ipt] += bj;
00075 }
00076
00077
00078 const double weight = event.weight();
00079 for (size_t ipt = 0; ipt < 4; ++ipt) {
00080 if (bjets_ptbinned[ipt].empty()) continue;
00081
00082 JetShape jsipt = applyProjection<JetShape>(event, _jsnames_pT[ipt]);
00083 jsipt.calc(bjets_ptbinned[ipt]);
00084 for (size_t ijet = 0; ijet < jsipt.numJets(); ++ijet) {
00085 for (size_t rbin = 0; rbin < jsipt.numBins(); ++rbin) {
00086 const double r_Psi = jsipt.rBinMax(rbin);
00087 _h_Psi_pT[ipt]->fill(r_Psi/0.7, jsipt.intJetShape(ijet, rbin), weight);
00088 }
00089 }
00090 }
00091
00092 }
00093
00094
00095
00096 void finalize() {
00097
00098
00099 vector<double> y, ey;
00100 for (size_t i = 0; i < _ptedges.size()-1; ++i) {
00101
00102 AIDA::IProfile1D* ph_i = _h_Psi_pT[i];
00103 y.push_back(1.0 - ph_i->binHeight(1));
00104 ey.push_back(ph_i->binError(1));
00105 }
00106 _h_OneMinusPsi_vs_pT->setCoordinate(1, y, ey);
00107
00108 }
00109
00110
00111
00112
00113 private:
00114
00115
00116
00117
00118
00119 vector<double> _ptedges;
00120
00121
00122 string _jsnames_pT[4];
00123
00124
00125
00126
00127
00128
00129 AIDA::IProfile1D* _h_Psi_pT[4];
00130 AIDA::IDataPointSet* _h_OneMinusPsi_vs_pT;
00131
00132
00133 };
00134
00135
00136
00137
00138 DECLARE_RIVET_PLUGIN(CDF_2008_S7782535);
00139
00140 }