test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions
HcalDigitizerImpl Namespace Reference

Functions

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

Function Documentation

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

Definition at line 61 of file HcalDigitizer.cc.

Referenced by HcalDigitizer::updateGeometry().

64  {
65  // if both digitizers exist, split up the cells
66  if(siPMDigitizer && hpdDigitizer)
67  {
68  std::vector<DetId> siPMDetIds = siPMDigitizer->detIds();
69  std::sort(siPMDetIds.begin(), siPMDetIds.end());
70  std::vector<DetId> sortedCells = allCells;
71  std::sort(sortedCells.begin(), sortedCells.end());
72  std::vector<DetId> hpdCells;
73  std::set_difference(sortedCells.begin(), sortedCells.end(),
74  siPMDetIds.begin(), siPMDetIds.end(),
75  std::back_inserter(hpdCells) );
76  hpdDigitizer->setDetIds(hpdCells);
77  }
78  else
79  {
80  if(siPMDigitizer) siPMDigitizer->setDetIds(allCells);
81  if(hpdDigitizer) hpdDigitizer->setDetIds(allCells);
82  }
83  }
template<typename SIPMDIGITIZER >
void HcalDigitizerImpl::fillSiPMCells ( std::vector< int > &  siPMCells,
SIPMDIGITIZER *  siPMDigitizer 
)

Definition at line 46 of file HcalDigitizer.cc.

Referenced by HcalDigitizer::HcalDigitizer().

47  {
48  std::vector<DetId> siPMDetIds;
49  siPMDetIds.reserve(siPMCells.size());
50  for(std::vector<int>::const_iterator idItr = siPMCells.begin();
51  idItr != siPMCells.end(); ++idItr)
52  {
53  siPMDetIds.emplace_back(*idItr);
54  }
55  siPMDigitizer->setDetIds(siPMDetIds);
56  }