Page Menu
Home
HEPForge
Search
Configure Global Search
Log In
Files
F10881316
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
17 KB
Subscribers
None
View Options
diff --git a/Analysis/MultiplicityCount.cc b/Analysis/MultiplicityCount.cc
--- a/Analysis/MultiplicityCount.cc
+++ b/Analysis/MultiplicityCount.cc
@@ -1,172 +1,210 @@
// -*- C++ -*-
//
// This is the implementation of the non-inlined, non-templated member
// functions of the MultiplicityCount class.
//
#include "MultiplicityCount.h"
#include "ThePEG/Interface/ParVector.h"
#include "ThePEG/Interface/Switch.h"
#include "ThePEG/Interface/ClassDocumentation.h"
#include "ThePEG/EventRecord/StandardSelectors.h"
#include "ThePEG/EventRecord/Event.h"
#ifdef ThePEG_TEMPLATES_IN_CC_FILE
// #include "MultiplicityCount.tcc"
#endif
#include "ThePEG/Persistency/PersistentOStream.h"
#include "ThePEG/Persistency/PersistentIStream.h"
using namespace ThePEG;
MultiplicityCount::MultiplicityCount()
{
+ weightSum = 0.0;
_data[0] = MultiplicityInfo(20.924,0.117,lightMeson);
_data[22] = MultiplicityInfo(21.27, 0.60,lightMeson);
_data[111] = MultiplicityInfo(9.59,0.33,lightMeson);
_data[113] = MultiplicityInfo(1.295,0.125,lightMeson);
_data[211] = MultiplicityInfo(17.04,0.25,lightMeson);
_data[213] = MultiplicityInfo(2.40,0.43,lightMeson);
_data[221] = MultiplicityInfo(0.956,0.049,lightMeson);
_data[223] = MultiplicityInfo(1.083,0.088,lightMeson);
_data[225] = MultiplicityInfo(0.168,0.021,other);
_data[311] = MultiplicityInfo(2.027,0.025,lightMeson);
_data[313] = MultiplicityInfo(0.761,0.032,strangeMeson);
_data[315] = MultiplicityInfo(0.106,0.060,strangeMeson);
_data[321] = MultiplicityInfo(2.319,0.079,strangeMeson);
_data[323] = MultiplicityInfo(0.731,0.058,strangeMeson);
_data[331] = MultiplicityInfo(0.152,0.030,lightMeson);
_data[333] = MultiplicityInfo(0.097,0.007,strangeMeson);
_data[335] = MultiplicityInfo(0.020,0.008,other);
_data[411] = MultiplicityInfo(0.184,0.018,other);
_data[413] = MultiplicityInfo(0.182,0.009,other);
_data[421] = MultiplicityInfo(0.473,0.026,other);
_data[431] = MultiplicityInfo(0.129,0.013,other);
_data[433] = MultiplicityInfo(0.096,0.046,other);
_data[443] = MultiplicityInfo(0.00544,0.00029,other);
_data[2212] = MultiplicityInfo(0.991,0.054,lightBaryon);
_data[2112] = MultiplicityInfo(0.991,0.054,lightBaryon);
_data[2224] = MultiplicityInfo(0.088,0.034,lightBaryon);
_data[2214] = MultiplicityInfo(0.000,0.000,lightBaryon);
_data[2114] = MultiplicityInfo(0.000,0.000,lightBaryon);
_data[3112] = MultiplicityInfo(0.083,0.011,lightBaryon);
_data[3122] = MultiplicityInfo(0.373,0.008,lightBaryon);
_data[3212] = MultiplicityInfo(0.074,0.009,lightBaryon);
_data[3222] = MultiplicityInfo(0.099,0.015,lightBaryon);
_data[3224] = MultiplicityInfo(0.0471,0.0046,lightBaryon);
_data[3312] = MultiplicityInfo(0.0262,0.0010,lightBaryon);
_data[3324] = MultiplicityInfo(0.0058,0.0010,lightBaryon);
_data[3334] = MultiplicityInfo(0.00125,0.00024,lightBaryon);
_data[4122] = MultiplicityInfo(0.077,0.016,other);
- //_data[100443 ] = MultiplicityInfo(0.00229,0.00041,other);
- //_data[9000211] = MultiplicityInfo(0.27,0.11,other);
- //_data[10221 ] = MultiplicityInfo(0.142,0.011,other);
+ _data[100443] = MultiplicityInfo(0.00229,0.00041,other);
+ _data[9000211] = MultiplicityInfo(0.27,0.11,other);
+ //_data[10221] = MultiplicityInfo(0.142,0.011,other);
}
void MultiplicityCount::analyze(tEventPtr event, long ieve, int loop, int state) {
+ double weight = event->weight();
+ weightSum += weight;
+
set<tcPPtr> particles;
event->selectFinalState(inserter(particles));
map <long,long> eventcount;
- eventcount.insert(make_pair(0,0));
for(set<tcPPtr>::const_iterator it = particles.begin();
it != particles.end(); ++it) {
if((*it)->dataPtr()->charged())
++eventcount[0];
long ID = abs( (*it)->id() );
- _finalstatecount.insert(make_pair(ID,0));
- ++_finalstatecount[ID];
+ _finalstatecount[ID] += weight;
}
// ========
StepVector steps = event->primaryCollision()->steps();
particles.clear();
steps[0]->select(inserter(particles), ThePEG::AllSelector());
for(set<tcPPtr>::const_iterator it = particles.begin();
it != particles.end(); ++it) {
long ID = (*it)->id();
- _collisioncount.insert(make_pair(ID,0));
- ++_collisioncount[ID];
+ _collisioncount[ID] += weight;
}
// =======
particles.clear();
for ( StepVector::const_iterator it = steps.begin()+2;
it != steps.end(); ++it ) {
(**it).select(inserter(particles), ThePEG::AllSelector());
}
for(set<tcPPtr>::const_iterator it = particles.begin();
it != particles.end(); ++it) {
long ID = abs( (*it)->id() );
if (_data.find(ID) != _data.end()) {
- eventcount.insert(make_pair(ID,0));
++eventcount[ID];
}
}
for(map<long,long>::const_iterator it = eventcount.begin();
it != eventcount.end(); ++it) {
- _data[it->first].actualCount += it->second;
- _data[it->first].sumofsquares += sqr(double(it->second));
+ _data[it->first].actualCount += weight * it->second;
+ _data[it->first].sumofsquares += sqr(double(weight * it->second));
}
}
LorentzRotation MultiplicityCount::transform(tEventPtr event) const {
return LorentzRotation();
// Return the Rotation to the frame in which you want to perform the analysis.
}
void MultiplicityCount::analyze(const tPVector & particles) {
AnalysisHandler::analyze(particles);
// Calls analyze() for each particle.
}
void MultiplicityCount::analyze(tPPtr) {}
+void MultiplicityCount::dofinish() {
+ AnalysisHandler::dofinish();
+ cerr << "\nCount of particles involved in hard process:\n";
+ for (map<long,double>::const_iterator it = _collisioncount.begin();
+ it != _collisioncount.end(); ++ it) {
+ string name = generator()->getParticleData(it->first)->PDGName();
+ cerr << name << '\t' << it->second << '\n';
+ }
+
+ cerr << "\nFinal state particle count:\n";
+ for (map<long,double>::const_iterator it = _finalstatecount.begin();
+ it != _finalstatecount.end(); ++ it) {
+ string name = generator()->getParticleData(it->first)->PDGName();
+ cerr << name << '\t' << it->second << '\n';
+ }
+
+ cerr << "\nParticle multiplicities (compared to LEP data):\n";
+ for (map<long,MultiplicityInfo>::const_iterator it = _data.begin();
+ it != _data.end();
+ ++it) {
+ MultiplicityInfo multiplicity = it->second;
+
+ string name = (it->first==0 ? "All charged" : generator()->getParticleData(it->first)->PDGName() );
+
+ //double N = generator()->currentEventNumber();
+
+ cerr << it->first << " \t" << name << '\t' << ' '
+ << round(multiplicity.actualCount) << '\t'
+ << multiplicity.mean(weightSum) << ' '
+ << multiplicity.stderror(weightSum) << " === "
+ << multiplicity.mult << ' '
+ << multiplicity.error << " === ";
+ if (multiplicity.serious(weightSum))
+ cerr << "!!!";
+ cerr << '\n';
+ }
+}
+
NoPIOClassDescription<MultiplicityCount> MultiplicityCount::initMultiplicityCount;
// Definition of the static class description member.
void MultiplicityCount::Init() {
static ParVector<MultiplicityCount,long> interfaceparticlecodes
("ParticleCodes",
"The PDG code for the particles",
&MultiplicityCount::_particlecodes,
0, 0, 0, -10000000, 10000000, false, false, true);
static ParVector<MultiplicityCount,double> interfaceMultiplicity
("Multiplicity",
"The multiplicity for the particle",
&MultiplicityCount::_multiplicity,
0, 0, 0, 0., 1000., false, false, true);
static ParVector<MultiplicityCount,double> interfaceError
("Error",
"The error on the multiplicity for the particle",
&MultiplicityCount::_error,
0, 0, 0, 0., 1000., false, false, true);
static ParVector<MultiplicityCount,unsigned int> interfaceSpecies
("Species",
"The type of particle",
&MultiplicityCount::_species,
0, 0, other, 0, other, false, false, true);
static ClassDocumentation<MultiplicityCount> documentation
("The MultiplicityCount class count the multiplcities of final-state particles"
" and compares them with LEP data.");
}
diff --git a/Analysis/MultiplicityCount.h b/Analysis/MultiplicityCount.h
--- a/Analysis/MultiplicityCount.h
+++ b/Analysis/MultiplicityCount.h
@@ -1,270 +1,275 @@
// -*- C++ -*-
#ifndef THEPEG_MultiplicityCount_H
#define THEPEG_MultiplicityCount_H
//
// This is the declaration of the MultiplicityCount class.
//
#include "ThePEG/Handlers/AnalysisHandler.h"
#include "ThePEG/Repository/Repository.h"
#include "ThePEG/PDT/ParticleData.h"
#include "MultiplicityCount.fh"
namespace ThePEG {
/**
* Enumeration for species of particle
*/
enum ParticleSpecies
{
lightMeson=0,strangeMeson,lightBaryon,other
};
/**
* Struct for the multiplcity data
*/
struct MultiplicityInfo
{
/**
* Default constructor
* @param mult The observed multiplcity.
* @param error The error on the observed multiplicity
* @param type The type of particle
*/
inline MultiplicityInfo(double mult=0.,double error=0.,
ParticleSpecies type=other);
/**
* The observed multiplicity
*/
double mult;
/**
* The error on the observed multiplicity
*/
double error;
/**
* The type of particle
*/
ParticleSpecies type;
/**
* Number of particles of this type
*/
- long actualCount;
+ double actualCount;
/**
* Sum of squares of number per event for error
*/
double sumofsquares;
/**
* The average number per event
- * @param N The number of events
+ * @param N The sum of the event weights
*/
double mean(double N);
/**
* The error on the average number per event
- * @param N The number of events
+ * @param N The sum of the event weights
*/
double stderror(double N);
/**
* Is the result more than \f$3\sigma\f$ from the experimental result
- * @param N The number of events
+ * @param N The sum of the event weights
*/
bool serious(double N);
};
/**
* The MultiplicityCount class is designed to count particle multiplicities and
* compare them to LEP data.
*
* @see \ref MultiplicityCountInterfaces "The interfaces"
* defined for MultiplicityCount.
*/
class MultiplicityCount: public AnalysisHandler {
public:
/**
* The default constructor.
*/
MultiplicityCount();
public:
/** @name Virtual functions required by the AnalysisHandler class. */
//@{
/**
* Analyze a given Event. Note that a fully generated event
* may be presented several times, if it has been manipulated in
* between. The default version of this function will call transform
* to make a lorentz transformation of the whole event, then extract
* all final state particles and call analyze(tPVector) of this
* analysis object and those of all associated analysis objects. The
* default version will not, however, do anything on events which
* have not been fully generated, or have been manipulated in any
* way.
* @param event pointer to the Event to be analyzed.
* @param ieve the event number.
* @param loop the number of times this event has been presented.
* If negative the event is now fully generated.
* @param state a number different from zero if the event has been
* manipulated in some way since it was last presented.
*/
virtual void analyze(tEventPtr event, long ieve, int loop, int state);
/**
* Transform the event to the desired Lorentz frame and return the
* corresponding LorentzRotation.
* @param event a pointer to the Event to be transformed.
* @return the LorentzRotation used in the transformation.
*/
virtual LorentzRotation transform(tEventPtr event) const;
/**
* Analyze the given vector of particles. The default version calls
* analyze(tPPtr) for each of the particles.
* @param particles the vector of pointers to particles to be analyzed
*/
virtual void analyze(const tPVector & particles);
/**
* Analyze the given particle.
* @param particle pointer to the particle to be analyzed.
*/
virtual void analyze(tPPtr particle);
//@}
public:
/**
* The standard Init function used to initialize the interfaces.
* Called exactly once for each class by the class description system
* before the main function starts or
* when this class is dynamically loaded.
*/
static void Init();
protected:
/** @name Clone Methods. */
//@{
/**
* Make a simple clone of this object.
* @return a pointer to the new object.
*/
inline virtual IBPtr clone() const;
/** Make a clone of this object, possibly modifying the cloned object
* to make it sane.
* @return a pointer to the new object.
*/
inline virtual IBPtr fullclone() const;
//@}
protected:
/** @name Standard Interfaced functions. */
//@{
/**
* Finalize this object. Called in the run phase just after a
* run has ended. Used eg. to write out statistics.
*/
inline virtual void dofinish();
//@}
private:
/**
* The static object used to initialize the description of this class.
* Indicates that this is a concrete class with persistent data.
*/
static NoPIOClassDescription<MultiplicityCount> initMultiplicityCount;
/**
* The assignment operator is private and must never be called.
* In fact, it should not even be implemented.
*/
MultiplicityCount & operator=(const MultiplicityCount &);
private:
/**
* The PDG codes of the particles
*/
vector<long> _particlecodes;
/**
* The multiplcity
*/
vector<double> _multiplicity;
/**
* The error
*/
vector<double> _error;
/**
* Species of particle
*/
vector<unsigned int> _species;
/**
* Map of PDG codes to multiplicity info
*/
map<long,MultiplicityInfo> _data;
/**
* Map of number of final-state particles to PDG code
*/
- map<long,long> _finalstatecount;
+ map<long,double> _finalstatecount;
/**
* Particles in hard process
*/
- map<long,long> _collisioncount;
+ map<long,double> _collisioncount;
+
+ /**
+ * The sum of the event weights
+ */
+ double weightSum;
};
}
#include "ThePEG/Utilities/ClassTraits.h"
namespace ThePEG {
/** @cond TRAITSPECIALIZATIONS */
/** This template specialization informs ThePEG about the
* base classes of MultiplicityCount. */
template <>
struct BaseClassTrait<ThePEG::MultiplicityCount,1> {
/** Typedef of the first base class of MultiplicityCount. */
typedef AnalysisHandler NthBase;
};
/** This template specialization informs ThePEG about the name of
* the MultiplicityCount class and the shared object where it is defined. */
template <>
struct ClassTraits<ThePEG::MultiplicityCount>
: public ClassTraitsBase<ThePEG::MultiplicityCount> {
/** Return a platform-independent class name */
static string className() { return "ThePEG::MultiplicityCount"; }
/** Return the name(s) of the shared library (or libraries) be loaded to get
* access to the MultiplicityCount class and any other class on which it depends
* (except the base class). */
static string library() { return "MultiplicityCount.so"; }
};
/** @endcond */
}
#include "MultiplicityCount.icc"
#ifndef ThePEG_TEMPLATES_IN_CC_FILE
// #include "MultiplicityCount.tcc"
#endif
#endif /* THEPEG_MultiplicityCount_H */
diff --git a/Analysis/MultiplicityCount.icc b/Analysis/MultiplicityCount.icc
--- a/Analysis/MultiplicityCount.icc
+++ b/Analysis/MultiplicityCount.icc
@@ -1,75 +1,35 @@
// -*- C++ -*-
//
// This is the implementation of the inlined member functions of
// the MultiplicityCount class.
//
namespace ThePEG {
inline MultiplicityInfo::MultiplicityInfo(double inmult,double inerror,
ParticleSpecies intype)
: mult(inmult), error(inerror), type(intype),
actualCount(0), sumofsquares(0.0)
{}
inline double MultiplicityInfo::mean(double N) {
return actualCount / N;
}
inline double MultiplicityInfo::stderror(double N) {
return sqrt( (sumofsquares / N - sqr(mean(N))) / N );
}
inline bool MultiplicityInfo::serious(double N) {
return (abs(mean(N)-mult) > 3.0*error);
}
inline IBPtr MultiplicityCount::clone() const {
return new_ptr(*this);
}
inline IBPtr MultiplicityCount::fullclone() const {
return new_ptr(*this);
}
-inline void MultiplicityCount::dofinish() {
- AnalysisHandler::dofinish();
- cerr << "\nCount of particles involved in hard process:\n";
- for (map<long,long>::const_iterator it = _collisioncount.begin();
- it != _collisioncount.end(); ++ it) {
- string name = generator()->getParticleData(it->first)->PDGName();
- cerr << name << '\t' << it->second << '\n';
- }
-
- cerr << "\nFinal state particle count:\n";
- for (map<long,long>::const_iterator it = _finalstatecount.begin();
- it != _finalstatecount.end(); ++ it) {
- string name = generator()->getParticleData(it->first)->PDGName();
- cerr << name << '\t' << it->second << '\n';
- }
-
- cerr << "\nParticle multiplicities (compared to LEP data):\n";
- for (map<long,MultiplicityInfo>::const_iterator it = _data.begin();
- it != _data.end();
- ++it) {
- MultiplicityInfo multiplicity = it->second;
-
- string name = (it->first==0 ? "All charged" : generator()->getParticleData(it->first)->PDGName() );
-
- double N = generator()->currentEventNumber();
-
- cerr << it->first << " \t" << name << '\t' << ' ' << multiplicity.actualCount << '\t'
- << multiplicity.mean(N) << ' '
- << multiplicity.stderror(N) << " === "
- << multiplicity.mult << ' '
- << multiplicity.error << " === ";
- if (multiplicity.serious(N))
- cerr << "!!!";
- cerr << '\n';
-
- }
-
-
}
-
-}
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Sat, May 3, 6:10 AM (1 d, 7 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4982945
Default Alt Text
(17 KB)
Attached To
rTHEPEGTESTHG thepegtesthg
Event Timeline
Log In to Comment