[819] | 1 | // |
---|
| 2 | // ******************************************************************** |
---|
| 3 | // * License and Disclaimer * |
---|
| 4 | // * * |
---|
| 5 | // * The Geant4 software is copyright of the Copyright Holders of * |
---|
| 6 | // * the Geant4 Collaboration. It is provided under the terms and * |
---|
| 7 | // * conditions of the Geant4 Software License, included in the file * |
---|
| 8 | // * LICENSE and available at http://cern.ch/geant4/license . These * |
---|
| 9 | // * include a list of copyright holders. * |
---|
| 10 | // * * |
---|
| 11 | // * Neither the authors of this software system, nor their employing * |
---|
| 12 | // * institutes,nor the agencies providing financial support for this * |
---|
| 13 | // * work make any representation or warranty, express or implied, * |
---|
| 14 | // * regarding this software system or assume any liability for its * |
---|
| 15 | // * use. Please see the license in the file LICENSE and URL above * |
---|
| 16 | // * for the full disclaimer and the limitation of liability. * |
---|
| 17 | // * * |
---|
| 18 | // * This code implementation is the result of the scientific and * |
---|
| 19 | // * technical work of the GEANT4 collaboration. * |
---|
| 20 | // * By using, copying, modifying or distributing the software (or * |
---|
| 21 | // * any work based on the software) you agree to acknowledge its * |
---|
| 22 | // * use in resulting scientific publications, and indicate your * |
---|
| 23 | // * acceptance of all terms of the Geant4 Software license. * |
---|
| 24 | // ******************************************************************** |
---|
| 25 | // |
---|
| 26 | // |
---|
[1055] | 27 | // $Id: G4QCandidate.cc,v 1.35 2009/02/23 09:49:24 mkossov Exp $ |
---|
[1340] | 28 | // GEANT4 tag $Name: hadr-chips-V09-03-08 $ |
---|
[819] | 29 | // |
---|
| 30 | // ---------------- G4QCandidate ---------------- |
---|
| 31 | // by Mikhail Kossov, Sept 1999. |
---|
| 32 | // class for Quasmon initiated Candidates used by CHIPS Model |
---|
| 33 | // ------------------------------------------------------------------ |
---|
[1055] | 34 | // Short description: A candidate for hadronization. The candidates |
---|
| 35 | // (hadrons or nuclear fragments) are competative, each quark of a |
---|
| 36 | // Quasmon select which candidate to use for hadronization |
---|
| 37 | // ------------------------------------------------------------------ |
---|
[819] | 38 | |
---|
| 39 | //#define debug |
---|
| 40 | |
---|
| 41 | #include "G4QCandidate.hh" |
---|
| 42 | #include <algorithm> |
---|
| 43 | |
---|
| 44 | G4QCandidate::G4QCandidate() : |
---|
| 45 | G4QHadron(),possible(false),parPossible(false),kMin(0),denseProbability(0.), |
---|
| 46 | preProbability(0.),relativeProbability(0.),integralProbability(0.), |
---|
| 47 | secondRelProbability(0.),secondIntProbability(0.),EBMass(0.),NBMass(0.) |
---|
| 48 | |
---|
| 49 | { |
---|
| 50 | } |
---|
| 51 | |
---|
| 52 | G4QCandidate::G4QCandidate(G4int PDGcode) : |
---|
| 53 | G4QHadron(PDGcode),possible(false),parPossible(false),kMin(0),denseProbability(0.), |
---|
| 54 | preProbability(0.),relativeProbability(0.),integralProbability(0.), |
---|
| 55 | secondRelProbability(0.),secondIntProbability(0.),EBMass(0.),NBMass(0.) |
---|
| 56 | { |
---|
| 57 | #ifdef debug |
---|
| 58 | G4cout<<"G4QCandidate::Constructor: PDG="<<PDGcode<<G4endl; |
---|
| 59 | #endif |
---|
| 60 | G4LorentzVector cur4Mom(0.,0.,0.,0.); |
---|
| 61 | G4QPDGCode QPDG(PDGcode); |
---|
| 62 | #ifdef debug |
---|
| 63 | G4cout<<"G4QCandidate::Constructor: QPDG="<<QPDG<<G4endl; |
---|
| 64 | #endif |
---|
| 65 | SetQPDG(QPDG); |
---|
| 66 | G4double vacMass=QPDG.GetMass(); |
---|
| 67 | #ifdef debug |
---|
| 68 | G4cout<<"G4QCandidate::Constructor: M="<<vacMass<<G4endl; |
---|
| 69 | #endif |
---|
| 70 | cur4Mom.setE(vacMass); |
---|
| 71 | Set4Momentum(cur4Mom); |
---|
| 72 | SetQC(QPDG.GetQuarkContent()); |
---|
| 73 | } |
---|
| 74 | |
---|
| 75 | G4QCandidate::G4QCandidate(const G4QCandidate& right) : |
---|
| 76 | G4QHadron(&right) |
---|
| 77 | { |
---|
| 78 | Set4Momentum (right.Get4Momentum()); |
---|
| 79 | SetQPDG (right.GetQPDG()); |
---|
| 80 | SetQC (right.GetQC()); |
---|
| 81 | SetNFragments (right.GetNFragments()); |
---|
| 82 | possible = right.possible; |
---|
| 83 | parPossible = right.parPossible; |
---|
| 84 | kMin = right.kMin; |
---|
| 85 | denseProbability = right.denseProbability; |
---|
| 86 | preProbability = right.preProbability; |
---|
| 87 | relativeProbability = right.relativeProbability; |
---|
| 88 | integralProbability = right.integralProbability; |
---|
| 89 | secondRelProbability= right.secondRelProbability; |
---|
| 90 | secondIntProbability= right.secondIntProbability; |
---|
| 91 | EBMass = right.EBMass; |
---|
| 92 | NBMass = right.NBMass; |
---|
| 93 | // thePClusters |
---|
| 94 | G4int nParCl = right.thePClusters.size(); |
---|
| 95 | if(nParCl) for(G4int ip=0; ip<nParCl; ip++) |
---|
| 96 | { |
---|
| 97 | G4QParentCluster* curPC = new G4QParentCluster(right.thePClusters[ip]); |
---|
| 98 | thePClusters.push_back(curPC); |
---|
| 99 | } |
---|
| 100 | } |
---|
| 101 | |
---|
| 102 | G4QCandidate::G4QCandidate(G4QCandidate* right) |
---|
| 103 | { |
---|
| 104 | Set4Momentum (right->Get4Momentum()); |
---|
| 105 | SetQPDG (right->GetQPDG()); |
---|
| 106 | SetQC (right->GetQC()); |
---|
| 107 | SetNFragments (right->GetNFragments()); |
---|
| 108 | possible = right->possible; |
---|
| 109 | parPossible = right->parPossible; |
---|
| 110 | kMin = right->kMin; |
---|
| 111 | denseProbability = right->denseProbability; |
---|
| 112 | preProbability = right->preProbability; |
---|
| 113 | relativeProbability = right->relativeProbability; |
---|
| 114 | integralProbability = right->integralProbability; |
---|
| 115 | secondRelProbability= right->secondRelProbability; |
---|
| 116 | secondIntProbability= right->secondIntProbability; |
---|
| 117 | EBMass = right->EBMass; |
---|
| 118 | NBMass = right->NBMass; |
---|
| 119 | // thePClusters |
---|
| 120 | G4int nParCl = right->thePClusters.size(); |
---|
| 121 | if(nParCl) for(G4int ip=0; ip<nParCl; ip++) |
---|
| 122 | { |
---|
| 123 | G4QParentCluster* curPC = new G4QParentCluster(right->thePClusters[ip]); |
---|
| 124 | thePClusters.push_back(curPC); |
---|
| 125 | } |
---|
| 126 | } |
---|
| 127 | |
---|
| 128 | G4QCandidate::~G4QCandidate() |
---|
| 129 | { |
---|
| 130 | #ifdef debug |
---|
| 131 | G4cout<<"~G4QCandidate: before thePClusters nC="<<thePClusters.size()<<G4endl; |
---|
| 132 | #endif |
---|
| 133 | std::for_each(thePClusters.begin(), thePClusters.end(), DeleteQParentCluster()); |
---|
| 134 | #ifdef debug |
---|
| 135 | G4cout<<"~G4QCandidate: === DONE ==="<<G4endl; |
---|
| 136 | #endif |
---|
| 137 | } |
---|
| 138 | |
---|
| 139 | // Assignment operator |
---|
| 140 | const G4QCandidate& G4QCandidate::operator=(const G4QCandidate &right) |
---|
| 141 | { |
---|
| 142 | if(this != &right) // Beware of self assignment |
---|
| 143 | { |
---|
| 144 | Set4Momentum (right.Get4Momentum()); |
---|
| 145 | SetQPDG (right.GetQPDG()); |
---|
| 146 | SetQC (right.GetQC()); |
---|
| 147 | SetNFragments (right.GetNFragments()); |
---|
| 148 | possible = right.possible; |
---|
| 149 | parPossible = right.parPossible; |
---|
| 150 | kMin = right.kMin; |
---|
| 151 | denseProbability = right.denseProbability; |
---|
| 152 | preProbability = right.preProbability; |
---|
| 153 | relativeProbability = right.relativeProbability; |
---|
| 154 | integralProbability = right.integralProbability; |
---|
| 155 | secondRelProbability= right.secondRelProbability; |
---|
| 156 | secondIntProbability= right.secondIntProbability; |
---|
| 157 | EBMass = right.EBMass; |
---|
| 158 | NBMass = right.NBMass; |
---|
| 159 | // thePClusters (Vector) |
---|
| 160 | G4int nParCl = right.thePClusters.size(); |
---|
| 161 | if(nParCl) for(G4int ip=0; ip<nParCl; ip++) |
---|
| 162 | { |
---|
| 163 | G4QParentCluster* curPC = new G4QParentCluster(right.thePClusters[ip]); |
---|
| 164 | thePClusters.push_back(curPC); |
---|
| 165 | } |
---|
| 166 | } |
---|
| 167 | return *this; |
---|
| 168 | } |
---|