]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - RICH/AliRICHResponseV0.cxx
Merging the VirtualMC branch to the main development branch (HEAD)
[u/mrichter/AliRoot.git] / RICH / AliRICHResponseV0.cxx
index 52869e710a263705dfe9408f8499abfefccef192..656153ff0db990315eb2ad5d341d241e0b3d5352 100644 (file)
 
 /*
   $Log$
+  Revision 1.9.6.1  2002/06/10 15:12:46  hristov
+  Merged with v3-08-02
+
+  Revision 1.9  2001/11/08 20:10:45  dibari
+  ctor with initialising of parmeters added
+
+  Revision 1.8  2001/09/05 09:09:38  hristov
+  The energy of feedback photons calculated correctly
+
+  Revision 1.7  2001/05/10 12:32:27  jbarbosa
+  Changed call to SetTrack.
+
   Revision 1.6  2001/02/23 17:39:02  jbarbosa
   Removed verbose output.
 
 //___________________________________________
 ClassImp(AliRICHResponseV0)
 
+AliRICHResponseV0::AliRICHResponseV0()
+{
+   SetSigmaIntegration(5.);
+   SetChargeSlope(27.);
+   SetChargeSpread(0.18, 0.18);
+   SetMaxAdc(4096);
+   SetAlphaFeedback(0.036);
+   SetEIonisation(26.e-9);
+   SetSqrtKx3(0.77459667);
+   SetKx2(0.962);
+   SetKx4(0.379);
+   SetSqrtKy3(0.77459667);
+   SetKy2(0.962);
+   SetKy4(0.379);
+   SetPitch(0.25);
+   SetWireSag(1);                    // 1->On, 0->Off
+   SetVoltage(2150);                 // Should only be 2000, 2050, 2100 or 2150
+}//AliRICHResponseV0::ctor()
 Float_t AliRICHResponseV0::IntPH(Float_t eloss, Float_t yhit)
 {
     // Get number of electrons and return charge
@@ -186,14 +216,16 @@ Int_t AliRICHResponseV0::FeedBackPhotons(Float_t *source, Float_t qtot)
   
   
   // Local variables 
-  Float_t cthf, ranf[2], phif, enfp = 0, sthf;
+  Double_t ranf[2];
+  Float_t cthf, phif, enfp = 0, sthf;
   Int_t i, ifeed;
   Float_t e1[3], e2[3], e3[3];
   Float_t vmod, uswop;
-  Float_t fp, random;
+  Float_t fp;
+  Double_t random;
   Float_t dir[3], phi;
   Int_t nfp;
-  Float_t pol[3], mom[3];
+  Float_t pol[3], mom[4];
   TLorentzVector position;
   //
   // Determine number of feedback photons
@@ -215,13 +247,14 @@ Int_t AliRICHResponseV0::FeedBackPhotons(Float_t *source, Float_t qtot)
   for (i = 0; i <nfp; i++) {
        
     // Direction
-    gMC->Rndm(ranf, 2);
+    gMC->GetRandom()->RndmArray(2,ranf);
     cthf = ranf[0] * 2 - 1.;
     if (cthf < 0)  continue;
     sthf = TMath::Sqrt((1 - cthf) * (1 + cthf));
     phif = ranf[1] * 2 * TMath::Pi();
     //
-    gMC->Rndm(&random, 1);
+    //gMC->Rndm(&random, 1);
+    gMC->GetRandom()->RndmArray(1, &random);
     if (random <= .57) {
       enfp = 7.5e-9;
     } else if (random <= .7) {
@@ -237,8 +270,10 @@ Int_t AliRICHResponseV0::FeedBackPhotons(Float_t *source, Float_t qtot)
     mom[0]*=enfp;
     mom[1]*=enfp;
     mom[2]*=enfp;
+    mom[3] = TMath::Sqrt(mom[0]*mom[0]+mom[1]*mom[1]+mom[2]*mom[2]);
     //printf("Dir %f %f %f\n",dir[0],dir[1],dir[2]);
     //printf("Momentum %15.12f %15.12f %15.12f\n",mom[0],mom[1],mom[2]);
+    //printf("Energy %e\n", mom[3]);
     
     // Polarisation
     e1[0] = 0;
@@ -278,7 +313,8 @@ Int_t AliRICHResponseV0::FeedBackPhotons(Float_t *source, Float_t qtot)
     vmod=TMath::Sqrt(1/vmod);
     for(j=0;j<3;j++) e2[j]*=vmod;
     
-    gMC->Rndm(ranf, 1);
+    //gMC->Rndm(ranf, 1);
+    gMC->GetRandom()->RndmArray(1,ranf);
     phi = ranf[0] * 2 * TMath::Pi();
     for(j=0;j<3;j++) pol[j]=e1[j]*TMath::Sin(phi)+e2[j]*TMath::Cos(phi);
     gMC->Gdtom(pol, pol, 2);