]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Option for gamma, jet selection in eta-phi window (G. Conesa)
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 16 Dec 2008 08:50:06 +0000 (08:50 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 16 Dec 2008 08:50:06 +0000 (08:50 +0000)
THerwig/AliGenHerwig.cxx
THerwig/AliGenHerwig.h

index 9578c55ab6af27c9bb85644134ef74ea135ce62d..a6779ce75be0150eb1e26bfb15500ef0a0c20194 100644 (file)
@@ -54,13 +54,22 @@ ClassImp(AliGenHerwig)
     fHerwig(0x0),
     fProcess(0),
     fPtHardMin(0.),
+    fPtHardMax(9999.),
     fPtRMS(0.),
     fMaxPr(10),
     fMaxErrors(1000),
     fEnSoft(1),
     fEv1Pr(0),
     fEv2Pr(0),
-    fFileName(0)
+    fFileName(0),
+    fEtaMinParton(-20.),     
+    fEtaMaxParton(20.),     
+    fPhiMinParton(0.),     
+    fPhiMaxParton(2.* TMath::Pi()),     
+    fEtaMinGamma(-20.),      
+    fEtaMaxGamma(20.),      
+    fPhiMinGamma(0.),      
+    fPhiMaxGamma(2. * TMath::Pi())  
 {
 // Constructor
   fEnergyCMS = 14000;
@@ -84,13 +93,22 @@ AliGenHerwig::AliGenHerwig(Int_t npart)
     fHerwig(0x0),
     fProcess(0),
     fPtHardMin(0.),
+    fPtHardMax(9999.),
     fPtRMS(0.),
     fMaxPr(10),
     fMaxErrors(1000),
     fEnSoft(1),
     fEv1Pr(0),
     fEv2Pr(0),
-    fFileName(0)
+    fFileName(0),
+    fEtaMinParton(-20.),     
+    fEtaMaxParton(20.),     
+    fPhiMinParton(0.),     
+    fPhiMaxParton(2.* TMath::Pi()),     
+    fEtaMinGamma(-20.),      
+    fEtaMaxGamma(20.),      
+    fPhiMinGamma(0.),      
+    fPhiMaxGamma(2. * TMath::Pi())  
 {
     fEnergyCMS = 14000;
     SetTarget();
@@ -145,7 +163,7 @@ void AliGenHerwig::Init()
 
   if ( fProcess < 0 ) strncpy(VVJIN.QQIN,fFileName.Data(),50);
 
-  fHerwig->Hwusta("PI0     ");
+  //fHerwig->Hwusta("PI0     ");
 
   // compute parameter dependent constants
   fHerwig->PrepareRun();
@@ -185,7 +203,7 @@ void AliGenHerwig::InitJimmy()
 
   if ( fProcess < 0 ) strncpy(VVJIN.QQIN,fFileName.Data(),50);
 
-  fHerwig->Hwusta("PI0     ");
+  //  fHerwig->Hwusta("PI0     ");
 
   // compute parameter dependent constants
   fHerwig->PrepareRunJimmy();
@@ -289,6 +307,14 @@ void AliGenHerwig::Generate()
        Int_t np = particles->GetEntriesFast()-1;
        if (np == 0 ) continue;
 
+       //Check hard partons or direct gamma in kine range
+
+       if (fProcess == kHeJets || fProcess == kHeDirectGamma) {
+         TParticle* parton1 = (TParticle *) particles->At(6);
+         TParticle* parton2 = (TParticle *) particles->At(7);
+         if (!CheckParton(parton1, parton2))  continue ;
+       } 
+
        Int_t nc=0;
 
        Int_t * newPos = new Int_t[np];
@@ -338,6 +364,53 @@ void AliGenHerwig::Generate()
   AdjustWeights();
 //  get cross-section
   fXsection=fHerwig->GetAVWGT();
+  //printf(">> trials << %d\n",fTrials);
+}
+
+Bool_t AliGenHerwig::CheckParton(TParticle* parton1, TParticle* parton2)
+{
+// Check the kinematic trigger condition
+//
+//Select events with parton max energy
+    if(fPtHardMax < parton1->Pt()) return kFALSE;
+
+// Select events within angular window
+    Double_t eta[2];
+    eta[0] = parton1->Eta();
+    eta[1] = parton2->Eta();
+    Double_t phi[2];
+    phi[0] = parton1->Phi();
+    phi[1] = parton2->Phi();
+    Int_t    pdg[2]; 
+    pdg[0] = parton1->GetPdgCode();
+    pdg[1] = parton2->GetPdgCode();   
+    printf("min %f, max %f\n",fPtHardMin, fPtHardMax);
+    printf("Parton 1: %s, pT= %2.2f, eta = %1.2f, phi = %2.2f\n", parton1->GetName(),parton1->Pt(), eta[0],phi[0]*TMath::RadToDeg());
+    printf("Parton 2: %s, pT= %2.2f, eta = %1.2f, phi = %2.2f\n", parton2->GetName(),parton2->Pt(), eta[1],phi[1]*TMath::RadToDeg());
+    
+    if (fProcess == kHeJets) {
+      //Check if one of the 2 outgoing partons are in the eta-phi window
+      for(Int_t i = 0; i < 2; i++)
+       if ((eta[i] < fEtaMaxParton  && eta[i] > fEtaMinParton) &&
+           (phi[i] < fPhiMaxParton  && phi[i] > fPhiMinParton)) return  kTRUE ;
+    }
+    
+    else {
+      //Check if the gamma and the jet  are in the eta-phi window
+      Int_t igj = 0;
+      Int_t ijj = 0;
+      if(pdg[0] == 22) ijj=1;
+      else igj=1;
+      if ((eta[ijj] < fEtaMaxParton   && eta[ijj] > fEtaMinParton) &&
+         (phi[ijj] < fPhiMaxParton   && phi[ijj] > fPhiMinParton)) {
+       
+       if ((eta[igj] < fEtaMaxGamma   && eta[igj] > fEtaMinGamma) &&
+           (phi[igj] < fPhiMaxGamma   && phi[igj] > fPhiMinGamma)) return  kTRUE;
+       
+      }
+    }
+
+    return kFALSE ;
 }
 
 void AliGenHerwig::AdjustWeights()
index 2e4206a9e78e731bd776ea29e8d00f81b5f962e3..d3a706ee1947492546b7cae334724c7bb46bdbbe 100644 (file)
@@ -26,7 +26,7 @@ class AliGenHerwig : public AliGenMC
 
 {
     enum {kNoTrigger, kHardProcesses, kDirectPhotons};
-
+    enum {kHeJets = 1500, kHeDirectGamma = 1800};
  public:
     AliGenHerwig();
     AliGenHerwig(Int_t npart);
@@ -46,6 +46,7 @@ class AliGenHerwig : public AliGenMC
     virtual void    SetStrucFunc(StrucFunc_t func = kCTEQ5L)
       {fStrucFunc = func;}
     virtual void    SetPtHardMin(Double_t pt) {fPtHardMin=pt;}
+    virtual void    SetPtHardMax(Double_t pt) {fPtHardMax=pt;}
     virtual void    SetPtRMS(Double_t pt) {fPtRMS=pt;}
     virtual void    SetMaxPr(Int_t i) {fMaxPr=i;}
     virtual void    SetMaxErrors(Int_t i) {fMaxErrors=i;}
@@ -56,6 +57,29 @@ class AliGenHerwig : public AliGenMC
     virtual void    SetHardProcessFile(TString filename) {fFileName=TString(filename);};
     virtual void    SetEventListRange(Int_t eventFirst=-1, Int_t eventLast=-1);
 
+    virtual Bool_t CheckParton(TParticle* parton1, TParticle* parton2);
+
+    virtual void         GetPartonEtaRange(Float_t& etamin, Float_t& etamax) const
+       {etamin = fEtaMinParton; etamax = fEtaMaxParton;}
+    virtual void         GetPartonPhiRange(Float_t& phimin, Float_t& phimax) const
+       {phimin = fPhiMinParton*180./TMath::Pi(); phimax = fPhiMaxParton*180/TMath::Pi();}
+    virtual void         GetGammaEtaRange(Float_t& etamin, Float_t& etamax) const
+       {etamin = fEtaMinGamma; etamax = fEtaMaxGamma;}
+    virtual void         GetGammaPhiRange(Float_t& phimin, Float_t& phimax) const
+       {phimin = fPhiMinGamma*180./TMath::Pi(); phimax = fPhiMaxGamma*180./TMath::Pi();}
+
+    virtual void    SetPartonEtaRange(Float_t etamin = -20., Float_t etamax = 20.)
+       {fEtaMinParton = etamin; fEtaMaxParton = etamax;}
+    // Phi range for jet trigger
+    virtual void    SetPartonPhiRange(Float_t phimin = 0., Float_t phimax = 360.)
+       {fPhiMinParton = TMath::Pi()*phimin/180.; fPhiMaxParton = TMath::Pi()*phimax/180.;}
+    // Eta range for gamma trigger 
+    virtual void    SetGammaEtaRange(Float_t etamin = -20., Float_t etamax = 20.)
+       {fEtaMinGamma = etamin; fEtaMaxGamma = etamax;}
+    // Phi range for gamma trigger
+    virtual void    SetGammaPhiRange(Float_t phimin = 0., Float_t phimax = 360.)
+       {fPhiMinGamma = TMath::Pi()*phimin/180.; fPhiMaxGamma = TMath::Pi()*phimax/180.;}
+
  protected:
     Bool_t SelectFlavor(Int_t pid);
 
@@ -75,7 +99,8 @@ class AliGenHerwig : public AliGenMC
     Float_t     fXsection;       // Cross-section
     THerwig6    *fHerwig;        // Herwig
     Int_t       fProcess;        // Process number
-    Double_t    fPtHardMin;      // lower pT-hard cut
+    Double_t    fPtHardMin;      // higher pT-hard cut
+    Double_t    fPtHardMax;      // lower pT-hard cut
     Double_t    fPtRMS;          // intrinsic pt of incoming hadrons
     Int_t       fMaxPr;          // maximum number of events to print out
     Int_t       fMaxErrors;      // maximum number of errors allowed
@@ -83,6 +108,14 @@ class AliGenHerwig : public AliGenMC
     Int_t       fEv1Pr;          // first event to be printed
     Int_t       fEv2Pr;          // last event to be printed
     TString     fFileName;       //!Name of file to read from hard scattering
+    Float_t     fEtaMinParton;         //Minimum eta of parton shower
+    Float_t     fEtaMaxParton;         //Maximum eta of parton shower
+    Float_t     fPhiMinParton;         //Minimum phi of parton shower
+    Float_t     fPhiMaxParton;         //Maximum phi of parton shower
+    Float_t     fEtaMinGamma;       // Minimum eta of triggered gamma
+    Float_t     fEtaMaxGamma;       // Maximum eta of triggered gamma
+    Float_t     fPhiMinGamma;       // Minimum phi of triggered gamma
+    Float_t     fPhiMaxGamma;       // Maximum phi of triggered gamma
 
  private:
     AliGenHerwig(const AliGenHerwig &Herwig);