1 |
loizides |
1.1 |
// $Id: FillerMCEventInfo.cc,v 1.13 2008/08/18 11:16:13 sixie Exp $
|
2 |
|
|
|
3 |
|
|
#include "MitProd/TreeFiller/interface/FillerMCEventInfo.h"
|
4 |
|
|
#include "FWCore/MessageLogger/interface/MessageLogger.h"
|
5 |
|
|
#include "DataFormats/Common/interface/Handle.h"
|
6 |
|
|
#include "MitAna/DataTree/interface/Names.h"
|
7 |
|
|
#include "MitAna/DataTree/interface/MCEventInfo.h"
|
8 |
|
|
|
9 |
|
|
using namespace std;
|
10 |
|
|
using namespace edm;
|
11 |
|
|
using namespace mithep;
|
12 |
|
|
|
13 |
|
|
//--------------------------------------------------------------------------------------------------
|
14 |
|
|
FillerMCEventInfo::FillerMCEventInfo(const ParameterSet &cfg, bool active) :
|
15 |
|
|
BaseFiller(cfg,"MCEventInfo",active),
|
16 |
|
|
evtName_(Conf().getUntrackedParameter<string>("evtName",Names::gkMCEvtInfoBrn)),
|
17 |
|
|
datasetName_(Conf().getUntrackedParameter<string>("datasetName","")),
|
18 |
|
|
eventInfo_(new MCEventInfo())
|
19 |
|
|
{
|
20 |
|
|
// Constructor.
|
21 |
|
|
}
|
22 |
|
|
|
23 |
|
|
//--------------------------------------------------------------------------------------------------
|
24 |
|
|
FillerMCEventInfo::~FillerMCEventInfo()
|
25 |
|
|
{
|
26 |
|
|
// Destructor.
|
27 |
|
|
|
28 |
|
|
delete eventInfo_;
|
29 |
|
|
}
|
30 |
|
|
|
31 |
|
|
//--------------------------------------------------------------------------------------------------
|
32 |
|
|
void FillerMCEventInfo::BookDataBlock(TreeWriter &tws)
|
33 |
|
|
{
|
34 |
|
|
// Create run info tre and book our branches.
|
35 |
|
|
|
36 |
|
|
// add branches to main tree
|
37 |
|
|
tws.AddBranch(evtName_.c_str(),"mithep::MCEventInfo",&eventInfo_);
|
38 |
|
|
}
|
39 |
|
|
|
40 |
|
|
//--------------------------------------------------------------------------------------------------
|
41 |
|
|
void FillerMCEventInfo::FillDataBlock(const edm::Event &event,
|
42 |
|
|
const edm::EventSetup &setup)
|
43 |
|
|
{
|
44 |
|
|
// Fill our data structures.
|
45 |
|
|
|
46 |
|
|
eventInfo_->SetWeight(1);
|
47 |
|
|
|
48 |
|
|
// can assign different weight based on datasetName_ and event content here
|
49 |
|
|
}
|