Fork me on GitHub

source: git/classes/DelphesClasses.cc@ e9c0d73

ImprovedOutputFile Timing dual_readout llp
Last change on this file since e9c0d73 was e9c0d73, checked in by Ulrike Schnoor <schnooru@…>, 7 years ago

added exclusive_ymerge for n=2,3,4,5

  • Property mode set to 100644
File size: 11.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/**
21 *
22 * Definition of classes to be stored in the root tree.
23 * Function CompareXYZ sorts objects by the variable XYZ that MUST be
24 * present in the data members of the root tree class of the branch.
25 *
26 * \author P. Demin - UCL, Louvain-la-Neuve
27 *
28 */
29
30#include "classes/DelphesClasses.h"
31
32#include "classes/DelphesFactory.h"
33#include "classes/SortableObject.h"
34
35CompBase *GenParticle::fgCompare = 0;
36CompBase *Photon::fgCompare = CompPT<Photon>::Instance();
37CompBase *Electron::fgCompare = CompPT<Electron>::Instance();
38CompBase *Muon::fgCompare = CompPT<Muon>::Instance();
39CompBase *Jet::fgCompare = CompPT<Jet>::Instance();
40CompBase *Track::fgCompare = CompPT<Track>::Instance();
41CompBase *Tower::fgCompare = CompE<Tower>::Instance();
42CompBase *HectorHit::fgCompare = CompE<HectorHit>::Instance();
43CompBase *Vertex::fgCompare = CompSumPT2<Vertex>::Instance();
44CompBase *Candidate::fgCompare = CompMomentumPt<Candidate>::Instance();
45
46//------------------------------------------------------------------------------
47
48TLorentzVector GenParticle::P4() const
49{
50 TLorentzVector vec;
51 vec.SetPxPyPzE(Px, Py, Pz, E);
52 return vec;
53}
54
55//------------------------------------------------------------------------------
56
57TLorentzVector MissingET::P4() const
58{
59 TLorentzVector vec;
60 vec.SetPtEtaPhiM(MET, Eta, Phi, 0.0);
61 return vec;
62}
63
64//------------------------------------------------------------------------------
65
66TLorentzVector Photon::P4() const
67{
68 TLorentzVector vec;
69 vec.SetPtEtaPhiM(PT, Eta, Phi, 0.0);
70 return vec;
71}
72
73//------------------------------------------------------------------------------
74
75TLorentzVector Electron::P4() const
76{
77 TLorentzVector vec;
78 vec.SetPtEtaPhiM(PT, Eta, Phi, 0.0);
79 return vec;
80}
81
82//------------------------------------------------------------------------------
83
84TLorentzVector Muon::P4() const
85{
86 TLorentzVector vec;
87 vec.SetPtEtaPhiM(PT, Eta, Phi, 0.0);
88 return vec;
89}
90
91//------------------------------------------------------------------------------
92
93TLorentzVector Jet::P4() const
94{
95 TLorentzVector vec;
96 vec.SetPtEtaPhiM(PT, Eta, Phi, Mass);
97 return vec;
98}
99
100//------------------------------------------------------------------------------
101
102TLorentzVector Track::P4() const
103{
104 TLorentzVector vec;
105 vec.SetPtEtaPhiM(PT, Eta, Phi, 0.0);
106 return vec;
107}
108
109//------------------------------------------------------------------------------
110
111TLorentzVector Tower::P4() const
112{
113 TLorentzVector vec;
114 vec.SetPtEtaPhiM(ET, Eta, Phi, 0.0);
115 return vec;
116}
117
118//------------------------------------------------------------------------------
119
120Candidate::Candidate() :
121 PID(0), Status(0), M1(-1), M2(-1), D1(-1), D2(-1),
122 Charge(0), Mass(0.0),
123 IsPU(0), IsRecoPU(0), IsConstituent(0), IsFromConversion(0),
124 ClusterIndex(-1), ClusterNDF(0), ClusterSigma(0), SumPT2(0), BTVSumPT2(0), GenDeltaZ(0), GenSumPT2(0),
125 Flavor(0), FlavorAlgo(0), FlavorPhys(0),
126 BTag(0), BTagAlgo(0), BTagPhys(0),
127 TauTag(0), Eem(0.0), Ehad(0.0),
128 DeltaEta(0.0), DeltaPhi(0.0),
129 Momentum(0.0, 0.0, 0.0, 0.0),
130 Position(0.0, 0.0, 0.0, 0.0),
131 PositionError(0.0, 0.0, 0.0, 0.0),
132 InitialPosition(0.0, 0.0, 0.0, 0.0),
133 Area(0.0, 0.0, 0.0, 0.0),
134 L(0),
135 D0(0), ErrorD0(0),
136 DZ(0), ErrorDZ(0),
137 P(0), ErrorP(0),
138 PT(0), ErrorPT(0),
139 CtgTheta(0), ErrorCtgTheta(0),
140 Phi(0), ErrorPhi(0),
141 Xd(0), Yd(0), Zd(0),
142 TrackResolution(0),
143 NCharged(0),
144 NNeutrals(0),
145 Beta(0),
146 BetaStar(0),
147 MeanSqDeltaR(0),
148 PTD(0),
149 NTimeHits(-1),
150 IsolationVar(-999),
151 IsolationVarRhoCorr(-999),
152 SumPtCharged(-999),
153 SumPtNeutral(-999),
154 SumPtChargedPU(-999),
155 SumPt(-999),
156 NSubJetsTrimmed(0),
157 NSubJetsPruned(0),
158 NSubJetsSoftDropped(0),
159 ExclYmerge23(0),
160 ExclYmerge34(0),
161 ExclYmerge45(0),
162 ExclYmerge56(0),
163 fFactory(0),
164 fArray(0)
165{
166 int i;
167 Edges[0] = 0.0;
168 Edges[1] = 0.0;
169 Edges[2] = 0.0;
170 Edges[3] = 0.0;
171 FracPt[0] = 0.0;
172 FracPt[1] = 0.0;
173 FracPt[2] = 0.0;
174 FracPt[3] = 0.0;
175 FracPt[4] = 0.0;
176 Tau[0] = 0.0;
177 Tau[1] = 0.0;
178 Tau[2] = 0.0;
179 Tau[3] = 0.0;
180 Tau[4] = 0.0;
181 for(i = 0; i < 5; ++i)
182 {
183 TrimmedP4[i].SetXYZT(0.0, 0.0, 0.0, 0.0);
184 PrunedP4[i].SetXYZT(0.0, 0.0, 0.0, 0.0);
185 SoftDroppedP4[i].SetXYZT(0.0, 0.0, 0.0, 0.0);
186 }
187}
188
189//------------------------------------------------------------------------------
190
191void Candidate::AddCandidate(Candidate *object)
192{
193 if(!fArray) fArray = fFactory->NewArray();
194 fArray->Add(object);
195}
196
197//------------------------------------------------------------------------------
198
199TObjArray *Candidate::GetCandidates()
200{
201 if(!fArray) fArray = fFactory->NewArray();
202 return fArray;
203}
204
205//------------------------------------------------------------------------------
206
207Bool_t Candidate::Overlaps(const Candidate *object) const
208{
209 const Candidate *candidate;
210
211 if(object->GetUniqueID() == GetUniqueID()) return kTRUE;
212
213 if(fArray)
214 {
215 TIter it(fArray);
216 while((candidate = static_cast<Candidate *>(it.Next())))
217 {
218 if(candidate->Overlaps(object)) return kTRUE;
219 }
220 }
221
222 if(object->fArray)
223 {
224 TIter it(object->fArray);
225 while((candidate = static_cast<Candidate *>(it.Next())))
226 {
227 if(candidate->Overlaps(this)) return kTRUE;
228 }
229 }
230
231 return kFALSE;
232}
233
234
235//------------------------------------------------------------------------------
236
237TObject *Candidate::Clone(const char *newname) const
238{
239 Candidate *object = fFactory->NewCandidate();
240 Copy(*object);
241 return object;
242}
243
244//------------------------------------------------------------------------------
245
246void Candidate::Copy(TObject &obj) const
247{
248 Candidate &object = static_cast<Candidate &>(obj);
249 Candidate *candidate;
250
251 object.PID = PID;
252 object.Status = Status;
253 object.M1 = M1;
254 object.M2 = M2;
255 object.D1 = D1;
256 object.D2 = D2;
257 object.Charge = Charge;
258 object.Mass = Mass;
259 object.IsPU = IsPU;
260 object.IsRecoPU = IsRecoPU;
261 object.IsConstituent = IsConstituent;
262 object.IsFromConversion = IsFromConversion;
263 object.ClusterIndex = ClusterIndex;
264 object.ClusterNDF = ClusterNDF;
265 object.ClusterSigma = ClusterSigma;
266 object.SumPT2 = SumPT2;
267 object.BTVSumPT2 = BTVSumPT2;
268 object.GenDeltaZ = GenDeltaZ;
269 object.GenSumPT2 = GenSumPT2;
270 object.Flavor = Flavor;
271 object.FlavorAlgo = FlavorAlgo;
272 object.FlavorPhys = FlavorPhys;
273 object.BTag = BTag;
274 object.BTagAlgo = BTagAlgo;
275 object.BTagPhys = BTagPhys;
276 object.TauTag = TauTag;
277 object.Eem = Eem;
278 object.Ehad = Ehad;
279 object.Edges[0] = Edges[0];
280 object.Edges[1] = Edges[1];
281 object.Edges[2] = Edges[2];
282 object.Edges[3] = Edges[3];
283 object.DeltaEta = DeltaEta;
284 object.DeltaPhi = DeltaPhi;
285 object.Momentum = Momentum;
286 object.Position = Position;
287 object.InitialPosition = InitialPosition;
288 object.PositionError = PositionError;
289 object.Area = Area;
290 object.L = L;
291 object.ErrorT = ErrorT;
292 object.D0 = D0;
293 object.ErrorD0 = ErrorD0;
294 object.DZ = DZ;
295 object.ErrorDZ = ErrorDZ;
296 object.P = P;
297 object.ErrorP = ErrorP;
298 object.PT = PT;
299 object.ErrorPT = ErrorPT;
300 object.CtgTheta = CtgTheta ;
301 object.ErrorCtgTheta = ErrorCtgTheta;
302 object.Phi = Phi;
303 object.ErrorPhi = ErrorPhi;
304 object.Xd = Xd;
305 object.Yd = Yd;
306 object.Zd = Zd;
307 object.TrackResolution = TrackResolution;
308 object.NCharged = NCharged;
309 object.NNeutrals = NNeutrals;
310 object.Beta = Beta;
311 object.BetaStar = BetaStar;
312 object.MeanSqDeltaR = MeanSqDeltaR;
313 object.PTD = PTD;
314 object.NTimeHits = NTimeHits;
315 object.IsolationVar = IsolationVar;
316 object.IsolationVarRhoCorr = IsolationVarRhoCorr;
317 object.SumPtCharged = SumPtCharged;
318 object.SumPtNeutral = SumPtNeutral;
319 object.SumPtChargedPU = SumPtChargedPU;
320 object.SumPt = SumPt;
321 object.ClusterIndex = ClusterIndex;
322 object.ClusterNDF = ClusterNDF;
323 object.ClusterSigma = ClusterSigma;
324 object.SumPT2 = SumPT2;
325
326 object.FracPt[0] = FracPt[0];
327 object.FracPt[1] = FracPt[1];
328 object.FracPt[2] = FracPt[2];
329 object.FracPt[3] = FracPt[3];
330 object.FracPt[4] = FracPt[4];
331 object.Tau[0] = Tau[0];
332 object.Tau[1] = Tau[1];
333 object.Tau[2] = Tau[2];
334 object.Tau[3] = Tau[3];
335 object.Tau[4] = Tau[4];
336
337 object.TrimmedP4[0] = TrimmedP4[0];
338 object.TrimmedP4[1] = TrimmedP4[1];
339 object.TrimmedP4[2] = TrimmedP4[2];
340 object.TrimmedP4[3] = TrimmedP4[3];
341 object.TrimmedP4[4] = TrimmedP4[4];
342 object.PrunedP4[0] = PrunedP4[0];
343 object.PrunedP4[1] = PrunedP4[1];
344 object.PrunedP4[2] = PrunedP4[2];
345 object.PrunedP4[3] = PrunedP4[3];
346 object.PrunedP4[4] = PrunedP4[4];
347 object.SoftDroppedP4[0] = SoftDroppedP4[0];
348 object.SoftDroppedP4[1] = SoftDroppedP4[1];
349 object.SoftDroppedP4[2] = SoftDroppedP4[2];
350 object.SoftDroppedP4[3] = SoftDroppedP4[3];
351 object.SoftDroppedP4[4] = SoftDroppedP4[4];
352
353 object.NSubJetsTrimmed = NSubJetsTrimmed;
354 object.NSubJetsPruned = NSubJetsPruned;
355 object.NSubJetsSoftDropped = NSubJetsSoftDropped;
356
357 object.fFactory = fFactory;
358 object.fArray = 0;
359
360 // copy cluster timing info
361 copy(ECalEnergyTimePairs.begin(), ECalEnergyTimePairs.end(), back_inserter(object.ECalEnergyTimePairs));
362
363 if(fArray && fArray->GetEntriesFast() > 0)
364 {
365 TIter itArray(fArray);
366 TObjArray *array = object.GetCandidates();
367 while((candidate = static_cast<Candidate *>(itArray.Next())))
368 {
369 array->Add(candidate);
370 }
371 }
372}
373
374//------------------------------------------------------------------------------
375
376void Candidate::Clear(Option_t* option)
377{
378 int i;
379 SetUniqueID(0);
380 ResetBit(kIsReferenced);
381 PID = 0;
382 Status = 0;
383 M1 = -1; M2 = -1; D1 = -1; D2 = -1;
384 Charge = 0;
385 Mass = 0.0;
386 IsPU = 0;
387 IsRecoPU = 0;
388 IsConstituent = 0;
389 IsFromConversion = 0;
390 Flavor = 0;
391 FlavorAlgo = 0;
392 FlavorPhys = 0;
393 BTag = 0;
394 BTagAlgo = 0;
395 BTagPhys = 0;
396 TauTag = 0;
397 Eem = 0.0;
398 Ehad = 0.0;
399 Edges[0] = 0.0;
400 Edges[1] = 0.0;
401 Edges[2] = 0.0;
402 Edges[3] = 0.0;
403 DeltaEta = 0.0;
404 DeltaPhi = 0.0;
405 Momentum.SetXYZT(0.0, 0.0, 0.0, 0.0);
406 Position.SetXYZT(0.0, 0.0, 0.0, 0.0);
407 InitialPosition.SetXYZT(0.0, 0.0, 0.0, 0.0);
408 Area.SetXYZT(0.0, 0.0, 0.0, 0.0);
409 L = 0.0;
410 ErrorT = 0.0;
411 D0 = 0.0;
412 ErrorD0 = 0.0;
413 DZ = 0.0;
414 ErrorDZ = 0.0;
415 P =0.0;
416 ErrorP =0.0;
417 PT = 0.0;
418 ErrorPT = 0.0;
419 CtgTheta = 0.0;
420 ErrorCtgTheta = 0.0;
421 Phi = 0.0;
422 ErrorPhi = 0.0;
423 Xd = 0.0;
424 Yd = 0.0;
425 Zd = 0.0;
426 TrackResolution = 0.0;
427 NCharged = 0;
428 NNeutrals = 0;
429 Beta = 0.0;
430 BetaStar = 0.0;
431 MeanSqDeltaR = 0.0;
432 PTD = 0.0;
433
434 NTimeHits = 0;
435 ECalEnergyTimePairs.clear();
436
437 IsolationVar = -999;
438 IsolationVarRhoCorr = -999;
439 SumPtCharged = -999;
440 SumPtNeutral = -999;
441 SumPtChargedPU = -999;
442 SumPt = -999;
443
444 ClusterIndex = -1;
445 ClusterNDF = -99;
446 ClusterSigma = 0.0;
447 SumPT2 = 0.0;
448 BTVSumPT2 = 0.0;
449 GenDeltaZ = 0.0;
450 GenSumPT2 = 0.0;
451
452 FracPt[0] = 0.0;
453 FracPt[1] = 0.0;
454 FracPt[2] = 0.0;
455 FracPt[3] = 0.0;
456 FracPt[4] = 0.0;
457 Tau[0] = 0.0;
458 Tau[1] = 0.0;
459 Tau[2] = 0.0;
460 Tau[3] = 0.0;
461 Tau[4] = 0.0;
462
463 for(i = 0; i < 5; ++i)
464 {
465 TrimmedP4[i].SetXYZT(0.0, 0.0, 0.0, 0.0);
466 PrunedP4[i].SetXYZT(0.0, 0.0, 0.0, 0.0);
467 SoftDroppedP4[i].SetXYZT(0.0, 0.0, 0.0, 0.0);
468 }
469
470 NSubJetsTrimmed = 0;
471 NSubJetsPruned = 0;
472 NSubJetsSoftDropped = 0;
473
474 fArray = 0;
475}
Note: See TracBrowser for help on using the repository browser.