25 #ifndef WFILTERPROPERTYHANDLER_H
26 #define WFILTERPROPERTYHANDLER_H
32 #include <boost/bimap.hpp>
33 #include <boost/lexical_cast.hpp>
35 #include "../WProtonData.h"
36 #include "../WSingleSelectorName.h"
37 #include "WColumnPropertyHandler.h"
38 #include "core/common/WPathHelper.h"
50 typedef std::shared_ptr< WFilterPropertyHandler >
SPtr;
60 typedef boost::bimap< std::string, int >
BM_PDG;
Creates, updates and handles the filter properties.
WPropBool getShowSecondaries()
Getter.
void createCheckBoxForPrimaryAndSecondary()
Create the Checkbox for primaries and secondaries.
BM_PDG m_PdgNamesByID
A Map of the PDG and their names.
WPropTrigger m_saveButton
A trigger for the save button to save changes.
WPropBool getShowPrimaries()
Getter.
void createPDGMap(std::string path)
creates a bimap out of the names and ids of PDG txt
std::string getParticleNameFilePath()
WPropBool m_showPrimaries
Decides whether to hide or show primaries.
void createMultiSelectionForPDG()
Create the multiselection for the option of PDG.
void writePdgMapInParticleNameFile()
write the BiMap in the Pdg particle name file
WPropSelection m_multiSelection
Stores users selected items.
WPropGroup m_filteringsubGroup
Stores subgroup for change the pdg-Name.
void updateProperty()
update current group property and subproperty
WPropSelection m_PdgForRenameSelection
A property to select one pdg to change.
boost::function< void() > CallbackPtr
shared_ptr that points to itself
boost::bimap< std::string, int > BM_PDG
bimap to save the pdg to a particlename
WFilterPropertyHandler::CallbackPtr m_dataUpdate
A function variable that reinitializes the WDataSets.
WFilterPropertyHandler(WProtonData::SPtr protonData, WPropertyGroup::SPtr properties, WFilterPropertyHandler::CallbackPtr dataUpdate)
constructor
void createProperties()
creates the group property and the subproperty
std::string setDefaultForRenameField()
Set the default string for the string property textfield.
int getPdgFromName(std::string particleName)
Search the pdg in the map with a given particlename.
void changePdgBiMap(int pdg, std::string newParticleName)
set or replace a particlename and pdg in the bimap
WPropBool m_showSecondaries
Decides whether to hide or show secondaries.
int m_currentColumnIndex
The current column that is selected as particle data group.
void updatePDGProperties()
Update PDG Properties (Multiselector and change-Name-Properties)
WPropGroup m_filteringGroup
Property group for filtering options.
void searchPDGTypes()
Collect all particle types from your input data.
std::shared_ptr< WFilterPropertyHandler > SPtr
Function variables for updating the data.
bool copyFileToHomePath(std::string shareDirFile, std::string homeDirFile)
Helperfunction to copy the particlename file.
WPropString m_inputNewParticleName
A string for the new particle name.
WProtonData::SPtr m_protonData
Pointer to the content and header of the CSV.
void createPropToSetParticleNames()
Create the Subgroup for change of PDG names.
std::vector< int > m_selectedPDGTypes
vector of the options of PDG
WPropertyBase::PropertyChangeNotifierType m_notifierSetParticleName
A notifier for the Changeevents of the Rename PDG property.
std::shared_ptr< WItemSelection > m_particleItemSelectionList
Stores selectable items.
void selectPdgAndSaveEvent(WPropertyBase::SPtr property)
Event of the save button in the rename pdg subgroup.
std::string getParticleNameFromPdg(int pdg)
Seatch the ParticleName in the map with a given pdg.
void updateCheckboxProperty(WPropertyBase::SPtr property)
Reload data when properties for selection of primaries and secondaries changed.
void updatePDGTypesProperty(WItemSelection::SPtr particleItemSelectionList)
Updates possible selectable particle types in multiselection.
int getPdgFromUnkownParticle(std::string particleName)
get the PDG number of an unknown particle element with the help of regex
void updateSelectedPDGTypes()
Update the m_selectedPDGTypes.
WPropertyGroup::SPtr m_properties
A property variable that is generated by the WModul.
BM_PDG::value_type PdgElement
represent an Element of a pdg and a particlename for the map
std::vector< int > m_pdgTypes
Stores every unique particle id.
bool isPDGTypeSelected(int pdgType)
Check whether the PDG type is contained in the m_selectedPDGTypes.
std::shared_ptr< WItemSelection > SPtr
Convenience typedef for a std::shared_ptr< WItemSelection >
boost::function< void(std::shared_ptr< WPropertyBase >)> PropertyChangeNotifierType
Signal signature emitted during set operations.
std::shared_ptr< WPropertyBase > SPtr
Convenience typedef for a std::shared_ptr< WPropertyBase >
std::shared_ptr< WPropertyGroup > SPtr
shared pointer to object of this type
std::shared_ptr< WProtonData > SPtr
shared_ptr that points to itself