Import Geant4 11.4.0.beta source tree
This commit is contained in:
@@ -30,70 +30,90 @@
|
||||
// Aggregate the records of changes in an endpoint of a locator.
|
||||
// Its key use is in playing these back in case of a problem.
|
||||
|
||||
// Author: John Apostolakis, 04.09.19 - First version
|
||||
// Author: John Apostolakis (CERN), 04 September 2019
|
||||
// --------------------------------------------------------------------
|
||||
#ifndef G4LOCATOR_CHANGE_LOGGER_HH
|
||||
#define G4LOCATOR_CHANGE_LOGGER_HH
|
||||
#define G4LOCATOR_CHANGE_LOGGER_HH 1
|
||||
|
||||
#include <vector>
|
||||
#include "G4LocatorChangeRecord.hh"
|
||||
#include "G4FieldTrack.hh"
|
||||
|
||||
/**
|
||||
* @brief G4LocatorChangeLogger aggregates the records of changes in an
|
||||
* endpoint of a locator. Its key use is in playing these back in case of
|
||||
* a problem.
|
||||
*/
|
||||
|
||||
class G4LocatorChangeLogger : public std::vector<G4LocatorChangeRecord>
|
||||
{
|
||||
public:
|
||||
|
||||
G4LocatorChangeLogger( const std::string& name ) : fName(name) {}
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
G4LocatorChangeLogger( const std::string& name );
|
||||
|
||||
void AddRecord( G4LocatorChangeRecord && chngRecord );
|
||||
void AddRecord( const G4LocatorChangeRecord & chngRecord );
|
||||
/**
|
||||
* Move or add a record.
|
||||
*/
|
||||
inline void AddRecord( G4LocatorChangeRecord && chngRecord );
|
||||
inline void AddRecord( const G4LocatorChangeRecord & chngRecord );
|
||||
|
||||
// Create a new record with full information
|
||||
inline
|
||||
void AddRecord( G4LocatorChangeRecord::EChangeLocation codeLocation,
|
||||
G4int iter,
|
||||
unsigned int count,
|
||||
const G4FieldTrack & fieldTrack );
|
||||
/**
|
||||
* Create a new record with full information.
|
||||
*/
|
||||
inline void AddRecord( G4LocatorChangeRecord::EChangeLocation codeLocation,
|
||||
G4int iter, unsigned int count,
|
||||
const G4FieldTrack& fieldTrack );
|
||||
|
||||
/**
|
||||
* Streaming operator dumping record.
|
||||
*/
|
||||
friend std::ostream& operator << ( std::ostream& os,
|
||||
const G4LocatorChangeLogger& logR );
|
||||
|
||||
/**
|
||||
* Streams object contents to an output stream.
|
||||
*/
|
||||
std::ostream& StreamInfo(std::ostream& os) const;
|
||||
|
||||
/**
|
||||
* Prints the changes in start, end points in columns. One event per row.
|
||||
*/
|
||||
static std::ostream& ReportEndChanges ( std::ostream& os,
|
||||
const G4LocatorChangeLogger& startA,
|
||||
const G4LocatorChangeLogger& endB );
|
||||
// Print the changes in start, end points in columns
|
||||
// One event per row
|
||||
|
||||
private:
|
||||
|
||||
const std::string fName;
|
||||
const std::string fName;
|
||||
};
|
||||
|
||||
// --------------
|
||||
// --------------------------------------------------------------------
|
||||
// Inline methods
|
||||
// --------------
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
void G4LocatorChangeLogger::
|
||||
AddRecord( G4LocatorChangeRecord::EChangeLocation codeLocation,
|
||||
G4int iter, unsigned int count,
|
||||
const G4FieldTrack & fieldTrack )
|
||||
{
|
||||
this->push_back(G4LocatorChangeRecord(codeLocation, iter, count, fieldTrack));
|
||||
push_back(G4LocatorChangeRecord(codeLocation, iter, count, fieldTrack));
|
||||
}
|
||||
|
||||
inline
|
||||
void G4LocatorChangeLogger::
|
||||
AddRecord( const G4LocatorChangeRecord& chngRecord )
|
||||
{
|
||||
this->push_back( chngRecord );
|
||||
push_back( chngRecord );
|
||||
}
|
||||
|
||||
inline
|
||||
void G4LocatorChangeLogger::
|
||||
AddRecord( G4LocatorChangeRecord && chngRecord )
|
||||
{
|
||||
this->push_back( chngRecord );
|
||||
push_back( chngRecord );
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user