ROOT logo
#include "hmdcgetcontainers.h"
#include "hmatrixcategory.h"
#include "hlinearcategory.h"
#include "hruntimedb.h"
#include "hspectrometer.h"
#include "hmdclayergeompar.h"
#include "hmdcgeompar.h"
#include "hmdcdetector.h"
#include "hspecgeompar.h"
#include "hmdcgeomstruct.h"
#include "hmdcrawstruct.h"
#include "hmdclookupgeom.h"
#include "hgeomcompositevolume.h"
#include "hdetgeompar.h"
#include "hgeomtransform.h"
#include "hgeomvolume.h"
#include "hparset.h"
#include "hevent.h"
#include "heventheader.h"
#include "hmdccal1sim.h"
#include "hmdcclussim.h"
#include "hmdchitsim.h"
#include "hmdcsegsim.h"
#include "hmdclayercorrpar.h"
#include "hmdcsetup.h"
#include "hmdctrackdset.h"

//*-- AUTHOR : Pechenov Vladimir
//*-- Modified : 19/06/2007 by V.Pechenov
//*-- Modified : 07/05/2002 by V.Pechenov
//*-- Modified : 08/05/2001
//*-- Modified : 29/09/2000

//_HADES_CLASS_DESCRIPTION 
////////////////////////////////////////////////////////////////
// HMdcGetContainers
//
// The lookup table for geting of pointers to param.&data containers
// Using:
//    HMdcGetContainers* fGetCont=HMdcGetContainers::getObject();
// If the cont. HMdcGetContainers not exist it will automaticaly 
// created and added to RuntimeDb
//
//    HMdcGeomPar* fgeomPar=fGetCont->getMdcGeomPar(Bool_t init=kFALSE);
// If cont. HMdcGeomPar don't exist & init=kTURUE it will created and initialized
//    ...
//
// Transformations:
// lab <--> sector
//    const HGeomTransform& getLabTransSec(Int_t sec, Bool_t init=kFALSE);
//    Bool_t getLabTransSec(HGeomTransform& trans, Int_t sec, 
//        Bool_t init=kFALSE);
//
// lab <--> module
//    const HGeomTransform& getLabTransMod(Int_t sec,Int_t mod,
//        Bool_t init=kFALSE);
//    Bool_t getLabTransMod(HGeomTransform& trans, Int_t sec, Int_t mod,
//        Bool_t init=kFALSE);
//
// sector <--> module
//    Bool_t getSecTransMod(HGeomTransform& trans, Int_t sec, Int_t mod,
//        Bool_t init=kFALSE);
// 
// Next methods use cell thickness from HMdcLayerGeomPar for
// calculating of mdc layer position and don't use HGeomCompositeVolume 
// layer parameters:
//
// lab <--> layer
//    Bool_t getLabTransLayer(HGeomTransform& trans, Int_t sec,Int_t mod,
//                            Int_t lay, Bool_t init=kFALSE);
// sector <--> layer
//    Bool_t getSecTransLayer(HGeomTransform& trans, Int_t sec,Int_t mod,
//                              Int_t lay, Bool_t init=kFALSE);
// module <--> layer
//    HGeomTransform& getModTransLayer(Int_t sec, Int_t mod, Int_t lay,
//                                     Bool_t init=kFALSE);
//////////////////////////////////////////////////////////////////

ClassImp(HMdcGetContainers)


HMdcGetContainers* HMdcGetContainers::fMdcGetContainers=0;

HMdcGetContainers* HMdcGetContainers::getObject() {
  if(!fMdcGetContainers) fMdcGetContainers=new HMdcGetContainers();
  return fMdcGetContainers;
}

HMdcGetContainers::HMdcGetContainers() {
  // seting default values
  if(gHades) {
    rtdb   = gHades->getRuntimeDb();
    isRtdb = kTRUE;
    spectr = gHades->getSetup();
  } else {
    Warning("HMdcGetContainers","gHades=%i",0);
    rtdb   = 0;
    spectr = 0;
    isRtdb = kFALSE;   
  }
  
  fMdcLayerGeomPar  = NULL;
  isMdcLayerGeomPar = kFALSE;
  fMdcGeomPar       = NULL;
  isMdcGeomPar      = kFALSE;
  fMdcDetector      = NULL;
  isMdcDetector     = kFALSE;
  fSpecGeomPar      = NULL;
  isSpecGeomPar     = kFALSE;
  fMdcGeomStruct    = NULL;
  isMdcGeomStruct   = kFALSE;
  fMdcRawStruct     = NULL;
  isMdcRawStruct    = kFALSE;
  fMdcLookupGeom    = NULL;
  isMdcLookupGeom   = kFALSE;
  fMdcLayerCorrPar  = NULL;
  isMdcLayerCorrPar = kFALSE;
  
  pMdcCal1Cat       = NULL;
  pGeantKineCat     = NULL;
  pGeantMdcCat      = NULL;
  pMdcClusCat       = NULL;
  pMdcClusFitCat    = NULL;
  pMdcWireFitCat    = NULL;
  pMdcClusInfCat    = NULL;
  pMdcTrkCandCat    = NULL;
  
  isMdcSetupInited  = kFALSE;
  isSimulation      = -1;
}

void HMdcGetContainers::deleteCont() {
  if(fMdcGetContainers) {
    delete fMdcGetContainers;
    fMdcGetContainers=0;
  }
}

Bool_t HMdcGetContainers::initCont(HParSet *par) {
  if( !par ) return kFALSE;
  if( !isInited(par) || !par->isStatic() ) return kTRUE;
  return par->init();
}

Bool_t HMdcGetContainers::isInited(HParSet *par) {
 if( !par ) return kFALSE;
 return par->getInputVersion(1)>=0 || par->getInputVersion(2)>=0;
}

HMdcLayerGeomPar* HMdcGetContainers::getMdcLayerGeomPar(Bool_t init) {
  if( !fMdcLayerGeomPar && isRtdb )
    fMdcLayerGeomPar=(HMdcLayerGeomPar*)rtdb->getContainer("MdcLayerGeomPar");
  if( init && !isMdcLayerGeomPar ) isMdcLayerGeomPar=initCont(fMdcLayerGeomPar);
  return fMdcLayerGeomPar;
}

HMdcLayerCorrPar* HMdcGetContainers::getMdcLayerCorrPar(Bool_t init) {
  if( !fMdcLayerCorrPar && isRtdb )
    fMdcLayerCorrPar=(HMdcLayerCorrPar*)rtdb->getContainer("MdcLayerCorrPar");
  if( init && !isMdcLayerCorrPar ) isMdcLayerCorrPar=initCont(fMdcLayerCorrPar);
  return fMdcLayerCorrPar;
}

HMdcGeomPar* HMdcGetContainers::getMdcGeomPar(Bool_t init) {
  if( !fMdcGeomPar && isRtdb )
    fMdcGeomPar=(HMdcGeomPar*)rtdb->getContainer("MdcGeomPar");
  if( init && !isMdcGeomPar ) isMdcGeomPar=initCont(fMdcGeomPar);
  return fMdcGeomPar;
}
    
HMdcDetector* HMdcGetContainers::getMdcDetector() {
  if(fMdcDetector==0 && gHades) fMdcDetector = (HMdcDetector*)gHades->getSetup()->getDetector("Mdc");
  return fMdcDetector;
}

HSpecGeomPar* HMdcGetContainers::getSpecGeomPar(Bool_t init) {
  if( !fSpecGeomPar && isRtdb )
    fSpecGeomPar=(HSpecGeomPar*)rtdb->getContainer("SpecGeomPar");
  if( init&& !isSpecGeomPar ) isSpecGeomPar=initCont(fSpecGeomPar);
  return fSpecGeomPar;
}


HMdcGeomStruct* HMdcGetContainers::getMdcGeomStruct(Bool_t init) {
  if( !fMdcGeomStruct && isRtdb )
    fMdcGeomStruct=(HMdcGeomStruct*)rtdb->getContainer("MdcGeomStruct");
  if( init && !isMdcGeomStruct ) isMdcGeomStruct=initCont(fMdcGeomStruct);
  return fMdcGeomStruct;
}


HMdcRawStruct* HMdcGetContainers::getMdcRawStruct(Bool_t init) {
  if( !fMdcRawStruct && isRtdb )
    fMdcRawStruct=(HMdcRawStruct*)rtdb->getContainer("MdcRawStruct");
  if( init && !isMdcRawStruct ) isMdcRawStruct=initCont(fMdcRawStruct);
  return fMdcRawStruct;
}

HMdcLookupGeom* HMdcGetContainers::getMdcLookupGeom(Bool_t init) {
  if( !fMdcLookupGeom && isRtdb )
    fMdcLookupGeom=(HMdcLookupGeom*)rtdb->getContainer("MdcLookupGeom");
  if( init && !isMdcLookupGeom ) isMdcLookupGeom=initCont(fMdcLookupGeom);
  return fMdcLookupGeom;
}

//------------------------------------------------------------------------

HGeomCompositeVolume* HMdcGetContainers::getGeomCompositeVolume(
    Int_t mod, Bool_t init) {
  if(!fMdcGeomPar && isMdcGeomPar ) getMdcGeomPar(init);
  return (fMdcGeomPar) ? fMdcGeomPar->getRefVolume(mod) : 0;
}

HMdcLayerGeomParLay* HMdcGetContainers::getMdcLayerGeomParLay(
    Int_t sec,Int_t mod,Int_t lay, Bool_t init) {
  getMdcLayerGeomPar(init);
  if( !fMdcLayerGeomPar ) return 0;
  HMdcLayerGeomParSec* fsec=&((*fMdcLayerGeomPar)[sec]);
  if( !fsec ) return 0;
  HMdcLayerGeomParMod* fmod=&((*fsec)[mod]);
  if( !fmod ) return 0;
  return &((*fmod)[lay]);
}

HModGeomPar* HMdcGetContainers::getModGeomPar(Int_t sec,Int_t mod,Bool_t init) {
  getMdcGeomPar(init);
  return (fMdcGeomPar) ? fMdcGeomPar->getModule(sec,mod) : 0;
}

const HGeomTransform& HMdcGetContainers::getLabTransSec(Int_t sec,Bool_t init) {
  // return transformation sector<-->lab.
  HSpecGeomPar* fSpecGeomPar=getSpecGeomPar(init);
  if(fSpecGeomPar) {
    HGeomVolume* fVol=fSpecGeomPar->getSector(sec);
    if(fVol) return fVol->getTransform();
  }
  Error("getLabTransSec","can't get the transformation lab.<-->sec. (S%i)",sec+1);
  return *((HGeomTransform*)NULL);
}

Bool_t HMdcGetContainers::getLabTransSec(HGeomTransform& trans, Int_t sec,
    Bool_t init) {
  const HGeomTransform& tr=getLabTransSec(sec,init);
  if( !&tr ) return kFALSE;
  trans=tr;
  return kTRUE;
}

const HGeomTransform& HMdcGetContainers::getLabTransMod(Int_t sec, Int_t mod,
    Bool_t init) {
  //return transformation module<-->lab.
  HModGeomPar* fMod=getModGeomPar(sec,mod,init);
  if(fMod) return fMod->getLabTransform();
  Error("getLabTransMod","can't get the transformation lab.<-->mod. (S%iM%i)",
      sec+1,mod+1);
  return *((HGeomTransform*)0);
}

Bool_t HMdcGetContainers::getLabTransMod(HGeomTransform& trans, Int_t sec,
    Int_t mod, Bool_t init) {
  const HGeomTransform& tr=getLabTransMod(sec,mod,init);
  if( !&tr ) return kFALSE;
  trans=tr;
  return kTRUE;
}

Bool_t HMdcGetContainers::getSecTransMod(HGeomTransform& trans, Int_t sec, 
    Int_t mod, Bool_t init) {
  //return transformation module<-->sector.
  const HGeomTransform& tr=getLabTransMod(sec,mod,init);
  if( !&tr ) return kFALSE;
  const HGeomTransform& fSec=getLabTransSec(sec,init);
  if( &fSec==0 ) return kFALSE;
  trans=tr;
  trans.transTo(fSec);
  return kTRUE;
}

Double_t HMdcGetContainers::getSensWireThick(Int_t mod, Int_t lay) {
  HGeomCompositeVolume* fMod = getGeomCompositeVolume(mod);
  if(fMod == 0) return 0.;
  HGeomVolume* fVol=fMod->getComponent(lay);
  if(fVol == 0) return 0.;
  HGeomVector* p1 = fVol->getPoint(0);
  HGeomVector* p2 = fVol->getPoint(4);
  if(p1==0 || p2==0) return 0.;
  Double_t thick = p2->getZ()-p1->getZ();
  if(thick<0) return 0; // must be at list positive!
  return thick;
}

Bool_t HMdcGetContainers::getModTransGeantLayer(HGeomTransform& trans,
    Int_t sec,Int_t mod,Int_t lay) {
  // Plane of HMdcGeant hits is entrance plane of sensitive wires volume!
  if(isSimData()) {
//!!! For simulation data geometry is not corrected yet...
    HGeomCompositeVolume* fMod=getGeomCompositeVolume(mod);
    if(fMod == 0) return kFALSE;
    HGeomVolume* fVol=fMod->getComponent(lay);
    if(fVol == 0) return kFALSE;
    trans = fVol->getTransform();
  } else {
    getMdcLayerGeomPar();
    HMdcLayerGeomParLay& fLayerGeomParLay = (*fMdcLayerGeomPar)[sec][mod][lay];
    if(&fLayerGeomParLay == 0) return kFALSE;
    trans = fLayerGeomParLay.getLayerPos(); 
  }
  Double_t thick = getSensWireThick(mod,lay);
  if(thick<0.001) return kFALSE;
  HGeomVector tr(trans.getTransVector());
  tr.setZ(tr.getZ()-thick/2.);
  trans.setTransVector(tr);
  return kTRUE;
}

const HGeomTransform& HMdcGetContainers::getModTransLayer(Int_t sec, Int_t mod,
    Int_t lay, Bool_t init) {
  //return transformation layer<-->module calculated in HMdcLayerGeomPar data
  if(isSimData()) {
//!!! For simulation data geometry is not corrected yet...
    HGeomCompositeVolume* fMod=getGeomCompositeVolume(mod,init);
    if(fMod) {
      HGeomVolume* fVol=fMod->getComponent(lay);
      if(fVol) return fVol->getTransform();
    }
    return *((HGeomTransform*)NULL);
  } else {
    getMdcLayerGeomPar(init);
    HMdcLayerGeomParLay& fLayerGeomParLay = (*fMdcLayerGeomPar)[sec][mod][lay];
    if(&fLayerGeomParLay == 0) return *((HGeomTransform*)NULL);
    return fLayerGeomParLay.getLayerPos();
  }
}

Bool_t HMdcGetContainers::getLabTransLayer(HGeomTransform& trans, 
    Int_t sec,Int_t mod, Int_t lay, Bool_t init) {
  //return transformation layer<-->lab. (do shift of the transfomation
  // vector along Z to real position of the sens. wires plane).
  const HGeomTransform& fLabMod=getLabTransMod(sec,mod,init);
  if( !&fLabMod ) return kFALSE; 
  const HGeomTransform& layTrans = getModTransLayer(sec,mod,lay,init);
  if(&layTrans == 0) return kFALSE;
  trans = layTrans;
  trans.transFrom(fLabMod);
  return kTRUE;
}

Bool_t HMdcGetContainers::getLabTransGeantLayer(HGeomTransform& trans, 
    Int_t sec,Int_t mod, Int_t lay) {
  // Plane of HMdcGeant hits is entrance plane of sensitive wires volume!
  // return transformation geant_hits_plane<-->lab.
  const HGeomTransform& fLabMod=getLabTransMod(sec,mod);
  if( !&fLabMod ) return kFALSE;
  if( !getModTransGeantLayer(trans,sec,mod,lay) ) return kFALSE;
  trans.transFrom(fLabMod);
  return kTRUE;
}

Bool_t HMdcGetContainers::getSecTransLayer(HGeomTransform& trans, 
    Int_t sec,Int_t mod, Int_t lay, Bool_t init) {
  //return transformation layer<-->sector (do shift of the transfomation
  // vector along Z to real position of the sens. wires plane).
  const HGeomTransform& fSec=getLabTransSec(sec,init);
  if( !&fSec ) return kFALSE;
  if( !getLabTransLayer(trans,sec,mod,lay,init) )return kFALSE;
  trans.transTo(fSec); 
  return kTRUE;
}

Bool_t HMdcGetContainers::getSecTransGeantLayer(HGeomTransform& trans, 
    Int_t sec,Int_t mod, Int_t lay) {
  // Plane of HMdcGeant hits is entrance plane of sensitive wires volume!
  // return transformation geant_hits_plane<-->sector
  const HGeomTransform& fSec=getLabTransSec(sec);
  if( !&fSec ) return kFALSE;
  if( !getLabTransGeantLayer(trans,sec,mod,lay) )return kFALSE;
  trans.transTo(fSec); 
  return kTRUE;
}

Bool_t HMdcGetContainers::getSecTransCathLayer(HGeomTransform& trans1, 
    HGeomTransform& trans2, Int_t sec,Int_t mod, Int_t lay, Bool_t init) {
  // return transformations of two cathode layers<-->sector 
  // (do shift of the transfomation vector along Z to real position of 
  // the sens. wires plane).
  const HGeomTransform& fSec=getLabTransSec(sec,init);
  if( !&fSec ) return kFALSE;
  const HGeomTransform& fLabMod=getLabTransMod(sec,mod,init);
  if( !&fLabMod ) return kFALSE;
  HMdcLayerGeomPar* fLayerGeomPar = getMdcLayerGeomPar(init);
  if(!fLayerGeomPar) return kFALSE;
  HMdcLayerGeomParLay& fLayerGeomParLay = (*fLayerGeomPar)[sec][mod][lay];
  if(!&fLayerGeomParLay) return kFALSE;
  Double_t halfCatDist       = fLayerGeomParLay.getCatDist()*0.5;
  const HGeomTransform& tr = getModTransLayer(sec,mod,lay,init);
  if(&tr == 0) return kFALSE;
  trans1=tr;
  trans2=tr;
  HGeomVector trVec1(tr.getTransVector());
  HGeomVector trVec2(trVec1);
  trVec1.setZ(trVec1.getZ() - halfCatDist);
  trVec2.setZ(trVec2.getZ() + halfCatDist);
  trans1.setTransVector(trVec1);
  trans2.setTransVector(trVec2);
  
  trans1.transFrom(fLabMod);
  trans2.transFrom(fLabMod);
  
  trans1.transTo(fSec);
  trans2.transTo(fSec);
  return kTRUE;
}

//------Categories:-------------------------

HCategory* HMdcGetContainers::getCatMdcCal1(void) {
  if(pMdcCal1Cat) return pMdcCal1Cat;
  if(gHades) pMdcCal1Cat = gHades->getCurrentEvent()->getCategory(catMdcCal1);
  return pMdcCal1Cat;
}
  
HCategory* HMdcGetContainers::getCatGeantKine(void) {
  if(pGeantKineCat) return pGeantKineCat;
  if(gHades) pGeantKineCat=gHades->getCurrentEvent()->getCategory(catGeantKine);
  return pGeantKineCat;
}

HCategory* HMdcGetContainers::getCatGeantMdc(void) {
  if(pGeantMdcCat) return pGeantMdcCat;
  if(gHades) pGeantMdcCat=gHades->getCurrentEvent()->getCategory(catMdcGeantRaw);
  return pGeantMdcCat;
}

HCategory* HMdcGetContainers::getCatMdcClus(Bool_t create) {
  if(pMdcClusCat) return pMdcClusCat;
  if(gHades==0) return 0;
  pMdcClusCat = gHades->getCurrentEvent()->getCategory(catMdcClus);
  if(!pMdcClusCat && create) {
    Int_t sizes[3]={6,2,8000};   // sec, seg, clust.(maximum 500 clusters in seg)
    if(isGeant()) pMdcClusCat = new HMatrixCategory("HMdcClusSim",3,sizes,0.25);
    else          pMdcClusCat = new HMatrixCategory("HMdcClus",3,sizes,0.25);
    gHades->getCurrentEvent()->addCategory(catMdcClus,pMdcClusCat,"Mdc");
  }
  return pMdcClusCat;
}

HCategory* HMdcGetContainers::getCatMdcTrkCand(Bool_t create) {
  if(pMdcTrkCandCat) return pMdcTrkCandCat;
  if(gHades==0) return 0; 
  pMdcTrkCandCat = gHades->getCurrentEvent()->getCategory(catMdcTrkCand);
  if(!pMdcTrkCandCat && create) {
    if(getMdcDetector() == 0) return 0;
    pMdcTrkCandCat = fMdcDetector->buildCategory(catMdcTrkCand);
    if (!pMdcTrkCandCat) return 0;
    gHades->getCurrentEvent()->addCategory(catMdcTrkCand,pMdcTrkCandCat,"Mdc");
  }
  return pMdcTrkCandCat;
}

HCategory* HMdcGetContainers::getCatMdcClusFit(Bool_t create) {
  if(pMdcClusFitCat) return pMdcClusFitCat;
  if(gHades==0) return 0; 
  pMdcClusFitCat = gHades->getCurrentEvent()->getCategory(catMdcClusFit);
  if(!pMdcClusFitCat && create) {  
    if(isGeant()) pMdcClusFitCat = new HLinearCategory("HMdcClusFitSim",15000);  
    else          pMdcClusFitCat = new HLinearCategory("HMdcClusFit",15000);
    gHades->getCurrentEvent()->addCategory(catMdcClusFit,pMdcClusFitCat,"Mdc");
  }
  return pMdcClusFitCat;
}

HCategory* HMdcGetContainers::getCatMdcWireFit(Bool_t create) {
  if(pMdcWireFitCat) return pMdcWireFitCat;
  if(gHades==0) return 0; 
  pMdcWireFitCat = gHades->getCurrentEvent()->getCategory(catMdcWireFit);
  if(!pMdcWireFitCat && create) {
    if(isGeant()) pMdcWireFitCat = new HLinearCategory("HMdcWireFitSim",200000);  
    else          pMdcWireFitCat = new HLinearCategory("HMdcWireFit",   200000);
    gHades->getCurrentEvent()->addCategory(catMdcWireFit,pMdcWireFitCat,"Mdc");
  }
  return pMdcWireFitCat;
}

HCategory* HMdcGetContainers::getCatMdcClusInf(Bool_t create) {
  if(pMdcClusInfCat) return pMdcClusInfCat;
  if(gHades==0) return 0; 
  pMdcClusInfCat = gHades->getCurrentEvent()->getCategory(catMdcClusInf);
  if(!pMdcClusInfCat && create) {    
    if(isGeant()) pMdcClusInfCat = new HLinearCategory("HMdcClusInfSim",15000);
    else          pMdcClusInfCat = new HLinearCategory("HMdcClusInf",15000);
    gHades->getCurrentEvent()->addCategory(catMdcClusInf,pMdcClusInfCat,"Mdc");
  }
  return pMdcClusInfCat;
}

void HMdcGetContainers::getFileName(TString& fileName) {
  // Return file name without dir.name and extension (.hld, .root, ...)
  getFileNameWInd(fileName);
  Int_t ind = fileName.Last('.');
  if(ind >= 0) fileName.Remove(ind);
}

void HMdcGetContainers::getFileNameWInd(TString& fileName) {
  // Return file name without dir.name
  if(gHades==0) {
    fileName = "";
    return; 
  }
  fileName  = gHades->getRuntimeDb()->getCurrentFileName();
  Int_t ind = fileName.Last('/');
  if(ind >= 0) fileName.Remove(0,ind+1);
}

void HMdcGetContainers::getRunId(TString& runId) {
  // Return runId
  runId = "";
  if(gHades) {
    HEventHeader* evHeader = gHades->getCurrentEvent()->getHeader();
    if(evHeader) runId += evHeader->getEventRunNumber();
  }
}

void HMdcGetContainers::getEventDate(TString& eventDate) {
  // Return current event date
  eventDate = "";
  if(gHades) {
    HEventHeader* evHeader = gHades->getCurrentEvent()->getHeader();
    if(evHeader) {
      UInt_t date = evHeader->getDate();
      UChar_t* dt = (UChar_t*)&date;
      eventDate.Form("%02i-%02i-%4i",dt[0],dt[1]+1,1900+dt[2]);
    }
  }
}

void HMdcGetContainers::getEventTime(TString& eventTime) {
  // Return current event time
  eventTime = "";
  if(gHades) {
    HEventHeader* evHeader = gHades->getCurrentEvent()->getHeader();
    if(evHeader) {
      UInt_t time = evHeader->getTime();
      UChar_t* tm = (UChar_t*)&time;
      eventTime.Form("%02i:%02i:%02i",tm[2],tm[1],tm[0]);
    }
  }
}

Bool_t HMdcGetContainers::isSimData(void) {
  if(isSimulation>=0) return isSimulation > 0; // ==2 ???embedding
  if(gHades != NULL && gHades->getEmbeddingMode()>0) {
    isSimulation = 2;
    return kTRUE;
  }
  if(isRtdb) {
    HMdcSetup* setup = (HMdcSetup*)rtdb->getContainer("MdcSetup");
    if(setup != NULL) {
      HMdcCommonSetup* mdcCommonSetup = setup->getMdcCommonSet();
      if(mdcCommonSetup != NULL) {
        isSimulation = mdcCommonSetup->getIsSimulation();
        return isSimulation > 0;  // ==2 ???embedding
      }
    }
  }

  isSimulation = 0;
  if(getCatMdcCal1()) {
    if(pMdcCal1Cat->getClass()==HMdcCal1Sim::Class()) isSimulation = 1;
  } else if(getCatMdcClus()) {
    if(pMdcClusCat->getClass()==HMdcClusSim::Class()) isSimulation = 1;
  } else {
    HEvent*&   event  = gHades->getCurrentEvent();
    HCategory* catHit = event->getCategory(catMdcHit);
    if(catHit!=NULL) {
      if(catHit->getClass()==HMdcHitSim::Class())     isSimulation = 1;
    } else {
      HCategory* catSeg=event->getCategory(catMdcSeg);
      if(catSeg!=NULL) {
        if(catSeg->getClass()==HMdcSegSim::Class())   isSimulation = 1;
      }
    }
  }

  return isSimulation > 0;  
}

void HMdcGetContainers::initMdcSetup(void) {
  for(Int_t s=0;s<6;s++) {
    numMods[s] = 0;
    for(Int_t m=0;m<4;m++) {
      if(getMdcDetector() != NULL) modSetup[s][m] = HMdcTrackDSet::isModActive(s,m) && getMdcDetector()->getModule(s,m)!=0;
      else                         modSetup[s][m] = HMdcTrackDSet::isModActive(s,m);
      if(modSetup[s][m]) numMods[s]++;
    }
    segSetup[s][0] = modSetup[s][0] || modSetup[s][1];
    segSetup[s][1] = modSetup[s][2] || modSetup[s][3];
  }
  isMdcSetupInited = kTRUE;
}

void HMdcGetContainers::setModList(const Int_t (*modList)[4]) {
  for(Int_t s=0;s<6;s++) {
    numMods[s] = 0;
    for(Int_t m=0;m<4;m++) {
      modSetup[s][m] = modList[s][m];
      if(modSetup[s][m]) numMods[s]++;
    }
    segSetup[s][0] = modSetup[s][0] || modSetup[s][1];
    segSetup[s][1] = modSetup[s][2] || modSetup[s][3];
  }
  isMdcSetupInited = kTRUE;
}

Bool_t HMdcGetContainers::isModActive(UInt_t sec,UInt_t mod) {
  if( !isMdcSetupInited ) initMdcSetup();
  return sec<6 && mod<4 ? modSetup[sec][mod] : kFALSE;
}

Bool_t HMdcGetContainers::isSegActive(UInt_t sec,UInt_t seg) {
  if( !isMdcSetupInited ) initMdcSetup();
  return sec<6 && seg<2 ?  segSetup[sec][seg] : kFALSE;
}

Bool_t HMdcGetContainers::isSecActive(UInt_t sec) {
  if( !isMdcSetupInited ) initMdcSetup();
  return sec<6&&numMods[sec]>0 ?  kTRUE : kFALSE;
}

Short_t HMdcGetContainers::getNumModulesInSec(UInt_t sec) {
  if( !isMdcSetupInited ) initMdcSetup();
  return sec<6 ? numMods[sec]:0;
}
 hmdcgetcontainers.cc:1
 hmdcgetcontainers.cc:2
 hmdcgetcontainers.cc:3
 hmdcgetcontainers.cc:4
 hmdcgetcontainers.cc:5
 hmdcgetcontainers.cc:6
 hmdcgetcontainers.cc:7
 hmdcgetcontainers.cc:8
 hmdcgetcontainers.cc:9
 hmdcgetcontainers.cc:10
 hmdcgetcontainers.cc:11
 hmdcgetcontainers.cc:12
 hmdcgetcontainers.cc:13
 hmdcgetcontainers.cc:14
 hmdcgetcontainers.cc:15
 hmdcgetcontainers.cc:16
 hmdcgetcontainers.cc:17
 hmdcgetcontainers.cc:18
 hmdcgetcontainers.cc:19
 hmdcgetcontainers.cc:20
 hmdcgetcontainers.cc:21
 hmdcgetcontainers.cc:22
 hmdcgetcontainers.cc:23
 hmdcgetcontainers.cc:24
 hmdcgetcontainers.cc:25
 hmdcgetcontainers.cc:26
 hmdcgetcontainers.cc:27
 hmdcgetcontainers.cc:28
 hmdcgetcontainers.cc:29
 hmdcgetcontainers.cc:30
 hmdcgetcontainers.cc:31
 hmdcgetcontainers.cc:32
 hmdcgetcontainers.cc:33
 hmdcgetcontainers.cc:34
 hmdcgetcontainers.cc:35
 hmdcgetcontainers.cc:36
 hmdcgetcontainers.cc:37
 hmdcgetcontainers.cc:38
 hmdcgetcontainers.cc:39
 hmdcgetcontainers.cc:40
 hmdcgetcontainers.cc:41
 hmdcgetcontainers.cc:42
 hmdcgetcontainers.cc:43
 hmdcgetcontainers.cc:44
 hmdcgetcontainers.cc:45
 hmdcgetcontainers.cc:46
 hmdcgetcontainers.cc:47
 hmdcgetcontainers.cc:48
 hmdcgetcontainers.cc:49
 hmdcgetcontainers.cc:50
 hmdcgetcontainers.cc:51
 hmdcgetcontainers.cc:52
 hmdcgetcontainers.cc:53
 hmdcgetcontainers.cc:54
 hmdcgetcontainers.cc:55
 hmdcgetcontainers.cc:56
 hmdcgetcontainers.cc:57
 hmdcgetcontainers.cc:58
 hmdcgetcontainers.cc:59
 hmdcgetcontainers.cc:60
 hmdcgetcontainers.cc:61
 hmdcgetcontainers.cc:62
 hmdcgetcontainers.cc:63
 hmdcgetcontainers.cc:64
 hmdcgetcontainers.cc:65
 hmdcgetcontainers.cc:66
 hmdcgetcontainers.cc:67
 hmdcgetcontainers.cc:68
 hmdcgetcontainers.cc:69
 hmdcgetcontainers.cc:70
 hmdcgetcontainers.cc:71
 hmdcgetcontainers.cc:72
 hmdcgetcontainers.cc:73
 hmdcgetcontainers.cc:74
 hmdcgetcontainers.cc:75
 hmdcgetcontainers.cc:76
 hmdcgetcontainers.cc:77
 hmdcgetcontainers.cc:78
 hmdcgetcontainers.cc:79
 hmdcgetcontainers.cc:80
 hmdcgetcontainers.cc:81
 hmdcgetcontainers.cc:82
 hmdcgetcontainers.cc:83
 hmdcgetcontainers.cc:84
 hmdcgetcontainers.cc:85
 hmdcgetcontainers.cc:86
 hmdcgetcontainers.cc:87
 hmdcgetcontainers.cc:88
 hmdcgetcontainers.cc:89
 hmdcgetcontainers.cc:90
 hmdcgetcontainers.cc:91
 hmdcgetcontainers.cc:92
 hmdcgetcontainers.cc:93
 hmdcgetcontainers.cc:94
 hmdcgetcontainers.cc:95
 hmdcgetcontainers.cc:96
 hmdcgetcontainers.cc:97
 hmdcgetcontainers.cc:98
 hmdcgetcontainers.cc:99
 hmdcgetcontainers.cc:100
 hmdcgetcontainers.cc:101
 hmdcgetcontainers.cc:102
 hmdcgetcontainers.cc:103
 hmdcgetcontainers.cc:104
 hmdcgetcontainers.cc:105
 hmdcgetcontainers.cc:106
 hmdcgetcontainers.cc:107
 hmdcgetcontainers.cc:108
 hmdcgetcontainers.cc:109
 hmdcgetcontainers.cc:110
 hmdcgetcontainers.cc:111
 hmdcgetcontainers.cc:112
 hmdcgetcontainers.cc:113
 hmdcgetcontainers.cc:114
 hmdcgetcontainers.cc:115
 hmdcgetcontainers.cc:116
 hmdcgetcontainers.cc:117
 hmdcgetcontainers.cc:118
 hmdcgetcontainers.cc:119
 hmdcgetcontainers.cc:120
 hmdcgetcontainers.cc:121
 hmdcgetcontainers.cc:122
 hmdcgetcontainers.cc:123
 hmdcgetcontainers.cc:124
 hmdcgetcontainers.cc:125
 hmdcgetcontainers.cc:126
 hmdcgetcontainers.cc:127
 hmdcgetcontainers.cc:128
 hmdcgetcontainers.cc:129
 hmdcgetcontainers.cc:130
 hmdcgetcontainers.cc:131
 hmdcgetcontainers.cc:132
 hmdcgetcontainers.cc:133
 hmdcgetcontainers.cc:134
 hmdcgetcontainers.cc:135
 hmdcgetcontainers.cc:136
 hmdcgetcontainers.cc:137
 hmdcgetcontainers.cc:138
 hmdcgetcontainers.cc:139
 hmdcgetcontainers.cc:140
 hmdcgetcontainers.cc:141
 hmdcgetcontainers.cc:142
 hmdcgetcontainers.cc:143
 hmdcgetcontainers.cc:144
 hmdcgetcontainers.cc:145
 hmdcgetcontainers.cc:146
 hmdcgetcontainers.cc:147
 hmdcgetcontainers.cc:148
 hmdcgetcontainers.cc:149
 hmdcgetcontainers.cc:150
 hmdcgetcontainers.cc:151
 hmdcgetcontainers.cc:152
 hmdcgetcontainers.cc:153
 hmdcgetcontainers.cc:154
 hmdcgetcontainers.cc:155
 hmdcgetcontainers.cc:156
 hmdcgetcontainers.cc:157
 hmdcgetcontainers.cc:158
 hmdcgetcontainers.cc:159
 hmdcgetcontainers.cc:160
 hmdcgetcontainers.cc:161
 hmdcgetcontainers.cc:162
 hmdcgetcontainers.cc:163
 hmdcgetcontainers.cc:164
 hmdcgetcontainers.cc:165
 hmdcgetcontainers.cc:166
 hmdcgetcontainers.cc:167
 hmdcgetcontainers.cc:168
 hmdcgetcontainers.cc:169
 hmdcgetcontainers.cc:170
 hmdcgetcontainers.cc:171
 hmdcgetcontainers.cc:172
 hmdcgetcontainers.cc:173
 hmdcgetcontainers.cc:174
 hmdcgetcontainers.cc:175
 hmdcgetcontainers.cc:176
 hmdcgetcontainers.cc:177
 hmdcgetcontainers.cc:178
 hmdcgetcontainers.cc:179
 hmdcgetcontainers.cc:180
 hmdcgetcontainers.cc:181
 hmdcgetcontainers.cc:182
 hmdcgetcontainers.cc:183
 hmdcgetcontainers.cc:184
 hmdcgetcontainers.cc:185
 hmdcgetcontainers.cc:186
 hmdcgetcontainers.cc:187
 hmdcgetcontainers.cc:188
 hmdcgetcontainers.cc:189
 hmdcgetcontainers.cc:190
 hmdcgetcontainers.cc:191
 hmdcgetcontainers.cc:192
 hmdcgetcontainers.cc:193
 hmdcgetcontainers.cc:194
 hmdcgetcontainers.cc:195
 hmdcgetcontainers.cc:196
 hmdcgetcontainers.cc:197
 hmdcgetcontainers.cc:198
 hmdcgetcontainers.cc:199
 hmdcgetcontainers.cc:200
 hmdcgetcontainers.cc:201
 hmdcgetcontainers.cc:202
 hmdcgetcontainers.cc:203
 hmdcgetcontainers.cc:204
 hmdcgetcontainers.cc:205
 hmdcgetcontainers.cc:206
 hmdcgetcontainers.cc:207
 hmdcgetcontainers.cc:208
 hmdcgetcontainers.cc:209
 hmdcgetcontainers.cc:210
 hmdcgetcontainers.cc:211
 hmdcgetcontainers.cc:212
 hmdcgetcontainers.cc:213
 hmdcgetcontainers.cc:214
 hmdcgetcontainers.cc:215
 hmdcgetcontainers.cc:216
 hmdcgetcontainers.cc:217
 hmdcgetcontainers.cc:218
 hmdcgetcontainers.cc:219
 hmdcgetcontainers.cc:220
 hmdcgetcontainers.cc:221
 hmdcgetcontainers.cc:222
 hmdcgetcontainers.cc:223
 hmdcgetcontainers.cc:224
 hmdcgetcontainers.cc:225
 hmdcgetcontainers.cc:226
 hmdcgetcontainers.cc:227
 hmdcgetcontainers.cc:228
 hmdcgetcontainers.cc:229
 hmdcgetcontainers.cc:230
 hmdcgetcontainers.cc:231
 hmdcgetcontainers.cc:232
 hmdcgetcontainers.cc:233
 hmdcgetcontainers.cc:234
 hmdcgetcontainers.cc:235
 hmdcgetcontainers.cc:236
 hmdcgetcontainers.cc:237
 hmdcgetcontainers.cc:238
 hmdcgetcontainers.cc:239
 hmdcgetcontainers.cc:240
 hmdcgetcontainers.cc:241
 hmdcgetcontainers.cc:242
 hmdcgetcontainers.cc:243
 hmdcgetcontainers.cc:244
 hmdcgetcontainers.cc:245
 hmdcgetcontainers.cc:246
 hmdcgetcontainers.cc:247
 hmdcgetcontainers.cc:248
 hmdcgetcontainers.cc:249
 hmdcgetcontainers.cc:250
 hmdcgetcontainers.cc:251
 hmdcgetcontainers.cc:252
 hmdcgetcontainers.cc:253
 hmdcgetcontainers.cc:254
 hmdcgetcontainers.cc:255
 hmdcgetcontainers.cc:256
 hmdcgetcontainers.cc:257
 hmdcgetcontainers.cc:258
 hmdcgetcontainers.cc:259
 hmdcgetcontainers.cc:260
 hmdcgetcontainers.cc:261
 hmdcgetcontainers.cc:262
 hmdcgetcontainers.cc:263
 hmdcgetcontainers.cc:264
 hmdcgetcontainers.cc:265
 hmdcgetcontainers.cc:266
 hmdcgetcontainers.cc:267
 hmdcgetcontainers.cc:268
 hmdcgetcontainers.cc:269
 hmdcgetcontainers.cc:270
 hmdcgetcontainers.cc:271
 hmdcgetcontainers.cc:272
 hmdcgetcontainers.cc:273
 hmdcgetcontainers.cc:274
 hmdcgetcontainers.cc:275
 hmdcgetcontainers.cc:276
 hmdcgetcontainers.cc:277
 hmdcgetcontainers.cc:278
 hmdcgetcontainers.cc:279
 hmdcgetcontainers.cc:280
 hmdcgetcontainers.cc:281
 hmdcgetcontainers.cc:282
 hmdcgetcontainers.cc:283
 hmdcgetcontainers.cc:284
 hmdcgetcontainers.cc:285
 hmdcgetcontainers.cc:286
 hmdcgetcontainers.cc:287
 hmdcgetcontainers.cc:288
 hmdcgetcontainers.cc:289
 hmdcgetcontainers.cc:290
 hmdcgetcontainers.cc:291
 hmdcgetcontainers.cc:292
 hmdcgetcontainers.cc:293
 hmdcgetcontainers.cc:294
 hmdcgetcontainers.cc:295
 hmdcgetcontainers.cc:296
 hmdcgetcontainers.cc:297
 hmdcgetcontainers.cc:298
 hmdcgetcontainers.cc:299
 hmdcgetcontainers.cc:300
 hmdcgetcontainers.cc:301
 hmdcgetcontainers.cc:302
 hmdcgetcontainers.cc:303
 hmdcgetcontainers.cc:304
 hmdcgetcontainers.cc:305
 hmdcgetcontainers.cc:306
 hmdcgetcontainers.cc:307
 hmdcgetcontainers.cc:308
 hmdcgetcontainers.cc:309
 hmdcgetcontainers.cc:310
 hmdcgetcontainers.cc:311
 hmdcgetcontainers.cc:312
 hmdcgetcontainers.cc:313
 hmdcgetcontainers.cc:314
 hmdcgetcontainers.cc:315
 hmdcgetcontainers.cc:316
 hmdcgetcontainers.cc:317
 hmdcgetcontainers.cc:318
 hmdcgetcontainers.cc:319
 hmdcgetcontainers.cc:320
 hmdcgetcontainers.cc:321
 hmdcgetcontainers.cc:322
 hmdcgetcontainers.cc:323
 hmdcgetcontainers.cc:324
 hmdcgetcontainers.cc:325
 hmdcgetcontainers.cc:326
 hmdcgetcontainers.cc:327
 hmdcgetcontainers.cc:328
 hmdcgetcontainers.cc:329
 hmdcgetcontainers.cc:330
 hmdcgetcontainers.cc:331
 hmdcgetcontainers.cc:332
 hmdcgetcontainers.cc:333
 hmdcgetcontainers.cc:334
 hmdcgetcontainers.cc:335
 hmdcgetcontainers.cc:336
 hmdcgetcontainers.cc:337
 hmdcgetcontainers.cc:338
 hmdcgetcontainers.cc:339
 hmdcgetcontainers.cc:340
 hmdcgetcontainers.cc:341
 hmdcgetcontainers.cc:342
 hmdcgetcontainers.cc:343
 hmdcgetcontainers.cc:344
 hmdcgetcontainers.cc:345
 hmdcgetcontainers.cc:346
 hmdcgetcontainers.cc:347
 hmdcgetcontainers.cc:348
 hmdcgetcontainers.cc:349
 hmdcgetcontainers.cc:350
 hmdcgetcontainers.cc:351
 hmdcgetcontainers.cc:352
 hmdcgetcontainers.cc:353
 hmdcgetcontainers.cc:354
 hmdcgetcontainers.cc:355
 hmdcgetcontainers.cc:356
 hmdcgetcontainers.cc:357
 hmdcgetcontainers.cc:358
 hmdcgetcontainers.cc:359
 hmdcgetcontainers.cc:360
 hmdcgetcontainers.cc:361
 hmdcgetcontainers.cc:362
 hmdcgetcontainers.cc:363
 hmdcgetcontainers.cc:364
 hmdcgetcontainers.cc:365
 hmdcgetcontainers.cc:366
 hmdcgetcontainers.cc:367
 hmdcgetcontainers.cc:368
 hmdcgetcontainers.cc:369
 hmdcgetcontainers.cc:370
 hmdcgetcontainers.cc:371
 hmdcgetcontainers.cc:372
 hmdcgetcontainers.cc:373
 hmdcgetcontainers.cc:374
 hmdcgetcontainers.cc:375
 hmdcgetcontainers.cc:376
 hmdcgetcontainers.cc:377
 hmdcgetcontainers.cc:378
 hmdcgetcontainers.cc:379
 hmdcgetcontainers.cc:380
 hmdcgetcontainers.cc:381
 hmdcgetcontainers.cc:382
 hmdcgetcontainers.cc:383
 hmdcgetcontainers.cc:384
 hmdcgetcontainers.cc:385
 hmdcgetcontainers.cc:386
 hmdcgetcontainers.cc:387
 hmdcgetcontainers.cc:388
 hmdcgetcontainers.cc:389
 hmdcgetcontainers.cc:390
 hmdcgetcontainers.cc:391
 hmdcgetcontainers.cc:392
 hmdcgetcontainers.cc:393
 hmdcgetcontainers.cc:394
 hmdcgetcontainers.cc:395
 hmdcgetcontainers.cc:396
 hmdcgetcontainers.cc:397
 hmdcgetcontainers.cc:398
 hmdcgetcontainers.cc:399
 hmdcgetcontainers.cc:400
 hmdcgetcontainers.cc:401
 hmdcgetcontainers.cc:402
 hmdcgetcontainers.cc:403
 hmdcgetcontainers.cc:404
 hmdcgetcontainers.cc:405
 hmdcgetcontainers.cc:406
 hmdcgetcontainers.cc:407
 hmdcgetcontainers.cc:408
 hmdcgetcontainers.cc:409
 hmdcgetcontainers.cc:410
 hmdcgetcontainers.cc:411
 hmdcgetcontainers.cc:412
 hmdcgetcontainers.cc:413
 hmdcgetcontainers.cc:414
 hmdcgetcontainers.cc:415
 hmdcgetcontainers.cc:416
 hmdcgetcontainers.cc:417
 hmdcgetcontainers.cc:418
 hmdcgetcontainers.cc:419
 hmdcgetcontainers.cc:420
 hmdcgetcontainers.cc:421
 hmdcgetcontainers.cc:422
 hmdcgetcontainers.cc:423
 hmdcgetcontainers.cc:424
 hmdcgetcontainers.cc:425
 hmdcgetcontainers.cc:426
 hmdcgetcontainers.cc:427
 hmdcgetcontainers.cc:428
 hmdcgetcontainers.cc:429
 hmdcgetcontainers.cc:430
 hmdcgetcontainers.cc:431
 hmdcgetcontainers.cc:432
 hmdcgetcontainers.cc:433
 hmdcgetcontainers.cc:434
 hmdcgetcontainers.cc:435
 hmdcgetcontainers.cc:436
 hmdcgetcontainers.cc:437
 hmdcgetcontainers.cc:438
 hmdcgetcontainers.cc:439
 hmdcgetcontainers.cc:440
 hmdcgetcontainers.cc:441
 hmdcgetcontainers.cc:442
 hmdcgetcontainers.cc:443
 hmdcgetcontainers.cc:444
 hmdcgetcontainers.cc:445
 hmdcgetcontainers.cc:446
 hmdcgetcontainers.cc:447
 hmdcgetcontainers.cc:448
 hmdcgetcontainers.cc:449
 hmdcgetcontainers.cc:450
 hmdcgetcontainers.cc:451
 hmdcgetcontainers.cc:452
 hmdcgetcontainers.cc:453
 hmdcgetcontainers.cc:454
 hmdcgetcontainers.cc:455
 hmdcgetcontainers.cc:456
 hmdcgetcontainers.cc:457
 hmdcgetcontainers.cc:458
 hmdcgetcontainers.cc:459
 hmdcgetcontainers.cc:460
 hmdcgetcontainers.cc:461
 hmdcgetcontainers.cc:462
 hmdcgetcontainers.cc:463
 hmdcgetcontainers.cc:464
 hmdcgetcontainers.cc:465
 hmdcgetcontainers.cc:466
 hmdcgetcontainers.cc:467
 hmdcgetcontainers.cc:468
 hmdcgetcontainers.cc:469
 hmdcgetcontainers.cc:470
 hmdcgetcontainers.cc:471
 hmdcgetcontainers.cc:472
 hmdcgetcontainers.cc:473
 hmdcgetcontainers.cc:474
 hmdcgetcontainers.cc:475
 hmdcgetcontainers.cc:476
 hmdcgetcontainers.cc:477
 hmdcgetcontainers.cc:478
 hmdcgetcontainers.cc:479
 hmdcgetcontainers.cc:480
 hmdcgetcontainers.cc:481
 hmdcgetcontainers.cc:482
 hmdcgetcontainers.cc:483
 hmdcgetcontainers.cc:484
 hmdcgetcontainers.cc:485
 hmdcgetcontainers.cc:486
 hmdcgetcontainers.cc:487
 hmdcgetcontainers.cc:488
 hmdcgetcontainers.cc:489
 hmdcgetcontainers.cc:490
 hmdcgetcontainers.cc:491
 hmdcgetcontainers.cc:492
 hmdcgetcontainers.cc:493
 hmdcgetcontainers.cc:494
 hmdcgetcontainers.cc:495
 hmdcgetcontainers.cc:496
 hmdcgetcontainers.cc:497
 hmdcgetcontainers.cc:498
 hmdcgetcontainers.cc:499
 hmdcgetcontainers.cc:500
 hmdcgetcontainers.cc:501
 hmdcgetcontainers.cc:502
 hmdcgetcontainers.cc:503
 hmdcgetcontainers.cc:504
 hmdcgetcontainers.cc:505
 hmdcgetcontainers.cc:506
 hmdcgetcontainers.cc:507
 hmdcgetcontainers.cc:508
 hmdcgetcontainers.cc:509
 hmdcgetcontainers.cc:510
 hmdcgetcontainers.cc:511
 hmdcgetcontainers.cc:512
 hmdcgetcontainers.cc:513
 hmdcgetcontainers.cc:514
 hmdcgetcontainers.cc:515
 hmdcgetcontainers.cc:516
 hmdcgetcontainers.cc:517
 hmdcgetcontainers.cc:518
 hmdcgetcontainers.cc:519
 hmdcgetcontainers.cc:520
 hmdcgetcontainers.cc:521
 hmdcgetcontainers.cc:522
 hmdcgetcontainers.cc:523
 hmdcgetcontainers.cc:524
 hmdcgetcontainers.cc:525
 hmdcgetcontainers.cc:526
 hmdcgetcontainers.cc:527
 hmdcgetcontainers.cc:528
 hmdcgetcontainers.cc:529
 hmdcgetcontainers.cc:530
 hmdcgetcontainers.cc:531
 hmdcgetcontainers.cc:532
 hmdcgetcontainers.cc:533
 hmdcgetcontainers.cc:534
 hmdcgetcontainers.cc:535
 hmdcgetcontainers.cc:536
 hmdcgetcontainers.cc:537
 hmdcgetcontainers.cc:538
 hmdcgetcontainers.cc:539
 hmdcgetcontainers.cc:540
 hmdcgetcontainers.cc:541
 hmdcgetcontainers.cc:542
 hmdcgetcontainers.cc:543
 hmdcgetcontainers.cc:544
 hmdcgetcontainers.cc:545
 hmdcgetcontainers.cc:546
 hmdcgetcontainers.cc:547
 hmdcgetcontainers.cc:548
 hmdcgetcontainers.cc:549
 hmdcgetcontainers.cc:550
 hmdcgetcontainers.cc:551
 hmdcgetcontainers.cc:552
 hmdcgetcontainers.cc:553
 hmdcgetcontainers.cc:554
 hmdcgetcontainers.cc:555
 hmdcgetcontainers.cc:556
 hmdcgetcontainers.cc:557
 hmdcgetcontainers.cc:558
 hmdcgetcontainers.cc:559
 hmdcgetcontainers.cc:560
 hmdcgetcontainers.cc:561
 hmdcgetcontainers.cc:562
 hmdcgetcontainers.cc:563
 hmdcgetcontainers.cc:564
 hmdcgetcontainers.cc:565
 hmdcgetcontainers.cc:566
 hmdcgetcontainers.cc:567
 hmdcgetcontainers.cc:568
 hmdcgetcontainers.cc:569
 hmdcgetcontainers.cc:570
 hmdcgetcontainers.cc:571
 hmdcgetcontainers.cc:572
 hmdcgetcontainers.cc:573
 hmdcgetcontainers.cc:574
 hmdcgetcontainers.cc:575
 hmdcgetcontainers.cc:576
 hmdcgetcontainers.cc:577
 hmdcgetcontainers.cc:578
 hmdcgetcontainers.cc:579
 hmdcgetcontainers.cc:580
 hmdcgetcontainers.cc:581
 hmdcgetcontainers.cc:582
 hmdcgetcontainers.cc:583
 hmdcgetcontainers.cc:584
 hmdcgetcontainers.cc:585
 hmdcgetcontainers.cc:586
 hmdcgetcontainers.cc:587
 hmdcgetcontainers.cc:588
 hmdcgetcontainers.cc:589
 hmdcgetcontainers.cc:590
 hmdcgetcontainers.cc:591
 hmdcgetcontainers.cc:592
 hmdcgetcontainers.cc:593
 hmdcgetcontainers.cc:594
 hmdcgetcontainers.cc:595
 hmdcgetcontainers.cc:596
 hmdcgetcontainers.cc:597
 hmdcgetcontainers.cc:598
 hmdcgetcontainers.cc:599
 hmdcgetcontainers.cc:600
 hmdcgetcontainers.cc:601
 hmdcgetcontainers.cc:602
 hmdcgetcontainers.cc:603
 hmdcgetcontainers.cc:604
 hmdcgetcontainers.cc:605
 hmdcgetcontainers.cc:606
 hmdcgetcontainers.cc:607
 hmdcgetcontainers.cc:608
 hmdcgetcontainers.cc:609
 hmdcgetcontainers.cc:610
 hmdcgetcontainers.cc:611
 hmdcgetcontainers.cc:612
 hmdcgetcontainers.cc:613
 hmdcgetcontainers.cc:614
 hmdcgetcontainers.cc:615
 hmdcgetcontainers.cc:616
 hmdcgetcontainers.cc:617
 hmdcgetcontainers.cc:618
 hmdcgetcontainers.cc:619
 hmdcgetcontainers.cc:620
 hmdcgetcontainers.cc:621
 hmdcgetcontainers.cc:622
 hmdcgetcontainers.cc:623
 hmdcgetcontainers.cc:624
 hmdcgetcontainers.cc:625
 hmdcgetcontainers.cc:626
 hmdcgetcontainers.cc:627
 hmdcgetcontainers.cc:628
 hmdcgetcontainers.cc:629
 hmdcgetcontainers.cc:630
 hmdcgetcontainers.cc:631
 hmdcgetcontainers.cc:632