|
ATLAS Offline Software
|
#include <MuonHoughPatternTool.h>
|
| MuonHoughPatternTool (const std::string &type, const std::string &name, const IInterface *parent) |
| Default constructor. More...
|
|
virtual | ~MuonHoughPatternTool ()=default |
| Destructor. More...
|
|
virtual void | makePatterns (const MuonHoughHitContainer &hitcontainer, MuonHoughPatternContainerShip &houghpatterns) const override |
| method that builds the patterns More...
|
|
virtual StatusCode | initialize () override |
| initiates private members More...
|
|
virtual StatusCode | finalize () override |
| deletes private members More...
|
|
virtual std::unique_ptr< MuonPrdPatternCollection > | getPhiMuonPatterns (MuonHoughPatternContainerShip &houghpatterns) const override |
| returns phipattern container in EDM More...
|
|
virtual std::unique_ptr< MuonPrdPatternCollection > | getEtaMuonPatterns (MuonHoughPatternContainerShip &houghpatterns) const override |
| returns etapattern container in EDM More...
|
|
virtual MuonHoughPatternContainerShip | emptyHoughPattern () const override |
| creates houghpatterns, called from FinderTool More...
|
|
| DeclareInterfaceID (IMuonHoughPatternTool, 1, 0) |
|
ServiceHandle< StoreGateSvc > & | evtStore () |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | evtStore () const |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | detStore () const |
| The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
virtual StatusCode | sysInitialize () override |
| Perform system initialization for an algorithm. More...
|
|
virtual StatusCode | sysStart () override |
| Handle START transition. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | inputHandles () const override |
| Return this algorithm's input handles. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | outputHandles () const override |
| Return this algorithm's output handles. More...
|
|
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Property< T > &t) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc="none") |
| Declare a new Gaudi property. More...
|
|
void | updateVHKA (Gaudi::Details::PropertyBase &) |
|
MsgStream & | msg () const |
|
MsgStream & | msg (const MSG::Level lvl) const |
|
bool | msgLvl (const MSG::Level lvl) const |
|
|
void | makePatterns (int id_number, double weightmdt, const MuonHoughHitContainer &event, MuonHoughPatternContainerShip &houghpatterns) const |
| method that builds the patterns More...
|
|
std::unique_ptr< MuonPrdPatternCollection > | getCurvedMuonPatterns (MuonHoughPatternContainerShip &houghpatterns) const |
| returns curvedpattern container in EDM More...
|
|
void | useIPMuons () |
| reduces Detector sizes for Hough Histograms to find patterns from muons from the Interaction Point (default on) More...
|
|
bool | analyseHisto (int id_number, int level, const std::unique_ptr< MuonHoughHitContainer > &event_to_analyse, std::unique_ptr< MuonHoughTransformSteering > &houghtransform, MuonHoughPatternContainerShip &houghpatterns) const |
| analyses the hough histograms More...
|
|
int | numberOfHits (const MuonHoughHitContainer &event) const |
| returns number of hits left (unused) More...
|
|
bool | hitInHoughPattern (const std::shared_ptr< MuonHoughHit > &hit, const MuonHoughPatternContainer &houghpattern) const |
| checks if hit is already in one of the found houghpatterns (unused) More...
|
|
void | weightRescaling (const MuonHoughHitContainer &event, int id_number, int level) const |
| rescales hits per iteration to reduce number of patterns when already some have been found More...
|
|
void | calculateWeights (const MuonHoughHitContainer &event, double weightmdt) const |
| calculates new weights based on rejection factor (1-origweight) and number of hits in event, only done for MDTs More...
|
|
int | overlapHoughPatterns (const MuonHoughPattern &houghpattern1, const MuonHoughPattern &houghpattern2) const |
| returns number of hits that are in both hough patterns More...
|
|
std::unique_ptr< MuonHoughHitContainer > | whichEventHough (int id, const MuonHoughHitContainer &event, double weightmdt) const |
| selects the hitcontainer to be used for filling the histograms More...
|
|
std::unique_ptr< MuonHoughHitContainer > | whichEventAssociation (int id, const MuonHoughHitContainer &event) const |
| selects the hitcontainer to be used to associate to the maxima More...
|
|
std::unique_ptr< MuonHoughTransformSteering > | whichHoughTransform (int id) const |
| returns the Houghtransform for the id More...
|
|
std::vector< int > | maxLevelHoughPattern (const MuonHoughPatternContainerShip &houghpattern) const |
| returns the maximum iteration, not in use More...
|
|
int | maxLevelHoughPattern (const MuonHoughPatternContainerShip &houghpattern, int id_number) const |
| returns the maximum iteration, not in use More...
|
|
std::unique_ptr< Muon::MuonPrdPattern > | houghPatternToEtaPattern (const MuonHoughPattern &houghpattern) const |
| converts hough pattern to EDM eta patterns More...
|
|
std::unique_ptr< Muon::MuonPrdPattern > | houghPatternToPhiPattern (const MuonHoughPattern &houghpattern) const |
| converts hough pattern to EDM phi patterns More...
|
|
std::unique_ptr< Muon::MuonPrdPattern > | houghPatternsToOneEtaPattern (const MuonHoughPattern &houghpattern1, const MuonHoughPattern &houghpattern2) const |
| converts and combines two hough patterns to one EDM phi pattern More...
|
|
std::unique_ptr< Muon::MuonPrdPattern > | houghPatternsToOnePhiPattern (const MuonHoughPattern &houghpattern1, const MuonHoughPattern &houghpattern2) const |
| converts and combines two hough patterns to one EDM phi pattern More...
|
|
std::unique_ptr< Muon::MuonPrdPattern > | houghPatternToCleanPhiPattern (MuonHoughPattern &houghpattern) const |
| converts hough pattern to EDM phi patterns and cleans it from outliers More...
|
|
unsigned int | getThresholdHoughPattern (int id_number) const |
| returns minimum number of hits a hough pattern can contain More...
|
|
double | getThresholdHisto (int id_number) const |
| returns minimum number for the maximum of a hough transform More...
|
|
void | setWeightMdtCutValue (const MuonHoughHitContainer &event, double &weightmdt) const |
| calculates the mdt weight cut value More...
|
|
bool | hitThroughCut (const std::shared_ptr< MuonHoughHit > &hit, double weightmdt) const |
| hit through weight cut? More...
|
|
void | printPattern (Muon::MuonPrdPattern *muonpattern) const |
| print out pattern hits More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKey> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &) |
| specialization for handling Gaudi::Property<SG::VarHandleBase> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &) |
| specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
|
|
|
std::unique_ptr< TFile > | m_file |
| pointer to the file name for the hough histograms More...
|
|
MuonHoughMathUtils | m_muonhoughmathutils |
| object for use of mathematical formulas for trackmodels More...
|
|
Gaudi::Property< bool > | m_use_histos {this, "UseHistos", false} |
| output histograms (false) More...
|
|
Gaudi::Property< bool > | m_use_cosmics {this, "UseCosmics", false} |
| use cosmic settings (false) More...
|
|
Gaudi::Property< bool > | m_use_csc_in_pattern {this, "UseCscInPattern", true} |
| use csc hits in association / pattern (true) More...
|
|
Gaudi::Property< bool > | m_use_csc_in_hough {this, "UseCscInHough", true} |
| use csc hits in histogram (false) More...
|
|
Gaudi::Property< bool > | m_use_negative_weights {this, "UseNegativeWeights", false} |
| use negative weights (false) More...
|
|
Gaudi::Property< bool > | m_use_curvedhough {this, "UseCurvedHough", true} |
| use curved hough transformation for eta patterns (true) More...
|
|
int | m_number_of_ids {7} |
| number of hough transforms currently supported (7) More...
|
|
Gaudi::Property< int > | m_number_of_maxima {this, "NumberOfMaximaPerIterations", 5} |
| number of iterations (5) More...
|
|
bool | m_use_ip {false} |
| use interaction point constraint (true) More...
|
|
Gaudi::Property< unsigned int > | m_thresholdpattern_xyz {this, "SetThresholdPatternRPhi", 1} |
| minimal size for a phi pattern (1) More...
|
|
Gaudi::Property< unsigned int > | m_thresholdpattern_rz {this, "SetThresholdPatternREta", 3} |
| minimal size for a eta pattern (3) More...
|
|
double | m_detectorsize_xy {0.} |
| acceptancy of patterns in xy (phi) in mm More...
|
|
double | m_detectorsize_yz {0.} |
| acceptancy of patterns in yz (not used) in mm More...
|
|
double | m_detectorsize_rz {0.} |
| acceptancy of patterns in rz (eta) in mm More...
|
|
Gaudi::Property< bool > | m_weightcut {this, "ApplyWeightCut", true} |
| weight_cut for hits in hough More...
|
|
Gaudi::Property< double > | m_weight {this, "WeightCut", 0.25} |
| value of weight cut More...
|
|
Gaudi::Property< bool > | m_weightcutmdt |
| weight_cut for mdt hits in hough More...
|
|
Gaudi::Property< double > | m_thresholdhisto_xyz {this, "SetThresholdHistoRPhi", 0.9} |
| threshold histogram in xyz More...
|
|
Gaudi::Property< double > | m_thresholdhisto_rz {this, "SetThresholdHistoREta", 2.1} |
| threshold histogram in rz More...
|
|
Gaudi::Property< int > | m_number_of_sectors_xyz {this, "SetNumberOfSectorsRPhi", 12} |
| number of sectors (different regions in which patterns can be found in the same iteration) in xyz More...
|
|
Gaudi::Property< int > | m_number_of_sectors_rz {this, "SetNumberOfSectorsREta", 16} |
| number of sectors (different regions in which patterns can be found in the same iteration) in rz More...
|
|
int | m_number_of_sectors_rz_cosmics {12} |
| number of sectors (different regions in which patterns can be found in the same iteration) in rzcosmics More...
|
|
Gaudi::Property< int > | m_printlevel {this, "Printlevel", 0} |
| output level (range 0-10) (default 0) More...
|
|
std::atomic_uint | m_ncalls {0} |
|
Gaudi::Property< int > | m_maxNumberOfPhiHits {this, "MaximumNumberOfPhiHits", -1} |
| maximum number of phi hits to do pattern recognition, if small zero no cut is applied More...
|
|
StoreGateSvc_t | m_evtStore |
| Pointer to StoreGate (event store by default) More...
|
|
StoreGateSvc_t | m_detStore |
| Pointer to StoreGate (detector store by default) More...
|
|
std::vector< SG::VarHandleKeyArray * > | m_vhka |
|
bool | m_varHandleArraysDeclared |
|
Definition at line 18 of file MuonHoughPatternTool.h.
◆ StoreGateSvc_t
◆ MuonHoughPatternTool()
MuonHoughPatternTool::MuonHoughPatternTool |
( |
const std::string & |
type, |
|
|
const std::string & |
name, |
|
|
const IInterface * |
parent |
|
) |
| |
◆ ~MuonHoughPatternTool()
virtual MuonHoughPatternTool::~MuonHoughPatternTool |
( |
| ) |
|
|
virtualdefault |
◆ analyseHisto()
analyses the hough histograms
- Parameters
-
[in] | id_number | The enum number corresponding to the HoughTransform |
[in] | level | The iteration number |
[in] | event_to_analyse | The hitcontainer which will be associated to the pattern |
[in] | houghtransform | The HoughTransform |
The Analyse-fillHistos loop is at three times ended for each id: 1- if the maximum_number of hhistos[id] ==0 2- if the houghpattern.size() < threshold_for_next_houghpattern 3 - if level == maximum_level at all these 3 times an array[number_of_ids] of int levelmax will be houghpattern has to be deleted.. (all in level>0) 4- if level not gets to 1 // but then no houghpatterns made.. ? 5- if numberOfHits left ==0
Definition at line 224 of file MuonHoughPatternTool.cxx.
237 bool test_for_next_level =
false;
240 double numberofmaxima = 0;
246 for (
unsigned int maximum_number = 0; maximum_number < houghpatterns.size(); ++maximum_number) {
248 std::unique_ptr<MuonHoughPattern>& houghpattern = houghpatterns[maximum_number];
249 if (!houghpattern) {
continue; }
251 ATH_MSG_DEBUG(
"id_number: " << id_number <<
" maximum_number: " << maximum_number <<
" size patternseg: " << houghpattern->
size());
256 if (houghpattern->
size() < numberofmaxima) {
257 ATH_MSG_DEBUG(
"ERROR: houghpattern smaller than maximum, id: " << id_number <<
" houghpattern.size(): " << houghpattern->
size()
258 <<
" numberofmaxima: " << numberofmaxima);
265 if (houghpattern->
size() >= threshold_for_next_houghpattern) {
269 test_for_next_level =
hitsLeft(*event_to_analyse);
271 }
else if (maximum_number == 0) {
272 ATH_MSG_DEBUG(
"houghpattern too small for next level : " <<
level <<
" id: " << id_number);
277 houghpatterns_all[id_number][
level][maximum_number] = std::move(houghpattern);
281 ATH_MSG_DEBUG(
" Test for next level: " << test_for_next_level);
283 return test_for_next_level;
◆ calculateWeights()
calculates new weights based on rejection factor (1-origweight) and number of hits in event, only done for MDTs
Definition at line 383 of file MuonHoughPatternTool.cxx.
384 if (weightmdt < 0.5)
return;
386 for (
unsigned int i = 0;
i <
event.size(); ++
i) {
387 std::shared_ptr<MuonHoughHit> hit =
event.getHit(
i);
392 double p_calc = 0.25 * p_old * (1. - weightmdt);
393 double p_new = p_calc / (p_calc + weightmdt * (1 - p_old));
394 ATH_MSG_VERBOSE(
" MDT probability old " << p_old <<
" Recalculated " << p_new);
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ DeclareInterfaceID()
- Todo:
- should be rethought and possibly using the Moore Interface
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleBase
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 245 of file AthCommonDataStore.h.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
253 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleKey
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 221 of file AthCommonDataStore.h.
229 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This is the generic version, for types that do not derive from SG::VarHandleKey
. It just forwards to the base class version of declareProperty
.
Definition at line 333 of file AthCommonDataStore.h.
338 return PBASE::declareProperty(
name, property,
doc);
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This dispatches to either the generic declareProperty
or the one for VarHandle/Key/KeyArray.
Definition at line 352 of file AthCommonDataStore.h.
◆ declareProperty() [6/6]
◆ detStore()
◆ emptyHoughPattern()
creates houghpatterns, called from FinderTool
Implements IMuonHoughPatternTool.
Definition at line 202 of file MuonHoughPatternTool.cxx.
208 houghpattern.emplace_back(std::move(which_segment_vector));
213 houghpattern[
i].emplace_back(std::move(level_vector));
216 houghpattern[
i][lvl].emplace_back(
nullptr);
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ extraDeps_update_handler()
Add StoreName to extra input/output deps as needed.
use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given
◆ finalize()
StatusCode MuonHoughPatternTool::finalize |
( |
| ) |
|
|
overridevirtual |
◆ getCurvedMuonPatterns()
returns curvedpattern container in EDM
Definition at line 952 of file MuonHoughPatternTool.cxx.
953 std::unique_ptr<MuonPrdPatternCollection> curvedpatterncollection = std::make_unique<MuonPrdPatternCollection>();
957 curvedpatterncollection->
reserve(maximum_number_of_patterns);
960 for (
unsigned int i = 0;
i < curvedpatterns.size(); ++
i) {
961 for (
unsigned int j = 0; j < curvedpatterns[
i].size(); ++j) {
962 std::unique_ptr<MuonHoughPattern>& houghpattern = curvedpatterns[
i][j];
963 if (!houghpattern) {
continue; }
965 if (!curvedpatterns[
i][j]->
empty()) {
967 curvedpatterncollection->
push_back(std::move(muonpattern));
972 return curvedpatterncollection;
◆ getEtaMuonPatterns()
returns etapattern container in EDM
Implements IMuonHoughPatternTool.
Definition at line 806 of file MuonHoughPatternTool.cxx.
807 std::unique_ptr<MuonPrdPatternCollection> etapatterncollection = std::make_unique<MuonPrdPatternCollection>();
811 if (
m_use_curvedhough) maximum_number_of_patterns = 2 * maximum_number_of_patterns;
813 etapatterncollection->
reserve(maximum_number_of_patterns);
818 ATH_MSG_DEBUG(
" GetEtaMuonPatterns Use RZ curved hough patterns ");
821 ATH_MSG_DEBUG(
" GetEtaMuonPatterns Use curved hough patterns ");
830 std::map<MuonHoughPattern*, int> mergedpatterns;
831 for (
unsigned int i = 0;
i < etapatterns.size(); ++
i) {
832 for (
unsigned int j = 0; j < etapatterns[
i].size(); ++j) {
833 std::unique_ptr<MuonHoughPattern>& houghpattern = etapatterns[
i][j];
834 if (!houghpattern)
continue;
835 mergedpatterns[houghpattern.get()] = 0;
842 for (
unsigned int i = 0;
i < etapatterns.size(); ++
i) {
843 for (
unsigned int j = 0; j < etapatterns[
i].size(); ++j) {
844 std::unique_ptr<MuonHoughPattern>& houghpattern1 = etapatterns[
i][j];
845 if (!houghpattern1)
continue;
848 for (
unsigned int k =
i;
k < etapatterns.size();
k++) {
849 for (
unsigned int l = 0;
l < etapatterns[
k].size();
l++) {
850 std::unique_ptr<MuonHoughPattern>& houghpattern2 = etapatterns[
k][
l];
851 if (!houghpattern2)
continue;
854 if (houghpattern1.get() == houghpattern2.get())
continue;
855 if (mergedpatterns[houghpattern1.get()] == 1)
continue;
856 if (mergedpatterns[houghpattern2.get()] == 1)
continue;
863 if (std::abs(curv1) < 1001. || std::abs(curv2) < 1001.) {
864 ATH_MSG_DEBUG(
"Curvature too small, should not be possible: " << curv1 <<
" " << curv2);
868 double angle1 = std::acos((std::abs(curv1) - 1000.) / curv1);
869 double angle2 = std::acos((std::abs(curv2) - 1000.) / curv2);
870 alpha = std::abs(
std::sin(angle1 - angle2));
872 ATH_MSG_DEBUG(
" patterns curv1 " << curv1 <<
" curv2 " << curv2 <<
" alpha " << alpha);
875 double phi1 = houghpattern1->
getEPhi();
876 double phi2 = houghpattern2->
getEPhi();
880 else if (dotprod < -1.)
882 double psi = std::acos(dotprod);
883 double the1 = houghpattern1->
getETheta();
884 double the2 = houghpattern2->
getETheta();
888 else if (dotprod < -1.)
890 double chi = std::acos(dotprod);
892 ATH_MSG_DEBUG(
" patterns phi1 " << phi1 <<
" phi2 " << phi2 <<
" psi " << psi);
893 ATH_MSG_DEBUG(
" patterns the1 " << the1 <<
" the2 " << the2 <<
" chi " << chi);
895 if (chi < 0.5 && psi < 0.5 && alpha < 0.05) {
898 const int ns1 = houghpattern1->
size();
899 const int ns2 = houghpattern2->
size();
901 ATH_MSG_DEBUG(
" Eta Overlap " << overlap <<
" size1 " << ns1 <<
" size2 " << ns2);
903 if (overlap == ns2 && overlap <= ns1) {
905 mergedpatterns[houghpattern2.get()] = 1;
908 if (overlap == ns1 && overlap < ns2) {
910 mergedpatterns[houghpattern1.get()] = 1;
913 std::unique_ptr<Muon::MuonPrdPattern> muonpattern;
915 if ((overlap > 0.8 * ns1 || overlap > 0.8 * ns2) && ns1 >= ns2) {
918 if ((overlap > 0.8 * ns1 || overlap > 0.8 * ns2) && ns1 < ns2) {
922 etapatterncollection->
push_back(std::move(muonpattern));
923 mergedpatterns[houghpattern1.get()] = 1;
924 mergedpatterns[houghpattern2.get()] = 1;
933 for (
unsigned int i = 0;
i < etapatterns.size(); ++
i) {
934 for (
unsigned int j = 0; j < etapatterns[
i].size(); ++j) {
935 std::unique_ptr<MuonHoughPattern>& houghpattern = etapatterns[
i][j];
936 if (!houghpattern) {
continue; }
937 if (mergedpatterns[houghpattern.get()] == 1)
continue;
939 if (!etapatterns[
i][j]->
empty()) {
941 etapatterncollection->
push_back(std::move(muonpattern));
949 return etapatterncollection;
◆ getPhiMuonPatterns()
returns phipattern container in EDM
Implements IMuonHoughPatternTool.
Definition at line 683 of file MuonHoughPatternTool.cxx.
684 std::unique_ptr<MuonPrdPatternCollection> phipatterncollection = std::make_unique<MuonPrdPatternCollection>();
691 std::map<MuonHoughPattern*, int> mergedpatterns;
692 for (
unsigned int i = 0;
i < phipatterns.size(); ++
i) {
693 for (
unsigned int j = 0; j < phipatterns[
i].size(); ++j) {
694 std::unique_ptr<MuonHoughPattern>& houghpattern = phipatterns[
i][j];
695 if (!houghpattern)
continue;
696 mergedpatterns[houghpattern.get()] = 0;
703 for (
unsigned int i = 0;
i < phipatterns.size(); ++
i) {
704 for (
unsigned int j = 0; j < phipatterns[
i].size(); ++j) {
705 std::unique_ptr<MuonHoughPattern>& houghpattern1 = phipatterns[
i][j];
706 if (!houghpattern1)
continue;
709 for (
unsigned int k =
i;
k < phipatterns.size();
k++) {
710 for (
unsigned int l = 0;
l < phipatterns[
k].size();
l++) {
711 std::unique_ptr<MuonHoughPattern>& houghpattern2 = phipatterns[
k][
l];
712 if (!houghpattern2)
continue;
715 if (houghpattern1.get() == houghpattern2.get())
continue;
716 if (mergedpatterns[houghpattern1.get()] == 1)
continue;
717 if (mergedpatterns[houghpattern2.get()] == 1)
continue;
718 const double phi1 = houghpattern1->
getEPhi();
719 const double phi2 = houghpattern2->
getEPhi();
722 double dotprod = scphi1.cs * scphi2.cs + scphi1.sn * scphi2.sn;
725 else if (dotprod < -1.)
727 double psi = std::acos(dotprod);
728 const double the1 = houghpattern1->
getETheta();
729 const double the2 = houghpattern2->
getETheta();
732 dotprod = scthe1.cs * scthe2.cs + scthe1.sn * scthe2.sn;
735 else if (dotprod < -1.)
737 double chi = std::acos(dotprod);
738 ATH_MSG_DEBUG(
" patterns phi1 " << phi1 <<
" phi2 " << phi2 <<
" psi " << psi);
739 ATH_MSG_DEBUG(
" patterns the1 " << the1 <<
" the2 " << the2 <<
" chi " << chi);
740 if (chi < 0.5 || psi < 0.5) {
742 ATH_MSG_DEBUG(
" Phi Overlap " << overlap <<
" size1 " << houghpattern1->
size() <<
" size2 "
743 << houghpattern2->
size());
744 int ns1 = houghpattern1->
size();
745 int ns2 = houghpattern2->
size();
746 if (overlap <= ns1 && overlap == ns2) {
748 mergedpatterns[houghpattern2.get()] = 1;
751 if (overlap == ns1 && overlap < ns2) {
753 mergedpatterns[houghpattern1.get()] = 1;
758 std::unique_ptr<Muon::MuonPrdPattern> muonpattern;
759 if ((overlap > 0.8 * ns1 || overlap > 0.8 * ns2) && ns1 >= ns2) {
762 if ((overlap > 0.8 * ns1 || overlap > 0.8 * ns2) && ns1 < ns2) {
767 phipatterncollection->
push_back(std::move(muonpattern));
768 mergedpatterns[houghpattern1.get()] = 1;
769 mergedpatterns[houghpattern2.get()] = 1;
779 for (
unsigned int i = 0;
i < phipatterns.size(); ++
i) {
780 for (
unsigned int j = 0; j < phipatterns[
i].size(); ++j) {
781 std::unique_ptr<MuonHoughPattern>& houghpattern = phipatterns[
i][j];
782 if (!houghpattern) {
continue; }
783 if (mergedpatterns[houghpattern.get()] == 1)
continue;
785 if (!phipatterns[
i][j]->
empty()) {
786 std::unique_ptr<Muon::MuonPrdPattern> muonpattern;
797 phipatterncollection->
push_back(std::move(muonpattern));
803 return phipatterncollection;
◆ getThresholdHisto()
double MuonHoughPatternTool::getThresholdHisto |
( |
int |
id_number | ) |
const |
|
private |
returns minimum number for the maximum of a hough transform
Definition at line 1420 of file MuonHoughPatternTool.cxx.
1421 double thresholdhisto = 0.;
1422 switch (id_number) {
1432 return thresholdhisto;
◆ getThresholdHoughPattern()
unsigned int MuonHoughPatternTool::getThresholdHoughPattern |
( |
int |
id_number | ) |
const |
|
private |
returns minimum number of hits a hough pattern can contain
Definition at line 1405 of file MuonHoughPatternTool.cxx.
1406 unsigned int thresholdpattern = 0;
1407 switch (id_number) {
1417 return thresholdpattern;
◆ hitInHoughPattern()
checks if hit is already in one of the found houghpatterns (unused)
Definition at line 308 of file MuonHoughPatternTool.cxx.
311 for (
unsigned int i = 0;
i < houghpattern.size(); ++
i) {
312 for (
unsigned int j = 0; j < houghpattern[
i].size(); ++j) {
313 if (houghpattern[
i][j]) {
315 ATH_MSG_VERBOSE(
"Hit in hough pattern found level " <<
i <<
" max " << j <<
"hitid: " << hit->
getId());
◆ hitsLeft()
returns if there are hits left
Definition at line 287 of file MuonHoughPatternTool.cxx.
288 int number_of_hits =
event.size();
289 for (
int hitid = 0; hitid < number_of_hits; ++hitid) {
290 if (!
event.getHit(hitid)->getAssociated()) {
return true; }
◆ hitsNotInPattern()
returns a hitcontainer with hits not yet used in pattern
Definition at line 1397 of file MuonHoughPatternTool.cxx.
1398 std::unique_ptr<MuonHoughHitContainer> hits_not_in_patterns = std::make_unique<MuonHoughHitContainer>();
1400 for (
unsigned int hitid = 0; hitid <
event.size(); ++hitid) {
1401 if (!
event.getHit(hitid)->getAssociated()) { hits_not_in_patterns->
addHit(
event.getHit(hitid)); }
1403 return hits_not_in_patterns;
◆ hitThroughCut()
bool MuonHoughPatternTool::hitThroughCut |
( |
const std::shared_ptr< MuonHoughHit > & |
hit, |
|
|
double |
weightmdt |
|
) |
| const |
|
private |
◆ houghPatternsToOneEtaPattern()
converts and combines two hough patterns to one EDM phi pattern
Definition at line 1022 of file MuonHoughPatternTool.cxx.
1026 const int ns1 = houghpattern1.
size();
1027 const int ns2 = houghpattern2.
size();
1029 const double the1 = houghpattern1.
getETheta();
1030 const double the2 = houghpattern2.
getETheta();
1031 const double theta = (ns1 * the1 + ns2 * the2) / (ns1 + ns2);
1033 const double phi1 = houghpattern1.
getEPhi();
1034 const double phi2 = houghpattern2.
getEPhi();
1035 const double cos_phi = (ns1 *
std::cos(phi1) + ns2 *
std::cos(phi2)) / (ns1 + ns2);
1036 const double sin_phi = (ns1 *
std::sin(phi1) + ns2 *
std::sin(phi2)) / (ns1 + ns2);
1037 const double phi = std::atan2(sin_phi, cos_phi);
1044 const double z0 = (ns1 * position1[2] + ns2 * position2[2]) / (ns1 + ns2);
1046 const double invcur = (ns1 * invcur1 + ns2 * invcur2) / (ns1 + ns2);
1048 ATH_MSG_DEBUG(
"Start Making one eta pattern theta " <<
theta <<
" phi " <<
phi <<
" invcur " << invcur);
1050 ATH_MSG_DEBUG(
"eta patterns theta1 " << the1 <<
" theta2 " << the2 <<
" phi1 " << phi1 <<
" phi2 " << phi2 <<
" invcur1 " << invcur1
1051 <<
" invcur2 " << invcur2 <<
" ns1 " << ns1 <<
" ns2 " << ns2);
1053 ATH_MSG_DEBUG(
" z values " <<
z0 <<
" z1 " << position1[2] <<
" z2 " << position2[2]);
1057 if (ns1 + ns2 < 2)
return nullptr;
1059 double invcurvature = invcur;
1061 if (invcurvature < 0)
charge = -1;
1063 if (invcurvature != 0) pscale = 1. / std::abs(invcurvature);
1068 r0 = (ns1 * houghpattern1.
getERPhi() + ns2 * houghpattern2.
getERPhi()) / (ns1 + ns2);
1081 std::unique_ptr<Muon::MuonPrdPattern> muonpattern = std::make_unique<Muon::MuonPrdPattern>(
pos,
dir);
1084 for (
unsigned int i = 0;
i < houghpattern1.
size(); ++
i) {
1091 for (
unsigned int i = 0;
i < houghpattern2.
size(); ++
i) {
1094 for (
unsigned int j = 0; j < houghpattern1.
size(); ++j) {
◆ houghPatternsToOnePhiPattern()
converts and combines two hough patterns to one EDM phi pattern
IP constraint used, should not be used for cosmics!
Definition at line 1111 of file MuonHoughPatternTool.cxx.
1118 double cos_phi{0.}, sin_phi{0.};
1120 for (
unsigned int i = 0;
i < houghpattern1.
size(); ++
i) {
1126 for (
unsigned int i = 0;
i < houghpattern2.
size(); ++
i) {
1129 for (
unsigned int j = 0; j < houghpattern1.
size(); ++j) {
1139 ATH_MSG_VERBOSE(
"Start Merged Phi hits cleaning with " << nphi <<
" hits ");
1142 if (nphi < 2)
return nullptr;
1144 double cphit = cos_phi / nphi;
1145 double sphit = sin_phi / nphi;
1151 for (
unsigned int i = 0;
i < houghpattern1.
size(); ++
i) {
1154 if (dotprod > 0.95) {
1161 for (
unsigned int i = 0;
i < houghpattern2.
size(); ++
i) {
1164 if (dotprod > 0.95) {
1166 for (
unsigned int j = 0; j < houghpattern1.
size(); ++j) {
1177 if (nphi < 2)
return nullptr;
1178 cphit = cos_phi / nphi;
1179 sphit = sin_phi / nphi;
1184 for (
unsigned int i = 0;
i < houghpattern1.
size(); ++
i) {
1187 if (dotprod > 0.99) {
1193 for (
unsigned int i = 0;
i < houghpattern2.
size(); ++
i) {
1196 if (dotprod > 0.99) {
1198 for (
unsigned int j = 0; j < houghpattern1.
size(); ++j) {
1208 if (nphi < 2)
return nullptr;
1209 cphit = cos_phi / nphi;
1210 sphit = sin_phi / nphi;
1216 for (
unsigned int i = 0;
i < houghpattern1.
size(); ++
i) {
1218 double thetah = houghpattern1.
getTheta(
i);
1220 if (dotprod > 0.995) {
1227 for (
unsigned int i = 0;
i < houghpattern2.
size(); ++
i) {
1229 double thetah = houghpattern2.
getTheta(
i);
1231 if (dotprod > 0.995) {
1233 for (
unsigned int j = 0; j < houghpattern1.
size(); ++j) {
1244 if (nphi < 2)
return nullptr;
1245 cphit = cos_phi / nphi;
1246 sphit = sin_phi / nphi;
1250 double x0 =
r0 * sphit;
1251 double y0 = -
r0 * cphit;
1257 std::unique_ptr<Muon::MuonPrdPattern> muonpattern = std::make_unique<Muon::MuonPrdPattern>(
pos,
dir);
1260 for (
unsigned int i = 0;
i < houghpattern1.
size(); ++
i) {
1263 if (dotprod > 0.995) {
1272 for (
unsigned int i = 0;
i < houghpattern2.
size(); ++
i) {
1275 if (dotprod > 0.995) {
1277 for (
unsigned int j = 0; j < houghpattern1.
size(); ++j) {
◆ houghPatternToCleanPhiPattern()
converts hough pattern to EDM phi patterns and cleans it from outliers
IP constraint used, should not be used for cosmics!
Definition at line 1297 of file MuonHoughPatternTool.cxx.
1305 for (
unsigned int i = 0;
i < houghpattern.
size(); ++
i) {
1306 const std::shared_ptr<MuonHoughHit> hit = houghpattern.
getHit(
i);
1314 unsigned int size = houghpattern.
size();
1319 <<
" theta " <<
theta);
1322 unsigned int newsize = houghpattern.
size();
1328 const int number_of_iterations = 4;
1329 static constexpr std::array<double, number_of_iterations> cutvalues{1000., 500., 250., 125.};
1332 std::unique_ptr<MuonHoughPattern> pat_owner{};
1333 for (
int it = 0;
it < number_of_iterations;
it++) {
1338 double max_dist = 0.;
1339 unsigned int max_i = UINT_MAX;
1340 for (
unsigned int i = 0;
i < newpattern->size(); ++
i) {
1341 double dist = newpattern->getHitx(
i) * scphi.sn - newpattern->getHity(
i) * scphi.cs -
r0;
1343 if (dist > max_dist) {
1348 if (max_dist < cutvalues[
it]) {
1351 std::unique_ptr<MuonHoughPattern> newpattern2 = std::make_unique<MuonHoughPattern>(
MuonHough::hough_xy);
1352 for (
unsigned int i = 0;
i < newpattern->size(); ++
i) {
1353 if (
i != max_i) { newpattern2->
addHit(newpattern->getHit(
i)); }
1358 newsize = newpattern2->
size();
1359 pat_owner = std::move(newpattern2);
1360 newpattern = pat_owner.get();
1368 double thetanew = 0.;
1369 for (
unsigned int i = 0;
i < newpattern->size(); ++
i) {
1370 double thetah = newpattern->getTheta(
i);
1374 thetanew = thetanew / (newpattern->size() + 1
e-7);
1377 double x0_new = r0_new * scphi.sn;
1378 double y0_new = -r0_new * scphi.cs;
1386 std::unique_ptr<Muon::MuonPrdPattern> muonpattern = std::make_unique<Muon::MuonPrdPattern>(
pos,
dir);
1388 for (
unsigned int i = 0;
i < newpattern->size(); ++
i) { muonpattern->
addPrd(newpattern->getPrd(
i)); }
1390 ATH_MSG_DEBUG(
"END Clean Phi hits " << newsize <<
" theta " << thetanew);
◆ houghPatternToEtaPattern()
converts hough pattern to EDM eta patterns
Definition at line 975 of file MuonHoughPatternTool.cxx.
982 double charge = curvature < 0 ? -1 : 1.;
983 double pscale = std::abs(curvature);
993 ATH_MSG_DEBUG(
"position: " << x0 <<
" " << y0 <<
" " << position[2]);
994 ATH_MSG_DEBUG(
"direction: " << direction[0] <<
" " << direction[1] <<
" " << direction[2]);
996 ATH_MSG_DEBUG(
" Lift Eta Hough Pattern with charge " <<
charge <<
" Curvature " << pscale);
997 std::unique_ptr<Muon::MuonPrdPattern> muonpattern = std::make_unique<Muon::MuonPrdPattern>(
pos,
dir);
999 for (
unsigned int i = 0;
i < houghpattern.
size(); ++
i) { muonpattern->
addPrd(houghpattern.
getPrd(
i)); }
◆ houghPatternToPhiPattern()
converts hough pattern to EDM phi patterns
Definition at line 1003 of file MuonHoughPatternTool.cxx.
1011 std::unique_ptr<Muon::MuonPrdPattern> muonpattern = std::make_unique<Muon::MuonPrdPattern>(
pos,
dir);
1013 for (
unsigned int i = 0;
i < houghpattern.
size(); ++
i) {
◆ initialize()
StatusCode MuonHoughPatternTool::initialize |
( |
| ) |
|
|
overridevirtual |
initiates private members
Definition at line 152 of file MuonHoughPatternTool.cxx.
155 m_file = std::make_unique<TFile>(
"HoughPattern.root",
"RECREATE");
180 return StatusCode::SUCCESS;
◆ inputHandles()
Return this algorithm's input handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ makePatterns() [1/2]
method that builds the patterns
skip cosmic events that have more than 1000 phi hits
value of mdt weight cut, dependent on # hits in event
Implements IMuonHoughPatternTool.
Definition at line 40 of file MuonHoughPatternTool.cxx.
44 for (
unsigned int hitid = 0; hitid < hitcontainer.
size(); ++hitid) { phihits += hitcontainer.
getMeasuresPhi(hitid); }
46 ATH_MSG_DEBUG(
"Cosmic event has more than 1000 phi hits: " << phihits <<
" event is not reconstructed!");
64 for (
unsigned int i = 0;
i < hitcontainer.
size(); ++
i) {
65 const std::shared_ptr<MuonHoughHit> hit = hitcontainer.
getHit(
i);
◆ makePatterns() [2/2]
method that builds the patterns
Definition at line 84 of file MuonHoughPatternTool.cxx.
90 std::unique_ptr<MuonHoughHitContainer> event_for_hough{
whichEventHough(id_number,
event, weightmdt)};
95 for (
unsigned int i = 0;
i < event_for_hough->size(); ++
i) {
96 const std::shared_ptr<MuonHoughHit> hit = event_for_hough->getHit(
i);
102 ATH_MSG_VERBOSE(
"Size event association: " << event_for_association->size());
103 for (
unsigned int i = 0;
i < event_for_association->size(); ++
i) {
104 const std::shared_ptr<MuonHoughHit> hit = event_for_association->getHit(
i);
110 ATH_MSG_DEBUG(
"size of event: " << event_for_association->size() <<
" id_number: " << id_number);
112 std::unique_ptr<MuonHoughTransformSteering> houghtransform{
whichHoughTransform(id_number)};
116 bool test_for_next_level =
true;
119 if (test_for_next_level) {
122 houghtransform->resetHisto();
123 ATH_MSG_DEBUG(
"fillHistos size hits not in patterns " << event_for_hough->size());
124 houghtransform->fill(*event_for_hough);
130 for (
int i = 0;
i <
histos.size(); ++
i) {
132 histos.getHisto(
i)->bookAndFillRootHistogram(
hname)->Write();
139 test_for_next_level =
analyseHisto(id_number,
level, event_for_association, houghtransform, houghpattern);
141 if (test_for_next_level) {
142 event_for_hough =
whichEventHough(id_number, *event_for_hough, weightmdt);
143 ATH_MSG_DEBUG(
"New event size for transform: " << event_for_hough->size());
◆ maxLevelHoughPattern() [1/2]
◆ maxLevelHoughPattern() [2/2]
returns the maximum iteration, not in use
- Todo:
- should be in houghpattern?
Definition at line 639 of file MuonHoughPatternTool.cxx.
640 int maxlevel = houghpattern[id_number].size();
642 while (maxlevel >= 1 && continu == 1) {
643 unsigned int maximum_number = 0;
645 while (continu && maximum_number < houghpattern[id_number][maxlevel - 1].
size())
648 <<
"maxlevel_houghpattern: " << maxlevel <<
" id: " << id_number);
649 if (!houghpattern[id_number][maxlevel - 1][maximum_number]->
empty()) { continu =
false; }
655 if (continu) { maxlevel--; }
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ numberOfHits()
returns number of hits left (unused)
Definition at line 295 of file MuonHoughPatternTool.cxx.
296 int number_of_hits_left = 0;
297 int number_of_hits =
event.size();
299 for (
int hitid = 0; hitid < number_of_hits; ++hitid) { number_of_hits_left += !
event.getHit(hitid)->getAssociated(); }
305 return number_of_hits_left;
◆ outputHandles()
Return this algorithm's output handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ overlapHoughPatterns()
returns number of hits that are in both hough patterns
Definition at line 400 of file MuonHoughPatternTool.cxx.
406 for (
unsigned int i = 0;
i < houghpattern1.
size(); ++
i) {
407 while (j < houghpattern2.
size()) {
417 double percentage1 = (1.0 * overlap) / houghpattern1.
size();
418 double percentage2 = (1.0 * overlap) / houghpattern2.
size();
420 ATH_MSG_DEBUG(
"Percentage Overlap: " << percentage1 <<
" " << percentage2);
◆ printPattern()
print out pattern hits
Definition at line 1449 of file MuonHoughPatternTool.cxx.
1461 ATH_MSG_VERBOSE(
"mdt " <<
k <<
" x: " << gpos.x() <<
" y: " << gpos.y() <<
" z: " << gpos.z());
1462 }
else if (!mdtprd) {
1466 ATH_MSG_VERBOSE(
"cluster " <<
k <<
" x: " << gpos.x() <<
" y: " << gpos.y() <<
" z: " << gpos.z());
◆ renounce()
◆ renounceArray()
◆ resetAssociation()
reset association flag of hits in m_event
Definition at line 183 of file MuonHoughPatternTool.cxx.
184 for (
unsigned int i = 0;
i <
event.size(); ++
i) {
185 std::shared_ptr<MuonHoughHit> hit =
event.getHit(
i);
◆ setWeightMdtCutValue()
calculates the mdt weight cut value
Definition at line 1435 of file MuonHoughPatternTool.cxx.
1440 int mdthits =
event.getMDThitno();
1441 weightmdt = mdthits > 0. ? 1. - 5. / std::sqrt(mdthits) : 0.;
◆ sysInitialize()
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ transformCoordsMaximum()
void MuonHoughPatternTool::transformCoordsMaximum |
( |
std::pair< double, double > & |
coordsmaximum, |
|
|
double |
r0_true |
|
) |
| |
|
staticprivate |
corrects the maximum of the histogram with a factor (not in use anymore, used for old rz transform)
Definition at line 660 of file MuonHoughPatternTool.cxx.
661 double z_true = coordsmaximum.first;
662 double theta_true = coordsmaximum.second;
671 double z_rec = z_true + z_cor;
672 double theta_rec = theta_true + theta_cor;
675 z_rec = z_true - z_cor;
676 theta_rec = theta_true - theta_cor;
679 coordsmaximum.first = z_rec;
680 coordsmaximum.second = theta_rec;
◆ updateVHKA()
◆ useIPMuons()
void MuonHoughPatternTool::useIPMuons |
( |
| ) |
|
|
private |
reduces Detector sizes for Hough Histograms to find patterns from muons from the Interaction Point (default on)
Definition at line 33 of file MuonHoughPatternTool.cxx.
◆ weightRescaling()
rescales hits per iteration to reduce number of patterns when already some have been found
Definition at line 324 of file MuonHoughPatternTool.cxx.
325 double weight_trigger_hits = 1.;
326 double weight_mdt_hits = 1.;
332 if (weight_trigger_hits > 1) weight_trigger_hits = 1.;
333 weight_mdt_hits = weight_trigger_hits;
342 weight_trigger_hits = 1.;
343 weight_mdt_hits = 1.;
346 weight_trigger_hits = 1.;
347 weight_mdt_hits = 1.;
350 weight_trigger_hits = 1.;
351 weight_mdt_hits = 0.75;
354 weight_trigger_hits = 0.75;
355 weight_mdt_hits = 0.5;
358 weight_trigger_hits = 0.5;
359 weight_mdt_hits = 0.25;
363 weight_trigger_hits = 0.5;
364 weight_mdt_hits = 0.25;
370 for (
unsigned int i = 0;
i <
event.size(); ++
i) {
371 std::shared_ptr<MuonHoughHit> hit =
event.getHit(
i);
373 switch (technology) {
◆ whichEventAssociation()
selects the hitcontainer to be used to associate to the maxima
Definition at line 424 of file MuonHoughPatternTool.cxx.
426 std::unique_ptr<MuonHoughHitContainer> event_to_analyse = std::make_unique<MuonHoughHitContainer>();
431 for (
unsigned int hitid = 0; hitid <
event.size(); ++hitid) {
432 std::shared_ptr<MuonHoughHit> hit =
event.getHit(hitid);
435 event_to_analyse->
addHit(hit);
441 for (
unsigned int hitid = 0; hitid <
event.size(); ++hitid) {
442 std::shared_ptr<MuonHoughHit> hit =
event.getHit(hitid);
443 event_to_analyse->
addHit(hit);
449 for (
unsigned int hitid = 0; hitid <
event.size(); ++hitid) {
450 std::shared_ptr<MuonHoughHit> hit =
event.getHit(hitid);
453 event_to_analyse->
addHit(hit);
460 for (
unsigned int hitid = 0; hitid <
event.size(); ++hitid) {
461 std::shared_ptr<MuonHoughHit> hit =
event.getHit(hitid);
467 for (
unsigned int hitid = 0; hitid <
event.size(); ++hitid) {
468 std::shared_ptr<MuonHoughHit> hit =
event.getHit(hitid);
474 for (
unsigned int hitid = 0; hitid <
event.size(); ++hitid) {
475 std::shared_ptr<MuonHoughHit> hit =
event.getHit(hitid);
482 return event_to_analyse;
◆ whichEventHough()
selects the hitcontainer to be used for filling the histograms
Definition at line 485 of file MuonHoughPatternTool.cxx.
489 ATH_MSG_DEBUG(
"whichEventHough::hitsNotInPattern: " << hits_not_in_patterns->size());
490 std::unique_ptr<MuonHoughHitContainer> event_to_analyse = std::make_unique<MuonHoughHitContainer>();
495 for (
unsigned int hitid = 0; hitid < hits_not_in_patterns->size(); ++hitid) {
496 std::shared_ptr<MuonHoughHit> hit = hits_not_in_patterns->getHit(hitid);
500 event_to_analyse->
addHit(hit);
507 for (
unsigned int hitid = 0; hitid < hits_not_in_patterns->size(); ++hitid) {
508 std::shared_ptr<MuonHoughHit> hit = hits_not_in_patterns->getHit(hitid);
515 for (
unsigned int hitid = 0; hitid < hits_not_in_patterns->size(); ++hitid) {
516 std::shared_ptr<MuonHoughHit> hit = hits_not_in_patterns->getHit(hitid);
520 event_to_analyse->
addHit(hit);
528 for (
unsigned int hitid = 0; hitid < hits_not_in_patterns->size(); ++hitid) {
529 if (hits_not_in_patterns->getDetectorId(hitid) ==
MuonHough::RPC) {
530 std::shared_ptr<MuonHoughHit> hit = hits_not_in_patterns->getHit(hitid);
535 for (
unsigned int hitid = 0; hitid < hits_not_in_patterns->size(); ++hitid) {
536 if (hits_not_in_patterns->getDetectorId(hitid) ==
MuonHough::RPC) {
537 std::shared_ptr<MuonHoughHit> hit = hits_not_in_patterns->getHit(hitid);
538 event_to_analyse->
addHit(hit);
544 for (
unsigned int hitid = 0; hitid < hits_not_in_patterns->size(); ++hitid) {
545 if (hits_not_in_patterns->getDetectorId(hitid) ==
MuonHough::MDT) {
546 std::shared_ptr<MuonHoughHit> hit = hits_not_in_patterns->getHit(hitid);
554 return event_to_analyse;
◆ whichHoughTransform()
returns the Houghtransform for the id
Definition at line 557 of file MuonHoughPatternTool.cxx.
558 std::unique_ptr<MuonHoughTransformer> houghtransformer;
577 nbins_angle =
static_cast<int>(detectorsize_angle_xy / stepsize_per_angle_xy);
578 houghtransformer = std::make_unique<MuonHoughTransformer_xy>(
nbins, nbins_angle,
m_detectorsize_xy, detectorsize_angle_xy,
601 houghtransformer = std::make_unique<MuonHoughTransformer_rzcosmics>(
608 houghtransformer = std::make_unique<MuonHoughTransformer_CurvedAtACylinder>(
615 if (houghtransformer) {
626 return std::make_unique<MuonHoughTransformSteering>(std::move(houghtransformer));
◆ m_detectorsize_angle_rz
constexpr double MuonHoughPatternTool::m_detectorsize_angle_rz {180.} |
|
staticconstexprprivate |
◆ m_detectorsize_angle_xyz
constexpr double MuonHoughPatternTool::m_detectorsize_angle_xyz {360.} |
|
staticconstexprprivate |
◆ m_detectorsize_rz
double MuonHoughPatternTool::m_detectorsize_rz {0.} |
|
private |
◆ m_detectorsize_rz_full
constexpr double MuonHoughPatternTool::m_detectorsize_rz_full {27750.} |
|
staticconstexprprivate |
size of full detector in rz (eta) in mm, used as acceptancy for cosmics
Definition at line 204 of file MuonHoughPatternTool.h.
◆ m_detectorsize_rz_ip
constexpr double MuonHoughPatternTool::m_detectorsize_rz_ip {1500.} |
|
staticconstexprprivate |
◆ m_detectorsize_xy
double MuonHoughPatternTool::m_detectorsize_xy {0.} |
|
private |
◆ m_detectorsize_xy_full
constexpr double MuonHoughPatternTool::m_detectorsize_xy_full {15000.} |
|
staticconstexprprivate |
size of full detector in xy (phi) in mm, used as acceptancy for cosmics
Definition at line 200 of file MuonHoughPatternTool.h.
◆ m_detectorsize_xy_ip
constexpr double MuonHoughPatternTool::m_detectorsize_xy_ip {600.} |
|
staticconstexprprivate |
◆ m_detectorsize_yz
double MuonHoughPatternTool::m_detectorsize_yz {0.} |
|
private |
◆ m_detectorsize_yz_full
constexpr double MuonHoughPatternTool::m_detectorsize_yz_full {25000.} |
|
staticconstexprprivate |
size of full detector in yz (not used) in mm, used as acceptancy for cosmics
Definition at line 202 of file MuonHoughPatternTool.h.
◆ m_detectorsize_yz_ip
constexpr double MuonHoughPatternTool::m_detectorsize_yz_ip {1000.} |
|
staticconstexprprivate |
◆ m_detStore
◆ m_evtStore
◆ m_file
std::unique_ptr<TFile> MuonHoughPatternTool::m_file |
|
private |
◆ m_maximum_level
constexpr int MuonHoughPatternTool::m_maximum_level {5} |
|
staticconstexprprivate |
◆ m_maximum_residu_angle
constexpr double MuonHoughPatternTool::m_maximum_residu_angle {3.} |
|
staticconstexprprivate |
◆ m_maximum_residu_mm
constexpr double MuonHoughPatternTool::m_maximum_residu_mm {500.} |
|
staticconstexprprivate |
◆ m_maximum_residu_mm_cosmics
constexpr double MuonHoughPatternTool::m_maximum_residu_mm_cosmics {2000.} |
|
staticconstexprprivate |
◆ m_maxNumberOfPhiHits
Gaudi::Property<int> MuonHoughPatternTool::m_maxNumberOfPhiHits {this, "MaximumNumberOfPhiHits", -1} |
|
private |
maximum number of phi hits to do pattern recognition, if small zero no cut is applied
Definition at line 274 of file MuonHoughPatternTool.h.
◆ m_muonhoughmathutils
◆ m_nbins_curved
constexpr int MuonHoughPatternTool::m_nbins_curved {160} |
|
staticconstexprprivate |
◆ m_ncalls
std::atomic_uint MuonHoughPatternTool::m_ncalls {0} |
|
mutableprivate |
◆ m_number_of_ids
int MuonHoughPatternTool::m_number_of_ids {7} |
|
private |
◆ m_number_of_maxima
Gaudi::Property<int> MuonHoughPatternTool::m_number_of_maxima {this, "NumberOfMaximaPerIterations", 5} |
|
private |
◆ m_number_of_sectors_rz
Gaudi::Property<int> MuonHoughPatternTool::m_number_of_sectors_rz {this, "SetNumberOfSectorsREta", 16} |
|
private |
number of sectors (different regions in which patterns can be found in the same iteration) in rz
Definition at line 264 of file MuonHoughPatternTool.h.
◆ m_number_of_sectors_rz_cosmics
int MuonHoughPatternTool::m_number_of_sectors_rz_cosmics {12} |
|
private |
number of sectors (different regions in which patterns can be found in the same iteration) in rzcosmics
Definition at line 266 of file MuonHoughPatternTool.h.
◆ m_number_of_sectors_xyz
Gaudi::Property<int> MuonHoughPatternTool::m_number_of_sectors_xyz {this, "SetNumberOfSectorsRPhi", 12} |
|
private |
number of sectors (different regions in which patterns can be found in the same iteration) in xyz
Definition at line 262 of file MuonHoughPatternTool.h.
◆ m_printlevel
Gaudi::Property<int> MuonHoughPatternTool::m_printlevel {this, "Printlevel", 0} |
|
private |
◆ m_stepsize_per_angle_rz
constexpr double MuonHoughPatternTool::m_stepsize_per_angle_rz {0.25} |
|
staticconstexprprivate |
◆ m_stepsize_per_angle_rz_cosmics
constexpr double MuonHoughPatternTool::m_stepsize_per_angle_rz_cosmics {2.} |
|
staticconstexprprivate |
◆ m_stepsize_per_angle_xy_cosmics
constexpr double MuonHoughPatternTool::m_stepsize_per_angle_xy_cosmics {1.} |
|
staticconstexprprivate |
◆ m_stepsize_per_angle_xyz
constexpr double MuonHoughPatternTool::m_stepsize_per_angle_xyz {0.25} |
|
staticconstexprprivate |
◆ m_stepsize_rz
constexpr double MuonHoughPatternTool::m_stepsize_rz {75.} |
|
staticconstexprprivate |
◆ m_stepsize_rz_cosmics
constexpr double MuonHoughPatternTool::m_stepsize_rz_cosmics {150.} |
|
staticconstexprprivate |
◆ m_stepsize_xy
constexpr double MuonHoughPatternTool::m_stepsize_xy {75.} |
|
staticconstexprprivate |
max range of 1/sqrt(curvature) for curved transform, corresponds to 0.02 ~ 2,5m ~ 1.6GeV
bin width for xy
Definition at line 223 of file MuonHoughPatternTool.h.
◆ m_stepsize_xy_cosmics
constexpr double MuonHoughPatternTool::m_stepsize_xy_cosmics {150.} |
|
staticconstexprprivate |
◆ m_stepsize_yz
constexpr double MuonHoughPatternTool::m_stepsize_yz {250.} |
|
staticconstexprprivate |
◆ m_theta_cor_constant
constexpr double MuonHoughPatternTool::m_theta_cor_constant {-0.042} |
|
staticconstexprprivate |
◆ m_theta_cor_constant2
constexpr double MuonHoughPatternTool::m_theta_cor_constant2 {4000.} |
|
staticconstexprprivate |
◆ m_thresholdhisto_rz
Gaudi::Property<double> MuonHoughPatternTool::m_thresholdhisto_rz {this, "SetThresholdHistoREta", 2.1} |
|
private |
◆ m_thresholdhisto_xyz
Gaudi::Property<double> MuonHoughPatternTool::m_thresholdhisto_xyz {this, "SetThresholdHistoRPhi", 0.9} |
|
private |
◆ m_thresholdpattern_rz
Gaudi::Property<unsigned int> MuonHoughPatternTool::m_thresholdpattern_rz {this, "SetThresholdPatternREta", 3} |
|
private |
◆ m_thresholdpattern_xyz
Gaudi::Property<unsigned int> MuonHoughPatternTool::m_thresholdpattern_xyz {this, "SetThresholdPatternRPhi", 1} |
|
private |
◆ m_use_cosmics
Gaudi::Property<bool> MuonHoughPatternTool::m_use_cosmics {this, "UseCosmics", false} |
|
private |
◆ m_use_csc_in_hough
Gaudi::Property<bool> MuonHoughPatternTool::m_use_csc_in_hough {this, "UseCscInHough", true} |
|
private |
◆ m_use_csc_in_pattern
Gaudi::Property<bool> MuonHoughPatternTool::m_use_csc_in_pattern {this, "UseCscInPattern", true} |
|
private |
◆ m_use_curvedhough
Gaudi::Property<bool> MuonHoughPatternTool::m_use_curvedhough {this, "UseCurvedHough", true} |
|
private |
◆ m_use_histos
Gaudi::Property<bool> MuonHoughPatternTool::m_use_histos {this, "UseHistos", false} |
|
private |
◆ m_use_ip
bool MuonHoughPatternTool::m_use_ip {false} |
|
private |
◆ m_use_negative_weights
Gaudi::Property<bool> MuonHoughPatternTool::m_use_negative_weights {this, "UseNegativeWeights", false} |
|
private |
◆ m_use_rpc_measures_eta
constexpr bool MuonHoughPatternTool::m_use_rpc_measures_eta {true} |
|
staticconstexprprivate |
use rpc phi strips in phi-patterns (true)
use rpc eta strips in eta-patterns (true)
Definition at line 157 of file MuonHoughPatternTool.h.
◆ m_varHandleArraysDeclared
◆ m_vhka
◆ m_weight
Gaudi::Property<double> MuonHoughPatternTool::m_weight {this, "WeightCut", 0.25} |
|
private |
◆ m_weightcut
Gaudi::Property<bool> MuonHoughPatternTool::m_weightcut {this, "ApplyWeightCut", true} |
|
private |
◆ m_weightcutmdt
Gaudi::Property<bool> MuonHoughPatternTool::m_weightcutmdt |
|
private |
Initial value:{this, "ApplyWeightCutMdt",
true}
weight_cut for mdt hits in hough
Definition at line 253 of file MuonHoughPatternTool.h.
◆ m_z_cor_constant
constexpr double MuonHoughPatternTool::m_z_cor_constant {-10000.} |
|
staticconstexprprivate |
use hough correction to correct the maximum found in rz-plane slightly as there is a bias in the houghtransform
constant 1 for z for hough correction
Definition at line 183 of file MuonHoughPatternTool.h.
◆ m_z_cor_constant2
constexpr double MuonHoughPatternTool::m_z_cor_constant2 {6000.} |
|
staticconstexprprivate |
The documentation for this class was generated from the following files:
void reserve(size_type n)
Attempt to preallocate enough memory for a specified number of elements.
double getECurvature() const
returns curvature of pattern
virtual const Trk::PrepRawData * prd(unsigned int index) const
returns the PrepRawData objects depending on the integer, return zero if index out of range
double getTheta(unsigned int hitno) const
returns theta of hit hitno
Scalar phi() const
phi method
virtual void addPrd(const Trk::PrepRawData *prd)
add hit to pattern
double getHitz() const
returns z position
bool getMeasuresPhi(unsigned int hitno) const
returns if hit hitno measures phi
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
double getHitx() const
returns x position
double getEPhi() const
returns phi of pattern
Amg::Vector3D getEPos() const
calulates 3d point closest to ip
StatusCode accept(const xAOD::Muon *mu)
Scalar theta() const
theta method
std::shared_ptr< MuonHoughHit > getHit(int hitno) const
returns Hit at position hitno
double getPhi(unsigned int hitno) const
returns phi of hit hitno
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool msgLvl(const MSG::Level lvl) const
void setWeight(double weight)
set weight
virtual const Amg::Vector3D & globalPosition() const =0
Returns the global position of the measurement (calculated on the fly)
#define ATH_MSG_VERBOSE(x)
double getHity() const
returns y position
const Amg::Vector3D & center() const
Returns the center position of the Surface.
void addHit(const std::shared_ptr< MuonHoughHit > &hit)
add hit to container
virtual void setOwner(IDataHandleHolder *o)=0
int getHitId(unsigned int hitno) const
returns hitid of hit hitno
POOL::TEvent event(POOL::TEvent::kClassAccess)
MuonHough::DetectorTechnology getDetectorId() const
return DetectorTechnology
std::string getWhichDetector() const
return DetectorTechnology in string
unsigned int size() const
returns size of hitcontainer
double getPhi() const
returns phi
double getETheta() const
returns theta of pattern
const Trk::PrepRawData * getPrd(unsigned int hitno) const
returns preprawdata pointer of hit hitno
const double r0
electron radius{cm}
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
@ hough_curved_at_a_cylinder
void updateParametersRPhi(bool cosmics=false)
update parameters in rphi plane based on weighted fit
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Identifier identify() const
return the identifier
void printHoughPattern() const
prints out info about hough pattern
std::string to_string(const DetectorType &type)
double charge(const T &p)
value_type push_back(value_type pElem)
Add an element to the end of the collection.
double getProbability() const
returns probability that hit is part of pattern (true muon)
Class to represent measurements from the Monitored Drift Tubes.
double getWeight() const
returns weight in histogram after rescaling
Eigen::Matrix< double, 3, 1 > Vector3D
std::vector< MuonHoughPatternCollection > MuonHoughPatternContainer
bool empty() const
returns if hitcontainer is empty
#define ATH_MSG_WARNING(x)
Amg::Vector3D getEDir() const
calculates direction at point closest to ip
void setAssociated(bool associated)
set associated
virtual const Trk::Surface & surface() const override final
Return surface associated with this detector element.
double getERPhi() const
returns r0/d0 of pattern
Helper to simultaneously calculate sin and cos of the same angle.
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
bool getMeasuresPhi() const
hit measures phi?
double getOrigWeight() const
returns original weight
virtual unsigned int numberOfContainedPrds() const
Number or PrepRawData contained by this Pattern.
Class representing clusters in the muon system.
double getMaximumHistogram() const
returns maximum of histogram used to generate pattern
DetectorTechnology
enum to identify the muondetectortechnology
std::vector< MuonHoughPatternContainer > MuonHoughPatternContainerShip
bool getAssociated() const
return if hit already associated to pattern
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
virtual const MuonGM::MdtReadoutElement * detectorElement() const override
Returns the detector element corresponding to this PRD.
std::vector< std::unique_ptr< MuonHoughPattern > > MuonHoughPatternCollection
This typedef represents a collection and container of MuonHoughPattern objects.
int getId() const
returns id