Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-23 09:21:51

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 // This example is provided by the Geant4-DNA collaboration
0027 // Any report or published results obtained using the Geant4-DNA software
0028 // shall cite the following Geant4-DNA collaboration publication:
0029 // Med. Phys. 37 (2010) 4692-4708
0030 // The Geant4-DNA web site is available at http://geant4-dna.org
0031 //
0032 // Authors: Henri Payno and Yann Perrot
0033 //
0034 //
0035 /// \file ClusteringAlgo.hh
0036 /// \brief Definition of the ClustreringAlgo class
0037 
0038 #ifndef ClusteringAlgo_H
0039 #define ClusteringAlgo_H 1
0040 
0041 #include "ClusterSBPoints.hh"
0042 #include "SBPoint.hh"
0043 
0044 #include <map>
0045 
0046 class ClusteringAlgoMessenger;
0047 
0048 class ClusteringAlgo
0049 {
0050   public:
0051     ClusteringAlgo(G4double pEps, G4int pMinPts, G4double pSPointsProb, G4double pEMinDamage,
0052                    G4double pEMaxDamage);
0053     ~ClusteringAlgo();
0054 
0055     // Get Set methods
0056     G4double GetEps() { return fEps; };
0057     void SetEps(G4double val) { fEps = val; };
0058     G4int GetMinPts() { return fMinPts; };
0059     void SetMinPts(G4int val) { fMinPts = val; };
0060     G4double GetSPointsProb() { return fSPointsProb; };
0061     void SetSPointsProb(G4double val) { fSPointsProb = val; };
0062     G4double GetEMinDamage() { return fEMinDamage; };
0063     void SetEMinDamage(G4double val) { fEMinDamage = val; };
0064     G4double GetEMaxDamage() { return fEMaxDamage; };
0065     void SetEMaxDamage(G4double val) { fEMaxDamage = val; };
0066 
0067     // Register a damage (position, edep)
0068     void RegisterDamage(G4ThreeVector, G4double);
0069 
0070     // Clustering Algorithm
0071     std::map<G4int, G4int> RunClustering();
0072 
0073     // Clean all data structures
0074     void Purge();
0075 
0076     // Return the number of simple break
0077     G4int GetSSB() const;
0078     // Return the number of complex simple break
0079     G4int GetComplexSSB() const;
0080     // Return the number of double strand break
0081     G4int GetDSB() const;
0082     // Return a map representing cluster size distribution
0083     // first G4int : cluster size (1 = SSB)
0084     // second G4int : counts
0085     std::map<G4int, G4int> GetClusterSizeDistribution();
0086 
0087   private:
0088     // Functions to check if SB candidate
0089     G4bool IsInSensitiveArea();
0090     G4bool IsEdepSufficient(G4double);
0091     // Check if a SB point can be merged to a cluster, and do it
0092     bool FindCluster(SBPoint* pPt);
0093     // Check if two points can be merged
0094     bool AreOnTheSameCluster(G4ThreeVector, G4ThreeVector, G4double);
0095     // Merge clusters
0096     void MergeClusters();
0097     // Add SSB to clusters
0098     void IncludeUnassociatedPoints();
0099 
0100     // Parameters to run clustering algorithm
0101     G4double fEps;  // distance to merge SBPoints
0102     G4int fMinPts;  // number of SBPoints to create a cluster
0103     G4double fSPointsProb;  // probability for a point to be in the sensitive area
0104     G4double fEMinDamage;  // min energy to create a damage
0105     G4double fEMaxDamage;  // energy to have a probability to create a damage = 1
0106 
0107     // Data structure containing all SB points
0108     std::vector<SBPoint*> fpSetOfPoints;
0109     // Datya structure containing all clusters
0110     std::vector<ClusterSBPoints*> fpClusters;
0111     // ID of the next SB point
0112     unsigned int fNextSBPointID;
0113 
0114     ClusteringAlgoMessenger* fpClustAlgoMessenger;
0115 };
0116 
0117 #endif