//
// Switch hadronisation on
//
- fPythia->SetMSTJ(1, fHadronisation);
-
+ fPythia->SetMSTJ(1, 1);
//
// .. and perform hadronisation
+// printf("Calling hadronisation %d\n", fPythia->GetN());
fPythia->Pyexec();
fTrials++;
fPythia->ImportParticles(fParticles,"All");
Int_t np = (fHadronisation) ? fParticles->GetEntriesFast() : fNpartons;
-
+
Int_t* pParent = new Int_t[np];
for (i=0; i< np; i++) pParent[i] = -1;
if (fProcess == kPyJets || fProcess == kPyDirectGamma) {
TParticle* jet1 = (TParticle *) fParticles->At(6);
TParticle* jet2 = (TParticle *) fParticles->At(7);
- if (!CheckTrigger(jet1, jet2)) {
- delete pParent;
- return 0;
- }
+ if (!CheckTrigger(jet1, jet2)) return 0;
}
+
+ //Introducing child cuts in case kPyW
+ if ( (fProcess == kPyW) && (fCutOnChild == 1) ) {
+ if ( !CheckKinematicsOnChild() ) return 0;
+ }
+
+
for (i = 0; i < np; i++) {
Int_t trackIt = 0;
TParticle * iparticle = (TParticle *) fParticles->At(i);
}
return triggered;
}
+
+
+//Checking Kinematics on Child (status code 1, particle code ?, kin cuts
+Bool_t AliGenPythia::CheckKinematicsOnChild(){
+
+ Bool_t checking = kFALSE;
+ Int_t j, kcode, ks, km;
+ Int_t nPartAcc = 0; //number of particles in the acceptance range
+ Int_t numberOfAcceptedParticles = 1;
+ if (fNumberOfAcceptedParticles != 0) { numberOfAcceptedParticles = fNumberOfAcceptedParticles; }
+ Int_t npart = fParticles->GetEntriesFast();
+
+ for (j = 0; j<npart; j++) {
+ TParticle * jparticle = (TParticle *) fParticles->At(j);
+ kcode = TMath::Abs( CheckPDGCode(jparticle->GetPdgCode()) );
+ ks = jparticle->GetStatusCode();
+ km = jparticle->GetFirstMother();
+
+ if( (ks == 1) && (kcode == fPdgCodeParticleforAcceptanceCut) && (KinematicSelection(jparticle,1)) ){
+ nPartAcc++;
+ }
+ }
+
+ if( numberOfAcceptedParticles <= nPartAcc){
+ checking = kTRUE;
+ }
+
+ return checking;
+
+}
+
AliGenPythia& AliGenPythia::operator=(const AliGenPythia& rhs)
{