File indexing completed on 2025-01-31 09:21:59
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031 #ifndef ScanDamage_h
0032 #define ScanDamage_h
0033
0034 #include <map>
0035 #include <vector>
0036 #include <string>
0037 #include <tuple>
0038 #include <set>
0039 #include "Damage.hh"
0040 #include <filesystem>
0041 namespace fs = std::filesystem;
0042 class TFile;
0043 using ullint = unsigned long long int;
0044
0045
0046 struct VoxelData
0047 {
0048 VoxelData(int chromo, int domain, ullint firstBpCN)
0049 {
0050 fChromosome = chromo;
0051 fDomain = domain;
0052 fFirstBpCopyNum = firstBpCN;
0053 }
0054
0055 ~VoxelData() {}
0056
0057 int fChromosome{0};
0058 int fDomain{0};
0059 ullint fFirstBpCopyNum{0};
0060 };
0061
0062
0063
0064 typedef std::vector<std::vector<ullint> > Table;
0065
0066
0067
0068 class Trier {
0069 public:
0070 bool operator()(const std::vector<ullint>& a, const std::vector<ullint>& b)
0071 {
0072 bool bb = false;
0073 if(a[0] < b[0]) bb = true;
0074 return bb;
0075 }
0076 };
0077
0078
0079
0080 class ScanDamage
0081 {
0082 public:
0083 ScanDamage();
0084 ~ScanDamage() = default;
0085 std::map<unsigned int,std::map<unsigned int,std::vector<Damage> > > ExtractDamage();
0086 void SetThresholdEnergy(double e) {fThresholdEnergy = e;}
0087 void SetProbabilityForIndirectSBSelection(double p) {fProbabilityForIndirectSB = p;}
0088 double GetThresholdEnergy() {return fThresholdEnergy;}
0089 double GetProbabilityForIndirectSBSelection() {return fProbabilityForIndirectSB;}
0090 std::map<int, Table> GetMergedSBData() {return fMergedTables;}
0091 double GetEdepSumInNucleus() {return fEdepSumInNucleus;}
0092 double GetTotalNbBpPlacedInGeo() {return fTotalNbBpPlacedInGeo;}
0093 double GetTotalNbHistonePlacedInGeo() {return fTotalNbHistonePlacedInGeo;}
0094 double GetNucleusVolume() {return fNucleusVolume;}
0095 double GetNucleusMassDensity() {return fNucleusMassDensity;}
0096 double GetNucleusMass() {return fNucleusMass;}
0097 std::map<int,ullint> GetChromosomeBpSizesMap() {return fChromosomeBpMap;}
0098 void SkipScanningIndirectDamage() {fSkipScanningIndirectDamage = true;}
0099 bool SkippedScanningIndirectDamage() {return fSkipScanningIndirectDamage;}
0100 private:
0101 void ScanDamageFromPhys();
0102 void ScanDamageFromChem();
0103 void RetrieveVoxelBp();
0104 void FillVoxelData();
0105 void AnaPhysRootFile(const std::string fileName);
0106 void AnaChemRootFile(fs::directory_entry entry);
0107 void AnaPhysRootTree1(TFile*);
0108 void AnaPhysRootTree2(TFile*);
0109 void SortPhysTableWithSelection();
0110 void SortChemTableWithSelection();
0111 void ReadCellandVoxelDefFilePaths();
0112 void MergeDamageFromPhysChem();
0113 std::tuple<unsigned int, unsigned int> GetEventNberAndVoxelNberFromChemRoot(const std::string fileNam);
0114 double fThresholdEnergy{17.5};
0115 std::string fCellDefFilePath{""};
0116 std::set<std::string> fVoxelDefFilesList;
0117 std::map<std::string, int> fBpPerVoxel;
0118 std::vector<VoxelData> fVoxels;
0119 std::map<int, Table> fphysTables, fphysSlectedTables, fchemTables, fchemSlectedTables,fMergedTables;
0120 std::map<unsigned int,std::map<unsigned int,std::vector<Damage> > > fDamage;
0121 double fEdepSumInNucleus{0};
0122 int corruptedFiles = 0;
0123 double fTotalNbBpPlacedInGeo{0};
0124 double fTotalNbHistonePlacedInGeo{0};
0125 double fNucleusVolume{0};
0126 double fNucleusMassDensity{0};
0127 double fNucleusMass{0};
0128 double fProbabilityForIndirectSB{0.4};
0129 std::map<int,ullint> fChromosomeBpMap;
0130 bool fSkipScanningIndirectDamage{false};
0131 };
0132
0133
0134
0135 #endif
0136
0137