G4QCandidate.cc

Go to the documentation of this file.
00001 //
00002 // ********************************************************************
00003 // * License and Disclaimer                                           *
00004 // *                                                                  *
00005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
00006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
00007 // * conditions of the Geant4 Software License,  included in the file *
00008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
00009 // * include a list of copyright holders.                             *
00010 // *                                                                  *
00011 // * Neither the authors of this software system, nor their employing *
00012 // * institutes,nor the agencies providing financial support for this *
00013 // * work  make  any representation or  warranty, express or implied, *
00014 // * regarding  this  software system or assume any liability for its *
00015 // * use.  Please see the license in the file  LICENSE  and URL above *
00016 // * for the full disclaimer and the limitation of liability.         *
00017 // *                                                                  *
00018 // * This  code  implementation is the result of  the  scientific and *
00019 // * technical work of the GEANT4 collaboration.                      *
00020 // * By using,  copying,  modifying or  distributing the software (or *
00021 // * any work based  on the software)  you  agree  to acknowledge its *
00022 // * use  in  resulting  scientific  publications,  and indicate your *
00023 // * acceptance of all terms of the Geant4 Software license.          *
00024 // ********************************************************************
00025 //
00026 //
00027 // $Id$
00028 //
00029 //      ---------------- G4QCandidate ----------------
00030 //             by Mikhail Kossov, Sept 1999.
00031 //      class for Quasmon initiated Candidates used by CHIPS Model
00032 // ------------------------------------------------------------------
00033 // Short description: A candidate for hadronization. The candidates
00034 // (hadrons or nuclear fragments) are competative, each quark of a
00035 // Quasmon select which candidate to use for hadronization
00036 // ------------------------------------------------------------------
00037 
00038 //#define debug
00039 
00040 #include "G4QCandidate.hh"
00041 #include <algorithm>
00042 
00043 G4QCandidate::G4QCandidate() : 
00044   G4QHadron(),possible(false),parPossible(false),kMin(0),denseProbability(0.),
00045   preProbability(0.),relativeProbability(0.),integralProbability(0.),
00046   secondRelProbability(0.),secondIntProbability(0.),EBMass(0.),NBMass(0.)
00047                             
00048 {
00049 }
00050 
00051 G4QCandidate::G4QCandidate(G4int PDGcode) :
00052   G4QHadron(PDGcode),possible(false),parPossible(false),kMin(0),denseProbability(0.),
00053   preProbability(0.),relativeProbability(0.),integralProbability(0.),
00054   secondRelProbability(0.),secondIntProbability(0.),EBMass(0.),NBMass(0.)
00055 {
00056 #ifdef debug
00057   G4cout<<"G4QCandidate::Constructor: PDG="<<PDGcode<<G4endl;
00058 #endif
00059   G4LorentzVector cur4Mom(0.,0.,0.,0.);
00060   G4QPDGCode QPDG(PDGcode);
00061 #ifdef debug
00062   G4cout<<"G4QCandidate::Constructor: QPDG="<<QPDG<<G4endl;
00063 #endif
00064   SetQPDG(QPDG);
00065   G4double vacMass=QPDG.GetMass();
00066 #ifdef debug
00067   G4cout<<"G4QCandidate::Constructor: M="<<vacMass<<G4endl;
00068 #endif
00069   cur4Mom.setE(vacMass);
00070   Set4Momentum(cur4Mom);
00071   SetQC(QPDG.GetQuarkContent());
00072 }
00073 
00074 G4QCandidate::G4QCandidate(const G4QCandidate& right) : 
00075   G4QHadron(&right)
00076 {
00077   Set4Momentum         (right.Get4Momentum());
00078   SetQPDG              (right.GetQPDG());
00079   SetQC                (right.GetQC());
00080   SetNFragments        (right.GetNFragments());
00081   possible            = right.possible;
00082   parPossible         = right.parPossible;
00083   kMin                = right.kMin;
00084   denseProbability    = right.denseProbability;
00085   preProbability      = right.preProbability;
00086   relativeProbability = right.relativeProbability;
00087   integralProbability = right.integralProbability;
00088   secondRelProbability= right.secondRelProbability;
00089   secondIntProbability= right.secondIntProbability;
00090   EBMass = right.EBMass;
00091   NBMass = right.NBMass;
00092   // thePClusters
00093   G4int nParCl        = right.thePClusters.size();
00094   if(nParCl) for(G4int ip=0; ip<nParCl; ip++)
00095   {
00096     G4QParentCluster* curPC = new G4QParentCluster(right.thePClusters[ip]);
00097     thePClusters.push_back(curPC);
00098   }
00099 }
00100 
00101 G4QCandidate::G4QCandidate(G4QCandidate* right)
00102 {
00103   Set4Momentum         (right->Get4Momentum());
00104   SetQPDG              (right->GetQPDG());
00105   SetQC                (right->GetQC());
00106   SetNFragments        (right->GetNFragments());
00107   possible            = right->possible;
00108   parPossible         = right->parPossible;
00109   kMin                = right->kMin;
00110   denseProbability    = right->denseProbability;
00111   preProbability      = right->preProbability;
00112   relativeProbability = right->relativeProbability;
00113   integralProbability = right->integralProbability;
00114   secondRelProbability= right->secondRelProbability;
00115   secondIntProbability= right->secondIntProbability;
00116   EBMass = right->EBMass;
00117   NBMass = right->NBMass;
00118   // thePClusters
00119   G4int nParCl        = right->thePClusters.size();
00120   if(nParCl) for(G4int ip=0; ip<nParCl; ip++)
00121   {
00122     G4QParentCluster* curPC = new G4QParentCluster(right->thePClusters[ip]);
00123     thePClusters.push_back(curPC);
00124   }
00125 }
00126 
00127 G4QCandidate::~G4QCandidate()
00128 {
00129 #ifdef debug
00130   G4cout<<"~G4QCandidate: before thePClusters nC="<<thePClusters.size()<<G4endl;
00131 #endif
00132   std::for_each(thePClusters.begin(), thePClusters.end(), DeleteQParentCluster());
00133 #ifdef debug
00134   G4cout<<"~G4QCandidate: === DONE ==="<<G4endl;
00135 #endif
00136 }
00137 
00138 // Assignment operator
00139 const G4QCandidate& G4QCandidate::operator=(const G4QCandidate &right)
00140 {
00141   if(this != &right)                          // Beware of self assignment
00142   {
00143     Set4Momentum         (right.Get4Momentum());
00144     SetQPDG              (right.GetQPDG());
00145     SetQC                (right.GetQC());
00146     SetNFragments        (right.GetNFragments());
00147     possible            = right.possible;
00148     parPossible         = right.parPossible;
00149     kMin                = right.kMin;
00150     denseProbability    = right.denseProbability;
00151     preProbability      = right.preProbability;
00152     relativeProbability = right.relativeProbability;
00153     integralProbability = right.integralProbability;
00154     secondRelProbability= right.secondRelProbability;
00155     secondIntProbability= right.secondIntProbability;
00156     EBMass = right.EBMass;
00157     NBMass = right.NBMass;
00158     // thePClusters (Vector)
00159     G4int nParCl        = right.thePClusters.size();
00160     if(nParCl) for(G4int ip=0; ip<nParCl; ip++)
00161     {
00162       G4QParentCluster* curPC = new G4QParentCluster(right.thePClusters[ip]);
00163       thePClusters.push_back(curPC);
00164     }
00165   }
00166   return *this;
00167 }

Generated on Mon May 27 17:49:30 2013 for Geant4 by  doxygen 1.4.7