Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 23:31:14

0001 ///////////////////////////////////////////////////////////////////////////////
0002 // File: CaloSlaveSD.cc
0003 // Date: 10.02
0004 // Description: Persistent component of Sensitive Detector class for
0005 //              calorimeters
0006 // Modifications:
0007 ///////////////////////////////////////////////////////////////////////////////
0008 
0009 #include "SimDataFormats/SimHitMaker/interface/CaloSlaveSD.h"
0010 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0011 
0012 #include <iostream>
0013 
0014 CaloSlaveSD::CaloSlaveSD(std::string n) : name_(n) {
0015   LogDebug("HitBuildInfo") << "CaloSlaveSD Called with name " << n << "\n";
0016 }
0017 
0018 CaloSlaveSD::~CaloSlaveSD() {}
0019 
0020 void CaloSlaveSD::Initialize() {
0021   LogDebug("HitBuildInfo") << " initialize CaloSlaveSD " << name_ << "\n";
0022   hits_.clear();
0023 }
0024 
0025 bool CaloSlaveSD::format() {
0026   LogDebug("HitBuildInfo") << " CaloSlaveSD " << name_ << "formatting " << hits_.size() << " hits.";
0027   return true;
0028 }
0029 
0030 bool CaloSlaveSD::processHits(uint32_t unitID, double eDepEM, double eDepHad, double tSlice, int tkID, uint16_t depth) {
0031   PCaloHit aCal = PCaloHit(unitID, eDepEM, eDepHad, tSlice, tkID, depth);
0032   LogDebug("HitBuildInfo") << " Sent Hit " << aCal << " to ROU " << name_;
0033   hits_.push_back(aCal);
0034   return true;
0035 }
0036 
0037 void CaloSlaveSD::Clean() {
0038   LogDebug("HitBuildIndo") << "CaloSlaveSD " << name_ << " cleaning the collection";
0039   Collection().swap(hits_);
0040 }
0041 
0042 void CaloSlaveSD::ReserveMemory(unsigned int size) {
0043   if (hits_.capacity() < size)
0044     hits_.reserve(size);
0045 }