[356] | 1 | #ifndef _HEPMCCONVERTER_H_
|
---|
| 2 | #define _HEPMCCONVERTER_H_
|
---|
| 3 |
|
---|
| 4 | /***********************************************************************
|
---|
| 5 | ** **
|
---|
| 6 | ** /----------------------------------------------\ **
|
---|
| 7 | ** | Delphes, a framework for the fast simulation | **
|
---|
| 8 | ** | of a generic collider experiment | **
|
---|
[443] | 9 | ** \------------- arXiv:0903.2225v1 ------------/ **
|
---|
[356] | 10 | ** **
|
---|
| 11 | ** **
|
---|
| 12 | ** This package uses: **
|
---|
| 13 | ** ------------------ **
|
---|
[443] | 14 | ** ROOT: Nucl. Inst. & Meth. in Phys. Res. A389 (1997) 81-86 **
|
---|
| 15 | ** FastJet algorithm: Phys. Lett. B641 (2006) [hep-ph/0512210] **
|
---|
| 16 | ** Hector: JINST 2:P09005 (2007) [physics.acc-ph:0707.1198v2] **
|
---|
[356] | 17 | ** FROG: [hep-ex/0901.2718v1] **
|
---|
[443] | 18 | ** HepMC: Comput. Phys. Commun.134 (2001) 41 **
|
---|
[356] | 19 | ** **
|
---|
| 20 | ** ------------------------------------------------------------------ **
|
---|
| 21 | ** **
|
---|
| 22 | ** Main authors: **
|
---|
| 23 | ** ------------- **
|
---|
| 24 | ** **
|
---|
[443] | 25 | ** Severine Ovyn Xavier Rouby **
|
---|
| 26 | ** severine.ovyn@uclouvain.be xavier.rouby@cern **
|
---|
[356] | 27 | ** **
|
---|
[443] | 28 | ** Center for Particle Physics and Phenomenology (CP3) **
|
---|
| 29 | ** Universite catholique de Louvain (UCL) **
|
---|
| 30 | ** Louvain-la-Neuve, Belgium **
|
---|
| 31 | ** **
|
---|
[356] | 32 | ** Copyright (C) 2008-2009, **
|
---|
[443] | 33 | ** All rights reserved. **
|
---|
[356] | 34 | ** **
|
---|
| 35 | ***********************************************************************/
|
---|
| 36 |
|
---|
| 37 | #include <string>
|
---|
| 38 | #include "DataConverter.h"
|
---|
| 39 |
|
---|
| 40 | #include "GenParticle.h"
|
---|
| 41 | #include "GenVertex.h"
|
---|
| 42 | #include "GenEvent.h"
|
---|
| 43 | #include "IO_Ascii.h"
|
---|
| 44 |
|
---|
| 45 | using namespace std;
|
---|
| 46 |
|
---|
| 47 | class HepMCConverter : public DataConverter {
|
---|
| 48 | public:
|
---|
[380] | 49 | HepMCConverter(const string& inputFileList, const string& outputFileName, const PdgTable& pdg, const int& Nevents=-1);
|
---|
[356] | 50 | virtual ~HepMCConverter();
|
---|
| 51 |
|
---|
| 52 | // const iterator for incoming particles
|
---|
| 53 | typedef std::vector<HepMC::GenParticle*>::const_iterator particles_in_const_iterator;
|
---|
| 54 |
|
---|
| 55 |
|
---|
| 56 |
|
---|
| 57 | private:
|
---|
| 58 | void AnalyseEvent(ExRootTreeBranch *branch,HepMC::GenEvent& evt,const Long64_t eventNumber);
|
---|
[368] | 59 | void AnalyseParticles(ExRootTreeBranch *branch, const HepMC::GenEvent& evt);
|
---|
[356] | 60 | void getStatsFromTuple(int &mo1, int &mo2, int &da1, int &da2, int &status, int &pid, int j) const;
|
---|
| 61 | void ReadStats();
|
---|
| 62 |
|
---|
| 63 | int mo1, mo2, da1, da2, status, pid;
|
---|
| 64 | HepMC::GenEvent *evt;
|
---|
| 65 |
|
---|
| 66 | int rdstate() const;
|
---|
| 67 | //maps to convert HepMC::GenParticle to particles # and vice versa
|
---|
| 68 | // -> needed for HepEvt like output
|
---|
| 69 | std::vector<HepMC::GenParticle*> index_to_particle;
|
---|
| 70 | std::map<HepMC::GenParticle*,int> particle_to_index;
|
---|
| 71 | // find index to HepMC::GenParticle* p in map m
|
---|
| 72 | int find_in_map(const std::map<HepMC::GenParticle*,int>& m,HepMC::GenParticle *p) const;
|
---|
| 73 |
|
---|
| 74 | };
|
---|
| 75 |
|
---|
| 76 | #endif
|
---|