// @(#)root/vmc:$Id$
// Authors: Ivana Hrivnacova 13/04/2002

/*************************************************************************
 * Copyright (C) 2006, Rene Brun and Fons Rademakers.                    *
 * Copyright (C) 2002, ALICE Experiment at CERN.                         *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#ifndef ROOT_TVirtualMCStack
#define ROOT_TVirtualMCStack

// Class TVirtualMCStack
// ---------------------
// Interface to a user defined particles stack.
//

#include "TObject.h"
#include "TMCProcess.h"

class TParticle;

class TVirtualMCStack : public TObject {

public:
   // Constructor
   TVirtualMCStack();

   // Destructor
   virtual ~TVirtualMCStack();

   //
   // Methods for stacking
   //

   // Create a new particle and push into stack;
   // toBeDone   - 1 if particles should go to tracking, 0 otherwise
   // parent     - number of the parent track, -1 if track is primary
   // pdg        - PDG encoding
   // px, py, pz - particle momentum [GeV/c]
   // e          - total energy [GeV]
   // vx, vy, vz - position [cm]
   // tof        - time of flight [s]
   // polx, poly, polz - polarization
   // mech       - creator process VMC code
   // ntr        - track number (is filled by the stack
   // weight     - particle weight
   // is         - generation status code
   virtual void  PushTrack(Int_t toBeDone, Int_t parent, Int_t pdg,
                           Double_t px, Double_t py, Double_t pz, Double_t e,
                           Double_t vx, Double_t vy, Double_t vz, Double_t tof,
                           Double_t polx, Double_t poly, Double_t polz,
                           TMCProcess mech, Int_t& ntr, Double_t weight,
                           Int_t is) = 0;

   // The stack has to provide two pop mechanisms:
   // The first pop mechanism required.
   // Pop all particles with toBeDone = 1, both primaries and seconadies
   virtual TParticle* PopNextTrack(Int_t& itrack) = 0;

   // The second pop mechanism required.
   // Pop only primary particles with toBeDone = 1, stacking of secondaries
   // is done by MC
   virtual TParticle* PopPrimaryForTracking(Int_t i) = 0;

   //
   // Set methods
   //

   // Set the current track number
   virtual void       SetCurrentTrack(Int_t trackNumber) = 0;

   //
   // Get methods
   //

   // Total number of tracks
   virtual Int_t      GetNtrack()    const = 0;

   // Total number of primary tracks
   virtual Int_t      GetNprimary()  const = 0;

   // Current track particle
   virtual TParticle* GetCurrentTrack() const= 0;

   // Current track number
   virtual Int_t      GetCurrentTrackNumber() const = 0;

   // Number of the parent of the current track
   virtual Int_t      GetCurrentParentTrackNumber() const = 0;

   ClassDef(TVirtualMCStack,1) //Interface to a particles stack
};

#endif //ROOT_TVirtualMCStack
 TVirtualMCStack.h:1
 TVirtualMCStack.h:2
 TVirtualMCStack.h:3
 TVirtualMCStack.h:4
 TVirtualMCStack.h:5
 TVirtualMCStack.h:6
 TVirtualMCStack.h:7
 TVirtualMCStack.h:8
 TVirtualMCStack.h:9
 TVirtualMCStack.h:10
 TVirtualMCStack.h:11
 TVirtualMCStack.h:12
 TVirtualMCStack.h:13
 TVirtualMCStack.h:14
 TVirtualMCStack.h:15
 TVirtualMCStack.h:16
 TVirtualMCStack.h:17
 TVirtualMCStack.h:18
 TVirtualMCStack.h:19
 TVirtualMCStack.h:20
 TVirtualMCStack.h:21
 TVirtualMCStack.h:22
 TVirtualMCStack.h:23
 TVirtualMCStack.h:24
 TVirtualMCStack.h:25
 TVirtualMCStack.h:26
 TVirtualMCStack.h:27
 TVirtualMCStack.h:28
 TVirtualMCStack.h:29
 TVirtualMCStack.h:30
 TVirtualMCStack.h:31
 TVirtualMCStack.h:32
 TVirtualMCStack.h:33
 TVirtualMCStack.h:34
 TVirtualMCStack.h:35
 TVirtualMCStack.h:36
 TVirtualMCStack.h:37
 TVirtualMCStack.h:38
 TVirtualMCStack.h:39
 TVirtualMCStack.h:40
 TVirtualMCStack.h:41
 TVirtualMCStack.h:42
 TVirtualMCStack.h:43
 TVirtualMCStack.h:44
 TVirtualMCStack.h:45
 TVirtualMCStack.h:46
 TVirtualMCStack.h:47
 TVirtualMCStack.h:48
 TVirtualMCStack.h:49
 TVirtualMCStack.h:50
 TVirtualMCStack.h:51
 TVirtualMCStack.h:52
 TVirtualMCStack.h:53
 TVirtualMCStack.h:54
 TVirtualMCStack.h:55
 TVirtualMCStack.h:56
 TVirtualMCStack.h:57
 TVirtualMCStack.h:58
 TVirtualMCStack.h:59
 TVirtualMCStack.h:60
 TVirtualMCStack.h:61
 TVirtualMCStack.h:62
 TVirtualMCStack.h:63
 TVirtualMCStack.h:64
 TVirtualMCStack.h:65
 TVirtualMCStack.h:66
 TVirtualMCStack.h:67
 TVirtualMCStack.h:68
 TVirtualMCStack.h:69
 TVirtualMCStack.h:70
 TVirtualMCStack.h:71
 TVirtualMCStack.h:72
 TVirtualMCStack.h:73
 TVirtualMCStack.h:74
 TVirtualMCStack.h:75
 TVirtualMCStack.h:76
 TVirtualMCStack.h:77
 TVirtualMCStack.h:78
 TVirtualMCStack.h:79
 TVirtualMCStack.h:80
 TVirtualMCStack.h:81
 TVirtualMCStack.h:82
 TVirtualMCStack.h:83
 TVirtualMCStack.h:84
 TVirtualMCStack.h:85
 TVirtualMCStack.h:86
 TVirtualMCStack.h:87
 TVirtualMCStack.h:88
 TVirtualMCStack.h:89
 TVirtualMCStack.h:90
 TVirtualMCStack.h:91
 TVirtualMCStack.h:92
 TVirtualMCStack.h:93
 TVirtualMCStack.h:94
 TVirtualMCStack.h:95
 TVirtualMCStack.h:96
 TVirtualMCStack.h:97
 TVirtualMCStack.h:98