Import Geant4 11.0.0.beta source tree
This commit is contained in:
@@ -31,59 +31,73 @@
|
||||
|
||||
G4Allocator<G4DCofThisEvent>*& anDCoTHAllocator_G4MT_TLS_()
|
||||
{
|
||||
G4ThreadLocalStatic G4Allocator<G4DCofThisEvent>* _instance = nullptr;
|
||||
return _instance;
|
||||
G4ThreadLocalStatic G4Allocator<G4DCofThisEvent>* _instance = nullptr;
|
||||
return _instance;
|
||||
}
|
||||
|
||||
G4DCofThisEvent::G4DCofThisEvent()
|
||||
{ if (!anDCoTHAllocator_G4MT_TLS_()) anDCoTHAllocator_G4MT_TLS_() = new G4Allocator<G4DCofThisEvent> ;
|
||||
{
|
||||
if(!anDCoTHAllocator_G4MT_TLS_())
|
||||
anDCoTHAllocator_G4MT_TLS_() = new G4Allocator<G4DCofThisEvent>;
|
||||
DC = new std::vector<G4VDigiCollection*>;
|
||||
}
|
||||
|
||||
G4DCofThisEvent::G4DCofThisEvent(G4int cap)
|
||||
{ if (!anDCoTHAllocator_G4MT_TLS_()) anDCoTHAllocator_G4MT_TLS_() = new G4Allocator<G4DCofThisEvent> ;
|
||||
{
|
||||
if(!anDCoTHAllocator_G4MT_TLS_())
|
||||
anDCoTHAllocator_G4MT_TLS_() = new G4Allocator<G4DCofThisEvent>;
|
||||
DC = new std::vector<G4VDigiCollection*>;
|
||||
for(G4int i=0;i<cap;i++)
|
||||
for(G4int i = 0; i < cap; i++)
|
||||
{
|
||||
DC->push_back((G4VDigiCollection*)0);
|
||||
DC->push_back((G4VDigiCollection*) 0);
|
||||
}
|
||||
}
|
||||
|
||||
G4DCofThisEvent::~G4DCofThisEvent()
|
||||
{ if (!anDCoTHAllocator_G4MT_TLS_()) anDCoTHAllocator_G4MT_TLS_() = new G4Allocator<G4DCofThisEvent> ;
|
||||
//DC->clearAndDestroy();
|
||||
for(size_t i=0;i<DC->size();i++)
|
||||
{ delete (*DC)[i]; }
|
||||
{
|
||||
if(!anDCoTHAllocator_G4MT_TLS_())
|
||||
anDCoTHAllocator_G4MT_TLS_() = new G4Allocator<G4DCofThisEvent>;
|
||||
// DC->clearAndDestroy();
|
||||
for(size_t i = 0; i < DC->size(); i++)
|
||||
{
|
||||
delete(*DC)[i];
|
||||
}
|
||||
DC->clear();
|
||||
delete DC;
|
||||
}
|
||||
|
||||
void G4DCofThisEvent::AddDigiCollection(G4int DCID,G4VDigiCollection * aDC)
|
||||
{ if (!anDCoTHAllocator_G4MT_TLS_()) anDCoTHAllocator_G4MT_TLS_() = new G4Allocator<G4DCofThisEvent> ;
|
||||
if(DCID>=0 && DCID<G4int(DC->size()))
|
||||
{ (*DC)[DCID] = aDC; }
|
||||
void G4DCofThisEvent::AddDigiCollection(G4int DCID, G4VDigiCollection* aDC)
|
||||
{
|
||||
if(!anDCoTHAllocator_G4MT_TLS_())
|
||||
anDCoTHAllocator_G4MT_TLS_() = new G4Allocator<G4DCofThisEvent>;
|
||||
if(DCID >= 0 && DCID < G4int(DC->size()))
|
||||
{
|
||||
(*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));
|
||||
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));
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
@@ -30,20 +30,37 @@
|
||||
|
||||
G4Allocator<G4DigiCollection>*& aDCAllocator_G4MT_TLS_()
|
||||
{
|
||||
G4ThreadLocalStatic G4Allocator<G4DigiCollection>* _instance = nullptr;
|
||||
return _instance;
|
||||
G4ThreadLocalStatic G4Allocator<G4DigiCollection>* _instance = nullptr;
|
||||
return _instance;
|
||||
}
|
||||
|
||||
G4DigiCollection::G4DigiCollection() : theCollection((void*)0)
|
||||
{ if (!aDCAllocator_G4MT_TLS_()) aDCAllocator_G4MT_TLS_() = new G4Allocator<G4DigiCollection> ;;}
|
||||
G4DigiCollection::G4DigiCollection()
|
||||
: theCollection((void*) 0)
|
||||
{
|
||||
if(!aDCAllocator_G4MT_TLS_())
|
||||
aDCAllocator_G4MT_TLS_() = new G4Allocator<G4DigiCollection>;
|
||||
;
|
||||
}
|
||||
|
||||
G4DigiCollection::G4DigiCollection(G4String detName,G4String colNam)
|
||||
: G4VDigiCollection(detName,colNam), theCollection((void*)0)
|
||||
{ if (!aDCAllocator_G4MT_TLS_()) aDCAllocator_G4MT_TLS_() = new G4Allocator<G4DigiCollection> ;;}
|
||||
G4DigiCollection::G4DigiCollection(G4String detName, G4String colNam)
|
||||
: G4VDigiCollection(detName, colNam)
|
||||
, theCollection((void*) 0)
|
||||
{
|
||||
if(!aDCAllocator_G4MT_TLS_())
|
||||
aDCAllocator_G4MT_TLS_() = new G4Allocator<G4DigiCollection>;
|
||||
;
|
||||
}
|
||||
|
||||
G4DigiCollection::~G4DigiCollection()
|
||||
{ if (!aDCAllocator_G4MT_TLS_()) aDCAllocator_G4MT_TLS_() = new G4Allocator<G4DigiCollection> ;;}
|
||||
|
||||
G4bool G4DigiCollection::operator==(const G4DigiCollection &right) const
|
||||
{ if (!aDCAllocator_G4MT_TLS_()) aDCAllocator_G4MT_TLS_() = new G4Allocator<G4DigiCollection> ; return (collectionName==right.collectionName); }
|
||||
{
|
||||
if(!aDCAllocator_G4MT_TLS_())
|
||||
aDCAllocator_G4MT_TLS_() = new G4Allocator<G4DigiCollection>;
|
||||
;
|
||||
}
|
||||
|
||||
G4bool G4DigiCollection::operator==(const G4DigiCollection& right) const
|
||||
{
|
||||
if(!aDCAllocator_G4MT_TLS_())
|
||||
aDCAllocator_G4MT_TLS_() = new G4Allocator<G4DigiCollection>;
|
||||
return (collectionName == right.collectionName);
|
||||
}
|
||||
|
||||
@@ -30,18 +30,15 @@
|
||||
#include "G4VDigi.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
G4VDigi::G4VDigi()
|
||||
{;}
|
||||
G4VDigi::G4VDigi() { ; }
|
||||
|
||||
G4VDigi::~G4VDigi()
|
||||
{;}
|
||||
G4VDigi::~G4VDigi() { ; }
|
||||
|
||||
G4bool G4VDigi::operator==(const G4VDigi &right) const
|
||||
{ return (this==&right); }
|
||||
G4bool G4VDigi::operator==(const G4VDigi& right) const
|
||||
{
|
||||
return (this == &right);
|
||||
}
|
||||
|
||||
void G4VDigi::Draw()
|
||||
{;}
|
||||
|
||||
void G4VDigi::Print()
|
||||
{;}
|
||||
void G4VDigi::Draw() { ; }
|
||||
|
||||
void G4VDigi::Print() { ; }
|
||||
|
||||
@@ -33,27 +33,22 @@
|
||||
G4VDigiCollection::G4VDigiCollection()
|
||||
{
|
||||
collectionName = "Unknown";
|
||||
DMname = "Unknown";
|
||||
DMname = "Unknown";
|
||||
}
|
||||
|
||||
G4VDigiCollection::G4VDigiCollection(G4String DMnam,G4String colNam)
|
||||
G4VDigiCollection::G4VDigiCollection(G4String DMnam, G4String colNam)
|
||||
{
|
||||
collectionName = colNam;
|
||||
DMname = DMnam;
|
||||
DMname = DMnam;
|
||||
}
|
||||
|
||||
G4VDigiCollection::~G4VDigiCollection()
|
||||
{ ; }
|
||||
G4VDigiCollection::~G4VDigiCollection() { ; }
|
||||
|
||||
G4bool G4VDigiCollection::operator==(const G4VDigiCollection &right) const
|
||||
{
|
||||
return ((collectionName==right.collectionName)
|
||||
&&(DMname==right.DMname));
|
||||
G4bool G4VDigiCollection::operator==(const G4VDigiCollection& right) const
|
||||
{
|
||||
return ((collectionName == right.collectionName) && (DMname == right.DMname));
|
||||
}
|
||||
|
||||
void G4VDigiCollection::DrawAllDigi()
|
||||
{;}
|
||||
|
||||
void G4VDigiCollection::PrintAllDigi()
|
||||
{;}
|
||||
void G4VDigiCollection::DrawAllDigi() { ; }
|
||||
|
||||
void G4VDigiCollection::PrintAllDigi() { ; }
|
||||
|
||||
Reference in New Issue
Block a user