CMS 3D CMS Logo

Functions

HcalDigitizerImpl Namespace Reference

Functions

template<typename HPDDIGITIZER , typename SIPMDIGITIZER >
void fillCells (const vector< DetId > &allCells, HPDDIGITIZER *hpdDigitizer, SIPMDIGITIZER *siPMDigitizer)
template<typename SIPMDIGITIZER >
void fillSiPMCells (const vector< int > &siPMCells, SIPMDIGITIZER *siPMDigitizer)

Function Documentation

template<typename HPDDIGITIZER , typename SIPMDIGITIZER >
void HcalDigitizerImpl::fillCells ( const vector< DetId > &  allCells,
HPDDIGITIZER *  hpdDigitizer,
SIPMDIGITIZER *  siPMDigitizer 
)

Definition at line 55 of file HcalDigitizer.cc.

References python::multivaluedict::sort().

Referenced by HcalDigitizer::updateGeometry().

  {
    // if both digitizers exist, split up the cells
    if(siPMDigitizer && hpdDigitizer)
    {
      std::vector<DetId> siPMDetIds = siPMDigitizer->detIds();
      std::sort(siPMDetIds.begin(), siPMDetIds.end());
      std::vector<DetId> sortedCells = allCells;
      std::sort(sortedCells.begin(), sortedCells.end());
      std::vector<DetId> hpdCells;
      std::set_difference(sortedCells.begin(), sortedCells.end(),
                          siPMDetIds.begin(), siPMDetIds.end(),
                          std::back_inserter(hpdCells) );
      hpdDigitizer->setDetIds(hpdCells);
    }
    else
    {
      if(siPMDigitizer) siPMDigitizer->setDetIds(allCells);
      if(hpdDigitizer) hpdDigitizer->setDetIds(allCells);
    }
  }
template<typename SIPMDIGITIZER >
void HcalDigitizerImpl::fillSiPMCells ( const vector< int > &  siPMCells,
SIPMDIGITIZER *  siPMDigitizer 
)

Definition at line 40 of file HcalDigitizer.cc.

Referenced by HcalDigitizer::HcalDigitizer().

  {
    std::vector<DetId> siPMDetIds;
    siPMDetIds.reserve(siPMCells.size());
    for(std::vector<int>::const_iterator idItr = siPMCells.begin();
        idItr != siPMCells.end(); ++idItr)
    {
      siPMDetIds.push_back(DetId(*idItr));
    }
    siPMDigitizer->setDetIds(siPMDetIds);
  }