]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Using vertex from underlying event in AliSimulation (T.Kuhr)
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 10 Feb 2004 09:54:10 +0000 (09:54 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 10 Feb 2004 09:54:10 +0000 (09:54 +0000)
EVGEN/EVGENLinkDef.h
EVGEN/libEVGEN.pkg
STEER/AliSimulation.cxx
STEER/AliSimulation.h
STEER/AliVertexGenFile.cxx [moved from EVGEN/AliVertexGenFile.cxx with 100% similarity]
STEER/AliVertexGenFile.h [moved from EVGEN/AliVertexGenFile.h with 100% similarity]
STEER/STEERLinkDef.h
STEER/libSTEER.pkg

index f5c3e82d40d22d2c58691caf254a8146cd36d108..ce645e77ffd72dfa3775bf2f6450f6b8dd66aa11 100644 (file)
@@ -51,7 +51,6 @@
 #pragma link C++ class  AliGenSlowNucleons+;
 #pragma link C++ class  AliSlowNucleonModel+;
 #pragma link C++ class  AliSlowNucleonModelExp+;
-#pragma link C++ class  AliVertexGenFile+;
 #pragma link C++ class  AliGenMUONCocktail+;
 #endif
 
index 29330e1b073bb78d65b21a15bfd6faa66ba6d169..b5c963f98a72ea7def3f57817f9d776e897d1a8d 100644 (file)
@@ -18,7 +18,7 @@ SRCS          = AliGenHIJINGpara.cxx AliGenBox.cxx AliGenFixed.cxx \
                AliStructFuncType.cxx AliGenSlowNucleons.cxx \
                AliGenGeVSimEventHeader.cxx\
                AliSlowNucleonModel.cxx AliSlowNucleonModelExp.cxx \
-               AliVertexGenFile.cxx AliGenMUONCocktail.cxx
+               AliGenMUONCocktail.cxx
 
 # Headerfiles for this particular package (Path respect to own directory)
 HDRS= $(SRCS:.cxx=.h) 
index 853df4ef9b4ad3d091d745bc7bf2cd89acf5714b..da034993db79deb185e2212693065a3cad3aa1a0 100644 (file)
@@ -83,6 +83,7 @@
 #include "AliRun.h"
 #include "AliModule.h"
 #include "AliGenerator.h"
+#include "AliVertexGenFile.h"
 #include "AliRunDigitizer.h"
 #include "AliDigitizer.h"
 #include <TObjString.h>
@@ -107,6 +108,7 @@ AliSimulation::AliSimulation(const char* configFileName,
   fConfigFileName(configFileName),
   fGAliceFileName("galice.root"),
   fBkgrdFileNames(NULL),
+  fUseBkgrdVertex(kTRUE),
   fRegionOfInterest(kTRUE)
 {
 // create simulation object with default parameters
@@ -128,6 +130,7 @@ AliSimulation::AliSimulation(const AliSimulation& sim) :
   fConfigFileName(sim.fConfigFileName),
   fGAliceFileName(sim.fGAliceFileName),
   fBkgrdFileNames(NULL),
+  fUseBkgrdVertex(sim.fUseBkgrdVertex),
   fRegionOfInterest(sim.fRegionOfInterest)
 {
 // copy constructor
@@ -258,12 +261,26 @@ Bool_t AliSimulation::RunSimulation(Int_t nEvents)
   }
   fGAliceFileName = runLoader->GetFileName();
 
+  if (!gAlice->Generator()) {
+    Error("RunSimulation", "gAlice has no generator object. "
+         "Check your config file: %s", fConfigFileName.Data());
+    return kFALSE;
+  }
+
+  // get vertex from background file in case of merging
+  if (fUseBkgrdVertex &&
+      fBkgrdFileNames && (fBkgrdFileNames->GetEntriesFast() > 0)) {
+    Int_t signalPerBkgrd = fBkgrdFileNames->At(0)->GetUniqueID();
+    const char* fileName = ((TObjString*)
+                           (fBkgrdFileNames->At(0)))->GetName();
+    Info("RunSimulation", "The vertex will be taken from the background "
+        "file %s with nSignalPerBackground = %d", 
+        fileName, signalPerBkgrd);
+    AliVertexGenFile* vtxGen = new AliVertexGenFile(fileName, signalPerBkgrd);
+    gAlice->Generator()->SetVertexGenerator(vtxGen);
+  }
+
   if (!fRunSimulation) {
-    if (!gAlice->Generator()) {
-      Error("RunSimulation", "gAlice has no generator object. "
-           "Check your config file: %s", fConfigFileName.Data());
-      return kFALSE;
-    }
     gAlice->Generator()->SetTrackingFlag(0);
   }
 
index bda4d911bf53bd5eda2f0019b677480f3687d7f8..4fdd4aa874efcc1c565a1f3fd7d6b862fa0abaaa 100644 (file)
@@ -28,6 +28,8 @@ public:
   void           SetMakeSDigits(const char* detectors) 
                    {fMakeSDigits = detectors;};
   void           MergeWith(const char* fileName, Int_t nSignalPerBkgrd = 1);
+  void           SetUseBkgrdVertex(Bool_t useBkgrdVertex)
+                   {fUseBkgrdVertex = useBkgrdVertex;};
   void           SetRegionOfInterest(Bool_t flag) {fRegionOfInterest = flag;};
   void           SetMakeDigits(const char* detectors)
                    {fMakeDigits = detectors;};
@@ -57,6 +59,7 @@ private:
   TString        fConfigFileName;     // name of the config file
   TString        fGAliceFileName;     // name of the galice file
   TObjArray*     fBkgrdFileNames;     // names of background files for merging
+  Bool_t         fUseBkgrdVertex;     // use vertex from background in case of merging
   Bool_t         fRegionOfInterest;   // digitization in region of interest
 
   ClassDef(AliSimulation, 1)  // class for running generation, simulation and digitization
index e9fef675c20b2642cca21ae0ea6769d5031b153b..1d7988d939267e3bb3c3507db6efa3d04afab25b 100644 (file)
@@ -80,6 +80,7 @@
 #pragma link C++ class  AliMC+;
 #pragma link C++ class  AliSimulation+;
 #pragma link C++ class  AliReconstruction+;
+#pragma link C++ class  AliVertexGenFile+;
 #endif
 
 
index 1c6621d06d2a117b2a015b2a4bad0596caac8fb8..ee83df94db63cceac5e3b16d34ebfb655f8a5597 100644 (file)
@@ -17,7 +17,7 @@ AliGausCorr.cxx AliTrackReference.cxx AliESD.cxx \
 AliTrackMap.cxx AliTrackMapper.cxx AliCollisionGeometry.cxx \
 AliMemoryWatcher.cxx AliBarrelTrack.cxx \
 AliESDtrack.cxx AliESDCaloTrack.cxx AliESDMuonTrack.cxx AliESDv0.cxx AliESDcascade.cxx AliESDvertex.cxx AliESDpid.cxx \
-AliMC.cxx AliSimulation.cxx AliReconstruction.cxx
+AliMC.cxx AliSimulation.cxx AliReconstruction.cxx AliVertexGenFile.cxx 
 HDRS:= $(SRCS:.cxx=.h) 
 
 DHDR= STEERLinkDef.h