1 #ifndef PHOTOELECTRICXMLHELPER_H
2 #define PHOTOELECTRICXMLHELPER_H 1
5 #include <CLHEP/Vector/TwoVector.h>
8 #include <gearxml/tinyxml.h>
9 #include <gear/TPCParameters.h>
34 CLHEP::Hep2Vector _position;
38 gear::TiXmlElement* _element;
46 CLHEP::Hep2Vector _start;
47 CLHEP::Hep2Vector _end;
50 gear::TiXmlElement* _element;
51 bool operator== (
Photoline a){
return a._module == _module;}
56 gear::TiXmlDocument _photodotFile;
64 std::vector<Photodot> _photodots;
71 std::vector<Photoline> _photolines;
75 static bool Comparison(std::pair<
double, std::vector<Photodot>::const_iterator> i, std::pair<
double, std::vector<Photodot>::const_iterator> j);
79 void AddPhotodotProjection(gear::TiXmlElement* element,
const CLHEP::Hep2Vector centroid,
const std::set<gear::GlobalPadIndex> &pads);
84 bool FillPhotodotInformation();
89 bool FillPhotolineInformation();
117 std::vector<std::pair<double, std::vector<Photodot>::const_iterator> >
GetSortedPhotodots(
double center_x,
double center_y);
123 std::vector<std::vector<Photodot>::const_iterator>
GetPhotodots();
129 std::vector<std::vector<Photoline>::const_iterator>
GetPhotolines();
161 void SaveFile(std::string fileName){_photodotFile.SaveFile(fileName);};
185 void AddPhotodotProjection(
int photodot_id,
const CLHEP::Hep2Vector centroid,
const std::set<gear::GlobalPadIndex> &pads);
197 void AddPhotodotProjection(
const CLHEP::Hep2Vector centroid,
const std::set<gear::GlobalPadIndex> &pads);
Definition: PhotoelectricXMLHelper.h:33
bool operator==(Photodot a)
Used to find a certain photodot by id.
Definition: PhotoelectricXMLHelper.h:42
void AddPhotolineProjection(int module_id, const std::set< gear::GlobalPadIndex > &pads)
Add pads associated to each photoline.
Definition: PhotoelectricXMLHelper.cc:204
gear::TiXmlElement * GetPhotoElectricElement()
This return the main element in the xml file.
Definition: PhotoelectricXMLHelper.cc:161
std::map< int, std::set< gear::GlobalPadIndex > > GetPhotodotPads()
Get pads associated to each photodot.
Definition: PhotoelectricXMLHelper.cc:226
std::vector< std::vector< Photoline >::const_iterator > GetPhotolines()
Photodots are sorted by the index found in the xml file.
Definition: PhotoelectricXMLHelper.cc:129
void SetTimeInfo(float start, float end)
This adds the time information to the xml file.
Definition: PhotoelectricXMLHelper.cc:141
Definition: PhotoelectricXMLHelper.h:45
std::vector< std::vector< Photodot >::const_iterator > GetPhotodots()
Photodots are sorted by the index found in the xml file.
Definition: PhotoelectricXMLHelper.cc:121
void SaveFile(std::string fileName)
Save the internal xml file.
Definition: PhotoelectricXMLHelper.h:161
PhotoelectricXMLFile(std::string xmlFile)
Constructor expecting a xml file with the true photodot positions stored as follows: ...
Definition: PhotoelectricXMLHelper.cc:18
std::map< int, std::set< gear::GlobalPadIndex > > GetPhotolinePads()
Get pads associated to each photoline.
Definition: PhotoelectricXMLHelper.cc:265
bool GetTimeInfo(float &start, float &end)
This reads the time information from the xml file.
Definition: PhotoelectricXMLHelper.cc:150
This provides some tools on handling the xml file used to store information on the Photoelectric anal...
Definition: PhotoelectricXMLHelper.h:54
std::vector< std::pair< double, std::vector< Photodot >::const_iterator > > GetSortedPhotodots(double center_x, double center_y)
This methods sorts the photodots from the photodot file.
Definition: PhotoelectricXMLHelper.cc:110