ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ClusteringAlgo.hh
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file ClusteringAlgo.hh
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 // This example is provided by the Geant4-DNA collaboration
27 // Any report or published results obtained using the Geant4-DNA software
28 // shall cite the following Geant4-DNA collaboration publication:
29 // Med. Phys. 37 (2010) 4692-4708
30 // The Geant4-DNA web site is available at http://geant4-dna.org
31 //
32 // Authors: Henri Payno and Yann Perrot
33 //
34 //
37 
38 #ifndef ClusteringAlgo_H
39 #define ClusteringAlgo_H 1
40 
41 #include "ClusterSBPoints.hh"
42 #include "SBPoint.hh"
43 
44 #include <map>
45 
47 
49 {
50 public:
51 
52  ClusteringAlgo(G4double pEps, G4int pMinPts, G4double pSPointsProb,
53  G4double pEMinDamage, G4double pEMaxDamage);
55 
56  // Get Set methods
58  {
59  return fEps;
60  };
61  void SetEps(G4double val)
62  {
63  fEps=val;
64  };
66  {
67  return fMinPts;
68  };
69  void SetMinPts(G4int val)
70  {
71  fMinPts=val;
72  };
74  {
75  return fSPointsProb;
76  };
78  {
79  fSPointsProb=val;
80  };
82  {
83  return fEMinDamage;
84  };
86  {
87  fEMinDamage=val;
88  };
90  {
91  return fEMaxDamage;
92  };
94  {
95  fEMaxDamage=val;
96  };
97 
98  // Register a damage (position, edep)
100 
101  // Clustering Algorithm
102  std::map<G4int,G4int> RunClustering();
103 
104  // Clean all data structures
105  void Purge();
106 
107  // Return the number of simple break
108  G4int GetSSB() const;
109  // Return the number of complex simple break
110  G4int GetComplexSSB() const;
111  // Return the number of double strand break
112  G4int GetDSB() const;
113  // Return a map representing cluster size distribution
114  // first G4int : cluster size (1 = SSB)
115  // second G4int : counts
116  std::map<G4int,G4int> GetClusterSizeDistribution();
117 
118 private:
119 
120  // Functions to check if SB candidate
123  // Check if a SB point can be merged to a cluster, and do it
124  bool FindCluster(SBPoint* pPt);
125  // Check if two points can be merged
127  // Merge clusters
128  void MergeClusters();
129  // Add SSB to clusters
131 
132  // Parameters to run clustering algorithm
133  G4double fEps; // distance to merge SBPoints
134  G4int fMinPts; // number of SBPoints to create a cluster
135  G4double fSPointsProb; // probability for a point to be in the sensitive area
136  G4double fEMinDamage; // min energy to create a damage
137  G4double fEMaxDamage; // energy to have a probability to create a damage = 1
138 
139  // Data structure containing all SB points
140  std::vector<SBPoint*> fpSetOfPoints;
141  // Datya structure containing all clusters
142  std::vector<ClusterSBPoints*> fpClusters;
143  // ID of the next SB point
144  unsigned int fNextSBPointID;
145 
147 
148 };
149 
150 #endif
151