rivet is hosted by Hepforge, IPPP Durham
ATLAS_2012_I1124167.cc
Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include "Rivet/Analysis.hh"
00003 #include "Rivet/Projections/ChargedFinalState.hh"
00004 #include "Rivet/Projections/FinalState.hh"
00005 #include "Rivet/Projections/Thrust.hh"
00006 #include "Rivet/Projections/Sphericity.hh"
00007 
00008 namespace Rivet {
00009 
00010 
00011   /// Rivet analysis class for ATLAS min bias event shapes
00012   class ATLAS_2012_I1124167 : public Analysis {
00013   public:
00014 
00015     /// Constructor
00016     ATLAS_2012_I1124167()
00017       : Analysis("ATLAS_2012_I1124167") {  }
00018 
00019 
00020     /// Initialization, called once before running
00021     void init() {
00022       // Projections
00023       ChargedFinalState cfs(-2.5, 2.5, 0.5*GeV);
00024       addProjection(cfs, "CFS");
00025       addProjection(Sphericity(cfs), "Sphericity");
00026 
00027       // Book histograms
00028       _hist_T_05_25 = bookHisto1D(1,1,1);
00029       _hist_T_05    = bookHisto1D(2,1,1);
00030       _hist_T_25_50 = bookHisto1D(1,1,2);
00031       _hist_T_25    = bookHisto1D(2,1,2);
00032       _hist_T_50_75 = bookHisto1D(1,1,3);
00033       _hist_T_50    = bookHisto1D(2,1,3);
00034       _hist_T_75_100= bookHisto1D(1,1,4);
00035       _hist_T_75    = bookHisto1D(2,1,4);
00036       _hist_T_100   = bookHisto1D(2,1,5);
00037 
00038       _hist_TM_05_25 = bookHisto1D(3,1,1);
00039       _hist_TM_05    = bookHisto1D(4,1,1);
00040       _hist_TM_25_50 = bookHisto1D(3,1,2);
00041       _hist_TM_25    = bookHisto1D(4,1,2);
00042       _hist_TM_50_75 = bookHisto1D(3,1,3);
00043       _hist_TM_50    = bookHisto1D(4,1,3);
00044       _hist_TM_75_100= bookHisto1D(3,1,4);
00045       _hist_TM_75    = bookHisto1D(4,1,4);
00046       _hist_TM_100   = bookHisto1D(4,1,5);
00047 
00048       _hist_S_05_25 = bookHisto1D(5,1,1);
00049       _hist_S_05    = bookHisto1D(6,1,1);
00050       _hist_S_25_50 = bookHisto1D(5,1,2);
00051       _hist_S_25    = bookHisto1D(6,1,2);
00052       _hist_S_50_75 = bookHisto1D(5,1,3);
00053       _hist_S_50    = bookHisto1D(6,1,3);
00054       _hist_S_75_100= bookHisto1D(5,1,4);
00055       _hist_S_75    = bookHisto1D(6,1,4);
00056       _hist_S_100   = bookHisto1D(6,1,5);
00057 
00058 
00059       _hist_T_N  = bookProfile1D(7,1,1);
00060       _hist_TM_N = bookProfile1D(7,1,2);
00061       _hist_S_N  = bookProfile1D(7,1,3);
00062 
00063       _hist_T_S  = bookProfile1D(8,1,1);
00064       _hist_TM_S = bookProfile1D(8,1,2);
00065       _hist_S_S  = bookProfile1D(8,1,3);
00066     }
00067 
00068 
00069     void analyze(const Event& event) {
00070       const double weight = event.weight();
00071 
00072       // CFS projection and particles
00073       const ChargedFinalState& cfs500 = applyProjection<ChargedFinalState>(event, "CFS");
00074       ParticleVector particles500 = cfs500.particlesByPt();
00075 
00076       // Require at least 6 charged particles
00077       if (cfs500.size() < 6) vetoEvent;
00078 
00079       // Preparation for Thrust calculation
00080       vector<Vector3> momenta;
00081 
00082       // Counters
00083       double num500 = 0;
00084       double ptSum500 = 0;
00085 
00086       double pTlead = particles500[0].pT()/GeV;
00087 
00088       // Loop over particles
00089       foreach (const Particle& p, particles500) {
00090         num500 += 1;
00091         ptSum500 += p.pT()/GeV;
00092 
00093         // Transverse Thrust calculation requires p_z to be set to 0
00094         Vector3 mom = p.p3();
00095         mom.setZ(0.0);
00096         momenta.push_back(mom);
00097       }
00098 
00099       // If only 2 particles, we need to use a ghost so that Thrust.calc() doesn't return 1.
00100       if (momenta.size() == 2) {
00101         momenta.push_back(Vector3(1e-10*MeV, 0., 0.));
00102       }
00103 
00104       // Actual thrust calculation
00105       Thrust thrust;
00106       thrust.calc(momenta);
00107 
00108       const double T  = 1.0 - thrust.thrust();
00109       const double TM = thrust.thrustMajor();
00110 
00111       Sphericity sphericity;
00112       sphericity.calc(momenta);
00113 
00114       const double S = sphericity.transSphericity();
00115 
00116       // Fill histos, most inclusive first
00117 
00118       // pTlead > 0.5
00119       _hist_T_05->fill(T , weight);
00120       _hist_TM_05->fill(TM, weight);
00121       _hist_S_05->fill(S , weight);
00122 
00123       // pTlead 0.5 - 2.5
00124       if (pTlead <= 2.5) {
00125         _hist_T_05_25->fill(T , weight);
00126         _hist_TM_05_25->fill(TM, weight);
00127         _hist_S_05_25->fill(S , weight);
00128       }
00129 
00130       // pTlead > 2.5
00131       if (pTlead > 2.5) {
00132         _hist_T_25->fill(T , weight);
00133         _hist_TM_25->fill(TM, weight);
00134         _hist_S_25->fill(S , weight);
00135       }
00136 
00137       // pTlead 2.5 - .5
00138       if (inRange(pTlead, 2.5, 5.0)) {
00139         _hist_T_25_50->fill(T , weight);
00140         _hist_TM_25_50->fill(TM, weight);
00141         _hist_S_25_50->fill(S , weight);
00142       }
00143 
00144       // pTlead > 5
00145       if (pTlead > 5) {
00146         _hist_T_50->fill(T , weight);
00147         _hist_TM_50->fill(TM, weight);
00148         _hist_S_50->fill(S , weight);
00149       }
00150 
00151       // pTlead 5 - 7.5
00152       if (inRange(pTlead, 5.0, 7.5)) {
00153         _hist_T_50_75->fill(T , weight);
00154         _hist_TM_50_75->fill(TM, weight);
00155         _hist_S_50_75->fill(S , weight);
00156       }
00157 
00158       // pTlead > 7.5
00159       if (pTlead > 7.5) {
00160         _hist_T_75->fill(T , weight);
00161         _hist_TM_75->fill(TM, weight);
00162         _hist_S_75->fill(S , weight);
00163       }
00164 
00165       // pTlead 7.5 - 10
00166       if (inRange(pTlead, 7.5, 10)) {
00167         _hist_T_75_100->fill(T , weight);
00168         _hist_TM_75_100->fill(TM, weight);
00169         _hist_S_75_100->fill(S , weight);
00170       }
00171 
00172       // pTlead > 10
00173       if (pTlead > 10) {
00174         _hist_T_100->fill(T , weight);
00175         _hist_TM_100->fill(TM, weight);
00176         _hist_S_100->fill(S , weight);
00177       }
00178 
00179 
00180       // Profiles Nch vs. ES
00181       _hist_T_N->fill(num500, T, weight);
00182       _hist_TM_N->fill(num500, TM, weight);
00183       _hist_S_N->fill(num500, S, weight);
00184 
00185       // Profiles pTsum vs. ES
00186       _hist_T_S->fill(ptSum500, T, weight);
00187       _hist_TM_S->fill(ptSum500, TM, weight);
00188       _hist_S_S->fill(ptSum500, S, weight);
00189     }
00190 
00191 
00192     void finalize() {
00193       normalize(_hist_T_05_25);
00194       normalize(_hist_T_05);
00195       normalize(_hist_T_25_50);
00196       normalize(_hist_T_25);
00197       normalize(_hist_T_50_75);
00198       normalize(_hist_T_50);
00199       normalize(_hist_T_75_100);
00200       normalize(_hist_T_75);
00201       normalize(_hist_T_100);
00202 
00203       normalize(_hist_TM_05_25);
00204       normalize(_hist_TM_05);
00205       normalize(_hist_TM_25_50);
00206       normalize(_hist_TM_25);
00207       normalize(_hist_TM_50_75);
00208       normalize(_hist_TM_50);
00209       normalize(_hist_TM_75_100);
00210       normalize(_hist_TM_75);
00211       normalize(_hist_TM_100);
00212 
00213       normalize(_hist_S_05_25);
00214       normalize(_hist_S_05);
00215       normalize(_hist_S_25_50);
00216       normalize(_hist_S_25);
00217       normalize(_hist_S_50_75);
00218       normalize(_hist_S_50);
00219       normalize(_hist_S_75_100);
00220       normalize(_hist_S_75);
00221       normalize(_hist_S_100);
00222     }
00223 
00224 
00225   private:
00226 
00227     Histo1DPtr _hist_T_05_25, _hist_T_05, _hist_T_25_50, _hist_T_25, _hist_T_50_75, _hist_T_50, _hist_T_75_100, _hist_T_75, _hist_T_100;
00228     Histo1DPtr _hist_TM_05_25, _hist_TM_05, _hist_TM_25_50, _hist_TM_25, _hist_TM_50_75, _hist_TM_50, _hist_TM_75_100, _hist_TM_75, _hist_TM_100;
00229     Histo1DPtr _hist_S_05_25, _hist_S_05, _hist_S_25_50, _hist_S_25, _hist_S_50_75, _hist_S_50, _hist_S_75_100, _hist_S_75, _hist_S_100;
00230     Profile1DPtr _hist_T_N, _hist_TM_N, _hist_S_N;
00231     Profile1DPtr _hist_T_S, _hist_TM_S, _hist_S_S;
00232 
00233   };
00234 
00235 
00236   // The hook for the plugin system
00237   DECLARE_RIVET_PLUGIN(ATLAS_2012_I1124167);
00238 
00239 }