StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StEEmcShowerShape.cxx
1 //
2 // Pibero Djawotho <pibero@indiana.edu>
3 // Indiana University
4 // Jan 26, 2008
5 //
6 #include <assert.h>
7 // C++ STL
8 #include "Stiostream.h"
9 #include <cassert>
10 
11 // STAR
12 #include "StMuDSTMaker/COMMON/StMuEmcUtil.h"
13 
14 // Local
15 #include "StEEmcShowerShape.h"
16 
17 ostream& operator<<(ostream& out, StMuEmcHit& hit)
18 {
19  static StMuEmcUtil util;
20  int module, eta, sub;
21  assert(util.getEndcapBin(7, hit.getId(), module, eta, sub) == 0);
22  out << "sector = " << module-1 << ", strip = " << eta-1
23  << ", adc = " << hit.getAdc() << ", E = " << hit.getEnergy();
24  return out;
25 }
26 
27 ostream& operator<<(ostream& out, const StEEmcShowerShape& shape)
28 {
29  out << "run = " << shape.runNumber()
30  << ", event = " << shape.eventNumber()
31  << ", energy = " << shape.energy()
32  << ", sector = " << shape.sector()
33  << '\n';
34  out << "U-plane: nStrips = " << shape.numberOfUstrips() << '\n'
35  << "high strip id: " << shape.highUstripId() << '\n';
36  for (int i = 0; i < shape.numberOfUstrips(); ++i) {
37  StMuEmcHit* hit = shape.uStrip(i);
38  out << *hit << '\n';
39  }
40  out << "V-plane: nStrips = " << shape.numberOfVstrips() << '\n'
41  << "high strip id: " << shape.highVstripId() << '\n';
42  for (int i = 0; i < shape.numberOfVstrips(); ++i) {
43  StMuEmcHit* hit = shape.vStrip(i);
44  out << *hit << '\n';
45  }
46  return out;
47 }
48 
49 ClassImp(StEEmcShowerShape);
50 
51 StEEmcShowerShape::StEEmcShowerShape()
52 {
53  mUstrips = new TClonesArray("StMuEmcHit");
54  mVstrips = new TClonesArray("StMuEmcHit");
55 }
56 
57 StEEmcShowerShape::StEEmcShowerShape(const StEEmcShowerShape& shape)
58 {
59  if (this == &shape) return;
60 
61  setRunNumber(shape.runNumber());
62  setEventNumber(shape.eventNumber());
63  setEnergy(shape.energy());
64  setSector(shape.sector());
65  setHighUstripId(shape.highUstripId());
66  setHighVstripId(shape.highVstripId());
67  setPosition(shape.position());
68 
69  mUstrips = new TClonesArray("StMuEmcHit");
70  mVstrips = new TClonesArray("StMuEmcHit");
71 
72  for (int i = 0; i < shape.numberOfUstrips(); ++i) addUstrip(shape.uStrip(i));
73  for (int i = 0; i < shape.numberOfVstrips(); ++i) addVstrip(shape.vStrip(i));
74 }
75 
76 StEEmcShowerShape::~StEEmcShowerShape()
77 {
78  delete mUstrips;
79  delete mVstrips;
80 }
int getId() const
Return Module number.
Definition: StMuEmcHit.h:18
float getEnergy() const
Return Hit energy.
Definition: StMuEmcHit.h:21
int getAdc() const
Return ADC value.
Definition: StMuEmcHit.h:19