Index: Makefile
===================================================================
--- Makefile	(revision a5af1df1cf2ca5a488fc610ab546c762b7cdb5f2)
+++ Makefile	(revision d612deca94f89952da103f30d46e21c02039b8bc)
@@ -90,5 +90,5 @@
 DISPLAYLIB = libDelphesDisplay.lib
 
-VERSION = $(shell cat VERSION)
+VERSION = x.y.z
 DISTDIR = Delphes-$(VERSION)
 DISTTAR = $(DISTDIR).tar.gz
@@ -104,5 +104,5 @@
 	classes/DelphesClasses.h \
 	classes/DelphesFactory.h \
-	classes/DelphesHepMCReader.h \
+	classes/DelphesHepMC2Reader.h \
 	classes/DelphesPileUpWriter.h \
 	external/ExRootAnalysis/ExRootProgressBar.h \
@@ -214,12 +214,24 @@
 	tmp/validation/DelphesValidation.$(ObjSuf)
 
-DelphesHepMC$(ExeSuf): \
-	tmp/readers/DelphesHepMC.$(ObjSuf)
-
-tmp/readers/DelphesHepMC.$(ObjSuf): \
-	readers/DelphesHepMC.cpp \
-	classes/DelphesClasses.h \
-	classes/DelphesFactory.h \
-	classes/DelphesHepMCReader.h \
+DelphesHepMC2$(ExeSuf): \
+	tmp/readers/DelphesHepMC2.$(ObjSuf)
+
+tmp/readers/DelphesHepMC2.$(ObjSuf): \
+	readers/DelphesHepMC2.cpp \
+	classes/DelphesClasses.h \
+	classes/DelphesFactory.h \
+	classes/DelphesHepMC2Reader.h \
+	modules/Delphes.h \
+	external/ExRootAnalysis/ExRootProgressBar.h \
+	external/ExRootAnalysis/ExRootTreeBranch.h \
+	external/ExRootAnalysis/ExRootTreeWriter.h
+DelphesHepMC3$(ExeSuf): \
+	tmp/readers/DelphesHepMC3.$(ObjSuf)
+
+tmp/readers/DelphesHepMC3.$(ObjSuf): \
+	readers/DelphesHepMC3.cpp \
+	classes/DelphesClasses.h \
+	classes/DelphesFactory.h \
+	classes/DelphesHepMC3Reader.h \
 	modules/Delphes.h \
 	external/ExRootAnalysis/ExRootProgressBar.h \
@@ -264,5 +276,6 @@
 	external/ExRootAnalysis/ExRootTreeWriter.h
 EXECUTABLE +=  \
-	DelphesHepMC$(ExeSuf) \
+	DelphesHepMC2$(ExeSuf) \
+	DelphesHepMC3$(ExeSuf) \
 	DelphesLHEF$(ExeSuf) \
 	DelphesROOT$(ExeSuf) \
@@ -270,5 +283,6 @@
 
 EXECUTABLE_OBJ +=  \
-	tmp/readers/DelphesHepMC.$(ObjSuf) \
+	tmp/readers/DelphesHepMC2.$(ObjSuf) \
+	tmp/readers/DelphesHepMC3.$(ObjSuf) \
 	tmp/readers/DelphesLHEF.$(ObjSuf) \
 	tmp/readers/DelphesROOT.$(ObjSuf) \
@@ -409,6 +423,9 @@
 	modules/MomentumSmearing.h \
 	modules/TrackSmearing.h \
+	modules/TrackCovariance.h \
+	modules/ClusterCounting.h \
 	modules/ImpactParameterSmearing.h \
 	modules/TimeSmearing.h \
+	modules/TimeOfFlight.h \
 	modules/SimpleCalorimeter.h \
 	modules/DenseTrackFilter.h \
@@ -445,8 +462,11 @@
 	modules/VertexFinder.h \
 	modules/VertexFinderDA4D.h \
-	modules/ExampleModule.h \
 	modules/LLPFilter.h \
 	modules/CscClusterEfficiency.h \
-	modules/CscClusterId.h
+	modules/CscClusterId.h \
+	modules/DecayFilter.h \
+	modules/ParticleDensity.h \
+	modules/TruthVertexFinder.h \
+	modules/ExampleModule.h
 tmp/modules/ModulesDict$(PcmSuf): \
 	tmp/modules/ModulesDict.$(SrcSuf)
@@ -512,8 +532,16 @@
 tmp/classes/DelphesFormula.$(ObjSuf): \
 	classes/DelphesFormula.$(SrcSuf) \
-	classes/DelphesFormula.h
-tmp/classes/DelphesHepMCReader.$(ObjSuf): \
-	classes/DelphesHepMCReader.$(SrcSuf) \
-	classes/DelphesHepMCReader.h \
+	classes/DelphesFormula.h \
+	classes/DelphesClasses.h
+tmp/classes/DelphesHepMC2Reader.$(ObjSuf): \
+	classes/DelphesHepMC2Reader.$(SrcSuf) \
+	classes/DelphesHepMC2Reader.h \
+	classes/DelphesClasses.h \
+	classes/DelphesFactory.h \
+	classes/DelphesStream.h \
+	external/ExRootAnalysis/ExRootTreeBranch.h
+tmp/classes/DelphesHepMC3Reader.$(ObjSuf): \
+	classes/DelphesHepMC3Reader.$(SrcSuf) \
+	classes/DelphesHepMC3Reader.h \
 	classes/DelphesClasses.h \
 	classes/DelphesFactory.h \
@@ -648,4 +676,18 @@
 tmp/external/Hector/H_VerticalQuadrupole.$(ObjSuf): \
 	external/Hector/H_VerticalQuadrupole.$(SrcSuf)
+tmp/external/TrackCovariance/AcceptanceClx.$(ObjSuf): \
+	external/TrackCovariance/AcceptanceClx.$(SrcSuf)
+tmp/external/TrackCovariance/ObsTrk.$(ObjSuf): \
+	external/TrackCovariance/ObsTrk.$(SrcSuf)
+tmp/external/TrackCovariance/SolGeom.$(ObjSuf): \
+	external/TrackCovariance/SolGeom.$(SrcSuf)
+tmp/external/TrackCovariance/SolGridCov.$(ObjSuf): \
+	external/TrackCovariance/SolGridCov.$(SrcSuf)
+tmp/external/TrackCovariance/SolTrack.$(ObjSuf): \
+	external/TrackCovariance/SolTrack.$(SrcSuf)
+tmp/external/TrackCovariance/TrkUtil.$(ObjSuf): \
+	external/TrackCovariance/TrkUtil.$(SrcSuf)
+tmp/external/TrackCovariance/VertexFit.$(ObjSuf): \
+	external/TrackCovariance/VertexFit.$(SrcSuf)
 tmp/modules/AngularSmearing.$(ObjSuf): \
 	modules/AngularSmearing.$(SrcSuf) \
@@ -690,13 +732,18 @@
 	external/ExRootAnalysis/ExRootFilter.h \
 	external/ExRootAnalysis/ExRootResult.h
+tmp/modules/ClusterCounting.$(ObjSuf): \
+	modules/ClusterCounting.$(SrcSuf) \
+	modules/ClusterCounting.h \
+	classes/DelphesClasses.h \
+	external/TrackCovariance/TrkUtil.h
 tmp/modules/ConstituentFilter.$(ObjSuf): \
-	modules/ConstituentFilter.$(SrcSuf) \
-	modules/ConstituentFilter.h \
-	classes/DelphesClasses.h \
-	classes/DelphesFactory.h \
-	classes/DelphesFormula.h \
-	external/ExRootAnalysis/ExRootClassifier.h \
-	external/ExRootAnalysis/ExRootFilter.h \
-	external/ExRootAnalysis/ExRootResult.h
+        modules/ConstituentFilter.$(SrcSuf) \
+        modules/ConstituentFilter.h \
+        classes/DelphesClasses.h \
+        classes/DelphesFactory.h \
+        classes/DelphesFormula.h \
+        external/ExRootAnalysis/ExRootClassifier.h \
+        external/ExRootAnalysis/ExRootFilter.h \
+        external/ExRootAnalysis/ExRootResult.h
 tmp/modules/CscClusterEfficiency.$(ObjSuf): \
 	modules/CscClusterEfficiency.$(SrcSuf) \
@@ -711,4 +758,13 @@
 	modules/CscClusterId.$(SrcSuf) \
 	modules/CscClusterId.h \
+	classes/DelphesClasses.h \
+        classes/DelphesFactory.h \
+        classes/DelphesFormula.h \
+	external/ExRootAnalysis/ExRootClassifier.h \
+	external/ExRootAnalysis/ExRootFilter.h \
+	external/ExRootAnalysis/ExRootResult.h
+tmp/modules/DecayFilter.$(ObjSuf): \
+	modules/DecayFilter.$(SrcSuf) \
+	modules/DecayFilter.h \
 	classes/DelphesClasses.h \
 	classes/DelphesFactory.h \
@@ -893,4 +949,13 @@
 	external/ExRootAnalysis/ExRootFilter.h \
 	external/ExRootAnalysis/ExRootResult.h
+tmp/modules/ParticleDensity.$(ObjSuf): \
+	modules/ParticleDensity.$(SrcSuf) \
+	modules/ParticleDensity.h \
+	classes/DelphesClasses.h \
+	classes/DelphesFactory.h \
+	classes/DelphesFormula.h \
+	external/ExRootAnalysis/ExRootClassifier.h \
+	external/ExRootAnalysis/ExRootFilter.h \
+	external/ExRootAnalysis/ExRootResult.h
 tmp/modules/ParticlePropagator.$(ObjSuf): \
 	modules/ParticlePropagator.$(SrcSuf) \
@@ -1001,4 +1066,13 @@
 	classes/DelphesFactory.h \
 	classes/DelphesFormula.h
+tmp/modules/TimeOfFlight.$(ObjSuf): \
+	modules/TimeOfFlight.$(SrcSuf) \
+	modules/TimeOfFlight.h \
+	classes/DelphesClasses.h \
+	classes/DelphesFactory.h \
+	classes/DelphesFormula.h \
+	external/ExRootAnalysis/ExRootClassifier.h \
+	external/ExRootAnalysis/ExRootFilter.h \
+	external/ExRootAnalysis/ExRootResult.h
 tmp/modules/TimeSmearing.$(ObjSuf): \
 	modules/TimeSmearing.$(SrcSuf) \
@@ -1025,4 +1099,11 @@
 	external/ExRootAnalysis/ExRootFilter.h \
 	external/ExRootAnalysis/ExRootResult.h
+tmp/modules/TrackCovariance.$(ObjSuf): \
+	modules/TrackCovariance.$(SrcSuf) \
+	modules/TrackCovariance.h \
+	classes/DelphesClasses.h \
+	external/TrackCovariance/SolGeom.h \
+	external/TrackCovariance/SolGridCov.h \
+	external/TrackCovariance/ObsTrk.h
 tmp/modules/TrackPileUpSubtractor.$(ObjSuf): \
 	modules/TrackPileUpSubtractor.$(SrcSuf) \
@@ -1053,4 +1134,14 @@
 	external/ExRootAnalysis/ExRootResult.h \
 	external/ExRootAnalysis/ExRootTreeBranch.h
+tmp/modules/TruthVertexFinder.$(ObjSuf): \
+	modules/TruthVertexFinder.$(SrcSuf) \
+	modules/TruthVertexFinder.h \
+	classes/DelphesClasses.h \
+	classes/DelphesFactory.h \
+	classes/DelphesPileUpReader.h \
+	classes/DelphesTF2.h \
+	external/ExRootAnalysis/ExRootClassifier.h \
+	external/ExRootAnalysis/ExRootFilter.h \
+	external/ExRootAnalysis/ExRootResult.h
 tmp/modules/UniqueObjectFinder.$(ObjSuf): \
 	modules/UniqueObjectFinder.$(SrcSuf) \
@@ -1106,5 +1197,6 @@
 	tmp/classes/DelphesFactory.$(ObjSuf) \
 	tmp/classes/DelphesFormula.$(ObjSuf) \
-	tmp/classes/DelphesHepMCReader.$(ObjSuf) \
+	tmp/classes/DelphesHepMC2Reader.$(ObjSuf) \
+	tmp/classes/DelphesHepMC3Reader.$(ObjSuf) \
 	tmp/classes/DelphesLHEFReader.$(ObjSuf) \
 	tmp/classes/DelphesModule.$(ObjSuf) \
@@ -1152,4 +1244,11 @@
 	tmp/external/Hector/H_VerticalKicker.$(ObjSuf) \
 	tmp/external/Hector/H_VerticalQuadrupole.$(ObjSuf) \
+	tmp/external/TrackCovariance/AcceptanceClx.$(ObjSuf) \
+	tmp/external/TrackCovariance/ObsTrk.$(ObjSuf) \
+	tmp/external/TrackCovariance/SolGeom.$(ObjSuf) \
+	tmp/external/TrackCovariance/SolGridCov.$(ObjSuf) \
+	tmp/external/TrackCovariance/SolTrack.$(ObjSuf) \
+	tmp/external/TrackCovariance/TrkUtil.$(ObjSuf) \
+	tmp/external/TrackCovariance/VertexFit.$(ObjSuf) \
 	tmp/modules/AngularSmearing.$(ObjSuf) \
 	tmp/modules/BTagging.$(ObjSuf) \
@@ -1157,7 +1256,9 @@
 	tmp/modules/Calorimeter.$(ObjSuf) \
 	tmp/modules/Cloner.$(ObjSuf) \
+	tmp/modules/ClusterCounting.$(ObjSuf) \
 	tmp/modules/ConstituentFilter.$(ObjSuf) \
 	tmp/modules/CscClusterEfficiency.$(ObjSuf) \
 	tmp/modules/CscClusterId.$(ObjSuf) \
+	tmp/modules/DecayFilter.$(ObjSuf) \
 	tmp/modules/Delphes.$(ObjSuf) \
 	tmp/modules/DenseTrackFilter.$(ObjSuf) \
@@ -1179,4 +1280,5 @@
 	tmp/modules/MomentumSmearing.$(ObjSuf) \
 	tmp/modules/OldCalorimeter.$(ObjSuf) \
+	tmp/modules/ParticleDensity.$(ObjSuf) \
 	tmp/modules/ParticlePropagator.$(ObjSuf) \
 	tmp/modules/PdgCodeFilter.$(ObjSuf) \
@@ -1190,10 +1292,13 @@
 	tmp/modules/TaggingParticlesSkimmer.$(ObjSuf) \
 	tmp/modules/TauTagging.$(ObjSuf) \
+	tmp/modules/TimeOfFlight.$(ObjSuf) \
 	tmp/modules/TimeSmearing.$(ObjSuf) \
 	tmp/modules/TrackCountingBTagging.$(ObjSuf) \
 	tmp/modules/TrackCountingTauTagging.$(ObjSuf) \
+	tmp/modules/TrackCovariance.$(ObjSuf) \
 	tmp/modules/TrackPileUpSubtractor.$(ObjSuf) \
 	tmp/modules/TrackSmearing.$(ObjSuf) \
 	tmp/modules/TreeWriter.$(ObjSuf) \
+	tmp/modules/TruthVertexFinder.$(ObjSuf) \
 	tmp/modules/UniqueObjectFinder.$(ObjSuf) \
 	tmp/modules/VertexFinder.$(ObjSuf) \
@@ -1911,8 +2016,16 @@
 	@touch $@
 
+modules/TrackCovariance.h: \
+	classes/DelphesModule.h
+	@touch $@
+
 modules/ExampleModule.h: \
 	classes/DelphesModule.h
 	@touch $@
 
+modules/Merger.h: \
+	classes/DelphesModule.h
+	@touch $@
+
 modules/Isolation.h: \
 	classes/DelphesModule.h
@@ -1920,8 +2033,4 @@
 
 modules/EnergyScale.h: \
-	classes/DelphesModule.h
-	@touch $@
-
-modules/Merger.h: \
 	classes/DelphesModule.h
 	@touch $@
@@ -1958,4 +2067,8 @@
 	external/fastjet/config.h \
 	external/fastjet/LimitedWarning.hh
+	@touch $@
+
+modules/DecayFilter.h: \
+	classes/DelphesModule.h
 	@touch $@
 
@@ -2037,4 +2150,8 @@
 	@touch $@
 
+modules/TimeOfFlight.h: \
+	classes/DelphesModule.h
+	@touch $@
+
 external/fastjet/contribs/Nsubjettiness/NjettinessPlugin.hh: \
 	external/fastjet/ClusterSequence.hh \
@@ -2155,4 +2272,8 @@
 	@touch $@
 
+modules/TruthVertexFinder.h: \
+	classes/DelphesModule.h
+	@touch $@
+
 classes/DelphesSTDHEPReader.h: \
 	classes/DelphesXDRReader.h
@@ -2231,4 +2352,8 @@
 	@touch $@
 
+modules/ClusterCounting.h: \
+	classes/DelphesModule.h
+	@touch $@
+
 modules/SimpleCalorimeter.h: \
 	classes/DelphesModule.h
@@ -2266,9 +2391,13 @@
 	@touch $@
 
+modules/ParticleDensity.h: \
+	classes/DelphesModule.h
+	@touch $@
+
+modules/TreeWriter.h: \
+	classes/DelphesModule.h
+	@touch $@
+
 modules/TimeSmearing.h: \
-	classes/DelphesModule.h
-	@touch $@
-
-modules/TreeWriter.h: \
 	classes/DelphesModule.h
 	@touch $@
@@ -2336,15 +2465,6 @@
 	@mkdir -p $(@D)
 	@echo ">> Building $@"
-ifeq ($(ARCH),aix5)
-	@$(MAKESHARED) $(OutPutOpt) $@ $(DELPHES_LIBS) -p 0 $^
-else
 ifeq ($(PLATFORM),macosx)
-# We need to make both the .dylib and the .so
 	@$(LD) $(SOFLAGS)$@ $(LDFLAGS) $^ $(OutPutOpt) $@ $(DELPHES_LIBS)
-ifneq ($(subst $(MACOSX_MINOR),,1234),1234)
-ifeq ($(MACOSX_MINOR),4)
-	@ln -sf $@ $(subst .$(DllSuf),.so,$@)
-endif
-endif
 else
 ifeq ($(PLATFORM),win32)
@@ -2355,6 +2475,4 @@
 else
 	@$(LD) $(SOFLAGS) $(LDFLAGS) $^ $(OutPutOpt) $@ $(DELPHES_LIBS)
-	@$(MT_DLL)
-endif
 endif
 endif
@@ -2363,15 +2481,6 @@
 	@mkdir -p $(@D)
 	@echo ">> Building $@"
-ifeq ($(ARCH),aix5)
-	@$(MAKESHARED) $(OutPutOpt) $@ $(DELPHES_LIBS) -p 0 $^
-else
 ifeq ($(PLATFORM),macosx)
-# We need to make both the .dylib and the .so
 	@$(LD) $(SOFLAGS)$@ $(LDFLAGS) $^ $(OutPutOpt) $@ $(DELPHES_LIBS)
-ifneq ($(subst $(MACOSX_MINOR),,1234),1234)
-ifeq ($(MACOSX_MINOR),4)
-	@ln -sf $@ $(subst .$(DllSuf),.so,$@)
-endif
-endif
 else
 ifeq ($(PLATFORM),win32)
@@ -2382,6 +2491,4 @@
 else
 	@$(LD) $(SOFLAGS) $(LDFLAGS) $^ $(OutPutOpt) $@ $(DELPHES_LIBS)
-	@$(MT_DLL)
-endif
 endif
 endif
@@ -2390,15 +2497,6 @@
 	@mkdir -p $(@D)
 	@echo ">> Building $@"
-ifeq ($(ARCH),aix5)
-	@$(MAKESHARED) $(OutPutOpt) $@ $(DISPLAY_LIBS) -p 0 $^
-else
 ifeq ($(PLATFORM),macosx)
-# We need to make both the .dylib and the .so
 	@$(LD) $(SOFLAGS)$@ $(LDFLAGS) $^ $(OutPutOpt) $@ $(DISPLAY_LIBS)
-ifneq ($(subst $(MACOSX_MINOR),,1234),1234)
-ifeq ($(MACOSX_MINOR),4)
-	@ln -sf $@ $(subst .$(DllSuf),.so,$@)
-endif
-endif
 else
 ifeq ($(PLATFORM),win32)
@@ -2409,6 +2507,4 @@
 else
 	@$(LD) $(SOFLAGS) $(LDFLAGS) $^ $(OutPutOpt) $@ $(DISPLAY_LIBS)
-	@$(MT_DLL)
-endif
 endif
 endif
@@ -2424,5 +2520,5 @@
 	@echo ">> Building $(DISTTAR)"
 	@mkdir -p $(DISTDIR)
-	@cp -a AUTHORS CHANGELOG CMakeLists.txt COPYING DelphesEnv.sh LICENSE NOTICE README README_4LHCb VERSION Makefile MinBias.pileup configure cards classes converters display doc examples external modules python readers validation $(DISTDIR)
+	@cp -a AUTHORS CHANGELOG CMakeLists.txt COPYING DelphesEnv.sh LICENSE NOTICE README README_4LHCb Makefile MinBias.pileup configure cards classes cmake converters display doc examples external modules python readers validation $(DISTDIR)
 	@find $(DISTDIR) -depth -name .\* -exec rm -rf {} \;
 	@tar -czf $(DISTTAR) $(DISTDIR)
