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     const ParticlePair& beams = e.applyProjection(_beamsproj).getBeams();
00075     const double meanBeamMom = ( beams.first.getMomentum().vect().mag() + 
00076                                  beams.second.getMomentum().vect().mag() ) / 2.0;
00077 
00078     // Get event weight for histo filling
00079     const double weight = e.weight();
00080 
00081     const Thrust& thrust = e.applyProjection(_thrustproj);
00082     _hist1MinusT->fill(1 - thrust.thrust(), weight); 
00083     _histTMajor->fill(thrust.thrustMajor(), weight); 
00084     _histTMinor->fill(thrust.thrustMinor(), weight); 
00085     _histOblateness->fill(thrust.oblateness(), weight);
00086 
00087     //const DurhamJet& durjetC = e.applyProjection(_cdurproj);
00088     //_histDiffRate2Durham->fill(, weight); 
00089     //_histDiffRate3Durham->fill(, weight);
00090     //_histDiffRate4Durham->fill(, weight);
00091 
00092     //const JadeJet& durjetC = e.applyProjection(_cjadeproj);
00093     //_histDiffRate2Jade->fill(, weight); 
00094     //_histDiffRate3Jade->fill(, weight); 
00095     //_histDiffRate4Jade->fill(, weight);
00096 
00097     //const JadeJet& durjetCN = e.applyProjection(_cnjadeproj);
00098     //_histDiffRate2JadeCN->fill(, weight); 
00099     //_histDiffRate3JadeCN->fill(, weight);
00100 
00101     const Sphericity& sphericityC = e.applyProjection(_cspherproj);
00102     _histSphericity->fill(sphericityC.sphericity(), weight); 
00103     _histAplanarity->fill(sphericityC.aplanarity(), weight); 
00104     _histPlanarity->fill(sphericityC.planarity(), weight); 
00105 
00106     const Sphericity& sphericityCN = e.applyProjection(_cnspherproj);
00107     _histSphericityCN->fill(sphericityCN.sphericity(), weight); 
00108     _histAplanarityCN->fill(sphericityCN.aplanarity(), weight); 
00109 
00110     const Hemispheres& hemi = e.applyProjection(_hemiproj);
00111     _histHemiMassH->fill(hemi.getScaledM2high(), weight); 
00112     _histHemiMassL->fill(hemi.getScaledM2low(), weight); 
00113     _histHemiMassD->fill(hemi.getScaledM2diff(), weight); 
00114     _histHemiBroadW->fill(hemi.getBmax(), weight); 
00115     _histHemiBroadN->fill(hemi.getBmin(), weight); 
00116     _histHemiBroadT->fill(hemi.getBsum(), weight); 
00117     _histHemiBroadD->fill(hemi.getBdiff(), weight); 
00118 
00119     const ParisiTensor& parisi = e.applyProjection(_parisiproj);    
00120     _histCParam->fill(parisi.C(), weight); 
00121     _histDParam->fill(parisi.D(), weight); 
00122     
00123     //const EEC& eec = e.applyProjection(_eecproj);
00124     //_histEEC->fill(, weight); 
00125     //_histAEEC->fill(, weight); 
00126 
00127 
00128     // Iterate over all the final state particles.
00129     const FinalState& cfs = e.applyProjection(_cfsproj);
00130     for (ParticleVector::const_iterator p = cfs.particles().begin(); p != cfs.particles().end(); ++p) {
00131       // Get momentum and energy of each particle.
00132       const Vector3 mom3 = p->getMomentum().vect();
00133       const double mom = mom3.mag();
00134       const double energy = p->getMomentum().getT();
00135 
00136       // Calculate scaled momenta.
00137       const double scaledMom = mom/meanBeamMom;
00138       const double logInvScaledMom = -log10(scaledMom);
00139 
00140       // Get momenta components w.r.t. thrust and sphericity.
00141       const double momT = thrust.thrustAxis().dot(mom3);
00142       const double momS = sphericityC.sphericityAxis().dot(mom3);
00143       const double pTinT = mom3.dot(thrust.thrustMajorAxis());
00144       const double pToutT = mom3.dot(thrust.thrustMinorAxis());
00145       const double pTinS = mom3.dot(sphericityC.sphericityMinorAxis());
00146       const double pToutS = mom3.dot(sphericityC.sphericityMinorAxis());
00147 
00148       // Calculate rapidities w.r.t. thrust and sphericity.
00149       const double rapidityT = 0.5 * (energy + momT) / (energy - momT);
00150       const double rapidityS = 0.5 * (energy + momS) / (energy - momS);
00151 
00152       // Fill histograms.
00153       _histLogScaledMom->fill(logInvScaledMom, weight); 
00154       _histScaledMom->fill(scaledMom, weight); 
00155       _histRapidityT->fill(rapidityT, weight); 
00156       _histRapidityS->fill(rapidityS, weight); 
00157       _histPtTIn->fill(pTinT, weight); 
00158       _histPtTOut->fill(pToutT, weight); 
00159       _histPtTInVsXp->fill(pTinS, weight); 
00160       _histPtTOutVsXp->fill(pToutS, weight); 
00161     }
00162 
00163     // Finished...
00164     log << Log::DEBUG << "Finished analyzing" << endl;
00165   }
00166 
00167 
00168   // Finalize
00169   void ZPhys73C11::finalize() { 
00170     // Normalize the histogram areas to 1
00171 //     normalize(_histLogScaledMom); 
00172 //     normalize(_histScaledMom); 
00173 //     normalize(_histRapidityT); 
00174 //     normalize(_histRapidityS); 
00175 //     normalize(_histPtTIn); 
00176 //     normalize(_histPtTOut); 
00177 //     normalize(_histPtTInVsXp); 
00178 //     normalize(_histPtTOutVsXp); 
00179     
00180 //     normalize(_hist1MinusT); 
00181 //     normalize(_histTMajor); 
00182 //     normalize(_histTMinor); 
00183 //     normalize(_histOblateness); 
00184     
00185 //     normalize(_histDiffRate2Durham); 
00186 //     normalize(_histDiffRate2Jade); 
00187 //     normalize(_histDiffRate2JadeCN);
00188 //     normalize(_histDiffRate3Durham);
00189 //     normalize(_histDiffRate3Jade); 
00190 //     normalize(_histDiffRate3JadeCN);
00191 //     normalize(_histDiffRate4Durham);
00192 //     normalize(_histDiffRate4Jade); 
00193     
00194 //     normalize(_histSphericity); 
00195 //     normalize(_histAplanarity); 
00196 //     normalize(_histPlanarity); 
00197 //     normalize(_histSphericityCN); 
00198 //     normalize(_histAplanarityCN); 
00199     
00200 //     normalize(_histHemiMassD); 
00201 //     normalize(_histHemiMassH); 
00202 //     normalize(_histHemiMassL); 
00203     
00204 //     normalize(_histHemiBroadW); 
00205 //     normalize(_histHemiBroadN); 
00206 //     normalize(_histHemiBroadT); 
00207 //     normalize(_histHemiBroadD); 
00208     
00209 //     normalize(_histCParam); 
00210 //     normalize(_histDParam); 
00211     
00212 //     normalize(_histEEC); 
00213 //     normalize(_histAEEC); 
00214   }
00215 
00216 }