#include "PamVMCGeoIDMgr.h"

PamVMCGeoIDMgr::PamVMCGeoIDMgr() {
  TString t;
  //Calorimeter
  t="CAST";
  fdmap.Add(new TObjString(t), new pCalID(3));
  //Tof
  t="S11Y";
  fdmap.Add(new TObjString(t), new pTofID(1));
  t="S12X";
  fdmap.Add(new TObjString(t), new pTofID(1));
  t="S21X";
  fdmap.Add(new TObjString(t), new pTofID(1));
  t="S22Y";
  fdmap.Add(new TObjString(t), new pTofID(1));
  t="S31Y";
  fdmap.Add(new TObjString(t), new pTofID(1));
  t="S32X";
  fdmap.Add(new TObjString(t), new pTofID(1));
  //Tracker
  t="TSPA";
  fdmap.Add(new TObjString(t), new pTrkID(2));     
  //AC
  t="C1D1";
  fdmap.Add(new TObjString(t), new pCardID(1));
  t="C2D1";
  fdmap.Add(new TObjString(t), new pCardID(1));
  t="SID1";
  fdmap.Add(new TObjString(t), new pCasID(1));
  t="TOP1";
  fdmap.Add(new TObjString(t), new pCatID());
  //S4
  t="S4";
  fdmap.Add(new TObjString(t), new pS4ID());
  //ND
  t="NDTI";
  fdmap.Add(new TObjString(t), new pNdID(1));
} 
PamVMCGeoIDMgr * PamVMCGeoIDMgr::fgeoid = 0;

PamVMCGeoIDMgr * PamVMCGeoIDMgr::Instance(){
  if(fgeoid == 0) {
    fgeoid = new PamVMCGeoIDMgr();
  }
  return fgeoid;
}

pGeoID * PamVMCGeoIDMgr::GetGeoID(const char *name){
  return (pGeoID*) fdmap(name);
}
