First commit of this file
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 23 Feb 2000 16:25:43 +0000 (16:25 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 23 Feb 2000 16:25:43 +0000 (16:25 +0000)
EVGEN/AliGenDoubleScan.cxx [new file with mode: 0644]
EVGEN/AliGenDoubleScan.h [new file with mode: 0644]

diff --git a/EVGEN/AliGenDoubleScan.cxx b/EVGEN/AliGenDoubleScan.cxx
new file mode 100644 (file)
index 0000000..ebb6928
--- /dev/null
@@ -0,0 +1,120 @@
+/**************************************************************************
+ * 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 "AliGenDoubleScan.h"
+#include <stdlib.h>
+#include "AliRun.h"
+ ClassImp(AliGenDoubleScan)
+    
+ AliGenDoubleScan::AliGenDoubleScan()
+        :AliGenScan(-1)
+{
+}
+
+AliGenDoubleScan::AliGenDoubleScan(Int_t npart)
+    :AliGenScan(npart)
+{
+}
+
+//____________________________________________________________
+AliGenDoubleScan::~AliGenDoubleScan()
+{}
+
+//____________________________________________________________
+void AliGenDoubleScan::Generate()
+{
+  //
+  // Generate one trigger
+  //
+  
+  Float_t polar[3]= {0,0,0};
+  //
+  Float_t origin[3];
+  Float_t p[3];
+  Int_t nt;
+  Float_t pmom, theta, phi;
+  //
+  Float_t random[6];
+  Float_t dx,dy,dz;
+  
+  //
+  if (fNy > 0) {
+      dx=(fXmax-fXmin)/fNx;
+  } else {
+      dx=1e10;
+  }
+
+  if (fNy > 0) {
+      dy=(fYmax-fYmin)/fNy;
+  } else {
+      dy=1e10;
+  }
+
+  if (fNz > 0) {
+      dz=(fZmax-fZmin)/fNz;
+  } else {
+      dz=1e10;
+  }
+  for (Int_t ix=0; ix<fNx; ix++) {
+      for (Int_t iy=0; iy<fNy; iy++) {
+         for (Int_t iz=0; iz<fNz; iz++){
+             gMC->Rndm(random,6);
+             origin[0]=fXmin+ix*dx+2*(random[0]-0.5)*fOsigma[0];
+             origin[1]=fYmin+iy*dy+2*(random[1]-0.5)*fOsigma[1];
+             origin[2]=fZmin+iz*dz+2*(random[2]-0.5)*fOsigma[2];            
+             pmom=fPMin+random[3]*(fPMax-fPMin);
+             theta=fThetaMin+random[4]*(fThetaMax-fThetaMin);
+             phi=fPhiMin+random[5]*(fPhiMax-fPhiMin);
+             p[0] = pmom*TMath::Cos(phi)*TMath::Sin(theta);
+             p[1] = pmom*TMath::Sin(phi)*TMath::Sin(theta);
+             p[2] = pmom*TMath::Cos(theta);
+             gAlice->SetTrack(fTrackIt,-1,fIpart,p,origin,polar,0,"Primary",nt);
+//
+// Generate 2nd particle at distance fDistance from  the first
+//
+             gMC->Rndm(random,6);
+             Float_t phi2=2.*TMath::Pi()*random[0];
+             Float_t dx  =fDistance*TMath::Sin(phi2);
+             Float_t dy  =fDistance*TMath::Cos(phi2);        
+             origin[0]=origin[0]+dx;
+             origin[1]=origin[1]+dy;         
+             pmom=fPMin+random[1]*(fPMax-fPMin);
+             theta=fThetaMin+random[2]*(fThetaMax-fThetaMin);
+             phi=fPhiMin+random[3]*(fPhiMax-fPhiMin);
+             p[0] = pmom*TMath::Cos(phi)*TMath::Sin(theta);
+             p[1] = pmom*TMath::Sin(phi)*TMath::Sin(theta);
+             p[2] = pmom*TMath::Cos(theta);
+             gAlice->SetTrack(fTrackIt,-1,fIpart,p,origin,polar,0,"Primary",nt);
+         }
+      }
+  }
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/EVGEN/AliGenDoubleScan.h b/EVGEN/AliGenDoubleScan.h
new file mode 100644 (file)
index 0000000..db487aa
--- /dev/null
@@ -0,0 +1,37 @@
+#ifndef AliGenDoubleScan_H
+#define AliGenDoubleScan_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+/* $Id$ */
+
+/////////////////////////////////////////////////////////
+//  Manager and hits classes for set:MUON version 0    //
+/////////////////////////////////////////////////////////
+#include "AliGenScan.h"
+#include "TNamed.h"
+#include "TF1.h"
+#include "TArrayF.h"
+#include "TTree.h"
+
+
+class AliGenDoubleScan : public AliGenScan
+{
+ private:
+    Float_t fDistance;
+ public:
+    AliGenDoubleScan();
+    AliGenDoubleScan(Int_t npart);
+    virtual ~AliGenDoubleScan();
+    // generate event
+    virtual void Generate();
+    virtual void SetDistance(Float_t d) {fDistance=d;}
+    ClassDef(AliGenDoubleScan,1) // Generation of particles on a grid 
+};
+#endif
+
+
+
+
+
+