* provided "as is" without express or implied warranty. *
**************************************************************************/
-// $Id: AliCollider.cxx,v 1.10 2004/02/13 11:08:16 nick Exp $
+// $Id: AliCollider.cxx,v 1.12 2004/05/04 15:33:04 nick Exp $
///////////////////////////////////////////////////////////////////////////
// Class AliCollider
//
// gen->SetOutputFile("test.root");
// gen->SetVertexMode(3);
-// gen->SetResolution(1e-4); // 1 micron vertex resolution
+// gen->SetResolution(1e-6); // 1 micron vertex resolution
//
// gen->SetRunNumber(1);
//
//
//
//--- Author: Nick van Eijndhoven 22-nov-2002 Utrecht University
-//- Modified: NvE $Date: 2004/02/13 11:08:16 $ Utrecht University
+//- Modified: NvE $Date: 2004/05/04 15:33:04 $ Utrecht University
///////////////////////////////////////////////////////////////////////////
+#include <cstdlib>
#include "AliCollider.h"
#include "Riostream.h"
{
// Default constructor.
// All variables initialised to default values.
+//
+// Some Pythia default MC parameters are automatically modified to provide
+// more suitable running conditions for soft processes in view of
+// nucleus-nucleus interactions and astrophysical processes.
+// The user may initialise the generator with all the default Pythia
+// parameters and obtain full user control to modify the settings by means
+// of the SetUserControl memberfunction.
+//
+// Refer to the SetElastic memberfunction for the inclusion of elastic
+// and diffractive processes.
+// By default these processes are not included.
+
fVertexmode=0; // No vertex structure creation
- fResolution=1e-5; // Standard resolution is 0.1 micron
+ fResolution=1e-7; // Standard resolution is 0.1 micron
fRunnum=0;
fEventnum=0;
fPrintfreq=1;
+ fUserctrl=0; // Automatic optimisation of some MC parameters
+ fElastic=0; // No elastic and diffractive processes
fEvent=0;
}
}
///////////////////////////////////////////////////////////////////////////
-Int_t AliCollider::GetVertexMode()
+Int_t AliCollider::GetVertexMode() const
{
// Provide the current mode for vertex structure creation.
return fVertexmode;
///////////////////////////////////////////////////////////////////////////
void AliCollider::SetResolution(Double_t res)
{
-// Set the resolution (in cm) for resolving (sec.) vertices.
+// Set the resolution (in meter) for resolving (sec.) vertices.
// By default this resolution is set to 0.1 micron.
// Note : In case no vertex creation has been selected, the value of
// the resolution is totally irrelevant.
fResolution=fabs(res);
}
///////////////////////////////////////////////////////////////////////////
-Double_t AliCollider::GetResolution()
+Double_t AliCollider::GetResolution() const
{
-// Provide the current resolution (in cm) for resolving (sec.) vertices.
+// Provide the current resolution (in meter) for resolving (sec.) vertices.
return fResolution;
}
///////////////////////////////////////////////////////////////////////////
fRunnum=run;
}
///////////////////////////////////////////////////////////////////////////
-Int_t AliCollider::GetRunNumber()
+Int_t AliCollider::GetRunNumber() const
{
// Provide the user defined run number.
return fRunnum;
fPrintfreq=n;
}
///////////////////////////////////////////////////////////////////////////
-Int_t AliCollider::GetPrintFreq()
+Int_t AliCollider::GetPrintFreq() const
{
// Provide the user selected print frequency.
return fPrintfreq;
}
///////////////////////////////////////////////////////////////////////////
+void AliCollider::SetUserControl(Int_t flag)
+{
+// Set the user control flag w.r.t. disabling automatic optimisation
+// of some Pythia default MC parameters for soft interactions in view of
+// nucleus-nucleus collisions and astrophysical processes.
+// Flag = 0 : Limited user control (automatic optimisation enabled)
+// 1 : Full user control (automatic optimisation disabled)
+// By default the user control is set to 0 (i.e. automatic optimisation).
+// See the Init() memberfunctions for further details w.r.t. the optimisations.
+ fUserctrl=flag;
+}
+///////////////////////////////////////////////////////////////////////////
+Int_t AliCollider::GetUserControl() const
+{
+// Provide the value of the user control flag.
+ return fUserctrl;
+}
+///////////////////////////////////////////////////////////////////////////
+void AliCollider::SetElastic(Int_t flag)
+{
+// Set the flag w.r.t. inclusion of elastic and diffractive processes.
+// By default these processes are not included.
+// Flag = 0 : Do not include elastic and diffractive processes
+// 1 : Elastic and diffractive processes will be included
+ fElastic=flag;
+}
+///////////////////////////////////////////////////////////////////////////
+Int_t AliCollider::GetElastic() const
+{
+// Provide the value of the control flag for elastic and diffractive processes.
+ return fElastic;
+}
+///////////////////////////////////////////////////////////////////////////
void AliCollider::Init(char* frame,char* beam,char* target,Float_t win)
{
// Initialisation of the underlying Pythia generator package.
+// The event number is reset to 0.
// This routine just invokes TPythia6::Initialize(...) and the arguments
// have the corresponding meaning.
-// The event number is reset to 0.
+// Some Pythia default MC parameters are automatically modified to provide
+// more suitable running conditions for soft processes in view of
+// astrophysical processes.
+// The optimisations consist of :
+// * Usage of real photons for photon beams or targets
+// * Minimum CMS energy of 3 GeV for the event
+// * Activation of the default K factor values
+// with separate settings for ordinary and color annihilation graphs.
+// The user may initialise the generator with all the default Pythia
+// parameters and obtain full user control to modify the settings by means
+// of invoking the SetUserControl memberfunction before this initialisation.
+// Note that the inclusion of elastic and diffractive processes is controlled
+// by invokation of the SetElastic memberfunction before this initialisation,
+// irrespective of the UserControl selection.
+
+ if (!fUserctrl) // Optimisation of some MC parameters
+ {
+ SetMSTP(14,10); // Real photons for photon beams or targets
+ SetPARP(2,3.); // Minimum CMS energy for the event
+ SetMSTP(33,2); // Activate K factor. Separate for ordinary and color annih. graphs
+ }
+
+ if (fElastic) SetMSEL(2); // Include low-Pt, elastic and diffractive events
+
fEventnum=0;
fNucl=0;
fFrame=frame;
{
// Initialisation of the underlying Pythia generator package for the generation
// of nucleus-nucleus interactions.
+// The event number is reset to 0.
// In addition to the Pythia standard arguments 'frame' and 'win', the user
// can specify here (Z,A) values of the projectile and target nuclei.
//
// Note : The 'win' value denotes either the cms energy per nucleon-nucleon collision
// (i.e. frame="cms") or the momentum per nucleon in all other cases.
//
-// The event number is reset to 0.
+// Some Pythia default MC parameters are automatically modified to provide
+// more suitable running conditions for soft processes in view of
+// nucleus-nucleus interactions and astrophysical processes.
+// The optimisations consist of :
+// * Minimum CMS energy of 3 GeV for the event
+// * Activation of the default K factor values
+// with separate settings for ordinary and color annihilation graphs.
+// The user may initialise the generator with all the default Pythia
+// parameters and obtain full user control to modify the settings by means
+// of invoking the SetUserControl memberfunction before this initialisation.
+// Note that the inclusion of elastic and diffractive processes is controlled
+// by invokation of the SetElastic memberfunction before this initialisation,
+// irrespective of the UserControl selection.
+
+ if (!fUserctrl) // Optimisation of some MC parameters
+ {
+ SetPARP(2,3.); // Minimum CMS energy for the event
+ SetMSTP(33,2); // Activate K factor. Separate for ordinary and color annih. graphs
+ }
+
+ if (fElastic) SetMSEL(2); // Include low-Pt, elastic and diffractive events
+
fEventnum=0;
fNucl=1;
fFrame=frame;
select=IsSelected();
if (select) fSelect=1;
- if (first) // Store projectile and target information in the event structure
+ if (first) // Store generator parameter information in the event structure
{
+ // Enter generator parameters as a device in the event
+ AliSignal params;
+ params.SetNameTitle("AliCollider","AliCollider generator parameters");
+ params.SetSlotName("Medit",1);
+ params.SetSlotName("Vertexmode",2);
+ params.SetSlotName("Resolution",3);
+ params.SetSlotName("Userctrl",4);
+ params.SetSlotName("Elastic",5);
+
+ params.SetSignal(medit,1);
+ params.SetSignal(fVertexmode,2);
+ params.SetSignal(fResolution,3);
+ params.SetSignal(fUserctrl,4);
+ params.SetSignal(fElastic,5);
+
+ // Store projectile and target information in the event structure
if (fNucl)
{
v[0]=GetP(1,1);
ptarg.SetVector(v,"car");
pnucl=ptarg.GetNorm();
fEvent->SetTarget(fAtarg,fZtarg,pnucl);
+
+ params.AddNamedSlot("specmode");
+ params.AddNamedSlot("Specpmin");
+ params.AddNamedSlot("npart");
+ params.AddNamedSlot("ncolpp");
+ params.AddNamedSlot("ncolnp");
+ params.AddNamedSlot("ncolpn");
+ params.AddNamedSlot("ncolnn");
+
+ params.SetSignal(specmode,"specmode");
+ params.SetSignal(fSpecpmin,"Specpmin");
+ params.SetSignal(npt,"npart");
+ params.SetSignal(ncols[0],"ncolpp");
+ params.SetSignal(ncols[1],"ncolnp");
+ params.SetSignal(ncols[2],"ncolpn");
+ params.SetSignal(ncols[3],"ncolnn");
}
else
{
kf=GetK(2,2);
fEvent->SetTarget(0,0,pnucl,kf);
}
+
+ fEvent->AddDevice(params);
+
first=0;
}
if (medit >= 0) Pyedit(medit); // Define which particles are to be kept
- if (mlist>=0 && select) Pylist(mlist);
+ if (mlist>=0 && select)
+ {
+ Pylist(mlist);
+ cout << endl;
+ }
npart=GetN();
for (Int_t jpart=1; jpart<=npart; jpart++)
v[2]=GetP(jpart,3);
p.SetVector(v,"car");
- // Production location in cm.
- v[0]=GetV(jpart,1)/10;
- v[1]=GetV(jpart,2)/10;
- v[2]=GetV(jpart,3)/10;
+ // Production location in meter.
+ v[0]=GetV(jpart,1)/1000.;
+ v[1]=GetV(jpart,2)/1000.;
+ v[2]=GetV(jpart,3)/1000.;
r.SetPosition(v,"car");
ntk++;
}
}
- if (mlist && !(fEventnum%fPrintfreq)) cout << endl; // Create empty output line after the event
+ if (!(fEventnum%fPrintfreq) && (mlist || fEvent))
+ {
+ if (fEvent)
+ {
+ cout << " Number of tracks in the event structure : "
+ << fEvent->GetNtracks() << endl;
+ }
+ cout << endl; // Create empty output line after the event
+ }
if (fOutTree && fSelect) fOutTree->Fill();
}
///////////////////////////////////////////////////////////////////////////
-AliEvent* AliCollider::GetEvent(Int_t select)
+AliEvent* AliCollider::GetEvent(Int_t select) const
{
// Provide pointer to the generated event structure.
//
}
}
///////////////////////////////////////////////////////////////////////////
-Int_t AliCollider::GetSelectionFlag()
+Int_t AliCollider::GetSelectionFlag() const
{
// Return the value of the selection flag for the total event.
// When the event passed the selection criteria as specified via
fSpecpmin=pmin;
}
///////////////////////////////////////////////////////////////////////////
-Float_t AliCollider::GetSpectatorPmin()
+Float_t AliCollider::GetSpectatorPmin() const
{
// Provide the minimal spectator momentum in GeV/c.
return fSpecpmin;