File indexing completed on 2024-04-06 12:29:43
0001
0002
0003
0004
0005
0006
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 }