rivet is hosted by Hepforge, IPPP Durham
ALICE_2015_I1357424.cc
Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include "Rivet/Analysis.hh"
00003 #include "Rivet/Projections/ChargedFinalState.hh"
00004 
00005 namespace Rivet {
00006 
00007 
00008   class ALICE_2015_I1357424 : public Analysis {
00009   public:
00010 
00011     ALICE_2015_I1357424()
00012       : Analysis("ALICE_2015_I1357424")
00013     {}
00014 
00015 
00016   public:
00017 
00018     void init() {
00019       const ChargedFinalState cfs(Cuts::absrap<0.5);
00020       addProjection(cfs, "CFS");
00021       //
00022       // plots from the paper
00023       _histPtPions          = bookHisto1D("d01-x01-y01");    // pions
00024       _histPtKaons          = bookHisto1D("d01-x01-y02");    // kaons
00025       _histPtProtons        = bookHisto1D("d01-x01-y03");    // protons
00026       _histPtKtoPi          = bookScatter2D("d02-x01-y01");  // K to pi ratio 
00027       _histPtPtoPi          = bookScatter2D("d03-x01-y01");  // p to pi ratio
00028       //
00029       // temp histos for ratios
00030       _histPtPionsR1        = bookHisto1D("TMP/pT_pi1", refData(2, 1, 1)); // pi histo compatible with more restricted kaon binning
00031       _histPtPionsR2        = bookHisto1D("TMP/pT_pi2", refData(3, 1, 1)); // pi histo compatible with more restricted proton binning
00032       _histPtKaonsR         = bookHisto1D("TMP/pT_K",   refData(2, 1, 1)); // K histo with more restricted binning
00033       _histPtProtonsR       = bookHisto1D("TMP/pT_p",   refData(3, 1, 1)); // p histo with more restricted binning
00034     }
00035 
00036 
00037     void analyze(const Event& event) {
00038       const double weight = event.weight();
00039       const ChargedFinalState& cfs = applyProjection<ChargedFinalState>(event, "CFS");
00040       foreach (const Particle& p, cfs.particles()) {
00041     // protections against mc generators decaying long-lived particles
00042     if ( !(p.hasAncestor(310)  || p.hasAncestor(-310)  ||     // K0s
00043            p.hasAncestor(130)  || p.hasAncestor(-130)  ||     // K0l
00044            p.hasAncestor(3322) || p.hasAncestor(-3322) ||     // Xi0
00045            p.hasAncestor(3122) || p.hasAncestor(-3122) ||     // Lambda
00046            p.hasAncestor(3222) || p.hasAncestor(-3222) ||     // Sigma+/-
00047            p.hasAncestor(3312) || p.hasAncestor(-3312) ||     // Xi-/+ 
00048        p.hasAncestor(3334) || p.hasAncestor(-3334) ))     // Omega-/+     
00049         {  
00050       switch (abs(p.pid())) {
00051       case 211: // pi+
00052         _histPtPions->fill(p.pT()/GeV, weight);
00053         _histPtPionsR1->fill(p.pT()/GeV, weight);
00054         _histPtPionsR2->fill(p.pT()/GeV, weight);
00055         break;
00056       case 2212: // proton
00057         _histPtProtons->fill(p.pT()/GeV, weight);
00058         _histPtProtonsR->fill(p.pT()/GeV, weight);
00059         break;
00060       case 321: // K+
00061         _histPtKaons->fill(p.pT()/GeV, weight);
00062         _histPtKaonsR->fill(p.pT()/GeV, weight);
00063         break;
00064       } // particle switch
00065     } // primary pi, K, p only
00066       } // particle loop
00067     }    
00068 
00069     void finalize() {
00070       divide(_histPtKaonsR,   _histPtPionsR1, _histPtKtoPi);
00071       divide(_histPtProtonsR, _histPtPionsR2, _histPtPtoPi);
00072 
00073       scale(_histPtPions,       1./sumOfWeights());
00074       scale(_histPtProtons,     1./sumOfWeights());
00075       scale(_histPtKaons,       1./sumOfWeights());
00076     }
00077 
00078 
00079   private:
00080 
00081     Histo1DPtr _histPtPions;
00082     Histo1DPtr _histPtProtons;
00083     Histo1DPtr _histPtKaons;
00084 
00085     Histo1DPtr _histPtPionsR1;
00086     Histo1DPtr _histPtPionsR2;
00087     Histo1DPtr _histPtProtonsR;
00088     Histo1DPtr _histPtKaonsR;
00089 
00090     Scatter2DPtr _histPtKtoPi;
00091     Scatter2DPtr _histPtPtoPi;
00092   };
00093 
00094 
00095 
00096   // The hook for the plugin system
00097   DECLARE_RIVET_PLUGIN(ALICE_2015_I1357424);
00098 
00099 }