G4InteractionContent.hh

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 
00030 #ifndef G4InteractionContent_h
00031 #define G4InteractionContent_h 1
00032 
00033 // ------------------------------------------------------------
00034 //      GEANT 4 class header file
00035 //
00036 //      ---------------- G4InteractionContent----------------
00037 //             by Gunter Folger, June 1998.
00038 //       class for a storing colliding particles in PartonString Models
00039 // ------------------------------------------------------------
00040 
00041 #include "globals.hh"
00042 #include "G4VSplitableHadron.hh"
00043 #include "G4Nucleon.hh"                // Uzhi 16.07.09
00044 
00045 //#define debug_QGSM
00046 #ifdef debug_QGSM
00047   #include "../../qgsm/include/G4QGSMSplitableHadron.hh"
00048   #include <deque>
00049 #endif  
00050 
00051 class G4InteractionContent 
00052 {
00053 
00054   public:
00055 
00056       G4InteractionContent() {}
00057       G4InteractionContent(G4VSplitableHadron *aPrimaryParticipant);
00058 
00059       ~G4InteractionContent();
00060 
00061       G4bool operator<(const G4InteractionContent &right) const;
00062       
00063       G4VSplitableHadron * GetProjectile() const ;
00064       G4VSplitableHadron * GetTarget() const;
00065 
00066       void                 SetTargetNucleon(G4Nucleon * aNucleon);
00067       G4Nucleon          * GetTargetNucleon() const;
00068 
00069       void SetTarget(G4VSplitableHadron *aTarget);
00070 
00071       G4int GetNumberOfSoftCollisions();
00072       G4int GetNumberOfHardCollisions();
00073       void  SetNumberOfSoftCollisions(int);
00074       void  SetNumberOfHardCollisions(int);
00075       G4int GetNumberOfDiffractiveCollisions();
00076       void  SetNumberOfDiffractiveCollisions(int);
00077 
00078       void SplitHadrons();
00079 
00080       void     SetInteractionTime(G4double aValue); // Uzhi Feb23
00081       G4double GetInteractionTime() const;          // Uzhi Feb23
00082       void     SetStatus(G4int aValue);             // Uzhi Feb26
00083       G4int    GetStatus() const;                   // Uzhi Feb26
00084  
00085 #ifdef G4DEBUG
00086       void Dump();
00087 #endif      
00088      
00089 
00090 private:
00091       G4InteractionContent & operator=(const G4InteractionContent &right);
00092       G4InteractionContent(const G4InteractionContent &right);
00093       int operator==(const G4InteractionContent &right) const;
00094       int operator!=(const G4InteractionContent &right) const;
00095 
00096   protected:
00097 
00098   private:
00099 
00100       G4VSplitableHadron * theTarget;
00101       G4VSplitableHadron * theProjectile;
00102       G4Nucleon          * theTargetNucleon;
00103       
00104       G4int theNumberOfHard;
00105       G4int theNumberOfSoft;
00106       G4int theNumberOfDiffractive;
00107 
00108       G4double theInteractionTime;
00109       G4int    curStatus;
00110 
00111 };
00112 
00113 // Class G4InteractionContent 
00114 
00115 inline G4VSplitableHadron * G4InteractionContent::GetProjectile() const
00116 {
00117         return theProjectile;
00118 }
00119 
00120 inline G4VSplitableHadron * G4InteractionContent::GetTarget() const
00121 {
00122         return theTarget;
00123 }
00124 
00125 inline void G4InteractionContent::SetTarget(G4VSplitableHadron *aTarget)
00126 {
00127         theTarget = aTarget;
00128 }
00129 
00130 inline void G4InteractionContent::SetTargetNucleon(G4Nucleon * aNucleon)
00131 {
00132         theTargetNucleon = aNucleon;
00133 }
00134 
00135 inline G4Nucleon * G4InteractionContent::GetTargetNucleon() const
00136 {
00137        return theTargetNucleon;
00138 }
00139 
00140 inline G4int G4InteractionContent::GetNumberOfSoftCollisions()
00141 {
00142         return theNumberOfSoft;
00143 }
00144 
00145 inline G4int G4InteractionContent::GetNumberOfHardCollisions()
00146 {
00147         return theNumberOfHard;
00148 }
00149 
00150 inline void G4InteractionContent::SetNumberOfSoftCollisions(int nCol)
00151 {
00152         theNumberOfSoft = nCol;
00153 }
00154 
00155 inline void G4InteractionContent::SetNumberOfHardCollisions(int nCol)
00156 {
00157         theNumberOfHard = nCol;
00158 }
00159 
00160 inline G4int G4InteractionContent::GetNumberOfDiffractiveCollisions()
00161 {
00162         return theNumberOfDiffractive;
00163 }
00164 
00165 inline void G4InteractionContent::SetNumberOfDiffractiveCollisions(int nCol)
00166 {
00167         theNumberOfDiffractive = nCol;
00168 }
00169 
00170 inline void G4InteractionContent::SplitHadrons()
00171 {
00172         if ( theProjectile != NULL ) theProjectile->SplitUp();
00173         if ( theTarget != NULL ) theTarget->SplitUp();
00174         #ifdef G4DEBUG
00175         //  Dump();
00176         #endif
00177 }
00178 
00179 #ifdef G4DEBUG
00180 inline void G4InteractionContent::Dump()
00181 {
00182         G4LorentzVector mom(0.,0.,0.,0.);
00183         G4cout  << " G4InteractionContent " << this << G4endl
00184                         << "Hard/Soft/Diff "
00185                         << theNumberOfHard<<" / "
00186                         <<theNumberOfSoft<<" / "
00187                         <<theNumberOfDiffractive << G4endl
00188                         << "Projectile " ;
00189         if ( theProjectile ) {
00190                 G4cout <<  theProjectile->GetDefinition()->GetPDGEncoding()
00191                                 << "  " << theProjectile->Get4Momentum()<< G4endl;
00192                 mom+=theProjectile->Get4Momentum();
00193                 #ifdef debug_QGSM 
00194                         G4QGSMSplitableHadron * at =(G4QGSMSplitableHadron*)theProjectile;
00195                         std::deque<G4Parton *>color=at->GetColorPartons();
00196                         std::deque<G4Parton *>anticolor=at->GetAntiColorPartons();
00197                         G4cout << " proj. color/anti size " << color.size() << " / " << anticolor.size() << G4endl;
00198                         std::deque<G4Parton *>::iterator p_iter;
00199                         G4LorentzVector colmom(0.,0.,0.,0.);
00200                         for ( p_iter=color.begin(); p_iter!= color.end(); ++p_iter){
00201                                 G4cout << "proj color : "<<(*p_iter)->GetPDGcode() << ", mom= "<< (*p_iter)->Get4Momentum()<<G4endl;
00202                                 colmom+=(*p_iter)->Get4Momentum();
00203                         }
00204 
00205                         G4LorentzVector anticolmom(0.,0.,0.,0.);
00206                         for ( p_iter=anticolor.begin(); p_iter!= anticolor.end(); ++p_iter){
00207                                 G4cout << "proj antic : "<<(*p_iter)->GetPDGcode() << ", mom= "<< (*p_iter)->Get4Momentum()<<G4endl;
00208                                 anticolmom+=(*p_iter)->Get4Momentum();
00209                         }
00210                         G4cout << " proj. color/anti mom " << colmom << " / " << anticolmom  << " Sum: " << colmom+anticolmom <<G4endl;
00211                 #endif
00212         } else {         
00213                 G4cout << " none " << G4endl;
00214         }           
00215         if ( theTarget ) {
00216                 G4cout <<  "Target     " << theTarget->GetDefinition()->GetPDGEncoding()
00217                                 << "  " << theTarget->Get4Momentum()<< G4endl;
00218                 mom+=theTarget->Get4Momentum();
00219                 #ifdef debug_QGSM 
00220                         G4QGSMSplitableHadron * at =(G4QGSMSplitableHadron*)theTarget;
00221                         std::deque<G4Parton *>color=at->GetColorPartons();
00222                         std::deque<G4Parton *>anticolor=at->GetAntiColorPartons();
00223                         G4cout << " target color/anti size " << color.size() << " / " << anticolor.size() << G4endl;
00224                         std::deque<G4Parton *>::iterator p_iter;
00225                         G4LorentzVector colmom(0.,0.,0.,0.);
00226                         for ( p_iter=color.begin(); p_iter!= color.end(); ++p_iter){
00227                                 G4cout << "target color : "<<(*p_iter)->GetPDGcode() << ", mom= "<< (*p_iter)->Get4Momentum()<<G4endl;
00228                                 colmom+=(*p_iter)->Get4Momentum();
00229                         }
00230 
00231                         G4LorentzVector anticolmom(0.,0.,0.,0.);
00232                         for ( p_iter=anticolor.begin(); p_iter!= anticolor.end(); ++p_iter){
00233                                 G4cout << "target antic : "<<(*p_iter)->GetPDGcode() << ", mom= "<< (*p_iter)->Get4Momentum()<<G4endl;
00234                                 anticolmom+=(*p_iter)->Get4Momentum();
00235                                         }
00236                         G4cout << " target color/anti mom " << colmom << " / " << anticolmom  << " Sum: " << colmom+anticolmom <<G4endl;
00237                 #endif
00238                 } else {
00239                 G4cout << " none " << G4endl;
00240         }           
00241         G4cout << "total 4-mom of interaction content " << mom << G4endl;
00242 }      
00243 #endif      
00244 
00245 #endif
00246 
00247 

Generated on Mon May 27 17:48:38 2013 for Geant4 by  doxygen 1.4.7