Page MenuHomeHEPForge

No OneTemporary

diff --git a/Analysis/HIHepMCFile.cc b/Analysis/HIHepMCFile.cc
--- a/Analysis/HIHepMCFile.cc
+++ b/Analysis/HIHepMCFile.cc
@@ -1,198 +1,206 @@
// -*- C++ -*-
//
// HIHepMCFile.cc is a part of ThePEG - Toolkit for HEP Event Generation
// Copyright (C) 1999-2011 Leif Lonnblad
//
// ThePEG 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 HIHepMCFile class.
//
#include "HIHepMCFile.h"
#include <config.h>
#include "ThePEG/Interface/ClassDocumentation.h"
#include "ThePEG/Interface/Parameter.h"
#include "ThePEG/Interface/Switch.h"
#include "ThePEG/EventRecord/Event.h"
#include "ThePEG/Repository/EventGenerator.h"
#include "ThePEG/Persistency/PersistentOStream.h"
#include "ThePEG/Persistency/PersistentIStream.h"
#include "ThePEG/Config/HepMCHelper.h"
#include "HepMC/IO_GenEvent.h"
#include "HepMC/IO_AsciiParticles.h"
#include "HepMC/GenCrossSection.h"
using namespace ThePEG;
HIHepMCFile::HIHepMCFile()
: _eventNumber(1), _format(1), _filename(), _unitchoice(),
_geneventPrecision(16) {}
// Cannot copy streams.
// Let doinitrun() take care of their initialization.
HIHepMCFile::HIHepMCFile(const HIHepMCFile & x)
: AnalysisHandler(x),
_eventNumber(x._eventNumber), _format(x._format),
_filename(x._filename), _hepmcio(), _hepmcdump(),
_unitchoice(x._unitchoice),
_geneventPrecision(x._geneventPrecision) {}
IBPtr HIHepMCFile::clone() const {
return new_ptr(*this);
}
IBPtr HIHepMCFile::fullclone() const {
return new_ptr(*this);
}
void HIHepMCFile::doinitrun() {
AnalysisHandler::doinitrun();
// set default filename unless user-specified name exists
if ( _filename.empty() )
_filename = generator()->filename() + ".hepmc";
switch ( _format ) {
default: {
HepMC::IO_GenEvent * tmpio
= new HepMC::IO_GenEvent(_filename.c_str(), ios::out);
tmpio->precision(_geneventPrecision);
_hepmcio = tmpio;
break;
}
case 2:
_hepmcio = new HepMC::IO_AsciiParticles(_filename.c_str(), ios::out);
break;
case 5:
_hepmcio = 0;
_hepmcdump.open(_filename.c_str());
break;
}
}
void HIHepMCFile::dofinish() {
if (_hepmcio) {
delete _hepmcio;
_hepmcio = 0;
}
else
_hepmcdump.close();
AnalysisHandler::dofinish();
cout << "\nHIHepMCFile: generated HepMC output.\n";
}
void HIHepMCFile::analyze(tEventPtr event, long, int, int) {
if (event->number() > _eventNumber) return;
Energy eUnit;
Length lUnit;
switch (_unitchoice) {
default: eUnit = GeV; lUnit = millimeter; break;
case 1: eUnit = MeV; lUnit = millimeter; break;
case 2: eUnit = GeV; lUnit = centimeter; break;
case 3: eUnit = MeV; lUnit = centimeter; break;
}
HepMC::GenEvent * hepmc
= HepMCConverter<HepMC::GenEvent>::convert(*event, false,
eUnit, lUnit);
HepMC::HeavyIon heavyion(1,1,1,1,1,1);
- double bpar = (event->incoming().first->vertex() - event->incoming().second->vertex()).perp()/femtometer;
+
+ const LorentzPoint v1 = event->incoming().first->vertex();
+ const LorentzPoint v2 = event->incoming().second->vertex();
+
+ double bpar = (v1 - v2).perp()/femtometer;
+ heavyion.HepMC::HeavyIon::set_event_plane_angle(atan2((v1 - v2).y(),(v1 - v2).x()));
heavyion.HepMC::HeavyIon::set_impact_parameter(float(bpar));
+
+ // Clear and blatant abuse of the Pdf info container!!
+ HepMC::PdfInfo pdfinfo(1,1,event->optionalWeight("averageKappa"),event->optionalWeight("junctions"),event->optionalWeight("lambdaSum"),1,1);
+
+
hepmc->set_heavy_ion(heavyion);
- //HepMC::GenCrossSection xs;
- //xs.set_cross_section( 666666, 0.666 );
- //hepmc->set_cross_section( xs );
+ hepmc->set_pdf_info(pdfinfo);
if (_hepmcio)
_hepmcio->write_event(hepmc);
else
hepmc->print(_hepmcdump);
delete hepmc;
}
void HIHepMCFile::persistentOutput(PersistentOStream & os) const {
os << _eventNumber << _format << _filename
<< _unitchoice << _geneventPrecision;
}
void HIHepMCFile::persistentInput(PersistentIStream & is, int) {
is >> _eventNumber >> _format >> _filename
>> _unitchoice >> _geneventPrecision;
}
ClassDescription<HIHepMCFile> HIHepMCFile::initHIHepMCFile;
// Definition of the static class description member.
void HIHepMCFile::Init() {
static ClassDocumentation<HIHepMCFile> documentation
("This analysis handler will output the event record in HepMC format.");
static Parameter<HIHepMCFile,long> interfacePrintEvent
("PrintEvent",
"The number of events that should be printed.",
&HIHepMCFile::_eventNumber, 1, 0, 0,
false, false, Interface::lowerlim);
static Switch<HIHepMCFile,int> interfaceFormat
("Format",
"Output format (1 = GenEvent, 2 = AsciiParticles, 5 = HepMC dump)",
&HIHepMCFile::_format, 1, false, false);
static SwitchOption interfaceFormatGenEvent
(interfaceFormat,
"GenEvent",
"IO_GenEvent format",
1);
static SwitchOption interfaceFormatAsciiParticles
(interfaceFormat,
"AsciiParticles",
"Deprecated (IO_AsciiParticles format)",
2);
static SwitchOption interfaceFormatDump
(interfaceFormat,
"Dump",
"Event dump (human readable)",
5);
static Parameter<HIHepMCFile,string> interfaceFilename
("Filename", "Name of the output file",
&HIHepMCFile::_filename, "");
static Parameter<HIHepMCFile,unsigned int> interfacePrecision
("Precision",
"Choice of output precision for the GenEvent format "
" (as number of digits).",
&HIHepMCFile::_geneventPrecision, 16, 6, 16,
false, false, Interface::limited);
static Switch<HIHepMCFile,int> interfaceUnits
("Units",
"Unit choice for energy and length",
&HIHepMCFile::_unitchoice, 0, false, false);
static SwitchOption interfaceUnitsGeV_mm
(interfaceUnits,
"GeV_mm",
"Use GeV and mm as units.",
0);
static SwitchOption interfaceUnitsMeV_mm
(interfaceUnits,
"MeV_mm",
"Use MeV and mm as units.",
1);
static SwitchOption interfaceUnitsGeV_cm
(interfaceUnits,
"GeV_cm",
"Use GeV and cm as units.",
2);
static SwitchOption interfaceUnitsMeV_cm
(interfaceUnits,
"MeV_cm",
"Use MeV and cm as units.",
3);
}
diff --git a/Analysis/Makefile.am b/Analysis/Makefile.am
--- a/Analysis/Makefile.am
+++ b/Analysis/Makefile.am
@@ -1,73 +1,65 @@
AIDAWRAPPERS = LWH/AIAnalysisFactory.h LWH/AIAxis.h LWH/AIHistogram1D.h LWH/AIHistogram2D.h \
LWH/AIHistogramFactory.h LWH/AITree.h LWH/AITreeFactory.h \
LWH/AIManagedObject.h LWH/AIDataPoint.h LWH/AIDataPointSet.h \
LWH/AIDataPointSetFactory.h LWH/AIMeasurement.h
LWHHEADERS = LWH/AnalysisFactory.h LWH/Axis.h LWH/Tree.h LWH/TreeFactory.h \
LWH/Histogram1D.h LWH/Histogram2D.h LWH/HistogramFactory.h LWH/ManagedObject.h \
LWH/VariAxis.h LWH/DataPoint.h LWH/DataPointSet.h LWH/DataPointSetFactory.h \
LWH/Measurement.h
mySOURCES = LWHFactory.cc
pkglib_LTLIBRARIES = LWHFactory.la XSecCheck.la ProgressLog.la
if HAVE_RIVET
DOCFILES = RivetAnalysis.h NLORivetAnalysis.h
pkglib_LTLIBRARIES += RivetAnalysis.la
RivetAnalysis_la_CPPFLAGS = $(RIVETINCLUDE) $(HEPMCINCLUDE) $(AM_CPPFLAGS)
RivetAnalysis_la_LIBADD = $(HEPMCLIBS) $(RIVETLIBS)
RivetAnalysis_la_SOURCES = RivetAnalysis.cc NLORivetAnalysis.cc $(INCLUDEFILES)
RivetAnalysis_la_LDFLAGS = $(AM_LDFLAGS) -module $(LIBTOOLVERSIONINFO)
else
DOCFILES = $(AIDAWRAPPERS) $(LWHHEADERS)
endif
DOCFILES += LWHFactory.h
INCLUDEFILES = $(DOCFILES)
LWHFactory_la_SOURCES = $(mySOURCES) $(INCLUDEFILES)
LWHFactory_la_LDFLAGS = $(AM_LDFLAGS) -module $(LIBTOOLVERSIONINFO)
LWHFactory_la_CPPFLAGS = $(AM_CPPFLAGS) $(LWHINCLUDE)
XSecCheck_la_SOURCES = XSecCheck.cc XSecCheck.h
XSecCheck_la_LDFLAGS = $(AM_LDFLAGS) -module $(LIBTOOLVERSIONINFO)
ProgressLog_la_SOURCES = ProgressLog.cc ProgressLog.h
ProgressLog_la_LDFLAGS = $(AM_LDFLAGS) -module $(LIBTOOLVERSIONINFO)
noinst_LTLIBRARIES = libThePEGHist.la
libThePEGHist_la_SOURCES = \
FactoryBase.cc FactoryBase.fh FactoryBase.h AIDA_helper.h
libThePEGHist_la_CPPFLAGS = $(AM_CPPFLAGS) $(LWHINCLUDE)
if HAVE_HEPMC
pkglib_LTLIBRARIES += HepMCAnalysis.la
HepMCAnalysis_la_LDFLAGS = $(AM_LDFLAGS) -module $(LIBTOOLVERSIONINFO)
- HepMCAnalysis_la_SOURCES = HepMCFile.h HepMCFile.cc NLOHepMCFile.h NLOHepMCFile.cc HIHepMCFile.h HIHepMCFile.cc
- HepMCAnalysis_la_CPPFLAGS = $(AM_CPPFLAGS) $(HEPMCINCLUDE)
- HepMCAnalysis_la_LIBADD = $(HEPMCLIBS)
-endif
-
-if HAVE_HEPMC3
- pkglib_LTLIBRARIES += HepMCAnalysis.la
- HepMCAnalysis_la_LDFLAGS = $(AM_LDFLAGS) -module $(LIBTOOLVERSIONINFO)
- HepMCAnalysis_la_SOURCES = HepMC3File.h HepMC3File.cc NLOHepMC3File.h NLOHepMC3File.cc
+ HepMCAnalysis_la_SOURCES = HepMCFile.h HepMCFile.cc NLOHepMCFile.h NLOHepMCFile.cc HIHepMCFile.h HIHepMCFile.cc
HepMCAnalysis_la_CPPFLAGS = $(AM_CPPFLAGS) $(HEPMCINCLUDE)
HepMCAnalysis_la_LIBADD = $(HEPMCLIBS)
endif
pkglib_LTLIBRARIES += GraphvizPlot.la
GraphvizPlot_la_LDFLAGS = $(AM_LDFLAGS) -module $(LIBTOOLVERSIONINFO)
GraphvizPlot_la_SOURCES = GraphvizPlot.h GraphvizPlot.cc
LWH.tgz: $(AIDAWRAPPERS) $(LWHHEADERS)
tar czf LWH.tgz $(AIDAWRAPPERS) $(LWHHEADERS)
include $(top_srcdir)/Config/Makefile.aminclude

File Metadata

Mime Type
text/x-diff
Expires
Sat, Dec 21, 1:54 PM (15 h, 36 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4014140
Default Alt Text
(9 KB)

Event Timeline