00001
00002
00003
00004
00005
00006 #include <assert.h>
00007
00008 #include <iostream>
00009 #include <cassert>
00010
00011
00012 #include "StMuDSTMaker/COMMON/StMuEmcUtil.h"
00013
00014
00015 #include "StEEmcShowerShape.h"
00016
00017 ostream& operator<<(ostream& out, StMuEmcHit& hit)
00018 {
00019 static StMuEmcUtil util;
00020 int module, eta, sub;
00021 assert(util.getEndcapBin(7, hit.getId(), module, eta, sub) == 0);
00022 out << "sector = " << module-1 << ", strip = " << eta-1
00023 << ", adc = " << hit.getAdc() << ", E = " << hit.getEnergy();
00024 return out;
00025 }
00026
00027 ostream& operator<<(ostream& out, const StEEmcShowerShape& shape)
00028 {
00029 out << "run = " << shape.runNumber()
00030 << ", event = " << shape.eventNumber()
00031 << ", energy = " << shape.energy()
00032 << ", sector = " << shape.sector()
00033 << '\n';
00034 out << "U-plane: nStrips = " << shape.numberOfUstrips() << '\n'
00035 << "high strip id: " << shape.highUstripId() << '\n';
00036 for (int i = 0; i < shape.numberOfUstrips(); ++i) {
00037 StMuEmcHit* hit = shape.uStrip(i);
00038 out << *hit << '\n';
00039 }
00040 out << "V-plane: nStrips = " << shape.numberOfVstrips() << '\n'
00041 << "high strip id: " << shape.highVstripId() << '\n';
00042 for (int i = 0; i < shape.numberOfVstrips(); ++i) {
00043 StMuEmcHit* hit = shape.vStrip(i);
00044 out << *hit << '\n';
00045 }
00046 return out;
00047 }
00048
00049 ClassImp(StEEmcShowerShape);
00050
00051 StEEmcShowerShape::StEEmcShowerShape()
00052 {
00053 mUstrips = new TClonesArray("StMuEmcHit");
00054 mVstrips = new TClonesArray("StMuEmcHit");
00055 }
00056
00057 StEEmcShowerShape::StEEmcShowerShape(const StEEmcShowerShape& shape)
00058 {
00059 if (this == &shape) return;
00060
00061 setRunNumber(shape.runNumber());
00062 setEventNumber(shape.eventNumber());
00063 setEnergy(shape.energy());
00064 setSector(shape.sector());
00065 setHighUstripId(shape.highUstripId());
00066 setHighVstripId(shape.highVstripId());
00067 setPosition(shape.position());
00068
00069 mUstrips = new TClonesArray("StMuEmcHit");
00070 mVstrips = new TClonesArray("StMuEmcHit");
00071
00072 for (int i = 0; i < shape.numberOfUstrips(); ++i) addUstrip(shape.uStrip(i));
00073 for (int i = 0; i < shape.numberOfVstrips(); ++i) addVstrip(shape.vStrip(i));
00074 }
00075
00076 StEEmcShowerShape::~StEEmcShowerShape()
00077 {
00078 delete mUstrips;
00079 delete mVstrips;
00080 }