Use local SetTrack, KeepTrack and SetHighWaterMark methods
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 27 Jul 2001 17:09:36 +0000 (17:09 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 27 Jul 2001 17:09:36 +0000 (17:09 +0000)
to delegate either to local stack or to stack owned by AliRun.
(Piotr Skowronski, A.M.)

12 files changed:
EVGEN/AliGenBox.cxx
EVGEN/AliGenDoubleScan.cxx
EVGEN/AliGenExtFile.cxx
EVGEN/AliGenFLUKAsource.cxx
EVGEN/AliGenFixed.cxx
EVGEN/AliGenHIJINGpara.cxx
EVGEN/AliGenHalo.cxx
EVGEN/AliGenHaloProtvino.cxx
EVGEN/AliGenHijing.cxx
EVGEN/AliGenParam.cxx
EVGEN/AliGenPythia.cxx
EVGEN/AliGenScan.cxx

index 2f8e9bf..7447b15 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.5  2000/12/21 16:24:06  morsch
+Coding convention clean-up
+
 Revision 1.4  2000/11/30 07:12:49  alibrary
 Introducing new Rndm and QA classes
 
@@ -132,7 +135,7 @@ void AliGenBox::Generate()
                    TMath::Sqrt(-2*TMath::Log(random[2*j+1]));
            }
        }
-       gAlice->SetTrack(fTrackIt,-1,fIpart,p,origin,polar,0,kPPrimary,nt);
+       SetTrack(fTrackIt,-1,fIpart,p,origin,polar,0,kPPrimary,nt);
     }
 }
 
index 93eff9f..3597984 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.6  2000/12/21 16:24:06  morsch
+Coding convention clean-up
+
 Revision 1.5  2000/12/06 15:11:38  morsch
 Correct double declared data members.
 
@@ -108,7 +111,7 @@ void AliGenDoubleScan::Generate()
              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,kPPrimary,nt);
+             SetTrack(fTrackIt,-1,fIpart,p,origin,polar,0,kPPrimary,nt);
 //
 // Generate 2nd particle at distance fDistance from  the first
 //
@@ -124,7 +127,7 @@ void AliGenDoubleScan::Generate()
              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,kPPrimary,nt);
+             SetTrack(fTrackIt,-1,fIpart,p,origin,polar,0,kPPrimary,nt);
          }
       }
   }
index 85d3fb3..04057a5 100644 (file)
 
 /*
 $Log$
+Revision 1.15  2001/01/23 13:29:37  morsch
+Add method SetParticleCode and enum type Code_t to handle both PDG (new ntuples)
+and GEANT3 codes (old ntuples) in input file.
+
 Revision 1.14  2000/12/21 16:24:06  morsch
 Coding convention clean-up
 
@@ -213,7 +217,7 @@ void AliGenExtFile::Generate()
                      TMath::Sqrt(-2*TMath::Log(random[2*j+1]));
              }
          }
-         gAlice->SetTrack(fTrackIt,-1,fIdpart,p,origin,polar,0,kPPrimary,nt);
+         SetTrack(fTrackIt,-1,fIdpart,p,origin,polar,0,kPPrimary,nt);
       }
       fNcurrent++;
       nb = (Int_t)h2->GetEvent(fNcurrent); 
index 2905767..d4e05f0 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.14  2001/03/21 11:28:20  morsch
+Use enum constants for particle selection.
+
 Revision 1.13  2000/12/21 16:24:06  morsch
 Coding convention clean-up
 
@@ -276,7 +279,7 @@ void AliGenFLUKAsource::Generate()
        if (part==1 && iwgt>100) iwgt=100;
        Int_t nstack=0;
        for (j=0; j<iwgt; j++) {
-           gAlice->SetTrack(fTrackIt,-1,part,p,origin,polar,fAge,kPPrimary,nt);
+           SetTrack(fTrackIt,-1,part,p,origin,polar,fAge,kPPrimary,nt);
            Rndm(random,2);
            phi=2*random[1]*TMath::Pi();
            Float_t pn1=p[0]*TMath::Sin(phi) - p[1]*TMath::Cos(phi);
index 1f30d09..a4d39bc 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.5  2001/02/24 11:41:59  morsch
+SetGun allows specify completely the particle kinematics and position in one go. (FCA)
+
 Revision 1.4  2000/12/21 16:24:06  morsch
 Coding convention clean-up
 
@@ -95,7 +98,7 @@ void AliGenFixed::Generate()
   Int_t i, nt;
   //
   for(i=0;i<fNpart;i++) 
-    gAlice->SetTrack(fTrackIt,-1,fIpart,fP,fOrigin.GetArray(),polar,0,kPPrimary,nt);
+    SetTrack(fTrackIt,-1,fIpart,fP,fOrigin.GetArray(),polar,0,kPPrimary,nt);
   
 }
   
index bd0a01d..cae12bb 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.8  2001/07/20 11:03:58  morsch
+Issue warning message if used outside allowed eta range (-8 to 8).
+
 Revision 1.7  2001/07/17 12:41:01  morsch
 - Calculation of fraction of event corresponding to selected pt-range corrected
 (R. Turrisi)
@@ -329,7 +332,7 @@ void AliGenHIJINGpara::Generate()
                        TMath::Sqrt(-2*TMath::Log(random[2*j+1]));
                }
            }
-           gAlice->SetTrack(fTrackIt,-1,part,p,origin,polar,0,kPPrimary,nt,fParentWeight);
+           SetTrack(fTrackIt,-1,part,p,origin,polar,0,kPPrimary,nt,fParentWeight);
            break;
        }
     }
index d4997ed..cb0c814 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.10  2000/12/21 16:24:06  morsch
+Coding convention clean-up
+
 Revision 1.9  2000/11/30 07:12:50  alibrary
 Introducing new Rndm and QA classes
 
@@ -139,12 +142,12 @@ void AliGenHalo::Generate()
       p[1]=p0*ty;
       p[2]=p0*tz;
       fParentWeight=wgt;
-      gAlice->SetTrack(fTrackIt,-1,ipart,p,origin,polar,0,kPNoProcess,nt,fParentWeight);
-//      gAlice->SetTrack(fTrackIt,-1,ipart,p,origin,polar,0,"Halo+",nt,fParentWeight);
+      SetTrack(fTrackIt,-1,ipart,p,origin,polar,0,kPNoProcess,nt,fParentWeight);
+//    SetTrack(fTrackIt,-1,ipart,p,origin,polar,0,"Halo+",nt,fParentWeight);
       origin[2]=-origin[2];
       p[2]=-p[2];
-      gAlice->SetTrack(fTrackIt,-1,ipart,p,origin,polar,0,kPNoProcess,nt,fParentWeight);
-//      gAlice->SetTrack(fTrackIt,-1,ipart,p,origin,polar,0,"Halo-",nt,fParentWeight);
+      SetTrack(fTrackIt,-1,ipart,p,origin,polar,0,kPNoProcess,nt,fParentWeight);
+//    SetTrack(fTrackIt,-1,ipart,p,origin,polar,0,"Halo-",nt,fParentWeight);
       origin[2]=-origin[2];
       p[2]=-p[2];
   }
index d7a88d9..dc01060 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.2  2001/06/14 12:15:27  morsch
+Bugs corrected. SetSide() method added.
+
 Revision 1.1  2001/01/23 15:04:33  morsch
 Generator to read beam halo file from Protvino group.
 
@@ -156,13 +159,11 @@ void AliGenHaloProtvino::Generate()
          p[2]       = -p[2];
       }
       
-      gAlice->SetTrack(0,-1,kProton,pP,originP,polar,0,kPNoProcess,ntP);
-      gAlice->KeepTrack(ntP);
-      
-      
+      SetTrack(0,-1,kProton,pP,originP,polar,0,kPNoProcess,ntP);
+      KeepTrack(ntP);
       fParentWeight=wgt*GassPressureWeight(zPrimary);
-      gAlice->SetTrack(fTrackIt,ntP,ipart,p,origin,polar,0,kPNoProcess,nt,fParentWeight);
-      gAlice->SetHighWaterMark(nt);
+      SetTrack(fTrackIt,ntP,ipart,p,origin,polar,0,kPNoProcess,nt,fParentWeight);
+      SetHighWaterMark(nt);
       
       //
       // Assume particles come from two directions with same probability
@@ -170,7 +171,7 @@ void AliGenHaloProtvino::Generate()
       origin[2]=-origin[2];
       p[2]=-p[2];
       fParentWeight=wgt*GassPressureWeight(-zPrimary);
-      gAlice->SetTrack(fTrackIt,ntP,ipart,p,origin,polar,0,kPNoProcess,nt,fParentWeight);
+      SetTrack(fTrackIt,ntP,ipart,p,origin,polar,0,kPNoProcess,nt,fParentWeight);
       origin[2]=-origin[2];
       p[2]=-p[2];
       origin[2]=-origin[2];
index f70bf1a..67a27da 100644 (file)
 
 /*
 $Log$
+Revision 1.24  2001/07/20 09:34:56  morsch
+Count the number of spectator neutrons and protons and add information
+to the event header. (Chiara Oppedisano)
+
 Revision 1.23  2001/07/13 17:30:22  morsch
 Derive from AliGenMC.
 
@@ -279,10 +283,9 @@ void AliGenHijing::Generate()
 // Put particle on the stack ... 
 //             printf("\n set track mother: %d %d %d %d %d %d ",i,imo, kf, nt+1, selected, hasSelectedDaughters);
            
-           gAlice->SetTrack(0,imo,kf,p,origin,polar,
-                            tof,kPPrimary,nt);
+           SetTrack(0,imo,kf,p,origin,polar, tof,kPPrimary,nt);
 // ... and keep it there
-           gAlice->KeepTrack(nt);
+           KeepTrack(nt);
 //
            *(newPos+i)=nt;
         } // selected
@@ -333,9 +336,9 @@ void AliGenHijing::Generate()
                imo = (mother->GetPdgCode() != 92) ? imo=*(newPos+imo) : -1;
            }   
 // Put particle on the stack
-           gAlice->SetTrack(fTrackIt,imo,kf,p,origin,polar,
+           SetTrack(fTrackIt,imo,kf,p,origin,polar,
                             tof,kPNoProcess,nt);
-           gAlice->KeepTrack(nt);
+           KeepTrack(nt);
            *(newPos+i)=nt;
         } // selected
       } // particle loop final state
@@ -354,7 +357,7 @@ void AliGenHijing::Generate()
   } // event loop
   MakeHeader();
   
-  gAlice->SetHighWaterMark(nt);
+  SetHighWaterMark(nt);
 }
 
 void AliGenHijing::KeepFullEvent()
index 07dcca9..de0ff76 100644 (file)
 
 /*
 $Log$
+Revision 1.31  2001/07/13 10:58:54  morsch
+- Some coded moved to AliGenMC
+- Improved handling of secondary vertices.
+
 Revision 1.30  2001/06/15 07:55:04  morsch
 Put only first generation decay products on the stack.
 
@@ -448,9 +452,9 @@ void AliGenParam::Generate()
                  ipa++;
 //
 // Parent
-                 gAlice->SetTrack(0, -1, iPart, p, origin0, polar, 0, kPPrimary, nt, wgtp);
+                 SetTrack(0, -1, iPart, p, origin0, polar, 0, kPPrimary, nt, wgtp);
                  pParent[0] = nt;
-                 gAlice->KeepTrack(nt); 
+                 KeepTrack(nt); 
 //
 // Decay Products
 //               
@@ -473,11 +477,11 @@ void AliGenParam::Generate()
                              iparent = -1;
                          }
                          printf("\n SetTrack %d %d %d %d", i, kf, iparent, trackIt[i]);
-                         gAlice->SetTrack(fTrackIt*trackIt[i], iparent, kf,
+                         SetTrack(fTrackIt*trackIt[i], iparent, kf,
                                           pc, och, polar,
                                           0, kPDecay, nt, wgtch);
                          pParent[i] = nt;
-                         gAlice->KeepTrack(nt); 
+                         KeepTrack(nt); 
                      }
                  }
              }  // Decays by Lujet
@@ -496,7 +500,7 @@ void AliGenParam::Generate()
          break;
     } // while
   } // event loop
-  gAlice->SetHighWaterMark(nt);
+  SetHighWaterMark(nt);
 }
 
 AliGenParam& AliGenParam::operator=(const  AliGenParam& rhs)
index d4cf4fc..31d9caa 100644 (file)
 
 /*
 $Log$
+Revision 1.38  2001/07/13 10:58:54  morsch
+- Some coded moved to AliGenMC
+- Improved handling of secondary vertices.
+
 Revision 1.37  2001/06/28 11:17:28  morsch
 SetEventListRange setter added. Events in specified range are listed for
 debugging. (Yuri Kharlov)
@@ -394,10 +398,10 @@ void AliGenPythia::Generate()
                    Int_t ipa = iparticle->GetFirstMother()-1;
                    Int_t iparent = (ipa > -1) ? pParent[ipa] : -1;
 //                 printf("\n SetTrack %d %d %d %d", i, iparent, kf, trackIt[i]);
-                   gAlice->SetTrack(fTrackIt*trackIt[i] ,
+                   SetTrack(fTrackIt*trackIt[i] ,
                                     iparent, kf, p, origin, polar, tof, kPPrimary, nt, 1.);
                    pParent[i] = nt;
-                   gAlice->KeepTrack(nt); 
+                   KeepTrack(nt); 
                } //  SetTrack loop
            }
        } else {
@@ -413,7 +417,7 @@ void AliGenPythia::Generate()
            }
        }
     } // event loop
-    gAlice->SetHighWaterMark(nt);
+    SetHighWaterMark(nt);
 //  adjust weight due to kinematic selection
     AdjustWeights();
 //  get cross-section
@@ -461,9 +465,9 @@ Int_t  AliGenPythia::GenerateMB()
            origin[1]=origin0[1]+iparticle->Vy()/10.;
            origin[2]=origin0[2]+iparticle->Vz()/10.;
            Float_t tof=kconv*iparticle->T();
-           gAlice->SetTrack(fTrackIt*trackIt, iparent, kf, p, origin, polar,
+           SetTrack(fTrackIt*trackIt, iparent, kf, p, origin, polar,
                             tof, kPPrimary, nt);
-           gAlice->KeepTrack(nt);
+           KeepTrack(nt);
            pParent[i] = nt;
        } // select particle
     } // particle loop 
index 90c9a66..bb8ee77 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.8  2000/12/06 15:11:38  morsch
+Correct double declared data members.
+
 Revision 1.7  2000/11/30 07:12:50  alibrary
 Introducing new Rndm and QA classes
 
@@ -140,7 +143,7 @@ void AliGenScan::Generate()
              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,kPPrimary,nt);
+             SetTrack(fTrackIt,-1,fIpart,p,origin,polar,0,kPPrimary,nt);
          }
       }
   }