CDF_2001_S4751469.cc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 // Field & Stuart underlying event analysis at CDF.
00004 // Phys.Rev.D65:092002,2002 - no arXiv code.
00005 // FNAL-PUB 01/211-E
00006 
00007 #include "Rivet/Analysis.hh"
00008 #include "Rivet/RivetAIDA.hh"
00009 #include "Rivet/Tools/Logging.hh"
00010 #include "Rivet/Projections/ChargedFinalState.hh"
00011 #include "Rivet/Projections/ConstLossyFinalState.hh"
00012 #include "Rivet/Projections/FastJets.hh"
00013 #include "Rivet/Projections/TriggerCDFRun0Run1.hh"
00014 #include "LWH/Profile1D.h"
00015 
00016 namespace Rivet {
00017 
00018 
00019   /// @brief "Field-Stuart" CDF Run I track-jet underlying event analysis
00020   ///
00021   /// @author Andy Buckley
00022   ///
00023   /// The "original" underlying event analysis, using a non-standard track-jet algorithm.
00024   ///
00025   /// @par Run conditions
00026   ///
00027   /// @arg \f$ \sqrt{s} = \f$ 1800 GeV
00028   /// @arg Run with generic QCD events.
00029   /// @arg Several \f$ p_\perp^\text{min} \f$ cutoffs are probably required to fill the profile histograms:
00030   ///   @arg \f$ p_\perp^\text{min} = \f$ 0 (min bias), 10, 20 GeV
00031   class CDF_2001_S4751469 : public Analysis {
00032   public:
00033 
00034     /// Constructor: cuts on final state are \f$ -1 < \eta < 1 \f$
00035     /// and \f$ p_T > 0.5 \f$ GeV.
00036     CDF_2001_S4751469()
00037       : Analysis("CDF_2001_S4751469"),
00038         _totalNumTrans2(0), _totalNumTrans5(0), _totalNumTrans30(0),
00039         _sumWeightsPtLead2(0),_sumWeightsPtLead5(0), _sumWeightsPtLead30(0)
00040     {
00041     }
00042 
00043 
00044     /// @name Analysis methods
00045     //@{
00046 
00047     // Book histograms
00048     void init() {
00049       addProjection(TriggerCDFRun0Run1(), "Trigger");
00050       // Randomly discard 8% of charged particles as a kind of hacky detector correction.
00051       const ChargedFinalState cfs(-1.0, 1.0, 0.5*GeV);
00052       const ConstLossyFinalState lfs(cfs, 0.08);
00053 
00054       // const LossyFinalState<StarRandomFilter> lfs(cfs, StarRandomFilter());
00055       addProjection(lfs, "FS");
00056       addProjection(FastJets(lfs, FastJets::TRACKJET, 0.7), "TrackJet");
00057 
00058       _numvsDeltaPhi2 =  bookProfile1D(1, 1, 1);
00059       _numvsDeltaPhi5 =  bookProfile1D(1, 1, 2);
00060       _numvsDeltaPhi30 = bookProfile1D(1, 1, 3);
00061       _pTvsDeltaPhi2 =   bookProfile1D(2, 1, 1);
00062       _pTvsDeltaPhi5 =   bookProfile1D(2, 1, 2);
00063       _pTvsDeltaPhi30 =  bookProfile1D(2, 1, 3);
00064 
00065       _numTowardMB = bookProfile1D(3, 1, 1);
00066       _numTransMB = bookProfile1D(3, 1, 2);
00067       _numAwayMB = bookProfile1D(3, 1, 3);
00068       _numTowardJ20 = bookProfile1D(4, 1, 1);
00069       _numTransJ20 = bookProfile1D(4, 1, 2);
00070       _numAwayJ20 = bookProfile1D(4, 1, 3);
00071 
00072       _ptsumTowardMB = bookProfile1D(5, 1, 1);
00073       _ptsumTransMB = bookProfile1D(5, 1, 2);
00074       _ptsumAwayMB = bookProfile1D(5, 1, 3);
00075       _ptsumTowardJ20 = bookProfile1D(6, 1, 1);
00076       _ptsumTransJ20 = bookProfile1D(6, 1, 2);
00077       _ptsumAwayJ20 = bookProfile1D(6, 1, 3);
00078 
00079       _ptTrans2 = bookHistogram1D(7, 1, 1);
00080       _ptTrans5 = bookHistogram1D(7, 1, 2);
00081       _ptTrans30 = bookHistogram1D(7, 1, 3);
00082     }
00083 
00084 
00085     /// Do the analysis
00086     void analyze(const Event& event) {
00087       // Trigger
00088       const bool trigger = applyProjection<TriggerCDFRun0Run1>(event, "Trigger").minBiasDecision();
00089       if (!trigger) vetoEvent;
00090 
00091       // Analyse, with pT > 0.5 GeV AND |eta| < 1
00092       const JetAlg& tj = applyProjection<JetAlg>(event, "TrackJet");
00093 
00094       // Final state (lossy) charged particles
00095       const FinalState& fs = applyProjection<FinalState>(event, "FS");
00096 
00097       // Get jets, sorted by pT
00098       const Jets jets = tj.jetsByPt();
00099       if (jets.empty()) {
00100         vetoEvent;
00101       }
00102 
00103       Jet leadingJet = jets.front();
00104       const double phiLead = leadingJet.ptWeightedPhi();
00105       const double ptLead = leadingJet.ptSum();
00106 
00107       // Cut on highest pT jet: combined 0.5 GeV < pT(lead) < 50 GeV
00108       if (ptLead/GeV < 0.5) vetoEvent;
00109       if (ptLead/GeV > 50.0) vetoEvent;
00110 
00111       // Get the event weight
00112       const double weight = event.weight();
00113 
00114       // Count sum of all event weights in three pT_lead regions
00115       if (ptLead/GeV > 2.0) {
00116         _sumWeightsPtLead2 += weight;
00117       }
00118       if (ptLead/GeV > 5.0) {
00119         _sumWeightsPtLead5 += weight;
00120       }
00121       if (ptLead/GeV > 30.0) {
00122         _sumWeightsPtLead30 += weight;
00123       }
00124 
00125       // Run over tracks
00126       double ptSumToward(0.0), ptSumAway(0.0), ptSumTrans(0.0);
00127       size_t numToward(0), numTrans(0), numAway(0);
00128 
00129       // Temporary histos that bin N and pT in dphi
00130       /// @todo Copy the permanent histos to get the binnings more robustly
00131       LWH::Profile1D hist_num_dphi_2(50, 0, 180), hist_num_dphi_5(50, 0, 180), hist_num_dphi_30(50, 0, 180);
00132       LWH::Profile1D hist_pt_dphi_2(50, 0, 180), hist_pt_dphi_5(50, 0, 180), hist_pt_dphi_30(50, 0, 180);
00133 
00134       foreach (const Particle& p, fs.particles()) {
00135         // Calculate DeltaPhi(p,leadingJet)
00136         const double dPhi = deltaPhi(p.momentum().phi(), phiLead);
00137         const double pT = p.momentum().pT();
00138 
00139         if (dPhi < PI/3.0) {
00140           ptSumToward += pT;
00141           ++numToward;
00142         }
00143         else if (dPhi < 2*PI/3.0) {
00144           ptSumTrans += pT;
00145           ++numTrans;
00146           // Fill transverse pT distributions
00147           if (ptLead/GeV > 2.0) {
00148             _ptTrans2->fill(pT/GeV, weight);
00149             _totalNumTrans2 += weight;
00150           }
00151           if (ptLead/GeV > 5.0) {
00152             _ptTrans5->fill(pT/GeV, weight);
00153             _totalNumTrans5 += weight;
00154           }
00155           if (ptLead/GeV > 30.0) {
00156             _ptTrans30->fill(pT/GeV, weight);
00157             _totalNumTrans30 += weight;
00158           }
00159         }
00160         else {
00161           ptSumAway += pT;
00162           ++numAway;
00163         }
00164 
00165         // Fill tmp histos to bin event's track Nch & pT in dphi
00166         const double dPhideg = 180*dPhi/PI;
00167         if (ptLead/GeV > 2.0) {
00168           hist_num_dphi_2.fill(dPhideg, 1);
00169           hist_pt_dphi_2.fill (dPhideg, pT/GeV);
00170         }
00171         if (ptLead/GeV > 5.0) {
00172           hist_num_dphi_5.fill(dPhideg, 1);
00173           hist_pt_dphi_5.fill (dPhideg, pT/GeV);
00174         }
00175         if (ptLead/GeV > 30.0) {
00176           hist_num_dphi_30.fill(dPhideg, 1);
00177           hist_pt_dphi_30.fill (dPhideg, pT/GeV);
00178         }
00179       }
00180 
00181       // Update the "proper" dphi profile histograms
00182       for (int i = 0; i < 50; i++) {
00183         if (ptLead/GeV > 2.0) {
00184           _numvsDeltaPhi2->fill(hist_num_dphi_2.binMean(i), hist_num_dphi_2.binHeight(i), weight);
00185           _pTvsDeltaPhi2->fill(hist_pt_dphi_2.binMean(i), hist_pt_dphi_2.binHeight(i), weight);
00186         }
00187         if (ptLead/GeV > 5.0) {
00188           _numvsDeltaPhi5->fill(hist_num_dphi_5.binMean(i), hist_num_dphi_5.binHeight(i), weight);
00189           _pTvsDeltaPhi5->fill(hist_pt_dphi_5.binMean(i), hist_pt_dphi_5.binHeight(i), weight);
00190         }
00191         if (ptLead/GeV > 30.0) {
00192           _numvsDeltaPhi30->fill(hist_num_dphi_30.binMean(i), hist_num_dphi_30.binHeight(i), weight);
00193           _pTvsDeltaPhi30->fill(hist_pt_dphi_30.binMean(i), hist_pt_dphi_30.binHeight(i), weight);
00194         }
00195       }
00196 
00197       // Log some event details about pT
00198       MSG_DEBUG("pT [lead; twd, away, trans] = [" << ptLead << "; "
00199                 << ptSumToward << ", " << ptSumAway << ", " << ptSumTrans << "]");
00200 
00201       // Update the pT profile histograms
00202       _ptsumTowardMB->fill(ptLead/GeV, ptSumToward/GeV, weight);
00203       _ptsumTowardJ20->fill(ptLead/GeV, ptSumToward/GeV, weight);
00204 
00205       _ptsumTransMB->fill(ptLead/GeV, ptSumTrans/GeV, weight);
00206       _ptsumTransJ20->fill(ptLead/GeV, ptSumTrans/GeV, weight);
00207 
00208       _ptsumAwayMB->fill(ptLead/GeV, ptSumAway/GeV, weight);
00209       _ptsumAwayJ20->fill(ptLead/GeV, ptSumAway/GeV, weight);
00210 
00211       // Log some event details about Nch
00212       MSG_DEBUG("N [twd, away, trans] = [" << ptLead << "; "
00213                << numToward << ", " << numTrans << ", " << numAway << "]");
00214 
00215       // Update the N_track profile histograms
00216       _numTowardMB->fill(ptLead/GeV, numToward, weight);
00217       _numTowardJ20->fill(ptLead/GeV, numToward, weight);
00218 
00219       _numTransMB->fill(ptLead/GeV, numTrans, weight);
00220       _numTransJ20->fill(ptLead/GeV, numTrans, weight);
00221 
00222       _numAwayMB->fill(ptLead/GeV, numAway, weight);
00223       _numAwayJ20->fill(ptLead/GeV, numAway, weight);
00224     }
00225 
00226 
00227     /// Normalize histos
00228     void finalize() {
00229       normalize(_ptTrans2, _totalNumTrans2 / _sumWeightsPtLead2);
00230       normalize(_ptTrans5, _totalNumTrans5 / _sumWeightsPtLead5);
00231       normalize(_ptTrans30, _totalNumTrans30 / _sumWeightsPtLead30);
00232     }
00233 
00234     //@}
00235 
00236 
00237   private:
00238 
00239     /// Sum total number of charged particles in the trans region, in 3 \f$ p_\perp^\text{lead} \f$ bins.
00240     double _totalNumTrans2, _totalNumTrans5, _totalNumTrans30;
00241 
00242     /// Sum the total number of events in 3 \f$ p_\perp^\text{lead} \f$ bins.
00243     double _sumWeightsPtLead2,_sumWeightsPtLead5, _sumWeightsPtLead30;
00244 
00245 
00246     /// @name Histogram collections
00247     //@{
00248     // These histos (binned in dphi) are filled per event and then reset
00249     // TODO: use LWH
00250     AIDA::IProfile1D *_hist_num_dphi_2, *_hist_num_dphi_5, *_hist_num_dphi_30;
00251     AIDA::IProfile1D *_hist_pt_dphi_2, *_hist_pt_dphi_5, *_hist_pt_dphi_30;
00252 
00253     // The sumpt vs. dphi and Nch vs. dphi histos
00254     AIDA::IProfile1D *_numvsDeltaPhi2, *_numvsDeltaPhi5, *_numvsDeltaPhi30;
00255     AIDA::IProfile1D *_pTvsDeltaPhi2, *_pTvsDeltaPhi5, *_pTvsDeltaPhi30;
00256 
00257 
00258     /// Profile histograms, binned in the \f$ p_T \f$ of the leading jet, for
00259     /// the \f$ p_T \f$ sum in the toward, transverse and away regions.
00260     AIDA::IProfile1D *_ptsumTowardMB,  *_ptsumTransMB,  *_ptsumAwayMB;
00261     AIDA::IProfile1D *_ptsumTowardJ20, *_ptsumTransJ20, *_ptsumAwayJ20;
00262 
00263     /// Profile histograms, binned in the \f$ p_T \f$ of the leading jet, for
00264     /// the number of charged particles per jet in the toward, transverse and
00265     /// away regions.
00266     AIDA::IProfile1D *_numTowardMB,  *_numTransMB,  *_numAwayMB;
00267     AIDA::IProfile1D *_numTowardJ20, *_numTransJ20, *_numAwayJ20;
00268 
00269     /// Histogram of \f$ p_T \f$ distribution for 3 different \f$ p_{T1} \f$ IR cutoffs.
00270     AIDA::IHistogram1D *_ptTrans2, *_ptTrans5, *_ptTrans30;
00271     //@}
00272 
00273   };
00274 
00275 
00276 
00277   // The hook for the plugin system
00278   DECLARE_RIVET_PLUGIN(CDF_2001_S4751469);
00279 
00280 }