00001
00002
00003
00004 #include "Rivet/Analysis.hh"
00005 #include "Rivet/Jet.hh"
00006 #include "Rivet/RivetAIDA.hh"
00007 #include "Rivet/Tools/Logging.hh"
00008 #include "Rivet/Projections/Beam.hh"
00009 #include "Rivet/Projections/ChargedFinalState.hh"
00010 #include "Rivet/Projections/FastJets.hh"
00011 #include "Rivet/Projections/TriggerCDFRun0Run1.hh"
00012
00013 namespace Rivet {
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 class CDF_2004_S5839831 : public Analysis {
00025 public:
00026
00027
00028
00029 CDF_2004_S5839831()
00030 : Analysis("CDF_2004_S5839831")
00031 {
00032 }
00033
00034
00035 private:
00036
00037
00038
00039
00040 struct ConesInfo {
00041 ConesInfo() : numMax(0), numMin(0), ptMax(0), ptMin(0), ptDiff(0) {}
00042 unsigned int numMax, numMin;
00043 double ptMax, ptMin, ptDiff;
00044 };
00045
00046
00047
00048 ConesInfo _calcTransCones(const double etaLead, const double phiLead,
00049 const ParticleVector& tracks) {
00050 const double phiTransPlus = mapAngle0To2Pi(phiLead + PI/2.0);
00051 const double phiTransMinus = mapAngle0To2Pi(phiLead - PI/2.0);
00052 MSG_DEBUG("phi_lead = " << phiLead
00053 << " -> trans = (" << phiTransPlus
00054 << ", " << phiTransMinus << ")");
00055
00056 unsigned int numPlus(0), numMinus(0);
00057 double ptPlus(0), ptMinus(0);
00058
00059 foreach (const Particle& t, tracks) {
00060 FourMomentum trackMom = t.momentum();
00061 const double pt = trackMom.pT();
00062
00063
00064 if (deltaR(trackMom, etaLead, phiTransPlus) < 0.7) {
00065 ptPlus += pt;
00066 numPlus += 1;
00067 } else if (deltaR(trackMom, etaLead, phiTransMinus) < 0.7) {
00068 ptMinus += pt;
00069 numMinus += 1;
00070 }
00071 }
00072
00073 ConesInfo rtn;
00074
00075 rtn.numMax = (ptPlus >= ptMinus) ? numPlus : numMinus;
00076 rtn.numMin = (ptPlus >= ptMinus) ? numMinus : numPlus;
00077
00078 rtn.ptMax = (ptPlus >= ptMinus) ? ptPlus : ptMinus;
00079 rtn.ptMin = (ptPlus >= ptMinus) ? ptMinus : ptPlus;
00080 rtn.ptDiff = fabs(rtn.ptMax - rtn.ptMin);
00081
00082 MSG_DEBUG("Min cone has " << rtn.numMin << " tracks -> "
00083 << "pT_min = " << rtn.ptMin/GeV << " GeV");
00084 MSG_DEBUG("Max cone has " << rtn.numMax << " tracks -> "
00085 << "pT_max = " << rtn.ptMax/GeV << " GeV");
00086
00087 return rtn;
00088 }
00089
00090
00091 ConesInfo _calcTransCones(const FourMomentum& leadvec,
00092 const ParticleVector& tracks) {
00093 const double etaLead = leadvec.pseudorapidity();
00094 const double phiLead = leadvec.azimuthalAngle();
00095 return _calcTransCones(etaLead, phiLead, tracks);
00096 }
00097
00098
00099
00100
00101
00102 void init() {
00103
00104 addProjection(TriggerCDFRun0Run1(), "Trigger");
00105 addProjection(Beam(), "Beam");
00106 const FinalState calofs(-1.2, 1.2);
00107 addProjection(calofs, "CaloFS");
00108 addProjection(FastJets(calofs, FastJets::CDFJETCLU, 0.7), "Jets");
00109 const ChargedFinalState trackfs(-1.2, 1.2, 0.4*GeV);
00110 addProjection(trackfs, "TrackFS");
00111
00112 const ChargedFinalState mbfs(-0.7, 0.7, 0.4*GeV);
00113 addProjection(mbfs, "MBFS");
00114
00115 const ChargedFinalState cheesefs(-1.0, 1.0, 0.4*GeV);
00116 addProjection(cheesefs, "CheeseFS");
00117 addProjection(FastJets(cheesefs, FastJets::CDFJETCLU, 0.7), "CheeseJets");
00118
00119
00120 if (fuzzyEquals(sqrtS()/GeV, 1800, 1E-3)) {
00121 _pt90MaxAvg1800 = bookProfile1D(1, 1, 1);
00122 _pt90MinAvg1800 = bookProfile1D(1, 1, 2);
00123 _pt90Max1800 = bookProfile1D(2, 1, 1);
00124 _pt90Min1800 = bookProfile1D(2, 1, 2);
00125 _pt90Diff1800 = bookProfile1D(2, 1, 3);
00126 _num90Max1800 = bookProfile1D(4, 1, 1);
00127 _num90Min1800 = bookProfile1D(4, 1, 2);
00128 _pTSum1800_2Jet = bookProfile1D(7, 1, 1);
00129 _pTSum1800_3Jet = bookProfile1D(7, 1, 2);
00130
00131 _pt90Dbn1800Et40 = bookHistogram1D(3, 1, 1);
00132 _pt90Dbn1800Et80 = bookHistogram1D(3, 1, 2);
00133 _pt90Dbn1800Et120 = bookHistogram1D(3, 1, 3);
00134 _pt90Dbn1800Et160 = bookHistogram1D(3, 1, 4);
00135 _pt90Dbn1800Et200 = bookHistogram1D(3, 1, 5);
00136 _numTracksDbn1800MB = bookHistogram1D(5, 1, 1);
00137 _ptDbn1800MB = bookHistogram1D(6, 1, 1);
00138 } else if (fuzzyEquals(sqrtS()/GeV, 630, 1E-3)) {
00139 _pt90Max630 = bookProfile1D(8, 1, 1);
00140 _pt90Min630 = bookProfile1D(8, 1, 2);
00141 _pt90Diff630 = bookProfile1D(8, 1, 3);
00142 _pTSum630_2Jet = bookProfile1D(9, 1, 1);
00143 _pTSum630_3Jet = bookProfile1D(9, 1, 2);
00144
00145 _numTracksDbn630MB = bookHistogram1D(10, 1, 1);
00146 _ptDbn630MB = bookHistogram1D(11, 1, 1);
00147 }
00148 }
00149
00150
00151
00152 void analyze(const Event& event) {
00153
00154 const bool trigger = applyProjection<TriggerCDFRun0Run1>(event, "Trigger").minBiasDecision();
00155 if (!trigger) vetoEvent;
00156
00157
00158 const double sqrtS = applyProjection<Beam>(event, "Beam").sqrtS();
00159 const double weight = event.weight();
00160
00161 {
00162 MSG_DEBUG("Running max/min analysis");
00163 vector<Jet> jets = applyProjection<JetAlg>(event, "Jets").jetsByE();
00164 if (!jets.empty()) {
00165
00166 const Jet leadingjet = jets.front();
00167 const double etaLead = leadingjet.momentum().eta();
00168
00169 const double ETlead = leadingjet.EtSum();
00170 MSG_DEBUG("Leading Et = " << ETlead/GeV << " GeV");
00171 if (fabs(etaLead) > 0.5 && ETlead < 15*GeV) {
00172 MSG_DEBUG("Leading jet eta = " << etaLead
00173 << " not in |eta| < 0.5 & pT > 15 GeV");
00174 } else {
00175
00176 const ParticleVector tracks = applyProjection<FinalState>(event, "TrackFS").particles();
00177 const ConesInfo cones = _calcTransCones(leadingjet.momentum(), tracks);
00178 if (fuzzyEquals(sqrtS/GeV, 630)) {
00179 _pt90Max630->fill(ETlead/GeV, cones.ptMax/GeV, weight);
00180 _pt90Min630->fill(ETlead/GeV, cones.ptMin/GeV, weight);
00181 _pt90Diff630->fill(ETlead/GeV, cones.ptDiff/GeV, weight);
00182 } else if (fuzzyEquals(sqrtS/GeV, 1800)) {
00183 _num90Max1800->fill(ETlead/GeV, cones.numMax, weight);
00184 _num90Min1800->fill(ETlead/GeV, cones.numMin, weight);
00185 _pt90Max1800->fill(ETlead/GeV, cones.ptMax/GeV, weight);
00186 _pt90Min1800->fill(ETlead/GeV, cones.ptMin/GeV, weight);
00187 _pt90Diff1800->fill(ETlead/GeV, cones.ptDiff/GeV, weight);
00188 _pt90MaxAvg1800->fill(ETlead/GeV, cones.ptMax/GeV, weight);
00189 _pt90MinAvg1800->fill(ETlead/GeV, cones.ptMin/GeV, weight);
00190
00191 const double ptTransTotal = cones.ptMax + cones.ptMin;
00192 if (inRange(ETlead/GeV, 40., 80.)) {
00193 _pt90Dbn1800Et40->fill(ptTransTotal/GeV, weight);
00194 } else if (inRange(ETlead/GeV, 80., 120.)) {
00195 _pt90Dbn1800Et80->fill(ptTransTotal/GeV, weight);
00196 } else if (inRange(ETlead/GeV, 120., 160.)) {
00197 _pt90Dbn1800Et120->fill(ptTransTotal/GeV, weight);
00198 } else if (inRange(ETlead/GeV, 160., 200.)) {
00199 _pt90Dbn1800Et160->fill(ptTransTotal/GeV, weight);
00200 } else if (inRange(ETlead/GeV, 200., 270.)) {
00201 _pt90Dbn1800Et200->fill(ptTransTotal/GeV, weight);
00202 }
00203 }
00204
00205 }
00206 }
00207 }
00208
00209
00210
00211 {
00212 MSG_DEBUG("Running min bias multiplicity analysis");
00213 const ParticleVector mbtracks = applyProjection<FinalState>(event, "MBFS").particles();
00214 if (fuzzyEquals(sqrtS/GeV, 1800)) {
00215 _numTracksDbn1800MB->fill(mbtracks.size(), weight);
00216 } else if (fuzzyEquals(sqrtS/GeV, 630)) {
00217 _numTracksDbn630MB->fill(mbtracks.size(), weight);
00218 }
00219
00220 foreach (const Particle& t, mbtracks) {
00221 FourMomentum trackMom = t.momentum();
00222 const double pt = trackMom.pT();
00223
00224 if (fuzzyEquals(sqrtS/GeV, 1800)) {
00225 _ptDbn1800MB->fill(pt/GeV, weight);
00226 } else if (fuzzyEquals(sqrtS/GeV, 630)) {
00227 _ptDbn630MB->fill(pt/GeV, weight);
00228 }
00229 }
00230 }
00231
00232
00233
00234
00235
00236
00237
00238 {
00239 MSG_DEBUG("Running Swiss Cheese analysis");
00240 const ParticleVector cheesetracks = applyProjection<FinalState>(event, "CheeseFS").particles();
00241 vector<Jet> cheesejets = applyProjection<JetAlg>(event, "Jets").jetsByE();
00242 if (cheesejets.empty()) {
00243 MSG_DEBUG("No 'cheese' jets found in event");
00244 return;
00245 }
00246 if (cheesejets.size() > 1 &&
00247 fabs(cheesejets[0].momentum().pseudorapidity()) <= 0.5 &&
00248 cheesejets[0].momentum().Et()/GeV > 5.0 &&
00249 cheesejets[1].momentum().Et()/GeV > 5.0) {
00250
00251 const double cheeseETlead = cheesejets[0].momentum().Et();
00252
00253 const double eta1 = cheesejets[0].momentum().pseudorapidity();
00254 const double phi1 = cheesejets[0].momentum().azimuthalAngle();
00255 const double eta2 = cheesejets[1].momentum().pseudorapidity();
00256 const double phi2 = cheesejets[1].momentum().azimuthalAngle();
00257
00258 double ptSumSub2(0), ptSumSub3(0);
00259 foreach (const Particle& t, cheesetracks) {
00260 FourMomentum trackMom = t.momentum();
00261 const double pt = trackMom.pT();
00262
00263
00264 const double deltaR1 = deltaR(trackMom, eta1, phi1);
00265 const double deltaR2 = deltaR(trackMom, eta2, phi2);
00266 MSG_TRACE("Track vs jet(1): "
00267 << "|(" << trackMom.pseudorapidity() << ", " << trackMom.azimuthalAngle() << ") - "
00268 << "|(" << eta1 << ", " << phi1 << ")| = " << deltaR1);
00269 MSG_TRACE("Track vs jet(2): "
00270 << "|(" << trackMom.pseudorapidity() << ", " << trackMom.azimuthalAngle() << ") - "
00271 << "|(" << eta2 << ", " << phi2 << ")| = " << deltaR2);
00272 if (deltaR1 > 0.7 && deltaR2 > 0.7) {
00273 ptSumSub2 += pt;
00274
00275
00276 if (cheesejets.size() > 2 &&
00277 cheesejets[2].momentum().Et()/GeV > 5.0) {
00278 const double eta3 = cheesejets[2].momentum().pseudorapidity();
00279 const double phi3 = cheesejets[2].momentum().azimuthalAngle();
00280 const double deltaR3 = deltaR(trackMom, eta3, phi3);
00281 MSG_TRACE("Track vs jet(3): "
00282 << "|(" << trackMom.pseudorapidity() << ", " << trackMom.azimuthalAngle() << ") - "
00283 << "|(" << eta3 << ", " << phi3 << ")| = " << deltaR3);
00284 if (deltaR3 > 0.7) {
00285 ptSumSub3 += pt;
00286 }
00287 }
00288 }
00289 }
00290
00291
00292 if (fuzzyEquals(sqrtS/GeV, 630)) {
00293 if (!isZero(ptSumSub2)) _pTSum630_2Jet->fill(cheeseETlead/GeV, ptSumSub2/GeV, weight);
00294 if (!isZero(ptSumSub3))_pTSum630_3Jet->fill(cheeseETlead/GeV, ptSumSub3/GeV, weight);
00295 } else if (fuzzyEquals(sqrtS/GeV, 1800)) {
00296 if (!isZero(ptSumSub2))_pTSum1800_2Jet->fill(cheeseETlead/GeV, ptSumSub2/GeV, weight);
00297 if (!isZero(ptSumSub3))_pTSum1800_3Jet->fill(cheeseETlead/GeV, ptSumSub3/GeV, weight);
00298 }
00299
00300 }
00301 }
00302
00303 }
00304
00305
00306 void finalize() {
00307
00308
00309 if (fuzzyEquals(sqrtS()/GeV, 1800, 1E-3)) {
00310
00311 normalize(_pt90Dbn1800Et40, 1656.75);
00312 normalize(_pt90Dbn1800Et80, 4657.5);
00313 normalize(_pt90Dbn1800Et120, 5395.5);
00314 normalize(_pt90Dbn1800Et160, 7248.75);
00315 normalize(_pt90Dbn1800Et200, 2442.0);
00316 }
00317
00318
00319 if (fuzzyEquals(sqrtS()/GeV, 1800, 1E-3)) {
00320 normalize(_numTracksDbn1800MB, 309718.25);
00321 normalize(_ptDbn1800MB, 33600.0);
00322 } else if (fuzzyEquals(sqrtS()/GeV, 630, 1E-3)) {
00323 normalize(_numTracksDbn630MB, 1101024.0);
00324 normalize(_ptDbn630MB, 105088.0);
00325 }
00326 }
00327
00328
00329
00330
00331 private:
00332
00333
00334
00335
00336
00337
00338
00339 AIDA::IProfile1D *_pt90MaxAvg1800, *_pt90MinAvg1800;
00340
00341
00342
00343
00344
00345 AIDA::IProfile1D *_pt90Max1800, *_pt90Min1800, *_pt90Diff1800;
00346
00347
00348
00349
00350
00351 AIDA::IProfile1D *_pt90Max630, *_pt90Min630, *_pt90Diff630;
00352
00353
00354
00355
00356 AIDA::IProfile1D *_num90Max1800, *_num90Min1800;
00357
00358
00359
00360
00361 AIDA::IProfile1D *_pTSum1800_2Jet, *_pTSum1800_3Jet;
00362
00363
00364
00365
00366 AIDA::IProfile1D *_pTSum630_2Jet, *_pTSum630_3Jet;
00367
00368
00369
00370
00371 AIDA::IHistogram1D *_pt90Dbn1800Et40, *_pt90Dbn1800Et80, *_pt90Dbn1800Et120,
00372 *_pt90Dbn1800Et160, *_pt90Dbn1800Et200;
00373
00374
00375
00376
00377
00378 AIDA::IHistogram1D *_numTracksDbn1800MB, *_ptDbn1800MB;
00379 AIDA::IHistogram1D *_numTracksDbn630MB, *_ptDbn630MB;
00380
00381
00382 };
00383
00384
00385
00386
00387 DECLARE_RIVET_PLUGIN(CDF_2004_S5839831);
00388
00389 }