rivet is hosted by Hepforge, IPPP Durham
UA1_1990_S2044935.cc
Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include "Rivet/Analysis.hh"
00003 #include "Rivet/Projections/FinalState.hh"
00004 #include "Rivet/Projections/ChargedFinalState.hh"
00005 #include "Rivet/Projections/MissingMomentum.hh"
00006 
00007 namespace Rivet {
00008 
00009 
00010   /// @brief UA1 minbias track multiplicities, \f$ p_\perp \f$ and \f$ E_\perp \f$
00011   class UA1_1990_S2044935 : public Analysis {
00012   public:
00013 
00014     /// Constructor
00015     UA1_1990_S2044935() : Analysis("UA1_1990_S2044935") {
00016       _sumwTrig = 0;
00017       _sumwTrig08 = 0;
00018       _sumwTrig40 = 0;
00019       _sumwTrig80 = 0;
00020     }
00021 
00022 
00023     /// @name Analysis methods
00024     //@{
00025 
00026     /// Book projections and histograms
00027     void init() {
00028       addProjection(ChargedFinalState(-5.5, 5.5), "TriggerFS");
00029       addProjection(ChargedFinalState(-2.5, 2.5), "TrackFS");
00030       const FinalState trkcalofs(-2.5, 2.5);
00031       addProjection(MissingMomentum(trkcalofs), "MET25");
00032       const FinalState calofs(-6.0, 6.0);
00033       addProjection(MissingMomentum(calofs), "MET60");
00034 
00035       if (fuzzyEquals(sqrtS()/GeV, 63)) {
00036         _hist_Pt = bookProfile1D(8,1,1);
00037       } else if (fuzzyEquals(sqrtS()/GeV, 200)) {
00038         _hist_Nch = bookHisto1D(1,1,1);
00039         _hist_Esigd3p = bookHisto1D(2,1,1);
00040         _hist_Pt = bookProfile1D(6,1,1);
00041         _hist_Et = bookHisto1D(9,1,1);
00042         _hist_Etavg = bookProfile1D(12,1,1);
00043       } else if (fuzzyEquals(sqrtS()/GeV, 500)) {
00044         _hist_Nch = bookHisto1D(1,1,2);
00045         _hist_Esigd3p = bookHisto1D(2,1,2);
00046         _hist_Et = bookHisto1D(10,1,1);
00047         _hist_Etavg = bookProfile1D(12,1,2);
00048       } else if (fuzzyEquals(sqrtS()/GeV, 900)) {
00049         _hist_Nch = bookHisto1D(1,1,3);
00050         _hist_Esigd3p = bookHisto1D(2,1,3);
00051         _hist_Pt = bookProfile1D(7,1,1);
00052         _hist_Et = bookHisto1D(11,1,1);
00053         _hist_Etavg = bookProfile1D(12,1,3);
00054         _hist_Esigd3p08 = bookHisto1D(3,1,1);
00055         _hist_Esigd3p40 = bookHisto1D(4,1,1);
00056         _hist_Esigd3p80 = bookHisto1D(5,1,1);
00057       }
00058 
00059     }
00060 
00061 
00062     void analyze(const Event& event) {
00063       // Trigger
00064       const FinalState& trigfs = applyProjection<FinalState>(event, "TriggerFS");
00065       unsigned int n_minus(0), n_plus(0);
00066       foreach (const Particle& p, trigfs.particles()) {
00067         const double eta = p.eta();
00068         if (inRange(eta, -5.5, -1.5)) n_minus++;
00069         else if (inRange(eta, 1.5, 5.5)) n_plus++;
00070       }
00071       MSG_DEBUG("Trigger -: " << n_minus << ", Trigger +: " << n_plus);
00072       if (n_plus == 0 || n_minus == 0) vetoEvent;
00073       const double weight = event.weight();
00074       _sumwTrig += weight;
00075 
00076       // Use good central detector tracks
00077       const FinalState& cfs = applyProjection<FinalState>(event, "TrackFS");
00078       const double Et25 = applyProjection<MissingMomentum>(event, "MET25").scalarEt();
00079       const double Et60 = applyProjection<MissingMomentum>(event, "MET60").scalarEt();
00080       const unsigned int nch = cfs.size();
00081 
00082       // Event level histos
00083       if (!fuzzyEquals(sqrtS()/GeV, 63, 1E-3)) {
00084         _hist_Nch->fill(nch, weight);
00085         _hist_Et->fill(Et60/GeV, weight);
00086         _hist_Etavg->fill(nch, Et25/GeV, weight);
00087       }
00088 
00089       // Particle/track level histos
00090       const double deta = 2 * 5.0;
00091       const double dphi = TWOPI;
00092       const double dnch_deta = nch/deta;
00093       foreach (const Particle& p, cfs.particles()) {
00094         const double pt = p.pT();
00095         const double scaled_weight = weight/(deta*dphi*pt/GeV);
00096         if (!fuzzyEquals(sqrtS()/GeV, 500, 1E-3)) {
00097           _hist_Pt->fill(nch, pt/GeV, weight);
00098         }
00099         if (!fuzzyEquals(sqrtS()/GeV, 63, 1E-3)) {
00100           _hist_Esigd3p->fill(pt/GeV, scaled_weight);
00101         }
00102         // Also fill for specific dn/deta ranges at 900 GeV
00103         if (fuzzyEquals(sqrtS()/GeV, 900, 1E-3)) {
00104           if (inRange(dnch_deta, 0.8, 4.0)) {
00105             _sumwTrig08 += weight;
00106             _hist_Esigd3p08->fill(pt/GeV, scaled_weight);
00107           } else if (inRange(dnch_deta, 4.0, 8.0)) {
00108             _sumwTrig40 += weight;
00109             _hist_Esigd3p40->fill(pt/GeV, scaled_weight);
00110           } else {
00111             //MSG_WARNING(dnch_deta);
00112             if (dnch_deta > 8.0) {
00113               _sumwTrig80 += weight;
00114               _hist_Esigd3p80->fill(pt/GeV, scaled_weight);
00115             }
00116           }
00117         }
00118       }
00119 
00120     }
00121 
00122 
00123     void finalize() {
00124       if (_sumwTrig <= 0) {
00125         MSG_WARNING("No events passed the trigger!");
00126         return;
00127       }
00128       const double xsec = crossSectionPerEvent();
00129       if (!fuzzyEquals(sqrtS()/GeV, 63, 1E-3)) {
00130         scale(_hist_Nch, 2*xsec/millibarn); //< Factor of 2 for Nch bin widths?
00131         scale(_hist_Esigd3p, xsec/millibarn);
00132         scale(_hist_Et, xsec/millibarn);
00133       }
00134       if (fuzzyEquals(sqrtS()/GeV, 900, 1E-3)) {
00135         // NB. Ref data is normalised to a fixed value not reproducible from MC.
00136         const double scale08 =  (_hist_Esigd3p08->bin(0).area() > 0) ?
00137           0.933e5/_hist_Esigd3p08->bin(0).height() : 0;
00138         scale(_hist_Esigd3p08, scale08);
00139         const double scale40 = (_hist_Esigd3p40->bin(0).area() > 0) ?
00140           1.369e5/_hist_Esigd3p40->bin(0).height() : 0;
00141         scale(_hist_Esigd3p40, scale40);
00142         const double scale80 = (_hist_Esigd3p80->bin(0).area() > 0) ?
00143           1.657e5/_hist_Esigd3p80->bin(0).height() : 0;
00144         scale(_hist_Esigd3p80, scale80);
00145       }
00146     }
00147 
00148     //@}
00149 
00150 
00151   private:
00152 
00153     /// @name Weight counters
00154     //@{
00155     double _sumwTrig, _sumwTrig08, _sumwTrig40, _sumwTrig80;
00156     //@}
00157 
00158     /// @name Histogram collections
00159     //@{
00160     Histo1DPtr _hist_Nch;
00161     Histo1DPtr _hist_Esigd3p;
00162     Histo1DPtr _hist_Esigd3p08;
00163     Histo1DPtr _hist_Esigd3p40;
00164     Histo1DPtr _hist_Esigd3p80;
00165     Profile1DPtr _hist_Pt;
00166     Profile1DPtr _hist_Etavg;
00167     Histo1DPtr _hist_Et;
00168     //@}
00169 
00170   };
00171 
00172 
00173 
00174   // The hook for the plugin system
00175   DECLARE_RIVET_PLUGIN(UA1_1990_S2044935);
00176 
00177 }