| 1 | 
 | 
|---|
| 2 | #include "modules/MadGraphJetLeptonMerger.h"
 | 
|---|
| 3 | 
 | 
|---|
| 4 | #include "ExRootAnalysis/ExRootClasses.h"
 | 
|---|
| 5 | 
 | 
|---|
| 6 | #include "ExRootAnalysis/ExRootFactory.h"
 | 
|---|
| 7 | #include "ExRootAnalysis/ExRootCandidate.h"
 | 
|---|
| 8 | 
 | 
|---|
| 9 | #include "TString.h"
 | 
|---|
| 10 | 
 | 
|---|
| 11 | #include <iostream>
 | 
|---|
| 12 | 
 | 
|---|
| 13 | using namespace std;
 | 
|---|
| 14 | 
 | 
|---|
| 15 | //------------------------------------------------------------------------------
 | 
|---|
| 16 | 
 | 
|---|
| 17 | MadGraphJetLeptonMerger::MadGraphJetLeptonMerger() :
 | 
|---|
| 18 |   fItInputLeptons(0), fItInputJets(0)
 | 
|---|
| 19 | {
 | 
|---|
| 20 | }
 | 
|---|
| 21 | 
 | 
|---|
| 22 | //------------------------------------------------------------------------------
 | 
|---|
| 23 | 
 | 
|---|
| 24 | MadGraphJetLeptonMerger::~MadGraphJetLeptonMerger()
 | 
|---|
| 25 | {
 | 
|---|
| 26 | }
 | 
|---|
| 27 | 
 | 
|---|
| 28 | //------------------------------------------------------------------------------
 | 
|---|
| 29 | 
 | 
|---|
| 30 | void MadGraphJetLeptonMerger::Init()
 | 
|---|
| 31 | {
 | 
|---|
| 32 |   // import array with output from lepton and jet finders
 | 
|---|
| 33 | 
 | 
|---|
| 34 |   fInputLeptons = ImportArray(GetString("InputLeptonsArray", "leptonfinder/leptons"));
 | 
|---|
| 35 |   fItInputLeptons = fInputLeptons->MakeIterator();
 | 
|---|
| 36 | 
 | 
|---|
| 37 |   fInputJets = ImportArray(GetString("InputJetsArray", "jetfinder/jets"));
 | 
|---|
| 38 |   fItInputJets = fInputJets->MakeIterator();
 | 
|---|
| 39 | 
 | 
|---|
| 40 |   fJetNumberMax = GetInt("JetNumberMax", 4);
 | 
|---|
| 41 | 
 | 
|---|
| 42 |   // create output arrays
 | 
|---|
| 43 | 
 | 
|---|
| 44 |   fOutputArray = ExportArray("candidates");
 | 
|---|
| 45 | 
 | 
|---|
| 46 | }
 | 
|---|
| 47 | 
 | 
|---|
| 48 | //------------------------------------------------------------------------------
 | 
|---|
| 49 | 
 | 
|---|
| 50 | void MadGraphJetLeptonMerger::Finish()
 | 
|---|
| 51 | {
 | 
|---|
| 52 |   if(fItInputLeptons) delete fItInputLeptons;
 | 
|---|
| 53 |   if(fItInputJets) delete fItInputJets;
 | 
|---|
| 54 | }
 | 
|---|
| 55 | 
 | 
|---|
| 56 | //------------------------------------------------------------------------------
 | 
|---|
| 57 | 
 | 
|---|
| 58 | void MadGraphJetLeptonMerger::Process()
 | 
|---|
| 59 | {
 | 
|---|
| 60 |   TObject *object = 0;
 | 
|---|
| 61 |   Int_t entry;
 | 
|---|
| 62 | 
 | 
|---|
| 63 |   fItInputLeptons->Reset();
 | 
|---|
| 64 |   while((object = fItInputLeptons->Next()))
 | 
|---|
| 65 |   {
 | 
|---|
| 66 |     fOutputArray->Add(object);
 | 
|---|
| 67 |   }
 | 
|---|
| 68 | 
 | 
|---|
| 69 |   entry = 0;
 | 
|---|
| 70 |   fItInputJets->Reset();
 | 
|---|
| 71 |   while((object = fItInputJets->Next()) && entry < fJetNumberMax)
 | 
|---|
| 72 |   {
 | 
|---|
| 73 |     fOutputArray->Add(object);
 | 
|---|
| 74 |     ++entry;
 | 
|---|
| 75 |   }
 | 
|---|
| 76 | }
 | 
|---|
| 77 | 
 | 
|---|
| 78 | //------------------------------------------------------------------------------
 | 
|---|