Skip to content

Commit

Permalink
Add option to trigger particles over any of the central barrel calori…
Browse files Browse the repository at this point in the history
…meters: PHOS or EMCal or DCal
  • Loading branch information
gconesab authored and ktf committed Feb 24, 2020
1 parent 46c4044 commit fe170d7
Show file tree
Hide file tree
Showing 4 changed files with 202 additions and 43 deletions.
82 changes: 66 additions & 16 deletions PYTHIA6/AliPythia6/AliGenPythia.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -156,19 +156,27 @@ AliGenPythia::AliGenPythia():
fEleInCalo(kFALSE),
fEleInEMCAL(kFALSE), // not in use
fCheckBarrel(kFALSE),
fCheckBarrelCalos(kFALSE),
fCheckEMCAL(kFALSE),
fCheckPHOS(kFALSE),
fCheckPHOSeta(kFALSE),
fPHOSRotateCandidate(-1),
fTriggerParticleMinPt(0),
fPhotonMinPt(0), // not in use
fElectronMinPt(0), // not in use
fPHOSMinPhi(219.),
fPHOSMaxPhi(321.),
fPHOSMinPhi(250.),
fPHOSMaxPhi(320.),
fPHOSEta(0.13),
fEMCALMinPhi(79.),
fEMCALMaxPhi(191.),
fEMCALEta(0.71),
fEMCALMinPhi(80.),
fEMCALMaxPhi(187.),
fEMCALEta(0.7),
fDCALMinPhi(260.),
fDCALMaxPhi(320.),
fDCALMinEta(0.22),
fDCALMaxEta(0.7),
fDCALMinPhiThird(320.),
fDCALMaxPhiThird(327.),
fDCALEtaThird(0.7),
fkTuneForDiff(0),
fProcDiff(0)
{
Expand Down Expand Up @@ -282,19 +290,27 @@ AliGenPythia::AliGenPythia(Int_t npart)
fEleInCalo(kFALSE),
fEleInEMCAL(kFALSE), // not in use
fCheckBarrel(kFALSE),
fCheckBarrelCalos(kFALSE),
fCheckEMCAL(kFALSE),
fCheckPHOS(kFALSE),
fCheckPHOSeta(kFALSE),
fPHOSRotateCandidate(-1),
fTriggerParticleMinPt(0),
fPhotonMinPt(0), // not in use
fElectronMinPt(0), // not in use
fPHOSMinPhi(219.),
fPHOSMaxPhi(321.),
fPHOSMinPhi(250.),
fPHOSMaxPhi(320.),
fPHOSEta(0.13),
fEMCALMinPhi(79.),
fEMCALMaxPhi(191.),
fEMCALEta(0.71),
fEMCALMinPhi(80.),
fEMCALMaxPhi(187.),
fEMCALEta(0.7),
fDCALMinPhi(260.),
fDCALMaxPhi(320.),
fDCALMinEta(0.22),
fDCALMaxEta(0.7),
fDCALMinPhiThird(320.),
fDCALMaxPhiThird(327.),
fDCALEtaThird(0.7),
fkTuneForDiff(0),
fProcDiff(0)
{
Expand Down Expand Up @@ -1053,7 +1069,7 @@ Int_t AliGenPythia::GenerateMB()
// Select events with fragmentation photon, decay photon, pi0, eta or other hadrons going to PHOS or EMCAL or central barrel,
// implemented primaryly for kPyJets, but extended to any kind of process.
if ((fFragPhotonInCalo || fPi0InCalo || fEtaInCalo || fEleInCalo || fHadronInCalo || fDecayPhotonInCalo) &&
(fCheckPHOS || fCheckEMCAL || fCheckBarrel) ) {
(fCheckPHOS || fCheckEMCAL || fCheckBarrel || fCheckBarrelCalos) ) {
Bool_t ok = TriggerOnSelectedParticles(np);

if(!ok) {
Expand Down Expand Up @@ -1485,10 +1501,15 @@ Bool_t AliGenPythia::CheckTrigger(const TParticle* jet1, const TParticle* jet2)
{
//Eta is okay, now check phi range
if ((phi[ij] < fPhiMaxJet && phi[ij] > fPhiMinJet) &&
(phi[ig] < fPhiMaxGamma && phi[ig] > fPhiMinGamma))
(phi[ig] < fPhiMaxGamma && phi[ig] > fPhiMinGamma))
{
triggered = kTRUE;
}
triggered = kTRUE;
if ( fCheckBarrelCalos )
{
Float_t phiGJ = phi[ig]*180./TMath::Pi(); //Convert to degrees
if ( !IsInBarrelCalorimeters(phiGJ,TMath::Abs(eta[ig])) ) triggered = kFALSE;
}
}
}
}
return triggered;
Expand Down Expand Up @@ -1743,6 +1764,14 @@ Bool_t AliGenPythia::IsInBarrel(Float_t eta) const
return kFALSE;
}

Bool_t AliGenPythia::IsInBarrelCalorimeters(Float_t phi, Float_t eta)
{
if ( IsInEMCAL(phi,eta ) ) return kTRUE ;
else if ( IsInDCAL (phi,eta ) ) return kTRUE ;
else if ( IsInPHOS (phi,eta,-1) ) return kTRUE ;
else return kFALSE;
}

Bool_t AliGenPythia::IsInEMCAL(Float_t phi, Float_t eta) const
{
// Is particle in EMCAL acceptance?
Expand All @@ -1754,6 +1783,26 @@ Bool_t AliGenPythia::IsInEMCAL(Float_t phi, Float_t eta) const
return kFALSE;
}


Bool_t AliGenPythia::IsInDCAL(Float_t phi, Float_t eta) const
{
Bool_t fullSM = kFALSE;
Bool_t thirdSM = kFALSE;

if(phi > fDCALMinPhi && phi < fDCALMaxPhi &&
eta > fDCALMinEta && eta < fDCALMaxEta ) fullSM = kTRUE;

if(phi > fDCALMinPhiThird && phi < fDCALMaxPhiThird &&
eta < fDCALEtaThird ) thirdSM = kTRUE;

if ( fullSM || thirdSM )
return kTRUE;
else
return kFALSE;
}

///

Bool_t AliGenPythia::IsInPHOS(Float_t phi, Float_t eta, Int_t iparticle)
{
// Is particle in PHOS acceptance?
Expand Down Expand Up @@ -2505,6 +2554,7 @@ Bool_t AliGenPythia::CheckDetectorAcceptance(Float_t phi, Float_t eta, Int_t ipa
if (fCheckPHOS && IsInPHOS (phi,eta,iparticle)) return kTRUE;
else if(fCheckEMCAL && IsInEMCAL (phi,eta)) return kTRUE;
else if(fCheckBarrel && IsInBarrel( eta)) return kTRUE;
else if(fCheckBarrelCalos && IsInBarrelCalorimeters(phi,eta)) return kTRUE;
else return kFALSE;
}

Expand All @@ -2513,8 +2563,8 @@ Bool_t AliGenPythia::TriggerOnSelectedParticles(Int_t np)
// Select events with fragmentation photon, decay photon, pi0, eta or other hadrons going to PHOS or EMCAL or central barrel,
// implemented primaryly for kPyJets, but extended to any kind of process.

//printf("Check: frag photon %d, pi0 %d, eta %d, electron %d, hadron %d, decay %d, PHOS %d, EMCAL %d, Barrel %d \n",
// fFragPhotonInCalo,fPi0InCalo, fEtaInCalo,fEleInCalo,fHadronInCalo,fDecayPhotonInCalo,fCheckPHOS,fCheckEMCAL, fCheckBarrel);
//printf("Check: frag photon %d, pi0 %d, eta %d, electron %d, hadron %d, decay %d, PHOS %d, EMCAL %d, Barrel %d Barrel calos %d\n",
// fFragPhotonInCalo,fPi0InCalo, fEtaInCalo,fEleInCalo,fHadronInCalo,fDecayPhotonInCalo,fCheckPHOS,fCheckEMCAL, fCheckBarrel, fCheckBarrelCalos);

Bool_t ok = kFALSE;
for (Int_t i=0; i< np; i++) {
Expand Down
39 changes: 31 additions & 8 deletions PYTHIA6/AliPythia6/AliGenPythia.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,47 +108,56 @@ class AliGenPythia : public AliGenMC
virtual void SetCheckPHOS (Bool_t b) {fCheckPHOS = b;}
virtual void SetCheckEMCAL (Bool_t b) {fCheckEMCAL = b;}
virtual void SetCheckBarrel (Bool_t b) {fCheckBarrel = b;}

virtual void SetCheckBarrelCalos (Bool_t b) {fCheckBarrelCalos = b;}

//virtual void SetElectronInEMCAL (Bool_t b) {fEleInEMCAL = b;}
//virtual void SetPhotonInPHOS (Bool_t b) {fCheckPHOS = b; fPhotonInCalo = b;} // Not in use

virtual void SetFragPhotonInCalo (Bool_t b) { fFragPhotonInCalo = b;}
virtual void SetFragPhotonInBarrel(Bool_t b) {fCheckBarrel = b; fFragPhotonInCalo = b;}
virtual void SetFragPhotonInEMCAL (Bool_t b) {fCheckEMCAL = b; fFragPhotonInCalo = b;}
virtual void SetFragPhotonInPHOS (Bool_t b) {fCheckPHOS = b; fFragPhotonInCalo = b;}

virtual void SetFragPhotonInBarrelCalos(Bool_t b) {fCheckBarrelCalos = b; fFragPhotonInCalo = b;}

virtual void SetHadronInCalo (Bool_t b) { fHadronInCalo = b;}
virtual void SetHadronInBarrel (Bool_t b) {fCheckBarrel = b; fHadronInCalo = b;}
virtual void SetHadronInEMCAL (Bool_t b) {fCheckEMCAL = b; fHadronInCalo = b;}
virtual void SetHadronInPHOS (Bool_t b) {fCheckPHOS = b; fHadronInCalo = b;}

virtual void SetHadronInBarrelCalos(Bool_t b) {fCheckBarrelCalos = b; fHadronInCalo = b;}

virtual void SetElectronInCalo (Bool_t b) { fEleInCalo = b;}
virtual void SetElectronInBarrel (Bool_t b) {fCheckBarrel = b; fEleInCalo = b;}
virtual void SetElectronInEMCAL (Bool_t b) {fCheckEMCAL = b; fEleInCalo = b;}
virtual void SetElectronInPHOS (Bool_t b) {fCheckPHOS = b; fEleInCalo = b;}

virtual void SetElectronInBarrelCalos(Bool_t b) {fCheckBarrelCalos = b; fEleInCalo = b;}

virtual void SetDecayPhotonInCalo (Bool_t d) {fDecayPhotonInCalo = d;}
virtual void SetDecayPhotonInBarrel(Bool_t d) {fDecayPhotonInCalo = d; fCheckBarrel = d;}
virtual void SetDecayPhotonInEMCAL(Bool_t d) {fDecayPhotonInCalo = d; fCheckEMCAL = d;}
virtual void SetDecayPhotonInPHOS (Bool_t d) {fDecayPhotonInCalo = d; fCheckPHOS = d;}

virtual void SetDecayPhotonInBarrelCalos(Bool_t d){fDecayPhotonInCalo = d; fCheckBarrelCalos = d;}

virtual void SetPi0InCalo (Bool_t b, Bool_t f = kFALSE) {fPi0InCalo = b; fForceNeutralMeson2PhotonDecay = f;}
virtual void SetPi0InBarrel (Bool_t b, Bool_t f = kFALSE) {fPi0InCalo = b; fForceNeutralMeson2PhotonDecay = f; fCheckBarrel= b; }
virtual void SetPi0InEMCAL (Bool_t b, Bool_t f = kFALSE) {fPi0InCalo = b; fForceNeutralMeson2PhotonDecay = f; fCheckEMCAL = b; }
virtual void SetPi0InPHOS (Bool_t b, Bool_t f = kFALSE) {fPi0InCalo = b; fForceNeutralMeson2PhotonDecay = f; fCheckPHOS = b; }

virtual void SetPi0InBarrelCalos (Bool_t b, Bool_t f = kFALSE) {fPi0InCalo = b; fForceNeutralMeson2PhotonDecay = f; fCheckBarrelCalos = b; }

virtual void SetEtaInCalo (Bool_t b, Bool_t f = kFALSE) {fEtaInCalo = b; fForceNeutralMeson2PhotonDecay = f;}
virtual void SetEtaInBarrel (Bool_t b, Bool_t f = kFALSE) {fEtaInCalo = b; fForceNeutralMeson2PhotonDecay = f; fCheckBarrel= b; }
virtual void SetEtaInEMCAL (Bool_t b, Bool_t f = kFALSE) {fEtaInCalo = b; fForceNeutralMeson2PhotonDecay = f; fCheckEMCAL = b; }
virtual void SetEtaInPHOS (Bool_t b, Bool_t f = kFALSE) {fEtaInCalo = b; fForceNeutralMeson2PhotonDecay = f; fCheckPHOS = b; }
virtual void SetEtaInBarrelCalos (Bool_t b, Bool_t f = kFALSE) {fEtaInCalo = b; fForceNeutralMeson2PhotonDecay = f; fCheckBarrelCalos = b; }

virtual void SetPi0PhotonDecayInBarrel(Bool_t b, Bool_t f = kFALSE) {fPi0InCalo = b; fDecayPhotonInCalo = b; fForceNeutralMeson2PhotonDecay = f; fCheckBarrel = b; }
virtual void SetPi0PhotonDecayInEMCAL (Bool_t b, Bool_t f = kFALSE) {fPi0InCalo = b; fDecayPhotonInCalo = b; fForceNeutralMeson2PhotonDecay = f; fCheckEMCAL = b; }
virtual void SetPi0PhotonDecayInPHOS (Bool_t b, Bool_t f = kFALSE) {fPi0InCalo = b; fDecayPhotonInCalo = b; fForceNeutralMeson2PhotonDecay = f; fCheckPHOS = b; }
virtual void SetPi0PhotonDecayInBarrelCalos(Bool_t b,Bool_t f = kFALSE) {fPi0InCalo = b; fDecayPhotonInCalo = b; fForceNeutralMeson2PhotonDecay = f; fCheckBarrelCalos = b; }

virtual void SetEtaPhotonDecayInBarrel(Bool_t b, Bool_t f = kFALSE) {fEtaInCalo = b; fDecayPhotonInCalo = b; fForceNeutralMeson2PhotonDecay = f; fCheckBarrel = b; }
virtual void SetEtaPhotonDecayInEMCAL (Bool_t b, Bool_t f = kFALSE) {fEtaInCalo = b; fDecayPhotonInCalo = b; fForceNeutralMeson2PhotonDecay = f; fCheckEMCAL = b; }
virtual void SetEtaPhotonDecayInPHOS (Bool_t b, Bool_t f = kFALSE) {fEtaInCalo = b; fDecayPhotonInCalo = b; fForceNeutralMeson2PhotonDecay = f; fCheckPHOS = b; }
virtual void SetEtaPhotonDecayInBarrelCalos(Bool_t b,Bool_t f = kFALSE) {fEtaInCalo = b; fDecayPhotonInCalo = b; fForceNeutralMeson2PhotonDecay = f; fCheckBarrelCalos = b; }


// Trigger on a minimum multiplicity
Expand All @@ -166,6 +175,10 @@ class AliGenPythia : public AliGenMC
virtual void SetBarrelAcceptance(Float_t deta) {fTriggerEta = deta ;}
virtual void SetTriggerY(Float_t dy) {fTriggerY = dy;}
virtual void SetEMCALAcceptance (Float_t phimin, Float_t phimax, Float_t deta) {fEMCALMinPhi = phimin ; fEMCALMaxPhi = phimax ; fEMCALEta = deta ; }
virtual void SetDCALAcceptance (Float_t phimin , Float_t phimax , Float_t etamin , Float_t etamax, // Full SM
Float_t phimin3, Float_t phimax3, Float_t deta3) // 1/3 SM
{fDCALMinPhi = phimin ; fDCALMaxPhi = phimax ; fDCALMinEta = etamin ; fDCALMaxEta = etamax ;
fDCALMinPhiThird = phimin3 ; fDCALMaxPhiThird = phimax3 ; fDCALEtaThird = deta3 ; }
virtual void SetPHOSAcceptance (Float_t phimin, Float_t phimax, Float_t deta) {fPHOSMinPhi = phimin ; fPHOSMaxPhi = phimax ; fPHOSEta = deta ; }
virtual void SetRotateParticleInPHOSeta(Bool_t b) {fCheckPHOSeta = b;}

Expand Down Expand Up @@ -254,8 +267,10 @@ class AliGenPythia : public AliGenMC
//
Bool_t CheckDetectorAcceptance(Float_t phi, Float_t eta, Int_t iparticle);
Bool_t IsInEMCAL (Float_t phi, Float_t eta) const;
Bool_t IsInDCAL (Float_t phi, Float_t eta) const;
Bool_t IsInPHOS (Float_t phi, Float_t eta, Int_t iparticle) ;
Bool_t IsInBarrel(Float_t eta) const;
Bool_t IsInBarrelCalorimeters(Float_t phi,Float_t eta) ;
Bool_t IsFromHeavyFlavor(Int_t ipart);
//
virtual void FinishRun();
Expand Down Expand Up @@ -387,6 +402,7 @@ class AliGenPythia : public AliGenMC
Bool_t fEleInCalo; // Option to ask for Electron in EMCAL acceptance
Bool_t fEleInEMCAL; // Option to ask for Electron in EMCAL acceptance (not in use)
Bool_t fCheckBarrel; // Option to ask for FragPhoton or Pi0 or Eta or gamma decays in central barrel acceptance
Bool_t fCheckBarrelCalos; // Option to ask for FragPhoton or Pi0 or Eta or gamma decays in PHOS+DCAL+EMCAL acceptance
Bool_t fCheckEMCAL; // Option to ask for FragPhoton or Pi0 or Eta or gamma decays in calorimeters EMCAL acceptance
Bool_t fCheckPHOS; // Option to ask for FragPhoton or Pi0 or Eta or gamma decays in calorimeters PHOS acceptance
Bool_t fCheckPHOSeta; // Option to ask for rotate event particles in phi to have in PHOS acceptance a requested particle that previously had the good eta
Expand All @@ -401,7 +417,14 @@ class AliGenPythia : public AliGenMC
Float_t fEMCALMinPhi; // Minimum phi EMCAL, degrees
Float_t fEMCALMaxPhi; // Maximum phi EMCAL, degrees
Float_t fEMCALEta; // Maximum eta EMCAL, coverage delta eta

Float_t fDCALMinPhi; // Minimum phi full SM DCAL, degrees
Float_t fDCALMaxPhi; // Maximum phi full SM DCAL, degrees
Float_t fDCALMinEta; // Minimum eta full SM DCAL
Float_t fDCALMaxEta; // Maximum eta full SM DCAL
Float_t fDCALMinPhiThird; // Minimum phi 1/3 SM DCAL, degrees
Float_t fDCALMaxPhiThird; // Maximum phi 1/3 SM DCAL, degrees
Float_t fDCALEtaThird; // Maximum eta 1/3 SM DCAL, coverage delta eta

Bool_t fkTuneForDiff; // Pythia tune
Int_t fProcDiff;
private:
Expand All @@ -413,7 +436,7 @@ class AliGenPythia : public AliGenMC
Bool_t GetWeightsDiffraction(Double_t M, Double_t &Mmin, Double_t &Mmax,
Double_t &wSD, Double_t &wDD, Double_t &wND);

ClassDef(AliGenPythia, 15) // AliGenerator interface to Pythia
ClassDef(AliGenPythia, 16) // AliGenerator interface to Pythia
};
#endif

Expand Down
Loading

0 comments on commit fe170d7

Please sign in to comment.