Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-23 09:19:39

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 ///////////////////////////////////////////////////////////////////////////////
0027 // File: CCalG4Hit.cc
0028 // Description: G4 Hit class for Calorimeters (Ecal, Hcal, ...)
0029 ///////////////////////////////////////////////////////////////////////////////
0030 
0031 #include "CCalG4Hit.hh"
0032 #include <iostream>
0033 
0034 
0035 CCalG4Hit::CCalG4Hit() : CCalHit(), 
0036   elem(0.0), hadr(0.0) 
0037 {}
0038 
0039 
0040 CCalG4Hit::~CCalG4Hit() {}
0041 
0042 
0043 CCalG4Hit::CCalG4Hit(const CCalG4Hit &right) : 
0044   G4VHit(right), CCalHit(right),
0045   elem(right.elem), hadr(right.hadr) 
0046 {}
0047 
0048 
0049 const CCalG4Hit& CCalG4Hit::operator=(const CCalG4Hit &right) {  
0050   CCalHit::operator=(right);
0051   elem  = right.elem;
0052   hadr  = right.hadr;
0053   return *this;
0054 }
0055 
0056 
0057 G4double CCalG4Hit::getEM() const      { return elem; }
0058 void   CCalG4Hit::setEM (G4double e)   { elem = e; }
0059       
0060 G4double CCalG4Hit::getHadr() const    { return hadr; }
0061 void   CCalG4Hit::setHadr (G4double e) { hadr = e; }
0062       
0063 void CCalG4Hit::addEnergyDeposit(const CCalG4Hit& aHit) {
0064   addEnergyDeposit( aHit.getEM(), aHit.getHadr() );
0065 }
0066 
0067 void CCalG4Hit::addEnergyDeposit(G4double em, G4double hd) {
0068   elem  += em; 
0069   hadr += hd;
0070   CCalHit::addEnergyDeposit(em+hd);
0071 }
0072 
0073 
0074 void CCalG4Hit::Print() {
0075   G4cout << (*this);
0076 }
0077 
0078 
0079 std::ostream& operator<< (std::ostream& os, const CCalG4Hit& hit) {
0080   os << static_cast<CCalHit>(hit);
0081   os << " Data specific of this CCalG4Hit are:" << G4endl
0082      << " \t EnergyDeposit of EM particles = " << hit.getEM() 
0083      << " (MeV)" << G4endl
0084      << " \t EnergyDeposit of HD particles = " << hit.getHadr() 
0085      << " (MeV)" << G4endl;
0086   return os;
0087 }
0088