CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/SimTracker/TrackHistory/src/VertexCategories.cc

Go to the documentation of this file.
00001 
00002 #include <iostream>
00003 
00004 #include "SimTracker/TrackHistory/interface/VertexCategories.h"
00005 
00006 const char * VertexCategories::Names[] =
00007 {
00008     "Fake",
00009     "SignalEvent",
00010     "BWeakDecay",
00011     "CWeakDecay",
00012     "TauDecay",
00013     "KsDecay",
00014     "LambdaDecay",
00015     "JpsiDecay",
00016     "XiDecay",
00017     "OmegaDecay",
00018     "SigmaPlusDecay",
00019     "SigmaMinusDecay",
00020     "LongLivedDecay",
00021     "KnownProcess",
00022     "UndefinedProcess",
00023     "UnknownProcess",
00024     "PrimaryProcess",
00025     "HadronicProcess",
00026     "DecayProcess",
00027     "ComptonProcess",
00028     "AnnihilationProcess",
00029     "EIoniProcess",
00030     "HIoniProcess",
00031     "MuIoniProcess",
00032     "PhotonProcess",
00033     "MuPairProdProcess",
00034     "ConversionsProcess",
00035     "EBremProcess",
00036     "SynchrotronRadiationProcess",
00037     "MuBremProcess",
00038     "MuNuclProcess",
00039     "PrimaryVertex",
00040     "SecondaryVertex",
00041     "TertiaryVertex",
00042     "Unknown"
00043 };
00044 
00045 
00046 void VertexCategories::unknownVertex()
00047 {
00048     // Check for all flags down
00049     for (std::size_t index = 0; index < flags_.size() - 1; ++index)
00050         if (flags_[index]) return;
00051     // If all of them are down then it is a unkown track.
00052     flags_[Unknown] = true;
00053 }
00054 
00055 
00056 std::ostream & operator<< (std::ostream & os, VertexCategories const & classifier)
00057 {
00058     bool init = true;
00059 
00060     const VertexCategories::Flags & flags = classifier.flags();
00061 
00062     // Print out the classification for the track
00063     for (std::size_t index = 0; index < flags.size(); ++index)
00064     {
00065         if (flags[index])
00066         {
00067             if (init)
00068             {
00069                 os << VertexCategories::Names[index];
00070                 init = false;
00071             }
00072             else
00073                 os << "::" << VertexCategories::Names[index];
00074         }
00075     }
00076     os << std::endl;
00077 
00078     return os;
00079 }