]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
updated STARLIGHT to r191 of http://starlight.hepforge.org/svn/trunk
authorcmayer <Christoph.Mayer@cern.ch>
Thu, 27 Nov 2014 19:05:33 +0000 (20:05 +0100)
committercmayer <Christoph.Mayer@cern.ch>
Thu, 27 Nov 2014 19:05:33 +0000 (20:05 +0100)
STARLIGHT/AliGenStarLight.cxx
STARLIGHT/AliGenStarLight.h
STARLIGHT/starlight/TStarLight/testsl.C
STARLIGHT/test/Config.C
STARLIGHT/test/rec.C

index 0fd2e78b4aadd171bcc8465d10260c16b2d4521f..696912ceafb19d79e35b7f5485f5ed8a38137490 100644 (file)
@@ -27,11 +27,20 @@ ClassImp(AliGenStarLight);
 
 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  
@@ -83,9 +92,15 @@ void AliGenStarLight::Generate() {
     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;
@@ -96,7 +111,23 @@ void AliGenStarLight::Generate() {
        (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;
index 249a62e347bdf506c35f02b265ca740b6a8ddb1f..25515ecd242d4f0995338a232efcb4d8d80f1ae9 100644 (file)
@@ -28,6 +28,15 @@ public:
   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;
   }
@@ -42,7 +51,11 @@ public:
   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
 } ;
index 1e70384950dcd6e28c484600f56337553cd8421e..5f4c6f71761adec750a5931548c519776be94725 100644 (file)
@@ -37,7 +37,7 @@ void testsl() {
   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)");
@@ -52,25 +52,27 @@ void testsl() {
   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)
index a694f272917e1e6da8787429baba7ef06ec01a5d..30f396bfdf51ea0c805faa3bac38bf8e6064b35d 100644 (file)
@@ -187,8 +187,9 @@ void Config()
   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);
 
@@ -209,8 +210,8 @@ void Config()
     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)");
@@ -220,6 +221,8 @@ void Config()
     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);
     
@@ -229,7 +232,7 @@ void Config()
     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();
   }
 
index dd867a0f9f82f86439a96b04a7f0ee2952fe4ef9..2ce5833c6ad6ad0b5cce89a353ee74d0cbc46c5d 100644 (file)
@@ -4,7 +4,7 @@ void rec() {
   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()));