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/TotalVisibleMomentum.hh"
00008 
00009 namespace Rivet {
00010 
00011 
00012   /// Minimum bias track analysis from UA1
00013   class UA1_1990_S2044935 : public Analysis {
00014   public:
00015 
00016     /// Constructor
00017     UA1_1990_S2044935() : Analysis("UA1_1990_S2044935") {
00018       setBeams(PROTON, ANTIPROTON);
00019       setNeedsCrossSection(true);
00020       _sumwTrig = 0;
00021       _sumwTrig08 = 0;
00022       _sumwTrig40 = 0;
00023       _sumwTrig80 = 0;
00024     }
00025  
00026 
00027     /// @name Analysis methods
00028     //@{
00029 
00030     /// Book projections and histograms
00031     void init() {
00032       addProjection(ChargedFinalState(-5.5, 5.5), "TriggerFS");
00033       addProjection(ChargedFinalState(-2.5, 2.5), "TrackFS");
00034       const FinalState trkcalofs(-2.5, 2.5);
00035       addProjection(TotalVisibleMomentum(trkcalofs), "MET25");
00036       const FinalState calofs(-6.0, 6.0);
00037       addProjection(TotalVisibleMomentum(calofs), "MET60");
00038 
00039       if (fuzzyEquals(sqrtS()/GeV, 63)) {
00040         _hist_Pt = bookProfile1D(8,1,1);
00041       } else if (fuzzyEquals(sqrtS()/GeV, 200)) {
00042         _hist_Nch = bookHistogram1D(1,1,1);
00043         _hist_Esigd3p = bookHistogram1D(2,1,1);
00044         _hist_Pt = bookProfile1D(6,1,1);
00045         _hist_Et = bookHistogram1D(9,1,1);
00046         _hist_Etavg = bookProfile1D(12,1,1);
00047       } else if (fuzzyEquals(sqrtS()/GeV, 500)) {
00048         _hist_Nch = bookHistogram1D(1,1,2);
00049         _hist_Esigd3p = bookHistogram1D(2,1,2);
00050         _hist_Et = bookHistogram1D(10,1,1);
00051         _hist_Etavg = bookProfile1D(12,1,2);
00052       } else if (fuzzyEquals(sqrtS()/GeV, 900)) {
00053         _hist_Nch = bookHistogram1D(1,1,3);
00054         _hist_Esigd3p = bookHistogram1D(2,1,3);
00055         _hist_Pt = bookProfile1D(7,1,1);
00056         _hist_Et = bookHistogram1D(11,1,1);
00057         _hist_Etavg = bookProfile1D(12,1,3);
00058         _hist_Esigd3p08 = bookHistogram1D(3,1,1);
00059         _hist_Esigd3p40 = bookHistogram1D(4,1,1);
00060         _hist_Esigd3p80 = bookHistogram1D(5,1,1);
00061       }
00062 
00063     }
00064  
00065 
00066     void analyze(const Event& event) {
00067       // Trigger
00068       const FinalState& trigfs = applyProjection<FinalState>(event, "TriggerFS");
00069       unsigned int n_minus(0), n_plus(0);
00070       foreach (const Particle& p, trigfs.particles()) {
00071         const double eta = p.momentum().eta();
00072         if (inRange(eta, -5.5, -1.5)) n_minus++;
00073         else if (inRange(eta, 1.5, 5.5)) n_plus++;
00074       }
00075       getLog() << Log::DEBUG << "Trigger -: " << n_minus << ", Trigger +: " << n_plus << endl;
00076       if (n_plus == 0 || n_minus == 0) vetoEvent;
00077       const double weight = event.weight();
00078       _sumwTrig += weight;
00079 
00080       // Use good central detector tracks
00081       const FinalState& cfs = applyProjection<FinalState>(event, "TrackFS");
00082       const double Et25 = applyProjection<TotalVisibleMomentum>(event, "MET25").scalarET();
00083       const double Et60 = applyProjection<TotalVisibleMomentum>(event, "MET60").scalarET();
00084       const unsigned int nch = cfs.size();
00085 
00086       // Event level histos
00087       _hist_Nch->fill(nch, weight);
00088       _hist_Et->fill(Et60/GeV, weight);
00089       _hist_Etavg->fill(nch, Et25/GeV, weight);
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 if(dnch_deta > 8.0) {
00113             _sumwTrig80 += weight;
00114             _hist_Esigd3p80->fill(pt/GeV, scaled_weight);
00115           }
00116         }
00117       }
00118    
00119     }
00120  
00121  
00122     void finalize() {
00123       if (_sumwTrig <= 0) {
00124         getLog() << Log::WARN << "No events passed the trigger!" << endl;
00125         return;
00126       }
00127       const double xsec = crossSectionPerEvent();
00128       scale(_hist_Nch, 2*xsec/millibarn); //< Factor of 2 for Nch bin widths?
00129       scale(_hist_Esigd3p, xsec/millibarn);
00130       scale(_hist_Et, xsec/millibarn);
00131       if (fuzzyEquals(sqrtS()/GeV, 900, 1E-3)) {
00132         // NB. Ref data is normalised to a fixed value. Note silly AIDA binHeight forgets the bin width.
00133         const double scale08 = 0.933e5/(_hist_Esigd3p08->binHeight(0)/_hist_Esigd3p08->axis().binWidth(0));
00134         scale(_hist_Esigd3p08, scale08);
00135         const double scale40 = 1.369e5/(_hist_Esigd3p40->binHeight(0)/_hist_Esigd3p40->axis().binWidth(0));
00136         scale(_hist_Esigd3p40, scale40);
00137         const double scale80 = 1.657e5/(_hist_Esigd3p80->binHeight(0)/_hist_Esigd3p80->axis().binWidth(0));
00138         scale(_hist_Esigd3p80, scale80);
00139       }
00140     }
00141  
00142     //@}
00143 
00144  
00145   private:
00146 
00147     /// @name Weight counters
00148     //@{
00149     double _sumwTrig, _sumwTrig08, _sumwTrig40, _sumwTrig80;
00150     //@}
00151 
00152     /// @name Histogram collections
00153     //@{
00154     AIDA::IHistogram1D* _hist_Nch;
00155     AIDA::IHistogram1D* _hist_Esigd3p;
00156     AIDA::IHistogram1D* _hist_Esigd3p08;
00157     AIDA::IHistogram1D* _hist_Esigd3p40;
00158     AIDA::IHistogram1D* _hist_Esigd3p80;
00159     AIDA::IProfile1D* _hist_Pt;
00160     AIDA::IProfile1D* _hist_Etavg;
00161     AIDA::IHistogram1D* _hist_Et;
00162     //@}
00163  
00164   };
00165 
00166 
00167 
00168   // This global object acts as a hook for the plugin system
00169   AnalysisBuilder<UA1_1990_S2044935> plugin_UA1_1990_S2044935;
00170 
00171 }