Import Geant4 10.1.0 source tree
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4XmlAnalysisManager.hh 74257 2013-10-02 14:24:55Z gcosmo $
|
||||
// $Id: G4XmlAnalysisManager.hh 83748 2014-09-12 12:13:37Z gcosmo $
|
||||
|
||||
// The main manager for Xml analysis.
|
||||
// It delegates most of functions to the object specific managers.
|
||||
@@ -38,12 +38,18 @@
|
||||
|
||||
#include "tools/histo/h1d"
|
||||
#include "tools/histo/h2d"
|
||||
#include "tools/histo/h3d"
|
||||
#include "tools/histo/p1d"
|
||||
#include "tools/histo/p2d"
|
||||
#include "tools/waxml/ntuple"
|
||||
|
||||
|
||||
class G4XmlFileManager;
|
||||
class G4H1ToolsManager;
|
||||
class G4H2ToolsManager;
|
||||
class G4H3ToolsManager;
|
||||
class G4P1ToolsManager;
|
||||
class G4P2ToolsManager;
|
||||
class G4XmlNtupleManager;
|
||||
|
||||
class G4XmlAnalysisManager : public G4VAnalysisManager
|
||||
@@ -60,9 +66,47 @@ class G4XmlAnalysisManager : public G4VAnalysisManager
|
||||
G4bool onlyIfActive = true) const;
|
||||
tools::histo::h2d* GetH2(G4int id, G4bool warn = true,
|
||||
G4bool onlyIfActive = true) const;
|
||||
tools::histo::h3d* GetH3(G4int id, G4bool warn = true,
|
||||
G4bool onlyIfActive = true) const;
|
||||
tools::histo::p1d* GetP1(G4int id, G4bool warn = true,
|
||||
G4bool onlyIfActive = true) const;
|
||||
tools::histo::p2d* GetP2(G4int id, G4bool warn = true,
|
||||
G4bool onlyIfActive = true) const;
|
||||
|
||||
tools::waxml::ntuple* GetNtuple() const;
|
||||
tools::waxml::ntuple* GetNtuple(G4int ntupleId) const;
|
||||
|
||||
// Iterators
|
||||
std::vector<tools::histo::h1d*>::iterator BeginH1();
|
||||
std::vector<tools::histo::h1d*>::iterator EndH1();
|
||||
std::vector<tools::histo::h1d*>::const_iterator BeginConstH1() const;
|
||||
std::vector<tools::histo::h1d*>::const_iterator EndConstH1() const;
|
||||
|
||||
std::vector<tools::histo::h2d*>::iterator BeginH2();
|
||||
std::vector<tools::histo::h2d*>::iterator EndH2();
|
||||
std::vector<tools::histo::h2d*>::const_iterator BeginConstH2() const;
|
||||
std::vector<tools::histo::h2d*>::const_iterator EndConstH2() const;
|
||||
|
||||
std::vector<tools::histo::h3d*>::iterator BeginH3();
|
||||
std::vector<tools::histo::h3d*>::iterator EndH3();
|
||||
std::vector<tools::histo::h3d*>::const_iterator BeginConstH3() const;
|
||||
std::vector<tools::histo::h3d*>::const_iterator EndConstH3() const;
|
||||
|
||||
std::vector<tools::histo::p1d*>::iterator BeginP1();
|
||||
std::vector<tools::histo::p1d*>::iterator EndP1();
|
||||
std::vector<tools::histo::p1d*>::const_iterator BeginConstP1() const;
|
||||
std::vector<tools::histo::p1d*>::const_iterator EndConstP1() const;
|
||||
|
||||
std::vector<tools::histo::p2d*>::iterator BeginP2();
|
||||
std::vector<tools::histo::p2d*>::iterator EndP2();
|
||||
std::vector<tools::histo::p2d*>::const_iterator BeginConstP2() const;
|
||||
std::vector<tools::histo::p2d*>::const_iterator EndConstP2() const;
|
||||
|
||||
std::vector<tools::waxml::ntuple*>::iterator BeginNtuple();
|
||||
std::vector<tools::waxml::ntuple*>::iterator EndNtuple();
|
||||
std::vector<tools::waxml::ntuple*>::const_iterator BeginConstNtuple() const;
|
||||
std::vector<tools::waxml::ntuple*>::const_iterator EndConstNtuple() const;
|
||||
|
||||
protected:
|
||||
// virtual methods from base class
|
||||
virtual G4bool OpenFileImpl(const G4String& fileName);
|
||||
@@ -77,6 +121,9 @@ class G4XmlAnalysisManager : public G4VAnalysisManager
|
||||
// methods
|
||||
G4bool WriteH1();
|
||||
G4bool WriteH2();
|
||||
G4bool WriteH3();
|
||||
G4bool WriteP1();
|
||||
G4bool WriteP2();
|
||||
G4bool WriteNtuple();
|
||||
G4bool CloseNtupleFiles();
|
||||
G4bool Reset();
|
||||
@@ -84,6 +131,9 @@ class G4XmlAnalysisManager : public G4VAnalysisManager
|
||||
// data members
|
||||
G4H1ToolsManager* fH1Manager;
|
||||
G4H2ToolsManager* fH2Manager;
|
||||
G4H3ToolsManager* fH3Manager;
|
||||
G4P1ToolsManager* fP1Manager;
|
||||
G4P2ToolsManager* fP2Manager;
|
||||
G4XmlNtupleManager* fNtupleManager;
|
||||
G4XmlFileManager* fFileManager;
|
||||
|
||||
|
||||
@@ -27,6 +27,9 @@
|
||||
|
||||
#include "G4H1ToolsManager.hh"
|
||||
#include "G4H2ToolsManager.hh"
|
||||
#include "G4H3ToolsManager.hh"
|
||||
#include "G4P1ToolsManager.hh"
|
||||
#include "G4P2ToolsManager.hh"
|
||||
#include "G4XmlNtupleManager.hh"
|
||||
|
||||
//_____________________________________________________________________________
|
||||
@@ -45,6 +48,30 @@ tools::histo::h2d* G4XmlAnalysisManager::GetH2(G4int id, G4bool warn,
|
||||
return fH2Manager->GetH2(id, warn, onlyIfActive);
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
tools::histo::h3d* G4XmlAnalysisManager::GetH3(G4int id, G4bool warn,
|
||||
G4bool onlyIfActive) const
|
||||
{
|
||||
return fH3Manager->GetH3(id, warn, onlyIfActive);
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
tools::histo::p1d* G4XmlAnalysisManager::GetP1(G4int id, G4bool warn,
|
||||
G4bool onlyIfActive) const
|
||||
{
|
||||
return fP1Manager->GetP1(id, warn, onlyIfActive);
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
tools::histo::p2d* G4XmlAnalysisManager::GetP2(G4int id, G4bool warn,
|
||||
G4bool onlyIfActive) const
|
||||
{
|
||||
return fP2Manager->GetP2(id, warn, onlyIfActive);
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
tools::waxml::ntuple* G4XmlAnalysisManager::GetNtuple() const
|
||||
@@ -58,3 +85,182 @@ tools::waxml::ntuple* G4XmlAnalysisManager::GetNtuple(G4int ntupleId) const
|
||||
{
|
||||
return fNtupleManager->GetNtuple(ntupleId);
|
||||
}
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
std::vector<tools::histo::h1d*>::iterator G4XmlAnalysisManager::BeginH1()
|
||||
{
|
||||
return fH1Manager->BeginH1();
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
std::vector<tools::histo::h1d*>::iterator G4XmlAnalysisManager::EndH1()
|
||||
{
|
||||
return fH1Manager->EndH1();
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
std::vector<tools::histo::h1d*>::const_iterator
|
||||
G4XmlAnalysisManager::BeginConstH1() const
|
||||
{
|
||||
return fH1Manager->BeginConstH1();
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
std::vector<tools::histo::h1d*>::const_iterator
|
||||
G4XmlAnalysisManager::EndConstH1() const
|
||||
{
|
||||
return fH1Manager->EndConstH1();
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
std::vector<tools::histo::h2d*>::iterator G4XmlAnalysisManager::BeginH2()
|
||||
{
|
||||
return fH2Manager->BeginH2();
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
std::vector<tools::histo::h2d*>::iterator G4XmlAnalysisManager::EndH2()
|
||||
{
|
||||
return fH2Manager->EndH2();
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
std::vector<tools::histo::h2d*>::const_iterator
|
||||
G4XmlAnalysisManager::BeginConstH2() const
|
||||
{
|
||||
return fH2Manager->BeginConstH2();
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
std::vector<tools::histo::h2d*>::const_iterator
|
||||
G4XmlAnalysisManager::EndConstH2() const
|
||||
{
|
||||
return fH2Manager->EndConstH2();
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
std::vector<tools::histo::h3d*>::iterator G4XmlAnalysisManager::BeginH3()
|
||||
{
|
||||
return fH3Manager->BeginH3();
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
std::vector<tools::histo::h3d*>::iterator G4XmlAnalysisManager::EndH3()
|
||||
{
|
||||
return fH3Manager->EndH3();
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
std::vector<tools::histo::h3d*>::const_iterator
|
||||
G4XmlAnalysisManager::BeginConstH3() const
|
||||
{
|
||||
return fH3Manager->BeginConstH3();
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
std::vector<tools::histo::h3d*>::const_iterator
|
||||
G4XmlAnalysisManager::EndConstH3() const
|
||||
{
|
||||
return fH3Manager->EndConstH3();
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
std::vector<tools::histo::p1d*>::iterator G4XmlAnalysisManager::BeginP1()
|
||||
{
|
||||
return fP1Manager->BeginP1();
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
std::vector<tools::histo::p1d*>::iterator G4XmlAnalysisManager::EndP1()
|
||||
{
|
||||
return fP1Manager->EndP1();
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
std::vector<tools::histo::p1d*>::const_iterator
|
||||
G4XmlAnalysisManager::BeginConstP1() const
|
||||
{
|
||||
return fP1Manager->BeginConstP1();
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
std::vector<tools::histo::p1d*>::const_iterator
|
||||
G4XmlAnalysisManager::EndConstP1() const
|
||||
{
|
||||
return fP1Manager->EndConstP1();
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
std::vector<tools::histo::p2d*>::iterator G4XmlAnalysisManager::BeginP2()
|
||||
{
|
||||
return fP2Manager->BeginP2();
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
std::vector<tools::histo::p2d*>::iterator G4XmlAnalysisManager::EndP2()
|
||||
{
|
||||
return fP2Manager->EndP2();
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
std::vector<tools::histo::p2d*>::const_iterator
|
||||
G4XmlAnalysisManager::BeginConstP2() const
|
||||
{
|
||||
return fP2Manager->BeginConstP2();
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
std::vector<tools::histo::p2d*>::const_iterator
|
||||
G4XmlAnalysisManager::EndConstP2() const
|
||||
{
|
||||
return fP2Manager->EndConstP2();
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
std::vector<tools::waxml::ntuple*>::iterator G4XmlAnalysisManager::BeginNtuple()
|
||||
{
|
||||
return fNtupleManager->BeginNtuple();
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
std::vector<tools::waxml::ntuple*>::iterator G4XmlAnalysisManager::EndNtuple()
|
||||
{
|
||||
return fNtupleManager->EndNtuple();
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
std::vector<tools::waxml::ntuple*>::const_iterator
|
||||
G4XmlAnalysisManager::BeginConstNtuple() const
|
||||
{
|
||||
return fNtupleManager->BeginConstNtuple();
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
std::vector<tools::waxml::ntuple*>::const_iterator
|
||||
G4XmlAnalysisManager::EndConstNtuple() const
|
||||
{
|
||||
return fNtupleManager->EndConstNtuple();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,120 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4XmlAnalysisReader.hh 74257 2013-10-02 14:24:55Z gcosmo $
|
||||
|
||||
// The main manager for Xml analysis reader.
|
||||
// It delegates most of functions to the object specific managers.
|
||||
|
||||
// Author: Ivana Hrivnacova, 25/07/2014 (ivana@ipno.in2p3.fr)
|
||||
|
||||
#ifndef G4XmlAnalysisReader_h
|
||||
#define G4XmlAnalysisReader_h 1
|
||||
|
||||
#include "G4VAnalysisReader.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
#include "tools/histo/h1d"
|
||||
#include "tools/histo/h2d"
|
||||
#include "tools/histo/h3d"
|
||||
#include "tools/histo/p1d"
|
||||
#include "tools/histo/p2d"
|
||||
#include "tools/raxml"
|
||||
|
||||
class G4XmlRFileManager;
|
||||
class G4H1ToolsManager;
|
||||
class G4H2ToolsManager;
|
||||
class G4H3ToolsManager;
|
||||
class G4P1ToolsManager;
|
||||
class G4P2ToolsManager;
|
||||
class G4XmlRNtupleManager;
|
||||
|
||||
class G4XmlAnalysisReader : public G4VAnalysisReader
|
||||
{
|
||||
public:
|
||||
G4XmlAnalysisReader(G4bool isMaster = true);
|
||||
virtual ~G4XmlAnalysisReader();
|
||||
|
||||
// static methods
|
||||
static G4XmlAnalysisReader* Instance();
|
||||
|
||||
// Access methods
|
||||
tools::histo::h1d* GetH1(G4int id, G4bool warn = true) const;
|
||||
tools::histo::h2d* GetH2(G4int id, G4bool warn = true) const;
|
||||
tools::histo::h3d* GetH3(G4int id, G4bool warn = true) const;
|
||||
tools::histo::p1d* GetP1(G4int id, G4bool warn = true) const;
|
||||
tools::histo::p2d* GetP2(G4int id, G4bool warn = true) const;
|
||||
tools::aida::ntuple* GetNtuple() const;
|
||||
tools::aida::ntuple* GetNtuple(G4int ntupleId) const;
|
||||
using G4VAnalysisReader::GetNtuple;
|
||||
|
||||
protected:
|
||||
// virtual methods from base class
|
||||
virtual G4int ReadH1Impl(const G4String& h1Name,
|
||||
const G4String& fileName,
|
||||
G4bool isUserFileName);
|
||||
virtual G4int ReadH2Impl(const G4String& h1Name,
|
||||
const G4String& fileName,
|
||||
G4bool isUserFileName);
|
||||
virtual G4int ReadH3Impl(const G4String& h1Name,
|
||||
const G4String& fileName,
|
||||
G4bool isUserFileName);
|
||||
virtual G4int ReadP1Impl(const G4String& h1Name,
|
||||
const G4String& fileName,
|
||||
G4bool isUserFileName);
|
||||
virtual G4int ReadP2Impl(const G4String& h1Name,
|
||||
const G4String& fileName,
|
||||
G4bool isUserFileName);
|
||||
virtual G4int ReadNtupleImpl(const G4String& ntupleName,
|
||||
const G4String& fileName,
|
||||
G4bool isUserFileName);
|
||||
|
||||
private:
|
||||
// static data members
|
||||
static G4XmlAnalysisReader* fgMasterInstance;
|
||||
static G4ThreadLocal G4XmlAnalysisReader* fgInstance;
|
||||
|
||||
// methods
|
||||
tools::raxml_out* GetHandler(
|
||||
const G4String& fileName,
|
||||
const G4String& objectName,
|
||||
const G4String& objectType,
|
||||
const G4String& inFunction);
|
||||
G4bool Reset();
|
||||
|
||||
// data members
|
||||
G4H1ToolsManager* fH1Manager;
|
||||
G4H2ToolsManager* fH2Manager;
|
||||
G4H3ToolsManager* fH3Manager;
|
||||
G4P1ToolsManager* fP1Manager;
|
||||
G4P2ToolsManager* fP2Manager;
|
||||
G4XmlRNtupleManager* fNtupleManager;
|
||||
G4XmlRFileManager* fFileManager;
|
||||
};
|
||||
|
||||
#include "G4XmlAnalysisReader.icc"
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4XmlAnalysisReader.hh 70604 2013-06-03 11:27:06Z ihrivnac $
|
||||
|
||||
// Author: Ivana Hrivnacova, 25/07/2014 (ivana@ipno.in2p3.fr)
|
||||
|
||||
#include "G4H1ToolsManager.hh"
|
||||
#include "G4H2ToolsManager.hh"
|
||||
#include "G4H3ToolsManager.hh"
|
||||
#include "G4P1ToolsManager.hh"
|
||||
#include "G4P2ToolsManager.hh"
|
||||
//#include "G4XmlRNtupleManager.hh"
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
tools::histo::h1d* G4XmlAnalysisReader::GetH1(G4int id, G4bool warn) const
|
||||
{
|
||||
return fH1Manager->GetH1(id, warn, false);
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
tools::histo::h2d* G4XmlAnalysisReader::GetH2(G4int id, G4bool warn) const
|
||||
{
|
||||
return fH2Manager->GetH2(id, warn, false);
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
tools::histo::h3d* G4XmlAnalysisReader::GetH3(G4int id, G4bool warn) const
|
||||
{
|
||||
return fH3Manager->GetH3(id, warn, false);
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
tools::histo::p1d* G4XmlAnalysisReader::GetP1(G4int id, G4bool warn) const
|
||||
{
|
||||
return fP1Manager->GetP1(id, warn, false);
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
tools::histo::p2d* G4XmlAnalysisReader::GetP2(G4int id, G4bool warn) const
|
||||
{
|
||||
return fP2Manager->GetP2(id, warn, false);
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
tools::aida::ntuple* G4XmlAnalysisReader::GetNtuple() const
|
||||
{
|
||||
//return fNtupleManager->GetNtuple();
|
||||
return 0;
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
tools::aida::ntuple* G4XmlAnalysisReader::GetNtuple(G4int /*ntupleId*/) const
|
||||
{
|
||||
//return fNtupleManager->GetNtuple(ntupleId);
|
||||
return 0;
|
||||
}
|
||||
@@ -25,6 +25,8 @@
|
||||
//
|
||||
// $Id: G4XmlFileManager.hh 70604 2013-06-03 11:27:06Z ihrivnac $
|
||||
|
||||
// The manager for Xml file output operations.
|
||||
|
||||
// Author: Ivana Hrivnacova, 18/06/2013 (ivana@ipno.in2p3.fr)
|
||||
|
||||
#ifndef G4XmlFileManager_h
|
||||
@@ -34,6 +36,8 @@
|
||||
#include "G4XmlNtupleDescription.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
#include <tools/raxml>
|
||||
|
||||
#include <fstream>
|
||||
|
||||
class G4AnalysisManagerState;
|
||||
@@ -44,7 +48,7 @@ class G4XmlFileManager : public G4VFileManager
|
||||
G4XmlFileManager(const G4AnalysisManagerState& state);
|
||||
~G4XmlFileManager();
|
||||
|
||||
// Methods to manipulate files
|
||||
// Methods to manipulate output files
|
||||
virtual G4bool OpenFile(const G4String& fileName);
|
||||
virtual G4bool WriteFile();
|
||||
virtual G4bool CloseFile();
|
||||
@@ -55,29 +59,17 @@ class G4XmlFileManager : public G4VFileManager
|
||||
G4bool CreateNtupleFile(G4XmlNtupleDescription* ntupleDescription);
|
||||
G4bool CloseNtupleFile(G4XmlNtupleDescription* ntupleDescription);
|
||||
|
||||
// Set methods
|
||||
void LockHistoDirectoryName();
|
||||
void LockNtupleDirectoryName();
|
||||
|
||||
// Get methods
|
||||
std::ofstream* GetHnFile() const;
|
||||
|
||||
private:
|
||||
// data members
|
||||
//
|
||||
std::ofstream* fHnFile;
|
||||
};
|
||||
|
||||
// inline functions
|
||||
|
||||
inline void G4XmlFileManager::LockHistoDirectoryName()
|
||||
{ fLockHistoDirectoryName = true; }
|
||||
|
||||
inline void G4XmlFileManager::LockNtupleDirectoryName()
|
||||
{ fLockNtupleDirectoryName = true; }
|
||||
|
||||
inline std::ofstream* G4XmlFileManager::GetHnFile() const
|
||||
{ return fHnFile; }
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
|
||||
#include "tools/waxml/ntuple"
|
||||
|
||||
#include <string>
|
||||
#include <fstream>
|
||||
#include <map>
|
||||
|
||||
@@ -49,7 +50,8 @@ struct G4XmlNtupleDescription
|
||||
fNtupleBooking(0),
|
||||
fNtupleIColumnMap(),
|
||||
fNtupleFColumnMap(),
|
||||
fNtupleDColumnMap() {}
|
||||
fNtupleDColumnMap(),
|
||||
fNtupleSColumnMap() {}
|
||||
|
||||
~G4XmlNtupleDescription()
|
||||
{ delete fFile;
|
||||
@@ -63,6 +65,7 @@ struct G4XmlNtupleDescription
|
||||
std::map<G4int, tools::waxml::ntuple::column<int>* > fNtupleIColumnMap;
|
||||
std::map<G4int, tools::waxml::ntuple::column<float>* > fNtupleFColumnMap;
|
||||
std::map<G4int, tools::waxml::ntuple::column<double>* > fNtupleDColumnMap;
|
||||
std::map<G4int, tools::waxml::ntuple::column<std::string>* > fNtupleSColumnMap;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -65,8 +65,14 @@ class G4XmlNtupleManager : public G4VNtupleManager
|
||||
tools::waxml::ntuple* GetNtuple() const;
|
||||
tools::waxml::ntuple* GetNtuple(G4int ntupleId) const;
|
||||
|
||||
// Iterators
|
||||
std::vector<tools::waxml::ntuple*>::iterator BeginNtuple();
|
||||
std::vector<tools::waxml::ntuple*>::iterator EndNtuple();
|
||||
std::vector<tools::waxml::ntuple*>::const_iterator BeginConstNtuple() const;
|
||||
std::vector<tools::waxml::ntuple*>::const_iterator EndConstNtuple() const;
|
||||
|
||||
// Access to ntuple vector (needed for Write())
|
||||
const std::vector<G4XmlNtupleDescription*>& GetNtupleVector() const;
|
||||
const std::vector<G4XmlNtupleDescription*>& GetNtupleDescriptionVector() const;
|
||||
|
||||
// Virtual functions from base class
|
||||
//
|
||||
@@ -74,14 +80,23 @@ class G4XmlNtupleManager : public G4VNtupleManager
|
||||
// Methods to create ntuples
|
||||
virtual G4int CreateNtuple(const G4String& name, const G4String& title);
|
||||
// Create columns in the last created ntuple
|
||||
virtual G4int CreateNtupleIColumn(const G4String& name);
|
||||
virtual G4int CreateNtupleFColumn(const G4String& name);
|
||||
virtual G4int CreateNtupleDColumn(const G4String& name);
|
||||
virtual G4int CreateNtupleIColumn(
|
||||
const G4String& name, std::vector<int>* vector);
|
||||
virtual G4int CreateNtupleFColumn(
|
||||
const G4String& name, std::vector<float>* vector);
|
||||
virtual G4int CreateNtupleDColumn(
|
||||
const G4String& name, std::vector<double>* vector);
|
||||
virtual G4int CreateNtupleSColumn(const G4String& name);
|
||||
virtual void FinishNtuple();
|
||||
// Create columns in the ntuple with given id
|
||||
virtual G4int CreateNtupleIColumn(G4int ntupleId, const G4String& name);
|
||||
virtual G4int CreateNtupleFColumn(G4int ntupleId, const G4String& name);
|
||||
virtual G4int CreateNtupleDColumn(G4int ntupleId, const G4String& name);
|
||||
// Create columns in the ntuple with given id
|
||||
virtual G4int CreateNtupleIColumn(G4int ntupleId,
|
||||
const G4String& name, std::vector<int>* vector);
|
||||
virtual G4int CreateNtupleFColumn(G4int ntupleId,
|
||||
const G4String& name, std::vector<float>* vector);
|
||||
virtual G4int CreateNtupleDColumn(G4int ntupleId,
|
||||
const G4String& name, std::vector<double>* vector);
|
||||
virtual G4int CreateNtupleSColumn(G4int ntupleId, const G4String& name);
|
||||
virtual void FinishNtuple(G4int ntupleId);
|
||||
|
||||
// Methods to fill ntuples
|
||||
@@ -89,11 +104,14 @@ class G4XmlNtupleManager : public G4VNtupleManager
|
||||
virtual G4bool FillNtupleIColumn(G4int columnId, G4int value);
|
||||
virtual G4bool FillNtupleFColumn(G4int columnId, G4float value);
|
||||
virtual G4bool FillNtupleDColumn(G4int columnId, G4double value);
|
||||
virtual G4bool FillNtupleSColumn(G4int columnId, const G4String& value);
|
||||
virtual G4bool AddNtupleRow();
|
||||
// Methods for ntuple with id > FirstNtupleId (when more ntuples exist)
|
||||
virtual G4bool FillNtupleIColumn(G4int ntupleId, G4int columnId, G4int value);
|
||||
virtual G4bool FillNtupleFColumn(G4int ntupleId, G4int columnId, G4float value);
|
||||
virtual G4bool FillNtupleDColumn(G4int ntupleId, G4int columnId, G4double value);
|
||||
virtual G4bool FillNtupleSColumn(G4int ntupleId, G4int columnId,
|
||||
const G4String& value);
|
||||
virtual G4bool AddNtupleRow(G4int ntupleId);
|
||||
|
||||
// Access methods
|
||||
@@ -108,6 +126,8 @@ class G4XmlNtupleManager : public G4VNtupleManager
|
||||
GetNtupleFColumn(G4int ntupleId, G4int columnId) const;
|
||||
tools::waxml::ntuple::column<double>*
|
||||
GetNtupleDColumn(G4int ntupleId, G4int columnId) const;
|
||||
tools::waxml::ntuple::column<std::string>*
|
||||
GetNtupleSColumn(G4int ntupleId, G4int columnId) const;
|
||||
|
||||
virtual G4XmlNtupleDescription* GetNtupleInFunction(G4int id,
|
||||
G4String function,
|
||||
@@ -117,7 +137,8 @@ class G4XmlNtupleManager : public G4VNtupleManager
|
||||
// data members
|
||||
//
|
||||
G4XmlFileManager* fFileManager;
|
||||
std::vector<G4XmlNtupleDescription*> fNtupleVector;
|
||||
std::vector<G4XmlNtupleDescription*> fNtupleDescriptionVector;
|
||||
std::vector<tools::waxml::ntuple*> fNtupleVector;
|
||||
};
|
||||
|
||||
// inline functions
|
||||
@@ -125,11 +146,28 @@ class G4XmlNtupleManager : public G4VNtupleManager
|
||||
inline void G4XmlNtupleManager::SetFileManager(G4XmlFileManager* fileManager)
|
||||
{ fFileManager = fileManager; }
|
||||
|
||||
inline std::vector<tools::waxml::ntuple*>::iterator
|
||||
G4XmlNtupleManager::BeginNtuple()
|
||||
{ return fNtupleVector.begin(); }
|
||||
|
||||
inline std::vector<tools::waxml::ntuple*>::iterator
|
||||
G4XmlNtupleManager::EndNtuple()
|
||||
{ return fNtupleVector.end(); }
|
||||
|
||||
inline std::vector<tools::waxml::ntuple*>::const_iterator
|
||||
G4XmlNtupleManager::BeginConstNtuple() const
|
||||
{ return fNtupleVector.begin(); }
|
||||
|
||||
inline std::vector<tools::waxml::ntuple*>::const_iterator
|
||||
G4XmlNtupleManager::EndConstNtuple() const
|
||||
{ return fNtupleVector.end(); }
|
||||
|
||||
inline G4int G4XmlNtupleManager::GetNofNtuples() const
|
||||
{ return fNtupleVector.size(); }
|
||||
|
||||
inline const std::vector<G4XmlNtupleDescription*>& G4XmlNtupleManager::GetNtupleVector() const
|
||||
{ return fNtupleVector; }
|
||||
inline const std::vector<G4XmlNtupleDescription*>&
|
||||
G4XmlNtupleManager::GetNtupleDescriptionVector() const
|
||||
{ return fNtupleDescriptionVector; }
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4XmlRFileManager.hh 70604 2013-06-03 11:27:06Z ihrivnac $
|
||||
|
||||
// The manager for Xml file input operations.
|
||||
|
||||
// Author: Ivana Hrivnacova, 10/09/2014 (ivana@ipno.in2p3.fr)
|
||||
|
||||
#ifndef G4XmlRFileManager_h
|
||||
#define G4XmlRFileManager_h 1
|
||||
|
||||
#include "G4BaseFileManager.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
#include <tools/raxml>
|
||||
|
||||
#include <fstream>
|
||||
|
||||
class G4AnalysisManagerState;
|
||||
|
||||
class G4XmlRFileManager : public G4BaseFileManager
|
||||
{
|
||||
public:
|
||||
G4XmlRFileManager(const G4AnalysisManagerState& state);
|
||||
~G4XmlRFileManager();
|
||||
|
||||
// Methods to manipulate input files
|
||||
virtual G4bool OpenRFile(const G4String& fileName);
|
||||
|
||||
// Specific methods for files per objects
|
||||
tools::raxml* GetRFile(const G4String& fileName) const;
|
||||
|
||||
private:
|
||||
// data members
|
||||
tools::xml::default_factory* fReadFactory;
|
||||
std::map<G4String, tools::raxml*> fRFiles;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,68 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id$
|
||||
|
||||
// Structure containing the information related to rroot ntuple
|
||||
//
|
||||
// Author: Ivana Hrivnacova, 09/04/2014 (ivana@ipno.in2p3.fr)
|
||||
|
||||
#ifndef G4XmlRNtupleDescription_h
|
||||
#define G4XmlRNtupleDescription_h 1
|
||||
|
||||
#include "tools/raxml"
|
||||
#include "tools/ntuple_binding"
|
||||
|
||||
namespace tools {
|
||||
class ntuple_binding;
|
||||
}
|
||||
|
||||
struct G4XmlRNtupleDescription
|
||||
{
|
||||
G4XmlRNtupleDescription(
|
||||
tools::aida::ntuple* rntuple)
|
||||
: fNtuple(rntuple),
|
||||
fNtupleBinding(new tools::ntuple_binding()),
|
||||
fIsInitialized(false) {}
|
||||
|
||||
~G4XmlRNtupleDescription()
|
||||
{
|
||||
delete fNtupleBinding;
|
||||
delete fNtuple; // CHECK
|
||||
}
|
||||
|
||||
tools::aida::ntuple* fNtuple;
|
||||
tools::ntuple_binding* fNtupleBinding;
|
||||
G4bool fIsInitialized;
|
||||
|
||||
private:
|
||||
// disabled (not implemented) copy constructor
|
||||
G4XmlRNtupleDescription(const G4XmlRNtupleDescription& rhs);
|
||||
// disabled (not implemented) assignement operator
|
||||
G4XmlRNtupleDescription& operator=(G4XmlRNtupleDescription& rhs);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,119 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id$
|
||||
|
||||
// Manager class for Xml read ntuples.
|
||||
// It implements functions specific to Xml read ntuples.
|
||||
//
|
||||
// Author: Ivana Hrivnacova, 25/07/2014 (ivana@ipno.in2p3.fr)
|
||||
|
||||
#ifndef G4XmlRNtupleManager_h
|
||||
#define G4XmlRNtupleManager_h 1
|
||||
|
||||
#include "G4VRNtupleManager.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
#include "tools/raxml"
|
||||
|
||||
#include <vector>
|
||||
|
||||
struct G4XmlRNtupleDescription;
|
||||
|
||||
class G4XmlRNtupleManager : public G4VRNtupleManager
|
||||
{
|
||||
friend class G4XmlAnalysisReader;
|
||||
|
||||
protected:
|
||||
G4XmlRNtupleManager(const G4AnalysisManagerState& state);
|
||||
virtual ~G4XmlRNtupleManager();
|
||||
|
||||
// Methods to manipulate ntuples
|
||||
G4bool IsEmpty() const;
|
||||
G4bool Reset();
|
||||
|
||||
// Access methods
|
||||
tools::aida::ntuple* GetNtuple() const;
|
||||
tools::aida::ntuple* GetNtuple(G4int ntupleId) const;
|
||||
|
||||
// Functions independent from the output type
|
||||
//
|
||||
// Methods to read ntuple from a file
|
||||
G4int SetNtuple(G4XmlRNtupleDescription* rntupleDescription);
|
||||
// Methods for ntuple with id = FirstNtupleId
|
||||
virtual G4bool SetNtupleIColumn(const G4String& columnName,
|
||||
G4int& value);
|
||||
virtual G4bool SetNtupleFColumn(const G4String& columnName,
|
||||
G4float& value);
|
||||
virtual G4bool SetNtupleDColumn(const G4String& columnName,
|
||||
G4double& value);
|
||||
virtual G4bool SetNtupleSColumn(const G4String& columnName,
|
||||
G4String& value);
|
||||
// Bind the ntuple columns of vector type
|
||||
virtual G4bool SetNtupleIColumn(const G4String& columnName,
|
||||
std::vector<G4int>& vector);
|
||||
virtual G4bool SetNtupleFColumn(const G4String& columnName,
|
||||
std::vector<G4float>& vector);
|
||||
virtual G4bool SetNtupleDColumn(const G4String& columnName,
|
||||
std::vector<G4double>& vector);
|
||||
// Methods for ntuple with id > FirstNtupleId
|
||||
virtual G4bool SetNtupleIColumn(G4int ntupleId,
|
||||
const G4String& columnName, G4int& value);
|
||||
virtual G4bool SetNtupleFColumn(G4int ntupleId,
|
||||
const G4String& columnName, G4float& value);
|
||||
virtual G4bool SetNtupleDColumn(G4int ntupleId,
|
||||
const G4String& columnName, G4double& value);
|
||||
virtual G4bool SetNtupleSColumn(G4int ntupleId,
|
||||
const G4String& columnName, G4String& value);
|
||||
// Bind the ntuple columns of vector type
|
||||
virtual G4bool SetNtupleIColumn(G4int ntupleId, const G4String& columnName,
|
||||
std::vector<G4int>& vector);
|
||||
virtual G4bool SetNtupleFColumn(G4int ntupleId, const G4String& columnName,
|
||||
std::vector<G4float>& vector);
|
||||
virtual G4bool SetNtupleDColumn(G4int ntupleId, const G4String& columnName,
|
||||
std::vector<G4double>& vector);
|
||||
virtual G4bool GetNtupleRow();
|
||||
virtual G4bool GetNtupleRow(G4int ntupleId) ;
|
||||
|
||||
// Access methods
|
||||
virtual G4int GetNofNtuples() const;
|
||||
|
||||
private:
|
||||
// methods
|
||||
G4XmlRNtupleDescription* GetNtupleInFunction(G4int id,
|
||||
G4String function,
|
||||
G4bool warn = true) const;
|
||||
|
||||
// data members
|
||||
std::vector<G4XmlRNtupleDescription*> fNtupleVector;
|
||||
};
|
||||
|
||||
// inline functions
|
||||
|
||||
inline G4int G4XmlRNtupleManager::GetNofNtuples() const
|
||||
{ return fNtupleVector.size(); }
|
||||
|
||||
#endif
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: g4xml_defs.hh 72292 2013-07-15 12:01:43Z ihrivnac $
|
||||
// $Id: g4xml_defs.hh 83748 2014-09-12 12:13:37Z gcosmo $
|
||||
|
||||
// Author: Ivana Hrivnacova, 15/06/2011 (ivana@ipno.in2p3.fr)
|
||||
|
||||
@@ -32,16 +32,53 @@
|
||||
|
||||
#include "tools/histo/h1d"
|
||||
#include "tools/histo/h2d"
|
||||
#include "tools/histo/h3d"
|
||||
#include "tools/histo/p1d"
|
||||
#include "tools/histo/p2d"
|
||||
#include "tools/waxml/ntuple"
|
||||
#include "G4XmlAnalysisManager.hh"
|
||||
#include "G4XmlAnalysisReader.hh"
|
||||
|
||||
namespace G4Xml {
|
||||
|
||||
typedef tools::histo::h1d G4AnaH1;
|
||||
typedef tools::histo::h2d G4AnaH2;
|
||||
typedef tools::waxml::ntuple* G4Ntuple;
|
||||
// H1 types
|
||||
typedef tools::histo::h1d G4AnaH1; // keep for backward compatibility
|
||||
typedef tools::histo::h1d G4H1;
|
||||
typedef std::vector<tools::histo::h1d*>::iterator G4H1Iterator;
|
||||
typedef std::vector<tools::histo::h1d*>::const_iterator G4H1ConstIterator;
|
||||
|
||||
// H2 types
|
||||
typedef tools::histo::h2d G4AnaH2; // keep for backward compatibility
|
||||
typedef tools::histo::h2d G4H2;
|
||||
typedef std::vector<tools::histo::h2d*>::iterator G4H2Iterator;
|
||||
typedef std::vector<tools::histo::h2d*>::const_iterator G4H2ConstIterator;
|
||||
|
||||
// H3 types
|
||||
typedef tools::histo::h3d G4H3;
|
||||
typedef std::vector<tools::histo::h3d*>::iterator G4H3Iterator;
|
||||
typedef std::vector<tools::histo::h3d*>::const_iterator G4H3ConstIterator;
|
||||
|
||||
// P1 types
|
||||
typedef tools::histo::p1d G4P1;
|
||||
typedef std::vector<tools::histo::p1d*>::iterator G4P1Iterator;
|
||||
typedef std::vector<tools::histo::p1d*>::const_iterator G4P1ConstIterator;
|
||||
|
||||
// P2 types
|
||||
typedef tools::histo::p2d G4P2;
|
||||
typedef std::vector<tools::histo::p2d*>::iterator G4P2Iterator;
|
||||
typedef std::vector<tools::histo::p2d*>::const_iterator G4P2ConstIterator;
|
||||
|
||||
// Ntuple types
|
||||
typedef tools::waxml::ntuple G4Ntuple;
|
||||
typedef std::vector<tools::waxml::ntuple*>::iterator G4NtupleIterator;
|
||||
typedef std::vector<tools::waxml::ntuple*>::const_iterator G4NtupleConstIterator;
|
||||
|
||||
// RNtuple types
|
||||
typedef tools::aida::ntuple G4RNtuple;
|
||||
|
||||
// Managers
|
||||
typedef G4XmlAnalysisManager G4AnalysisManager;
|
||||
typedef G4XmlAnalysisReader G4AnalysisReader;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user