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/VertexCategories.h"
0005 
0006 const char *const VertexCategories::Names[] = {"Fake",
0007                                                "SignalEvent",
0008                                                "BWeakDecay",
0009                                                "CWeakDecay",
0010                                                "TauDecay",
0011                                                "KsDecay",
0012                                                "LambdaDecay",
0013                                                "JpsiDecay",
0014                                                "XiDecay",
0015                                                "OmegaDecay",
0016                                                "SigmaPlusDecay",
0017                                                "SigmaMinusDecay",
0018                                                "LongLivedDecay",
0019                                                "KnownProcess",
0020                                                "UndefinedProcess",
0021                                                "UnknownProcess",
0022                                                "PrimaryProcess",
0023                                                "HadronicProcess",
0024                                                "DecayProcess",
0025                                                "ComptonProcess",
0026                                                "AnnihilationProcess",
0027                                                "EIoniProcess",
0028                                                "HIoniProcess",
0029                                                "MuIoniProcess",
0030                                                "PhotonProcess",
0031                                                "MuPairProdProcess",
0032                                                "ConversionsProcess",
0033                                                "EBremProcess",
0034                                                "SynchrotronRadiationProcess",
0035                                                "MuBremProcess",
0036                                                "MuNuclProcess",
0037                                                "PrimaryVertex",
0038                                                "SecondaryVertex",
0039                                                "TertiaryVertex",
0040                                                "Unknown"};
0041 
0042 void VertexCategories::unknownVertex() {
0043   // Check for all flags down
0044   for (std::size_t index = 0; index < flags_.size() - 1; ++index)
0045     if (flags_[index])
0046       return;
0047   // If all of them are down then it is a unkown track.
0048   flags_[Unknown] = true;
0049 }
0050 
0051 std::ostream &operator<<(std::ostream &os, VertexCategories const &classifier) {
0052   bool init = true;
0053 
0054   const VertexCategories::Flags &flags = classifier.flags();
0055 
0056   // Print out the classification for the track
0057   for (std::size_t index = 0; index < flags.size(); ++index) {
0058     if (flags[index]) {
0059       if (init) {
0060         os << VertexCategories::Names[index];
0061         init = false;
0062       } else
0063         os << "::" << VertexCategories::Names[index];
0064     }
0065   }
0066   os << std::endl;
0067 
0068   return os;
0069 }