Fork me on GitHub

source: git/modules/Cloner.cc@ 1d9974e

ImprovedOutputFile Timing dual_readout llp
Last change on this file since 1d9974e was cab38f6, checked in by Pavel Demin <pavel.demin@…>, 10 years ago

remove svn tags and fix formatting

  • Property mode set to 100644
File size: 2.4 KB
Line 
1/*
2 * Delphes: a framework for fast simulation of a generic collider experiment
3 * Copyright (C) 2012-2014 Universite catholique de Louvain (UCL), Belgium
4 *
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.
9 *
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.
14 *
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
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
43using namespace std;
44
45//------------------------------------------------------------------------------
46
47Cloner::Cloner() :
48 fItInputArray(0)
49{
50
51}
52
53//------------------------------------------------------------------------------
54
55Cloner::~Cloner()
56{
57
58}
59
60//------------------------------------------------------------------------------
61
62void 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
77void Cloner::Finish()
78{
79 if(fItInputArray) delete fItInputArray;
80}
81
82//------------------------------------------------------------------------------
83
84void 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//------------------------------------------------------------------------------
Note: See TracBrowser for help on using the repository browser.