]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EVGEN/AliGenMUONCocktail.cxx
doxy: do not show whitespace diffs on bulk edit
[u/mrichter/AliRoot.git] / EVGEN / AliGenMUONCocktail.cxx
index 5968c647c4d96a2120fbf04ba62e05b09b9a1ee6..6a7e44b15dbf91a2945aee1d18bef6ebc21c01ec 100644 (file)
@@ -68,30 +68,6 @@ AliGenMUONCocktail::AliGenMUONCocktail()
 {
 // Constructor
 }
-//_________________________________________________________________________
-AliGenMUONCocktail::AliGenMUONCocktail(const AliGenMUONCocktail & cocktail):
-    AliGenCocktail(cocktail),
-    fFastGlauber(0x0),
-    fTotalRate(0),  
-    fMuonMultiplicity(1),
-    fMuonPtCut(1.),
-    fMuonThetaMinCut(171.), 
-    fMuonThetaMaxCut(178.),
-    fNSucceded(0), 
-    fNGenerated(0), 
-    fLowImpactParameter(0.),
-    fHighImpactParameter(5.),
-    fAverageImpactParameter(0.),
-    fNumberOfCollisions(0.), 
-    fNumberOfParticipants(0.),
-    fHadronicMuons(kTRUE),
-    fInvMassCut (kFALSE),
-    fInvMassMinCut (0.),
-    fInvMassMaxCut (100.)
-{
-// Copy constructor
-}
-
 //_________________________________________________________________________
 AliGenMUONCocktail::~AliGenMUONCocktail()
 {
@@ -106,7 +82,7 @@ void AliGenMUONCocktail::Init()
   Double_t sigmaReaction =   0.072;   // MinBias NN cross section for PbPb LHC energies  http://arxiv.org/pdf/nucl-ex/0302016
 
   // Initialising Fast Glauber object
-  fFastGlauber = new AliFastGlauber();
+  fFastGlauber = AliFastGlauber::Instance();
   fFastGlauber->SetPbPbLHC();
   fFastGlauber->SetNNCrossSection(sigmaReaction*1000.); //Expected NN cross-section in mb at LHC with diffractive part http://arxiv.org/pdf/nucl-ex/0302016 )
   fFastGlauber->Init(1);
@@ -387,9 +363,8 @@ void AliGenMUONCocktail::Generate()
 // Generate event 
     TIter next(fEntries);
     AliGenCocktailEntry *entry = 0;
-    AliGenCocktailEntry *preventry = 0;
     AliGenerator* gen = 0;
-    TObjArray *partArray = gAlice->GetMCApp()->Particles();
+    const TObjArray *partArray = gAlice->GetMCApp()->Particles();
 
 //  Generate the vertex position used by all generators    
     if(fVertexSmear == kPerEvent) Vertex();
@@ -398,16 +373,17 @@ void AliGenMUONCocktail::Generate()
     Bool_t primordialTrigger = kFALSE;
     while(!primordialTrigger) {
                //Reseting stack
-               AliRunLoader * runloader = gAlice->GetRunLoader();
+               AliRunLoader * runloader = AliRunLoader::Instance();
                if (runloader)
                        if (runloader->Stack())
-                               runloader->Stack()->Reset();
+                               runloader->Stack()->Clean();
                // Loop over generators and generate events
                Int_t igen=0;
                Int_t npart =0;
                while((entry = (AliGenCocktailEntry*)next())) {
                        gen = entry->Generator();
                        gen->SetVertex(fVertex.At(0), fVertex.At(1), fVertex.At(2));
+                       gen->SetTime(fTime);
                        if ( (npart = gRandom->Poisson(entry->Rate())) >0 ) {
                                igen++; 
                                if (igen == 1) entry->SetFirst(0);
@@ -418,7 +394,6 @@ void AliGenMUONCocktail::Generate()
                                gen->SetNumberParticles(npart);
                                gen->Generate();
                                entry->SetLast(partArray->GetEntriesFast());
-                               preventry = entry;
                          // }
                        }
                }  
@@ -437,7 +412,7 @@ void AliGenMUONCocktail::Generate()
                        (gAlice->GetMCApp()->Particle(iPart)->Theta()*180./TMath::Pi()>fMuonThetaMinCut) &&
                        (gAlice->GetMCApp()->Particle(iPart)->Theta()*180./TMath::Pi()<fMuonThetaMaxCut) &&
                        (gAlice->GetMCApp()->Particle(iPart)->Pt()>fMuonPtCut)                             ) { 
-                                       gAlice->GetMCApp()->Particle(iPart)->SetProductionVertex(fVertex.At(0), fVertex.At(1), fVertex.At(2), 0.);   
+                                       gAlice->GetMCApp()->Particle(iPart)->SetProductionVertex(fVertex.At(0), fVertex.At(1), fVertex.At(2), fTime);   
                                        GoodMuons.AddLast(gAlice->GetMCApp()->Particle(iPart));
                                        numberOfMuons++;
                        }                       
@@ -474,19 +449,3 @@ void AliGenMUONCocktail::Generate()
 
     AliDebug(5,Form("Generated Events are %d and Succeeded Events are %d",fNGenerated,fNSucceded));
 }
-
-
-AliGenMUONCocktail& AliGenMUONCocktail::operator=(const  AliGenMUONCocktail& rhs)
-{
-// Assignment operator
-    rhs.Copy(*this);
-    return *this;
-}
-
-void AliGenMUONCocktail::Copy(TObject &) const
-{
-    Fatal("Copy","Not implemented!\n");
-}
-
-
-