All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
RealisticCaloRecoScinPpd.cc
Go to the documentation of this file.
2 #include <cmath>
3 #include <iostream>
4 
6 
7 RealisticCaloRecoScinPpd::RealisticCaloRecoScinPpd() : RealisticCaloReco::Processor("RealisticCaloRecoScinPpd") {
8 
9  _description = "Performs fist reconstruction of scintillator calo hits";
10 
11  registerProcessorParameter("ppd_mipPe" ,
12  "# Photo-electrons per MIP (scintillator): used to poisson smear #PEs if >0" ,
14  (float)10.);
15 
16  registerProcessorParameter("ppd_npix" ,
17  "total number of MPPC/SiPM pixels for implementation of saturation effect" ,
19  (int)10000);
20 }
21 
22 float RealisticCaloRecoScinPpd::reconstructEnergy(const CalorimeterHit* hit) {
23  // here the input energy should be in NPE
24  float energy = hit->getEnergy();
25 
26  // first de-saturate PPD response
27  // this is the fraction of SiPM pixels fired above which a linear continuation of the saturation-reconstruction function is used.
28  // 0.95 of nPixel corresponds to a energy correction of factor ~3.
29  const float r = 0.95;
30  if (energy < r*_PPD_n_pixels){ //current hit below linearisation threshold, reconstruct energy normally:
31  energy = -_PPD_n_pixels * std::log ( 1. - ( energy / _PPD_n_pixels ) );
32  } else { //current hit is aove linearisation threshold, reconstruct using linear continuation function:
33  energy = 1/(1-r)*(energy-r*_PPD_n_pixels)-_PPD_n_pixels*std::log(1-r);
34  }
35  // then go back to MIP scale
36  energy/=_PPD_pe_per_mip;
37 
38  // what layer is this hit in?
39  int layer = (*_idDecoder) (hit)[_cellIDLayerString];
40  // now correct for sampling fraction (calibration from MIP -> shower GeV)
41  energy *= getLayerCalib( layer );
42 
43  return energy;
44 }
45 
46 
float getLayerCalib(int ilayer)
std::string _cellIDLayerString
RealisticCaloRecoScinPpd aRealisticCaloRecoScinPpd
virtual float reconstructEnergy(const CalorimeterHit *hit)