--- /dev/null
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Author: The ALICE Off-line Project. *
+ * Contributors are mentioned in the code where appropriate. *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+
+/*
+$Log$
+*/
+
+#include "AliLegoGeneratorEta.h"
+#include "AliRun.h"
+
+ClassImp(AliLegoGeneratorEta)
+
+
+//___________________________________________
+void AliLegoGeneratorEta::Generate()
+{
+// Create a geantino with kinematics corresponding to the current bins
+// Here: Coor1 = eta
+// Coor2 = phi.
+
+ //
+ // Rootinos are 0
+ const Int_t kMpart = 0;
+ Float_t orig[3], pmom[3];
+ Float_t t, cost, sint, cosp, sinp;
+ if (fCoor1Bin==-1) fCoor1Bin=fNCoor1;
+ // Prepare for next step
+ if(fCoor1Bin>=fNCoor1-1)
+ if(fCoor2Bin>=fNCoor2-1) {
+ Warning("Generate","End of Lego Generation");
+ return;
+ } else {
+ fCoor2Bin++;
+ printf("Generating rays in phi bin:%d\n",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.;
+
+ cost = TMath::Cos(theta);
+ sint = TMath::Sin(theta);
+ cosp = TMath::Cos(phi);
+ sinp = TMath::Sin(phi);
+
+ pmom[0] = cosp*sint;
+ pmom[1] = sinp*sint;
+ pmom[2] = cost;
+
+ // --- Where to start
+ orig[0] = orig[1] = orig[2] = 0;
+ Float_t dalicz = 3000;
+ if (fRadMin > 0) {
+ t = PropagateCylinder(orig,pmom,fRadMin,dalicz);
+ orig[0] = pmom[0]*t;
+ orig[1] = pmom[1]*t;
+ orig[2] = pmom[2]*t;
+ if (TMath::Abs(orig[2]) > fZMax) return;
+ }
+
+ Float_t polar[3]={0.,0.,0.};
+ Int_t ntr;
+ gAlice->SetTrack(1, 0, kMpart, pmom, orig, polar, 0, "LEGO ray", ntr);
+
+}
--- /dev/null
+#ifndef ALILEGOGENERATORETA_H
+#define ALILEGOGENERATORETA_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+/* $Id$ */
+
+///////////////////////////////////////////////////////////////////////////////
+// //
+// //
+// Utility class to compute and draw Radiation Length Map //
+// //
+// //
+///////////////////////////////////////////////////////////////////////////////
+
+#include "AliLegoGenerator.h"
+
+class AliLegoGeneratorEta : public AliLegoGenerator
+{
+
+ public:
+ virtual void Generate();
+ ClassDef(AliLegoGeneratorEta,1) //Lego GeneratorEta
+};
+
+#endif
+
+
+
+
+
+
+
+
--- /dev/null
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Author: The ALICE Off-line Project. *
+ * Contributors are mentioned in the code where appropriate. *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+
+/*
+$Log$
+*/
+
+#include "AliLegoGeneratorXYZ.h"
+#include "AliRun.h"
+
+ClassImp(AliLegoGeneratorXYZ)
+
+
+//___________________________________________
+
+
+AliLegoGeneratorXYZ::AliLegoGeneratorXYZ()
+{
+// Default Constructor
+ fDir1[0]=1.; fDir1[1]=0.; fDir1[2]=0.;
+ fDir2[0]=0.; fDir2[1]=1.; fDir2[2]=0.;
+ fDir3[0]=0.; fDir3[1]=0.; fDir3[2]=1.;
+}
+
+AliLegoGeneratorXYZ::AliLegoGeneratorXYZ(char* axis)
+{
+// Constructor
+ if (!strcmp(axis,"x") || !strcmp(axis,"X"))
+ {
+ fDir1[0]=0.; fDir1[1]=1.; fDir1[2]=0.;
+ fDir2[0]=0.; fDir2[1]=0.; fDir2[2]=1.;
+ fDir3[0]=1.; fDir3[1]=0.; fDir3[2]=0.;
+ }
+ else if (!strcmp(axis,"y") || !strcmp(axis,"Y"))
+ {
+ fDir1[0]=1.; fDir1[1]=0.; fDir1[2]=0.;
+ fDir2[0]=0.; fDir2[1]=0.; fDir2[2]=1;
+ fDir3[0]=0.; fDir3[1]=1.; fDir3[2]=0.;
+ }
+ else if (!strcmp(axis,"z") || !strcmp(axis,"Z"))
+ {
+ fDir1[0]=1.; fDir1[1]=0.; fDir1[2]=0.;
+ fDir2[0]=0.; fDir2[1]=1.; fDir2[2]=0.;
+ fDir3[0]=0.; fDir3[1]=0.; fDir3[2]=1.;
+ }
+ else
+ {
+ fDir1[0]=1.; fDir1[1]=0.; fDir1[2]=0.;
+ fDir2[0]=0.; fDir2[1]=1.; fDir2[2]=0.;
+ fDir3[0]=0.; fDir3[1]=0.; fDir3[2]=1.;
+ }
+}
+
+
+AliLegoGeneratorXYZ::AliLegoGeneratorXYZ(Int_t nc1, Float_t c1min,
+ Float_t c1max, Int_t nc2,
+ Float_t c2min, Float_t c2max,
+ Float_t rmin, Float_t rmax, Float_t zmax) :
+ AliLegoGenerator(nc1, c1min, c1max, nc2, c2min, c2max,
+ rmin, rmax, zmax)
+{
+// Constructor
+ fDir1[0]=1.; fDir1[1]=0.; fDir1[2]=0.;
+ fDir2[0]=0.; fDir2[1]=1.; fDir2[2]=0.;
+ fDir3[0]=0.; fDir3[1]=0.; fDir3[2]=1.;
+}
+
+
+//___________________________________________
+void AliLegoGeneratorXYZ::Generate()
+{
+// Create a geantino with kinematics corresponding to the current bins
+// Here: Coor1 = x
+// Coor2 = z
+
+ //
+ // Rootinos are 0
+ const Int_t kMpart = 0;
+ Float_t orig[3], pmom[3];
+
+ // Prepare for next step
+ if(fCoor1Bin>=fNCoor1-1)
+ if(fCoor2Bin>=fNCoor2-1) {
+ Warning("Generate","End of Lego Generation");
+ return;
+ } else {
+ fCoor2Bin++;
+ printf("Generating rays in Coordinate 2 bin:%d\n",fCoor2Bin);
+ fCoor1Bin=0;
+ } else fCoor1Bin++;
+
+
+ fCurCoor1 = (fCoor1Min+(fCoor1Bin+0.5)*(fCoor1Max-fCoor1Min)/fNCoor1);
+ fCurCoor2 = (fCoor2Min+(fCoor2Bin+0.5)*(fCoor2Max-fCoor2Min)/fNCoor2);
+
+// Origin and direction
+ Int_t i;
+ for (i=0; i<3; i++) {
+ pmom[i]=fDir3[i];
+ orig[i]=fCurCoor1*fDir1[i]+fCurCoor2*fDir2[i];
+ }
+
+ Float_t dalicz = 3000;
+ if (fRadMin > 0) {
+ Float_t t = PropagateCylinder(orig,pmom,fRadMin,dalicz);
+ orig[0] = pmom[0]*t;
+ orig[1] = pmom[1]*t;
+ orig[2] = pmom[2]*t;
+ if (TMath::Abs(orig[2]) > fZMax) return;
+ }
+
+ Float_t polar[3]={0.,0.,0.};
+ Int_t ntr;
+ gAlice->SetTrack(1, 0, kMpart, pmom, orig, polar, 0, "LEGO XYZ ray", ntr);
+
+}
+
+
+
+
--- /dev/null
+#ifndef ALILEGOGENERATORXYZ_H
+#define ALILEGOGENERATORXYZ_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+/* $Id$ */
+
+///////////////////////////////////////////////////////////////////////////////
+// //
+// //
+// Utility class to compute and draw Radiation Length Map //
+// //
+// //
+///////////////////////////////////////////////////////////////////////////////
+
+#include "AliLegoGenerator.h"
+
+class AliLegoGeneratorXYZ : public AliLegoGenerator
+{
+
+ public:
+ AliLegoGeneratorXYZ();
+ AliLegoGeneratorXYZ(char* axis);
+ AliLegoGeneratorXYZ(Int_t nc1, Float_t c1min, Float_t c1max,
+ Int_t nc2, Float_t c2min, Float_t c2max,
+ Float_t rmin, Float_t rmax, Float_t zmax);
+ virtual void Generate();
+ protected:
+ Float_t fDir1[3]; // 1st unit vector spanning the scanning plane
+ Float_t fDir2[3]; // 2nd unit vector spanning the scanning plane
+ Float_t fDir3[3]; // Direction of flight for geantinos
+
+ ClassDef(AliLegoGeneratorXYZ,1) //Lego GeneratorXYZ
+};
+
+#endif
+
+
+
+
+
+
+
+
AliLego.cxx AliModule.cxx AliDigitNew.cxx \
AliGeometry.cxx AliRecPoint.cxx AliSegmentation.cxx \
AliHitMap.cxx AliMagFC.cxx AliMagFCM.cxx \
- AliMagFDM.cxx AliLegoGenerator.cxx \
+ AliMagFDM.cxx AliLegoGenerator.cxx AliLegoGeneratorXYZ.cxx\
+ AliLegoGeneratorEta.cxx \
AliKalmanTrack.cxx AliCluster.cxx
# C++ Headers
#pragma link C++ class AliMC;
#pragma link C++ class AliLego;
#pragma link C++ class AliLegoGenerator;
+#pragma link C++ class AliLegoGeneratorXYZ;
+#pragma link C++ class AliLegoGeneratorEta;
#pragma link C++ class AliDigitNew;
#pragma link C++ class AliGeometry;
#pragma link C++ class AliRecPoint;