Import Geant4 11.0.0.beta source tree
This commit is contained in:
@@ -30,63 +30,74 @@
|
||||
|
||||
G4Allocator<G4HCofThisEvent>*& anHCoTHAllocator_G4MT_TLS_()
|
||||
{
|
||||
G4ThreadLocalStatic G4Allocator<G4HCofThisEvent>* _instance = nullptr;
|
||||
return _instance;
|
||||
G4ThreadLocalStatic G4Allocator<G4HCofThisEvent>* _instance = nullptr;
|
||||
return _instance;
|
||||
}
|
||||
|
||||
G4HCofThisEvent::G4HCofThisEvent()
|
||||
{ if (!anHCoTHAllocator_G4MT_TLS_()) anHCoTHAllocator_G4MT_TLS_() = new G4Allocator<G4HCofThisEvent> ;
|
||||
{
|
||||
if(!anHCoTHAllocator_G4MT_TLS_())
|
||||
anHCoTHAllocator_G4MT_TLS_() = new G4Allocator<G4HCofThisEvent>;
|
||||
HC = new std::vector<G4VHitsCollection*>;
|
||||
}
|
||||
|
||||
G4HCofThisEvent::G4HCofThisEvent(G4int cap)
|
||||
{ if (!anHCoTHAllocator_G4MT_TLS_()) anHCoTHAllocator_G4MT_TLS_() = new G4Allocator<G4HCofThisEvent> ;
|
||||
{
|
||||
if(!anHCoTHAllocator_G4MT_TLS_())
|
||||
anHCoTHAllocator_G4MT_TLS_() = new G4Allocator<G4HCofThisEvent>;
|
||||
HC = new std::vector<G4VHitsCollection*>;
|
||||
for(G4int i=0;i<cap;i++)
|
||||
for(G4int i = 0; i < cap; i++)
|
||||
{
|
||||
HC->push_back((G4VHitsCollection*)0);
|
||||
HC->push_back((G4VHitsCollection*) 0);
|
||||
}
|
||||
}
|
||||
|
||||
G4HCofThisEvent::~G4HCofThisEvent()
|
||||
{ if (!anHCoTHAllocator_G4MT_TLS_()) anHCoTHAllocator_G4MT_TLS_() = new G4Allocator<G4HCofThisEvent> ;
|
||||
//HC->clearAndDestroy();
|
||||
for(size_t i=0;i<HC->size();i++)
|
||||
{ delete (*HC)[i]; }
|
||||
{
|
||||
if(!anHCoTHAllocator_G4MT_TLS_())
|
||||
anHCoTHAllocator_G4MT_TLS_() = new G4Allocator<G4HCofThisEvent>;
|
||||
// HC->clearAndDestroy();
|
||||
for(size_t i = 0; i < HC->size(); i++)
|
||||
{
|
||||
delete(*HC)[i];
|
||||
}
|
||||
HC->clear();
|
||||
delete HC;
|
||||
}
|
||||
|
||||
void G4HCofThisEvent::AddHitsCollection(G4int HCID,G4VHitsCollection * aHC)
|
||||
{ if (!anHCoTHAllocator_G4MT_TLS_()) anHCoTHAllocator_G4MT_TLS_() = new G4Allocator<G4HCofThisEvent> ;
|
||||
if(HCID>=0 && HCID<G4int(HC->size()))
|
||||
void G4HCofThisEvent::AddHitsCollection(G4int HCID, G4VHitsCollection* aHC)
|
||||
{
|
||||
if(!anHCoTHAllocator_G4MT_TLS_())
|
||||
anHCoTHAllocator_G4MT_TLS_() = new G4Allocator<G4HCofThisEvent>;
|
||||
if(HCID >= 0 && HCID < G4int(HC->size()))
|
||||
{
|
||||
aHC->SetColID(HCID);
|
||||
(*HC)[HCID] = aHC;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
G4HCofThisEvent::G4HCofThisEvent(const G4HCofThisEvent& rhs)
|
||||
{
|
||||
if ( !anHCoTHAllocator_G4MT_TLS_() ) anHCoTHAllocator_G4MT_TLS_() = new G4Allocator<G4HCofThisEvent>;
|
||||
HC = new std::vector<G4VHitsCollection*>(rhs.HC->size());
|
||||
for ( unsigned int i = 0 ; i<rhs.HC->size() ; ++i)
|
||||
*(HC->at(i)) = *(rhs.HC->at(i));
|
||||
if(!anHCoTHAllocator_G4MT_TLS_())
|
||||
anHCoTHAllocator_G4MT_TLS_() = new G4Allocator<G4HCofThisEvent>;
|
||||
HC = new std::vector<G4VHitsCollection*>(rhs.HC->size());
|
||||
for(unsigned int i = 0; i < rhs.HC->size(); ++i)
|
||||
*(HC->at(i)) = *(rhs.HC->at(i));
|
||||
}
|
||||
|
||||
G4HCofThisEvent& G4HCofThisEvent::operator=(const G4HCofThisEvent& rhs)
|
||||
{
|
||||
if ( this == &rhs ) return *this;
|
||||
if ( !anHCoTHAllocator_G4MT_TLS_() ) anHCoTHAllocator_G4MT_TLS_() = new G4Allocator<G4HCofThisEvent>;
|
||||
for ( std::vector<G4VHitsCollection*>::const_iterator it = HC->begin() ;
|
||||
it != HC->end() ; ++it )
|
||||
{
|
||||
delete *it;
|
||||
}
|
||||
HC->resize(rhs.HC->size());
|
||||
for ( unsigned int i = 0 ; i<rhs.HC->size() ; ++i)
|
||||
*(HC->at(i)) = *(rhs.HC->at(i));
|
||||
if(this == &rhs)
|
||||
return *this;
|
||||
if(!anHCoTHAllocator_G4MT_TLS_())
|
||||
anHCoTHAllocator_G4MT_TLS_() = new G4Allocator<G4HCofThisEvent>;
|
||||
for(std::vector<G4VHitsCollection*>::const_iterator it = HC->begin();
|
||||
it != HC->end(); ++it)
|
||||
{
|
||||
delete *it;
|
||||
}
|
||||
HC->resize(rhs.HC->size());
|
||||
for(unsigned int i = 0; i < rhs.HC->size(); ++i)
|
||||
*(HC->at(i)) = *(rhs.HC->at(i));
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
@@ -30,20 +30,37 @@
|
||||
|
||||
G4Allocator<G4HitsCollection>*& anHCAllocator_G4MT_TLS_()
|
||||
{
|
||||
G4ThreadLocalStatic G4Allocator<G4HitsCollection>* _instance = nullptr;
|
||||
return _instance;
|
||||
G4ThreadLocalStatic G4Allocator<G4HitsCollection>* _instance = nullptr;
|
||||
return _instance;
|
||||
}
|
||||
|
||||
G4HitsCollection::G4HitsCollection() : theCollection((void*)0)
|
||||
{ if (!anHCAllocator_G4MT_TLS_()) anHCAllocator_G4MT_TLS_() = new G4Allocator<G4HitsCollection> ;;}
|
||||
G4HitsCollection::G4HitsCollection()
|
||||
: theCollection((void*) 0)
|
||||
{
|
||||
if(!anHCAllocator_G4MT_TLS_())
|
||||
anHCAllocator_G4MT_TLS_() = new G4Allocator<G4HitsCollection>;
|
||||
;
|
||||
}
|
||||
|
||||
G4HitsCollection::G4HitsCollection(G4String detName,G4String colNam)
|
||||
: G4VHitsCollection(detName,colNam), theCollection((void*)0)
|
||||
{ if (!anHCAllocator_G4MT_TLS_()) anHCAllocator_G4MT_TLS_() = new G4Allocator<G4HitsCollection> ;;}
|
||||
G4HitsCollection::G4HitsCollection(G4String detName, G4String colNam)
|
||||
: G4VHitsCollection(detName, colNam)
|
||||
, theCollection((void*) 0)
|
||||
{
|
||||
if(!anHCAllocator_G4MT_TLS_())
|
||||
anHCAllocator_G4MT_TLS_() = new G4Allocator<G4HitsCollection>;
|
||||
;
|
||||
}
|
||||
|
||||
G4HitsCollection::~G4HitsCollection()
|
||||
{ if (!anHCAllocator_G4MT_TLS_()) anHCAllocator_G4MT_TLS_() = new G4Allocator<G4HitsCollection> ;;}
|
||||
|
||||
G4bool G4HitsCollection::operator==(const G4HitsCollection &right) const
|
||||
{ if (!anHCAllocator_G4MT_TLS_()) anHCAllocator_G4MT_TLS_() = new G4Allocator<G4HitsCollection> ; return (collectionName==right.collectionName); }
|
||||
{
|
||||
if(!anHCAllocator_G4MT_TLS_())
|
||||
anHCAllocator_G4MT_TLS_() = new G4Allocator<G4HitsCollection>;
|
||||
;
|
||||
}
|
||||
|
||||
G4bool G4HitsCollection::operator==(const G4HitsCollection& right) const
|
||||
{
|
||||
if(!anHCAllocator_G4MT_TLS_())
|
||||
anHCAllocator_G4MT_TLS_() = new G4Allocator<G4HitsCollection>;
|
||||
return (collectionName == right.collectionName);
|
||||
}
|
||||
|
||||
@@ -30,18 +30,12 @@
|
||||
#include "G4VHit.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
G4VHit::G4VHit()
|
||||
{;}
|
||||
G4VHit::G4VHit() { ; }
|
||||
|
||||
G4VHit::~G4VHit()
|
||||
{;}
|
||||
G4VHit::~G4VHit() { ; }
|
||||
|
||||
G4bool G4VHit::operator==(const G4VHit &) const
|
||||
{ return false; }
|
||||
G4bool G4VHit::operator==(const G4VHit&) const { return false; }
|
||||
|
||||
void G4VHit::Draw()
|
||||
{;}
|
||||
|
||||
void G4VHit::Print()
|
||||
{;}
|
||||
void G4VHit::Draw() { ; }
|
||||
|
||||
void G4VHit::Print() { ; }
|
||||
|
||||
@@ -33,29 +33,24 @@
|
||||
G4VHitsCollection::G4VHitsCollection()
|
||||
{
|
||||
collectionName = "Unknown";
|
||||
SDname = "Unknown";
|
||||
colID = -1;
|
||||
SDname = "Unknown";
|
||||
colID = -1;
|
||||
}
|
||||
|
||||
G4VHitsCollection::G4VHitsCollection(G4String detName,G4String colNam)
|
||||
G4VHitsCollection::G4VHitsCollection(G4String detName, G4String colNam)
|
||||
{
|
||||
collectionName = colNam;
|
||||
SDname = detName;
|
||||
colID = -1;
|
||||
SDname = detName;
|
||||
colID = -1;
|
||||
}
|
||||
|
||||
G4VHitsCollection::~G4VHitsCollection()
|
||||
{ ; }
|
||||
G4VHitsCollection::~G4VHitsCollection() { ; }
|
||||
|
||||
G4bool G4VHitsCollection::operator==(const G4VHitsCollection &right) const
|
||||
{
|
||||
return ((collectionName==right.collectionName)
|
||||
&&(SDname==right.SDname));
|
||||
G4bool G4VHitsCollection::operator==(const G4VHitsCollection& right) const
|
||||
{
|
||||
return ((collectionName == right.collectionName) && (SDname == right.SDname));
|
||||
}
|
||||
|
||||
void G4VHitsCollection::DrawAllHits()
|
||||
{;}
|
||||
|
||||
void G4VHitsCollection::PrintAllHits()
|
||||
{;}
|
||||
void G4VHitsCollection::DrawAllHits() { ; }
|
||||
|
||||
void G4VHitsCollection::PrintAllHits() { ; }
|
||||
|
||||
Reference in New Issue
Block a user