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 (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 56 of file HcalDigitizer.cc.

References python.multivaluedict::sort().

Referenced by HcalDigitizer::updateGeometry().

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

Definition at line 41 of file HcalDigitizer.cc.

Referenced by HcalDigitizer::HcalDigitizer().

42  {
43  std::vector<DetId> siPMDetIds;
44  siPMDetIds.reserve(siPMCells.size());
45  for(std::vector<int>::const_iterator idItr = siPMCells.begin();
46  idItr != siPMCells.end(); ++idItr)
47  {
48  siPMDetIds.push_back(DetId(*idItr));
49  }
50  siPMDigitizer->setDetIds(siPMDetIds);
51  }
Definition: DetId.h:20