00001 #ifndef ecaltimingevent_hh
00002 #define ecaltimingevent_hh
00003
00004 #include <iostream>
00005 #include "DataFormats/EcalRecHit/interface/EcalRecHit.h"
00006 #include "DataFormats/EcalDetId/interface/EcalDetIdCollections.h"
00007
00008
00009
00010
00011
00012
00013 class EcalTimingEvent : public EcalRecHit
00014 {
00015 public:
00016
00017
00018 EcalTimingEvent(const EcalRecHit& rec): EcalRecHit(rec) {};
00019
00020
00021
00022
00023
00024
00025 friend std::ostream& operator << (std::ostream& os, const EcalTimingEvent& event)
00026 {
00027 if(event.detid().subdetId() == EcalBarrel) {
00028 EBDetId id(event.detid());
00029 os << id.ieta() << "\t" << id.iphi() << "\t" << id.zside() << "\t";
00030 } else {
00031 EEDetId id(event.detid());
00032 os << id.ix() << "\t" << id.iy() << "\t" << id.zside() << "\t";
00033 }
00034
00035 os << event.time() << "\t" << event.timeError() << "\t" << event.energy();
00036 return os;
00037 }
00038
00039 bool operator== (const EcalTimingEvent &first) const
00040 {
00041
00042 if (first.energy() == this->energy() &&
00043 first.time() == this->time() &&
00044 first.timeError() == this->timeError()) {
00045 return true;
00046 }
00047
00048 return false;
00049 }
00050
00051 };
00052
00053 #endif
00054