LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
molecule.C File Reference
#include <iostream>
#include "TROOT.h"
#include "../dnadamage1/include/DNAVolumeType.hh"

Go to the source code of this file.

Classes

class  ThreeVector< T >
 
class  Molecule
 

Functions

 ClassImp (ThreeVector)
 
 ClassImp (Molecule)
 
std::vector< Moleculemolecule ()
 

Function Documentation

ClassImp ( ThreeVector  )
ClassImp ( Molecule  )
std::vector<Molecule> molecule ( )

Definition at line 87 of file molecule.C.

References file, fMolecules, util::size(), x, y, and z.

88 {
89  std::vector<Molecule> fMolecules;
90  double size;
91  string name;
92  ifstream file("VoxelStraight.fab2g4dna");
93  if(!file.is_open())
94  {
95  string msg ="VoxelStraight.fab2g4dna could not be opened";
96  throw std::invalid_argument(msg);
97  }
98 
99  string line;
100  while(getline(file, line) )
101  {
102  if(line.empty())
103  {
104  continue;
105  }
106 
107  istringstream issLine(line);
108  string firstItem;
109  issLine >> firstItem;
110  if("_Size" == firstItem)
111  {
112  issLine >> size;
113  }
114  else if("_pl" == firstItem)
115  {
116  string name;
117  issLine >> name;
118 
119  string material;
120  issLine >> material;
121 
122  int strand;
123  issLine >> strand;
124 
125  int copyNumber;
126  issLine >> copyNumber;
127 
128  double x;
129  issLine >> x;
130 
131  double y;
132  issLine >> y;
133 
134  double z;
135  issLine >> z;
136 
137  Molecule molecule(name,
138  copyNumber,
139  ThreeVector<double>(x, y, z),
140  strand);
141  fMolecules.push_back(molecule);
142  }
143  }
144  file.close();
145 
146  return fMolecules;
147 }
Float_t x
Definition: compare.C:6
Float_t y
Definition: compare.C:6
Double_t z
Definition: plot.C:276
vector< Molecule > fMolecules
Definition: plot.C:17
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
Definition: StdUtils.h:101
TFile * file
std::vector< Molecule > molecule()
Definition: molecule.C:87