Import Geant4 10.0.0 source tree
This commit is contained in:
@@ -0,0 +1,118 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4AnalysisManagerState.hh 66310 2012-12-17 11:56:35Z ihrivnac $
|
||||
|
||||
// The state of the analysis manager instance.
|
||||
//
|
||||
// Author: Ivana Hrivnacova, 09/07/2013 (ivana@ipno.in2p3.fr)
|
||||
|
||||
#ifndef G4AnalysisManagerState_h
|
||||
#define G4AnalysisManagerState_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4AnalysisVerbose.hh"
|
||||
#include "G4Threading.hh"
|
||||
|
||||
class G4AnalysisManagerState
|
||||
{
|
||||
// Only G4VAnalysisManager can change the state
|
||||
friend class G4VAnalysisManager;
|
||||
|
||||
public:
|
||||
G4AnalysisManagerState(const G4String& type, G4bool isMaster);
|
||||
|
||||
// Utility method
|
||||
static G4bool IsMT() {
|
||||
return G4Threading::G4GetThreadId() > -2;
|
||||
}
|
||||
|
||||
// get methods
|
||||
G4String GetType() const;
|
||||
G4bool GetIsMaster() const;
|
||||
G4bool GetIsActivation() const;
|
||||
G4int GetVerboseLevel() const;
|
||||
const G4AnalysisVerbose* GetVerboseL1() const;
|
||||
const G4AnalysisVerbose* GetVerboseL2() const;
|
||||
const G4AnalysisVerbose* GetVerboseL3() const;
|
||||
const G4AnalysisVerbose* GetVerboseL4() const;
|
||||
|
||||
private:
|
||||
// disabled constructors, operators
|
||||
G4AnalysisManagerState();
|
||||
G4AnalysisManagerState(const G4AnalysisManagerState&);
|
||||
G4AnalysisManagerState& operator=(const G4AnalysisManagerState&);
|
||||
|
||||
// set methods
|
||||
// (hidden from all clients except for G4VAnalysisManager friend)
|
||||
void SetIsActivation(G4bool isActivation);
|
||||
void SetVerboseLevel(G4int verboseLevel);
|
||||
|
||||
// data members
|
||||
G4String fType;
|
||||
G4bool fIsMaster;
|
||||
G4bool fIsActivation;
|
||||
G4int fVerboseLevel;
|
||||
G4AnalysisVerbose fVerboseL1;
|
||||
G4AnalysisVerbose fVerboseL2;
|
||||
G4AnalysisVerbose fVerboseL3;
|
||||
G4AnalysisVerbose fVerboseL4;
|
||||
G4AnalysisVerbose* fpVerboseL1;
|
||||
G4AnalysisVerbose* fpVerboseL2;
|
||||
G4AnalysisVerbose* fpVerboseL3;
|
||||
G4AnalysisVerbose* fpVerboseL4;
|
||||
};
|
||||
|
||||
// inline functions
|
||||
|
||||
inline void G4AnalysisManagerState::SetIsActivation(G4bool isActivation)
|
||||
{ fIsActivation = isActivation; }
|
||||
|
||||
inline G4String G4AnalysisManagerState::GetType() const
|
||||
{ return fType; }
|
||||
|
||||
inline G4bool G4AnalysisManagerState::GetIsMaster() const
|
||||
{ return fIsMaster; }
|
||||
|
||||
inline G4bool G4AnalysisManagerState::GetIsActivation() const
|
||||
{ return fIsActivation; }
|
||||
|
||||
inline G4int G4AnalysisManagerState::GetVerboseLevel() const
|
||||
{ return fVerboseLevel; }
|
||||
|
||||
inline const G4AnalysisVerbose* G4AnalysisManagerState::GetVerboseL1() const
|
||||
{ return fpVerboseL1; }
|
||||
|
||||
inline const G4AnalysisVerbose* G4AnalysisManagerState::GetVerboseL2() const
|
||||
{ return fpVerboseL2; }
|
||||
|
||||
inline const G4AnalysisVerbose* G4AnalysisManagerState::GetVerboseL3() const
|
||||
{ return fpVerboseL3; }
|
||||
|
||||
inline const G4AnalysisVerbose* G4AnalysisManagerState::GetVerboseL4() const
|
||||
{ return fpVerboseL4; }
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4AnalysisMessenger.hh 66310 2012-12-17 11:56:35Z ihrivnac $
|
||||
|
||||
// The messenger class for G4VAnalysisManager.
|
||||
// It implements commands:
|
||||
// - /analysis/setActivation
|
||||
// - /analysis/verbose
|
||||
//
|
||||
// Author: Ivana Hrivnacova, 24/06/2013 (ivana@ipno.in2p3.fr)
|
||||
|
||||
#ifndef G4AnalysisMessenger_h
|
||||
#define G4AnalysisMessenger_h 1
|
||||
|
||||
#include "G4UImessenger.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class G4VAnalysisManager;
|
||||
class G4HnManager;
|
||||
class G4FileMessenger;
|
||||
class G4H1Messenger;
|
||||
class G4H2Messenger;
|
||||
class G4HnMessenger;
|
||||
|
||||
class G4UIdirectory;
|
||||
class G4UIcmdWithABool;
|
||||
class G4UIcmdWithAnInteger;
|
||||
|
||||
class G4AnalysisMessenger : public G4UImessenger
|
||||
{
|
||||
public:
|
||||
G4AnalysisMessenger(G4VAnalysisManager* manager);
|
||||
virtual ~G4AnalysisMessenger();
|
||||
|
||||
// methods
|
||||
void SetH1HnManager(G4HnManager* h1HnManager);
|
||||
void SetH2HnManager(G4HnManager* h2HnManager);
|
||||
|
||||
// methods
|
||||
virtual void SetNewValue(G4UIcommand* command, G4String value);
|
||||
|
||||
// data members
|
||||
G4VAnalysisManager* fManager; ///< Associated class
|
||||
G4FileMessenger* fFileMessenger;
|
||||
G4H1Messenger* fH1Messenger;
|
||||
G4H2Messenger* fH2Messenger;
|
||||
G4HnMessenger* fH1HnMessenger;
|
||||
G4HnMessenger* fH2HnMessenger;
|
||||
|
||||
G4UIdirectory* fAnalysisDir;
|
||||
G4UIcmdWithABool* fSetActivationCmd;
|
||||
G4UIcmdWithAnInteger* fVerboseCmd;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4Fcn.hh 72292 2013-07-15 12:01:43Z ihrivnac $
|
||||
|
||||
// Author: Ivana Hrivnacova, 04/07/2012 (ivana@ipno.in2p3.fr)
|
||||
|
||||
#ifndef G4AnalysisUtilities_h
|
||||
#define G4AnalysisUtilities_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
|
||||
#include <vector>
|
||||
|
||||
namespace G4Analysis {
|
||||
|
||||
// Invalid object Id
|
||||
//
|
||||
const G4int kInvalidId = -1;
|
||||
|
||||
// Utility functions for checking input parameters
|
||||
G4bool CheckNbins(G4int nbins);
|
||||
G4bool CheckMinMax(G4double xmin, G4double xmax, const G4String& binSchemeName);
|
||||
G4bool CheckEdges(const std::vector<G4double>& edges);
|
||||
|
||||
// Get unit value with added handling of b"none"
|
||||
G4double GetUnitValue(const G4String& unit);
|
||||
|
||||
// Add unit & fcn to the title
|
||||
void UpdateTitle(G4String& title,
|
||||
const G4String& unitName, const G4String& fcnName);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4AnalysisVerbose.hh 72292 2013-07-15 12:01:43Z ihrivnac $
|
||||
|
||||
// Utility class for analysis category messages.
|
||||
|
||||
// Author: Ivana Hrivnacova, 17/10/2011 (ivana@ipno.in2p3.fr)
|
||||
|
||||
#ifndef G4AnalysisVerbose_h
|
||||
#define G4AnalysisVerbose_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
|
||||
class G4AnalysisVerbose
|
||||
{
|
||||
public:
|
||||
G4AnalysisVerbose(const G4String& type, G4int verboseLevel);
|
||||
virtual ~G4AnalysisVerbose();
|
||||
|
||||
void Message(const G4String& action,
|
||||
const G4String& object,
|
||||
const G4String& objectName,
|
||||
G4bool success = true) const;
|
||||
|
||||
void Message(const G4String& action,
|
||||
const G4String& object,
|
||||
G4ExceptionDescription& description,
|
||||
G4bool success = true) const;
|
||||
|
||||
private:
|
||||
// data members
|
||||
//
|
||||
G4String fType;
|
||||
G4String fToBeDoneText;
|
||||
G4String fDoneText;
|
||||
G4String fFailureText;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4BaseAnalysisManager.hh 70604 2013-06-03 11:27:06Z ihrivnac $
|
||||
|
||||
// Base class for the object managers.
|
||||
// It handles first object ID and its lock and provides common utility methods.
|
||||
|
||||
// Author: Ivana Hrivnacova, 18/06/2013 (ivana@ipno.in2p3.fr)
|
||||
|
||||
#ifndef G4BaseAnalysisManager_h
|
||||
#define G4BaseAnalysisManager_h 1
|
||||
|
||||
#include "G4Fcn.hh"
|
||||
#include "G4BinScheme.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class G4AnalysisManagerState;
|
||||
|
||||
class G4BaseAnalysisManager
|
||||
{
|
||||
public:
|
||||
G4BaseAnalysisManager(const G4AnalysisManagerState& state);
|
||||
virtual ~G4BaseAnalysisManager();
|
||||
|
||||
// The ids of objects are generated automatically
|
||||
// starting from 0; with the following function it is possible to
|
||||
// change the first Id to start from other value
|
||||
G4bool SetFirstId(G4int firstId);
|
||||
|
||||
protected:
|
||||
// methods
|
||||
void ExceptionForHistograms(const G4String& functionName) const;
|
||||
|
||||
// data members
|
||||
const G4AnalysisManagerState& fState;
|
||||
G4int fFirstId;
|
||||
G4bool fLockFirstId;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4Fcn.hh 72292 2013-07-15 12:01:43Z ihrivnac $
|
||||
|
||||
// Author: Ivana Hrivnacova, 04/07/2012 (ivana@ipno.in2p3.fr)
|
||||
|
||||
#ifndef G4BinScheme_h
|
||||
#define G4BinScheme_h 1
|
||||
|
||||
#include "G4Fcn.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
#include <vector>
|
||||
|
||||
// Enumeration for definition available binning schemes
|
||||
|
||||
enum G4BinScheme {
|
||||
kLinearBinScheme,
|
||||
kLogBinScheme,
|
||||
kUserBinScheme
|
||||
};
|
||||
|
||||
// Utility function
|
||||
namespace G4Analysis {
|
||||
|
||||
G4BinScheme GetBinScheme(const G4String& binSchemeName);
|
||||
|
||||
void ComputeEdges(G4int nbins, G4double xmin, G4double xmax,
|
||||
G4Fcn fcn, G4BinScheme,
|
||||
std::vector<G4double>& edges);
|
||||
|
||||
void ComputeEdges(const std::vector<G4double>& edges, G4Fcn fcn,
|
||||
std::vector<G4double>& newEdges);
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,49 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4Fcn.hh 73423 2013-08-27 10:54:55Z gcosmo $
|
||||
|
||||
// Author: Ivana Hrivnacova, 04/07/2012 (ivana@ipno.in2p3.fr)
|
||||
|
||||
#ifndef G4Fcn_h
|
||||
#define G4Fcn_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
|
||||
// Generic function which can be applied to histogram/ntuple values
|
||||
typedef G4double (*G4Fcn) (G4double);
|
||||
|
||||
// Identity function
|
||||
inline G4double G4FcnIdentity(G4double value) { return value; }
|
||||
|
||||
// Utility function
|
||||
namespace G4Analysis {
|
||||
G4Fcn GetFunction(const G4String& fcnName);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,63 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4FileMessenger.hh 66310 2012-12-17 11:56:35Z ihrivnac $
|
||||
|
||||
// The messenger class for File management
|
||||
//
|
||||
// It implements commands:
|
||||
// - /analysis/setFileName name
|
||||
// - /analysis/setHistoDirName name
|
||||
// - /analysis/setNtupleDirName name
|
||||
//
|
||||
// Author: Ivana Hrivnacova, 18/06/2013 (ivana@ipno.in2p3.fr)
|
||||
|
||||
#ifndef G4FileMessenger_h
|
||||
#define G4FileMessenger_h 1
|
||||
|
||||
#include "G4UImessenger.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class G4VAnalysisManager;
|
||||
class G4UIcmdWithAString;
|
||||
|
||||
class G4FileMessenger : public G4UImessenger
|
||||
{
|
||||
public:
|
||||
G4FileMessenger(G4VAnalysisManager* manager);
|
||||
virtual ~G4FileMessenger();
|
||||
|
||||
// methods
|
||||
virtual void SetNewValue(G4UIcommand* command, G4String value);
|
||||
|
||||
G4VAnalysisManager* fManager; ///< Associated class
|
||||
|
||||
G4UIcmdWithAString* fSetFileNameCmd;
|
||||
G4UIcmdWithAString* fSetHistoDirNameCmd;
|
||||
G4UIcmdWithAString* fSetNtupleDirNameCmd;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4H1Messenger.hh 66310 2012-12-17 11:56:35Z ihrivnac $
|
||||
|
||||
// The messenger class for H1 management.
|
||||
// It implements commands in /analysis/h1 directory.
|
||||
//
|
||||
// This messenger class is a generalization of the HistoMessenger class,
|
||||
// originally developed for the extended/electromagnetic examples
|
||||
// by Michel Maire (michel.maire@lapp.in2p3.fr)
|
||||
//
|
||||
// Author: Ivana Hrivnacova, 24/06/2013 (ivana@ipno.in2p3.fr)
|
||||
|
||||
#ifndef G4H1Messenger_h
|
||||
#define G4H1Messenger_h 1
|
||||
|
||||
#include "G4UImessenger.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class G4VAnalysisManager;
|
||||
class G4UIdirectory;
|
||||
class G4UIcommand;
|
||||
|
||||
class G4H1Messenger : public G4UImessenger
|
||||
{
|
||||
public:
|
||||
G4H1Messenger(G4VAnalysisManager* manager);
|
||||
virtual ~G4H1Messenger();
|
||||
|
||||
// methods
|
||||
virtual void SetNewValue(G4UIcommand* command, G4String value);
|
||||
|
||||
private:
|
||||
void CreateH1Cmd();
|
||||
void SetH1Cmd();
|
||||
void SetH1TitleCmd();
|
||||
void SetH1XAxisCmd();
|
||||
void SetH1YAxisCmd();
|
||||
|
||||
G4VAnalysisManager* fManager; ///< Associated class
|
||||
|
||||
G4UIdirectory* fH1Dir;
|
||||
G4UIcommand* fCreateH1Cmd;
|
||||
G4UIcommand* fSetH1Cmd;
|
||||
G4UIcommand* fSetH1TitleCmd;
|
||||
G4UIcommand* fSetH1XAxisCmd;
|
||||
G4UIcommand* fSetH1YAxisCmd;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4H2Messenger.hh 66310 2012-12-17 11:56:35Z ihrivnac $
|
||||
|
||||
// The messenger class for H2 management.
|
||||
// It implements commands in /analysis/h2 directory.
|
||||
//
|
||||
// Author: Ivana Hrivnacova, 18/06/2013 (ivana@ipno.in2p3.fr)
|
||||
|
||||
#ifndef G4H2Messenger_h
|
||||
#define G4H2Messenger_h 1
|
||||
|
||||
#include "G4UImessenger.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class G4VAnalysisManager;
|
||||
class G4UIdirectory;
|
||||
class G4UIcommand;
|
||||
|
||||
class G4H2Messenger : public G4UImessenger
|
||||
{
|
||||
public:
|
||||
G4H2Messenger(G4VAnalysisManager* manager);
|
||||
virtual ~G4H2Messenger();
|
||||
|
||||
// methods
|
||||
virtual void SetNewValue(G4UIcommand* command, G4String value);
|
||||
|
||||
private:
|
||||
void CreateH2Cmd();
|
||||
void SetH2Cmd();
|
||||
void SetH2TitleCmd();
|
||||
void SetH2XAxisCmd();
|
||||
void SetH2YAxisCmd();
|
||||
void SetH2ZAxisCmd();
|
||||
|
||||
G4VAnalysisManager* fManager; ///< Associated class
|
||||
|
||||
G4UIdirectory* fH2Dir;
|
||||
G4UIcommand* fCreateH2Cmd;
|
||||
G4UIcommand* fSetH2Cmd;
|
||||
G4UIcommand* fSetH2TitleCmd;
|
||||
G4UIcommand* fSetH2XAxisCmd;
|
||||
G4UIcommand* fSetH2YAxisCmd;
|
||||
G4UIcommand* fSetH2ZAxisCmd;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,80 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4HnInformation.hh 73423 2013-08-27 10:54:55Z gcosmo $
|
||||
|
||||
// Author: Ivana Hrivnacova, 04/07/2012 (ivana@ipno.in2p3.fr)
|
||||
|
||||
#ifndef G4HnInformation_h
|
||||
#define G4HnInformation_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4Fcn.hh"
|
||||
#include "G4BinScheme.hh"
|
||||
|
||||
struct G4HnInformation
|
||||
{
|
||||
G4HnInformation(const G4String& name,
|
||||
const G4String& xunitName, const G4String& yunitName,
|
||||
const G4String& fxName, const G4String& fyName,
|
||||
G4double xunit, G4double yunit,
|
||||
G4Fcn fx, G4Fcn fy,
|
||||
G4BinScheme xBinScheme, G4BinScheme yBinScheme)
|
||||
: fName(name),
|
||||
fXUnitName(xunitName),
|
||||
fYUnitName(yunitName),
|
||||
fXFcnName(fxName),
|
||||
fYFcnName(fyName),
|
||||
fXUnit(xunit),
|
||||
fYUnit(yunit),
|
||||
fXFcn(fx),
|
||||
fYFcn(fy),
|
||||
fXBinScheme(xBinScheme),
|
||||
fYBinScheme(yBinScheme),
|
||||
fActivation(true),
|
||||
fAscii(false)
|
||||
{}
|
||||
|
||||
G4String fName;
|
||||
G4String fXUnitName;
|
||||
G4String fYUnitName;
|
||||
G4String fXFcnName;
|
||||
G4String fYFcnName;
|
||||
G4double fXUnit;
|
||||
G4double fYUnit;
|
||||
G4Fcn fXFcn;
|
||||
G4Fcn fYFcn;
|
||||
G4BinScheme fXBinScheme;
|
||||
G4BinScheme fYBinScheme;
|
||||
G4bool fActivation;
|
||||
G4bool fAscii;
|
||||
|
||||
// disable default constructor
|
||||
private:
|
||||
G4HnInformation();
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,121 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4HnManager.hh 70604 2013-06-03 11:27:06Z ihrivnac $
|
||||
|
||||
// Class for management of G4HnInformation.
|
||||
// It implements functions handling the added H1/H2 information
|
||||
// (not available in g4tools).
|
||||
//
|
||||
// Author: Ivana Hrivnacova, 18/06/2013 (ivana@ipno.in2p3.fr)
|
||||
|
||||
#ifndef G4HnManager_h
|
||||
#define G4HnManager_h 1
|
||||
|
||||
#include "G4BaseAnalysisManager.hh"
|
||||
#include "G4HnInformation.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
#include <vector>
|
||||
|
||||
class G4HnManager : public G4BaseAnalysisManager
|
||||
{
|
||||
public:
|
||||
G4HnManager(const G4String& hnType,
|
||||
const G4AnalysisManagerState& state);
|
||||
virtual ~G4HnManager();
|
||||
|
||||
// Methods to manipulate additional information
|
||||
|
||||
void AddH1Information(const G4String& name,
|
||||
const G4String& unitName,
|
||||
const G4String& fcnName,
|
||||
G4double unit,
|
||||
G4Fcn fx,
|
||||
G4BinScheme binScheme);
|
||||
void AddH2Information(const G4String& name,
|
||||
const G4String& xunitName,
|
||||
const G4String& yunitName,
|
||||
const G4String& xfcnName,
|
||||
const G4String& yfcnName,
|
||||
G4double xunit, G4double yunit,
|
||||
G4Fcn fx, G4Fcn fy,
|
||||
G4BinScheme xBinScheme, G4BinScheme yBinScheme);
|
||||
// Access methofd
|
||||
G4HnInformation* GetHnInformation(G4int id,
|
||||
G4String functionName = "",
|
||||
G4bool warn = true) const;
|
||||
|
||||
const std::vector<G4HnInformation*>& GetHnVector() const;
|
||||
G4int GetNofHns() const;
|
||||
G4String GetHnType() const;
|
||||
|
||||
// Activation option
|
||||
|
||||
// Return false if activation is enabled and there is no object activated,
|
||||
// return true otherwise
|
||||
G4bool IsActive() const;
|
||||
|
||||
// ASCII option
|
||||
|
||||
// Return false if there is no object selected for ASCII output,
|
||||
// return true otherwise
|
||||
G4bool IsAscii() const;
|
||||
|
||||
// Function implementing public analsi manager interface
|
||||
//
|
||||
|
||||
void SetActivation(G4bool activation);
|
||||
void SetActivation(G4int id, G4bool activation);
|
||||
void SetAscii(G4int id, G4bool ascii);
|
||||
|
||||
// Access to Hn additional information
|
||||
G4String GetName(G4int id) const;
|
||||
G4double GetXUnit(G4int id) const;
|
||||
G4double GetYUnit(G4int id) const;
|
||||
G4bool GetActivation(G4int id) const;
|
||||
G4bool GetAscii(G4int id) const;
|
||||
|
||||
private:
|
||||
// Data members
|
||||
G4String fHnType;
|
||||
G4int fNofActiveObjects;
|
||||
G4int fNofAsciiObjects;
|
||||
|
||||
// Additional histograms/ntuple properties not included in tools
|
||||
std::vector<G4HnInformation*> fHnVector;
|
||||
};
|
||||
|
||||
inline G4int G4HnManager::GetNofHns() const
|
||||
{ return fHnVector.size(); }
|
||||
|
||||
inline G4String G4HnManager::GetHnType() const
|
||||
{ return fHnType; }
|
||||
|
||||
inline const std::vector<G4HnInformation*>& G4HnManager::GetHnVector() const
|
||||
{ return fHnVector; }
|
||||
|
||||
#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: G4HnMessenger.hh 66310 2012-12-17 11:56:35Z ihrivnac $
|
||||
|
||||
// The messenger class for histogram information management.
|
||||
// It implements commands in /analysis/h1 directory.
|
||||
//
|
||||
// Author: Ivana Hrivnacova, 18/06/2013 (ivana@ipno.in2p3.fr)
|
||||
|
||||
#ifndef G4HnMessenger_h
|
||||
#define G4HnMessenger_h 1
|
||||
|
||||
#include "G4UImessenger.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class G4HnManager;
|
||||
class G4UIcommand;
|
||||
class G4UIcmdWithABool;
|
||||
class G4UIcmdWithAnInteger;
|
||||
|
||||
class G4HnMessenger : public G4UImessenger
|
||||
{
|
||||
public:
|
||||
G4HnMessenger(G4HnManager* manager);
|
||||
virtual ~G4HnMessenger();
|
||||
|
||||
// methods
|
||||
virtual void SetNewValue(G4UIcommand* command, G4String value);
|
||||
|
||||
private:
|
||||
G4String GetCmdDirectoryName() const;
|
||||
G4String GetHnDescription() const;
|
||||
void SetHnAsciiCmd();
|
||||
void SetHnActivationCmd();
|
||||
void SetHnActivationToAllCmd();
|
||||
|
||||
G4HnManager* fManager; ///< Associated class
|
||||
|
||||
G4UIcmdWithAnInteger* fSetHnAsciiCmd;
|
||||
G4UIcommand* fSetHnActivationCmd;
|
||||
G4UIcmdWithABool* fSetHnActivationAllCmd;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,300 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4VAnalysisManager.hh 71635 2013-06-19 13:48:28Z ihrivnac $
|
||||
|
||||
// The nonvirtual public interface class to g4tools based analysis.
|
||||
// It is defined as a composite of object manager base classes.
|
||||
// Individual use of the component managers is disabled
|
||||
// (except for file manager and Hn manager which are also used from
|
||||
// other object managers).
|
||||
// The functions which has to be implemented in concrete managers
|
||||
// are declared as virtual protected.
|
||||
|
||||
// Author: Ivana Hrivnacova, 09/07/2013 (ivana@ipno.in2p3.fr)
|
||||
|
||||
#ifndef G4VAnalysisManager_h
|
||||
#define G4VAnalysisManager_h 1
|
||||
|
||||
#include "G4AnalysisManagerState.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
#include <vector>
|
||||
#include <fstream>
|
||||
|
||||
|
||||
class G4AnalysisMessenger;
|
||||
class G4HnManager;
|
||||
class G4VH1Manager;
|
||||
class G4VH2Manager;
|
||||
class G4VNtupleManager;
|
||||
class G4VFileManager;
|
||||
|
||||
class G4VAnalysisManager
|
||||
{
|
||||
public:
|
||||
G4VAnalysisManager(const G4String& type, G4bool isMaster);
|
||||
virtual ~G4VAnalysisManager();
|
||||
|
||||
// Methods for handling files
|
||||
G4bool OpenFile();
|
||||
G4bool OpenFile(const G4String& fileName);
|
||||
G4bool Write();
|
||||
G4bool CloseFile();
|
||||
|
||||
// Methods for handling files and directories names
|
||||
G4bool SetFileName(const G4String& fileName);
|
||||
G4bool SetHistoDirectoryName(const G4String& dirName);
|
||||
G4bool SetNtupleDirectoryName(const G4String& dirName);
|
||||
G4String GetFileName() const;
|
||||
G4String GetHistoDirectoryName() const;
|
||||
G4String GetNtupleDirectoryName() const;
|
||||
|
||||
// Methods for handling histogrammes
|
||||
G4int CreateH1(const G4String& name, const G4String& title,
|
||||
G4int nbins, G4double xmin, G4double xmax,
|
||||
const G4String& unitName = "none",
|
||||
const G4String& fcnName = "none",
|
||||
const G4String& binSchemeName = "linear");
|
||||
|
||||
G4int CreateH1(const G4String& name, const G4String& title,
|
||||
const std::vector<G4double>& edges,
|
||||
const G4String& unitName = "none",
|
||||
const G4String& fcnName = "none");
|
||||
|
||||
G4int CreateH2(const G4String& name, const G4String& title,
|
||||
G4int nxbins, G4double xmin, G4double xmax,
|
||||
G4int nybins, G4double ymin, G4double ymax,
|
||||
const G4String& xunitName = "none",
|
||||
const G4String& yunitName = "none",
|
||||
const G4String& xfcnName = "none",
|
||||
const G4String& yfcnName = "none",
|
||||
const G4String& xbinScheme = "linear",
|
||||
const G4String& ybinScheme = "linear");
|
||||
|
||||
G4int CreateH2(const G4String& name, const G4String& title,
|
||||
const std::vector<G4double>& xedges,
|
||||
const std::vector<G4double>& yedges,
|
||||
const G4String& xunitName = "none",
|
||||
const G4String& yunitName = "none",
|
||||
const G4String& xfcnName = "none",
|
||||
const G4String& yfcnName = "none");
|
||||
|
||||
G4bool SetH1(G4int id,
|
||||
G4int nbins, G4double xmin, G4double xmax,
|
||||
const G4String& unitName = "none",
|
||||
const G4String& fcnName = "none",
|
||||
const G4String& binSchemeName = "linear");
|
||||
|
||||
G4bool SetH1(G4int id,
|
||||
const std::vector<G4double>& edges,
|
||||
const G4String& unitName = "none",
|
||||
const G4String& fcnName = "none");
|
||||
|
||||
G4bool SetH2(G4int id,
|
||||
G4int nxbins, G4double xmin, G4double xmax,
|
||||
G4int nybins, G4double ymin, G4double ymax,
|
||||
const G4String& xunitName = "none",
|
||||
const G4String& yunitName = "none",
|
||||
const G4String& xfcnName = "none",
|
||||
const G4String& yfcnName = "none",
|
||||
const G4String& xbinSchemeName = "linear",
|
||||
const G4String& ybinSchemeName = "linear");
|
||||
|
||||
G4bool SetH2(G4int id,
|
||||
const std::vector<G4double>& xedges,
|
||||
const std::vector<G4double>& yedges,
|
||||
const G4String& xunitName = "none",
|
||||
const G4String& yunitName = "none",
|
||||
const G4String& xfcnName = "none",
|
||||
const G4String& yfcnName = "none");
|
||||
|
||||
G4bool ScaleH1(G4int id, G4double factor);
|
||||
G4bool ScaleH2(G4int id, G4double factor);
|
||||
|
||||
// Methods for handling ntuples
|
||||
G4int CreateNtuple(const G4String& name, const G4String& title);
|
||||
// Create columns in the last created ntuple
|
||||
G4int CreateNtupleIColumn(const G4String& name);
|
||||
G4int CreateNtupleFColumn(const G4String& name);
|
||||
G4int CreateNtupleDColumn(const G4String& name);
|
||||
void FinishNtuple();
|
||||
// Create columns in the ntuple with given id
|
||||
G4int CreateNtupleIColumn(G4int ntupleId, const G4String& name);
|
||||
G4int CreateNtupleFColumn(G4int ntupleId, const G4String& name);
|
||||
G4int CreateNtupleDColumn(G4int ntupleId, const G4String& name);
|
||||
void FinishNtuple(G4int ntupleId);
|
||||
|
||||
// The ids of histograms and ntuples are generated automatically
|
||||
// starting from 0; with following functions it is possible to
|
||||
// change the first Id to start from other value
|
||||
G4bool SetFirstHistoId(G4int firstId);
|
||||
G4bool SetFirstH1Id(G4int firstId);
|
||||
G4bool SetFirstH2Id(G4int firstId);
|
||||
G4bool SetFirstNtupleId(G4int firstId);
|
||||
G4bool SetFirstNtupleColumnId(G4int firstId);
|
||||
|
||||
// Methods to fill histogrammes, ntuples
|
||||
G4bool FillH1(G4int id, G4double value, G4double weight = 1.0);
|
||||
G4bool FillH2(G4int id, G4double xvalue, G4double yvalue,
|
||||
G4double weight = 1.0);
|
||||
// Methods for ntuple with id = FirstNtupleId
|
||||
G4bool FillNtupleIColumn(G4int id, G4int value);
|
||||
G4bool FillNtupleFColumn(G4int id, G4float value);
|
||||
G4bool FillNtupleDColumn(G4int id, G4double value);
|
||||
G4bool AddNtupleRow();
|
||||
// Methods for ntuple with id > FirstNtupleId (when more ntuples exist)
|
||||
G4bool FillNtupleIColumn(G4int ntupleId, G4int columnId, G4int value);
|
||||
G4bool FillNtupleFColumn(G4int ntupleId, G4int columnId, G4float value);
|
||||
G4bool FillNtupleDColumn(G4int ntupleId, G4int columnId, G4double value);
|
||||
G4bool AddNtupleRow(G4int ntupleId);
|
||||
|
||||
// Activation option
|
||||
|
||||
// When this option is enabled, only the histograms marked as activated
|
||||
// are returned, filled or saved on file.
|
||||
// No warning is issued when Get or Fill is called on inactive histogram.
|
||||
void SetActivation(G4bool activation);
|
||||
G4bool GetActivation() const;
|
||||
|
||||
// Return false if activation is enabled and there is no object activated,
|
||||
// return true otherwise
|
||||
G4bool IsActive() const;
|
||||
|
||||
// ASCII option
|
||||
|
||||
// Return false if there is no object selected for ASCII output,
|
||||
// return true otherwise
|
||||
G4bool IsAscii() const;
|
||||
|
||||
// Access methods
|
||||
G4int GetNofH1s() const;
|
||||
G4int GetNofH2s() const;
|
||||
G4int GetNofNtuples() const;
|
||||
|
||||
// Access methods via names
|
||||
G4int GetH1Id(const G4String& name, G4bool warn = true) const;
|
||||
G4int GetH2Id(const G4String& name, G4bool warn = true) const;
|
||||
|
||||
|
||||
// Methods to manipulate additional information
|
||||
void SetH1Activation(G4bool activation);
|
||||
void SetH1Activation(G4int id, G4bool activation);
|
||||
void SetH1Ascii(G4int id, G4bool ascii);
|
||||
void SetH2Activation(G4bool activation);
|
||||
void SetH2Activation(G4int id, G4bool activation);
|
||||
void SetH2Ascii(G4int id, G4bool ascii);
|
||||
|
||||
// Access to H1 parameters
|
||||
G4int GetH1Nbins(G4int id) const;
|
||||
G4double GetH1Xmin(G4int id) const;
|
||||
G4double GetH1Xmax(G4int id) const;
|
||||
G4double GetH1Width(G4int id) const;
|
||||
|
||||
// Access to H2 parameters
|
||||
G4int GetH2Nxbins(G4int id) const;
|
||||
G4double GetH2Xmin(G4int id) const;
|
||||
G4double GetH2Xmax(G4int id) const;
|
||||
G4double GetH2XWidth(G4int id) const;
|
||||
G4int GetH2Nybins(G4int id) const;
|
||||
G4double GetH2Ymin(G4int id) const;
|
||||
G4double GetH2Ymax(G4int id) const;
|
||||
G4double GetH2YWidth(G4int id) const;
|
||||
|
||||
// Access to H1 additional information
|
||||
G4String GetH1Name(G4int id) const;
|
||||
G4double GetH1Unit(G4int id) const;
|
||||
G4bool GetH1Activation(G4int id) const;
|
||||
G4bool GetH1Ascii(G4int id) const;
|
||||
|
||||
// Access to H2 additional information
|
||||
G4String GetH2Name(G4int id) const;
|
||||
G4double GetH2XUnit(G4int id) const;
|
||||
G4double GetH2YUnit(G4int id) const;
|
||||
G4bool GetH2Activation(G4int id) const;
|
||||
G4bool GetH2Ascii(G4int id) const;
|
||||
|
||||
// Setters for attributes for plotting
|
||||
G4bool SetH1Title(G4int id, const G4String& title);
|
||||
G4bool SetH1XAxisTitle(G4int id, const G4String& title);
|
||||
G4bool SetH1YAxisTitle(G4int id, const G4String& title);
|
||||
G4bool SetH2Title(G4int id, const G4String& title);
|
||||
G4bool SetH2XAxisTitle(G4int id, const G4String& title);
|
||||
G4bool SetH2YAxisTitle(G4int id, const G4String& title);
|
||||
G4bool SetH2ZAxisTitle(G4int id, const G4String& title);
|
||||
|
||||
// Access attributes for plotting
|
||||
G4String GetH1Title(G4int id) const;
|
||||
G4String GetH1XAxisTitle(G4int id) const;
|
||||
G4String GetH1YAxisTitle(G4int id) const;
|
||||
G4String GetH2Title(G4int id) const;
|
||||
G4String GetH2XAxisTitle(G4int id) const;
|
||||
G4String GetH2YAxisTitle(G4int id) const;
|
||||
G4String GetH2ZAxisTitle(G4int id) const;
|
||||
|
||||
// Verbosity
|
||||
void SetVerboseLevel(G4int verboseLevel);
|
||||
G4int GetVerboseLevel() const;
|
||||
|
||||
// The manager type (starts with an uppercase letter)
|
||||
G4String GetType() const;
|
||||
// The manager file type (starts with a lowercase letter)
|
||||
G4String GetFileType() const;
|
||||
|
||||
protected:
|
||||
// virtual methods
|
||||
virtual G4bool OpenFileImpl(const G4String& fileName) = 0;
|
||||
virtual G4bool WriteImpl() = 0;
|
||||
virtual G4bool CloseFileImpl() = 0;
|
||||
|
||||
// methods
|
||||
void SetH1Manager(G4VH1Manager* h1Manager);
|
||||
void SetH2Manager(G4VH2Manager* h2Manager);
|
||||
void SetNtupleManager(G4VNtupleManager* ntupleManager);
|
||||
void SetFileManager(G4VFileManager* fileManager);
|
||||
|
||||
// Methods to manipulate additional information
|
||||
G4bool WriteAscii(const G4String& fileName);
|
||||
|
||||
// data members
|
||||
G4AnalysisManagerState fState;
|
||||
|
||||
private:
|
||||
// data members
|
||||
G4AnalysisMessenger* fMessenger;
|
||||
G4HnManager* fH1HnManager;
|
||||
G4HnManager* fH2HnManager;
|
||||
G4VH1Manager* fVH1Manager;
|
||||
G4VH2Manager* fVH2Manager;
|
||||
G4VNtupleManager* fVNtupleManager;
|
||||
G4VFileManager* fVFileManager;
|
||||
};
|
||||
|
||||
// inline functions
|
||||
|
||||
#include "G4VAnalysisManager.icc"
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,400 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4VAnalysisManager.hh 70604 2013-06-03 11:27:06Z ihrivnac $
|
||||
|
||||
#include "G4HnManager.hh"
|
||||
#include "G4VH1Manager.hh"
|
||||
#include "G4VH2Manager.hh"
|
||||
#include "G4VNtupleManager.hh"
|
||||
#include "G4VFileManager.hh"
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
G4bool G4VAnalysisManager::FillH1(G4int id, G4double value, G4double weight)
|
||||
{
|
||||
return fVH1Manager->FillH1(id, value, weight);
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
G4bool G4VAnalysisManager::FillH2(G4int id,
|
||||
G4double xvalue, G4double yvalue,
|
||||
G4double weight)
|
||||
{
|
||||
return fVH2Manager->FillH2(id, xvalue, yvalue, weight);
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
G4bool G4VAnalysisManager::FillNtupleIColumn(G4int columnId, G4int value)
|
||||
{
|
||||
return fVNtupleManager->FillNtupleIColumn(columnId, value);
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
G4bool G4VAnalysisManager::FillNtupleFColumn(G4int columnId, G4float value)
|
||||
{
|
||||
return fVNtupleManager->FillNtupleFColumn(columnId, value);
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
G4bool G4VAnalysisManager::FillNtupleDColumn(G4int columnId, G4double value)
|
||||
{
|
||||
return fVNtupleManager->FillNtupleDColumn(columnId, value);
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
G4bool G4VAnalysisManager::AddNtupleRow()
|
||||
{
|
||||
return fVNtupleManager->AddNtupleRow();
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
G4bool G4VAnalysisManager::FillNtupleIColumn(G4int ntupleId, G4int columnId,
|
||||
G4int value)
|
||||
{
|
||||
return fVNtupleManager->FillNtupleIColumn(ntupleId, columnId, value);
|
||||
}
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
G4bool G4VAnalysisManager::FillNtupleFColumn(G4int ntupleId, G4int columnId,
|
||||
G4float value)
|
||||
{
|
||||
return fVNtupleManager->FillNtupleFColumn(ntupleId, columnId, value);
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
G4bool G4VAnalysisManager::FillNtupleDColumn(G4int ntupleId, G4int columnId,
|
||||
G4double value)
|
||||
{
|
||||
return fVNtupleManager->FillNtupleDColumn(ntupleId, columnId, value);
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
G4bool G4VAnalysisManager::AddNtupleRow(G4int ntupleId)
|
||||
{
|
||||
return fVNtupleManager->AddNtupleRow(ntupleId);
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
G4bool G4VAnalysisManager::GetActivation() const
|
||||
{
|
||||
return fState.GetIsActivation();
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
G4int G4VAnalysisManager::GetH1Id(const G4String& name, G4bool warn) const
|
||||
{
|
||||
return fVH1Manager->GetH1Id(name, warn);
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
G4int G4VAnalysisManager::GetH2Id(const G4String& name, G4bool warn) const
|
||||
{
|
||||
return fVH2Manager->GetH2Id(name, warn);
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
G4int G4VAnalysisManager::GetH1Nbins(G4int id) const
|
||||
{
|
||||
return fVH1Manager->GetH1Nbins(id);
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
G4double G4VAnalysisManager::GetH1Xmin(G4int id) const
|
||||
{
|
||||
// Returns xmin value with applied unit and histogram function
|
||||
|
||||
return fVH1Manager->GetH1Xmin(id);
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
G4double G4VAnalysisManager::GetH1Xmax(G4int id) const
|
||||
{
|
||||
return fVH1Manager->GetH1Xmax(id);
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
G4double G4VAnalysisManager::GetH1Width(G4int id) const
|
||||
{
|
||||
return fVH1Manager->GetH1Width(id);
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
G4int G4VAnalysisManager::GetH2Nxbins(G4int id) const
|
||||
{
|
||||
return fVH2Manager->GetH2Nxbins(id);
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
G4double G4VAnalysisManager::GetH2Xmin(G4int id) const
|
||||
{
|
||||
// Returns xmin value with applied unit and histogram function
|
||||
|
||||
return fVH2Manager->GetH2Xmin(id);
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
G4double G4VAnalysisManager::GetH2Xmax(G4int id) const
|
||||
{
|
||||
return fVH2Manager->GetH2Xmax(id);
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
G4double G4VAnalysisManager::GetH2XWidth(G4int id) const
|
||||
{
|
||||
return fVH2Manager->GetH2XWidth(id);
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
G4int G4VAnalysisManager::GetH2Nybins(G4int id) const
|
||||
{
|
||||
return fVH2Manager->GetH2Nybins(id);
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
G4double G4VAnalysisManager::GetH2Ymin(G4int id) const
|
||||
{
|
||||
// Returns xmin value with applied unit and histogram function
|
||||
|
||||
return fVH2Manager->GetH2Ymin(id);
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
G4double G4VAnalysisManager::GetH2Ymax(G4int id) const
|
||||
{
|
||||
return fVH2Manager->GetH2Ymax(id);
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
G4double G4VAnalysisManager::GetH2YWidth(G4int id) const
|
||||
{
|
||||
return fVH2Manager->GetH2YWidth(id);
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
G4String G4VAnalysisManager::GetH1Name(G4int id) const
|
||||
{
|
||||
return fH1HnManager->GetName(id);
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
G4double G4VAnalysisManager::GetH1Unit(G4int id) const
|
||||
{
|
||||
return fH1HnManager->GetXUnit(id);
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
G4bool G4VAnalysisManager::GetH1Activation(G4int id) const
|
||||
{
|
||||
return fH1HnManager->GetActivation(id);
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
G4bool G4VAnalysisManager::GetH1Ascii(G4int id) const
|
||||
{
|
||||
return fH1HnManager->GetAscii(id);
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
G4String G4VAnalysisManager::GetH2Name(G4int id) const
|
||||
{
|
||||
return fH2HnManager->GetName(id);
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
G4double G4VAnalysisManager::GetH2XUnit(G4int id) const
|
||||
{
|
||||
return fH2HnManager->GetXUnit(id);
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
G4double G4VAnalysisManager::GetH2YUnit(G4int id) const
|
||||
{
|
||||
return fH2HnManager->GetYUnit(id);
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
G4bool G4VAnalysisManager::GetH2Activation(G4int id) const
|
||||
{
|
||||
return fH2HnManager->GetActivation(id);
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
G4bool G4VAnalysisManager::GetH2Ascii(G4int id) const
|
||||
{
|
||||
return fH2HnManager->GetAscii(id);
|
||||
}
|
||||
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
G4bool G4VAnalysisManager::SetH1Title(G4int id, const G4String& title)
|
||||
{
|
||||
return fVH1Manager->SetH1Title(id, title);
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
G4bool G4VAnalysisManager::SetH1XAxisTitle(G4int id, const G4String& title)
|
||||
{
|
||||
return fVH1Manager->SetH1XAxisTitle(id, title);
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
G4bool G4VAnalysisManager::SetH1YAxisTitle(G4int id, const G4String& title)
|
||||
{
|
||||
return fVH1Manager->SetH1YAxisTitle(id, title);
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
G4bool G4VAnalysisManager::SetH2Title(G4int id, const G4String& title)
|
||||
{
|
||||
return fVH2Manager->SetH2Title(id, title);
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
G4bool G4VAnalysisManager::SetH2XAxisTitle(G4int id, const G4String& title)
|
||||
{
|
||||
return fVH2Manager->SetH2XAxisTitle(id, title);
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
G4bool G4VAnalysisManager::SetH2YAxisTitle(G4int id, const G4String& title)
|
||||
{
|
||||
return fVH2Manager->SetH2YAxisTitle(id, title);
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
G4bool G4VAnalysisManager::SetH2ZAxisTitle(G4int id, const G4String& title)
|
||||
{
|
||||
return fVH2Manager->SetH2ZAxisTitle(id, title);
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
G4String G4VAnalysisManager::GetH1Title(G4int id) const
|
||||
{
|
||||
return fVH1Manager->GetH1Title(id);
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
G4String G4VAnalysisManager::GetH1XAxisTitle(G4int id) const
|
||||
{
|
||||
return fVH1Manager->GetH1XAxisTitle(id);
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
G4String G4VAnalysisManager::GetH1YAxisTitle(G4int id) const
|
||||
{
|
||||
return fVH1Manager->GetH1YAxisTitle(id);
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
G4String G4VAnalysisManager::GetH2Title(G4int id) const
|
||||
{
|
||||
return fVH2Manager->GetH2Title(id);
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
G4String G4VAnalysisManager::GetH2XAxisTitle(G4int id) const
|
||||
{
|
||||
return fVH2Manager->GetH2XAxisTitle(id);
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
G4String G4VAnalysisManager::GetH2YAxisTitle(G4int id) const
|
||||
{
|
||||
return fVH2Manager->GetH2YAxisTitle(id);
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
G4String G4VAnalysisManager::GetH2ZAxisTitle(G4int id) const
|
||||
{
|
||||
return fVH2Manager->GetH2ZAxisTitle(id);
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
G4int G4VAnalysisManager::GetVerboseLevel() const
|
||||
{
|
||||
return fState.GetVerboseLevel();
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
G4String G4VAnalysisManager::GetType() const
|
||||
{
|
||||
return fState.GetType();
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
G4String G4VAnalysisManager::GetFileType() const
|
||||
{
|
||||
return fVFileManager->GetFileType();
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4VFileManager.hh 70604 2013-06-03 11:27:06Z ihrivnac $
|
||||
|
||||
// Base class for File manager.
|
||||
//
|
||||
// Author: Ivana Hrivnacova, 18/06/2013 (ivana@ipno.in2p3.fr)
|
||||
|
||||
#ifndef G4VFileManager_h
|
||||
#define G4VFileManager_h 1
|
||||
|
||||
#include "G4BaseAnalysisManager.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class G4VFileManager
|
||||
{
|
||||
public:
|
||||
G4VFileManager(const G4AnalysisManagerState& state);
|
||||
virtual ~G4VFileManager();
|
||||
|
||||
// Methods to manipulate files
|
||||
virtual G4bool OpenFile(const G4String& fileName) = 0;
|
||||
virtual G4bool WriteFile() = 0;
|
||||
virtual G4bool CloseFile() = 0;
|
||||
|
||||
// Methods for handling files and directories names
|
||||
G4bool SetFileName(const G4String& fileName);
|
||||
G4bool SetHistoDirectoryName(const G4String& dirName);
|
||||
G4bool SetNtupleDirectoryName(const G4String& dirName);
|
||||
G4String GetFileName() const;
|
||||
G4String GetFullFileName() const;
|
||||
G4String GetNtupleFileName(const G4String& ntupleName) const;
|
||||
G4String GetHistoDirectoryName() const;
|
||||
G4String GetNtupleDirectoryName() const;
|
||||
|
||||
// The manager file type (starts with a lowercase letter)
|
||||
G4String GetFileType() const;
|
||||
|
||||
protected:
|
||||
// data members
|
||||
const G4AnalysisManagerState& fState;
|
||||
G4String fFileName;
|
||||
G4String fHistoDirectoryName;
|
||||
G4String fNtupleDirectoryName;
|
||||
G4bool fLockFileName;
|
||||
G4bool fLockHistoDirectoryName;
|
||||
G4bool fLockNtupleDirectoryName;
|
||||
};
|
||||
|
||||
// inline functions
|
||||
|
||||
inline G4String G4VFileManager::GetFileName() const {
|
||||
return fFileName;
|
||||
}
|
||||
|
||||
inline G4String G4VFileManager::GetHistoDirectoryName() const {
|
||||
return fHistoDirectoryName;
|
||||
}
|
||||
|
||||
inline G4String G4VFileManager::GetNtupleDirectoryName() const {
|
||||
return fNtupleDirectoryName;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,111 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4VH1Manager.hh 70604 2013-06-03 11:27:06Z ihrivnac $
|
||||
|
||||
// Base class for H1 manager.
|
||||
//
|
||||
// Author: Ivana Hrivnacova, 18/06/2013 (ivana@ipno.in2p3.fr)
|
||||
|
||||
#ifndef G4VH1Manager_h
|
||||
#define G4VH1Manager_h 1
|
||||
|
||||
#include "G4BaseAnalysisManager.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
#include <vector>
|
||||
|
||||
class G4HnManager;
|
||||
class G4AnalysisManagerState;
|
||||
|
||||
class G4VH1Manager : public G4BaseAnalysisManager
|
||||
{
|
||||
// Disable using the object managers outside
|
||||
friend class G4VAnalysisManager;
|
||||
|
||||
protected:
|
||||
G4VH1Manager(const G4AnalysisManagerState& state);
|
||||
virtual ~G4VH1Manager();
|
||||
|
||||
// Methods for handling histogrammes
|
||||
virtual G4int CreateH1(const G4String& name, const G4String& title,
|
||||
G4int nbins, G4double xmin, G4double xmax,
|
||||
const G4String& unitName = "none",
|
||||
const G4String& fcnName = "none",
|
||||
const G4String& binSchemeName = "linear") = 0;
|
||||
virtual G4int CreateH1(const G4String& name, const G4String& title,
|
||||
const std::vector<G4double>& edges,
|
||||
const G4String& unitName = "none",
|
||||
const G4String& fcnName = "none") = 0;
|
||||
|
||||
virtual G4bool SetH1(G4int id,
|
||||
G4int nbins, G4double xmin, G4double xmax,
|
||||
const G4String& unitName = "none",
|
||||
const G4String& fcnName = "none",
|
||||
const G4String& binSchemeName = "linear") = 0;
|
||||
virtual G4bool SetH1(G4int id,
|
||||
const std::vector<G4double>& edges,
|
||||
const G4String& unitName = "none",
|
||||
const G4String& fcnName = "none") = 0;
|
||||
|
||||
virtual G4bool ScaleH1(G4int id, G4double factor) = 0;
|
||||
|
||||
// Methods to fill histograms
|
||||
virtual G4bool FillH1(G4int id, G4double value, G4double weight = 1.0) = 0;
|
||||
|
||||
// Access methods
|
||||
virtual G4int GetH1Id(const G4String& name, G4bool warn = true) const = 0;
|
||||
|
||||
// Access to H1 parameters
|
||||
virtual G4int GetH1Nbins(G4int id) const = 0;
|
||||
virtual G4double GetH1Xmin(G4int id) const = 0;
|
||||
virtual G4double GetH1Xmax(G4int id) const = 0;
|
||||
virtual G4double GetH1Width(G4int id) const = 0;
|
||||
|
||||
// Setters for attributes for plotting
|
||||
virtual G4bool SetH1Title(G4int id, const G4String& title) = 0;
|
||||
virtual G4bool SetH1XAxisTitle(G4int id, const G4String& title) = 0;
|
||||
virtual G4bool SetH1YAxisTitle(G4int id, const G4String& title) = 0;
|
||||
|
||||
// Access attributes for plotting
|
||||
virtual G4String GetH1Title(G4int id) const = 0;
|
||||
virtual G4String GetH1XAxisTitle(G4int id) const = 0;
|
||||
virtual G4String GetH1YAxisTitle(G4int id) const = 0;
|
||||
|
||||
// Methods to manipulate histograms
|
||||
virtual G4bool WriteOnAscii(std::ofstream& output) = 0;
|
||||
|
||||
// data members
|
||||
G4HnManager* fHnManager;
|
||||
|
||||
private:
|
||||
// Not implemented copy constructor
|
||||
G4VH1Manager(const G4VH1Manager& rhs);
|
||||
// Not implemented assignment operator
|
||||
G4VH1Manager& operator=(const G4VH1Manager& rhs);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,132 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4VH2Manager.hh 70604 2013-06-03 11:27:06Z ihrivnac $
|
||||
|
||||
// Base class for H2 manager.
|
||||
//
|
||||
// Author: Ivana Hrivnacova, 18/06/2013 (ivana@ipno.in2p3.fr)
|
||||
|
||||
#ifndef G4VH2Manager_h
|
||||
#define G4VH2Manager_h 1
|
||||
|
||||
#include "G4BaseAnalysisManager.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class G4HnManager;
|
||||
class G4AnalysisManagerState;
|
||||
|
||||
class G4VH2Manager : public G4BaseAnalysisManager
|
||||
{
|
||||
// Disable using the object managers outside G4VAnalysisManager
|
||||
friend class G4VAnalysisManager;
|
||||
|
||||
protected:
|
||||
G4VH2Manager(const G4AnalysisManagerState& state);
|
||||
virtual ~G4VH2Manager();
|
||||
|
||||
// Methods for handling histogrammes
|
||||
virtual G4int CreateH2(const G4String& name, const G4String& title,
|
||||
G4int nxbins, G4double xmin, G4double xmax,
|
||||
G4int nybins, G4double ymin, G4double ymax,
|
||||
const G4String& xunitName = "none",
|
||||
const G4String& yunitName = "none",
|
||||
const G4String& xfcnName = "none",
|
||||
const G4String& yfcnName = "none",
|
||||
const G4String& xbinScheme = "linear",
|
||||
const G4String& ybinScheme = "linear") = 0;
|
||||
|
||||
virtual G4int CreateH2(const G4String& name, const G4String& title,
|
||||
const std::vector<G4double>& xedges,
|
||||
const std::vector<G4double>& yedges,
|
||||
const G4String& xunitName = "none",
|
||||
const G4String& yunitName = "none",
|
||||
const G4String& xfcnName = "none",
|
||||
const G4String& yfcnName = "none") = 0;
|
||||
|
||||
virtual G4bool SetH2(G4int id,
|
||||
G4int nxbins, G4double xmin, G4double xmax,
|
||||
G4int nybins, G4double ymin, G4double ymax,
|
||||
const G4String& xunitName = "none",
|
||||
const G4String& yunitName = "none",
|
||||
const G4String& xfcnName = "none",
|
||||
const G4String& yfcnName = "none",
|
||||
const G4String& xbinScheme = "linear",
|
||||
const G4String& ybinScheme = "linear") = 0;
|
||||
|
||||
virtual G4bool SetH2(G4int id,
|
||||
const std::vector<G4double>& xedges,
|
||||
const std::vector<G4double>& yedges,
|
||||
const G4String& xunitName = "none",
|
||||
const G4String& yunitName = "none",
|
||||
const G4String& xfcnName = "none",
|
||||
const G4String& yfcnName = "none") = 0;
|
||||
|
||||
virtual G4bool ScaleH2(G4int id, G4double factor) = 0;
|
||||
|
||||
// Methods to fill histograms
|
||||
virtual G4bool FillH2(G4int id, G4double xvalue, G4double yvalue,
|
||||
G4double weight = 1.0) = 0;
|
||||
|
||||
// Access methods
|
||||
virtual G4int GetH2Id(const G4String& name, G4bool warn = true) const = 0;
|
||||
|
||||
// Access to H2 parameters
|
||||
virtual G4int GetH2Nxbins(G4int id) const = 0;
|
||||
virtual G4double GetH2Xmin(G4int id) const = 0;
|
||||
virtual G4double GetH2Xmax(G4int id) const = 0;
|
||||
virtual G4double GetH2XWidth(G4int id) const = 0;
|
||||
virtual G4int GetH2Nybins(G4int id) const = 0;
|
||||
virtual G4double GetH2Ymin(G4int id) const = 0;
|
||||
virtual G4double GetH2Ymax(G4int id) const = 0;
|
||||
virtual G4double GetH2YWidth(G4int id) const = 0;
|
||||
|
||||
// Setters for attributes for plotting
|
||||
virtual G4bool SetH2Title(G4int id, const G4String& title) = 0;
|
||||
virtual G4bool SetH2XAxisTitle(G4int id, const G4String& title) = 0;
|
||||
virtual G4bool SetH2YAxisTitle(G4int id, const G4String& title) = 0;
|
||||
virtual G4bool SetH2ZAxisTitle(G4int id, const G4String& title) = 0;
|
||||
|
||||
// Access attributes for plotting
|
||||
virtual G4String GetH2Title(G4int id) const = 0;
|
||||
virtual G4String GetH2XAxisTitle(G4int id) const = 0;
|
||||
virtual G4String GetH2YAxisTitle(G4int id) const = 0;
|
||||
virtual G4String GetH2ZAxisTitle(G4int id) const = 0;
|
||||
|
||||
// Methods to manipulate histograms
|
||||
virtual G4bool WriteOnAscii(std::ofstream& output) = 0;
|
||||
|
||||
// data members
|
||||
G4HnManager* fHnManager;
|
||||
|
||||
private:
|
||||
// Not implemented copy constructor
|
||||
G4VH2Manager(const G4VH2Manager& rhs);
|
||||
// Not implemented assignment operator
|
||||
G4VH2Manager& operator=(const G4VH2Manager& rhs);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,90 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4VNtupleManager.hh 70604 2013-06-03 11:27:06Z ihrivnac $
|
||||
|
||||
// Base class for Ntuple manager.
|
||||
// It defines functions independent from the output type.
|
||||
//
|
||||
// Author: Ivana Hrivnacova, 18/06/2013 (ivana@ipno.in2p3.fr)
|
||||
|
||||
#ifndef G4VNtupleManager_h
|
||||
#define G4VNtupleManager_h 1
|
||||
|
||||
#include "G4BaseAnalysisManager.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
#include <vector>
|
||||
|
||||
class G4VNtupleManager : public G4BaseAnalysisManager
|
||||
{
|
||||
// Disable using the object managers outside G4VAnalysisManager and
|
||||
// its messenger
|
||||
friend class G4VAnalysisManager;
|
||||
|
||||
protected:
|
||||
G4VNtupleManager(const G4AnalysisManagerState& state);
|
||||
virtual ~G4VNtupleManager();
|
||||
|
||||
// Methods for handling ntuples
|
||||
virtual G4int CreateNtuple(const G4String& name, const G4String& title) = 0;
|
||||
// Create columns in the last created ntuple
|
||||
virtual G4int CreateNtupleIColumn(const G4String& name) = 0;
|
||||
virtual G4int CreateNtupleFColumn(const G4String& name) = 0;
|
||||
virtual G4int CreateNtupleDColumn(const G4String& name) = 0;
|
||||
virtual void FinishNtuple() = 0;
|
||||
// Create columns in the ntuple with given id
|
||||
virtual G4int CreateNtupleIColumn(G4int ntupleId, const G4String& name) = 0;
|
||||
virtual G4int CreateNtupleFColumn(G4int ntupleId, const G4String& name) = 0;
|
||||
virtual G4int CreateNtupleDColumn(G4int ntupleId, const G4String& name) = 0;
|
||||
virtual void FinishNtuple(G4int ntupleId) = 0;
|
||||
|
||||
// The ntuple column ids are generated automatically starting from 0;
|
||||
// with the following function it is possible to change it
|
||||
// to start from another value
|
||||
G4bool SetFirstNtupleColumnId(G4int firstId);
|
||||
|
||||
// Methods to fill histogrammes, ntuples
|
||||
// Methods for ntuple with id = FirstNtupleId
|
||||
virtual G4bool FillNtupleIColumn(G4int id, G4int value) = 0;
|
||||
virtual G4bool FillNtupleFColumn(G4int id, G4float value) = 0;
|
||||
virtual G4bool FillNtupleDColumn(G4int id, G4double value) = 0;
|
||||
virtual G4bool AddNtupleRow() = 0;
|
||||
// Methods for ntuple with id > FirstNtupleId (when more ntuples exist)
|
||||
virtual G4bool FillNtupleIColumn(G4int ntupleId, G4int columnId, G4int value) = 0;
|
||||
virtual G4bool FillNtupleFColumn(G4int ntupleId, G4int columnId, G4float value) = 0;
|
||||
virtual G4bool FillNtupleDColumn(G4int ntupleId, G4int columnId, G4double value) = 0;
|
||||
virtual G4bool AddNtupleRow(G4int ntupleId) = 0;
|
||||
|
||||
// Access methods
|
||||
virtual G4int GetNofNtuples() const = 0;
|
||||
|
||||
protected:
|
||||
G4int fFirstNtupleColumnId;
|
||||
G4bool fLockFirstNtupleColumnId;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: g4analysis_defs.hh 72292 2013-07-15 12:01:43Z ihrivnac $
|
||||
|
||||
// Author: Ivana Hrivnacova, 15/06/2011 (ivana@ipno.in2p3.fr)
|
||||
|
||||
#ifndef g4analysis_defs_h
|
||||
#define g4analysis_defs_h
|
||||
|
||||
#include "g4csv_defs.hh"
|
||||
#include "g4xml_defs.hh"
|
||||
#include "g4root_defs.hh"
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user