Fork me on GitHub

source: git/modules/Cloner.cc@ fafc433

ImprovedOutputFile Timing dual_readout llp
Last change on this file since fafc433 was 7c0fcd5, checked in by Pavel Demin <demin@…>, 10 years ago

delete duplicate license file and prepend GPLv3 header to all source code files

  • Property mode set to 100644
File size: 2.5 KB
RevLine 
[7c0fcd5]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
[f8d08bb]19
20/** \class Clone
21 *
22 * Clone candidate array
23 *
24 * $Date$
25 * $Revision$
26 *
27 * \author M. Selvaggi - UCL, Louvain-la-Neuve
28 *
29 */
30
31#include "modules/Cloner.h"
32
33#include "classes/DelphesClasses.h"
34#include "classes/DelphesFactory.h"
35#include "classes/DelphesFormula.h"
36
37#include "ExRootAnalysis/ExRootResult.h"
38#include "ExRootAnalysis/ExRootFilter.h"
39#include "ExRootAnalysis/ExRootClassifier.h"
40
41#include <algorithm>
42#include <stdexcept>
43#include <iostream>
44#include <sstream>
45
46using namespace std;
47
48//------------------------------------------------------------------------------
49
50Cloner::Cloner() :
51 fItInputArray(0)
52{
53
54}
55
56//------------------------------------------------------------------------------
57
58Cloner::~Cloner()
59{
60
61}
62
63//------------------------------------------------------------------------------
64
65void Cloner::Init()
66{
67 // import input array(s)
68
69 fInputArray = ImportArray(GetString("InputArray", "FastJetFinder/jets"));
70 fItInputArray = fInputArray->MakeIterator();
71
72 // create output array(s)
73
74 fOutputArray = ExportArray(GetString("OutputArray", "jets"));
75
76}
77
78//------------------------------------------------------------------------------
79
80void Cloner::Finish()
81{
82 if(fItInputArray) delete fItInputArray;
83}
84
85//------------------------------------------------------------------------------
86
87void Cloner::Process()
88{
89 Candidate *candidate;
90
91 // loop over all input candidates
92 fItInputArray->Reset();
93 while((candidate = static_cast<Candidate*>(fItInputArray->Next())))
94 {
95 candidate = static_cast<Candidate*>(candidate->Clone());
96 fOutputArray->Add(candidate);
97 }
98}
99
100//------------------------------------------------------------------------------
Note: See TracBrowser for help on using the repository browser.