CMS 3D CMS Logo

/data/git/CMSSW_5_3_11_patch5/src/SimDataFormats/SimHitMaker/src/CaloSlaveSD.cc

Go to the documentation of this file.
00001 
00002 // File: CaloSlaveSD.cc
00003 // Date: 10.02
00004 // Description: Persistent component of Sensitive Detector class for 
00005 //              calorimeters
00006 // Modifications: 
00008 
00009 #include "SimDataFormats/SimHitMaker/interface/CaloSlaveSD.h"
00010 
00011 #include <iostream>
00012 
00013 CaloSlaveSD::CaloSlaveSD(std::string n) : name_(n) {
00014 
00015   LogDebug("HitBuildInfo") << "CaloSlaveSD Called with name " << n << "\n";
00016 
00017 }
00018 
00019 CaloSlaveSD::~CaloSlaveSD() {}
00020 
00021 void CaloSlaveSD::Initialize() {
00022 
00023   LogDebug("HitBuildInfo") << " initialize CaloSlaveSD "<< name_ << "\n";
00024   hits_.clear();
00025 }
00026 
00027 bool CaloSlaveSD::format() {
00028 
00029   LogDebug("HitBuildInfo") << " CaloSlaveSD " << name_ << "formatting " 
00030                            << hits_.size() << " hits.";
00031   return true;
00032 }
00033 
00034 bool CaloSlaveSD::processHits(uint32_t unitID, double eDepEM, double eDepHad, 
00035                               double tSlice, int tkID, uint16_t depth) {
00036   
00037   PCaloHit aCal = PCaloHit (unitID, eDepEM, eDepHad, tSlice, tkID, depth);
00038   LogDebug("HitBuildInfo") <<" Sent Hit " << aCal << " to ROU " << name_;
00039   hits_.push_back(aCal);
00040   return true;
00041 } 
00042 
00043 void CaloSlaveSD::Clean() {
00044 
00045   LogDebug("HitBuildIndo") << "CaloSlaveSD " << name_ << " cleaning the collection";
00046   Collection().swap(hits_);
00047 
00048 }
00049 
00050 void CaloSlaveSD::ReserveMemory(unsigned int size) {
00051   
00052   if ( hits_.capacity() < size ) hits_.reserve(size);
00053 
00054 }