CMS 3D CMS Logo

CaloSlaveSD.cc
Go to the documentation of this file.
1 // File: CaloSlaveSD.cc
3 // Date: 10.02
4 // Description: Persistent component of Sensitive Detector class for
5 // calorimeters
6 // Modifications:
8 
10 
11 #include <iostream>
12 
14  LogDebug("HitBuildInfo") << "CaloSlaveSD Called with name " << n << "\n";
15 }
16 
18 
20  LogDebug("HitBuildInfo") << " initialize CaloSlaveSD " << name_ << "\n";
21  hits_.clear();
22 }
23 
25  LogDebug("HitBuildInfo") << " CaloSlaveSD " << name_ << "formatting " << hits_.size() << " hits.";
26  return true;
27 }
28 
29 bool CaloSlaveSD::processHits(uint32_t unitID, double eDepEM, double eDepHad, double tSlice, int tkID, uint16_t depth) {
30  PCaloHit aCal = PCaloHit(unitID, eDepEM, eDepHad, tSlice, tkID, depth);
31  LogDebug("HitBuildInfo") << " Sent Hit " << aCal << " to ROU " << name_;
32  hits_.push_back(aCal);
33  return true;
34 }
35 
37  LogDebug("HitBuildIndo") << "CaloSlaveSD " << name_ << " cleaning the collection";
38  Collection().swap(hits_);
39 }
40 
41 void CaloSlaveSD::ReserveMemory(unsigned int size) {
42  if (hits_.capacity() < size)
43  hits_.reserve(size);
44 }
#define LogDebug(id)
size
Write out results.
virtual bool processHits(uint32_t, double, double, double, int, uint16_t depth=0)
Definition: CaloSlaveSD.cc:29
virtual void Initialize()
Definition: CaloSlaveSD.cc:19
virtual ~CaloSlaveSD()
Definition: CaloSlaveSD.cc:17
virtual void Clean()
Definition: CaloSlaveSD.cc:36
virtual void ReserveMemory(unsigned int size)
Definition: CaloSlaveSD.cc:41
Collection hits_
Definition: CaloSlaveSD.h:36
CaloSlaveSD(std::string)
Definition: CaloSlaveSD.cc:13
std::string name_
Definition: CaloSlaveSD.h:39
virtual bool format()
Definition: CaloSlaveSD.cc:24
std::vector< PCaloHit > Collection
Definition: CaloSlaveSD.h:18