Fork me on GitHub

source: svn/trunk/modules/Cloner.cc@ 1184

Last change on this file since 1184 was 1100, checked in by Pavel Demin, 12 years ago

add Cloner

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id Revision Date
File size: 1.7 KB
Line 
1
2/** \class Clone
3 *
4 * Clone candidate array
5 *
6 * $Date: 2013-04-26 10:42:11 +0000 (Fri, 26 Apr 2013) $
7 * $Revision: 1100 $
8 *
9 * \author M. Selvaggi - UCL, Louvain-la-Neuve
10 *
11 */
12
13#include "modules/Cloner.h"
14
15#include "classes/DelphesClasses.h"
16#include "classes/DelphesFactory.h"
17#include "classes/DelphesFormula.h"
18
19#include "ExRootAnalysis/ExRootResult.h"
20#include "ExRootAnalysis/ExRootFilter.h"
21#include "ExRootAnalysis/ExRootClassifier.h"
22
23#include <algorithm>
24#include <stdexcept>
25#include <iostream>
26#include <sstream>
27
28using namespace std;
29
30//------------------------------------------------------------------------------
31
32Cloner::Cloner() :
33 fItInputArray(0)
34{
35
36}
37
38//------------------------------------------------------------------------------
39
40Cloner::~Cloner()
41{
42
43}
44
45//------------------------------------------------------------------------------
46
47void Cloner::Init()
48{
49 // import input array(s)
50
51 fInputArray = ImportArray(GetString("InputArray", "FastJetFinder/jets"));
52 fItInputArray = fInputArray->MakeIterator();
53
54 // create output array(s)
55
56 fOutputArray = ExportArray(GetString("OutputArray", "jets"));
57
58}
59
60//------------------------------------------------------------------------------
61
62void Cloner::Finish()
63{
64 if(fItInputArray) delete fItInputArray;
65}
66
67//------------------------------------------------------------------------------
68
69void Cloner::Process()
70{
71 Candidate *candidate;
72
73 // loop over all input candidates
74 fItInputArray->Reset();
75 while((candidate = static_cast<Candidate*>(fItInputArray->Next())))
76 {
77 candidate = static_cast<Candidate*>(candidate->Clone());
78 fOutputArray->Add(candidate);
79 }
80}
81
82//------------------------------------------------------------------------------
Note: See TracBrowser for help on using the repository browser.