CMS 3D CMS Logo

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

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