Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:31:06

0001 
0002 #include <iostream>
0003 
0004 #include "SimTracker/TrackHistory/interface/TrackCategories.h"
0005 
0006 const char *const TrackCategories::Names[] = {"Fake",
0007                                               "Bad",
0008                                               "BadInnerHits",
0009                                               "SharedInnerHits",
0010                                               "SignalEvent",
0011                                               "Bottom",
0012                                               "Charm",
0013                                               "Light",
0014                                               "Muon",
0015                                               "TrackerSimHits",
0016                                               "BWeakDecay",
0017                                               "CWeakDecay",
0018                                               "ChargePionDecay",
0019                                               "ChargeKaonDecay",
0020                                               "TauDecay",
0021                                               "KsDecay",
0022                                               "LambdaDecay",
0023                                               "JpsiDecay",
0024                                               "XiDecay",
0025                                               "OmegaDecay",
0026                                               "SigmaPlusDecay",
0027                                               "SigmaMinusDecay",
0028                                               "LongLivedDecay",
0029                                               "KnownProcess",
0030                                               "UndefinedProcess",
0031                                               "UnknownProcess",
0032                                               "PrimaryProcess",
0033                                               "HadronicProcess",
0034                                               "DecayProcess",
0035                                               "ComptonProcess",
0036                                               "AnnihilationProcess",
0037                                               "EIoniProcess",
0038                                               "HIoniProcess",
0039                                               "MuIoniProcess",
0040                                               "PhotonProcess",
0041                                               "MuPairProdProcess",
0042                                               "ConversionsProcess",
0043                                               "EBremProcess",
0044                                               "SynchrotronRadiationProcess",
0045                                               "MuBremProcess",
0046                                               "MuNuclProcess",
0047                                               "FromBWeakDecayMuon",
0048                                               "FromCWeakDecayMuon",
0049                                               "DecayOnFlightMuon",
0050                                               "FromChargePionMuon",
0051                                               "FromChargeKaonMuon",
0052                                               "PrimaryVertex",
0053                                               "SecondaryVertex",
0054                                               "TertiaryVertex",
0055                                               "Unknown"};
0056 
0057 void TrackCategories::unknownTrack() {
0058   // Check for all flags down
0059   for (std::size_t index = 0; index < flags_.size() - 1; ++index)
0060     if (flags_[index])
0061       return;
0062   // If all of them are down then it is a unkown track.
0063   flags_[Unknown] = true;
0064 }
0065 
0066 std::ostream &operator<<(std::ostream &os, TrackCategories const &classifier) {
0067   bool init = true;
0068 
0069   const TrackCategories::Flags &flags = classifier.flags();
0070 
0071   // Print out the classification for the track
0072   for (std::size_t index = 0; index < flags.size(); ++index) {
0073     if (flags[index]) {
0074       if (init) {
0075         os << TrackCategories::Names[index];
0076         init = false;
0077       } else
0078         os << "::" << TrackCategories::Names[index];
0079     }
0080   }
0081   os << std::endl;
0082 
0083   return os;
0084 }