AliGenStarLight::AliGenStarLight()
: AliGenMC()
- , fSLgenerator(NULL) {
+ , fRapidityMotherMin( 1) // Max < Min: no cut
+ , fRapidityMotherMax(-1)
+ , fEtaChildMin( 1) // Max < Min: no cut
+ , fEtaChildMax(-1)
+ , fSLgenerator(NULL)
+{
}
//----------------------------------------------------------------------
AliGenStarLight::AliGenStarLight(Int_t npart)
: AliGenMC(npart)
+ , fRapidityMotherMin( 1) // Max < Min: no cut
+ , fRapidityMotherMax(-1)
+ , fEtaChildMin( 1) // Max < Min: no cut
+ , fEtaChildMax(-1)
, fSLgenerator(new TStarLight("TStarLight",
"StarLight UPC Event Generator",
"")) // no config file name
fSLgenerator->BoostEvent();
fSLgenerator->ImportParticles(&fParticles, "ALL");
+ TLorentzVector vSum;
genOK = kTRUE;
- for (Long64_t i(0), n(fParticles.GetEntries()); i<n && genOK; ++i) {
- const TParticle *part(dynamic_cast<TParticle*>(fParticles.At(i)));
+ const Long64_t n(fParticles.GetEntries());
+ if (n == 0) {
+ AliFatal("no particles generated");
+ return;
+ }
+ for (Long64_t i(0); i<n; ++i) {
+ TParticle *part(dynamic_cast<TParticle*>(fParticles.At(i)));
if (NULL == part) {
AliFatal("NULL == part");
return;
(part->Y() >= fYMin) && (part->Y() < fYMax) &&
(part->P() >= fPMin) && (part->P() < fPMax) &&
(part->Pt() >= fPtMin) && (part->Pt() < fPtMax);
+ if (fEtaChildMin <= fEtaChildMax) // no cut if Max < Min
+ genOK = genOK && (part->Eta() >= fEtaChildMin &&
+ part->Eta() < fEtaChildMax);
+ if (kFALSE == genOK)
+ break;
+
+ TLorentzVector v;
+ part->Momentum(v);
+ vSum += v;
}
+
+ if (fRapidityMotherMin <= fRapidityMotherMax) // no cut if Max < Min
+ genOK = (genOK
+ ? (vSum.Rapidity() > fRapidityMotherMin &&
+ vSum.Rapidity() < fRapidityMotherMax)
+ : kFALSE);
+
if (kFALSE == genOK) continue;
fNprimaries = 0;