18 CaloHitResponse(parameterMap, shapes), theSiPM(), theRecoveryTime(250.),
19 TIMEMULT(1), Y11RANGE(80.), Y11MAX(0.04), Y11TIMETORISE(16.65),
36 photonTimeMap::iterator channelPhotons;
41 channelPhotons->second));
44 const unsigned int size ( signal.
size() ) ;
46 for(
unsigned int i ( 0 ) ;
i !=
size ; ++
i ) {
47 keep = keep || signal[
i] > 1.e-7 ;
53 if (keep)
add(signal);
63 (*oldSignal) += signal;
73 unsigned int photons(signal + 0.5);
79 std::pair<DetId, photonTimeHist >(
id,
81 pars.readoutFrameSize(), 0)
86 LogDebug(
"HcalSiPMHitResponse") << id;
87 LogDebug(
"HcalSiPMHitResponse") <<
" fCtoGeV: " << pars.fCtoGeV(
id)
88 <<
" samplingFactor: " << pars.samplingFactor(
id)
89 <<
" photoelectronsToAnalog: " << pars.photoelectronsToAnalog(
id)
90 <<
" simHitToPhotoelectrons: " << pars.simHitToPhotoelectrons(
id);
92 <<
" photons: " << photons
96 LogDebug(
"HcalSiPMHitResponse") <<
" corrected time: " <<
time;
97 LogDebug(
"HcalSiPMHitResponse") <<
" timePhase: " << pars.timePhase()
99 <<
" binOfMaximum: " << pars.binOfMaximum()
105 tzero +=
BUNCHSPACE*pars.binOfMaximum() + 72.31;
106 LogDebug(
"HcalSiPMHitResponse") <<
" corrected tzero: " << tzero <<
'\n';
109 for (
unsigned int pe(0); pe<
photons; ++pe) {
112 LogDebug(
"HcalSiPMHitResponse") <<
"t_pe: " << t_pe <<
" t_pe + tzero: " << (t_pe+
tzero)
113 <<
" t_bin: " << t_bin <<
'\n';
122 typedef std::multiset <const PCaloHit *, PCaloHitCompareTimes>
SortedHitSet;
124 std::map< DetId, SortedHitSet > sortedhits;
126 hitItr != hits.
end(); ++hitItr) {
130 DetId id(hitItr->id());
131 if (sortedhits.find(
id)==sortedhits.end())
132 sortedhits.insert(std::pair<DetId, SortedHitSet>(
id, SortedHitSet()));
133 sortedhits[id].insert(&(*hitItr));
136 int pixelIntegral, oldIntegral;
138 for (std::map<DetId, SortedHitSet>::iterator
i = sortedhits.begin();
139 i!=sortedhits.end(); ++
i) {
141 for (SortedHitSet::iterator itr =
i->second.begin();
142 itr !=
i->second.end(); ++itr) {
145 oldIntegral = pixelIntegral;
184 int photons =
static_cast<int>(signal + 0.5);
187 signal = double(pixels);
198 double binTime =
tzero;
201 result[
bin] += (*shape)(binTime)*signal;
218 int sampleBin(0), preciseBin(0);
221 double hitPixels(0.), elapsedTime(0.);
222 unsigned int sumPE(0);
225 for (
unsigned int pt(0); pt < photons.size(); ++pt) {
232 signal[sampleBin] += hitPixels;
233 sumHits += hitPixels;
261 double diffNorm)
const {
280 return exp(-0.0635-0.1518*t)*
pow(t, 2.528)/2485.9;
virtual void initializeHits()
Initialize hits.
A general implementation for the response of a SiPM.
virtual bool keepBlank() const
Electronic response of the preamp.
std::multiset< PCaloHit, PCaloHitCompareTimes > SortedHitSet
static double Y11TimePDF(double t)
int preciseSize() const
get the size
Main class for Parameters in different subdetectors.
CLHEP::RandFlat * theRndFlat
virtual double delay(const PCaloHit &hit) const =0
double timePhase() const
the adjustment you need to apply to get the signal where you want it
int getIntegral(double time)
Creates electronics signals from hits.
virtual void differentiatePreciseSamples(CaloSamples &samples, double diffNorm=1.0) const
void setNCells(int nCells)
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
float preciseDeltaT() const
double generatePhotonTime() const
double analogSignalAmplitude(const DetId &id, float energy, const CaloSimParameters ¶meters) const
int readoutFrameSize() const
for now, the LinearFrames and trhe digis will be one-to-one.
const CaloVHitCorrection * theHitCorrection
Integral< F, X >::type integral(const F &f)
HcalTDCParameters theTDCParams
AnalogSignalMap theAnalogSignalMap
std::vector< unsigned int > photonTimeHist
virtual CaloSamples makeBlankSignal(const DetId &detId) const
float const Y11TIMETORISE
const CaloShapes * theShapes
virtual void setRandomEngine(CLHEP::HepRandomEngine &engine)
const CaloVSimParameterMap * theParameterMap
int size() const
get the size
HcalSiPMHitResponse(const CaloVSimParameterMap *parameterMap, const CaloShapes *shapes)
CaloSamples * findSignal(const DetId &detId)
users can look for the signal for a given cell
float & preciseAtMod(int i)
mutable function to access precise samples
virtual int hitCells(unsigned int photons, unsigned int integral=0) const
virtual void run(MixCollection< PCaloHit > &hits)
Complete cell digitization.
virtual void finalizeHits()
Finalize hits.
static const double tzero[3]
virtual void add(const PCaloHit &hit)
process a single SimHit
const CaloVHitFilter * theHitFilter
virtual void setRandomEngine(CLHEP::HepRandomEngine &engine)
DetId id() const
get the (generic) id
photonTimeMap precisionTimedPhotons
void addToHistory(double time, int pixels)
tuple size
Write out results.
Power< A, B >::type pow(const A &a, const B &b)
virtual const CaloVShape * shape(const DetId &detId) const
virtual ~HcalSiPMHitResponse()
virtual CaloSamples makeSiPMSignal(const DetId &id, const PCaloHit &hit, int &integral) const