CMS 3D CMS Logo

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