/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Generator/BesEvtGen/BesEvtGen-00-03-58/src/EvtGen/EvtGenBase/EvtParticle.hh

Go to the documentation of this file.
00001 //--------------------------------------------------------------------------
00002 //
00003 // Environment:
00004 //      This software is part of the EvtGen package developed jointly
00005 //      for the BaBar and CLEO collaborations.  If you use all or part
00006 //      of it, please give an appropriate acknowledgement.
00007 //
00008 // Copyright Information: See EvtGen/COPYRIGHT
00009 //      Copyright (C) 1998      Caltech, UCSB
00010 //
00011 // Module: EvtGen/EvtParticle.hh
00012 //
00013 // Description:Class to describe all particles
00014 //
00015 // Modification history:
00016 //
00017 //    DJL/RYD     Sept. 25, 1996         Module created
00018 //
00019 //------------------------------------------------------------------------
00020 
00021 #ifndef EVTPARTICLE_HH
00022 #define EVTPARTICLE_HH
00023 
00024 //#include <iostream.h>
00025 #include <assert.h>
00026 #include "EvtGenBase/EvtVector4R.hh"
00027 #include "EvtGenBase/EvtSpinDensity.hh"
00028 #include "EvtGenBase/EvtId.hh"
00029 #include "EvtGenBase/EvtSpinType.hh"
00030 #include <string>
00031 #include "EvtGenModels/EvtGlobalSet.hh"
00032 class EvtDiracSpinor;
00033 class EvtVector4C;
00034 class EvtTensor4C;
00035 class EvtStdHep;
00036 class EvtSecondary;
00037 
00038 const int MAX_DAUG =100;
00039 const int MAX_LEVEL=10;
00040 const int MAX_TRIES=10000;
00041 
00042 class EvtParticle{
00043 
00044 public:
00045 
00049   EvtParticle();
00050 
00054   virtual ~EvtParticle();
00055 
00059   virtual EvtVector4C epsParent(int i) const; 
00060 
00064   virtual EvtVector4C eps(int i) const; 
00065 
00066 
00070   virtual EvtVector4C epsParentPhoton(int i); 
00071 
00075   virtual EvtVector4C epsPhoton(int i); 
00076 
00077 
00081   virtual EvtDiracSpinor spParent(int) const;
00082 
00086   virtual EvtDiracSpinor sp(int) const;
00087 
00088 
00089 
00093   virtual EvtDiracSpinor spParentNeutrino() const;
00094 
00099   virtual EvtDiracSpinor spNeutrino() const;
00100   
00101 
00105   virtual EvtTensor4C epsTensorParent(int i) const; 
00106 
00110   virtual EvtTensor4C epsTensor(int i) const; 
00111 
00115   virtual void init(EvtId part_n,const EvtVector4R& p4)=0;
00116   
00120   void addDaug(EvtParticle *node); 
00121   
00125   void decay();
00126 
00130   void deleteTree();
00131   void deleteDaughters(bool keepChannel=false);
00132 
00136   void setChannel( int i );
00137 
00141   void setGeneratorFlag(int flag){_generatorFlag = flag;}
00142 
00146   int getGeneratorFlag(){ return _generatorFlag ;}
00147   
00151   void setIntFlag(std::vector<int> vi){
00152     _intFlag=vi;
00153   }
00154 
00158   std::vector<int>  getIntFlag(){
00159     return _intFlag;
00160   }
00161 
00167   void makeDaughters(int ndaug,EvtId *id);
00168 
00174   double initializePhaseSpace(int numdaughter,EvtId *daughters, 
00175                             double poleSize=-1., int whichTwo1=0, 
00176                             int whichTwo2=1); 
00177 
00181   EvtParticle *getDaug(int i);
00182 
00186   EvtParticle *nextIter(EvtParticle *rootOfTree=0);
00187 
00191   void makeStdHep(EvtStdHep& stdhep,
00192                  EvtSecondary& secondary,EvtId *stable_parent_ihep);
00193   void makeStdHep(EvtStdHep& stdhep);
00194 
00199   EvtVector4R getP4Lab();
00200 
00205   EvtVector4R getP4Restframe();
00206 
00210   EvtVector4R get4Pos();
00211 
00215   EvtParticle *getParent();
00216   
00220   void insertDaugPtr(int idaug,EvtParticle* partptr){ _daug[idaug]=partptr;
00221                                                  partptr->_parent=this; }
00225   double mass() const;
00226 
00230   int firstornot() const;
00231   void setFirstOrNot();
00232   void resetFirstOrNot();
00233 
00237   EvtId getId() const;
00238 
00243   EvtSpinType::spintype getSpinType() const;
00244 
00248   int getSpinStates() const;
00249 
00253   const EvtVector4R& getP4() const;
00254 
00258   void setP4(const EvtVector4R& p4){_p=p4;}
00259   
00263   int getChannel() const;
00264   
00268   int getNDaug() const;
00269   void resetNDaug() {_ndaug=0; return;}
00270 
00276   void printTree() const;
00277 
00278   void printTreeRec(int level) const;
00279   std::string writeTreeRec(std::string ) const;
00280 
00281   void dumpTree( ) const;
00282   void dumpTreeRec(int level,int dj) const;
00283 
00284   std::string treeStr() const;
00285   std::string treeStrRec(int level) const;
00286 
00290   void printParticle() const;
00291 
00295   void setLifetime(double tau);
00296   
00300   void setLifetime();
00301 
00305   double getLifetime();
00306 
00310   void setDiagonalSpinDensity();
00311   
00315   void setVectorSpinDensity(); 
00316   
00317   void setPolarizedSpinDensity(double r00,double r11,double r22); //pingrg for polarized charmonium production 
00321   void setSpinDensityForward(const EvtSpinDensity& rho){_rhoForward=rho;}
00322 
00327   void setSpinDensityForwardHelicityBasis(const EvtSpinDensity& rho);
00328   void setSpinDensityForwardHelicityBasis(const EvtSpinDensity& rho,
00329                                           double alpha,
00330                                           double beta,
00331                                           double gamma);
00332   
00339   virtual EvtSpinDensity rotateToHelicityBasis() const=0;
00340   virtual EvtSpinDensity rotateToHelicityBasis(double alpha,
00341                                                double beta,
00342                                                double gamma) const=0;
00343 
00347   EvtSpinDensity getSpinDensityForward(){return _rhoForward;}
00348 
00352   void setSpinDensityBackward(const EvtSpinDensity& rho){_rhoBackward=rho;}
00353 
00357   EvtSpinDensity getSpinDensityBackward(){return _rhoBackward;}
00358 
00359   //Hacks will be removed when better solutions are thought of!
00360   //This is used to suppress use of random numbers when doing initialization
00361   //of some models.
00362   void noLifeTime() { _genlifetime=0; }
00363 
00364   //lange - April 29, 2002
00365   void setId(EvtId id) { _id=id;}
00366   void initDecay(bool useMinMass=false);
00367   void generateMassTree();
00368 
00369   double compMassProb();
00370 
00371   //setMass will blow away any existing 4vector
00372   void setMass(double m) { _p=EvtVector4R(m,0.0,0.0,0.0);}
00373 
00374   //void setMixed() {_mix=true;}
00375   //void setUnMixed() {_mix=false;}
00376   //bool getMixed() {return _mix;}
00377 
00378   //void takeCConj() {report(INFO,"EvtGen") << "should take conj\n";}
00379 
00380   //this means that the particle has gone through initDecay
00381   // and thus has a mass
00382   bool isInitialized() {return _isInit;}
00383   bool hasValidP4() {return _validP4;}
00384   bool isDecayed() {return _isDecayed;}
00385 
00386 
00387   // decay prob - only relevent if already decayed
00388   // and is a scalar particle
00389   // returned is a double* that should be prob/probMax
00390   double* decayProb() {return _decayProb;}
00391   void setDecayProb( double p);
00392 
00393   void setInclusiveMode(int im){_inclusiveMode=im ;}
00394   int  getInclusiveMode(){return _inclusiveMode;}
00395   
00396 protected:
00397 
00398   void setp( double e, double px, double py, double pz) { _p.set(e,px,py,pz); }
00399   void setp( const EvtVector4R& p4 ) { _p =p4; }
00400   void setpart_num(EvtId particle_number ) 
00401   { 
00402     assert(_channel==-10||
00403            _id.getId()==particle_number.getId()||
00404            _id.getId()==-1);
00405     _id = particle_number; 
00406   }
00407   bool           _validP4;
00408 
00409 private:
00410 
00411   EvtParticle*   _daug[MAX_DAUG];
00412   int            _ndaug; 
00413   EvtParticle*   _parent;
00414   int            _channel; 
00415   int            _first;
00416   EvtId          _id;
00417   EvtVector4R    _p;
00418   double         _t;
00419   bool            _isInit;
00420   bool           _isDecayed;
00421   int            _generatorFlag;
00422   //bool _mix;
00423 
00424   EvtSpinDensity _rhoForward;
00425   EvtSpinDensity _rhoBackward;
00426 
00427   void makeStdHepRec(int firstparent,int lastparent,EvtStdHep& stdhep,
00428                  EvtSecondary& secondary,EvtId *stable_parent_ihep);
00429   void makeStdHepRec(int firstparent,int lastparent,EvtStdHep& stdhep);
00430 
00431 
00432   //This is a hack until things gets straightened out. (Ryd)
00433   int         _genlifetime;
00434   
00435   //should never be used, therefor is private.
00436   //these does _not_ have an implementation
00437   EvtParticle& operator=(const EvtParticle& p);
00438   EvtParticle(const EvtParticle& p);
00439 
00440   double *_decayProb;
00441 
00442   //Access the inclusive mode for OPENCHARM
00443   int _inclusiveMode;
00444   //Set mode index for ConExc
00445   std::vector<int> _intFlag;
00446 
00447 
00448 };
00449 
00450 std::string IntToStr( int  a); //pingrg, 2008-03-24
00451 #endif
00452 

Generated on Tue Nov 29 23:12:14 2016 for BOSS_7.0.2 by  doxygen 1.4.7