Newer
Older
#ifndef FWCORE_CONVERTOR_H
#define FWCORE_CONVERTOR_H
// LCIO
#include <map>
#include <iostream>
#include <string>
#include "lcio.h"
// #include "IO/LCReader.h"
// #include "EVENT/LCCollection.h"
#include "EVENT/SimTrackerHit.h"
#include "plcio/SimTrackerHit.h"
#include "plcio/SimTrackerHitCollection.h"
#include "plcio/SimCalorimeterHit.h"
#include "plcio/SimCalorimeterHitCollection.h"
#include "plcio/MCParticle.h"
#include "plcio/MCParticleCollection.h"
#include "plcio/VertexCollection.h"
#include "EVENT/TPCHit.h"
#include "plcio/TPCHit.h"
#include "plcio/TPCHitCollection.h"
#include "EVENT/Cluster.h"
#include "plcio/Cluster.h"
#include "plcio/ClusterCollection.h"
#include "EVENT/ParticleID.h"
#include "EVENT/CalorimeterHit.h"
#include "plcio/CalorimeterHit.h"
#include "podio/CollectionIDTable.h"
#include "EVENT/Track.h"
#include "EVENT/TrackerHit.h"
#include "EVENT/TrackState.h"
#include "plcio/Track.h"
Cao Guangjie
committed
#include "plcio/TrackerHit.h"
#include "plcio/TrackCollection.h"
Cao Guangjie
committed
#include "plcio/TrackerHitCollection.h"
#include "EVENT/ReconstructedParticle.h"
#include "plcio/ReconstructedParticle.h"
#include "plcio/ReconstructedParticleCollection.h"
Cao Guangjie
committed
#include "plcio/ParticleID.h"
#include "plcio/ParticleIDCollection.h"
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#include <utility>
// Forward declarations
/** @class LCIO2Plcio LCIO2Plcio.h
*
* An LCIO2Plcio for Converting from LCCollection to plcio collection;
*
* @author jhZou, gjCao
*/
// typedef plcio::MCParticleCollection* (*fptr) (EVENT::LCCollection*);
typedef podio::CollectionBase* (*fptr) (EVENT::LCCollection*);
typedef std::vector<std::pair<EVENT::LCCollection*, podio::CollectionBase*>> CollectionsVec;
typedef std::map<std::string, CollectionsVec> CollectionsMap;
class LCIO2Plcio{
public:
/// Standard Constructor
LCIO2Plcio();
LCIO2Plcio(EVENT::LCCollection*);
/// Standard Destructor
virtual ~LCIO2Plcio(){}
void test(){ printf("MYTESTFUC\n"); }
void clear(){ map_cols.clear(); };
// plcio::MCParticleCollection* Convertor_getPlcio(EVENT::LCCollection*);
podio::CollectionBase* Convertor_getPlcio(EVENT::LCCollection*);
static podio::CollectionBase* Convertor_MCParticle(EVENT::LCCollection*);
static podio::CollectionBase* Convertor_LCRunHeader(EVENT::LCCollection*);
static podio::CollectionBase* Convertor_SimTrackerHit(EVENT::LCCollection*);
static podio::CollectionBase* Convertor_SimCalorimeterHit(EVENT::LCCollection*);
static podio::CollectionBase* Convertor_Cluster(EVENT::LCCollection*);
static podio::CollectionBase* Convertor_Track(EVENT::LCCollection*);
Cao Guangjie
committed
static podio::CollectionBase* Convertor_TrackerHit(EVENT::LCCollection*);
static podio::CollectionBase* Convertor_TPCHit(EVENT::LCCollection*);
static podio::CollectionBase* Convertor_ReconstructedParticle(EVENT::LCCollection*);
Cao Guangjie
committed
static podio::CollectionBase* Convertor_ParticleID(EVENT::LCCollection*);
static podio::CollectionBase* Convertor_LCRelation(EVENT::LCCollection*);
static podio::CollectionBase* Convertor_Vertex(EVENT::LCCollection*);
static void setMCParticle(EVENT::MCParticle*, plcio::MCParticle&);
void setCollName(const std::string &collName){ CollName = collName; };
bool isReady(const std::string&);
private:
std::string TypeName;
static std::string CollName;
// maintain a log vec about data read;
std::vector<std::string> vec_Types;
// maintain a map from keyword to function pointer.
std::map<std::string, fptr> map_cvt;
static CollectionsMap map_cols;
// plcio::MCParticleCollection* hitcol_pl;
// EVENT::LCCollection* hitcol_lc;
};
#endif // CORE_CONVERTOR_H