DecayList.h

00001 #ifndef _DecayList_h_included_
00002 #define _DecayList_h_included_
00003 
00004 /** 
00005  * @class DecayList
00006  *
00007  * @brief Storage class for keeping track of TauolaParticles and
00008  * their index (as passed to Tauola).
00009  *
00010  * This class contains a list of TauolaParticles. The index of the
00011  * TauolaParticle in the list is passed to FORTRAN TAUOLA (as we can 
00012  * not pass TauolaParticles directly). A static copy of the class is 
00013  * used for any run of Tauola and is cleared after each decay generation.
00014  * To be compatible with how indicies are used in Tauola, those that are:
00015  * - < 0 are relative to some other given position in the list
00016  * - = 0 is the position one greater than some given position in the list.
00017  * - > 0 are absolute. 1 is the first item (which should generally be 
00018  * the tau's position) 
00019  *
00020  * @author Nadia Davidson
00021  * @date 17 June 2008
00022  */
00023 
00024 #include <stdio.h>
00025 #include <stdlib.h>
00026 #include <iostream>
00027 
00028 #include "TauolaParticle.h"
00029 
00030 using namespace std;
00031 
00032 namespace Tauolapp
00033 {
00034 
00035 class TauolaParticle;
00036 
00037 class DecayList {
00038   
00039  public:
00040   /** Return the TauolaParticle corresponding to the index (absolute)
00041       in the list of particle */
00042   static TauolaParticle * getParticle(int index);
00043 
00044   /** Adds the new particle into the list and delete the previous
00045      particle at the same position if it exists */
00046   static void updateList(TauolaParticle * new_particle,
00047                          int index);
00048   
00049   /** Adds the new particle to the end of list */ 
00050   static void addToEnd(TauolaParticle * new_particle);
00051 
00052   /** clear all entries from the list */
00053   static void clear();
00054 
00055   /** Translates index (absolute and relative) to
00056       absolute index. If a relative index is given (negative integer)
00057       it is taken relative from the end of the list */
00058   static int getAbsoluteIndex(int index);
00059 
00060   /** Translates index (absolute and relative) to
00061       absolute index. If a relative index is given (negative integer)
00062       it is taken relative to the parameter "neg_index_relative_to" */
00063   static int getAbsoluteIndex(int index, 
00064                               int neg_index_relative_to);
00065 
00066   /** Return index (absolute) of "particle" */
00067   static int getAbsoluteIndex(TauolaParticle * particle);
00068 
00069   /** Print the contents of the list */
00070   static void print();
00071 
00072  private:
00073   /** vector used for TauolaParticle mapping */
00074   static vector<TauolaParticle*> m_particle_list;
00075 
00076 };
00077 
00078 } // namespace Tauolapp
00079 #endif
Generated on Sun Oct 20 20:24:08 2013 for C++InterfacetoTauola by  doxygen 1.6.3