27 CaloHitResponse(parameterMap, shapes), theSiPM(0), theRecoveryTime(250.) {
38 typedef std::multiset <const PCaloHit *, PCaloHitCompareTimes> SortedHitSet;
40 std::map< DetId, SortedHitSet > sortedhits;
42 hitItr != hits.
end(); ++hitItr) {
44 !(
isnan(hitItr->time())) &&
47 if (sortedhits.find(
id)==sortedhits.end())
48 sortedhits.insert(std::pair<DetId, SortedHitSet>(
id, SortedHitSet()));
49 sortedhits[
id].insert(&(*hitItr));
52 int pixelIntegral, oldIntegral;
55 for (std::map<DetId, SortedHitSet>::iterator
i = sortedhits.begin();
56 i!=sortedhits.end(); ++
i) {
58 for (SortedHitSet::iterator itr =
i->second.begin();
59 itr !=
i->second.end(); ++itr) {
62 oldIntegral = pixelIntegral;
89 int photons =
static_cast<int>(signal + 0.5);
92 signal = double(pixels);
101 const double tzero = pars.timePhase() - jitter -
103 double binTime =
tzero;
106 result[
bin] += (*shape)(binTime)*signal;
A general implementation for the response of a SiPM.
CaloSamples makeBlankSignal(const DetId &detId) const
creates an empty signal for this DetId
bool operator()(const PCaloHit *a, const PCaloHit *b) const
Electronic response of the preamp.
virtual CaloSamples makeSiPMSignal(const PCaloHit &inHit, int &integral) const
int getIntegral(double time)
Creates electronics signals from hits.
virtual void correct(PCaloHit &hit) const =0
void setNCells(int nCells)
virtual void add(const PCaloHit &hit)
process a single SimHit
virtual const CaloSimParameters & simParameters(const DetId &id) const =0
virtual bool accepts(const PCaloHit &hit) const =0
void initRandomEngine(CLHEP::HepRandomEngine &engine)
double timeOfFlight(const DetId &detId) const
const CaloVHitCorrection * theHitCorrection
Integral< F, X >::type integral(const F &f)
double analogSignalAmplitude(const PCaloHit &hit, const CaloSimParameters ¶meters) const
const CaloShapes * theShapes
virtual int hitCells(int photons, int integral=0) const
virtual void setRandomEngine(CLHEP::HepRandomEngine &engine)
const CaloVSimParameterMap * theParameterMap
int size() const
get the size
HcalSiPMHitResponse(const CaloVSimParameterMap *parameterMap, const CaloShapes *shapes)
virtual void run(MixCollection< PCaloHit > &hits)
Complete cell digitization.
static const double tzero[3]
const CaloVHitFilter * theHitFilter
virtual void setRandomEngine(CLHEP::HepRandomEngine &engine)
void addToHistory(double time, int pixels)
virtual const CaloVShape * shape(const DetId &detId) const
virtual ~HcalSiPMHitResponse()