SetNumberOfAcceptedParticles();
SetTarget();
SetProjectile();
+ fParentSelect.Set(8);
+ fChildSelect.Set(8);
}
AliGenMC::AliGenMC(Int_t npart)
Bool_t AliGenMC::CheckAcceptanceGeometry(Int_t np, TClonesArray* particles)
{
- Bool_t Check ; // All fPdgCodeParticleforAcceptanceCut particles are in in the fGeometryAcceptance acceptance
- Int_t NumberOfPdgCodeParticleforAcceptanceCut=0;
- Int_t NumberOfAcceptedPdgCodeParticleforAcceptanceCut=0;
+// Check the geometrical acceptance for particle.
+
+ Bool_t check ;
+ Int_t numberOfPdgCodeParticleforAcceptanceCut = 0;
+ Int_t numberOfAcceptedPdgCodeParticleforAcceptanceCut = 0;
TParticle * particle;
Int_t i;
- for (i=0; i<np; i++) {
+ for (i = 0; i < np; i++) {
particle = (TParticle *) particles->At(i);
if( TMath::Abs( particle->GetPdgCode() ) == TMath::Abs( fPdgCodeParticleforAcceptanceCut ) ) {
- NumberOfPdgCodeParticleforAcceptanceCut++;
- if (fGeometryAcceptance->Impact(particle)) NumberOfAcceptedPdgCodeParticleforAcceptanceCut++;
+ numberOfPdgCodeParticleforAcceptanceCut++;
+ if (fGeometryAcceptance->Impact(particle)) numberOfAcceptedPdgCodeParticleforAcceptanceCut++;
}
}
- if ( NumberOfAcceptedPdgCodeParticleforAcceptanceCut > (fNumberOfAcceptedParticles-1) )
- Check = kTRUE;
+ if ( numberOfAcceptedPdgCodeParticleforAcceptanceCut > (fNumberOfAcceptedParticles-1) )
+ check = kTRUE;
else
- Check = kFALSE;
+ check = kFALSE;
- return Check;
+ return check;
}
Int_t AliGenMC::CheckPDGCode(Int_t pdgcode) const
**************************************************************************/
/* $Id$ */
+//
+// Interface for reading events from files.
+// Realisations of this interface have to be used with AliGenExFile.
+// NextEvent() loops over events
+// and NextParticle() loops over particles.
+// Author: andreas.morsch@cern.ch
#include "AliGenReader.h"
ClassImp(AliGenReader)
return *this;
}
-void AliGenReader::RewindEvent()
-{
- // Go back to the first particle of the event.
- // Need to be implemented in the implementation classes. Interface dies.
- Fatal("AliGenReader::RewindEvent","\nMethod RewindEvent not present in the implementation class.\n");
-}
-
void AliGenReader::Copy(AliGenReader&) const
{
//
/* $Id$ */
+// Interface for reading events from files.
+// Realisations of this interface have to be used with AliGenExFile.
+// Author: andreas.morsch@cern.ch
+
#include "TObject.h"
class TParticle;
AliGenReader(const AliGenReader &reader)
:TObject(reader), fFileName(NULL), fCode(kPDG){reader.Copy(*this);}
virtual ~AliGenReader(){;}
- // Initialise
- virtual void Init() {}
- // set file name of data file
virtual void SetFileName(const Text_t *filname) {fFileName=filname;}
- // Read
- virtual Int_t NextEvent(){return 0;}
+ virtual void Init() = 0;
+ virtual Int_t NextEvent() = 0;
+ virtual TParticle* NextParticle() = 0;
+ virtual void RewindEvent() = 0;
enum Code_t {kPDG, kGEANT3};
void SetParticleCode(Code_t code) {fCode = code;}
- virtual TParticle* NextParticle(){return NULL;}
- virtual void RewindEvent();
AliGenReader & operator=(const AliGenReader & rhs);
- private:
- void Copy(AliGenReader&) const;
+
protected:
const Text_t *fFileName; // Name of file to read from
Code_t fCode; // Particle code type
+ private:
+ void Copy(AliGenReader&) const;
ClassDef(AliGenReader,1) //Generate particles from external file
};
// Read
virtual Int_t NextEvent();
virtual TParticle* NextParticle();
+ virtual void RewindEvent(){;}
AliGenReaderCwn & operator=(const AliGenReaderCwn & rhs);
private:
void Copy(AliGenReaderCwn&) const;
// Read
virtual Int_t NextEvent();
virtual TParticle* NextParticle();
+ virtual void RewindEvent(){;}
AliGenReaderEcalHijing & operator=(const AliGenReaderEcalHijing & rhs);
protected:
// Read
virtual Int_t NextEvent();
virtual TParticle* NextParticle();
+ virtual void RewindEvent(){;}
AliGenReaderEcalJets & operator=(const AliGenReaderEcalJets & rhs);
protected: