]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Add possibility if jet kinematic biasing.
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 19 Dec 2001 10:36:19 +0000 (10:36 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 19 Dec 2001 10:36:19 +0000 (10:36 +0000)
EVGEN/AliGenPythia.cxx
EVGEN/AliGenPythia.h

index 1dd1170784ce5443a26d0c990a56cdab508520e8..41e735234c6875cef71f9f76eb4c2d281efa175e 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.45  2001/11/28 08:06:52  morsch
+Use fMaxLifeTime parameter.
+
 Revision 1.44  2001/11/27 13:13:07  morsch
 Maximum lifetime for long-lived particles to be put on the stack is parameter.
 It can be set via SetMaximumLifetime(..).
@@ -147,8 +150,10 @@ AliGenPythia::AliGenPythia()
 // Default Constructor
   fParticles = 0;
   fPythia    = 0;
-  fDecayer = new AliDecayerPythia();
+  fDecayer   = new AliDecayerPythia();
   SetEventListRange();
+  SetJetPhiRange();
+  SetJetEtaRange();
 }
 
 AliGenPythia::AliGenPythia(Int_t npart)
@@ -169,11 +174,13 @@ AliGenPythia::AliGenPythia(Int_t npart)
     fDecayer = new AliDecayerPythia();
     // Set random number generator 
     sRandom=fRandom;
-    SetEventListRange();
     fFlavorSelect   = 0;
     // Produced particles  
     fParticles = new TClonesArray("TParticle",1000);
     fEventVertex.Set(3);
+    SetEventListRange();
+    SetJetPhiRange();
+    SetJetEtaRange();
 }
 
 AliGenPythia::AliGenPythia(const AliGenPythia & Pythia)
@@ -468,7 +475,12 @@ Int_t  AliGenPythia::GenerateMB()
     Int_t np = fParticles->GetEntriesFast();
     Int_t* pParent = new Int_t[np];
     for (i=0; i< np-1; i++) pParent[i] = -1;
-
+    if (fProcess == kPyJets) {
+       TParticle* jet1 = (TParticle *) fParticles->At(6);
+       TParticle* jet2 = (TParticle *) fParticles->At(7);
+       if (!CheckTrigger(jet1, jet2)) return 0;
+    }
+    
     for (i = 0; i<np-1; i++) {
        Int_t trackIt = 0;
        TParticle *  iparticle = (TParticle *) fParticles->At(i);
@@ -545,6 +557,29 @@ void AliGenPythia::MakeHeader()
     gAlice->SetGenEventHeader(header);
 }
        
+
+Bool_t AliGenPythia::CheckTrigger(TParticle* jet1, TParticle* jet2)
+{
+// Check the kinematic trigger condition
+//
+    Double_t eta1      = jet1->Eta();
+    Double_t eta2      = jet2->Eta();
+    Double_t phi1      = jet1->Phi();
+    Double_t phi2      = jet2->Phi();
+    Bool_t   triggered = kFALSE;
+    //Check eta range first...    
+    if ((eta1 < fEtaMaxJet && eta1 > fEtaMinJet) ||
+       (eta2 < fEtaMaxJet && eta2 > fEtaMinJet))
+    {
+       //Eta is okay, now check phi range
+        if ((phi1 < fPhiMaxJet && phi1 > fPhiMinJet) ||
+            (phi2 < fPhiMaxJet && phi2 > fPhiMinJet))
+        {
+           triggered = kTRUE;
+        }
+    }
+    return triggered;
+}
          
 AliGenPythia& AliGenPythia::operator=(const  AliGenPythia& rhs)
 {
index 0860884f097bca08516e586df8609d44e5868865..b3b6601fd6c31b5675fcca6be3e6751709c9ce35 100644 (file)
@@ -36,9 +36,14 @@ class AliGenPythia : public AliGenMC
     virtual void    SetEnergyCMS(Float_t energy = 5500) {fEnergyCMS = energy;}
     // treat protons as inside nuclei
     virtual void    SetNuclei(Int_t a1, Int_t a2);
+    virtual void    SetJetEtaRange(Float_t etamin = -20., Float_t etamax = 20.)
+       {fEtaMinJet = etamin; fEtaMaxJet = etamax;}
+    virtual void    SetJetPhiRange(Float_t phimin = -180., Float_t phimax = 180.)
+       {fPhiMinJet = TMath::Pi()*phimin/180.; fPhiMaxJet = TMath::Pi()*phimax/180.;}
     // get cross section of process
     virtual Float_t GetXsection() {return fXsection;}      
     virtual void    FinishRun();
+    Bool_t CheckTrigger(TParticle* jet1, TParticle* jet2);
     
     // Assignment Operator
     AliGenPythia & operator=(const AliGenPythia & rhs);
@@ -64,6 +69,11 @@ class AliGenPythia : public AliGenMC
     AliDecayer  *fDecayer;        //!Pointer to the decayer instance
     Int_t       fDebugEventFirst; //!First event to debug
     Int_t       fDebugEventLast;  //!Last  event to debug
+    Float_t     fEtaMinJet;      // Minimum eta of triggered Jet
+    Float_t     fEtaMaxJet;      // Maximum eta of triggered Jet
+    Float_t     fPhiMinJet;      // At least one of triggered Jets must be in this
+    Float_t     fPhiMaxJet;      // phi range
+
  private:
     // adjust the weight from kinematic cuts
     void   AdjustWeights();