Belle II Software  release-05-02-19
RestOfEvent.cc
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2010 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Anze Zupanc, Matic Lubej, Sviatoslav Bilokin *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #include <analysis/dataobjects/RestOfEvent.h>
12 
13 #include <framework/datastore/StoreArray.h>
14 
15 #include <analysis/dataobjects/Particle.h>
16 #include <mdst/dataobjects/MCParticle.h>
17 #include <mdst/dataobjects/Track.h>
18 #include <mdst/dataobjects/ECLCluster.h>
19 #include <mdst/dataobjects/KLMCluster.h>
20 
21 #include <analysis/ClusterUtility/ClusterUtils.h>
22 
23 #include <TLorentzVector.h>
24 
25 using namespace Belle2;
26 // New methods:
27 void RestOfEvent::addParticles(const std::vector<const Particle*>& particlesToAdd)
28 {
29  StoreArray<Particle> allParticles;
30  for (auto* particleToAdd : particlesToAdd) {
31  std::vector<const Particle*> daughters = particleToAdd->getFinalStateDaughters();
32  for (auto* daughter : daughters) {
33  bool toAdd = true;
34  for (auto& myIndex : m_particleIndices) {
35  if (allParticles[myIndex]->isCopyOf(daughter, true)) {
36  toAdd = false;
37  break;
38  }
39  }
40  if (toAdd) {
41  B2DEBUG(10, "\t\tAdding particle with PDG " << daughter->getPDGCode());
42  m_particleIndices.insert(daughter->getArrayIndex());
43  }
44  }
45  }
46 }
47 
48 std::vector<const Particle*> RestOfEvent::getParticles(const std::string& maskName, bool unpackComposite) const
49 {
50  std::vector<const Particle*> result;
51  StoreArray<Particle> allParticles;
52  std::set<int> source;
53  if (m_particleIndices.size() == 0) {
54  B2DEBUG(10, "ROE contains no particles, masks are empty too");
55  return result;
56  }
57  if (maskName == "") {
58  // if no mask provided work with internal source
59  source = m_particleIndices;
60  } else {
61  bool maskFound = false;
62  for (auto& mask : m_masks) {
63  if (mask.getName() == maskName) {
64  maskFound = true;
65  source = mask.getParticles();
66  break;
67  }
68  }
69  if (!maskFound) {
70  B2FATAL("No " << maskName << " mask defined in current ROE!");
71  }
72  }
73  for (const int index : source) {
74  if ((allParticles[index]->getParticleSource() == Particle::EParticleSourceObject::c_Composite or
75  allParticles[index]->getParticleSource() == Particle::EParticleSourceObject::c_V0) && unpackComposite) {
76  auto fsdaughters = allParticles[index]->getFinalStateDaughters();
77  for (auto* daughter : fsdaughters) {
78  result.push_back(daughter);
79  }
80  continue;
81  }
82  result.push_back(allParticles[index]);
83  }
84  return result;
85 }
86 std::vector<const Particle*> RestOfEvent::getPhotons(const std::string& maskName, bool unpackComposite) const
87 {
88  auto particles = getParticles(maskName, unpackComposite);
89  std::vector<const Particle*> photons;
90  for (auto* particle : particles) {
91  if (particle->getParticleSource() == Particle::EParticleSourceObject::c_ECLCluster) {
92  photons.push_back(particle);
93  }
94  }
95  return photons;
96 }
97 std::vector<const Particle*> RestOfEvent::getHadrons(const std::string& maskName, bool unpackComposite) const
98 {
99  auto particles = getParticles(maskName, unpackComposite);
100  std::vector<const Particle*> hadrons;
101  for (auto* particle : particles) {
102  if (particle->getParticleSource() == Particle::EParticleSourceObject::c_KLMCluster) {
103  hadrons.push_back(particle);
104  }
105  }
106  return hadrons;
107 }
108 
109 std::vector<const Particle*> RestOfEvent::getChargedParticles(const std::string& maskName, unsigned int pdg,
110  bool unpackComposite) const
111 {
112  auto particles = getParticles(maskName, unpackComposite);
113  std::vector<const Particle*> charged;
114  for (auto* particle : particles) {
115  if (particle->getParticleSource() == Particle::EParticleSourceObject::c_Track) {
116  if (pdg == 0 || pdg == abs(particle->getPDGCode())) {
117  charged.push_back(particle);
118  }
119  }
120  }
121  return charged;
122 }
123 
124 
125 bool RestOfEvent::hasParticle(const Particle* particle, const std::string& maskName) const
126 {
127  if (maskName != "" && !hasMask(maskName)) {
128  B2FATAL("No " << maskName << " mask defined in current ROE!");
129  }
130 
131  std::vector<const Particle*> particlesROE = getParticles(maskName);
132  return isInParticleList(particle, particlesROE);
133 }
134 
135 void RestOfEvent::initializeMask(const std::string& name, const std::string& origin)
136 {
137  if (name == "") {
138  B2FATAL("Creation of ROE Mask with an empty name is not allowed!");
139  }
140  if (findMask(name)) {
141  B2FATAL("ROE Mask already exists!");
142  }
143  Mask elon(name, origin);
144  m_masks.push_back(elon);
145 }
146 
147 void RestOfEvent::excludeParticlesFromMask(const std::string& maskName, const std::vector<const Particle*>& particlesToUpdate,
148  Particle::EParticleSourceObject listType, bool discard)
149 {
150  Mask* mask = findMask(maskName);
151  if (!mask) {
152  B2FATAL("No " << maskName << " mask defined in current ROE!");
153  }
154  std::string maskNameToGetParticles = maskName;
155  if (!mask->isValid()) {
156  maskNameToGetParticles = "";
157  }
158  std::vector<const Particle*> allROEParticles = getParticles(maskNameToGetParticles);
159  std::vector<const Particle*> toKeepinROE;
160  for (auto* roeParticle : allROEParticles) {
161  if (isInParticleList(roeParticle, particlesToUpdate)) {
162  if (!discard) {
163  // If keep particles option is on, take the equal particles
164  toKeepinROE.push_back(roeParticle);
165  }
166  } else {
167  // Keep all particles which has different type than provided list
168  if (listType != roeParticle->getParticleSource()) {
169  toKeepinROE.push_back(roeParticle);
170  } else if (discard) {
171  // If keep particles option is off, take not equal particles
172  toKeepinROE.push_back(roeParticle);
173  }
174  }
175  }
176  mask->clearParticles();
177  mask->addParticles(toKeepinROE);
178 }
179 
180 void RestOfEvent::updateMaskWithCuts(const std::string& maskName, const std::shared_ptr<Variable::Cut>& trackCut,
181  const std::shared_ptr<Variable::Cut>& eclCut, const std::shared_ptr<Variable::Cut>& klmCut, bool updateExisting)
182 {
183  Mask* mask = findMask(maskName);
184  if (!mask) {
185  B2FATAL("ROE Mask does not exist!");
186  }
187  std::string sourceName = "";
188  if (updateExisting) {
189  // if mask already exists, take its particles to update
190  sourceName = maskName;
191  }
192  // get all initial ROE particles, don't touch the possible V0s, otherwise, some daughters may be excluded, and some not... This may be revisited if needed
193  std::vector<const Particle*> allROEParticles = getParticles(sourceName, false);
194  std::vector<const Particle*> maskedParticles;
195  // First check particle type, then check cuts, if no cuts provided, take all particles of this type
196  for (auto* particle : allROEParticles) {
197  if (particle->getParticleSource() == Particle::EParticleSourceObject::c_Track && (!trackCut || trackCut->check(particle))) {
198  maskedParticles.push_back(particle);
199  }
200  if (particle->getParticleSource() == Particle::EParticleSourceObject::c_ECLCluster && (!eclCut || eclCut->check(particle))) {
201  maskedParticles.push_back(particle);
202  }
203  if (particle->getParticleSource() == Particle::EParticleSourceObject::c_KLMCluster && (!klmCut || klmCut->check(particle))) {
204  maskedParticles.push_back(particle);
205  }
206  // don't lose a possible V0 particle
207  if (particle->getParticleSource() == Particle::EParticleSourceObject::c_Composite or
208  particle->getParticleSource() == Particle::EParticleSourceObject::c_V0) {
209  maskedParticles.push_back(particle);
210  }
211  }
212  mask->clearParticles();
213  mask->addParticles(maskedParticles);
214 }
215 
216 void RestOfEvent::updateMaskWithV0(const std::string& name, const Particle* particleV0)
217 {
218  Mask* mask = findMask(name);
219  if (!mask) {
220  B2FATAL("ROE Mask does not exist!");
221  }
222  std::vector<const Particle*> allROEParticles = getParticles(name, false);
223  std::vector<int> indicesToErase;
224  std::vector<const Particle*> daughtersV0 = particleV0->getFinalStateDaughters();
225  for (auto* maskParticle : allROEParticles) {
226  bool toKeep = true;
227  for (auto* daughterV0 : daughtersV0) {
228  if (daughterV0->isCopyOf(maskParticle, true)) {
229  toKeep = false;
230  }
231  }
232  if (!toKeep) {
233  indicesToErase.push_back(maskParticle->getArrayIndex());
234  }
235  }
236  if (daughtersV0.size() != indicesToErase.size()) {
237  B2DEBUG(10, "Only " << indicesToErase.size() << " daughters are excluded from mask particles. Abort");
238  return;
239  }
240  std::string toprint = "We will erase next indices from " + name + " mask: ";
241  for (auto& i : indicesToErase) {
242  toprint += std::to_string(i) + " ";
243  }
244  B2DEBUG(10, toprint);
245  // If everything is good, we add
246  mask->addV0(particleV0, indicesToErase);
247 }
248 
249 bool RestOfEvent::checkCompatibilityOfMaskAndV0(const std::string& name, const Particle* particleV0)
250 {
251  Mask* mask = findMask(name);
252  if (!mask) {
253  B2FATAL("ROE Mask does not exist!");
254  }
255  if (!mask->isValid()) {
256  return false; //We should have particles here!
257  }
258  if (particleV0->getParticleSource() != Particle::EParticleSourceObject::c_Composite and
259  particleV0->getParticleSource() != Particle::EParticleSourceObject::c_V0) {
260  return false;
261  }
262  std::vector<const Particle*> daughtersV0 = particleV0->getFinalStateDaughters();
263  for (auto* daughter : daughtersV0) {
264  if (daughter->getParticleSource() != Particle::EParticleSourceObject::c_Track) {
265  return false; // Non tracks are not supported yet
266  }
267  }
268  if (mask->hasV0(particleV0)) {
269  return false; // We are not going to add another one
270  }
271  return true;
272 }
273 
274 bool RestOfEvent::hasMask(const std::string& name) const
275 {
276  for (auto& mask : m_masks) {
277  if (mask.getName() == name) {
278  return true;
279  }
280  }
281  return false;
282 }
283 TLorentzVector RestOfEvent::get4Vector(const std::string& maskName) const
284 {
285  TLorentzVector roe4Vector;
286  std::vector<const Particle*> myParticles = RestOfEvent::getParticles(maskName);
287  for (const Particle* particle : myParticles) {
288  // KLMClusters are discarded, because KLM energy estimation is based on hit numbers, therefore it is unreliable
289  if (particle->getParticleSource() == Particle::EParticleSourceObject::c_KLMCluster) {
290  continue;
291  }
292  roe4Vector += particle->get4Vector();
293  }
294  return roe4Vector;
295 }
296 
297 
298 RestOfEvent::Mask* RestOfEvent::findMask(const std::string& name)
299 {
300  for (auto& mask : m_masks) {
301  if (mask.getName() == name) {
302  return &mask;
303  }
304  }
305  return nullptr;
306 
307 }
308 std::vector<const Track*> RestOfEvent::getTracks(const std::string& maskName) const
309 {
310  std::vector<const Track*> result;
311  std::vector<const Particle*> allParticles = getParticles(maskName);
312  for (auto* particle : allParticles) {
313  if (particle->getParticleSource() == Particle::EParticleSourceObject::c_Track) {
314  result.push_back(particle->getTrack());
315  }
316  }
317  return result;
318 }
319 std::vector<const ECLCluster*> RestOfEvent::getECLClusters(const std::string& maskName) const
320 {
321  std::vector<const ECLCluster*> result;
322  std::vector<const Particle*> allParticles = getParticles(maskName);
323  for (auto* particle : allParticles) {
324  //Get all ECL clusters independently of the particle type, (both charged and neutral)
325  auto* cluster = particle->getECLCluster();
326  if (cluster and cluster->hasHypothesis(ECLCluster::EHypothesisBit::c_nPhotons)) {
327  result.push_back(cluster);
328  }
329  }
330  return result;
331 }
332 std::vector<const KLMCluster*> RestOfEvent::getKLMClusters(const std::string& maskName) const
333 {
334  std::vector<const KLMCluster*> result;
335  std::vector<const Particle*> allParticles = getParticles(maskName);
336  for (auto* particle : allParticles) {
337  if (particle->getParticleSource() == Particle::EParticleSourceObject::c_KLMCluster) {
338  result.push_back(particle->getKLMCluster());
339  }
340  }
341  return result;
342 }
343 int RestOfEvent::getNTracks(const std::string& maskName) const
344 {
345  int nTracks = getTracks(maskName).size();
346  return nTracks;
347 }
348 int RestOfEvent::getNECLClusters(const std::string& maskName) const
349 {
350  int nROEECLClusters = getECLClusters(maskName).size();
351  return nROEECLClusters;
352 }
353 int RestOfEvent::getNKLMClusters(const std::string& maskName) const
354 {
355  int nROEKLMClusters = getKLMClusters(maskName).size();
356  return nROEKLMClusters;
357 }
358 //
359 // Old methods:
360 //
361 TLorentzVector RestOfEvent::get4VectorTracks(const std::string& maskName) const
362 {
363  StoreArray<Particle> particles;
364  std::vector<const Track*> roeTracks = RestOfEvent::getTracks(maskName);
365 
366  // Collect V0 momenta
367  TLorentzVector roe4VectorTracks;
368  //TODO: untested: test and move this method to variables!
369  //std::vector<unsigned int> v0List = RestOfEvent::getV0IDList(maskName);
370  //for (unsigned int iV0 = 0; iV0 < v0List.size(); iV0++)
371  // roe4VectorTracks += particles[v0List[iV0]]->get4Vector();
372  const unsigned int n = Const::ChargedStable::c_SetSize;
373  //auto fractions = getChargedStableFractions(maskName);
374  double fractions[n] = {0, 0, 1, 0, 0, 0};
375  //fillFractions(fractions, maskName);
376 
377  // Add momenta from other tracks
378  for (auto& roeTrack : roeTracks) {
379 
380  const Track* track = roeTrack;
381  const PIDLikelihood* pid = track->getRelatedTo<PIDLikelihood>();
382  const MCParticle* mcp = roeTrack->getRelatedTo<MCParticle>();
383 
384  if (!pid) {
385  B2ERROR("Track with no PID information!");
386  continue;
387  }
388 
389  double particlePDG;
390 
391  // MC, if available
393  double mcChoice = Const::pion.getPDGCode();
394  if (mcp) {
395  int mcpdg = abs(mcp->getPDG());
396  if (Const::chargedStableSet.contains(Const::ParticleType(mcpdg))) {
397  mcChoice = mcpdg;
398  }
399  }
400 
401  // PID for Belle
403  // Set variables
404  Const::PIDDetectorSet set = Const::ECL;
405  double eIDBelle = pid->getProbability(Const::electron, Const::pion, set);
406  double muIDBelle = 0.5;
407  if (pid->isAvailable(Const::KLM))
408  muIDBelle = exp(pid->getLogL(Const::muon, Const::KLM));
409  double atcPIDBelle_Kpi = atcPIDBelleKpiFromPID(pid);
410 
411  // Check for leptons, else kaons or pions
412  double pidChoice;
413  if (eIDBelle > 0.9 and eIDBelle > muIDBelle)
414  pidChoice = Const::electron.getPDGCode();
415  else if (muIDBelle > 0.9 and eIDBelle < muIDBelle)
416  pidChoice = Const::muon.getPDGCode();
417  // Check for kaons, else pions
418  else if (atcPIDBelle_Kpi > 0.6)
419  pidChoice = Const::kaon.getPDGCode();
420  // Assume pions
421  else
422  pidChoice = Const::pion.getPDGCode();
423 
424  // Most likely
426  // TODO: SET TO PION UNTILL MOST LIKELY FUNCTION IS RELIABLE
427  double fracChoice = Const::pion.getPDGCode();
428 
429  // Use MC mass hypothesis
430  if (fractions[0] == -1)
431  particlePDG = mcChoice;
432  // Use Belle case
433  else if (fractions[0] == -2)
434  particlePDG = pidChoice;
435  // Use fractions
436  else
437  particlePDG = fracChoice;
438 
439  auto trackParticle = Const::ChargedStable(particlePDG);
440  const TrackFitResult* tfr = roeTrack->getTrackFitResultWithClosestMass(trackParticle);
441 
442  // Set energy of track
443  double tempMass = trackParticle.getMass();
444  TVector3 tempMom = tfr->getMomentum();
445  TLorentzVector temp4Vector;
446  temp4Vector.SetVect(tempMom);
447  temp4Vector.SetE(TMath::Sqrt(tempMom.Mag2() + tempMass * tempMass));
448 
449  roe4VectorTracks += temp4Vector;
450  }
451 
452  return roe4VectorTracks;
453 }
454 
455 TLorentzVector RestOfEvent::get4VectorNeutralECLClusters(const std::string& maskName) const
456 {
457  std::vector<const ECLCluster*> roeClusters = RestOfEvent::getECLClusters(maskName);
458  TLorentzVector roe4VectorECLClusters;
459 
460  // Add all momenta from neutral ECLClusters which have the nPhotons hypothesis
461  ClusterUtils C;
462  for (auto& roeCluster : roeClusters) {
463  if (roeCluster->isNeutral())
464  if (roeCluster->hasHypothesis(ECLCluster::EHypothesisBit::c_nPhotons))
465  roe4VectorECLClusters += C.Get4MomentumFromCluster(roeCluster, ECLCluster::EHypothesisBit::c_nPhotons);
466  }
467 
468  return roe4VectorECLClusters;
469 }
470 
471 bool RestOfEvent::isInParticleList(const Particle* roeParticle, const std::vector<const Particle*>& particlesToUpdate) const
472 {
473  for (auto* listParticle : particlesToUpdate) {
474  if (roeParticle->isCopyOf(listParticle, true)) {
475  return true;
476  }
477  }
478  return false;
479 }
480 
481 std::vector<std::string> RestOfEvent::getMaskNames() const
482 {
483  std::vector<std::string> maskNames;
484 
485  for (auto& mask : m_masks) {
486  maskNames.push_back(mask.getName());
487  }
488 
489  return maskNames;
490 }
491 
492 void RestOfEvent::print() const
493 {
494  B2INFO(" - Particles[" << m_particleIndices.size() << "] : ");
496  for (auto mask : m_masks) {
497  mask.print();
498  }
499  if (m_isNested) {
500  B2INFO("This ROE is nested.");
501  }
502 }
503 
504 void RestOfEvent::printIndices(const std::set<int>& indices) const
505 {
506  if (indices.empty())
507  return;
508 
509  std::string printout = " -> ";
510  for (const int index : indices) {
511  printout += std::to_string(index) + ", ";
512  }
513  B2INFO(printout);
514 }
515 
516 Particle* RestOfEvent::convertToParticle(const std::string& maskName, int pdgCode, bool isSelfConjugated)
517 {
518  StoreArray<Particle> particles;
519  std::set<int> source;
520  if (maskName == "") {
521  // if no mask provided work with internal source
522  source = m_particleIndices;
523  } else {
524  bool maskFound = false;
525  for (auto& mask : m_masks) {
526  if (mask.getName() == maskName) {
527  maskFound = true;
528  source = mask.getParticles();
529  break;
530  }
531  }
532  if (!maskFound) {
533  B2FATAL("No " << maskName << " mask defined in current ROE!");
534  }
535  }
536  int particlePDG = (pdgCode == 0) ? getPDGCode() : pdgCode;
537  auto isFlavored = (isSelfConjugated) ? Particle::EFlavorType::c_Unflavored : Particle::EFlavorType::c_Flavored;
538  return particles.appendNew(get4Vector(maskName), particlePDG, isFlavored, std::vector(source.begin(),
539  source.end()), Particle::PropertyFlags::c_IsUnspecified);
540 }
541 
543 {
544  // ACC = ARICH
545  Const::PIDDetectorSet set = Const::ARICH;
546  double acc_sig = exp(pid->getLogL(Const::kaon, set));
547  double acc_bkg = exp(pid->getLogL(Const::pion, set));
548  double acc = 0.5; // Belle standard
549  if (acc_sig + acc_bkg > 0.0)
550  acc = acc_sig / (acc_sig + acc_bkg);
551 
552  // TOF = TOP
553  set = Const::TOP;
554  double tof_sig = exp(pid->getLogL(Const::kaon, set));
555  double tof_bkg = exp(pid->getLogL(Const::pion, set));
556  double tof = 0.5; // Belle standard
557  double tof_all = tof_sig + tof_bkg;
558  if (tof_all != 0) {
559  tof = tof_sig / tof_all;
560  if (tof < 0.001) tof = 0.001;
561  if (tof > 0.999) tof = 0.999;
562  }
563 
564  // dE/dx = CDC
565  set = Const::CDC;
566  double cdc_sig = exp(pid->getLogL(Const::kaon, set));
567  double cdc_bkg = exp(pid->getLogL(Const::pion, set));
568  double cdc = 0.5; // Belle standard
569  double cdc_all = cdc_sig + cdc_bkg;
570  if (cdc_all != 0) {
571  cdc = cdc_sig / cdc_all;
572  if (cdc < 0.001) cdc = 0.001;
573  if (cdc > 0.999) cdc = 0.999;
574  }
575 
576  // Combined
577  double pid_sig = acc * tof * cdc;
578  double pid_bkg = (1. - acc) * (1. - tof) * (1. - cdc);
579 
580  return pid_sig / (pid_sig + pid_bkg);
581 }
Belle2::Const::ChargedStable::c_SetSize
static const unsigned int c_SetSize
Number of elements (for use in array bounds etc.)
Definition: Const.h:491
Belle2::RestOfEvent::m_masks
std::vector< Mask > m_masks
List of the ROE masks.
Definition: RestOfEvent.h:393
Belle2::RestOfEvent::printIndices
void printIndices(const std::set< int > &indices) const
Prints indices in the given set in a single line.
Definition: RestOfEvent.cc:504
Belle2::RestOfEvent::getNTracks
int getNTracks(const std::string &maskName="") const
Get number of all (no mask) or a subset (use mask) of all Tracks in ROE.
Definition: RestOfEvent.cc:343
Belle2::RestOfEvent::excludeParticlesFromMask
void excludeParticlesFromMask(const std::string &maskName, const std::vector< const Particle * > &particles, Particle::EParticleSourceObject listType, bool discard)
Update mask by keeping or excluding particles.
Definition: RestOfEvent.cc:147
Belle2::GeneralCut::check
bool check(const Object *p) const
Check if the current cuts are passed by the given object.
Definition: GeneralCut.h:123
Belle2::RestOfEvent::get4Vector
TLorentzVector get4Vector(const std::string &maskName="") const
Get 4-momentum vector all (no mask) or a subset (use mask) of all Tracks and ECLClusters in ROE.
Definition: RestOfEvent.cc:283
Belle2::RestOfEvent::getNECLClusters
int getNECLClusters(const std::string &maskName="") const
Get number of all (no mask) or a subset (use mask) of all ECLclusters in ROE.
Definition: RestOfEvent.cc:348
Belle2::RestOfEvent::updateMaskWithCuts
void updateMaskWithCuts(const std::string &name, const std::shared_ptr< Variable::Cut > &trackCut=nullptr, const std::shared_ptr< Variable::Cut > &eclCut=nullptr, const std::shared_ptr< Variable::Cut > &klmCut=nullptr, bool updateExisting=false)
Update mask with cuts.
Definition: RestOfEvent.cc:180
Belle2::RestOfEvent::getMaskNames
std::vector< std::string > getMaskNames() const
Get vector of all mask names of the ROE object.
Definition: RestOfEvent.cc:481
Belle2::TrackFitResult::getMomentum
TVector3 getMomentum() const
Getter for vector of momentum at closest approach of track in r/phi projection.
Definition: TrackFitResult.h:116
Belle2::RestOfEvent::getPhotons
std::vector< const Particle * > getPhotons(const std::string &maskName="", bool unpackComposite=true) const
Get photons from ROE mask.
Definition: RestOfEvent.cc:86
Belle2::Const::electron
static const ChargedStable electron
electron particle
Definition: Const.h:533
Belle2::ClusterUtils::Get4MomentumFromCluster
const TLorentzVector Get4MomentumFromCluster(const ECLCluster *cluster, ECLCluster::EHypothesisBit hypo)
Returns four momentum vector.
Definition: ClusterUtils.cc:26
Belle2::Const::chargedStableSet
static const ParticleSet chargedStableSet
set of charged stable particles
Definition: Const.h:494
Belle2::ECLCluster::EHypothesisBit::c_nPhotons
@ c_nPhotons
CR is split into n photons (N1)
Belle2::RestOfEvent::m_isNested
bool m_isNested
Nested ROE indicator.
Definition: RestOfEvent.h:395
Belle2::Const::ParticleType::getPDGCode
int getPDGCode() const
PDG code.
Definition: Const.h:349
Belle2::RestOfEvent::atcPIDBelleKpiFromPID
double atcPIDBelleKpiFromPID(const PIDLikelihood *pid) const
OBSOLETE: Added helper function so creation of temporary particles and setting pid relations is not n...
Definition: RestOfEvent.cc:542
Belle2::PIDLikelihood
Class to collect log likelihoods from TOP, ARICH, dEdx, ECL and KLM aimed for output to mdst includes...
Definition: PIDLikelihood.h:37
Belle2::RelationsInterface::getRelatedTo
TO * getRelatedTo(const std::string &name="", const std::string &namedRelation="") const
Get the object to which this object has a relation.
Definition: RelationsObject.h:250
Belle2::RestOfEvent::hasParticle
bool hasParticle(const Particle *particle, const std::string &maskName="") const
Check if ROE has StoreArray index of given to the list of unused tracks in the event.
Definition: RestOfEvent.cc:125
Belle2::TrackFitResult
Values of the result of a track fit with a given particle hypothesis.
Definition: TrackFitResult.h:59
Belle2::RestOfEvent::get4VectorTracks
TLorentzVector get4VectorTracks(const std::string &maskName="") const
OBSOLETE: Get 4-momentum vector all (no mask) or a subset (use mask) of all Tracks in ROE.
Definition: RestOfEvent.cc:361
Belle2::Const::kaon
static const ChargedStable kaon
charged kaon particle
Definition: Const.h:536
Belle2::RestOfEvent::convertToParticle
Particle * convertToParticle(const std::string &maskName="", int pdgCode=0, bool isSelfConjugated=true)
Converts ROE to Particle and adds it to StoreArray.
Definition: RestOfEvent.cc:516
Belle2::RestOfEvent::getHadrons
std::vector< const Particle * > getHadrons(const std::string &maskName="", bool unpackComposite=true) const
Get hadrons from ROE mask.
Definition: RestOfEvent.cc:97
Belle2::Const::RestrictedDetectorSet
A class for sets of detector IDs whose content is limited to restricted set of valid detector IDs.
Definition: Const.h:172
Belle2::Const::pion
static const ChargedStable pion
charged pion particle
Definition: Const.h:535
Belle2::RestOfEvent::getPDGCode
int getPDGCode() const
Gets the PDG code of the rest of event.
Definition: RestOfEvent.h:207
Belle2::Particle::getFinalStateDaughters
std::vector< const Belle2::Particle * > getFinalStateDaughters() const
Returns a vector of pointers to Final State daughter particles.
Definition: Particle.cc:613
Belle2::ClusterUtils
Class to provide momentum-related information from ECLClusters.
Definition: ClusterUtils.h:44
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::RestOfEvent::get4VectorNeutralECLClusters
TLorentzVector get4VectorNeutralECLClusters(const std::string &maskName="") const
Get 4-momentum vector all (no mask) or a subset (use mask) of all ECLClusters in ROE.
Definition: RestOfEvent.cc:455
Belle2::RestOfEvent::getParticles
std::vector< const Particle * > getParticles(const std::string &maskName="", bool unpackComposite=true) const
Get all Particles from ROE mask.
Definition: RestOfEvent.cc:48
Belle2::RestOfEvent::getKLMClusters
std::vector< const KLMCluster * > getKLMClusters(const std::string &maskName="") const
Get vector of all unused KLMClusters.
Definition: RestOfEvent.cc:332
Belle2::Particle::EParticleSourceObject
EParticleSourceObject
particle source enumerators
Definition: Particle.h:84
Belle2::Particle::isCopyOf
bool isCopyOf(const Particle *oParticle, bool doDetailedComparison=false) const
Returns true if this Particle and oParticle are copies of each other.
Definition: Particle.cc:677
Belle2::RestOfEvent::hasMask
bool hasMask(const std::string &name) const
True if this ROE object has mask.
Definition: RestOfEvent.cc:274
Belle2::RestOfEvent::checkCompatibilityOfMaskAndV0
bool checkCompatibilityOfMaskAndV0(const std::string &name, const Particle *particleV0)
Check if V0 can be added, maybe should be moved to private.
Definition: RestOfEvent.cc:249
Belle2::RestOfEvent::initializeMask
void initializeMask(const std::string &name, const std::string &origin="unknown")
Initialize new mask.
Definition: RestOfEvent.cc:135
Belle2::Particle
Class to store reconstructed particles.
Definition: Particle.h:77
Belle2::RestOfEvent::getTracks
std::vector< const Track * > getTracks(const std::string &maskName="") const
Get vector of all (no mask) or a subset (use mask) of all Tracks in ROE.
Definition: RestOfEvent.cc:308
Belle2::RestOfEvent::isInParticleList
bool isInParticleList(const Particle *roeParticle, const std::vector< const Particle * > &particlesToUpdate) const
Checks if a particle has its copy in the provided list.
Definition: RestOfEvent.cc:471
Belle2::Const::ParticleType
The ParticleType class for identifying different particle types.
Definition: Const.h:284
Belle2::Const::ChargedStable
Provides a type-safe way to pass members of the chargedStableSet set.
Definition: Const.h:465
Belle2::RestOfEvent::getECLClusters
std::vector< const ECLCluster * > getECLClusters(const std::string &maskName="") const
Get vector of all (no mask) or a subset (use mask) of all ECLClusters in ROE.
Definition: RestOfEvent.cc:319
Belle2::Const::muon
static const ChargedStable muon
muon particle
Definition: Const.h:534
Belle2::RestOfEvent::m_particleIndices
std::set< int > m_particleIndices
StoreArray indices to unused particles.
Definition: RestOfEvent.h:392
Belle2::Track
Class that bundles various TrackFitResults.
Definition: Track.h:35
Belle2::MCParticle
A Class to store the Monte Carlo particle information.
Definition: MCParticle.h:43
Belle2::RestOfEvent::print
void print() const
Prints the contents of a RestOfEvent object to screen.
Definition: RestOfEvent.cc:492
Belle2::StoreArray< Particle >
Belle2::RestOfEvent::addParticles
void addParticles(const std::vector< const Particle * > &particle)
Add StoreArray indices of given Particles to the list of unused particles in the event.
Definition: RestOfEvent.cc:27
Belle2::Particle::getParticleSource
EParticleSourceObject getParticleSource() const
Returns particle source as defined with enum EParticleSourceObject.
Definition: Particle.h:404
Belle2::RestOfEvent::updateMaskWithV0
void updateMaskWithV0(const std::string &name, const Particle *particleV0)
Update mask with composite particle.
Definition: RestOfEvent.cc:216
Belle2::RestOfEvent::findMask
Mask * findMask(const std::string &name)
Helper method to find ROE mask.
Definition: RestOfEvent.cc:298
Belle2::RestOfEvent::getChargedParticles
std::vector< const Particle * > getChargedParticles(const std::string &maskName="", unsigned int pdg=0, bool unpackComposite=true) const
Get charged particles from ROE mask.
Definition: RestOfEvent.cc:109
Belle2::RestOfEvent::getNKLMClusters
int getNKLMClusters(const std::string &maskName="") const
Get number of all remaining KLM clusters.
Definition: RestOfEvent.cc:353
Belle2::RestOfEvent::Mask
Structure of Rest of Event mask.
Definition: RestOfEvent.h:69