105 const Float_t CPar[18] = {0.87842E-3, -0.19625E-2, 0.12949E-2, -0.20028E-3, 0.12575E-4, -0.28333E-6,
106 -0.10342E-4, 0.17692E-4, -0.82391E-5, 0.13063E-5, -0.90815E-7, 0.23586E-8,
180 if(gSystem->AccessPathName(
input.Data())!=0) {
181 Error(
"readHist()",
"File %s not found!",
input.Data());
185 TFile *file =
new TFile(
input,
"READ");
188 hvertexgeom = (TH1F*) gDirectory->Get(
"hvertex");
191 Error(
"readHist()",
"hvertex hist for target geom not found! hopeless ....");
195 nVertex = hvertexgeom->GetNbinsX();
197 for(Int_t binVertex=0; binVertex<nVertex; binVertex++) {
198 TH3F *h = (TH3F*)gDirectory->Get(Form(
"hVertex_full%i", binVertex+1));
200 nbinTheta = h->GetNbinsZ();
201 nbinR = h->GetNbinsY();
202 nbinZ = h->GetNbinsX();
207 size = nVertex*nbinTheta;
208 for(Int_t i=0; i<size; i++){
211 cout <<
"Histogram binning : theta " << nbinTheta <<
" r " <<
212 nbinR <<
" z " << nbinZ << endl;
215 for(Int_t binTheta=0; binTheta<nbinTheta; binTheta++) {
216 h->GetZaxis()->SetRange(binTheta+1, binTheta+1);
217 fhzr[binVertex*nbinTheta+binTheta] = (TH2F*) h->Project3D(
"xy");
218 fhzr[binVertex*nbinTheta+binTheta]->SetName(Form(
"%s_%i_xy", h->GetName(), binTheta));
219 fhzr[binVertex*nbinTheta+binTheta]->SetDirectory(0);
223 Error(
"readHist()",
"hvertex %i not found!", binVertex);
228 Error(
"readHist()",
"File point NULL!");
278 const Double_t R2D = 57.295780;
279 const Double_t me = 0.0005109989;
286 for (
int i=0; i<cur; i++) {
288 if (mstack[i]->HasID(gamma_id) && mstack[i]->IsActive()) {
290 if ((*num) == stacksize) {
291 Warning(
"Modify",
"stacksize reached");
299 Double_t Ephot = track->E();
300 Double_t thphot = R2D*track->Theta();
302 if ( thphot<0. || thphot>90 )
continue;
314 Int_t index = int(Ephot/0.01);
319 if (Elepton[index] == NULL) {
320 Char_t funame[11] =
"Elepton000";
321 sprintf(funame,
"Elepton%03d", index);
322 Elepton[index] =
new TF1(funame, PGammaConversion::dSde, me,
double(index)*0.01+0.005, 2);
323 Elepton[index]->SetNpx(200);
324 Elepton[index]->SetParameters(Ephot, Z);
329 Double_t Eelec = Elepton[index]->GetRandom();
330 Eelec *= Ephot/(double(index)*0.01+0.005);
331 Double_t Pelec = sqrt(Eelec*Eelec - me*me);
332 Double_t Thelec = (me/Ephot) * ulep->GetRandom();
333 Double_t Eposi = Ephot - Eelec;
334 Double_t Pposi = sqrt(Eposi*Eposi - me*me);
335 Double_t arg = (Pelec/Pposi) * sin(Thelec);
336 if (arg<-1.) arg = -1;
337 if (arg> 1.) arg = 1;
338 Double_t Thposi = TMath::ASin(arg);
340 Double_t Phelec = 6.28318531 * RGen->Uniform();
341 Double_t Phposi = 6.28318531 - Phelec;
343 TVector3 Dirphot(track->Vect());
344 Dirphot = Dirphot.Unit();
346 TVector3 lep3(Pelec*cos(Phelec)*sin(Thelec), Pelec*sin(Phelec)*sin(Thelec), Pelec*cos(Thelec));
347 TVector3 lep4(Pposi*cos(Phposi)*sin(Thposi), Pposi*sin(Phposi)*sin(Thposi), Pposi*cos(Thposi));
348 lep3.RotateUz(Dirphot);
349 lep4.RotateUz(Dirphot);
363 if (RGen->Uniform() < 0.5) {
372 ep.SetVectM(lep3,me);
376 ep.SetParentIndex(track->
GetIndex());
378 ep.SetVertex(0, 0, 0, 0);
381 em.SetVectM(lep4,me);
385 em.SetParentIndex(track->
GetIndex());
387 em.SetVertex(0, 0, 0, 0);
394 TH2F *hzr = getHist(vertex.Z(), thphot);
397 Error(
"Modify()",
"hzr at theta %f and vertex %f not found !", thphot, vertex.Z());
402 hzr->GetRandom2(z,
r);
404 if(!TMath::Finite(z) || !TMath::Finite(
r)) {
405 ep.SetVertex(0, 0, 10000, 0);
406 em.SetVertex(0, 0, 10000, 0);
408 Double_t phi = gRandom->Rndm()*2*TMath::Pi();
409 Double_t x = cos(phi)*
r;
410 Double_t y = sin(phi)*
r;;
411 ep.SetVertex(x, y, z, 0);
412 em.SetVertex(x, y, z, 0);
414 cout<<
" x " << x <<
" y " << y <<
" phi " << phi*TMath::RadToDeg() <<
415 " r " <<
r <<
" th " << thphot << endl;
418 ep.SetVertex(x1, y1, z1, 0);
419 em.SetVertex(x1, y1, z1, 0);
422 *(mstack[*num]) = ep;
424 *(mstack[*num]) = em;
Int_t GetSourceId() const