Fork me on GitHub

source: git/modules/LeptonDressing.cc@ a190d94

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

fix GPLv3 header

  • Property mode set to 100644
File size: 3.7 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 LeptonDressing
21 *
22 *
23 *
24 *
25 *
26 * \author P. Demin && A. Mertens - UCL, Louvain-la-Neuve
27 *
28 */
29
30#include "modules/LeptonDressing.h"
31
32#include "classes/DelphesClasses.h"
33#include "classes/DelphesFactory.h"
34#include "classes/DelphesFormula.h"
35
36#include "ExRootAnalysis/ExRootResult.h"
37#include "ExRootAnalysis/ExRootFilter.h"
38#include "ExRootAnalysis/ExRootClassifier.h"
39
40#include "TMath.h"
41#include "TString.h"
42#include "TFormula.h"
43#include "TRandom3.h"
44#include "TObjArray.h"
45#include "TDatabasePDG.h"
46#include "TLorentzVector.h"
47
48#include <algorithm>
49#include <stdexcept>
50#include <iostream>
51#include <sstream>
52
53using namespace std;
54
55//------------------------------------------------------------------------------
56
57LeptonDressing::LeptonDressing() :
58 fItDressingInputArray(0), fItCandidateInputArray(0)
59{
60}
61
62//------------------------------------------------------------------------------
63
64LeptonDressing::~LeptonDressing()
65{
66}
67
68//------------------------------------------------------------------------------
69
70void LeptonDressing::Init()
71{
72 fDeltaR = GetDouble("DeltaRMax", 0.4);
73
74 // import input array(s)
75
76 fDressingInputArray = ImportArray(GetString("DressingInputArray", "Calorimeter/photons"));
77 fItDressingInputArray = fDressingInputArray->MakeIterator();
78
79 fCandidateInputArray = ImportArray(GetString("CandidateInputArray", "UniqueObjectFinder/electrons"));
80 fItCandidateInputArray = fCandidateInputArray->MakeIterator();
81
82 // create output array
83
84 fOutputArray = ExportArray(GetString("OutputArray", "electrons"));
85}
86
87//------------------------------------------------------------------------------
88
89void LeptonDressing::Finish()
90{
91 if(fItCandidateInputArray) delete fItCandidateInputArray;
92 if(fItDressingInputArray) delete fItDressingInputArray;
93}
94
95//------------------------------------------------------------------------------
96
97void LeptonDressing::Process()
98{
99 Candidate *candidate, *dressing, *mother;
100 TLorentzVector momentum;
101
102 // loop over all input candidate
103 fItCandidateInputArray->Reset();
104 while((candidate = static_cast<Candidate*>(fItCandidateInputArray->Next())))
105 {
106 const TLorentzVector &candidateMomentum = candidate->Momentum;
107
108 // loop over all input tracks
109 fItDressingInputArray->Reset();
110 momentum.SetPxPyPzE(0.0, 0.0, 0.0, 0.0);
111 while((dressing = static_cast<Candidate*>(fItDressingInputArray->Next())))
112 {
113 const TLorentzVector &dressingMomentum = dressing->Momentum;
114 if (dressingMomentum.Pt() > 0.1)
115 {
116 if(candidateMomentum.DeltaR(dressingMomentum) <= fDeltaR)
117 {
118 momentum += dressingMomentum;
119 }
120 }
121 }
122
123 mother = candidate;
124 candidate = static_cast<Candidate*>(candidate->Clone());
125
126 candidate->Momentum += momentum;
127 candidate->AddCandidate(mother);
128
129 fOutputArray->Add(candidate);
130 }
131}
132
133//------------------------------------------------------------------------------
Note: See TracBrowser for help on using the repository browser.