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
00030
00031 class CDF_2008_LEADINGJETS : public Analysis {
00032 public:
00033
00034
00035 CDF_2008_LEADINGJETS()
00036 : Analysis("CDF_2008_LEADINGJETS")
00037 {
00038 setBeams(PROTON, ANTIPROTON);
00039 }
00040
00041
00042
00043
00044
00045 void init() {
00046
00047 const FinalState fsj(-4.0, 4.0, 0.0*GeV);
00048 addProjection(fsj, "FSJ");
00049 addProjection(FastJets(fsj, FastJets::CDFMIDPOINT, 0.7), "MidpointJets");
00050
00051
00052 const FinalState fs(-1.0, 1.0, 0.0*GeV);
00053 addProjection(fs, "FS");
00054
00055
00056 const ChargedFinalState cfs(-1.0, 1.0, 0.5*GeV);
00057 addProjection(cfs, "CFS");
00058
00059
00060 _hist_pnchg = bookProfile1D( 1, 1, 1);
00061 _hist_pmaxnchg = bookProfile1D( 2, 1, 1);
00062 _hist_pminnchg = bookProfile1D( 3, 1, 1);
00063 _hist_pdifnchg = bookProfile1D( 4, 1, 1);
00064 _hist_pcptsum = bookProfile1D( 5, 1, 1);
00065 _hist_pmaxcptsum = bookProfile1D( 6, 1, 1);
00066 _hist_pmincptsum = bookProfile1D( 7, 1, 1);
00067 _hist_pdifcptsum = bookProfile1D( 8, 1, 1);
00068 _hist_pcptave = bookProfile1D( 9, 1, 1);
00069
00070
00071
00072 }
00073
00074
00075
00076 void analyze(const Event& e) {
00077
00078
00079 const FinalState& fsj = applyProjection<FinalState>(e, "FSJ");
00080 if (fsj.particles().size() < 1) {
00081 getLog() << Log::DEBUG << "Failed multiplicity cut" << endl;
00082 vetoEvent;
00083 }
00084
00085 const Jets& jets = applyProjection<FastJets>(e, "MidpointJets").jetsByPt();
00086 getLog() << Log::DEBUG << "Jet multiplicity = " << jets.size() << endl;
00087
00088
00089 if (jets.size() < 1 || fabs(jets[0].momentum().eta()) >= 2) {
00090 getLog() << Log::DEBUG << "Failed leading jet cut" << endl;
00091 vetoEvent;
00092 }
00093
00094 const double jetphi = jets[0].momentum().phi();
00095 const double jeteta = jets[0].momentum().eta();
00096 const double jetpT = jets[0].momentum().pT();
00097 getLog() << Log::DEBUG << "Leading jet: pT = " << jetpT
00098 << ", eta = " << jeteta << ", phi = " << jetphi << endl;
00099
00100
00101 const double weight = e.weight();
00102
00103
00104 const FinalState& cfs = applyProjection<ChargedFinalState>(e, "CFS");
00105
00106 size_t numOverall(0), numToward(0), numTrans1(0), numTrans2(0), numAway(0) ;
00107 double ptSumOverall(0.0), ptSumToward(0.0), ptSumTrans1(0.0), ptSumTrans2(0.0), ptSumAway(0.0);
00108
00109 double ptMaxOverall(0.0), ptMaxToward(0.0), ptMaxTrans1(0.0), ptMaxTrans2(0.0), ptMaxAway(0.0);
00110
00111
00112 foreach (const Particle& p, cfs.particles()) {
00113 const double dPhi = deltaPhi(p.momentum().phi(), jetphi);
00114 const double pT = p.momentum().pT();
00115 const double phi = p.momentum().phi();
00116 double rotatedphi = phi - jetphi;
00117 while (rotatedphi < 0) rotatedphi += 2*PI;
00118
00119 ptSumOverall += pT;
00120 ++numOverall;
00121 if (pT > ptMaxOverall) {
00122 ptMaxOverall = pT;
00123 }
00124
00125 if (dPhi < PI/3.0) {
00126 ptSumToward += pT;
00127 ++numToward;
00128 if (pT > ptMaxToward) ptMaxToward = pT;
00129 }
00130 else if (dPhi < 2*PI/3.0) {
00131 if (rotatedphi <= PI) {
00132 ptSumTrans1 += pT;
00133 ++numTrans1;
00134 if (pT > ptMaxTrans1) ptMaxTrans1 = pT;
00135 } else {
00136 ptSumTrans2 += pT;
00137 ++numTrans2;
00138 if (pT > ptMaxTrans2) ptMaxTrans2 = pT;
00139 }
00140 }
00141 else {
00142 ptSumAway += pT;
00143 ++numAway;
00144 if (pT > ptMaxAway) ptMaxAway = pT;
00145 }
00146 }
00147
00148
00149 #if 0
00150
00151
00152
00153 foreach (const Particle& p, fs.particles()) {
00154 const double dPhi = deltaPhi(p.momentum().phi(), jetphi);
00155 const double ET = p.momentum().Et();
00156 const double phi = p.momentum().phi();
00157 double rotatedphi = phi - jetphi;
00158 while (rotatedphi < 0) rotatedphi += 2*PI;
00159
00160 EtSumOverall += ET;
00161
00162 if (dPhi < PI/3.0) {
00163 EtSumToward += ET;
00164 }
00165 else if (dPhi < 2*PI/3.0) {
00166 if (rotatedphi <= PI) {
00167 EtSumTrans1 += ET;
00168 }
00169 else {
00170 EtSumTrans2 += ET;
00171 }
00172 }
00173 else {
00174 EtSumAway += ET;
00175 }
00176 }
00177 #endif
00178
00179
00180
00181
00182 _hist_pnchg->fill(jetpT/GeV, (numTrans1+numTrans2)/(4*PI/3), weight);
00183 _hist_pmaxnchg->fill(jetpT/GeV, (numTrans1>numTrans2 ? numTrans1 : numTrans2)/(2*PI/3), weight);
00184 _hist_pminnchg->fill(jetpT/GeV, (numTrans1<numTrans2 ? numTrans1 : numTrans2)/(2*PI/3), weight);
00185 _hist_pdifnchg->fill(jetpT/GeV, abs(numTrans1-numTrans2)/(2*PI/3), weight);
00186
00187
00188
00189 _hist_pcptsum->fill(jetpT/GeV, (ptSumTrans1+ptSumTrans2)/GeV/(4*PI/3), weight);
00190 _hist_pmaxcptsum->fill(jetpT/GeV, (ptSumTrans1>ptSumTrans2 ? ptSumTrans1 : ptSumTrans2)/GeV/(2*PI/3), weight);
00191 _hist_pmincptsum->fill(jetpT/GeV, (ptSumTrans1<ptSumTrans2 ? ptSumTrans1 : ptSumTrans2)/GeV/(2*PI/3), weight);
00192 _hist_pdifcptsum->fill(jetpT/GeV, fabs(ptSumTrans1-ptSumTrans2)/GeV/(2*PI/3), weight);
00193
00194
00195
00196
00197
00198
00199 if ((numTrans1+numTrans2) > 0) {
00200 _hist_pcptave->fill(jetpT/GeV, (ptSumTrans1+ptSumTrans2)/GeV/(numTrans1+numTrans2), weight);
00201
00202 }
00203
00204
00205
00206
00207 }
00208
00209
00210 void finalize() {
00211
00212 }
00213
00214
00215
00216
00217 private:
00218
00219 AIDA::IProfile1D *_hist_pnchg;
00220 AIDA::IProfile1D *_hist_pmaxnchg;
00221 AIDA::IProfile1D *_hist_pminnchg;
00222 AIDA::IProfile1D *_hist_pdifnchg;
00223 AIDA::IProfile1D *_hist_pcptsum;
00224 AIDA::IProfile1D *_hist_pmaxcptsum;
00225 AIDA::IProfile1D *_hist_pmincptsum;
00226 AIDA::IProfile1D *_hist_pdifcptsum;
00227 AIDA::IProfile1D *_hist_pcptave;
00228
00229 };
00230
00231
00232
00233
00234 AnalysisBuilder<CDF_2008_LEADINGJETS> plugin_CDF_2008_LEADINGJETS;
00235
00236 }