]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STARLIGHT/starlight/src/twophotonluminosity.cpp
Update to trunk of hepforge
[u/mrichter/AliRoot.git] / STARLIGHT / starlight / src / twophotonluminosity.cpp
index 428ad38500f97b0b42f49c9befff1eab1572aaaf..2d4a26cd73edbc196971afbd173b7f8a808803a4 100644 (file)
@@ -20,9 +20,9 @@
 ///////////////////////////////////////////////////////////////////////////
 //
 // File and Version Information:
-// $Rev:: 164                         $: revision of last commit
-// $Author:: odjuvsla                 $: author of last commit
-// $Date:: 2013-10-06 16:18:08 +0200 #$: date of last commit
+// $Rev:: 176                         $: revision of last commit
+// $Author:: jseger                   $: author of last commit
+// $Date:: 2014-06-20 22:15:20 +0200 #$: date of last commit
 //
 // Description:
 //    Added incoherent factor to luminosity table output--Joey
@@ -86,7 +86,7 @@ void twoPhotonLuminosity::twoPhotonDifferentialLuminosity()
   OldNorm   = Normalize;
   
   //Writing out our input parameters+(w,y)grid+diff._lum.
-  wylumfile << inputParametersInstance.parameterValueKey() << endl;
+  // wylumfile << inputParametersInstance.parameterValueKey() << endl;
   wylumfile << beam1().Z() <<endl;
   wylumfile << beam1().A() <<endl;
   wylumfile << beam2().Z() <<endl;
@@ -103,7 +103,7 @@ void twoPhotonLuminosity::twoPhotonDifferentialLuminosity()
   wylumfile << inputParametersInstance.interferenceStrength() <<endl;
   wylumfile << inputParametersInstance.coherentProduction() <<endl;
   wylumfile << inputParametersInstance.incoherentFactor() <<endl;
-  wylumfile << inputParametersInstance.deuteronSlopePar() <<endl;
+  wylumfile << starlightConstants::deuteronSlopePar <<endl;
   wylumfile << inputParametersInstance.maxPtInterference() <<endl;
   wylumfile << inputParametersInstance.nmbPtBinsInterference() <<endl;
   for (unsigned int i = 0; i < _nWbins; ++i) {
@@ -125,11 +125,12 @@ void twoPhotonLuminosity::twoPhotonDifferentialLuminosity()
         wylumfile << xlum <<endl;
       }
       Normalize = OldNorm;
-  }
+    }
 
   }
   else if(inputParametersInstance.xsecCalcMethod() == 1) {
     
+    /*
         const int nthreads = inputParametersInstance.nThreads();
         pthread_t threads[nthreads];
         difflumiargs args[nthreads];
@@ -179,6 +180,18 @@ void twoPhotonLuminosity::twoPhotonDifferentialLuminosity()
     
     wylumfile << inputParametersInstance.parameterValueKey() << endl;
     wylumfile.close();
+    */ 
+
+    for (unsigned int i = 0; i < _nWbins; i++) {   //For each (w,y) pair, calculate the diff. _lum
+      printf("Calculating cross section: %2.0f %% \r", float(i)/float(_nWbins)*100);
+      fflush(stdout);
+      for (unsigned int j = 0; j < _nYbins; j++) {
+        xlum = w[i] * D2LDMDY(w[i],y[j]);   //Convert photon flux dN/dW to Lorentz invariant photon number WdN/dW
+        wylumfile << xlum <<endl;
+        // cout<<" i: "<<i<<" j: "<<j<<" W*dN/dW: "<<xlum<<endl; 
+      }
+    }
+  }
     return;
 }