1 |
loizides |
1.2 |
// $Id: ObjectService.cc,v 1.1 2008/07/30 09:04:40 loizides Exp $
|
2 |
loizides |
1.1 |
|
3 |
|
|
#include "MitProd/ObjectService/interface/ObjectService.h"
|
4 |
|
|
#include "DataFormats/Provenance/interface/ModuleDescription.h"
|
5 |
|
|
#include "FWCore/ParameterSet/interface/ParameterSet.h"
|
6 |
|
|
#include "FWCore/ServiceRegistry/interface/ActivityRegistry.h"
|
7 |
|
|
#include "FWCore/ServiceRegistry/interface/Service.h"
|
8 |
|
|
#include "FWCore/MessageLogger/interface/JobReport.h"
|
9 |
loizides |
1.2 |
#include "MitProd/ObjectService/interface/NamedObject.h"
|
10 |
loizides |
1.1 |
|
11 |
|
|
using namespace edm;
|
12 |
|
|
using namespace std;
|
13 |
|
|
using namespace mithep;
|
14 |
|
|
|
15 |
|
|
//--------------------------------------------------------------------------------------------------
|
16 |
|
|
ObjectService::ObjectService(const ParameterSet &cfg, ActivityRegistry &ar) :
|
17 |
loizides |
1.2 |
obs_(0),
|
18 |
|
|
obsEvt_(0)
|
19 |
loizides |
1.1 |
{
|
20 |
|
|
// Constructor.
|
21 |
|
|
|
22 |
loizides |
1.2 |
obs_.SetOwner(kTRUE);
|
23 |
|
|
obsEvt_.SetOwner(kTRUE);
|
24 |
loizides |
1.1 |
|
25 |
|
|
// set watchers
|
26 |
|
|
ar.watchPreProcessEvent (this,&ObjectService::preEventProcessing);
|
27 |
|
|
ar.watchPostProcessEvent(this,&ObjectService::postEventProcessing);
|
28 |
|
|
ar.watchPostBeginJob (this,&ObjectService::postBeginJob);
|
29 |
|
|
ar.watchPostEndJob (this,&ObjectService::postEndJob);
|
30 |
|
|
}
|
31 |
|
|
|
32 |
|
|
//--------------------------------------------------------------------------------------------------
|
33 |
|
|
ObjectService::~ObjectService()
|
34 |
|
|
{
|
35 |
|
|
// Destructor.
|
36 |
|
|
}
|
37 |
|
|
|
38 |
|
|
//--------------------------------------------------------------------------------------------------
|
39 |
|
|
void ObjectService::postBeginJob()
|
40 |
|
|
{
|
41 |
|
|
// Nothing to be done for now
|
42 |
|
|
}
|
43 |
|
|
|
44 |
|
|
//--------------------------------------------------------------------------------------------------
|
45 |
|
|
void ObjectService::postEndJob()
|
46 |
|
|
{
|
47 |
loizides |
1.2 |
// Clear all objects in the hashtables.
|
48 |
loizides |
1.1 |
|
49 |
loizides |
1.2 |
obs_.Delete();
|
50 |
|
|
obsEvt_.Delete();
|
51 |
loizides |
1.1 |
}
|
52 |
|
|
|
53 |
|
|
//--------------------------------------------------------------------------------------------------
|
54 |
|
|
void ObjectService::postEventProcessing(const Event&, const EventSetup&)
|
55 |
|
|
{
|
56 |
loizides |
1.2 |
// Remove objects put per event.
|
57 |
loizides |
1.1 |
|
58 |
loizides |
1.2 |
obsEvt_.Clear();
|
59 |
loizides |
1.1 |
}
|
60 |
|
|
|
61 |
|
|
//--------------------------------------------------------------------------------------------------
|
62 |
|
|
void ObjectService::preEventProcessing(const EventID&, const Timestamp&)
|
63 |
|
|
{
|
64 |
|
|
}
|