MarlinTPC
1.2.0
|
This provides some tools on handling the xml file used to store information on the Photoelectric analysis. More...
#include <PhotoelectricXMLHelper.h>
Public Member Functions | |
PhotoelectricXMLFile (std::string xmlFile) | |
Constructor expecting a xml file with the true photodot positions stored as follows: More... | |
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. More... | |
std::vector< std::vector < Photodot >::const_iterator > | GetPhotodots () |
Photodots are sorted by the index found in the xml file. More... | |
std::vector< std::vector < Photoline >::const_iterator > | GetPhotolines () |
Photodots are sorted by the index found in the xml file. More... | |
void | SetTimeInfo (float start, float end) |
This adds the time information to the xml file. More... | |
bool | GetTimeInfo (float &start, float &end) |
This reads the time information from the xml file. More... | |
void | SaveFile (std::string fileName) |
Save the internal xml file. More... | |
gear::TiXmlElement * | GetPhotoElectricElement () |
This return the main element in the xml file. More... | |
void | AddPhotodotProjection (int photodot_id, const CLHEP::Hep2Vector centroid, const std::set< gear::GlobalPadIndex > &pads) |
Add information about the associated pads to a photodot. More... | |
void | AddPhotodotProjection (const CLHEP::Hep2Vector centroid, const std::set< gear::GlobalPadIndex > &pads) |
Add information about pads in a cluster not connected to a photodot. More... | |
std::map< int, std::set < gear::GlobalPadIndex > > | GetPhotodotPads () |
Get pads associated to each photodot. More... | |
std::map< int, std::set < gear::GlobalPadIndex > > | GetPhotolinePads () |
Get pads associated to each photoline. More... | |
void | AddPhotolineProjection (int module_id, const std::set< gear::GlobalPadIndex > &pads) |
Add pads associated to each photoline. More... | |
This provides some tools on handling the xml file used to store information on the Photoelectric analysis.
Up to now it allows to:
PhotoelectricXMLFile::PhotoelectricXMLFile | ( | std::string | xmlFile | ) |
Constructor expecting a xml file with the true photodot positions stored as follows:
xmlFile | Photodot file name including the path |
void marlintpc::PhotoelectricXMLFile::AddPhotodotProjection | ( | int | photodot_id, |
const CLHEP::Hep2Vector | centroid, | ||
const std::set< gear::GlobalPadIndex > & | pads | ||
) |
Add information about the associated pads to a photodot.
void marlintpc::PhotoelectricXMLFile::AddPhotodotProjection | ( | const CLHEP::Hep2Vector | centroid, |
const std::set< gear::GlobalPadIndex > & | pads | ||
) |
Add information about pads in a cluster not connected to a photodot.
void PhotoelectricXMLFile::AddPhotolineProjection | ( | int | module_id, |
const std::set< gear::GlobalPadIndex > & | pads | ||
) |
Add pads associated to each photoline.
module_id | Give the module where the line belongs to. |
pads | Global pad indices of the associated pads. |
std::map< int, std::set< gear::GlobalPadIndex > > PhotoelectricXMLFile::GetPhotodotPads | ( | ) |
Get pads associated to each photodot.
If no pads are associated the set size is 0.
vector< vector< Photodot >::const_iterator > PhotoelectricXMLFile::GetPhotodots | ( | ) |
Photodots are sorted by the index found in the xml file.
Referenced by marlintpc::PhotoelectricPulseProcessor::init().
gear::TiXmlElement * PhotoelectricXMLFile::GetPhotoElectricElement | ( | ) |
This return the main element in the xml file.
It can be used to add additional information to the main (photoelectric_geometry) element.
std::map< int, std::set< gear::GlobalPadIndex > > PhotoelectricXMLFile::GetPhotolinePads | ( | ) |
Get pads associated to each photoline.
If no pads are associated the set size is 0.
vector< vector< Photoline >::const_iterator > PhotoelectricXMLFile::GetPhotolines | ( | ) |
Photodots are sorted by the index found in the xml file.
Referenced by marlintpc::PhotoelectricPulseProcessor::init().
vector< pair< double, vector< Photodot >::const_iterator > > PhotoelectricXMLFile::GetSortedPhotodots | ( | double | center_x, |
double | center_y | ||
) |
This methods sorts the photodots from the photodot file.
The distance to the given point (center_x,center_y) is calculated and than all dots are sorted by this distance. Shortest distance is at the beginning. The corresponding dot should be used to assign the clusters to the true position. This assumes that the distortions of the magnetic field are minimal in the center of the magnet/the given point.
center_x | x coordinate of the point with the most homogeneous magnetic field |
center_y | y coordinate of the point with the most homogeneous magnetic field |
bool PhotoelectricXMLFile::GetTimeInfo | ( | float & | start, |
float & | end | ||
) |
This reads the time information from the xml file.
Expected xml format:
start | The start time. |
end | The end time. |
|
inline |
Save the internal xml file.
It consists of the information from the original photodot file and possibly additional information (pulse time cut, cluster connected to each dot,...).
fileName | The file name of the xml file including the path. |
void PhotoelectricXMLFile::SetTimeInfo | ( | float | start, |
float | end | ||
) |
This adds the time information to the xml file.
This can be later on be used by processors to apply a time cut on pulses to reduce noise pulses. Will look like this:
start | The start time. |
end | The end time. |