BmnRoot
Loading...
Searching...
No Matches
BmnGemFastDigitize.cxx
Go to the documentation of this file.
1// -------------------------------------------------------------------------
2// ----- BmnGemFastDigitize source file -----
3// ----- Created 4/07/19 by A. Zinchenko -----
4// -------------------------------------------------------------------------
5
7#include "CbmMCTrack.h"
8#include "CbmStsPoint.h"
9#include "CbmStsSensor.h"
10
11#include "FairRootManager.h"
12
13#include <TCut.h>
14#include <TDatabasePDG.h>
15#include <TEntryList.h>
16#include <TGeoManager.h>
17#include <TH1I.h>
18#include <TH2I.h>
19#include <TParticlePDG.h>
20#include <TRandom.h>
21#include <TROOT.h>
22#include "TFile.h"
23#include <TSystem.h>
24#include <TTree.h>
25//#include <TH1F.h>
26//#include <TH3F.h>
27
28#include <iostream>
29#include <fstream>
30#include <queue>
31
32using std::cout;
33using std::endl;
34using std::ifstream;
35using std::iterator;
36using std::map;
37using std::multimap;
38using std::pair;
39using std::set;
40using std::vector;
41
42// ----- Default constructor -------------------------------------------
44 : FairTask("GemFastDigitize"),
45 fhInd(NULL)
46{
47}
48// -------------------------------------------------------------------------
49
50// ----- Destructor ----------------------------------------------------
52// -------------------------------------------------------------------------
53
54// ----- Public method Init --------------------------------------------
56
57 // Get RootManager
58 FairRootManager* ioman = FairRootManager::Instance();
59 if ( ! ioman ) {
60 cout << "-E- BmnGemFastDigitize::Init: "
61 << "RootManager not instantiated!" << endl;
62 return kFATAL;
63 }
64
65 // Get input arrays
66 fPoints = (TClonesArray*) ioman->GetObject("StsPoint");
67 if ( ! fPoints ) {
68 //cout << "-W- BmnGetFastDigitize::Init: "<< "No STSPoint array!" << endl;
69 return kERROR;
70 }
71 fMCTracks = (TClonesArray*) ioman->GetObject("MCTrack");
72
73 // Get list of files with digit trees
74 if (gSystem->Exec("du -s clusLib")) {
75 LOG(fatal) << " !!! No clusLib directory found - exit !!!";
76 }
77 //gSystem->Exec("ls -1 clusLib/thx*histo.root > aaa");
78 //gSystem->Exec("ls -1 thxp10thyp00.histo.root > aaa");
79
80 //ifstream fin("aaa");
81 ifstream fin("clusLib/file_list.txt");
82 TString fileName;
83 //const Int_t nbinsx = 15, nbinsy = 5;
84 //Double_t xlim[nbinsx] = {-75, 75}; // theta_x (deg)
85 const Int_t nbinsx = 29, nbinsy = 5;
86 Double_t xlim[nbinsx] = {-72.5, 72.5}; // theta_x (deg)
87 Double_t ylim[nbinsy] = {-25, 25}; // theta_y
88 fhInd = new TH2I("hInd","",nbinsx,xlim[0],xlim[1],nbinsy,ylim[0],ylim[1]);
89 fhInd->StatOverflows(kTRUE); // correct numbering of underflow / overflow bins
90
91 while(1) {
92 fin >> fileName;
93 if (fin.eof()) break;
94
95 // Decode file name to get theta_X and theta_Y
96 //Int_t ithx = TString(fileName(4,2)).Atoi(), ithy = TString(fileName(10,2)).Atoi();
97 //if (fileName(4) == 'm') ithx = -ithx;
98 //if (fileName(10) == 'm') ithy = -ithy;
99 Int_t ithx = TString(fileName(12,2)).Atoi(), ithy = TString(fileName(18,2)).Atoi();
100 if (fileName(11) == 'm') ithx = -ithx;
101 if (fileName(17) == 'm') ithy = -ithy;
102 TString hname = "h";
103 hname += ithx;
104 hname += "_";
105 hname += ithy;
106 /*
107 //Double_t xmin[2] = {238.0, 252.5}, xmax[2] = {242.5, 257.0};
108 Double_t xmin[2] = {236.8, 251.4}, xmax[2] = {238.3, 252.8};
109 Int_t nbins = 100;
110 //TH2I *hXY = new TH2I("hXY","Y vs X",nbins,xmin[0],xmax[0],nbins,xmin[1],xmax[1]); // Y vs X (cog[1] vs cog[0])
111 //clus->Project(hXY->GetName(),"cog[1]:cog[0]",cut);
112 */
113 //TFile *file = TFile::Open("checkDigi_st5_new.histo.root");
114 TFile *file = TFile::Open(fileName);
115 TTree *clus = (TTree*) file->Get("clus");
116
117 // Get stored histogram
118 TH2I *hXY = (TH2I*) file->Get("hXY");
119 hXY = (TH2I*) hXY->Clone(hname);
120 Int_t indXY = fhInd->Fill(ithx,ithy);
121 fHistMap[indXY] = hXY;
122 fTreeMap[indXY] = clus;
123
124 clus->SetBranchStatus("*",0); // disable branches
125 clus->SetBranchStatus("qtot*",1); // enable branches
126 clus->SetBranchStatus("ibeg*",1); // enable branches
127 clus->SetBranchStatus("strin*",1); // enable branches
128 clus->SetBranchStatus("dpitin*",1); // enable branches
129 clus->SetBranchStatus("strout*",1); // enable branches
130 clus->SetBranchStatus("cog*",1); // enable branches
131 clus->SetBranchStatus("digis*",1); // enable branches
132
133 //TList *list = file.GetList();
134 //Int_t ntot = list->GetEntries();
135
136 //TCut cut0("abs(imax[0]-240)<5&&strout[0]==244"); // side 0
137 //TCut cut1("abs(imax[1]-254)<5&&strout[1]==259&&imax[1]>252"); // side 1
138 TCut cut0("abs(ibeg[0]-237)<5&&strout[0]==244"); // side 0
139 TCut cut1("abs(ibeg[1]-252)<5&&strout[1]==259"); // side 1
140 TCut cut = ""; //cut0 && cut1;
141 if (file->Get("CUT")) cut = *((TCut*)file->Get("CUT"));
142
143 TEntryList *entryList = NULL;
144 clus->Draw(">>entryList",cut,"entrylist",9000000000);
145 entryList = (TEntryList*) gDirectory->Get("entryList");
146 clus->SetEntryList(entryList);
147 cout << " xxxxxx " << fileName << " " << entryList->GetN() << " " << ithx << " " << ithy << " " << indXY << endl;
148
149 fvDig0 = &fvDigis[0];
150 fvDig1 = &fvDigis[1];
151
152 clus->SetBranchAddress("qtot[2]",&fQtot);
153 clus->SetBranchAddress("ibeg[2]",&fIbeg);
154 clus->SetBranchAddress("strin[2]",&fStrin);
155 clus->SetBranchAddress("dpitin[2]",&fDpitin);
156 clus->SetBranchAddress("strout[2]",&fStrout);
157 clus->SetBranchAddress("cog[2]",&fCog);
158 clus->SetBranchAddress("digis0", &fvDig0);
159 clus->SetBranchAddress("digis1", &fvDig1);
160
161 Int_t entries = entryList->GetN();
162 entries = TMath::Min(10000,entries);
163 map<Int_t,Int_t> strin[2]; // entrance strips
164 std::multimap<Float_t,Int_t> mmm;
165 fXYmap[0][indXY] = mmm;
166 fXYmap[1][indXY] = mmm;
167
168 for (Int_t j = 0; j < entries; ++j) {
169 Int_t treeEn = entryList->GetEntry(j);
170 clus->GetEntry(treeEn);
171 //cout << j << " " << entryList->GetEntry(j) << " " << cog[0] << " " << cog[1] << endl;
172
173 for (Int_t side = 0; side < 2; ++side) {
174 fXYmap[side][indXY].insert(pair<Float_t,Int_t>(fCog[side],treeEn));
175 if (strin[side].find(fStrin[side]) == strin[side].end()) strin[side][fStrin[side]] = 0;
176 ++strin[side][fStrin[side]];
177 }
178 }
179
180 // Find reference strip
181 for (Int_t side = 0; side < 2; ++side) {
182 map<Int_t,Int_t>::iterator it = strin[side].begin();
183 fStrRef[side][indXY] = it->first;
184 Int_t maxStrip = it->second;
185
186 for ( ; it != strin[side].end(); ++it) {
187 if (it->second > maxStrip) {
188 maxStrip = it->second;
189 fStrRef[side][indXY] = it->first;
190 }
191 }
192 }
193
194 //file.Close();
195 }
196
197 cout << "-I- BmnGemFastDigitize: Initialisation successful" << endl;
198 return kSUCCESS;
199
200}
201// -------------------------------------------------------------------------
202
203// ----- Public method Exec --------------------------------------------
204void BmnGemFastDigitize::Exec(Option_t* opt) {
205
206}
207// -------------------------------------------------------------------------
208
209// ----- Public method Finish ------------------------------------------
213// -------------------------------------------------------------------------
214
215// ----- Public method ProduceHitResponse ------------------------------
216void BmnGemFastDigitize::ProduceHitResponseFast(CbmStsSensor* sensor, std::set<Int_t> &pSet,
217 Double_t *stripSignalF, Double_t *stripSignalB,
218 map<Int_t, set<Int_t> > &chanPointMapF,
219 map<Int_t, set<Int_t> > &chanPointMapB)
220{
221 // Produce sensor response
222
223 Int_t iPoint = -1, stationNr = Int_t(sensor->GetStationNr());
224 CbmStsPoint* point = NULL;
225 set<Int_t>::iterator it1;
226 Double_t dPitch = 0;
227
228 for (it1 = pSet.begin(); it1 != pSet.end(); it1++) {
229
230 //AZ Apply overall efficiency
231 //const Double_t eff0 = 0.65;
232 //if (gRandom->Rndm() > eff0) continue;
233
234 iPoint = (*it1);
235 point = (CbmStsPoint*)fPoints->UncheckedAt(iPoint);
236 TVector3 mom;
237 point->Momentum(mom);
238
239 CbmMCTrack *mcTr = (CbmMCTrack*) fMCTracks->UncheckedAt(point->GetTrackID()); //ES
240 TParticlePDG *part = TDatabasePDG::Instance()->GetParticle(mcTr->GetPdgCode());
241 Double_t mnoc = 1.0, mass = 3.7283999; // He4
242 if (part) mass = part->Mass();
243 if (mass > 0.0001) {
244 TLorentzVector lorv;
245 lorv.SetVectM(mom, mass);
246 Double_t beta = lorv.Beta();
247 Double_t gamma = lorv.Gamma();
248 Double_t charge = (part) ? part->Charge()/3 : 1;
249 mnoc = GetNumberOfClusters(beta, gamma, charge, 1.787, 12.33);
250 if (mnoc < 0.5) continue; //AZ
251 //cout << " ***clus*** " << stationNr << " " << mass << " " << beta << " " << gamma << " " << mnoc << endl;
252 }
253 Double_t coeff = mnoc / 29.2; // 29.2 - mnoc for test particles (pion with p = 1.6 GeV/c)
254 //AZ 31.07.20 coeff *= 2; // to correct ADC conversion factor
255 coeff *= 1.; // to correct ADC conversion factor
256
257 //Double_t moduleThickness = 0.3 + 0.25 + 0.2 + 0.15 ; // DriftGapThickness + FirstTransferGapThickness + SecondTransferGapThickness + InductionGapThickness;
258
259 TVector3 posIn, posOut;
260 point->PositionIn(posIn);
261 point->PositionOut(posOut);
262 TVector3 dpos = posOut;
263 dpos -= posIn;
264 dpos *= 0.001;
265 posIn += dpos;
266 posOut -= dpos;
267
268 Double_t xrand, yrand;
269
270 // Get theX, theY data set
271 if (mom.Z() < 0) mom *= -1; // particle going backward
272 Double_t theX = TMath::ATan2 (mom.X(),mom.Z()) * TMath::RadToDeg();
273 Double_t theY = TMath::ATan2 (mom.Y(),mom.Z()) * TMath::RadToDeg();
274 if (stationNr % 2 == 0) theY = -theY; // 28-09-19 - OK
275 Int_t indXY = FindDataSet(theX, theY);
276 //cout << " ------------------ Data set: " << indXY << " " << posIn.Z() << " " << theX << " " << theY << endl;
277 TH2I *hxy = fHistMap[indXY];
278
279 //TTree *clus = (TTree*) gROOT->FindObjectAny("clus");
280 //((TH2I*)gROOT->FindObjectAny("hXY"))->GetRandom2(xrand,yrand);
281 hxy->GetRandom2(xrand,yrand);
282 Float_t xy[2];
283 xy[0] = xrand;
284 xy[1] = yrand;
285
286 Int_t istrip0[2] = {0};
287 multimap<Float_t,Int_t>::iterator mit, mit1;
288
289 for (Int_t ixy = 0; ixy < 2; ++ixy) {
290 map<Int_t,Float_t> charges[2]; // 2 clusters
291 //for (Int_t iclus = 0; iclus < 2; ++iclus) charges[iclus].clear();
292 mit = fXYmap[ixy][indXY].lower_bound(xy[ixy]);
293 if (mit == fXYmap[ixy][indXY].end()) --mit;
294 // First cluster
295 Int_t entry = mit->second;
296 fTreeMap[indXY]->GetEntry(entry);
297 Double_t delt = TMath::Abs (fCog[ixy] - xy[ixy]);
298 Int_t ndig = fvDigis[ixy].size();
299 Double_t qTot0 = fQtot[ixy];
300 Double_t dpitch0 = fDpitin[ixy];
301 for (Int_t j = 0; j < ndig; ++j) {
302 charges[0][j+fIbeg[ixy]] = fvDigis[ixy][j];
303 }
304 //cout << cog[ixy] << " " << xy[ixy] << endl;
305 // Second cluster
306 mit1 = mit;
307 if (mit != fXYmap[ixy][indXY].begin()) --mit1;
308 else ++mit1;
309 entry = mit1->second;
310 fTreeMap[indXY]->GetEntry(entry);
311 //cout << cog[ixy] << " " << xy[ixy] << endl;
312 Double_t delt1 = TMath::Abs (fCog[ixy] - xy[ixy]);
313 Double_t dist = delt + delt1;
314 //cout << dist << " " << delt << " " << delt1 << endl;
315 Double_t w = (dist - delt) / dist;
316 Double_t w1 = (dist - delt1) / dist;
317 //w1 = 0; w = 1; // !!!!! test
318 //AZ if (gRandom->Rndm() >= 0.5) { w1 = 0; w = 1; }
319 //AZ else { w1 = 1; w = 0; }
320 //cout << w << " " << w1 << " " << w+w1 << " " << (mit==xyMap[ixy].begin()) << endl;
321 ndig = fvDigis[ixy].size();
322 Double_t qTot1 = fQtot[ixy];
323 Double_t dpitch1 = fDpitin[ixy];
324 for (Int_t j = 0; j < ndig; ++j) {
325 charges[1][j+fIbeg[ixy]] = fvDigis[ixy][j];
326 }
327 Int_t i0 = TMath::Min(charges[0].begin()->first,charges[1].begin()->first);
328 //i0 = TMath::Max (i0,0);
329 Int_t i1 = TMath::Max(charges[0].rbegin()->first,charges[1].rbegin()->first);
330 //if (ixy == 0) i1 = TMath::Min (i1,sensor->GetNChannelsFront());
331 //else i1 = TMath::Min (i1,sensor->GetNChannelsBack());
332 /*
333 Double_t cognew[3] = {0}, qqq[3] = {0};
334 for (Int_t iclus = 0; iclus < 2; ++iclus) {
335 for (map<Int_t,Float_t>::iterator it = charges[iclus].begin(); it != charges[iclus].end(); ++it) {
336 cognew[iclus] += it->first * it->second;
337 qqq[iclus] += it->second;
338 }
339 cognew[iclus] /= qqq[iclus];
340 h1[ixy][iclus+1]->Fill(cognew[iclus]);
341 }
342 */
343 //Int_t istr;
344 if (ixy == 0) {
345 if (stationNr % 2) istrip0[ixy] = sensor->GetFrontChannel(posIn.X(),posIn.Y(),posIn.Z(),dPitch);
346 else istrip0[ixy] = sensor->GetFrontChannel(posOut.X(),posOut.Y(),posOut.Z(),dPitch);
347 } else {
348 if (stationNr % 2) istrip0[ixy] = sensor->GetBackChannel(posIn.X(),posIn.Y(),posIn.Z(),dPitch);
349 else istrip0[ixy] = sensor->GetBackChannel(posOut.X(),posOut.Y(),posOut.Z(),dPitch);
350 }
351
352 Double_t pitch = (ixy == 0) ? sensor->GetDx() : sensor->GetDy();
353 dPitch /= pitch;
354 if (dPitch < 0) { --istrip0[ixy]; dPitch += 1.0; } // new
355 //if (stationNr % 2 == 0) { istrip0[ixy]-=1; dPitch = 1 - dPitch; }
356 if (stationNr % 2 == 0) { dPitch = 1 - dPitch; }
357 //AZ if (stationNr % 2 == 0) { dPitch = 1 - TMath::Abs(dPitch); }
358 //AZ if (stationNr % 2 == 0) { dPitch = - dPitch; }
359 if (stationNr % 2 == 0) ++istrip0[ixy]; // AZ - how to explain this???
360
361 // Weighted average of 2 clusters
362 Double_t qtot12 = qTot0 * w + qTot1 * w1;
363 Double_t dpitch12 = dpitch0 * w + dpitch1 * w1;
364 //if (stationNr % 2 == 0) { dpitch12 = 1 - dpitch12; } // AZ
365 Int_t ntot = i1 - i0 + 1;
366 Double_t *q12array = new Double_t[ntot];
367 Double_t q12sum0 = 0, q12sum1 = 0;
368
369 for (Int_t j = i0; j <= i1; ++j) {
370 if (charges[0].find(j) == charges[0].end()) charges[0][j] = 0;
371 if (charges[1].find(j) == charges[1].end()) charges[1][j] = 0;
372 //Double_t q12 = (charges[0][j] * w + charges[1][j] * w1) / (w + w1) * fQtot[ixy];
373 q12array[j-i0] = (charges[0][j] * w + charges[1][j] * w1) * qtot12; // w + w1 = 1
374 q12sum0 += q12array[j-i0];
375 }
376 Double_t shift = dPitch - dpitch12, q12 = 0;
377 //if (stationNr % 2 == 0) shift = -shift; //AZ
378 map<Int_t,Double_t> buffer;
379
380 for (Int_t j = i0; j <= i1; ++j) {
381 if (stationNr % 2) q12 = Interp (q12array, j-i0, ntot, -shift);
382 //else q12 = Interp (q12array, j-i0, ntot, -shift);
383 else q12 = Interp (q12array, j-i0, ntot, -shift);
384
385 //Int_t dj = (ixy == 0) ? j - 241 : j - 256;
386 //Int_t dj = (ixy == 0) ? j - 240 : j - 254;
387 Int_t dj = j - fStrRef[ixy][indXY];
388 buffer[dj] = q12;
389 q12sum1 += q12;
390 //cognew[2] += q12 * j;
391 //qqq[2] += q12;
392 }
393 Double_t scale = q12sum0 / q12sum1;
394 scale *= coeff;
395
396 for (map<Int_t,Double_t>::iterator it = buffer.begin(); it != buffer.end(); ++it) {
397 Int_t jj = it->first;
398 if (stationNr % 2 > 0) jj += istrip0[ixy];
399 else jj = istrip0[ixy] - it->first + 0; // even stations (rotated)
400
401 if (ixy == 0) {
402 if (jj < 0 || jj >= sensor->GetNChannelsFront()) continue;
403 stripSignalF[jj] += it->second * scale;
404 chanPointMapF[jj].insert(iPoint);
405 } else {
406 if (jj < 0 || jj >= sensor->GetNChannelsBack()) continue;
407 stripSignalB[jj] += it->second * scale;
408 chanPointMapB[jj].insert(iPoint);
409 }
410 }
411 delete [] q12array;
412 //cognew[2] /= qqq[2];
413 //h1[ixy][3]->Fill(cognew[2]);
414 //cogGen[ixy] = cognew[2];
415 } // for (Int_t ixy = 0;
416 } // for (it1 = pSet.begin();
417}
418
419// -------------------------------------------------------------------------
420
421Double_t BmnGemFastDigitize::Interp(Double_t *yy, Int_t indx, Int_t ntot, Double_t dx)
422{
423 static Double_t y0 = 0, y1 = 0;
424 static Int_t indx0 = 0;
425
426 if (indx == 0) {
427 if (dx >= 0) {
428 indx0 = 1;
429 y0 = yy[0];
430 } else {
431 indx0 = 0;
432 y0 = 0.0;
433 }
434 y1 = yy[indx0];
435 } else {
436 y0 = y1;
437 if (indx0 >= ntot) y1 = 0.0;
438 else y1 = yy[indx0];
439 }
440
441 ++indx0;
442 if (dx < 0) dx += 1;
443 //cout << indx << " aaa " << y0 + (y1 - y0) / (x1 - x0) * (x - x0) << " " << yy[indx] << " " << indx0 << endl;
444 //cout << " Interp: " << indx0 << " " << dx << " " << y0 << " " << y0 + (y1 - y0) * dx << endl;
445 //AZ return y0 + (y1 - y0) * dx;
446 return TMath::Max (y0 + (y1 - y0) * dx, 0.0);
447}
448
449// -------------------------------------------------------------------------
450
451Int_t BmnGemFastDigitize::FindDataSet(Double_t theX, Double_t theY)
452{
453 // Find appropriate data set according to theX, theY
454 // (contribution from R.Zinchenko)
455
456 static Int_t first = 1;
457
458 if (first) {
459 first = 0;
460 // Find nearest non-zero bin
461 Int_t nx = fhInd->GetNbinsX(), ny = fhInd->GetNbinsY();
462 vector<Int_t> ia(ny);
463 vector<vector<Int_t> > matri(nx,ia);
464 vector<Float_t> fa(ny);
465 vector<vector<Float_t> > matrf(nx,fa);
466 Int_t ix, iy, /*iz,*/ ix0, iy0, iz0, ixOK, iyOK;
467 std::queue<Int_t> que;
468
469 for (Int_t i = 1; i <= nx; ++i) {
470 for (Int_t j = 1; j <= ny; ++j) {
471 if (fhInd->GetBinContent(i,j)) {
472 matri[i-1][j-1] = fhInd->GetBin(i,j);
473 que.push(fhInd->GetBin(i,j));
474 }
475 }
476 }
477
478 while (que.size()) {
479 Int_t bin0 = que.front(); // current cell
480 fhInd->GetBinXYZ(bin0,ix0,iy0,iz0);
481 --ix0;
482 --iy0;
483 Int_t binOK = matri[ix0][iy0]; // active cell
484 fhInd->GetBinXYZ(binOK,ixOK,iyOK,iz0);
485 --ixOK;
486 --iyOK;
487 que.pop();
488
489 // Loop over cell neighbours
490 for (Int_t i = -1; i < 2; ++i) {
491 ix = ix0 + i;
492 if (ix < 0 || ix > nx-1) continue;
493
494 for (Int_t j = -1; j < 2; ++j) {
495 iy = iy0 + j;
496 if (iy < 0 || iy > ny-1) continue;
497 if (i == 0 && j == 0) continue;
498 Float_t r20 = matrf[ix][iy];
499 if (matri[ix][iy] && r20 < 0.1) continue; // active cell
500 Float_t r2 = (ix-ixOK)*(ix-ixOK) + (iy-iyOK)*(iy-iyOK);
501 if (r20 < 0.1 || r2 < r20) {
502 matrf[ix][iy] = r2;
503 matri[ix][iy] = matri[ix0][iy0];
504 if (r20 < 0.1) que.push(fhInd->GetBin(ix+1,iy+1));
505 }
506 }
507 }
508 }
509
510 for (Int_t i = 1; i <= nx; ++i) {
511 for (Int_t j = 1; j <= ny; ++j) {
512 fhInd->SetBinContent(i,j,matri[i-1][j-1]);
513 }
514 }
515 } // if (first)
516
517 Int_t ix = fhInd->GetXaxis()->FindBin(theX);
518 if (ix < 1) ix = 1;
519 else if (ix > fhInd->GetNbinsX()) ix = fhInd->GetNbinsX();
520 Int_t iy = fhInd->GetYaxis()->FindBin(theY);
521 if (iy < 1) iy = 1;
522 else if (iy > fhInd->GetNbinsY()) iy = fhInd->GetNbinsY();
523
524 return fhInd->GetBinContent(ix, iy);
525
526}
527
528// -------------------------------------------------------------------------
529
530Double_t BmnGemFastDigitize::GetNumberOfClusters(Double_t beta, Double_t gamma, Double_t charge, Double_t p0, Double_t p1)
531{
532 Double_t beta2 = beta * beta;
533 Double_t gamma2 = gamma * gamma;
534 Double_t val = p0/beta2*(p1 + TMath::Log(beta2*gamma2) - beta2);
535 return TMath::Min(val*charge*charge,20000.);
536}
537
538// -------------------------------------------------------------------------
vector< Double_t > dist(vector< Double_t > qp, Double_t mu)
Definition BmnMath.cxx:869
int i
Definition P4_F32vec4.h:22
virtual InitStatus Init()
void ProduceHitResponseFast(CbmStsSensor *sensor, std::set< Int_t > &pSet, Double_t *stripSignalF, Double_t *stripSignalB, std::map< Int_t, std::set< Int_t > > &chanPointMapF, std::map< Int_t, std::set< Int_t > > &chanPointMapB)
virtual void Exec(Option_t *opt)
Double_t GetNumberOfClusters(Double_t beta, Double_t gamma, Double_t charge, Double_t p0, Double_t p1)
Int_t GetPdgCode() const
Definition CbmMCTrack.h:56
void PositionOut(TVector3 &pos)
Definition CbmStsPoint.h:79
void PositionIn(TVector3 &pos)
Definition CbmStsPoint.h:78
Int_t GetNChannelsFront() const
Double_t GetDy() const
Int_t GetNChannelsBack() const
Int_t GetFrontChannel(Double_t x, Double_t y, Double_t z, Double_t &dPitch)
Double_t GetDx() const
Int_t GetBackChannel(Double_t x, Double_t y, Double_t z, Double_t &dPitch)
Int_t GetStationNr() const