Import Geant4 10.1.0 source tree
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4DCofThisEvent.hh 67992 2013-03-13 10:59:57Z gcosmo $
|
||||
// $Id: G4DCofThisEvent.hh 81087 2014-05-20 15:44:27Z gcosmo $
|
||||
//
|
||||
|
||||
#ifndef G4DCofThisEvent_h
|
||||
@@ -58,6 +58,8 @@ class G4DCofThisEvent
|
||||
|
||||
void AddDigiCollection(G4int DCID,G4VDigiCollection * aDC);
|
||||
|
||||
G4DCofThisEvent(const G4DCofThisEvent&);
|
||||
G4DCofThisEvent& operator=(const G4DCofThisEvent&);
|
||||
private:
|
||||
std::vector<G4VDigiCollection*> * DC;
|
||||
|
||||
|
||||
@@ -24,10 +24,11 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4DCofThisEvent.cc 67992 2013-03-13 10:59:57Z gcosmo $
|
||||
// $Id: G4DCofThisEvent.cc 81087 2014-05-20 15:44:27Z gcosmo $
|
||||
//
|
||||
|
||||
#include "G4DCofThisEvent.hh"
|
||||
#include <algorithm>
|
||||
|
||||
G4ThreadLocal G4Allocator<G4DCofThisEvent> *anDCoTHAllocator_G4MT_TLS_ = 0;
|
||||
|
||||
@@ -60,3 +61,26 @@ void G4DCofThisEvent::AddDigiCollection(G4int DCID,G4VDigiCollection * aDC)
|
||||
{ (*DC)[DCID] = aDC; }
|
||||
}
|
||||
|
||||
G4DCofThisEvent::G4DCofThisEvent(const G4DCofThisEvent& rhs)
|
||||
{
|
||||
if ( !anDCoTHAllocator_G4MT_TLS_ ) anDCoTHAllocator_G4MT_TLS_ = new G4Allocator<G4DCofThisEvent>;
|
||||
DC = new std::vector<G4VDigiCollection*>(rhs.DC->size());
|
||||
for ( unsigned int i = 0 ; i < rhs.DC->size() ; ++i )
|
||||
*(DC->at(i)) = *(rhs.DC->at(i));
|
||||
}
|
||||
|
||||
G4DCofThisEvent& G4DCofThisEvent::operator=(const G4DCofThisEvent& rhs)
|
||||
{
|
||||
if ( this == &rhs ) return *this;
|
||||
if ( !anDCoTHAllocator_G4MT_TLS_ ) anDCoTHAllocator_G4MT_TLS_ = new G4Allocator<G4DCofThisEvent>;
|
||||
for ( std::vector<G4VDigiCollection*>::const_iterator it = DC->begin() ;
|
||||
it != DC->end() ; ++it )
|
||||
{
|
||||
delete *it;
|
||||
}
|
||||
DC->resize(rhs.DC->size());
|
||||
for ( unsigned int i = 0 ; i < rhs.DC->size() ; ++i )
|
||||
*(DC->at(i)) = *(rhs.DC->at(i));
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user