CMS_2011_S9120041.cc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 #include "Rivet/Analysis.hh"
00004 #include "Rivet/RivetAIDA.hh"
00005 #include "Rivet/Tools/Logging.hh"
00006 #include "Rivet/Projections/FinalState.hh"
00007 #include "Rivet/Projections/ChargedFinalState.hh"
00008 #include "Rivet/Projections/FastJets.hh"
00009 #include "Rivet/Projections/Beam.hh"
00010 
00011 using namespace std;
00012 
00013 namespace Rivet {
00014 
00015   // UE charged particles vs. leading jet
00016   class CMS_2011_S9120041 : public Analysis {
00017   public:
00018 
00019     /// Constructor
00020     CMS_2011_S9120041() : Analysis("CMS_2011_S9120041") {}
00021 
00022 
00023     void init() {
00024       const ChargedFinalState cfs(-2.0, 2.0, 500*MeV);
00025       addProjection(cfs, "CFS");
00026 
00027       const ChargedFinalState cfsforjet(-2.5, 2.5, 500*MeV); // tracks accepted are with pT > 0.5 GeV
00028       addProjection(cfsforjet, "CFSforjet");
00029 
00030 
00031       const FastJets jetpro(cfsforjet, FastJets::SISCONE, 0.5);
00032       addProjection(jetpro, "Jets");
00033       addProjection(Beam(), "Beam");
00034 
00035       _hist_profile_Nch_pT_7TeV = bookProfile1D(1, 1, 1); //Profile plot for No. of Charged particles vs. pT max for 7 TeV.
00036       _hist_profile_SumpT_pT_7TeV = bookProfile1D(2, 1, 1);   //Profile plot Trans. Momentum sum vs. pT max for 7 TeV.
00037       _hist_profile_Nch_09TeV = bookProfile1D(3, 1, 1);
00038       _hist_profile_Sum_09TeV = bookProfile1D(4, 1, 1);
00039       _hist_dist_Nch_7TeV_pT3 = bookHistogram1D(5, 1, 1);
00040       _hist_dist_Sum_7TeV_pT3 = bookHistogram1D(6, 1, 1);
00041       _hist_dist_pT_7TeV_pT3 = bookHistogram1D(7, 1, 1);
00042       _hist_dist_Nch_7TeV_pT20 = bookHistogram1D(8, 1, 1);
00043       _hist_dist_Sum_7TeV_pT20 = bookHistogram1D(9,1,1);
00044       _hist_dist_pT_7TeV_pT20 = bookHistogram1D(10, 1, 1);
00045       _hist_dist_Nch_09TeV_pT3 = bookHistogram1D(11, 1, 1); // No. of trans. charged particles Distribution for sqrt(s) = 0.9TeV, pT max > 3GeV.
00046       _hist_dist_Sum_09TeV_pT3 = bookHistogram1D(12 , 1, 1); // No. of trans. momentum sum Distribution for sqrt(s) = 0.9TeV, pT max > 3GeV.
00047       _hist_dist_pT_09TeV_pT3 = bookHistogram1D(13, 1, 1); // Trans. momentum Distribution for sqrt(s) = 0.9TeV, pT max > 3GeV.
00048 
00049       _j = 0.0;
00050       _jj = 0.0;
00051       _jjj = 0.0;
00052 
00053       _nch_tot_7TeV_pT3 = 0.0;
00054       _nch_tot_7TeV_pT20 = 0.0;
00055       _nch_tot_09TeV_pT3 = 0.0;
00056     }
00057 
00058 
00059     /// Perform the per-event analysis
00060     void analyze(const Event& event) {
00061       const double weight = event.weight();
00062 
00063       Jets jets = applyProjection<FastJets>(event, "Jets").jetsByPt(1.0*GeV);
00064       if (jets.size() < 1) vetoEvent;
00065 
00066       FourMomentum p_lead = jets[0].momentum();
00067       const double philead = p_lead.phi();
00068       const double pTlead  = p_lead.perp();
00069 
00070       ParticleVector particles =
00071           applyProjection<ChargedFinalState>(event, "CFS").particlesByPt();
00072 
00073       double nTransverse(0.0), ptSumTransverse(0.0), pT;
00074       foreach (const Particle& p, particles) {
00075         double dphi = fabs(deltaPhi(philead, p.momentum().phi()));
00076         double eta = fabs(p.momentum().eta());
00077         if (((PI/3.0 < dphi) && (dphi < 2.0*PI/3.0))&&(eta < 2.0)) {
00078           nTransverse += 1.0;
00079 
00080           ptSumTransverse += p.momentum().perp();
00081           pT = p.momentum().perp();
00082 
00083           if ( (fuzzyEquals(sqrtS(), 7.0*TeV)) && (pTlead > 20.0*GeV) )
00084             _hist_dist_pT_7TeV_pT20 -> fill(pT/GeV, weight);
00085 
00086           if ( (fuzzyEquals(sqrtS(), 7.0*TeV)) && (pTlead > 3.0*GeV) )
00087             _hist_dist_pT_7TeV_pT3 -> fill(pT/GeV, weight);
00088 
00089           if ( (fuzzyEquals(sqrtS(), 900.0*GeV)) && (pTlead > 3.0*GeV) )
00090             _hist_dist_pT_09TeV_pT3 -> fill(pT/GeV, weight);
00091         }
00092       }
00093 
00094 
00095       if (fuzzyEquals(sqrtS(), 7.0*TeV))
00096       {
00097         _hist_profile_Nch_pT_7TeV -> fill
00098             (pTlead/GeV, nTransverse / ((8.0 * PI/3.0)), weight);
00099 
00100         _hist_profile_SumpT_pT_7TeV -> fill
00101             (pTlead/GeV , ptSumTransverse / ((GeV * (8.0 * PI/3.0))) , weight);
00102         if(pTlead > 3.0*GeV)
00103         {
00104           _hist_dist_Nch_7TeV_pT3 -> fill(nTransverse, weight);
00105           _nch_tot_7TeV_pT3 += nTransverse*weight;
00106           _j += weight ;
00107           _hist_dist_Sum_7TeV_pT3 -> fill(ptSumTransverse / GeV, weight);
00108         }
00109         if(pTlead > 20.0*GeV)
00110         {
00111 
00112           _hist_dist_Nch_7TeV_pT20 -> fill(nTransverse, weight);
00113           _nch_tot_7TeV_pT20 += nTransverse*weight;
00114           _jj += weight;
00115 
00116           _hist_dist_Sum_7TeV_pT20 -> fill(ptSumTransverse / GeV, weight);
00117         }
00118       }
00119       else if (fuzzyEquals(sqrtS() , 900.0*GeV))
00120       {
00121         _hist_profile_Nch_09TeV -> fill(pTlead / GeV, nTransverse / ((8.0 * PI/3.0)), weight);
00122         _hist_profile_Sum_09TeV -> fill(pTlead / GeV, ptSumTransverse / ((GeV * (8.0 * PI/3.0))), weight);
00123 
00124 
00125         if(pTlead > 3.0*GeV)
00126         {
00127           _hist_dist_Nch_09TeV_pT3 -> fill(nTransverse, weight);
00128           _nch_tot_09TeV_pT3 += nTransverse*weight;
00129           _jjj += weight;
00130 
00131           _hist_dist_Sum_09TeV_pT3 -> fill(ptSumTransverse/GeV, weight);
00132         }
00133       }
00134     }
00135 
00136 
00137 
00138     /// Normalise histograms etc., after the run
00139     void finalize() {
00140       normalize(_hist_dist_Nch_7TeV_pT3);
00141       normalize(_hist_dist_Sum_7TeV_pT3);
00142       normalize(_hist_dist_Nch_7TeV_pT20);
00143       normalize(_hist_dist_Sum_7TeV_pT20);
00144       normalize(_hist_dist_Nch_09TeV_pT3);
00145       normalize(_hist_dist_Sum_09TeV_pT3);
00146 
00147       double _nch_avg_7TeV_pT3 = (_nch_tot_7TeV_pT3 / _j);
00148       double _nch_avg_7TeV_pT20 = (_nch_tot_7TeV_pT20 / _jj);
00149       double _nch_avg_09TeV_pT3 = (_nch_tot_09TeV_pT3 / _jjj);
00150 
00151       if (_j!=0.0) normalize(_hist_dist_pT_7TeV_pT20, _nch_avg_7TeV_pT20);
00152       if (_jj!=0.0) normalize(_hist_dist_pT_7TeV_pT3, _nch_avg_7TeV_pT3);
00153       if (_jjj!=0.0) normalize(_hist_dist_pT_09TeV_pT3, _nch_avg_09TeV_pT3);
00154     }
00155 
00156 
00157 
00158   private:
00159 
00160     double  _j;
00161     double _jj;
00162     double _jjj;
00163 
00164     double _nch_tot_7TeV_pT3;
00165     double _nch_tot_7TeV_pT20;
00166     double _nch_tot_09TeV_pT3;
00167 
00168     AIDA::IProfile1D * _hist_profile_Nch_pT_7TeV;
00169     AIDA::IProfile1D * _hist_profile_SumpT_pT_7TeV;
00170     AIDA::IProfile1D * _hist_profile_Nch_09TeV;
00171     AIDA::IProfile1D * _hist_profile_Sum_09TeV;
00172     AIDA::IHistogram1D * _hist_dist_Nch_7TeV_pT3 ;
00173     AIDA::IHistogram1D * _hist_dist_Sum_7TeV_pT3;
00174     AIDA::IHistogram1D * _hist_dist_pT_7TeV_pT3;
00175     AIDA::IHistogram1D * _hist_dist_Nch_7TeV_pT20;
00176     AIDA::IHistogram1D * _hist_dist_Sum_7TeV_pT20;
00177     AIDA::IHistogram1D * _hist_dist_pT_7TeV_pT20;
00178     AIDA::IHistogram1D * _hist_dist_Nch_09TeV_pT3;
00179     AIDA::IHistogram1D * _hist_dist_Sum_09TeV_pT3;
00180     AIDA::IHistogram1D * _hist_dist_pT_09TeV_pT3;
00181 
00182   };
00183 
00184 
00185   // This global object acts as a hook for the plugin system
00186   DECLARE_RIVET_PLUGIN(CMS_2011_S9120041);
00187 }
00188 
00189 
00190 
00191