UA1_1990_S2044935.cc

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