CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TrackCategories.cc
Go to the documentation of this file.
1 
2 #include <iostream>
3 
5 
6 const char * const TrackCategories::Names[] =
7 {
8  "Fake",
9  "Bad",
10  "BadInnerHits",
11  "SharedInnerHits",
12  "SignalEvent",
13  "Bottom",
14  "Charm",
15  "Light",
16  "Muon",
17  "TrackerSimHits",
18  "BWeakDecay",
19  "CWeakDecay",
20  "ChargePionDecay",
21  "ChargeKaonDecay",
22  "TauDecay",
23  "KsDecay",
24  "LambdaDecay",
25  "JpsiDecay",
26  "XiDecay",
27  "OmegaDecay",
28  "SigmaPlusDecay",
29  "SigmaMinusDecay",
30  "LongLivedDecay",
31  "KnownProcess",
32  "UndefinedProcess",
33  "UnknownProcess",
34  "PrimaryProcess",
35  "HadronicProcess",
36  "DecayProcess",
37  "ComptonProcess",
38  "AnnihilationProcess",
39  "EIoniProcess",
40  "HIoniProcess",
41  "MuIoniProcess",
42  "PhotonProcess",
43  "MuPairProdProcess",
44  "ConversionsProcess",
45  "EBremProcess",
46  "SynchrotronRadiationProcess",
47  "MuBremProcess",
48  "MuNuclProcess",
49  "FromBWeakDecayMuon",
50  "FromCWeakDecayMuon",
51  "DecayOnFlightMuon",
52  "FromChargePionMuon",
53  "FromChargeKaonMuon",
54  "PrimaryVertex",
55  "SecondaryVertex",
56  "TertiaryVertex",
57  "Unknown"
58 };
59 
60 
62 {
63  // Check for all flags down
64  for (std::size_t index = 0; index < flags_.size() - 1; ++index)
65  if (flags_[index]) return;
66  // If all of them are down then it is a unkown track.
67  flags_[Unknown] = true;
68 }
69 
70 
71 std::ostream & operator<< (std::ostream & os, TrackCategories const & classifier)
72 {
73  bool init = true;
74 
75  const TrackCategories::Flags & flags = classifier.flags();
76 
77  // Print out the classification for the track
78  for (std::size_t index = 0; index < flags.size(); ++index)
79  {
80  if (flags[index])
81  {
82  if (init)
83  {
85  init = false;
86  }
87  else
88  os << "::" << TrackCategories::Names[index];
89  }
90  }
91  os << std::endl;
92 
93  return os;
94 }
static const char *const Names[]
Name of the different categories.
int init
Definition: HydjetWrapper.h:67
std::vector< Variable::Flags > flags
Definition: MVATrainer.cc:135
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
const Flags & flags() const
Returns flags with the category descriptions.
std::vector< bool > Flags
Main types associated to the class.
Flags flags_
Flag containers.