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