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;
virtual void Init();
virtual void Generate();
+ void SetRapidityMotherRange(Double_t yMin, Double_t yMax) {
+ fRapidityMotherMin = yMin;
+ fRapidityMotherMax = yMax;
+ }
+ void SetEtaChildRange(Double_t etaMin, Double_t etaMax) {
+ fEtaChildMin = etaMin;
+ fEtaChildMax = etaMax;
+ }
+
TStarLight *GetTStarLight() {
return (TStarLight*)fSLgenerator;
}
AliGenStarLight(const AliGenStarLight &p);
AliGenStarLight& operator=(const AliGenStarLight &p);
- TStarLight *fSLgenerator; //! Pointer to StarLight Generator.
+ Double_t fRapidityMotherMin; // Max < Min: no cut
+ Double_t fRapidityMotherMax;
+ Double_t fEtaChildMin; // Max < Min: no cut
+ Double_t fEtaChildMax;
+ TStarLight *fSLgenerator; //! Pointer to StarLight Generator.
ClassDef(AliGenStarLight,3); // STARlight parameterisation generator
} ;
sl->SetParameter("ETA_MIN = -10 #Minimum pseudorapidity");
sl->SetParameter("ETA_MAX = 10 #Maximum pseudorapidity");
sl->SetParameter("PROD_MODE = 4 #gg or gP switch (1 = 2-photon, 2 = coherent vector meson (narrow), 3 = coherent vector meson (wide), # 4 = incoherent vector meson, 5 = A+A DPMJet single, 6 = A+A DPMJet double, 7 = p+A DPMJet single, 8 = p+A Pythia single )");
- sl->SetParameter("PROD_PID = 113 #Channel of interest (not relevant for photonuclear processes)");
+ sl->SetParameter("PROD_PID = 913 #Channel of interest (not relevant for photonuclear processes)");
sl->SetParameter("RND_SEED = 34533 #Random number seed");
sl->SetParameter("BREAKUP_MODE = 5 #Controls the nuclear breakup");
sl->SetParameter("INTERFERENCE = 0 #Interference (0 = off, 1 = on)");
TClonesArray tca("TParticle", 100);
TLorentzVector v[2], vSum;
- TH1* hM = new TH1D("hM", "STARLIGHT;M#(){#pi^{+}#pi^{-}}", 100, 0., 2.);
- TH1* hPt = new TH1D("hPt", "STARLIGHT;P_{T}#(){#pi^{+}#pi^{-}}", 100, 0., 1.);
- TH1* hY = new TH1D("hY", "STARLIGHT;Y#(){#pi^{+}#pi^{-}}", 160,-8., 8.);
+ TH1* hM = new TH1D("hM", "STARLIGHT;M#(){#pi^{+}#pi^{-}}", 80, 0., 2.);
+ TH1* hPt = new TH1D("hPt", "STARLIGHT;P_{T}#(){#pi^{+}#pi^{-}}", 80, 0., 2.);
+ TH1* hY = new TH1D("hY", "STARLIGHT;Y#(){#pi^{+}#pi^{-}}", 100,-10., 10.);
std::ofstream ofs("rho0.txt");
TParticle *p;
- for (Int_t counter(0); counter<1000;) {
+ for (Int_t counter(0); counter<20000;) {
sl->GenerateEvent();
sl->BoostEvent();
sl->ImportParticles(&tca, "ALL");
- Bool_t isOK = kTRUE;
- for (Int_t i=0; i<tca.GetEntries() && isOK; ++i) {
+ Bool_t genOK = kTRUE;
+ TLorentzVector vSum;
+ for (Int_t i=0; i<tca.GetEntries() && genOK; ++i) {
p = (TParticle*)tca.At(i);
p->Momentum(v[i]);
-// isOK = TMath::Abs(v[i].Rapidity()) <= 0.9;
+ vSum += v[i];
+// genOK = TMath::Abs(v[i].Rapidity()) <= 1.5;
}
tca.Clear();
- if (!isOK) continue;
- Printf("counter, %d", counter, isOK);
+ if (!genOK) continue;
+ Printf("counter, %d", counter, genOK);
++counter;
vSum = v[0] + v[1];
ofs << std::fixed << std::setprecision(4)
AliGenerator* gener = 0x0;
if (proc == kStarlight) {
- gSystem->Load("libStarLight");
- gSystem->Load("libAliStarLight.so");
+ TString ap="../../build/lib/tgt_linux/";
+ gSystem->Load(ap+"libStarLight.so");
+ gSystem->Load(ap+"libAliStarLight.so");
AliGenStarLight* sl = new AliGenStarLight(1000*1000);
sl->SetParameter("CUT_ETA = 0 #Cut in pseudorapidity? (0 = no, 1 = yes)");
sl->SetParameter("ETA_MIN = -10 #Minimum pseudorapidity");
sl->SetParameter("ETA_MAX = 10 #Maximum pseudorapidity");
- sl->SetParameter("PROD_MODE = 2 #gg or gP switch (1 = 2-photon, 2 = coherent vector meson (narrow), 3 = coherent vector meson (wide), # 4 = incoherent vector meson, 5 = A+A DPMJet single, 6 = A+A DPMJet double, 7 = p+A DPMJet single, 8 = p+A Pythia single )");
- sl->SetParameter("PROD_PID = 113 #Channel of interest (not relevant for photonuclear processes)");
+ sl->SetParameter("PROD_MODE = 4 #gg or gP switch (1 = 2-photon, 2 = coherent vector meson (narrow), 3 = coherent vector meson (wide), # 4 = incoherent vector meson, 5 = A+A DPMJet single, 6 = A+A DPMJet double, 7 = p+A DPMJet single, 8 = p+A Pythia single )");
+ sl->SetParameter("PROD_PID = 913 #Channel of interest (not relevant for photonuclear processes)");
sl->SetParameter("RND_SEED = 34533 #Random number seed");
sl->SetParameter("BREAKUP_MODE = 5 #Controls the nuclear breakup");
sl->SetParameter("INTERFERENCE = 0 #Interference (0 = off, 1 = on)");
sl->SetParameter("INT_PT_MAX = 0.24 #Maximum pt considered, when interference is turned on");
sl->SetParameter("INT_PT_N_BINS = 120 #Number of pt bins when interference is turned on");
+ sl->SetRapidityMotherRange(-1., 1.);
+
sl->Init();
sl->GetTStarLight()->PrintInputs(std::cout);
gener->SetCutVertexZ(1.); // Truncate at 1 sigma
gener->SetVertexSmear(kPerEvent);
gener->SetTrackingFlag(1);
- gener->SetYRange(-0.9, 0.9);
+// gener->SetYRange(-0.9, 0.9);
gener->Init();
}
reco.SetWriteESDfriend();
reco.SetWriteAlignmentData();
- reco.SetDefaultStorage("alien://Folder=/alice/data/2010/OCDB");
+ reco.SetDefaultStorage("alien://Folder=/alice/data/2013/OCDB");
// reco.SetDefaultStorage("local://$ALICE_ROOT/OCDB");
reco.SetSpecificStorage("GRP/GRP/Data",
Form("local://%s",gSystem->pwd()));