EurPhys40C287.cc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include "Rivet/Tools/Logging.hh"
00003 #include "Rivet/RivetAIDA.hh"
00004 #include "Rivet/Analyses/PL273B181.hh"
00005 #include "HepPDT/ParticleID.hh"
00006 
00007 using namespace AIDA;
00008 using namespace HepMC;
00009 
00010 namespace Rivet {
00011 
00012   void PL273B181::init() {
00013     // Book histograms
00014     // histChTot_       = bookHistogram1D("TotalChMult","Total charged multiplicity", 25, 1.0, 51.0);
00015     histChTot_       = bookHistogram1D(1, 1, 1, "Total charged multiplicity");
00016     histSphericity_  = bookHistogram1D("Sphericity", "Event Shape: Sphericity", 8, 0.0, 0.70);
00017     histAplanarity_  = bookHistogram1D("Aplanarity", "Event Shape: APlanarity", 10, 0.0, 0.09);
00018     histPlanarity_   = bookHistogram1D("Planarity",  "Event Shape: Planarity", 16, 0.0, 0.70);
00019 
00020   }
00021 
00022 
00023   // Do the analysis
00024   void PL273B181::analyze(const Event & event) {
00025     Log& log = getLog();
00026     log << Log::DEBUG << "Starting analyzing" << endl;
00027 
00028     // Analyse and print some info
00029     const Multiplicity& m = event.applyProjection(mult);
00030     log << Log::INFO << "Total charged multiplicity    = " << m.totalChargedMultiplicity() << endl;
00031 
00032     //Analyse the event shape info
00033     const Sphericity& s = event.applyProjection(spher);
00034     log << Log::INFO << "Sphericity    = " << s.sphericity() << endl;
00035     log << Log::INFO << "Aplanarity    = " << s.aplanarity() << endl;
00036     log << Log::INFO << "Planarity     = " << s.planarity() << endl;
00037 
00038     // Fill histograms here, and scale them later
00039     const double weight = event.weight();
00040     histChTot_->fill(m.totalChargedMultiplicity(), weight);
00041     histSphericity_->fill(s.sphericity(), weight);
00042     histPlanarity_->fill(s.planarity(), weight);
00043     histAplanarity_->fill(s.aplanarity(), weight);
00044 
00045     // Finished...
00046     log << Log::DEBUG << "Finished analyzing" << endl;
00047   }
00048 
00049 
00050   // Finalize
00051   void PL273B181::finalize() { 
00052     // Normalize the histogram areas to 1
00053     normalize(histChTot_);
00054     normalize(histSphericity_);
00055     normalize(histPlanarity_); 
00056     normalize(histAplanarity_);
00057   }
00058 
00059 }