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[]) {
191 std::cout <<
"fluctuateEloss: eloss= " << eloss <<
"length= " << length <<
"NumberOfSegs= " << NumberOfSegs << std::endl;
193 if( length > 0.) dedx = eloss/length;
197 double particleMass = 938.271;
202 if(pid==11) particleMass = 0.511;
203 else if(pid==13) particleMass = 105.658;
204 else if(pid==211) particleMass = 139.570;
207 float segmentLength = length/NumberOfSegs;
212 double segmentEloss = (1000.*eloss)/NumberOfSegs;
214 std::cout <<
"segmentLength= " << segmentLength <<
"segmentEloss= " << segmentEloss << std::endl;
217 for (
int i=0;
i<NumberOfSegs;++
i) {
222 double deltaCutoff = deltaCut;
223 de = fluctuate.SampleFluctuations(
double(particleMomentum*1000.),
224 particleMass, deltaCutoff,
225 double(segmentLength),
226 segmentEloss )/1000.;
232 std::cout <<
"sum= " << sum << std::endl;
236 float ratio = eloss/sum;
237 for (
int ii=0;ii<NumberOfSegs;++ii) elossVector[ii]= ratio*elossVector[ii];
239 float averageEloss = eloss/NumberOfSegs;
240 for (
int ii=0;ii<NumberOfSegs;++ii) elossVector[ii]= averageEloss;
249 std::cout <<
"ChargeDividerFP420:TimeResponse: call of PeakShape" << std::endl;
251 return this->PeakShape( hit );
252 }
else if (decoMode) {
255 std::cout <<
"ChargeDividerFP420:TimeResponse: call of DeconvolutionShape" << std::endl;
257 return this->DeconvolutionShape( hit );
261 std::cout <<
"ChargeDividerFP420:TimeResponse: no any Shape" << std::endl;
278 float zEntry = 1000.;
283 int det, zside, sector, zmodule;
289 float RRR =
sqrt(xEntry*xEntry + yEntry*yEntry + zEntry*zEntry);
290 float costheta = zEntry / RRR ;
296 float dist = (zStationBegPos[sector-1] - 420000.) / costheta;
301 std::cout <<
"sector=" << sector << std::endl;
302 std::cout <<
"zmodule=" << zmodule << std::endl;
303 std::cout <<
"zStationBegPos[sector-1]=" << zStationBegPos[sector-1] << std::endl;
305 std::cout <<
"costheta=" << costheta << std::endl;
306 std::cout <<
"unitID=" << unitID << std::endl;
309 std::cout <<
"dist found =" << dist << std::endl;
314 float SigmaShape = 52.17;
316 float tofNorm = (hit.
tof() - t0)/SigmaShape;
318 float readTimeNorm = -tofNorm;
322 std::cout <<
"ChargeDividerFP420:PeakShape::dist=" << dist << std::endl;
325 std::cout <<
"tofNorm=" << tofNorm << std::endl;
326 std::cout <<
"1 + readTimeNorm=" << 1 + readTimeNorm << std::endl;
328 std::cout <<
"(1 + readTimeNorm)*exp(-readTimeNorm)=" << (1 + readTimeNorm)*
exp(-readTimeNorm) << std::endl;
331 if (1 + readTimeNorm > 0) {
333 return hit.
energyLoss()*(1 + readTimeNorm)*
exp(-readTimeNorm);
349 float zEntry = 1000.;
354 int det, zside, sector, zmodule;
360 float RRR =
sqrt(xEntry*xEntry + yEntry*yEntry + zEntry*zEntry);
361 float costheta = zEntry / RRR ;
367 float dist = (zStationBegPos[sector-1] - 420000.) / costheta;
372 std::cout <<
"sector=" << sector << std::endl;
373 std::cout <<
"zmodule=" << zmodule << std::endl;
374 std::cout <<
"zStationBegPos[sector-1]=" << zStationBegPos[sector-1] << std::endl;
376 std::cout <<
"costheta=" << costheta << std::endl;
377 std::cout <<
"unitID=" << unitID << std::endl;
380 std::cout <<
"dist found =" << dist << std::endl;
384 float SigmaShape = 12.;
388 float tofNorm = (hit.
tof() - t0)/SigmaShape;
390 float readTimeNorm = -tofNorm;
395 std::cout <<
"ChargeDividerFP420:DeconvolutionShape::dist=" << dist << std::endl;
398 std::cout <<
"tofNorm=" << tofNorm << std::endl;
400 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)
Exp< T >::type exp(const T &t)
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