00001
00002 #include "Rivet/Analysis.hh"
00003 #include "Rivet/RivetAIDA.hh"
00004 #include "Rivet/Tools/Logging.hh"
00005 #include "Rivet/Projections/FinalState.hh"
00006 #include "Rivet/Projections/ChargedFinalState.hh"
00007 #include "Rivet/Projections/FastJets.hh"
00008
00009 namespace Rivet {
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 class CDF_2010_S8591881_QCD : public Analysis {
00030 public:
00031
00032
00033 CDF_2010_S8591881_QCD()
00034 : Analysis("CDF_2010_S8591881_QCD")
00035 {
00036 }
00037
00038
00039
00040
00041
00042 void init() {
00043
00044 const FinalState fsj(-4.0, 4.0, 0.0*GeV);
00045 addProjection(fsj, "FSJ");
00046 addProjection(FastJets(fsj, FastJets::CDFMIDPOINT, 0.7), "MidpointJets");
00047
00048
00049 const ChargedFinalState cfs(-1.0, 1.0, 0.5*GeV);
00050 addProjection(cfs, "CFS");
00051
00052
00053 _hist_tnchg = bookProfile1D(10, 1, 1);
00054 _hist_pnchg = bookProfile1D(10, 1, 2);
00055 _hist_anchg = bookProfile1D(10, 1, 3);
00056 _hist_pmaxnchg = bookProfile1D(11, 1, 1);
00057 _hist_pminnchg = bookProfile1D(11, 1, 2);
00058 _hist_pdifnchg = bookProfile1D(11, 1, 3);
00059 _hist_tcptsum = bookProfile1D(12, 1, 1);
00060 _hist_pcptsum = bookProfile1D(12, 1, 2);
00061 _hist_acptsum = bookProfile1D(12, 1, 3);
00062 _hist_pmaxcptsum = bookProfile1D(13, 1, 1);
00063 _hist_pmincptsum = bookProfile1D(13, 1, 2);
00064 _hist_pdifcptsum = bookProfile1D(13, 1, 3);
00065 _hist_pcptave = bookProfile1D(14, 1, 1);
00066 _hist_pcptmax = bookProfile1D(15, 1, 1);
00067 }
00068
00069
00070
00071 void analyze(const Event& e) {
00072
00073
00074 const FinalState& fsj = applyProjection<FinalState>(e, "FSJ");
00075 if (fsj.particles().size() < 1) {
00076 MSG_DEBUG("Failed multiplicity cut");
00077 vetoEvent;
00078 }
00079
00080 const Jets& jets = applyProjection<FastJets>(e, "MidpointJets").jetsByPt();
00081 MSG_DEBUG("Jet multiplicity = " << jets.size());
00082
00083
00084 if (jets.size() < 1 || fabs(jets[0].momentum().eta()) >= 2) {
00085 MSG_DEBUG("Failed leading jet cut");
00086 vetoEvent;
00087 }
00088
00089 const double jetphi = jets[0].momentum().phi();
00090 const double jeteta = jets[0].momentum().eta();
00091 const double jetpT = jets[0].momentum().pT();
00092 MSG_DEBUG("Leading jet: pT = " << jetpT
00093 << ", eta = " << jeteta << ", phi = " << jetphi);
00094
00095
00096 const double weight = e.weight();
00097
00098
00099 const FinalState& cfs = applyProjection<ChargedFinalState>(e, "CFS");
00100
00101 size_t numOverall(0), numToward(0), numAway(0) ;
00102 long int numTrans1(0), numTrans2(0);
00103 double ptSumOverall(0.0), ptSumToward(0.0), ptSumTrans1(0.0), ptSumTrans2(0.0), ptSumAway(0.0);
00104 double ptMaxOverall(0.0), ptMaxToward(0.0), ptMaxTrans1(0.0), ptMaxTrans2(0.0), ptMaxAway(0.0);
00105
00106
00107 foreach (const Particle& p, cfs.particles()) {
00108 const double dPhi = deltaPhi(p.momentum().phi(), jetphi);
00109 const double pT = p.momentum().pT();
00110 const double phi = p.momentum().phi();
00111 double rotatedphi = phi - jetphi;
00112 while (rotatedphi < 0) rotatedphi += 2*PI;
00113
00114 ptSumOverall += pT;
00115 ++numOverall;
00116 if (pT > ptMaxOverall) {
00117 ptMaxOverall = pT;
00118 }
00119
00120 if (dPhi < PI/3.0) {
00121 ptSumToward += pT;
00122 ++numToward;
00123 if (pT > ptMaxToward) ptMaxToward = pT;
00124 }
00125 else if (dPhi < 2*PI/3.0) {
00126 if (rotatedphi <= PI) {
00127 ptSumTrans1 += pT;
00128 ++numTrans1;
00129 if (pT > ptMaxTrans1) ptMaxTrans1 = pT;
00130 } else {
00131 ptSumTrans2 += pT;
00132 ++numTrans2;
00133 if (pT > ptMaxTrans2) ptMaxTrans2 = pT;
00134 }
00135 }
00136 else {
00137 ptSumAway += pT;
00138 ++numAway;
00139 if (pT > ptMaxAway) ptMaxAway = pT;
00140 }
00141 }
00142
00143
00144 _hist_tnchg->fill(jetpT/GeV, numToward/(4*PI/3), weight);
00145 _hist_pnchg->fill(jetpT/GeV, (numTrans1+numTrans2)/(4*PI/3), weight);
00146 _hist_pmaxnchg->fill(jetpT/GeV, (numTrans1>numTrans2 ? numTrans1 : numTrans2)/(2*PI/3), weight);
00147 _hist_pminnchg->fill(jetpT/GeV, (numTrans1<numTrans2 ? numTrans1 : numTrans2)/(2*PI/3), weight);
00148 _hist_pdifnchg->fill(jetpT/GeV, abs(numTrans1-numTrans2)/(2*PI/3), weight);
00149 _hist_anchg->fill(jetpT/GeV, numAway/(4*PI/3), weight);
00150
00151 _hist_tcptsum->fill(jetpT/GeV, ptSumToward/GeV/(4*PI/3), weight);
00152 _hist_pcptsum->fill(jetpT/GeV, (ptSumTrans1+ptSumTrans2)/GeV/(4*PI/3), weight);
00153 _hist_pmaxcptsum->fill(jetpT/GeV, (ptSumTrans1>ptSumTrans2 ? ptSumTrans1 : ptSumTrans2)/GeV/(2*PI/3), weight);
00154 _hist_pmincptsum->fill(jetpT/GeV, (ptSumTrans1<ptSumTrans2 ? ptSumTrans1 : ptSumTrans2)/GeV/(2*PI/3), weight);
00155 _hist_pdifcptsum->fill(jetpT/GeV, fabs(ptSumTrans1-ptSumTrans2)/GeV/(2*PI/3), weight);
00156 _hist_acptsum->fill(jetpT/GeV, ptSumAway/GeV/(4*PI/3), weight);
00157
00158 if ((numTrans1+numTrans2) > 0) {
00159 _hist_pcptave->fill(jetpT/GeV, (ptSumTrans1+ptSumTrans2)/GeV/(numTrans1+numTrans2), weight);
00160 _hist_pcptmax->fill(jetpT/GeV, (ptMaxTrans1 > ptMaxTrans2 ? ptMaxTrans1 : ptMaxTrans2)/GeV, weight);
00161 }
00162 }
00163
00164
00165 void finalize() {
00166 }
00167
00168
00169
00170
00171 private:
00172
00173 AIDA::IProfile1D *_hist_tnchg;
00174 AIDA::IProfile1D *_hist_pnchg;
00175 AIDA::IProfile1D *_hist_anchg;
00176 AIDA::IProfile1D *_hist_pmaxnchg;
00177 AIDA::IProfile1D *_hist_pminnchg;
00178 AIDA::IProfile1D *_hist_pdifnchg;
00179 AIDA::IProfile1D *_hist_tcptsum;
00180 AIDA::IProfile1D *_hist_pcptsum;
00181 AIDA::IProfile1D *_hist_acptsum;
00182 AIDA::IProfile1D *_hist_pmaxcptsum;
00183 AIDA::IProfile1D *_hist_pmincptsum;
00184 AIDA::IProfile1D *_hist_pdifcptsum;
00185 AIDA::IProfile1D *_hist_pcptave;
00186 AIDA::IProfile1D *_hist_pcptmax;
00187
00188 };
00189
00190
00191
00192
00193 DECLARE_RIVET_PLUGIN(CDF_2010_S8591881_QCD);
00194
00195 }