]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliLegoGeneratorEta.cxx
put STEERBase into the include path
[u/mrichter/AliRoot.git] / STEER / AliLegoGeneratorEta.cxx
index e5304b61e122e45a9ad37a458264c633b1e8ec00..e1844441553f6037c258dcf0756bdbe4099e3019 100644 (file)
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
-/*
-$Log$
-Revision 1.1  2000/10/26 14:18:05  morsch
-Add new AliLegoGenerator classes:
-AliLegoGeneratorXYZ: carthesian binning
-AliLegoGeneratorEta: eta-phi binning
+/* $Id$ */
 
-*/
+//------------------------------------------------------------------------
+//    Lego generator in Eta bins
+//    Uses geantino rays to check the material distributions and detector's
+//    geometry
+//    Author: A.Morsch 
+//------------------------------------------------------------------------
 
 #include "AliLegoGeneratorEta.h"
 #include "AliRun.h"
+#include "AliMC.h"
+#include "AliLog.h"
 
 ClassImp(AliLegoGeneratorEta)
 
@@ -44,19 +46,20 @@ void AliLegoGeneratorEta::Generate()
    // Prepare for next step
    if(fCoor1Bin>=fNCoor1-1)
      if(fCoor2Bin>=fNCoor2-1) {
-       Warning("Generate","End of Lego Generation");
+       AliWarning("End of Lego Generation");
        return;
      } else { 
        fCoor2Bin++;
-       printf("Generating rays in phi bin:%d\n",fCoor2Bin);
+       AliDebug(1, Form("Generating rays in eta bin:%d",fCoor2Bin));
        fCoor1Bin=0;
      } else fCoor1Bin++;
 
    fCurCoor1 = (fCoor1Min+(fCoor1Bin+0.5)*(fCoor1Max-fCoor1Min)/fNCoor1);
    fCurCoor2 = (fCoor2Min+(fCoor2Bin+0.5)*(fCoor2Max-fCoor2Min)/fNCoor2);
 
-   Float_t theta = 2.*TMath::ATan(TMath::Exp(-fCurCoor1));
-   Float_t phi   = fCurCoor2*TMath::Pi()/180.;
+   Float_t phi   = fCurCoor1*TMath::Pi()/180.;
+   Float_t theta = 2.*TMath::ATan(TMath::Exp(-fCurCoor2));
+
    
    cost      = TMath::Cos(theta);
    sint      = TMath::Sin(theta);
@@ -80,6 +83,6 @@ void AliLegoGeneratorEta::Generate()
    
    Float_t polar[3]={0.,0.,0.};
    Int_t ntr;
-   gAlice->SetTrack(1, 0, kMpart, pmom, orig, polar, 0, kPPrimary, ntr);
+   gAlice->GetMCApp()->PushTrack(1, -1, kMpart, pmom, orig, polar, 0, kPPrimary, ntr);
    
 }