ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitPhysics/Mods/src/MergeLeptonsMod.cc
Revision: 1.2
Committed: Wed Dec 10 17:28:23 2008 UTC (16 years, 5 months ago) by loizides
Content type: text/plain
Branch: MAIN
CVS Tags: Mit_009a, Mit_009, Mit_008, Mit_008pre2, Mit_008pre1, Mit_006b, Mit_006a
Changes since 1.1: +2 -2 lines
Log Message:
Added naming convention: SetInputName/SetOutputName etc.

File Contents

# User Rev Content
1 loizides 1.2 // $Id: MergeLeptonsMod.cc,v 1.1 2008/12/10 11:44:33 loizides Exp $
2 loizides 1.1
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 loizides 1.2 fMuIn = GetObjThisEvt<MuonCol>(fMuName);
30 loizides 1.1
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     }