Page Menu
Home
HEPForge
Search
Configure Global Search
Log In
Files
F8723537
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
10 KB
Subscribers
None
View Options
diff --git a/Contrib/Makefile.am b/Contrib/Makefile.am
--- a/Contrib/Makefile.am
+++ b/Contrib/Makefile.am
@@ -1,20 +1,21 @@
EXTRA_DIST = \
AcerDetInterface \
AlpGen \
Analysis2 \
AnomalousHVV \
DecayAnalysis \
HiggsPair \
HiggsPairOL \
LeptonME \
PGSInterface \
RadiativeZPrime \
TauAnalysis \
-HJets++
+HJets++ \
+MultiWeight
dist-hook:
rm -rf `find $(distdir) -name '.svn' -or -name 'Makefile' -or -name '.hg'`
cd HJets++; autoreconf -vi
all:
bash make_makefiles.sh
diff --git a/Contrib/MultiWeight/Makefile.in b/Contrib/MultiWeight/Makefile.in
new file mode 100644
--- /dev/null
+++ b/Contrib/MultiWeight/Makefile.in
@@ -0,0 +1,36 @@
+# -*- Makefile -*- (for emacs)
+#
+# This Makefile is intended for compiling Herwig++ plugins
+#
+# This Makefile received very little testing,
+# any bug reports are very welcome!
+#
+# Location of include files
+THEPEGINCLUDE =
+HERWIGINCLUDE =
+GSLINCLUDE =
+#RIVETINCLUDE = -I$(shell rivet-config --includedir --cppflags)
+# Messy hack, not guaranteed to work:
+FASTJETLIB = `echo $(FASTJETINCLUDE) | sed "s/-I//" | sed "s/ //"`/../lib/
+#LDFLAGS = -L$(FASTJETLIB) -lfastjet $(HEPMCLIB)
+#LDFLAGS += $(shell rivet-config --ldflags --libs)
+LDFLAGS =
+SHARED_FLAG =
+INCLUDE = $(THEPEGINCLUDE) $(HERWIGINCLUDE) $(GSLINCLUDE) $(FASTJETINCLUDE) $(RIVETINCLUDE) $(HEPMCINCLUDE)
+# C++ flags
+CXX =
+CXXFLAGS =
+
+ALLCCFILES=$(shell echo *.cc)
+
+default : MultiWeight.so
+
+%.o : %.cc %.h
+ $(CXX) -fPIC $(CPPFLAGS) $(INCLUDE) $(CXXFLAGS) -c -shared $< -o $@
+
+MultiWeight.so:
+ $(CXX) $(INCLUDE) -fPIC MultiWeight.cc $(CPPFLAGS) $(INCLUDE) $(CXXFLAGS) $(SHARED_FLAG) $(LDFLAGS) -shared -o MultiWeight.so
+
+clean:
+ rm -f $(ALLCCFILES:.cc=.o) \
+ MultiWeight.so
diff --git a/Contrib/MultiWeight/MultiWeight.cc b/Contrib/MultiWeight/MultiWeight.cc
new file mode 100644
--- /dev/null
+++ b/Contrib/MultiWeight/MultiWeight.cc
@@ -0,0 +1,137 @@
+// -*- C++ -*-
+//
+// MultiWeight.cc is a part of Herwig++ - A multi-purpose Monte Carlo event generator
+// Copyright (C) 2002-2015 The Herwig Collaboration
+//
+// Herwig++ is licenced under version 2 of the GPL, see COPYING for details.
+// Please respect the MCnet academic guidelines, see GUIDELINES for details.
+//
+//
+// This is the implementation of the non-inlined, non-templated member
+// functions of the MultiWeight class.
+//
+
+#include <cmath>
+#include <fstream>
+
+#include "MultiWeight.h"
+#include "ThePEG/Repository/EventGenerator.h"
+#include "ThePEG/EventRecord/Particle.h"
+#include "ThePEG/Vectors/ThreeVector.h"
+#include "ThePEG/EventRecord/Event.h"
+#include "ThePEG/PDT/EnumParticles.h"
+#include "ThePEG/Interface/ClassDocumentation.h"
+#include "ThePEG/Persistency/PersistentOStream.h"
+#include "ThePEG/Persistency/PersistentIStream.h"
+#include <boost/algorithm/string.hpp>
+
+using namespace Herwig;
+
+MultiWeight::MultiWeight() {}
+
+
+IBPtr MultiWeight::clone() const {
+ return new_ptr(*this);
+}
+
+IBPtr MultiWeight::fullclone() const {
+ return new_ptr(*this);
+}
+
+
+//Define the necessary fortran analyse(s) here. Make sure you include the underscore.
+
+
+void MultiWeight::doinitrun() {
+ AnalysisHandler::doinitrun();
+}
+
+//The following function analyses an event. You may also add a C++ analysis here.
+void MultiWeight::analyze(tEventPtr event, long, int, int) {
+
+ /* variables to be
+ * filled
+ */
+ double real_weight;
+ int iapp = 0;
+
+ /*
+ * loop over the optional weights
+ * use the "special" weight values
+ * to identify them
+ */
+ for (map<string,double>::const_iterator it= event->optionalWeights().begin(); it!=event->optionalWeights().end(); ++it){
+
+ string one = it->first; // contains the weight information
+ double two = it->second; // contains the weight
+
+ // print for debugging
+ // cout << "it = " << it->first << "->" << it->second << endl;
+
+ /*
+ * aMCFast weights
+ */
+ if(it->second == -111) {
+ one.erase(one.begin(),one.begin()+7);
+ one.erase(one.end()-1,one.end());
+ iapp++;
+ cout << "aMCFast: " << endl;
+ cout << "\tit = " << it->first << endl;
+ }
+
+ /*
+ * mg5 clustering info
+ */
+ if(it->second == -222) {
+ cout << "mg5 clustering: " << endl;
+ cout << "\tit = " << it->first << endl;
+ }
+ /*
+ * mg5 scale clustering info
+ */
+ if(it->second == -333) {
+ cout << "mg5 clustering scale: " << endl;
+ cout << "\tit = " << it->first << endl;
+ }
+
+ /*
+ * mg5 scale clustering info
+ */
+ if(it->second == -999) {
+ cout << "FxFx info: " << endl;
+ cout << "\tit = " << it->first << endl;
+ }
+
+ /* if none of the special tags
+ * then it's an optional weight
+ */
+ if(it->second != -111 && it->second != -222 && it->second != -333 && it->second != -999) {
+ cout << "optional weight:" << endl;
+ cout << "\tit = " << it->first << "->" << it->second << endl;
+ }
+
+ /*
+ * the "central" weight for the event
+ */
+ string central = "central";
+ if(one == central) { real_weight = it->second; }
+ }
+
+}
+
+
+NoPIOClassDescription<MultiWeight> MultiWeight::initMultiWeight;
+// Definition of the static class description member.
+
+void MultiWeight::Init() {
+ std::cout << "MultiWeight analysis loaded" << endl;
+
+ static ClassDocumentation<MultiWeight> documentation
+ ("The MultiWeight class prints is an interface to a Multiple Weight analysis");
+
+}
+
+void MultiWeight::dofinish() {
+ AnalysisHandler::dofinish();
+}
+
diff --git a/Contrib/MultiWeight/MultiWeight.h b/Contrib/MultiWeight/MultiWeight.h
new file mode 100644
--- /dev/null
+++ b/Contrib/MultiWeight/MultiWeight.h
@@ -0,0 +1,163 @@
+// -*- C++ -*-
+//
+// MultiWeight.h is a part of Herwig++ - A multi-purpose Monte Carlo event generator
+// Copyright (C) 2002-2007 The Herwig Collaboration
+//
+// Herwig++ is licenced under version 2 of the GPL, see COPYING for details.
+// Please respect the MCnet academic guidelines, see GUIDELINES for details.
+//
+#ifndef HERWIG_MultiWeight_H
+#define HERWIG_MultiWeight_H
+//
+// This is the declaration of the MultiWeight class.
+//
+
+#include "ThePEG/Repository/CurrentGenerator.h"
+#include "ThePEG/Handlers/AnalysisHandler.h"
+#include "MultiWeight.fh"
+#include "Herwig++/Utilities/Histogram.h"
+
+
+
+#include <cmath>
+#include <fstream>
+
+namespace Herwig {
+
+using namespace ThePEG;
+
+/**
+ * The MultiWeight class is designed to perform some simple analysis of
+ * gauge boson, W and Z, distributions in hadron-hadron collisions. The main
+ * distriubtions are the transverse momentum and rapidities of the gauge bosons
+ * which are of physical interest, and the azimuthal angle distribution for
+ * testing purposes.
+ *
+ * @see \ref MultiWeightInterfaces "The interfaces"
+ * defined for MultiWeight.
+ */
+class MultiWeight: public AnalysisHandler {
+
+public:
+
+ /**
+ * The default constructor.
+ */
+ inline MultiWeight();
+
+ /** @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);
+
+
+ //@}
+
+
+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.
+ */
+ 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.
+ */
+ virtual IBPtr fullclone() const;
+ //@}
+
+protected:
+ inline virtual void doinitrun();
+ /** @name Standard Interfaced functions. */
+ //@{
+ /**
+ * Finalize this object. Called in the run phase just after a
+ * run has ended. Used eg. to write out statistics.
+ */
+ 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<MultiWeight> initMultiWeight;
+
+ /**
+ * The assignment operator is private and must never be called.
+ * In fact, it should not even be implemented.
+ */
+ MultiWeight & operator=(const MultiWeight &);
+
+private:
+
+};
+
+}
+
+#include "ThePEG/Utilities/ClassTraits.h"
+
+namespace ThePEG {
+
+/** @cond TRAITSPECIALIZATIONS */
+
+/** This template specialization informs ThePEG about the
+ * base classes of MultiWeight. */
+template <>
+struct BaseClassTrait<Herwig::MultiWeight,1> {
+ /** Typedef of the first base class of MultiWeight. */
+ typedef AnalysisHandler NthBase;
+};
+
+/** This template specialization informs ThePEG about the name of
+ * the MultiWeight class and the shared object where it is defined. */
+template <>
+struct ClassTraits<Herwig::MultiWeight>
+ : public ClassTraitsBase<Herwig::MultiWeight> {
+ /** Return a platform-independent class name */
+ static string className() { return "Herwig::MultiWeight"; }
+ /** Return the name(s) of the shared library (or libraries) be loaded to get
+ * access to the MultiWeight class and any other class on which it depends
+ * (except the base class). */
+ static string library() { return "MultiWeight.so"; }
+};
+
+/** @endcond */
+
+}
+
+
+#endif /* HERWIG_SimpleLHCAnalysis_H */
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Mon, Jan 20, 8:40 PM (12 h, 20 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4242306
Default Alt Text
(10 KB)
Attached To
rHERWIGHG herwighg
Event Timeline
Log In to Comment