[b443089] | 1 | /*
|
---|
| 2 | * Delphes: a framework for fast simulation of a generic collider experiment
|
---|
| 3 | * Copyright (C) 2012-2014 Universite catholique de Louvain (UCL), Belgium
|
---|
[1fa50c2] | 4 | *
|
---|
[b443089] | 5 | * This program is free software: you can redistribute it and/or modify
|
---|
| 6 | * it under the terms of the GNU General Public License as published by
|
---|
| 7 | * the Free Software Foundation, either version 3 of the License, or
|
---|
| 8 | * (at your option) any later version.
|
---|
[1fa50c2] | 9 | *
|
---|
[b443089] | 10 | * This program is distributed in the hope that it will be useful,
|
---|
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
| 13 | * GNU General Public License for more details.
|
---|
[1fa50c2] | 14 | *
|
---|
[b443089] | 15 | * You should have received a copy of the GNU General Public License
|
---|
| 16 | * along with this program. If not, see <http://www.gnu.org/licenses/>.
|
---|
| 17 | */
|
---|
| 18 |
|
---|
[f8d08bb] | 19 |
|
---|
| 20 | /** \class Clone
|
---|
| 21 | *
|
---|
| 22 | * Clone candidate array
|
---|
| 23 | *
|
---|
| 24 | * \author M. Selvaggi - UCL, Louvain-la-Neuve
|
---|
| 25 | *
|
---|
| 26 | */
|
---|
| 27 |
|
---|
| 28 | #include "modules/Cloner.h"
|
---|
| 29 |
|
---|
| 30 | #include "classes/DelphesClasses.h"
|
---|
| 31 | #include "classes/DelphesFactory.h"
|
---|
| 32 | #include "classes/DelphesFormula.h"
|
---|
| 33 |
|
---|
| 34 | #include "ExRootAnalysis/ExRootResult.h"
|
---|
| 35 | #include "ExRootAnalysis/ExRootFilter.h"
|
---|
| 36 | #include "ExRootAnalysis/ExRootClassifier.h"
|
---|
| 37 |
|
---|
| 38 | #include <algorithm>
|
---|
| 39 | #include <stdexcept>
|
---|
| 40 | #include <iostream>
|
---|
| 41 | #include <sstream>
|
---|
| 42 |
|
---|
| 43 | using namespace std;
|
---|
| 44 |
|
---|
| 45 | //------------------------------------------------------------------------------
|
---|
| 46 |
|
---|
| 47 | Cloner::Cloner() :
|
---|
| 48 | fItInputArray(0)
|
---|
| 49 | {
|
---|
| 50 |
|
---|
| 51 | }
|
---|
| 52 |
|
---|
| 53 | //------------------------------------------------------------------------------
|
---|
| 54 |
|
---|
| 55 | Cloner::~Cloner()
|
---|
| 56 | {
|
---|
| 57 |
|
---|
| 58 | }
|
---|
| 59 |
|
---|
| 60 | //------------------------------------------------------------------------------
|
---|
| 61 |
|
---|
| 62 | void Cloner::Init()
|
---|
| 63 | {
|
---|
| 64 | // import input array(s)
|
---|
| 65 |
|
---|
| 66 | fInputArray = ImportArray(GetString("InputArray", "FastJetFinder/jets"));
|
---|
| 67 | fItInputArray = fInputArray->MakeIterator();
|
---|
| 68 |
|
---|
| 69 | // create output array(s)
|
---|
| 70 |
|
---|
| 71 | fOutputArray = ExportArray(GetString("OutputArray", "jets"));
|
---|
| 72 |
|
---|
| 73 | }
|
---|
| 74 |
|
---|
| 75 | //------------------------------------------------------------------------------
|
---|
| 76 |
|
---|
| 77 | void Cloner::Finish()
|
---|
| 78 | {
|
---|
| 79 | if(fItInputArray) delete fItInputArray;
|
---|
| 80 | }
|
---|
| 81 |
|
---|
| 82 | //------------------------------------------------------------------------------
|
---|
| 83 |
|
---|
| 84 | void Cloner::Process()
|
---|
| 85 | {
|
---|
| 86 | Candidate *candidate;
|
---|
| 87 |
|
---|
| 88 | // loop over all input candidates
|
---|
| 89 | fItInputArray->Reset();
|
---|
| 90 | while((candidate = static_cast<Candidate*>(fItInputArray->Next())))
|
---|
| 91 | {
|
---|
| 92 | candidate = static_cast<Candidate*>(candidate->Clone());
|
---|
| 93 | fOutputArray->Add(candidate);
|
---|
| 94 | }
|
---|
| 95 | }
|
---|
| 96 |
|
---|
| 97 | //------------------------------------------------------------------------------
|
---|