]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - THijing/AliGenHijing.cxx
First prototype of the new AliCluster base class
[u/mrichter/AliRoot.git] / THijing / AliGenHijing.cxx
index fb09ce87e3fd2c9d9dd0a621447bc29b71edca1f..f9f910020be475c9266f7fa0f286b3272d7d473d 100644 (file)
@@ -22,6 +22,7 @@
 // Andreas Morsch    (andreas.morsch@cern.ch)
 //
 
+#include <TClonesArray.h>
 #include <TGraph.h>
 #include <THijing.h>
 #include <TLorentzVector.h>
 ClassImp(AliGenHijing)
 
 AliGenHijing::AliGenHijing()
-                 :AliGenMC()
+    :AliGenMC(),
+     fFrame("CMS"),
+     fMinImpactParam(0.),
+     fMaxImpactParam(5.),
+     fKeep(0),
+     fQuench(1),
+     fShadowing(1),
+     fDecaysOff(1),
+     fTrigger(0),     
+     fEvaluate(0),
+     fSelectAll(0),
+     fFlavor(0),
+     fEnergyCMS(5500.),
+     fKineBias(0.),
+     fTrials(0),
+     fXsection(0.),
+     fHijing(0),
+     fPtHardMin(0.),
+     fPtHardMax(1.e4),
+     fSpectators(1),
+     fDsigmaDb(0),
+     fDnDb(0),
+     fPtMinJet(-2.5),
+     fEtaMinJet(-20.),
+     fEtaMaxJet(+20.),
+     fPhiMinJet(0.),
+     fPhiMaxJet(2. * TMath::Pi()),
+     fRadiation(3),
+     fSimpleJet(kFALSE),
+     fNoGammas(kFALSE),
+     fProjectileSpecn(0),
+     fProjectileSpecp(0),
+     fTargetSpecn(0),
+     fTargetSpecp(0),
+     fLHC(kFALSE),
+     fRandomPz(kFALSE),
+     fNoHeavyQuarks(kFALSE)
 {
 // Constructor
     fParticles = 0;
-    fHijing    = 0;
-    fDsigmaDb  = 0;
-    fDnDb      = 0;
     AliHijingRndm::SetHijingRandom(GetRandom());
 }
 
 AliGenHijing::AliGenHijing(Int_t npart)
-    :AliGenMC(npart)
+    :AliGenMC(npart),
+     fFrame("CMS"),
+     fMinImpactParam(0.),
+     fMaxImpactParam(5.),
+     fKeep(0),
+     fQuench(1),
+     fShadowing(1),
+     fDecaysOff(1),
+     fTrigger(0),     
+     fEvaluate(0),
+     fSelectAll(0),
+     fFlavor(0),
+     fEnergyCMS(5500.),
+     fKineBias(0.),
+     fTrials(0),
+     fXsection(0.),
+     fHijing(0),
+     fPtHardMin(0.),
+     fPtHardMax(1.e4),
+     fSpectators(1),
+     fDsigmaDb(0),
+     fDnDb(0),
+     fPtMinJet(-2.5),
+     fEtaMinJet(-20.),
+     fEtaMaxJet(+20.),
+     fPhiMinJet(0.),
+     fPhiMaxJet(2. * TMath::Pi()),
+     fRadiation(3),
+     fSimpleJet(kFALSE),
+     fNoGammas(kFALSE),
+     fProjectileSpecn(0),
+     fProjectileSpecp(0),
+     fTargetSpecn(0),
+     fTargetSpecp(0),
+     fLHC(kFALSE),
+     fRandomPz(kFALSE),
+     fNoHeavyQuarks(kFALSE)
 {
 // Default PbPb collisions at 5. 5 TeV
 //
     fName = "Hijing";
     fTitle= "Particle Generator using HIJING";
-
-    SetEnergyCMS();
-    SetImpactParameterRange();
-    SetBoostLHC();
-    SetJetEtaRange();
-    SetJetPhiRange();
-    
-    fKeep       =  0;
-    fQuench     =  1;
-    fShadowing  =  1;
-    fTrigger    =  0;
-    fDecaysOff  =  1;
-    fEvaluate   =  0;
-    fSelectAll  =  0;
-    fFlavor     =  0;
-    fSpectators =  1;
-    fDsigmaDb   =  0;
-    fDnDb       =  0;
-    fPtMinJet   = -2.5;        
-    fRadiation  =  3;
-    //
-    SetSimpleJets();
-    SetNoGammas();
-    SetRandomPz();
-    SwitchOffHeavyQuarks(kFALSE);
 //
     fParticles = new TClonesArray("TParticle",10000);    
 //
 // Set random number generator   
     AliHijingRndm::SetHijingRandom(GetRandom());
-    fHijing = 0;
-
-}
-
-AliGenHijing::AliGenHijing(const AliGenHijing & hijing):
-    AliGenMC(hijing)
-{
-// copy constructor
 }
 
-
 AliGenHijing::~AliGenHijing()
 {
 // Destructor
@@ -189,7 +225,7 @@ void AliGenHijing::Generate()
 //
   Int_t nt  = 0;
   Int_t jev = 0;
-  Int_t j, kf, ks, imo;
+  Int_t j, kf, ks, ksp, imo;
   kf = 0;
     
 
@@ -283,14 +319,15 @@ void AliGenHijing::Generate()
          Bool_t  selected             =  kTRUE;
          kf        = iparticle->GetPdgCode();
          ks        = iparticle->GetStatusCode();
+         ksp       = iparticle->GetUniqueID();
          
 // --------------------------------------------------------------------------
 // Count spectator neutrons and protons
-         if(ks == 0 || ks == 1){
+         if(ksp == 0 || ksp == 1){
              if(kf == kNeutron) fProjectileSpecn += 1;
              if(kf == kProton)  fProjectileSpecp += 1;
          }
-         else if(ks == 10 || ks == 11){
+         else if(ksp == 10 || ksp == 11){
              if(kf == kNeutron) fTargetSpecn += 1;
              if(kf == kProton)  fTargetSpecp += 1;
          }
@@ -298,8 +335,8 @@ void AliGenHijing::Generate()
 //         
          if (!fSelectAll) {
              selected = KinematicSelection(iparticle,0)&&SelectFlavor(kf);
-             if (!fSpectators && selected) selected = (ks != 0 && ks != 1 && ks != 10
-                                                       && ks != 11);
+             if (!fSpectators && selected) selected = (ksp != 0 && ksp != 1 && ksp != 10
+                                                       && ksp != 11);
          }
 //
 // Put particle on the stack if selected
@@ -309,9 +346,15 @@ void AliGenHijing::Generate()
              pSelected[i] = 1;
          } // selected
       } // particle loop final state
+
 //
-// Write particles to stack
+//    Time of the interactions
+      Float_t tInt = 0.;
+      if (fPileUpTimeWindow > 0.) tInt = fPileUpTimeWindow * (2. * gRandom->Rndm() - 1.);
+
 //
+// Write particles to stack
+
       for (i = 0; i<np; i++) {
          TParticle *  iparticle = (TParticle *) fParticles->At(i);
          Bool_t  hasMother   = (iparticle->GetFirstMother()     >=0);
@@ -325,7 +368,9 @@ void AliGenHijing::Generate()
              origin[0] = origin0[0]+iparticle->Vx()/10;
              origin[1] = origin0[1]+iparticle->Vy()/10;
              origin[2] = origin0[2]+iparticle->Vz()/10;
-             tof = kconv*iparticle->T();
+             tof = kconv * iparticle->T() + sign * origin0[2] / 3.e10;
+             if (fPileUpTimeWindow > 0.) tof += tInt;
+             
              imo = -1;
              TParticle* mother = 0;
              if (hasMother) {
@@ -334,8 +379,7 @@ void AliGenHijing::Generate()
                  imo = (mother->GetPdgCode() != 92) ? newPos[imo] : -1;
              } // if has mother   
              Bool_t tFlag = (fTrackIt && !hasDaughter);
-             PushTrack(tFlag,imo,kf,p,origin,polar,
-                      tof,kPNoProcess,nt, 1., ks);
+             PushTrack(tFlag,imo,kf,p,origin,polar,tof,kPNoProcess,nt, 1., ks);
 
              
              KeepTrack(nt);
@@ -598,8 +642,8 @@ Bool_t AliGenHijing::CheckTrigger()
        for (Int_t i = 0; i < np; i++) {
            TParticle* part = (TParticle*) fParticles->At(i);
            Int_t kf = part->GetPdgCode();
-           Int_t ks = part->GetStatusCode();
-           if (kf == 22 && ks == 40) {
+           Int_t ksp = part->GetUniqueID();
+           if (kf == 22 && ksp == 40) {
                Float_t phi = part->Phi();
                Float_t eta = part->Eta();
                if  (eta < fEtaMaxJet && 
@@ -614,16 +658,3 @@ Bool_t AliGenHijing::CheckTrigger()
     } // fTrigger == 2
     return triggered;
 }
-
-
-void AliGenHijing::Copy(TObject &) const
-{
-  Fatal("Copy","Not implemented!\n");
-}
-
-AliGenHijing& AliGenHijing::operator=(const  AliGenHijing& rhs)
-{
-    rhs.Copy(*this); 
-    return (*this);
-}
-