1 |
loizides |
1.1 |
// $Id: JetIDMod.cc,v 1.6 2008/11/28 13:07:38 ceballos Exp $
|
2 |
|
|
|
3 |
|
|
#include "MitPhysics/Mods/interface/MergeLeptonsMod.h"
|
4 |
|
|
#include "MitPhysics/Init/interface/ModNames.h"
|
5 |
|
|
|
6 |
|
|
using namespace mithep;
|
7 |
|
|
|
8 |
|
|
ClassImp(mithep::MergeLeptonsMod)
|
9 |
|
|
|
10 |
|
|
//--------------------------------------------------------------------------------------------------
|
11 |
|
|
mithep::MergeLeptonsMod::MergeLeptonsMod(const char *name, const char *title) :
|
12 |
|
|
BaseMod(name,title),
|
13 |
|
|
fElName(ModNames::gkCleanElectronsName),
|
14 |
|
|
fMuName(ModNames::gkCleanMuonsName),
|
15 |
|
|
fMergedName(ModNames::gkMergedLeptonsName),
|
16 |
|
|
fElIn(0),
|
17 |
|
|
fMuIn(0),
|
18 |
|
|
fColOut(0)
|
19 |
|
|
{
|
20 |
|
|
// Constructor.
|
21 |
|
|
}
|
22 |
|
|
|
23 |
|
|
//--------------------------------------------------------------------------------------------------
|
24 |
|
|
void mithep::MergeLeptonsMod::Process()
|
25 |
|
|
{
|
26 |
|
|
// Merge the two input collections and publish merged collection.
|
27 |
|
|
|
28 |
|
|
fElIn = GetObjThisEvt<ElectronCol>(fElName);
|
29 |
|
|
fMuIn = GetObjThisEvt<MuonCol>(fElName);
|
30 |
|
|
|
31 |
|
|
UInt_t nents = 0;
|
32 |
|
|
if (fElIn)
|
33 |
|
|
nents += fElIn->GetEntries();
|
34 |
|
|
if (fMuIn)
|
35 |
|
|
nents += fMuIn->GetEntries();
|
36 |
|
|
|
37 |
|
|
fColOut = new mithep::ParticleOArr(nents, GetMergedName());
|
38 |
|
|
|
39 |
|
|
if (fElIn)
|
40 |
|
|
fColOut->Add(fElIn);
|
41 |
|
|
if (fMuIn)
|
42 |
|
|
fColOut->Add(fMuIn);
|
43 |
|
|
|
44 |
|
|
// sort according to pt
|
45 |
|
|
fColOut->Sort();
|
46 |
|
|
|
47 |
|
|
// add to event for other modules to use
|
48 |
|
|
AddObjThisEvt(fColOut);
|
49 |
|
|
}
|