00001 #ifndef SimDataFormats_PCaloHit_H
00002 #define SimDataFormats_PCaloHit_H
00003
00004 #include "SimDataFormats/EncodedEventId/interface/EncodedEventId.h"
00005
00006
00007
00008 class PCaloHit {
00009
00010 public:
00011
00012 PCaloHit(float e = 0., float t = 0., int i = 0, float emFraction = 1.,
00013 uint16_t d = 0) : myEnergy(e), myEMFraction(emFraction), myTime(t),
00014 myItra(i), myDepth(d) { }
00015
00016 PCaloHit(unsigned int id, float e = 0., float t = 0., int i = 0,
00017 float emFraction = 1., uint16_t d = 0) : myEnergy (e),
00018 myEMFraction(emFraction), myTime (t), myItra (i), detId(id), myDepth(d) { }
00019 PCaloHit(float eEM, float eHad, float t, int i = 0, uint16_t d = 0);
00020 PCaloHit(unsigned int id, float eEM, float eHad, float t, int i = 0,
00021 uint16_t d = 0);
00022
00023
00024 static const char *name() { return "Hit"; }
00025
00026 const char * getName() const { return name (); }
00027
00028
00029 double energy() const { return myEnergy; }
00030 double energyEM() const { return myEMFraction*myEnergy; }
00031 double energyHad() const { return (1.-myEMFraction)*myEnergy; }
00032
00033
00034 double time() const { return myTime; }
00035
00036
00037 int geantTrackId() const { return myItra; }
00038
00039
00040 unsigned int id() const { return detId; }
00041
00042
00043
00044
00045 uint16_t depth() const { return myDepth; }
00046
00047
00048
00049 void setEventId(EncodedEventId e) { theEventId = e; }
00050
00051 EncodedEventId eventId() const {return theEventId;}
00052
00053
00054
00055
00056 bool operator<(const PCaloHit &d) const { return myEnergy < d.myEnergy; }
00057
00058
00059 bool operator==(const PCaloHit &d) const
00060 { return (myEnergy == d.myEnergy && detId == d.detId); }
00061
00062
00063 protected:
00064 float myEnergy;
00065 float myEMFraction;
00066 float myTime;
00067 int myItra;
00068 unsigned int detId;
00069 uint16_t myDepth;
00070 EncodedEventId theEventId;
00071 };
00072
00073 #include<iosfwd>
00074 std::ostream &operator<<(std::ostream &, const PCaloHit &);
00075
00076 #endif // _SimDataFormats_SimCaloHit_PCaloHit_h_