Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
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
#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/MCParticle.h"
#include "EVENT/SimTrackerHit.h"
#include "EVENT/SimCalorimeterHit.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 <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 void void_Core_MCParticle(EVENT::MCParticle*, plcio::MCParticle&);
static plcio::MCParticleCollection* Core_MCParticle(EVENT::LCCollection*);
bool isReady(const std::string&);
void setPlcioMCParticleCollection(plcio::MCParticleCollection*);
void setLCIOMCParticleCollection(EVENT::LCCollection*);
private:
std::string TypeName;
// 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