Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-08-06 09:23:58

0001 // -*- C++ -*-
0002 //
0003 // LEPBMultiplicity.h is a part of Herwig - A multi-purpose Monte Carlo event generator
0004 // Copyright (C) 2002-2019 The Herwig Collaboration
0005 //
0006 // Herwig is licenced under version 3 of the GPL, see COPYING for details.
0007 // Please respect the MCnet academic guidelines, see GUIDELINES for details.
0008 //
0009 #ifndef HERWIG_LEPBMultiplicity_H
0010 #define HERWIG_LEPBMultiplicity_H
0011 //
0012 // This is the declaration of the LEPBMultiplicity class.
0013 //
0014 
0015 #include "ThePEG/Handlers/AnalysisHandler.h"
0016 
0017 namespace Herwig {
0018 
0019 using namespace ThePEG;
0020 
0021 
0022 /** \ingroup Analysis
0023  *  Struct for the multiplcity data
0024  */
0025 struct BranchingInfo {
0026   /**
0027    *  Default constructor
0028    * @param mult  The observed multiplcity.
0029    * @param error The error on the observed multiplicity
0030    */
0031   BranchingInfo(double mult=0.,double error=0.);
0032 
0033   /**
0034    *  The observed multiplicity
0035    */
0036   double obsBranching;
0037 
0038   /**
0039    *  The error on the observed multiplicity
0040    */
0041   double obsError;
0042 
0043   /**
0044    *  Number of particles of this type
0045    */
0046   long actualCount;
0047 
0048   /**
0049    *  Sum of squares of number per event for error
0050    */
0051   double sumofsquares;
0052 
0053   /**
0054    *  The average fraction per quark
0055    * @param N The number of events
0056    * @param den The denominator to give the fraction
0057    */
0058   double simBranching(long N,BranchingInfo den=BranchingInfo());
0059 
0060   /**
0061    *  The error on the average number per event
0062    * @param N The number of events 
0063    * @param den The denominator to give the fraction
0064    */
0065   double simError(long N,BranchingInfo den=BranchingInfo());
0066 
0067   /**
0068    * Is the result more than \f$3\sigma\f$ from the experimental result
0069    * @param N The number of events
0070    * @param den The denominator to give the fraction
0071    */
0072   double nSigma(long N,BranchingInfo den=BranchingInfo());
0073 
0074   /**
0075    * Plot standard error in a simple barchart
0076    * @param N The number of events
0077    * @param den The denominator to give the fraction
0078    */
0079   string bargraph(long N,BranchingInfo den=BranchingInfo());
0080 };
0081 
0082 /**
0083  * The LEPBBMultiplicity class is designed to compare the production
0084  * rates of \f$B^+\f$, \f$B^0\f$, \f$B^0_s\f$ and B-baryons in
0085  * B events at LEP
0086  *
0087  * @see \ref LEPBMultiplicityInterfaces "The interfaces"
0088  * defined for LEPBMultiplicity.
0089  */
0090 class LEPBMultiplicity: public AnalysisHandler {
0091 
0092 public:
0093 
0094   /**
0095    * The default constructor.
0096    */
0097   LEPBMultiplicity();
0098 
0099 public:
0100 
0101   /** @name Virtual functions required by the AnalysisHandler class. */
0102   //@{
0103   /**
0104    * Analyze a given Event. Note that a fully generated event
0105    * may be presented several times, if it has been manipulated in
0106    * between. The default version of this function will call transform
0107    * to make a lorentz transformation of the whole event, then extract
0108    * all final state particles and call analyze(tPVector) of this
0109    * analysis object and those of all associated analysis objects. The
0110    * default version will not, however, do anything on events which
0111    * have not been fully generated, or have been manipulated in any
0112    * way.
0113    * @param event pointer to the Event to be analyzed.
0114    * @param ieve the event number.
0115    * @param loop the number of times this event has been presented.
0116    * If negative the event is now fully generated.
0117    * @param state a number different from zero if the event has been
0118    * manipulated in some way since it was last presented.
0119    */
0120   virtual void analyze(tEventPtr event, long ieve, int loop, int state);
0121   //@}
0122 
0123 public:
0124 
0125   /**
0126    * The standard Init function used to initialize the interfaces.
0127    * Called exactly once for each class by the class description system
0128    * before the main function starts or
0129    * when this class is dynamically loaded.
0130    */
0131   static void Init();
0132 
0133 protected:
0134 
0135   /** @name Clone Methods. */
0136   //@{
0137   /**
0138    * Make a simple clone of this object.
0139    * @return a pointer to the new object.
0140    */
0141   virtual IBPtr clone() const {return new_ptr(*this);}
0142 
0143   /** Make a clone of this object, possibly modifying the cloned object
0144    * to make it sane.
0145    * @return a pointer to the new object.
0146    */
0147   virtual IBPtr fullclone() const {return new_ptr(*this);}
0148   //@}
0149 
0150 protected:
0151 
0152   /** @name Standard Interfaced functions. */
0153   //@{
0154   /**
0155    * Finalize this object. Called in the run phase just after a
0156    * run has ended. Used eg. to write out statistics.
0157    */
0158   virtual void dofinish();
0159   //@}
0160 
0161 private:
0162 
0163   /**
0164    * The assignment operator is private and must never be called.
0165    * In fact, it should not even be implemented.
0166    */
0167   LEPBMultiplicity & operator=(const LEPBMultiplicity &) = delete;
0168 
0169 private:
0170 
0171   /**
0172    *  Map of PDG codes to multiplicity info
0173    */
0174   map<long,BranchingInfo> _data;
0175 };
0176 
0177 }
0178 
0179 #endif /* HERWIG_LEPBMultiplicity_H */