File: hrichringfind.cc $Id: hrichringfind.cc,v 1.27 2009-07-16 13:42:57 jurkovic Exp $ *-- Author : Witold Przygoda (przygoda@psja1.if.uj.edu.pl) *-- Modified : 2000/10/xx by Wolfgang Koenig *-- Modified : 2001/01/xx by Laura Fabbietti *-- Modified : 2001/09/06 by Witold Przygoda _HADES_CLASS_DESCRIPTION HRichRingFind Ring recognition algorithms. This class isn't any task but it is called for each event from the HRichAnalysis::execute() function.
HRichRingFind() | |
HRichRingFind(const HRichRingFind& source) | |
virtual | ~HRichRingFind() |
void | TObject::AbstractMethod(const char* method) const |
virtual void | TObject::AppendPad(Option_t* option = "") |
virtual void | TObject::Browse(TBrowser* b) |
Float_t | CalcDistance(const HRichHit& ring1, const HRichHit& ring2) |
Float_t | CalcDistance(Int_t x, Int_t y, const HRichHit& ring) |
Float_t | CalcDistance(Int_t x1, Int_t y1, Int_t x2, Int_t y2) |
virtual void | CalcFakeContribution(HRichAnalysis* showMe) |
void | CalcRingClusters(HRichAnalysis* showYou, Int_t* dumpArr, Int_t ringNr, Int_t nowX, Int_t nowY) |
virtual void | CalcRingParameters(HRichAnalysis* showMe, HRichHit* pHit) |
static TClass* | Class() |
virtual const char* | TObject::ClassName() const |
virtual void | TObject::Clear(Option_t* = "") |
virtual TObject* | TObject::Clone(const char* newname = "") const |
void | CloseMaxRejection(TList* hitList) |
virtual Int_t | TObject::Compare(const TObject* obj) const |
virtual void | TObject::Copy(TObject& object) const |
virtual void | TObject::Delete(Option_t* option = "")MENU |
virtual Int_t | TObject::DistancetoPrimitive(Int_t px, Int_t py) |
virtual void | TObject::Draw(Option_t* option = "") |
virtual void | TObject::DrawClass() constMENU |
virtual TObject* | TObject::DrawClone(Option_t* option = "") constMENU |
virtual void | TObject::Dump() constMENU |
virtual void | TObject::Error(const char* method, const char* msgfmt) const |
Int_t | Execute(HRichAnalysis* giveMe) |
virtual void | TObject::ExecuteEvent(Int_t event, Int_t px, Int_t py) |
virtual void | TObject::Fatal(const char* method, const char* msgfmt) const |
virtual TObject* | TObject::FindObject(const char* name) const |
virtual TObject* | TObject::FindObject(const TObject* obj) const |
Int_t | GetAlgorithmNr(HRichAnalysis* showMe) |
virtual Option_t* | TObject::GetDrawOption() const |
static Long_t | TObject::GetDtorOnly() |
virtual const char* | TObject::GetIconName() const |
virtual const char* | TObject::GetName() const |
virtual char* | TObject::GetObjectInfo(Int_t px, Int_t py) const |
static Bool_t | TObject::GetObjectStat() |
virtual Option_t* | TObject::GetOption() const |
virtual const char* | TObject::GetTitle() const |
virtual UInt_t | TObject::GetUniqueID() const |
virtual Bool_t | TObject::HandleTimer(TTimer* timer) |
virtual ULong_t | TObject::Hash() const |
virtual void | TObject::Info(const char* method, const char* msgfmt) const |
virtual Bool_t | TObject::InheritsFrom(const char* classname) const |
virtual Bool_t | TObject::InheritsFrom(const TClass* cl) const |
Bool_t | init(HRichAnalysis*) |
virtual void | TObject::Inspect() constMENU |
void | TObject::InvertBit(UInt_t f) |
virtual TClass* | IsA() const |
virtual Bool_t | TObject::IsEqual(const TObject* obj) const |
virtual Bool_t | TObject::IsFolder() const |
Bool_t | TObject::IsOnHeap() const |
virtual Bool_t | TObject::IsSortable() const |
Bool_t | TObject::IsZombie() const |
virtual void | TObject::ls(Option_t* option = "") const |
Int_t | MatchRings(HRichAnalysis* showMe, TList* hitList1, TList* hitList2) |
void | MaxAnalysis(HRichAnalysis* showMe, TList* hitList, TArrayI* in, TArrayI* out, Int_t minAmpl) |
void | MaxCluster(HRichAnalysis* showYou, TArrayI* in, TArrayI* out, Int_t nowPad, Int_t maxCode, Int_t minAmpl) |
void | MaxFinding(HRichAnalysis* showYou, TList* hitList, TArrayI* in, TArrayI* out, Int_t ringnr, Float_t distance) |
Int_t | MaxLabAmpl(TList* hitList, Int_t maxCode) |
void | MaxMarker(HRichAnalysis* showYou, TArrayI* in, TArrayI* out, Int_t nowPad, Int_t maxCode) |
void | MaxSelector(HRichAnalysis* showMe, TList* hitList, TArrayI* in, TArrayI* out) |
void | TObject::MayNotUse(const char* method) const |
virtual Bool_t | TObject::Notify() |
static void | TObject::operator delete(void* ptr) |
static void | TObject::operator delete(void* ptr, void* vp) |
static void | TObject::operator delete[](void* ptr) |
static void | TObject::operator delete[](void* ptr, void* vp) |
void* | TObject::operator new(size_t sz) |
void* | TObject::operator new(size_t sz, void* vp) |
void* | TObject::operator new[](size_t sz) |
void* | TObject::operator new[](size_t sz, void* vp) |
HRichRingFind& | operator=(const HRichRingFind& source) |
virtual void | TObject::Paint(Option_t* option = "") |
virtual void | TObject::Pop() |
virtual void | TObject::Print(Option_t* option = "") const |
virtual Int_t | TObject::Read(const char* name) |
virtual void | TObject::RecursiveRemove(TObject* obj) |
void | TObject::ResetBit(UInt_t f) |
void | RingFindFitMatrix(HRichAnalysis* showMe, Int_t minampl, Int_t distance, Int_t howmanyrings = 5) |
void | RingFindHoughTransf(HRichAnalysis* showMe, Int_t minampl, Int_t distance, Int_t howmanyrings = 5) |
virtual void | TObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU |
virtual void | TObject::SavePrimitive(basic_ostream<char,char_traits<char> >& out, Option_t* option = "") |
void | TObject::SetBit(UInt_t f) |
void | TObject::SetBit(UInt_t f, Bool_t set) |
virtual void | TObject::SetDrawOption(Option_t* option = "")MENU |
static void | TObject::SetDtorOnly(void* obj) |
static void | TObject::SetObjectStat(Bool_t stat) |
virtual void | TObject::SetUniqueID(UInt_t uid) |
virtual void | ShowMembers(TMemberInspector& insp, char* parent) |
virtual void | Streamer(TBuffer& b) |
void | StreamerNVirtual(TBuffer& b) |
virtual void | TObject::SysError(const char* method, const char* msgfmt) const |
Bool_t | TestAsymmetry(HRichAnalysis* showYou, HRichHit* pHit, Int_t amplit) |
Bool_t | TObject::TestBit(UInt_t f) const |
Int_t | TObject::TestBits(UInt_t f) const |
Bool_t | TestBorder(HRichAnalysis* showYou, HRichHit* pHit, Int_t amplit) |
Bool_t | TestDensity(HRichAnalysis* showYou, HRichHit* pHit) |
Bool_t | TestDynamic(HRichAnalysis* showYou, HRichHit* pHit, Int_t amplit) |
Bool_t | TestRatio(HRichAnalysis* showYou, HRichHit* pHit) |
Int_t | TestRing(HRichAnalysis* showYou, HRichHit* hit, Int_t amplit) |
Bool_t | TestRingCharge(HRichHit* hit) |
virtual void | TObject::UseCurrentStyle() |
virtual void | TObject::Warning(const char* method, const char* msgfmt) const |
virtual Int_t | TObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) |
virtual Int_t | TObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) const |
virtual void | TObject::DoError(int level, const char* location, const char* fmt, va_list va) const |
Double_t | HomogenDistr(Double_t left, Double_t right) |
void | TObject::MakeZombie() |
enum TObject::EStatusBits { | kCanDelete | |
kMustCleanup | ||
kObjInCanvas | ||
kIsReferenced | ||
kHasUUID | ||
kCannotPick | ||
kNoContextMenu | ||
kInvalidObject | ||
}; | ||
enum TObject::[unnamed] { | kIsOnHeap | |
kNotDeleted | ||
kZombie | ||
kBitMask | ||
kSingleKey | ||
kOverwrite | ||
kWriteDelete | ||
}; |
TList | fHitCandidate | |
TList | fHitList1 | |
TList | fHitList2 | |
TArrayI | iPadCol | |
TArrayI | iPadPlane | |
TArrayI | iPadPlaneCopy | |
TArrayI | iPadRow | |
Int_t | iRingNr | |
HRichHit* | pRings |
Int_t | d2_colrow_ij | |
Int_t | d2_colrow_jk | |
Int_t | d_col_ij | |
Int_t | d_col_jk | |
Int_t | d_row_ij | |
Int_t | d_row_jk | |
Float_t | fClusterLMax4 | |
Float_t | fClusterLMax8 | |
Float_t | fClusterSize | |
Int_t | fMaxClusterSize | |
Int_t | fMaxClusterSum | |
Int_t | fMaxThrClusterSize | |
Int_t | iCount | |
Int_t | iHitCount | |
Int_t | iInnerCount | |
Int_t | iInnerPhot4 | |
Int_t | iInnerPhot8 | |
Int_t | iMatrixHalfSize | |
Int_t | iMatrixSize | |
TArrayI | iPadActive | |
Int_t | iRingImageSize | |
TArrayI | iRingTempImage | |
Int_t | lx_from | |
Int_t | lx_to | |
Int_t | ly_from | |
Int_t | ly_to | |
Int_t | maxCols | |
Int_t | maxRings | max number of rich hits in pRings array |
Int_t | maxRows | |
HRichAnalysisPar* | pAnalysisParams | |
HRichGeometryPar* | pGeometryParams | |
Float_t | phiMeanMax | |
Float_t | thetaMeanMax | |
Float_t | xMeanMax | |
Float_t | xPadMeanMax | |
Float_t | yMeanMax | |
Float_t | yPadMeanMax |
According to the settings in the HRichAnalysisPar parameter container, ring finding algorithms are executed. - Ring candidates found by the pattern matrix are stored in the list fHitList1 - Ring candidates found by the hough trasfomation are stored in the list fHitList2 At the end the two list of candidates are merged according to the analysis parameter (see comment in MatchRings)
Ring recognition algorithm: Pattern Matrix
Ring recognition algorithm: Hough Transform
This function looks for local maxima among 8 neighbouring pads in the "in" array (iPadPlabe) "and fills the output "out" array. The iPadPlane contains the pads that correpond to the ring center each with its specific weight. Among them the Local Maxima is sought. The "out" array is created here in such a way that the amplitude of a local maximum is copied from input "in" array (iPdaPlane), the pads that are not local maxima are marked with '-1'. The pads that havent been fired are marked with '0'. The parameters of local maxima are first put to the list fHitCandidate of HRichHitCandidate objects. The list is sorted by descending ring quality and only the rings that are at a minimal distance of "distance" from each other are stored in a "hitList".
This function is used to label the clusters of the local maxima. The pads corresponding to a L.M. were labeled in the MaxFinding function and their values stored in "out" array. A label is assigned to each L.M. (hit) belonging to the list "hitList" (this list has been filled at the end of the member function MaxFinding) and this label must be now propagated to all pads belonging to the L.M cluster. The condition to be fullfilled in order to belong to a cluster is that the pads are reachable from the maximum (L.M.) in a descending monotonous way. If a pad belongs to more than one clusters it is marked with '-2'. At the end all the connected fired pads of a local maximum are marked with the label of this maximum (even if they are '-2'. In case of a conflict (possible only if two maxima are separated by one pad) the label of maximum with higher amplitude is assigned to the pads. The propagation of a label is done in a similar way as in the case of cleaning algorithm (high amplitude clusters).
This function is called by MaxSelector recursively to propagate given label "maxCode" of a l.m. to all pads beloning to the l.m cluster. All these pads are marked with '-1' in the "out" array. If the pad marked earlier by a label from another maximum is reached it is marked as a common pad with '-2'. The label is propagated as long as the value of the weight of the concatenated pads is monotonous.
This is an auxiliary function called by MaxSelector only. It returns the amplitude of a local maximum labeled with "maxCode".
The function analyses local maximum cluster, calculating the mean position of a maximum, weighted by the amplitude of pads in cluster, also cluster size and the amplitude sum of the pads belonging to a cluster. The data are stored in HRichHit structure.
Function called recursively from MaxAnalysis to analyse features of local maxima clusters; similar to MaxMarker.
All the rings that have been found by the 2 algorhtms and then further analyzed, are tested. There are five tests at the moment and they are active if their Status is set to 1 or 2. If Status == 1 a given test is performed and the result is stored in the HRichHit structure. If Status == 2, the test result must be positive to store the hit candidate in the output file. If Status == 0 the test is not performed and the information stored in HRichHit can be false or true, depending on the test (see tests for details).
If density (ratio: fired pads / all active pads) in label larger than 2*Sm - see below - exceeds 40%, ring recognition is not performed. For small labels like < 2*(pattern matrix surface) this test is not performed.
Basic check for the ring amplitude. Reduction of the threshold amplitude at the borders of the detector is applied, proportionally to the part of a ring which is cut (outside). Maximum reduction is by 50% (it means half or more of a ring can be still recognised. If there is more than a half of a ring outside it must have iRingQuality >= amplit (without any threshold reduction) to be accepted. Additionally in this test fBorderFactor is written to a hit !
The dynamic minimal (threshold) amplitude (quality) is estimated here if called with amplit > 0 and for rings that are mainly not outside. It is calculated due to highly fenomenological formula: threshold Amplitude = amplit * e^( P1*(S/Sm - 1) + P2*(D/P3 - 1) ) where P1 - parameter (0.055) P2 - parameter (0.5) Sm = ring pattern matrix surface (in number of pads units) S = number of pads in given labeled area P3 = mean density (ratio: pads fired / all pads) for ring matrix area ~0.15 D = density of fired pads for given labeled area
This part calculates how many fired pads belong to ring in comparison with the number of fired pads outside and inside. The area of ringMask is scanned. In it the fired pads outside/inside of ring must not to exceed i.e. 33% of total number of fired pads in this area - at least 67% has to be inside of ring border. If ring is outside the test is not done (always positive).
The asymmetry of ring is investigated. The centroid of the ring is defined by the difference in X and Y coordinates between the ring center and the center of gravity of the ring. In order to get a positive decision from the test the distance must be lower than iRingRadiusError given in input data. Then a ring radius is calculated and it also has to fit in the value iRingRadius +/- iRingRadiusError. If a ring is clearly outside the border the test is not done (always positive). REMARK: ring radius and ring centroid are calculated ONLY for rings inside the frame! If the ring candidate is placed partially outside zero values for its radius and centroid are stored in HRichHit.
Average charge of ring candidate is checked, minimum and maximum value are set in the richanalysispar.txt.
This method calculates for each ring candidate: 1) the number of fired pads that belong to the ring (all fired pads in the region 13X13 centered in the ring center) 2) the total charge of the ring obtained summing up all the charges of the pads that belong to the ring. 3) the number of photon local maxima among 5 pads, that should correspond to the number of photon in one ring 4) the number of photon local maxima among 9 pads. It is called at the end of the RingFindHoughTransf and RingFindFitMatrix function, after the lists of candidate have been filled and all properties calculated
If both algorithms are active and iSuperiorAlgorithmID = 3 then hit with iRingAlgorithmIndex = 3 is Pattern Matrix information hit with iRingAlgorithmIndex = 4 is Hough Transform information iSuperiorAlgorithmID = 3 means all rings found independently by two algorithms are stored. If both algorithms are active and iSuperiorAlgorithmID = 1 or 2 then only rings found by both algorithms are stored. If iSuperiorAlgorithmID = 1 information is taken from Pattern Matrix and iRingAlgorithmIndex = 5. If iSuperiorAlgorithmID = 2 information is taken from Hough Transform and iRingAlgorithmIndex = 6. This distinction is made because the position of a ring found by both algorithms may slightly differ and therefore also ring parameters may differ. If only one algorithm is active then iSuperiorAlgorithmID flag is ignored and rings found by the active algorithm are stored. If it is Pattern Matrix iRingAlgorithmIndex = 1 and in the case of Hough Transform iRingAlgorithmIndex = 2. In general if iRingAlgorithmIndexis is odd (1,3,5) information on a ring found by Pattern Matrix algorithm is stored and if iRingAlgorithmIndexis is even (2,4,6) information on a ring found by Hough Transform algorithm is stored.
the function calculates the total number of pads and photon local maxima (4 and 8-connected pads), for all the clusters that belong to a ring.
this method tests the quality of candidates close
to bright rings. Picking up some intensity of the
bright ring fakes could be identified.
If the quality of these "fakes" candidates is too
low compared with the quality of the bright ring
the candidates are rejected ( if the isActiveFakesRejection
is equal 2) or stored and labeled with a flag.
If the quality of the 2 compared rings is similar
the centroid of both is checked, if one of the two is
very assymmetric is rejected.