25 std::cout <<
"ChargeDividerFP420.h: constructor" << std::endl;
26 std::cout <<
"peakMode = " << peakMode <<
"fluctuateCharge= "<< fluctuateCharge <<
"chargedivisionsPerHit = " << chargedivisionsPerHit <<
"deltaCut= "<< deltaCut << std::endl;
41 chargedivisionsPerHit=10;
64 zStationBegPos[0] = -40. + z420;
65 zStationBegPos[1] = zStationBegPos[0]+zD2;
66 zStationBegPos[2] = zStationBegPos[0]+zD3;
67 zStationBegPos[3] = zStationBegPos[0]+2*zD3;
76 delete theFP420NumberingScheme;
97 std::cout <<
" CDividerFP420::ChargeDividerFP420:divide: direction= " << direction << std::endl;
98 std::cout <<
" CDividerFP420::ChargeDividerFP420:divide: direction.mag = " << direction.
mag() << std::endl;
100 std::cout <<
" pitchcur= " << pitchcur << std::endl;
101 std::cout <<
" peakMode = " << peakMode <<
" decoMode = " << decoMode <<
" fluctuateCharge= "<< fluctuateCharge <<
" chargedivisionsPerHit = " << chargedivisionsPerHit <<
" deltaCut= "<< deltaCut << std::endl;
104 int NumberOfSegmentation =
109 (int)(1+chargedivisionsPerHit*direction.
mag()/pitchcur);
113 std::cout <<
"NumberOfSegmentation= " << NumberOfSegmentation << std::endl;
120 std::cout <<
"CDividerFP420::ChargeDividerFP420:divide: eLoss= " << eLoss << std::endl;
126 float decSignal = TimeResponse(hit);
128 std::cout <<
"CDividerFP420::ChargeDividerFP420:divide: decSignal= " << decSignal << std::endl;
133 _ionization_points.resize(NumberOfSegmentation);
138 float* eLossVector =
new float[NumberOfSegmentation];
142 std::cout <<
"CDividerFP420::ChargeDividerFP420:divide: resize done; then, fluctuateCharge ? = " << fluctuateCharge << std::endl;
144 if( fluctuateCharge ) {
148 float momentum = hit.
pabs();
149 float length = direction.
mag();
152 std::cout <<
"pid= " << pid <<
"momentum= " << momentum <<
"eLoss= " << eLoss <<
"length= " << length << std::endl;
154 fluctuateEloss(pid, momentum, eLoss, length, NumberOfSegmentation, eLossVector);
157 for (
int i = 0;
i != NumberOfSegmentation; ++
i) {
158 if( fluctuateCharge ) {
159 energy=eLossVector[
i]*decSignal/eLoss;
162 _ionization_points[
i] = edu;
164 energy=decSignal/float(NumberOfSegmentation);
167 _ionization_points[
i] = edu;
172 std::cout <<
"CDividerFP420::ChargeDividerFP420:divide: !!! RESULT !!!" << std::endl;
173 std::cout <<
" _ionization_points size = " << _ionization_points.size() << std::endl;
174 for(
unsigned int i = 0;
i < _ionization_points.size(); ++
i ) {
175 std::cout <<
" eLossVector[i] i = " <<
i << eLossVector[
i] << std::endl;
179 delete[] eLossVector;
180 return _ionization_points;
184 float eloss,
float length,
185 int NumberOfSegs,
float elossVector[]) {
188 std::cout <<
"fluctuateEloss: eloss= " << eloss <<
"length= " << length <<
"NumberOfSegs= " << NumberOfSegs << std::endl;
192 double particleMass = 938.271;
197 if(pid==11) particleMass = 0.511;
198 else if(pid==13) particleMass = 105.658;
199 else if(pid==211) particleMass = 139.570;
202 float segmentLength = length/NumberOfSegs;
207 double segmentEloss = (1000.*eloss)/NumberOfSegs;
209 std::cout <<
"segmentLength= " << segmentLength <<
"segmentEloss= " << segmentEloss << std::endl;
212 for (
int i=0;
i<NumberOfSegs;++
i) {
217 double deltaCutoff = deltaCut;
218 de = fluctuate.SampleFluctuations(
double(particleMomentum*1000.),
219 particleMass, deltaCutoff,
220 double(segmentLength),
221 segmentEloss )/1000.;
227 std::cout <<
"sum= " << sum << std::endl;
231 float ratio = eloss/sum;
232 for (
int ii=0;ii<NumberOfSegs;++ii) elossVector[ii]= ratio*elossVector[ii];
234 float averageEloss = eloss/NumberOfSegs;
235 for (
int ii=0;ii<NumberOfSegs;++ii) elossVector[ii]= averageEloss;
244 std::cout <<
"ChargeDividerFP420:TimeResponse: call of PeakShape" << std::endl;
246 return this->PeakShape( hit );
247 }
else if (decoMode) {
250 std::cout <<
"ChargeDividerFP420:TimeResponse: call of DeconvolutionShape" << std::endl;
252 return this->DeconvolutionShape( hit );
256 std::cout <<
"ChargeDividerFP420:TimeResponse: no any Shape" << std::endl;
273 float zEntry = 1000.;
278 int det, zside, sector, zmodule;
284 float RRR =
sqrt(xEntry*xEntry + yEntry*yEntry + zEntry*zEntry);
285 float costheta = zEntry / RRR ;
291 float dist = (zStationBegPos[sector-1] - 420000.) / costheta;
296 std::cout <<
"sector=" << sector << std::endl;
297 std::cout <<
"zmodule=" << zmodule << std::endl;
298 std::cout <<
"zStationBegPos[sector-1]=" << zStationBegPos[sector-1] << std::endl;
300 std::cout <<
"costheta=" << costheta << std::endl;
301 std::cout <<
"unitID=" << unitID << std::endl;
304 std::cout <<
"dist found =" << dist << std::endl;
309 float SigmaShape = 52.17;
311 float tofNorm = (hit.
tof() - t0)/SigmaShape;
313 float readTimeNorm = -tofNorm;
317 std::cout <<
"ChargeDividerFP420:PeakShape::dist=" << dist << std::endl;
320 std::cout <<
"tofNorm=" << tofNorm << std::endl;
321 std::cout <<
"1 + readTimeNorm=" << 1 + readTimeNorm << std::endl;
323 std::cout <<
"(1 + readTimeNorm)*exp(-readTimeNorm)=" << (1 + readTimeNorm)*
exp(-readTimeNorm) << std::endl;
326 if (1 + readTimeNorm > 0) {
328 return hit.
energyLoss()*(1 + readTimeNorm)*
exp(-readTimeNorm);
344 float zEntry = 1000.;
349 int det, zside, sector, zmodule;
355 float RRR =
sqrt(xEntry*xEntry + yEntry*yEntry + zEntry*zEntry);
356 float costheta = zEntry / RRR ;
362 float dist = (zStationBegPos[sector-1] - 420000.) / costheta;
367 std::cout <<
"sector=" << sector << std::endl;
368 std::cout <<
"zmodule=" << zmodule << std::endl;
369 std::cout <<
"zStationBegPos[sector-1]=" << zStationBegPos[sector-1] << std::endl;
371 std::cout <<
"costheta=" << costheta << std::endl;
372 std::cout <<
"unitID=" << unitID << std::endl;
375 std::cout <<
"dist found =" << dist << std::endl;
379 float SigmaShape = 12.;
383 float tofNorm = (hit.
tof() - t0)/SigmaShape;
385 float readTimeNorm = -tofNorm;
390 std::cout <<
"ChargeDividerFP420:DeconvolutionShape::dist=" << dist << std::endl;
393 std::cout <<
"tofNorm=" << tofNorm << std::endl;
395 std::cout <<
"exp(-0.5*readTimeNorm*readTimeNorm)=" <<
exp(-0.5*readTimeNorm*readTimeNorm) << std::endl;
float tof() const
deprecated name for timeOfFlight()
ChargeDividerFP420(double pit, double az420, double azD2, double azD3, int)
static void unpackFP420Index(const unsigned int &idx, int &det, int &zside, int &station, int &superplane)
std::vector< EnergySegmentFP420 > ionization_type
Local3DPoint exitPoint() const
Exit point in the local Det frame.
float DeconvolutionShape(const PSimHit &)
CDividerFP420::ionization_type divide(const PSimHit &, const double &)
float pabs() const
fast and more accurate access to momentumAtEntry().mag()
void fluctuateEloss(int particleId, float momentum, float eloss, float length, int NumberOfSegmentation, float elossVector[])
virtual ~ChargeDividerFP420()
float TimeResponse(const PSimHit &)
float PeakShape(const PSimHit &)
float energyLoss() const
The energy deposit in the PSimHit, in ???.
Local3DPoint entryPoint() const
Entry point in the local Det frame.
unsigned int detUnitId() const