17 |
|
#ifndef MITPROD_OBJECTSERVICE_OBJECTSERVICE_H |
18 |
|
#define MITPROD_OBJECTSERVICE_OBJECTSERVICE_H |
19 |
|
|
20 |
+ |
#include <string> |
21 |
|
#include "DataFormats/Provenance/interface/EventID.h" |
22 |
|
#include "DataFormats/Provenance/interface/Timestamp.h" |
23 |
|
#include "FWCore/Framework/interface/Event.h" |
36 |
|
|
37 |
|
namespace mithep |
38 |
|
{ |
39 |
+ |
using std::string; |
40 |
+ |
|
41 |
|
class ObjectService { |
42 |
|
public: |
43 |
|
ObjectService(const edm::ParameterSet &cfg, edm::ActivityRegistry &ar); |
44 |
|
~ObjectService(); |
45 |
|
|
46 |
< |
template<class T> bool add(const T *obj, const char *name); |
47 |
< |
template<class T> bool addObjEvt(T *obj, const char *name); |
48 |
< |
template<class T> const T *get(const char *name) const; |
49 |
< |
template<class T> const T *getObjEvt(const char *name) const; |
50 |
< |
template<class T> T *mod(const char *name) const; |
51 |
< |
template<class T> T *modObjEvt(const char *name) const; |
46 |
> |
template<class T> bool add(const T *obj, const char *name); |
47 |
> |
template<class T> bool addObjEvt(T *obj, const char *name); |
48 |
> |
template<class T> const T *get(const char *name) const; |
49 |
> |
template<class T> const T *getObjEvt(const char *name) const; |
50 |
> |
template<class T> T *mod(const char *name) const; |
51 |
> |
template<class T> T *modObjEvt(const char *name) const; |
52 |
> |
|
53 |
> |
template<class T> bool add(const T *obj, const string &name) |
54 |
> |
{ return add<T>(obj,name.c_str()); } |
55 |
> |
template<class T> bool addObjEvt(T *obj, const string &name) |
56 |
> |
{ return addObjEvt<T>(obj,name.c_str()); } |
57 |
> |
template<class T> const T *get(const string &name) const |
58 |
> |
{ return get<T>(name.c_str()); } |
59 |
> |
template<class T> const T *getObjEvt(const string &name) const |
60 |
> |
{ return getObjEvt<T>(name.c_str()); } |
61 |
> |
template<class T> T *mod(const string &name) const |
62 |
> |
{ return mod<T>(name.c_str()); } |
63 |
> |
template<class T> T *modObjEvt(const string &name) const |
64 |
> |
{ return modObjEvt<T>(name.c_str()); } |
65 |
|
|
66 |
|
private: |
67 |
< |
void preEventProcessing(const edm::EventID &id, const edm::Timestamp &t); |
68 |
< |
void postEventProcessing(const edm::Event &e, const edm::EventSetup &es); |
69 |
< |
void postBeginJob(); |
70 |
< |
void postEndJob(); |
67 |
> |
void preEventProcessing(const edm::EventID &id, const edm::Timestamp &t); |
68 |
> |
void postEventProcessing(const edm::Event &e, const edm::EventSetup &es); |
69 |
> |
void postBeginJob(); |
70 |
> |
void postEndJob(); |
71 |
|
|
72 |
|
THashTable obs_; //hash table holding the objects |
73 |
|
THashTable obsEvt_; //hash table holding the objects per event |