TASSO_1990_S2148048.cc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include "Rivet/Analysis.hh"
00003 #include "Rivet/RivetAIDA.hh"
00004 #include "Rivet/Tools/Logging.hh"
00005 //#include "Rivet/Projections/Beam.hh"
00006 #include "Rivet/Projections/Thrust.hh"
00007 #include "Rivet/Projections/Sphericity.hh"
00008 #include "Rivet/Projections/ChargedFinalState.hh"
00009 /// @todo Include more projections as required, e.g. ChargedFinalState, FastJets, ZFinder...
00010 
00011 namespace Rivet {
00012 
00013 
00014   class TASSO_1990_S2148048 : public Analysis {
00015   public:
00016 
00017     /// @name Constructors etc.
00018     //@{
00019 
00020     /// Constructor
00021     TASSO_1990_S2148048()
00022       : Analysis("TASSO_1990_S2148048")
00023     {
00024       /// @todo Set whether your finalize method needs the generator cross section
00025       setBeams(ELECTRON, POSITRON);
00026       //_sumWPassed = 0;
00027     }
00028 
00029     //@}
00030 
00031 
00032   public:
00033 
00034     /// @name Analysis methods
00035     //@{
00036 
00037     /// Book histograms and initialise projections before the run
00038     void init() {
00039       const ChargedFinalState cfs(-MAXRAPIDITY, MAXRAPIDITY, 0.1/GeV);
00040       addProjection(cfs, "CFS");
00041       
00042       //// Beams -- needed for x_p calculation
00043       //addProjection(Beam(), "Beams");
00044       
00045       // Thrust
00046       addProjection(Thrust(cfs), "Thrust");
00047 
00048       // For Sphericity and the like
00049       addProjection(Sphericity(cfs), "Sphericity");
00050       
00051       // Histos
00052       int offset = 0;
00053       switch (int(sqrtS()/GeV)) {
00054         case 14:
00055           offset = 0;
00056           break;
00057         case 22:
00058           offset = 1;
00059           break;
00060         case 35:
00061           offset = 2;
00062           break;
00063         case 44:
00064           offset = 3;
00065           break;
00066       }
00067       //_h_xp         = bookHistogram1D( 2, 1, 1+offset);
00068       _h_sphericity = bookHistogram1D( 6, 1, 1+offset);
00069       _h_aplanarity = bookHistogram1D( 7, 1, 1+offset);
00070       _h_thrust     = bookHistogram1D( 8, 1, 1+offset);
00071     }
00072 
00073 
00074 
00075     /// Perform the per-event analysis
00076     void analyze(const Event& event) {
00077       const double weight = event.weight();
00078       const ChargedFinalState& cfs = applyProjection<ChargedFinalState>(event, "CFS");
00079 
00080       //// Get beams and average beam momentum
00081       //const ParticlePair& beams = applyProjection<Beam>(event, "Beams").beams();
00082       //const double meanBeamMom = ( beams.first.momentum().vector3().mod() +
00083                                    //beams.second.momentum().vector3().mod() ) / 2.0;
00084       
00085       // TASSO hadronic event selection TODO: move this into a trigger definition
00086       // See page 2 in publication
00087       // Condition 1)  --- require at least 5 (4) 'good' tracks
00088       int nch = cfs.particles().size();
00089       if ( (int(sqrtS()/GeV) > 27 && nch < 5) || (int(sqrtS()/GeV) <= 27 && nch < 4 ) ) {
00090         getLog() << Log::DEBUG << "Failed # good tracks cut: " << nch << endl;
00091         vetoEvent;
00092       }
00093       // Condition 2) --- 
00094       // Condition 5) --- scalar momentum (not pT!!!) sum >= 0.265*s
00095       double momsum = 0.0;
00096       foreach (const Particle& p, cfs.particles()) {
00097         const double mom = p.momentum().vector3().mod();
00098         momsum += mom;
00099       }
00100       if (momsum <=0.265 * sqrtS()/GeV) {
00101         getLog() << Log::DEBUG << "Failed pTsum cut: " << momsum << " < " << 0.265 * sqrtS()/GeV << endl;
00102         vetoEvent;
00103       }
00104 
00105       // Raise counter for events that pass trigger conditions
00106       //_sumWPassed += event.weight();
00107 
00108       const Thrust& thrust = applyProjection<Thrust>(event, "Thrust");
00109       //const Vector3 & thrustAxis = thrust.thrustAxis ();
00110       //double theta = thrustAxis.theta();
00111       //if ( fabs(cos(theta)) >= 0.8 ) {
00112         //getLog() << Log::DEBUG << "Failed thrust angle cut: " << fabs(cos(theta)) << endl;
00113         //vetoEvent;
00114       //}
00115       
00116       const Sphericity& sphericity = applyProjection<Sphericity>(event, "Sphericity");
00117 
00118       //// Fill histograms in order of appearance in paper
00119       //foreach (const Particle& p, cfs.particles()) {
00120         //// Get momentum and energy of each particle.
00121         //const Vector3 mom3 = p.momentum().vector3();
00122         //// Scaled momenta.
00123         //const double mom = mom3.mod();
00124         //const double scaledMom = mom/meanBeamMom;
00125         //_h_xp->fill(scaledMom, weight);
00126       //}
00127       //
00128       _h_sphericity->fill(sphericity.sphericity(), weight);
00129       _h_aplanarity->fill(sphericity.aplanarity(), weight);
00130       _h_thrust->fill(thrust.thrust(), weight);
00131     }
00132 
00133 
00134     /// Normalise histograms etc., after the run
00135     void finalize() {
00136       //scale(_h_xp, _sumWPassed/(crossSection()*sumOfWeights()));
00137       normalize(_h_sphericity);
00138       normalize(_h_aplanarity);
00139       normalize(_h_thrust    );
00140     }
00141 
00142     //@}
00143 
00144 
00145   private:
00146 
00147     // Data members like post-cuts event weight counters go here
00148 
00149     //double _sumWPassed;
00150 
00151   private:
00152 
00153     /// @name Histograms
00154     //@{
00155     AIDA::IHistogram1D* _h_xp        ;
00156     AIDA::IHistogram1D* _h_sphericity;
00157     AIDA::IHistogram1D* _h_aplanarity;
00158     AIDA::IHistogram1D* _h_thrust    ;
00159     //@}
00160 
00161 
00162   };
00163 
00164 
00165 
00166   // This global object acts as a hook for the plugin system
00167   AnalysisBuilder<TASSO_1990_S2148048> plugin_TASSO_1990_S2148048;
00168 
00169 
00170 }