#ifndef _HEPMCCONVERTER_H_ #define _HEPMCCONVERTER_H_ /*********************************************************************** ** ** ** /----------------------------------------------\ ** ** | Delphes, a framework for the fast simulation | ** ** | of a generic collider experiment | ** ** \----------------------------------------------/ ** ** ** ** ** ** This package uses: ** ** ------------------ ** ** FastJet algorithm: Phys. Lett. B641 (2006) [hep-ph/0512210] ** ** Hector: JINST 2:P09005 (2007) [physics.acc-ph:0707.1198v2] ** ** FROG: [hep-ex/0901.2718v1] ** ** ** ** ------------------------------------------------------------------ ** ** ** ** Main authors: ** ** ------------- ** ** ** ** Severine Ovyn Xavier Rouby ** ** severine.ovyn@uclouvain.be xavier.rouby@cern ** ** ** ** Center for Particle Physics and Phenomenology (CP3) ** ** Universite catholique de Louvain (UCL) ** ** Louvain-la-Neuve, Belgium ** ** ** ** Copyright (C) 2008-2009, ** ** All rights reserved. ** ** ** ***********************************************************************/ #include #include "DataConverter.h" #include "GenParticle.h" #include "GenVertex.h" #include "GenEvent.h" #include "IO_Ascii.h" using namespace std; class HepMCConverter : public DataConverter { public: HepMCConverter(const string& inputFileList, const string& outputFileName, const int& Nevents=-1); virtual ~HepMCConverter(); // const iterator for incoming particles typedef std::vector::const_iterator particles_in_const_iterator; private: void AnalyseEvent(ExRootTreeBranch *branch,HepMC::GenEvent& evt,const Long64_t eventNumber); void AnalyseParticles(ExRootTreeBranch *branch, const HepMC::GenEvent& evt); void getStatsFromTuple(int &mo1, int &mo2, int &da1, int &da2, int &status, int &pid, int j) const; void ReadStats(); int mo1, mo2, da1, da2, status, pid; HepMC::GenEvent *evt; int rdstate() const; //maps to convert HepMC::GenParticle to particles # and vice versa // -> needed for HepEvt like output std::vector index_to_particle; std::map particle_to_index; // find index to HepMC::GenParticle* p in map m int find_in_map(const std::map& m,HepMC::GenParticle *p) const; }; #endif