BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
RecEmcHit.cxx
Go to the documentation of this file.
1//
2// Bes EMC Rec Hit
3//
4// Created by Wang.Zhe 2003, 10, 1
5//
6#include <iostream>
7
8#include "EmcRecEventModel/RecEmcHit.h"
9#include "EmcRecGeoSvc/IEmcRecGeoSvc.h"
10#include "GaudiKernel/Bootstrap.h"
11#include "GaudiKernel/ISvcLocator.h"
12
13// Constructors and destructors
15 fCellId.clear();
16 fEnergy = -1;
17 fTime = -1;
18}
19
26
28 // Nothing to do
29}
30
31// Copy and assignment
32// RecEmcHit::RecEmcHit(const RecEmcHit& aHit)
33// :ContainedObject(aHit)
34//{
35// fCellId=aHit.CellId();
36// fEnergy=aHit.Energy();
37// fTime=aHit.Time();
38// }
39//
40// RecEmcHit& RecEmcHit::operator=(const RecEmcHit& aHit)
41//{
42// if(this!=&aHit)
43// {
44// ContainedObject::operator=(aHit);
45// fCellId=aHit.CellId();
46// fEnergy=aHit.Energy();
47// fTime=aHit.Time();
48// }
49// return *this;
50// }
51
52// Other methods
54 IEmcRecGeoSvc* iGeoSvc;
55 ISvcLocator* svcLocator = Gaudi::svcLocator();
56 StatusCode sc = svcLocator->service( "EmcRecGeoSvc", iGeoSvc );
57 if ( sc != StatusCode::SUCCESS ) { cout << "Error: Can't get EmcRecGeoSvc" << endl; }
58
59 return iGeoSvc->GetCCenter( fCellId );
60}
61
63 IEmcRecGeoSvc* iGeoSvc;
64 ISvcLocator* svcLocator = Gaudi::svcLocator();
65 StatusCode sc = svcLocator->service( "EmcRecGeoSvc", iGeoSvc );
66 if ( sc != StatusCode::SUCCESS ) { cout << "Error: Can't get EmcRecGeoSvc" << endl; }
67
68 return iGeoSvc->GetCFrontCenter( fCellId );
69}
70
75
80
82 fTime = Time;
83 return fTime;
84}
85
87 const RecEmcTime& Time ) {
90 fTime = Time;
91}
92
93void RecEmcHit::Dump() const {
94 cout << "Hit: ";
95
96 cout << fCellId << ", ";
97
98 cout.width( 12 );
99 cout.setf( ios::right );
100 cout << fEnergy << ", ";
101
102 cout.width( 12 );
103 cout.setf( ios::right );
104 cout << fTime << endl;
105}
106
107ostream& operator<<( ostream& os, const RecEmcHit& aHit ) {
108 os << "Hit: ";
109
110 os << aHit.getCellId() << ", ";
111
112 os.width( 12 );
113 os.setf( ios::right );
114 os << aHit.getEnergy() << ", ";
115
116 os.width( 12 );
117 os.setf( ios::right );
118 os << aHit.getTime() << endl;
119
120 return os;
121}
HepGeom::Point3D< double > HepPoint3D
ostream & operator<<(ostream &os, const RecEmcHit &aHit)
virtual HepPoint3D GetCFrontCenter(const Identifier &id) const =0
virtual HepPoint3D GetCCenter(const Identifier &id) const =0
void Assign(const RecEmcID &CellId, const RecEmcEnergy &Energy, const RecEmcTime &Time)
Definition RecEmcHit.cxx:86
RecEmcEnergy Energy(const RecEmcEnergy &Energy)
Definition RecEmcHit.cxx:76
HepPoint3D getFrontCenter() const
Definition RecEmcHit.cxx:62
RecEmcID CellId(const RecEmcID &CellId)
Definition RecEmcHit.cxx:71
void Dump() const
Definition RecEmcHit.cxx:93
RecEmcTime Time(const RecEmcTime &Time)
Definition RecEmcHit.cxx:81
HepPoint3D getCenter() const
Definition RecEmcHit.cxx:53