]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EVGEN/AliGenBox.cxx
Update timestamps for new AMANDA simulation (17/02/2015)
[u/mrichter/AliRoot.git] / EVGEN / AliGenBox.cxx
index 112da0d00c972320b86f6529191ac11caf39fb54..197a8c09b82aa1b5be1a2142595b8c586d7f9005 100644 (file)
@@ -62,10 +62,19 @@ AliGenBox::AliGenBox(Int_t npart)
 
 //_____________________________________________________________________________
 
-void AliGenBox::Generate()
+void AliGenBox::Generate() {
+  //
+  // Generate one trigger (fNpart particles)
+  //
+  GenerateN(1);
+}
+//_____________________________________________________________________________
+void AliGenBox::GenerateN(Int_t ntimes)
 {
   //
-  // Generate one trigger
+  // Generate ntimes triggers
+  //   total ntimes*fNpart particles
   //
   
     Float_t polar[3]= {0,0,0};
@@ -89,7 +98,8 @@ void AliGenBox::Generate()
 
     Double_t m = TDatabasePDG::Instance()->GetParticle(fIpart)->Mass();
 
-    for(i=0;i<fNpart;i++) {
+    Int_t mult = fNpart*ntimes;
+    for(i=0;i<mult;i++) {
        Rndm(random,3);
        
        if (TestBit(kYRange)) {
@@ -143,16 +153,17 @@ void AliGenBox::Generate()
              TMath::Cos(2*random[0]*TMath::Pi())*
              TMath::Sqrt(-2*TMath::Log(random[1]));
        }
-       PushTrack(fTrackIt,-1,fIpart,p,origin,polar,time,kPPrimary,nt);
+       PushTrack(fTrackIt,-1,fIpart,p,origin,polar,time,kPPrimary,nt, 1., 1);
     }
 
     AliGenEventHeader* header = new AliGenEventHeader("BOX");
     header->SetPrimaryVertex(fVertex);
-    header->SetNProduced(fNpart);
+    header->SetNProduced(mult);
     header->SetInteractionTime(fTime);
     
  // Passes header either to the container or to gAlice
     if (fContainer) {
+        header->SetName(fName);
        fContainer->AddHeader(header);
     } else {
        gAlice->SetGenEventHeader(header);      
@@ -172,7 +183,5 @@ void AliGenBox::Init()
     Fatal("Init","You should only set the range of one of these variables: y, eta or theta\n");
   if((!TestBit(kYRange)) && (!TestBit(kEtaRange)) && (!TestBit(kThetaRange)) )
     Fatal("Init","You should set the range of one of these variables: y, eta or theta\n");
-
-  AliPDG::AddParticlesToPdgDataBase();
 }