CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 
11 
12 #include <iostream>
13 
15  LogDebug("HitBuildInfo") << "CaloSlaveSD Called with name " << n << "\n";
16 }
17 
19 
21  LogDebug("HitBuildInfo") << " initialize CaloSlaveSD " << name_ << "\n";
22  hits_.clear();
23 }
24 
26  LogDebug("HitBuildInfo") << " CaloSlaveSD " << name_ << "formatting " << hits_.size() << " hits.";
27  return true;
28 }
29 
30 bool CaloSlaveSD::processHits(uint32_t unitID, double eDepEM, double eDepHad, double tSlice, int tkID, uint16_t depth) {
31  PCaloHit aCal = PCaloHit(unitID, eDepEM, eDepHad, tSlice, tkID, depth);
32  LogDebug("HitBuildInfo") << " Sent Hit " << aCal << " to ROU " << name_;
33  hits_.push_back(aCal);
34  return true;
35 }
36 
38  LogDebug("HitBuildIndo") << "CaloSlaveSD " << name_ << " cleaning the collection";
39  Collection().swap(hits_);
40 }
41 
42 void CaloSlaveSD::ReserveMemory(unsigned int size) {
43  if (hits_.capacity() < size)
44  hits_.reserve(size);
45 }
virtual bool processHits(uint32_t, double, double, double, int, uint16_t depth=0)
Definition: CaloSlaveSD.cc:30
virtual void Initialize()
Definition: CaloSlaveSD.cc:20
virtual ~CaloSlaveSD()
Definition: CaloSlaveSD.cc:18
virtual void Clean()
Definition: CaloSlaveSD.cc:37
virtual void ReserveMemory(unsigned int size)
Definition: CaloSlaveSD.cc:42
Collection hits_
Definition: CaloSlaveSD.h:35
CaloSlaveSD(std::string)
Definition: CaloSlaveSD.cc:14
std::string name_
Definition: CaloSlaveSD.h:38
virtual bool format()
Definition: CaloSlaveSD.cc:25
tuple size
Write out results.
std::vector< PCaloHit > Collection
Definition: CaloSlaveSD.h:17
#define LogDebug(id)