ImprovedOutputFile
Timing
dual_readout
llp
Last change
on this file since 12b11f9 was f8d08bb, checked in by pavel <pavel@…>, 12 years ago |
add Cloner
|
-
Property mode
set to
100644
|
File size:
1.7 KB
|
Line | |
---|
1 |
|
---|
2 | /** \class Clone
|
---|
3 | *
|
---|
4 | * Clone candidate array
|
---|
5 | *
|
---|
6 | * $Date$
|
---|
7 | * $Revision$
|
---|
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 |
|
---|
28 | using namespace std;
|
---|
29 |
|
---|
30 | //------------------------------------------------------------------------------
|
---|
31 |
|
---|
32 | Cloner::Cloner() :
|
---|
33 | fItInputArray(0)
|
---|
34 | {
|
---|
35 |
|
---|
36 | }
|
---|
37 |
|
---|
38 | //------------------------------------------------------------------------------
|
---|
39 |
|
---|
40 | Cloner::~Cloner()
|
---|
41 | {
|
---|
42 |
|
---|
43 | }
|
---|
44 |
|
---|
45 | //------------------------------------------------------------------------------
|
---|
46 |
|
---|
47 | void 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 |
|
---|
62 | void Cloner::Finish()
|
---|
63 | {
|
---|
64 | if(fItInputArray) delete fItInputArray;
|
---|
65 | }
|
---|
66 |
|
---|
67 | //------------------------------------------------------------------------------
|
---|
68 |
|
---|
69 | void 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.