#include "PDGMap.h" using namespace std; PDGMap::PDGMap() { FillParticleColors(); FillPDGMapV2(); //FillScaled(); } void PDGMap::FillParticleColors() { Colors[11]=kRed; Colors[211]=kGreen; Colors[2212]=kBlue; Colors[321]=kMagenta; } void PDGMap::FillPDGMap() { //Particles[111]="Pi_0"; //Particles[-13]="Muon+"; //Particles[13]="Muon-"; Particles[11]="e-"; //Particles[14]="Neutrino"; //Particles[22]="Gamma"; Particles[211]="Pi+"; Particles[2212]="p+"; Particles[321]="K+"; Particles[-11]="e+"; Particles[0]="Summary"; } void PDGMap::FillPDGMapV2() { //my histograms get these names, root uses them internally and strange things will haben if there is //a '+' //Particles[111]="Pi_0"; //Particles[-13]="Muon+"; //Particles[13]="Muon-"; Particles[11]="P11"; //Particles[14]="Neutrino"; //Particles[22]="Gamma"; Particles[211]="P211"; Particles[2212]="P2212"; Particles[321]="P321"; Particles[-11]="Pm11"; Particles[0]="Summary"; } void PDGMap::FillScaled() { Particles[11]="P11scaled"; Particles[211]="P211scaled"; Particles[2212]="P2212scaled"; Particles[321]="P321scaled"; Particles[-11]="Pm11scaled"; Particles[0]="Summaryscaled"; } std::string PDGMap::GetSummaryName() { return Particles[0]; } short int PDGMap::GetParticleColor(Int_t pdgCode) const { map::const_iterator found=Colors.find(pdgCode); if( found!=Colors.end() ) { short int color=found->second; return color; } return 0; } short int PDGMap::GetParticleColor(const string &ParticleName) const { map::const_iterator end=Particles.end(); map::const_iterator cit; for(cit=Particles.begin();cit!=end;++cit) { if(cit->second==ParticleName) { short int color=GetParticleColor(cit->first); return color; } } return 0; }