Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

ZPhys73C11.cc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include "Rivet/Tools/Logging.hh"
00003 #include "Rivet/RivetAIDA.hh"
00004 #include "Rivet/RivetCLHEP.hh"
00005 #include "Rivet/Analyses/ZPhys73C11.hh"
00006 #include "HepPDT/ParticleID.hh"
00007 
00008 using namespace AIDA;
00009 using namespace HepMC;
00010 
00011 
00012 namespace Rivet {
00013 
00014   void ZPhys73C11::init() {
00015     // Inclusive single-particle distributions
00016     _histLogScaledMom = bookHistogram1D("IncSingleLogScaledMom", "Inclusive single particle log(1/x_p)", 60, 0.0, 6.0);
00017     _histScaledMom    = bookHistogram1D("IncSingleScaledMom", "Inclusive single particle x_p = |p|/|p_beam|", 50, 0.0, 1.0);
00018     _histRapidityT    = bookHistogram1D("IncSingleRapidityT", "Inclusive single particle rapidity w.r.t. thrust axis, y_T", 30, 0.0, 6.0);
00019     _histRapidityS    = bookHistogram1D("IncSingleRapidityS", "Inclusive single particle rapidity w.r.t. sphericity axis, y_S", 30, 0.0, 6.0);
00020     _histPtTIn        = bookHistogram1D("IncSinglePtTIn", "Inclusive single particle in-plane p_T w.r.t. thrust axis (GeV)", 50, 0.0, 14.0);
00021     _histPtTOut       = bookHistogram1D("IncSinglePtTOut", "Inclusive single particle out-of-plane p_T w.r.t. thrust-minor axis (GeV)", 50, 0.0, 3.5);
00022     _histPtTInVsXp    = bookHistogram1D("IncSinglePtTInMeanVsXp", "Inclusive single particle in-plane p_T (GeV) vs. x_p", 50, 0.0, 3.5);
00023     _histPtTOutVsXp   = bookHistogram1D("IncSinglePtTOutMeanVsXp", "Inclusive single particle out-of-plane p_T (GeV) vs. x_p", 50, 0.0, 3.5);
00024 
00025     // Event shape distributions
00026     _hist1MinusT      = bookHistogram1D("ESOneMinusThrust", "1-thrust, 1-T", 50, 0.0, 0.5);
00027     _histTMajor       = bookHistogram1D("ESMajor", "Thrust major, M", 50, 0.0, 0.65);
00028     _histTMinor       = bookHistogram1D("ESMinor", "Thrust minor, m", 50, 0.0, 0.4);
00029     _histOblateness   = bookHistogram1D("ESOblateness", "Oblateness = M - m", 50, 0.0, 0.5);
00030 
00031     _histDiffRate2Durham = bookHistogram1D("DiffRate2Durham", "Differential 2-jet rate with Durham algorithm, D_2^Durham", 20, 0.0, 0.3); // binned in y_cut
00032     _histDiffRate2Jade   = bookHistogram1D("DiffRate2Jade", "Differential 2-jet rate with Jade algorithm, D_2^Jade", 20, 0.0, 0.3); // binned in y_cut
00033     _histDiffRate2JadeCN = bookHistogram1D("DiffRate2JadeCN", "Differential 2-jet rate with Jade algorithm from charged and neutral particles, D_2,CN^Jade", 20, 0.0, 0.3); // binned in y_cut
00034     _histDiffRate3Durham = bookHistogram1D("DiffRate3Durham", "Differential 3-jet rate with Durham algorithm, D_3^Durham", 20, 0.0, 0.1); // binned in y_cut
00035     _histDiffRate3Jade   = bookHistogram1D("DiffRate3Jade", "Differential 3-jet rate with Jade algorithm from charged and neutral particles, D_3,CN^Jade", 20, 0.0, 0.1); // binned in y_cut
00036     _histDiffRate3JadeCN = bookHistogram1D("DiffRate3JadeCN", "Differential 3-jet rate with Jade algorithm, D_3^Jade", 20, 0.0, 0.1); // binned in y_cut
00037     _histDiffRate4Durham = bookHistogram1D("DiffRate4Durham", "Differential 4-jet rate with Durham algorithm, D_4^Durham", 20, 0.0, 0.03); // binned in y_cut
00038     _histDiffRate4Jade   = bookHistogram1D("DiffRate4Jade", "Differential 4-jet rate with Jade algorithm, D_4^Jade", 20, 0.0, 0.05); // binned in y_cut
00039 
00040     _histSphericity  = bookHistogram1D("ESSphericity", "Sphericity, S", 20, 0.0, 0.8);
00041     _histAplanarity  = bookHistogram1D("ESAplanarity", "Aplanarity, A", 20, 0.0, 0.3);
00042     _histPlanarity   = bookHistogram1D("ESPlanarity", "Planarity, P", 20, 0.0, 0.5);
00043     _histSphericityCN  = bookHistogram1D("ESSphericityCN", "Sphericity from charged and neutral particles, S_CN", 20, 0.0, 0.8);
00044     _histAplanarityCN  = bookHistogram1D("ESAplanarityCN", "Aplanarity from charged and neutral particles, A_CN", 20, 0.0, 0.3);
00045 
00046     _histHemiMassD = bookHistogram1D("HemiMassDiff", "Difference in hemisphere masses, M_d^2/E_vis^2", 20, 0.0, 0.4);
00047     _histHemiMassH = bookHistogram1D("HemiMassHeavy", "Heavy hemisphere masses, M_h^2/E_vis^2", 20, 0.0, 0.4);
00048     _histHemiMassL = bookHistogram1D("HemiMassLight", "Light hemisphere masses, M_l^2/E_vis^2", 20, 0.0, 0.12);
00049 
00050     _histHemiBroadW = bookHistogram1D("HemiBroadW", "Wide hemisphere broadening, B_max", 20, 0.0, 0.3);
00051     _histHemiBroadN = bookHistogram1D("HemiBroadN", "Narrow hemisphere broadening, B_min", 20, 0.0, 0.18);
00052     _histHemiBroadT = bookHistogram1D("HemiBroadT", "Total hemisphere broadening, B_sum", 20, 0.0, 0.35);
00053     _histHemiBroadD = bookHistogram1D("HemiBroadD", "Difference in hemisphere broadening, B_diff", 20, 0.0, 0.30);
00054 
00055     _histCParam = bookHistogram1D("CParam", "C parameter, C", 20, 0.0, 0.9);
00056     _histDParam = bookHistogram1D("DParam", "D parameter, D", 20, 0.0, 0.8);
00057 
00058     _histEEC = bookHistogram1D("EEC", "Energy-energy correlation, EEC", 40, -1.0, 1.0); // binned in cos(chi)
00059     _histAEEC = bookHistogram1D("AEEC", "Asymmetry of the energy-energy correlation, AEEC", 20, -1.0, 0.0); // binned in cos(chi)
00060 
00061 
00062     // Identified particle distributions
00063     // ?
00064 
00065   }
00066 
00067 
00068   // Do the analysis
00069   void ZPhys73C11::analyze(const Event& e) {
00070     Log& log = getLog();
00071     log << Log::DEBUG << "Starting analyzing" << endl;
00072 
00073     // Get beams and average beam momentum
00074     /// @todo Some problem with how the beams projection's destructor handles particles: segfaults.
00075     const ParticlePair& beams = e.applyProjection(_beamsproj).getBeams();
00076     const double meanBeamMom = ( beams.first.getMomentum().vect().mag() + beams.second.getMomentum().vect().mag() ) / 2.0;
00077 
00078     // Calculate event-wise shape distributions
00079     const Thrust& thrust = e.applyProjection(_thrustproj);
00080     const Sphericity& sphericityC = e.applyProjection(_cspherproj);
00081     const Sphericity& sphericityCN = e.applyProjection(_cnspherproj);
00082     const ParisiTensor& parisi = e.applyProjection(_parisiproj);
00083 
00084     // Get event weight for histo filling
00085     const double weight = e.weight();
00086 
00087     // Iterate over all the final state particles.
00088     const FinalState& cfs = e.applyProjection(_cfsproj);
00089     for (ParticleVector::const_iterator p = cfs.particles().begin(); p != cfs.particles().end(); ++p) {
00090       // Get momentum and energy of each particle.
00091       const Vector3 mom3 = p->getMomentum().vect();
00092       const double mom = mom3.mag();
00093       const double energy = p->getMomentum().getT();
00094 
00095       // Calculate scaled momenta.
00096       const double scaledMom = mom/meanBeamMom;
00097       const double logInvScaledMom = -log10(scaledMom);
00098 
00099       // Get momenta components w.r.t. thrust and sphericity.
00100       const double momT = thrust.thrustAxis().dot(mom3);
00101       const double momS = sphericityC.sphericityAxis().dot(mom3);
00102       const double pTinT = mom3.dot(thrust.thrustMajorAxis());
00103       const double pToutT = mom3.dot(thrust.thrustMinorAxis());
00104       const double pTinS = mom3.dot(sphericityC.sphericityMinorAxis());
00105       const double pToutS = mom3.dot(sphericityC.sphericityMinorAxis());
00106 
00107       // Calculate rapidities w.r.t. thrust and sphericity.
00108       const double rapidityT = 0.5 * (energy + momT) / (energy - momT);
00109       const double rapidityS = 0.5 * (energy + momS) / (energy - momS);
00110 
00111       // Fill histograms.
00112       _histLogScaledMom->fill(logInvScaledMom, weight); 
00113       _histScaledMom->fill(scaledMom, weight); 
00114       _histRapidityT->fill(rapidityT, weight); 
00115       _histRapidityS->fill(rapidityS, weight); 
00116       _histPtTIn->fill(pTinT, weight); 
00117       _histPtTOut->fill(pToutT, weight); 
00118       _histPtTInVsXp->fill(pTinS, weight); 
00119       _histPtTOutVsXp->fill(pToutS, weight); 
00120     }
00121 
00122     // Fill histograms.
00123     _hist1MinusT->fill(1 - thrust.thrust(), weight); 
00124     _histTMajor->fill(thrust.thrustMajor(), weight); 
00125     _histTMinor->fill(thrust.thrustMinor(), weight); 
00126     _histOblateness->fill(thrust.oblateness(), weight);
00127 
00128     //_histDiffRate2Durham->fill(, weight); 
00129     //_histDiffRate2Jade->fill(, weight); 
00130     //_histDiffRate2JadeCN->fill(, weight); 
00131     //_histDiffRate3Durham->fill(, weight);
00132     //_histDiffRate3Jade->fill(, weight); 
00133     //_histDiffRate3JadeCN->fill(, weight);
00134     //_histDiffRate4Durham->fill(, weight);
00135     //_histDiffRate4Jade->fill(, weight); 
00136     
00137     _histSphericity->fill(sphericityC.sphericity(), weight); 
00138     _histAplanarity->fill(sphericityC.aplanarity(), weight); 
00139     _histPlanarity->fill(sphericityC.planarity(), weight); 
00140     _histSphericityCN->fill(sphericityCN.sphericity(), weight); 
00141     _histAplanarityCN->fill(sphericityCN.aplanarity(), weight); 
00142 
00143     //_histHemiMassD->fill(, weight); 
00144     //_histHemiMassH->fill(, weight); 
00145     //_histHemiMassL->fill(, weight); 
00146 
00147     //_histHemiBroadW->fill(, weight); 
00148     //_histHemiBroadN->fill(, weight); 
00149     //_histHemiBroadT->fill(, weight); 
00150     //_histHemiBroadD->fill(, weight); 
00151     
00152     _histCParam->fill(parisi.C(), weight); 
00153     _histDParam->fill(parisi.D(), weight); 
00154     
00155     //_histEEC->fill(, weight); 
00156     //_histAEEC->fill(, weight); 
00157 
00158     // Finished...
00159     log << Log::DEBUG << "Finished analyzing" << endl;
00160   }
00161 
00162 
00163   // Finalize
00164   void ZPhys73C11::finalize() { 
00165     // Normalize the histogram areas to 1
00166 //     normalize(_histLogScaledMom); 
00167 //     normalize(_histScaledMom); 
00168 //     normalize(_histRapidityT); 
00169 //     normalize(_histRapidityS); 
00170 //     normalize(_histPtTIn); 
00171 //     normalize(_histPtTOut); 
00172 //     normalize(_histPtTInVsXp); 
00173 //     normalize(_histPtTOutVsXp); 
00174     
00175 //     normalize(_hist1MinusT); 
00176 //     normalize(_histTMajor); 
00177 //     normalize(_histTMinor); 
00178 //     normalize(_histOblateness); 
00179     
00180 //     normalize(_histDiffRate2Durham); 
00181 //     normalize(_histDiffRate2Jade); 
00182 //     normalize(_histDiffRate2JadeCN);
00183 //     normalize(_histDiffRate3Durham);
00184 //     normalize(_histDiffRate3Jade); 
00185 //     normalize(_histDiffRate3JadeCN);
00186 //     normalize(_histDiffRate4Durham);
00187 //     normalize(_histDiffRate4Jade); 
00188     
00189 //     normalize(_histSphericity); 
00190 //     normalize(_histAplanarity); 
00191 //     normalize(_histPlanarity); 
00192 //     normalize(_histSphericityCN); 
00193 //     normalize(_histAplanarityCN); 
00194     
00195 //     normalize(_histHemiMassD); 
00196 //     normalize(_histHemiMassH); 
00197 //     normalize(_histHemiMassL); 
00198     
00199 //     normalize(_histHemiBroadW); 
00200 //     normalize(_histHemiBroadN); 
00201 //     normalize(_histHemiBroadT); 
00202 //     normalize(_histHemiBroadD); 
00203     
00204 //     normalize(_histCParam); 
00205 //     normalize(_histDParam); 
00206     
00207 //     normalize(_histEEC); 
00208 //     normalize(_histAEEC); 
00209   }
00210 
00211 }