Fork me on GitHub

source: git/classes/DelphesClasses.cc@ 4689481

ImprovedOutputFile Timing dual_readout llp
Last change on this file since 4689481 was f25215c, checked in by GitHub <noreply@…>, 6 years ago

Merge pull request #51 from mflechl/master

Adding TauWeight variable

  • Property mode set to 100644
File size: 12.2 KB
RevLine 
[b443089]1/*
2 * Delphes: a framework for fast simulation of a generic collider experiment
3 * Copyright (C) 2012-2014 Universite catholique de Louvain (UCL), Belgium
[1fa50c2]4 *
[b443089]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.
[1fa50c2]9 *
[b443089]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.
[1fa50c2]14 *
[b443089]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
[d7d2da3]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();
[8f7db23]42CompBase *HectorHit::fgCompare = CompE<HectorHit>::Instance();
[3c46e17]43CompBase *Vertex::fgCompare = CompSumPT2<Vertex>::Instance();
[d7d2da3]44CompBase *Candidate::fgCompare = CompMomentumPt<Candidate>::Instance();
45
46//------------------------------------------------------------------------------
47
[2b3ef28]48TLorentzVector GenParticle::P4() const
[d7d2da3]49{
50 TLorentzVector vec;
51 vec.SetPxPyPzE(Px, Py, Pz, E);
52 return vec;
53}
54
55//------------------------------------------------------------------------------
56
[2b3ef28]57TLorentzVector MissingET::P4() const
[4ad7b96]58{
59 TLorentzVector vec;
60 vec.SetPtEtaPhiM(MET, Eta, Phi, 0.0);
61 return vec;
62}
63
64//------------------------------------------------------------------------------
65
[2b3ef28]66TLorentzVector Photon::P4() const
[d7d2da3]67{
68 TLorentzVector vec;
69 vec.SetPtEtaPhiM(PT, Eta, Phi, 0.0);
70 return vec;
71}
72
73//------------------------------------------------------------------------------
74
[2b3ef28]75TLorentzVector Electron::P4() const
[d7d2da3]76{
77 TLorentzVector vec;
78 vec.SetPtEtaPhiM(PT, Eta, Phi, 0.0);
79 return vec;
80}
81
82//------------------------------------------------------------------------------
83
[2b3ef28]84TLorentzVector Muon::P4() const
[d7d2da3]85{
86 TLorentzVector vec;
87 vec.SetPtEtaPhiM(PT, Eta, Phi, 0.0);
88 return vec;
89}
90
91//------------------------------------------------------------------------------
92
[2b3ef28]93TLorentzVector Jet::P4() const
[d7d2da3]94{
95 TLorentzVector vec;
96 vec.SetPtEtaPhiM(PT, Eta, Phi, Mass);
97 return vec;
98}
99
100//------------------------------------------------------------------------------
101
[2b3ef28]102TLorentzVector Track::P4() const
[d7d2da3]103{
104 TLorentzVector vec;
105 vec.SetPtEtaPhiM(PT, Eta, Phi, 0.0);
106 return vec;
107}
108
109//------------------------------------------------------------------------------
110
[2b3ef28]111TLorentzVector Tower::P4() const
[d7d2da3]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),
[5d2481f]123 IsPU(0), IsRecoPU(0), IsConstituent(0), IsFromConversion(0),
[2118a6a]124 ClusterIndex(-1), ClusterNDF(0), ClusterSigma(0), SumPT2(0), BTVSumPT2(0), GenDeltaZ(0), GenSumPT2(0),
[fe0273c]125 Flavor(0), FlavorAlgo(0), FlavorPhys(0),
126 BTag(0), BTagAlgo(0), BTagPhys(0),
[7429c6a]127 TauTag(0), TauWeight(0.0), Eem(0.0), Ehad(0.0),
[d7d2da3]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),
[2118a6a]131 PositionError(0.0, 0.0, 0.0, 0.0),
132 InitialPosition(0.0, 0.0, 0.0, 0.0),
[d7d2da3]133 Area(0.0, 0.0, 0.0, 0.0),
[80306e6]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),
[a98c7ef]142 TrackResolution(0),
[24d005f]143 NCharged(0),
144 NNeutrals(0),
145 Beta(0),
146 BetaStar(0),
147 MeanSqDeltaR(0),
[da00c35]148 PTD(0),
[839deb7]149 NTimeHits(-1),
[b62c2da]150 IsolationVar(-999),
151 IsolationVarRhoCorr(-999),
152 SumPtCharged(-999),
153 SumPtNeutral(-999),
154 SumPtChargedPU(-999),
155 SumPt(-999),
[839deb7]156 NSubJetsTrimmed(0),
157 NSubJetsPruned(0),
158 NSubJetsSoftDropped(0),
[e9c0d73]159 ExclYmerge23(0),
160 ExclYmerge34(0),
161 ExclYmerge45(0),
162 ExclYmerge56(0),
[da00c35]163 fFactory(0),
164 fArray(0)
[d7d2da3]165{
[8d200a6]166 int i;
[d7d2da3]167 Edges[0] = 0.0;
168 Edges[1] = 0.0;
169 Edges[2] = 0.0;
170 Edges[3] = 0.0;
[24d005f]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;
[63178fb]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;
[ba75867]181
182 SoftDroppedJet.SetXYZT(0.0, 0.0, 0.0, 0.0);
183 SoftDroppedSubJet1.SetXYZT(0.0, 0.0, 0.0, 0.0);
184 SoftDroppedSubJet2.SetXYZT(0.0, 0.0, 0.0, 0.0);
185
[8d200a6]186 for(i = 0; i < 5; ++i)
187 {
188 TrimmedP4[i].SetXYZT(0.0, 0.0, 0.0, 0.0);
189 PrunedP4[i].SetXYZT(0.0, 0.0, 0.0, 0.0);
190 SoftDroppedP4[i].SetXYZT(0.0, 0.0, 0.0, 0.0);
191 }
[d7d2da3]192}
193
194//------------------------------------------------------------------------------
195
196void Candidate::AddCandidate(Candidate *object)
197{
198 if(!fArray) fArray = fFactory->NewArray();
199 fArray->Add(object);
200}
201
202//------------------------------------------------------------------------------
203
204TObjArray *Candidate::GetCandidates()
205{
206 if(!fArray) fArray = fFactory->NewArray();
207 return fArray;
208}
209
210//------------------------------------------------------------------------------
211
212Bool_t Candidate::Overlaps(const Candidate *object) const
213{
214 const Candidate *candidate;
215
216 if(object->GetUniqueID() == GetUniqueID()) return kTRUE;
217
218 if(fArray)
219 {
220 TIter it(fArray);
221 while((candidate = static_cast<Candidate *>(it.Next())))
222 {
223 if(candidate->Overlaps(object)) return kTRUE;
224 }
225 }
226
227 if(object->fArray)
228 {
229 TIter it(object->fArray);
230 while((candidate = static_cast<Candidate *>(it.Next())))
231 {
232 if(candidate->Overlaps(this)) return kTRUE;
233 }
234 }
235
236 return kFALSE;
237}
238
239
240//------------------------------------------------------------------------------
241
242TObject *Candidate::Clone(const char *newname) const
243{
244 Candidate *object = fFactory->NewCandidate();
245 Copy(*object);
246 return object;
247}
248
249//------------------------------------------------------------------------------
250
251void Candidate::Copy(TObject &obj) const
252{
253 Candidate &object = static_cast<Candidate &>(obj);
254 Candidate *candidate;
255
256 object.PID = PID;
257 object.Status = Status;
258 object.M1 = M1;
259 object.M2 = M2;
260 object.D1 = D1;
261 object.D2 = D2;
262 object.Charge = Charge;
263 object.Mass = Mass;
264 object.IsPU = IsPU;
[84733ae]265 object.IsRecoPU = IsRecoPU;
[d7d2da3]266 object.IsConstituent = IsConstituent;
[5d2481f]267 object.IsFromConversion = IsFromConversion;
[2118a6a]268 object.ClusterIndex = ClusterIndex;
269 object.ClusterNDF = ClusterNDF;
270 object.ClusterSigma = ClusterSigma;
271 object.SumPT2 = SumPT2;
272 object.BTVSumPT2 = BTVSumPT2;
273 object.GenDeltaZ = GenDeltaZ;
274 object.GenSumPT2 = GenSumPT2;
[fe0273c]275 object.Flavor = Flavor;
276 object.FlavorAlgo = FlavorAlgo;
277 object.FlavorPhys = FlavorPhys;
[d7d2da3]278 object.BTag = BTag;
[edf10ba]279 object.BTagAlgo = BTagAlgo;
[fe0273c]280 object.BTagPhys = BTagPhys;
[d7d2da3]281 object.TauTag = TauTag;
[7429c6a]282 object.TauWeight = TauWeight;
[d7d2da3]283 object.Eem = Eem;
284 object.Ehad = Ehad;
285 object.Edges[0] = Edges[0];
286 object.Edges[1] = Edges[1];
287 object.Edges[2] = Edges[2];
288 object.Edges[3] = Edges[3];
289 object.DeltaEta = DeltaEta;
290 object.DeltaPhi = DeltaPhi;
291 object.Momentum = Momentum;
292 object.Position = Position;
[2118a6a]293 object.InitialPosition = InitialPosition;
294 object.PositionError = PositionError;
[43c646a]295 object.Area = Area;
[80306e6]296 object.L = L;
[28c722a]297 object.ErrorT = ErrorT;
[80306e6]298 object.D0 = D0;
299 object.ErrorD0 = ErrorD0;
300 object.DZ = DZ;
301 object.ErrorDZ = ErrorDZ;
302 object.P = P;
303 object.ErrorP = ErrorP;
304 object.PT = PT;
305 object.ErrorPT = ErrorPT;
306 object.CtgTheta = CtgTheta ;
307 object.ErrorCtgTheta = ErrorCtgTheta;
308 object.Phi = Phi;
309 object.ErrorPhi = ErrorPhi;
[a0431dc]310 object.Xd = Xd;
311 object.Yd = Yd;
312 object.Zd = Zd;
[a98c7ef]313 object.TrackResolution = TrackResolution;
[24d005f]314 object.NCharged = NCharged;
315 object.NNeutrals = NNeutrals;
316 object.Beta = Beta;
317 object.BetaStar = BetaStar;
318 object.MeanSqDeltaR = MeanSqDeltaR;
319 object.PTD = PTD;
[839deb7]320 object.NTimeHits = NTimeHits;
[b62c2da]321 object.IsolationVar = IsolationVar;
322 object.IsolationVarRhoCorr = IsolationVarRhoCorr;
323 object.SumPtCharged = SumPtCharged;
324 object.SumPtNeutral = SumPtNeutral;
325 object.SumPtChargedPU = SumPtChargedPU;
326 object.SumPt = SumPt;
[ab3bdd9]327 object.ClusterIndex = ClusterIndex;
328 object.ClusterNDF = ClusterNDF;
329 object.ClusterSigma = ClusterSigma;
330 object.SumPT2 = SumPT2;
331
[24d005f]332 object.FracPt[0] = FracPt[0];
333 object.FracPt[1] = FracPt[1];
334 object.FracPt[2] = FracPt[2];
335 object.FracPt[3] = FracPt[3];
336 object.FracPt[4] = FracPt[4];
[63178fb]337 object.Tau[0] = Tau[0];
338 object.Tau[1] = Tau[1];
339 object.Tau[2] = Tau[2];
340 object.Tau[3] = Tau[3];
341 object.Tau[4] = Tau[4];
[839deb7]342
[de6d698]343 object.TrimmedP4[0] = TrimmedP4[0];
344 object.TrimmedP4[1] = TrimmedP4[1];
345 object.TrimmedP4[2] = TrimmedP4[2];
346 object.TrimmedP4[3] = TrimmedP4[3];
347 object.TrimmedP4[4] = TrimmedP4[4];
348 object.PrunedP4[0] = PrunedP4[0];
349 object.PrunedP4[1] = PrunedP4[1];
350 object.PrunedP4[2] = PrunedP4[2];
351 object.PrunedP4[3] = PrunedP4[3];
352 object.PrunedP4[4] = PrunedP4[4];
353 object.SoftDroppedP4[0] = SoftDroppedP4[0];
354 object.SoftDroppedP4[1] = SoftDroppedP4[1];
355 object.SoftDroppedP4[2] = SoftDroppedP4[2];
356 object.SoftDroppedP4[3] = SoftDroppedP4[3];
357 object.SoftDroppedP4[4] = SoftDroppedP4[4];
358
[edf10ba]359 object.NSubJetsTrimmed = NSubJetsTrimmed;
360 object.NSubJetsPruned = NSubJetsPruned;
[de6d698]361 object.NSubJetsSoftDropped = NSubJetsSoftDropped;
[e4c3fef]362
[ba75867]363 object.SoftDroppedJet =SoftDroppedJet;
364 object.SoftDroppedSubJet1 = SoftDroppedSubJet1;
365 object.SoftDroppedSubJet2 = SoftDroppedSubJet2;
366
[d7d2da3]367 object.fFactory = fFactory;
368 object.fArray = 0;
369
[839deb7]370 // copy cluster timing info
371 copy(ECalEnergyTimePairs.begin(), ECalEnergyTimePairs.end(), back_inserter(object.ECalEnergyTimePairs));
[3db5282]372
[d7d2da3]373 if(fArray && fArray->GetEntriesFast() > 0)
374 {
375 TIter itArray(fArray);
376 TObjArray *array = object.GetCandidates();
377 while((candidate = static_cast<Candidate *>(itArray.Next())))
378 {
379 array->Add(candidate);
380 }
381 }
382}
383
384//------------------------------------------------------------------------------
385
386void Candidate::Clear(Option_t* option)
387{
[8d200a6]388 int i;
[d7d2da3]389 SetUniqueID(0);
390 ResetBit(kIsReferenced);
391 PID = 0;
392 Status = 0;
393 M1 = -1; M2 = -1; D1 = -1; D2 = -1;
394 Charge = 0;
395 Mass = 0.0;
396 IsPU = 0;
[d759c46]397 IsRecoPU = 0;
[d7d2da3]398 IsConstituent = 0;
[5d2481f]399 IsFromConversion = 0;
[fe0273c]400 Flavor = 0;
401 FlavorAlgo = 0;
402 FlavorPhys = 0;
[d7d2da3]403 BTag = 0;
[edf10ba]404 BTagAlgo = 0;
[fe0273c]405 BTagPhys = 0;
[d7d2da3]406 TauTag = 0;
[7429c6a]407 TauWeight = 0.0;
[d7d2da3]408 Eem = 0.0;
409 Ehad = 0.0;
410 Edges[0] = 0.0;
411 Edges[1] = 0.0;
412 Edges[2] = 0.0;
413 Edges[3] = 0.0;
414 DeltaEta = 0.0;
415 DeltaPhi = 0.0;
416 Momentum.SetXYZT(0.0, 0.0, 0.0, 0.0);
417 Position.SetXYZT(0.0, 0.0, 0.0, 0.0);
[80306e6]418 InitialPosition.SetXYZT(0.0, 0.0, 0.0, 0.0);
[d7d2da3]419 Area.SetXYZT(0.0, 0.0, 0.0, 0.0);
[80306e6]420 L = 0.0;
[28c722a]421 ErrorT = 0.0;
[80306e6]422 D0 = 0.0;
423 ErrorD0 = 0.0;
424 DZ = 0.0;
425 ErrorDZ = 0.0;
426 P =0.0;
427 ErrorP =0.0;
428 PT = 0.0;
429 ErrorPT = 0.0;
430 CtgTheta = 0.0;
431 ErrorCtgTheta = 0.0;
432 Phi = 0.0;
433 ErrorPhi = 0.0;
[a0431dc]434 Xd = 0.0;
435 Yd = 0.0;
436 Zd = 0.0;
[a98c7ef]437 TrackResolution = 0.0;
[24d005f]438 NCharged = 0;
439 NNeutrals = 0;
440 Beta = 0.0;
441 BetaStar = 0.0;
442 MeanSqDeltaR = 0.0;
443 PTD = 0.0;
[839deb7]444
445 NTimeHits = 0;
446 ECalEnergyTimePairs.clear();
447
[b62c2da]448 IsolationVar = -999;
449 IsolationVarRhoCorr = -999;
450 SumPtCharged = -999;
451 SumPtNeutral = -999;
452 SumPtChargedPU = -999;
453 SumPt = -999;
[839deb7]454
[ab3bdd9]455 ClusterIndex = -1;
456 ClusterNDF = -99;
457 ClusterSigma = 0.0;
458 SumPT2 = 0.0;
459 BTVSumPT2 = 0.0;
460 GenDeltaZ = 0.0;
461 GenSumPT2 = 0.0;
462
[24d005f]463 FracPt[0] = 0.0;
464 FracPt[1] = 0.0;
465 FracPt[2] = 0.0;
466 FracPt[3] = 0.0;
467 FracPt[4] = 0.0;
[63178fb]468 Tau[0] = 0.0;
469 Tau[1] = 0.0;
470 Tau[2] = 0.0;
471 Tau[3] = 0.0;
472 Tau[4] = 0.0;
[839deb7]473
[ba75867]474 SoftDroppedJet.SetXYZT(0.0, 0.0, 0.0, 0.0);
475 SoftDroppedSubJet1.SetXYZT(0.0, 0.0, 0.0, 0.0);
476 SoftDroppedSubJet2.SetXYZT(0.0, 0.0, 0.0, 0.0);
477
478
[8d200a6]479 for(i = 0; i < 5; ++i)
480 {
481 TrimmedP4[i].SetXYZT(0.0, 0.0, 0.0, 0.0);
[839deb7]482 PrunedP4[i].SetXYZT(0.0, 0.0, 0.0, 0.0);
[8d200a6]483 SoftDroppedP4[i].SetXYZT(0.0, 0.0, 0.0, 0.0);
484 }
485
[edf10ba]486 NSubJetsTrimmed = 0;
487 NSubJetsPruned = 0;
[de6d698]488 NSubJetsSoftDropped = 0;
[839deb7]489
[d7d2da3]490 fArray = 0;
491}
Note: See TracBrowser for help on using the repository browser.