rivet is hosted by Hepforge, IPPP Durham
ALICE_2011_S8945144.cc
Go to the documentation of this file.
00001 #include "Rivet/Rivet.hh"
00002 #include "Rivet/Analysis.hh"
00003 #include "Rivet/Projections/ChargedFinalState.hh"
00004 #include "Rivet/RivetYODA.hh"
00005 
00006 namespace Rivet {
00007 
00008 
00009   class ALICE_2011_S8945144 : public Analysis {
00010   public:
00011 
00012     ALICE_2011_S8945144()
00013       : Analysis("ALICE_2011_S8945144")
00014     {}
00015 
00016 
00017   public:
00018 
00019     void init() {
00020       const ChargedFinalState cfs(-15, 15);
00021       addProjection(cfs, "CFS");
00022 
00023       _histPtPions        = bookHisto1D("d01-x01-y01");
00024       _histPtAntiPions    = bookHisto1D("d01-x01-y02");
00025       _histPtKaons        = bookHisto1D("d02-x01-y01");
00026       _histPtAntiKaons    = bookHisto1D("d02-x01-y02");
00027       _histPtProtons      = bookHisto1D("d03-x01-y01");
00028       _histPtAntiProtons  = bookHisto1D("d03-x01-y02");
00029       _histAveragePt      = bookProfile1D("d04-x01-y01");
00030     }
00031 
00032 
00033     void analyze(const Event& event) {
00034       const double weight = event.weight();
00035       const ChargedFinalState& cfs = applyProjection<ChargedFinalState>(event, "CFS");
00036       foreach (const Particle& p, cfs.particles()) {
00037         if(fabs(p.momentum().rapidity())<0.5) {
00038           switch (p.pdgId()) {
00039             case 211:
00040               _histPtPions->fill(p.momentum().pT()/GeV, weight);
00041               _histAveragePt->fill(p.mass()/GeV, p.momentum().pT()/GeV, weight);
00042               break;
00043             case -211:
00044               _histPtAntiPions->fill(p.momentum().pT()/GeV, weight);
00045               _histAveragePt->fill(p.mass()/GeV, p.momentum().pT()/GeV, weight);
00046               break;
00047             case 2212:
00048               if ( !(p.hasAncestor(3322) ||                             // Xi0
00049                      p.hasAncestor(3122) || p.hasAncestor(-3122) ||     // Lambda
00050                      p.hasAncestor(3222) || p.hasAncestor(-3222) ||     // Sigma+/-
00051                      p.hasAncestor(3312) || p.hasAncestor(-3312) ) ) {  // Xi-/+
00052                 _histPtProtons->fill(p.momentum().pT()/GeV, weight);
00053                 _histAveragePt->fill(p.mass()/GeV, p.momentum().pT()/GeV, weight);
00054               }
00055               break;
00056             case -2212:
00057               if ( !(p.hasAncestor(3322) ||                             // Xi0
00058                      p.hasAncestor(3122) || p.hasAncestor(-3122) ||     // Lambda
00059                      p.hasAncestor(3222) || p.hasAncestor(-3222) ||     // Sigma+/-
00060                      p.hasAncestor(3312) || p.hasAncestor(-3312) ) ) {  // Xi-/+
00061                 _histPtAntiProtons->fill(p.momentum().pT()/GeV, weight);
00062                 _histAveragePt->fill(p.mass()/GeV, p.momentum().pT()/GeV, weight);
00063               }
00064               break;
00065             case 321:
00066               _histPtKaons->fill(p.momentum().pT()/GeV, weight);
00067               _histAveragePt->fill(p.mass()/GeV, p.momentum().pT()/GeV, weight);
00068               break;
00069             case -321:
00070               _histPtAntiKaons->fill(p.momentum().pT()/GeV, weight);
00071               _histAveragePt->fill(p.mass()/GeV, p.momentum().pT()/GeV, weight);
00072               break;
00073           }
00074         }
00075       }
00076     }
00077 
00078 
00079     void finalize() {
00080       scale(_histPtPions,       1./sumOfWeights());
00081       scale(_histPtProtons,     1./sumOfWeights());
00082       scale(_histPtKaons,       1./sumOfWeights());
00083       scale(_histPtAntiPions,   1./sumOfWeights());
00084       scale(_histPtAntiProtons, 1./sumOfWeights());
00085       scale(_histPtAntiKaons,   1./sumOfWeights());
00086     }
00087 
00088 
00089   private:
00090 
00091     Histo1DPtr _histPtPions;
00092     Histo1DPtr _histPtProtons;
00093     Histo1DPtr _histPtKaons;
00094     Histo1DPtr _histPtAntiPions;
00095     Histo1DPtr _histPtAntiProtons;
00096     Histo1DPtr _histPtAntiKaons;
00097     Profile1DPtr _histAveragePt;
00098 
00099   };
00100 
00101 
00102 
00103   // The hook for the plugin system
00104   DECLARE_RIVET_PLUGIN(ALICE_2011_S8945144);
00105 
00106 }