if (eRecoMode==1 && distZ>10) continue; in this reco mode we loop only over segment2 , since InBT and vtx are correlated!!!
1763 Log(3,
"EdbShowerAlg_GS::FindPairs",
"Starting FindPairs(InBT,eAli_Sub) now....");
1767 Int_t RecoShowerArrayN=0;
1776 Float_t x_av,y_av,z_av,tx_av,ty_av,distZ;
1778 Float_t IP_Pair_To_InBT=0;
1779 Float_t IP_Pair_To_InBT_Seg=0;
1780 Float_t IP_Pair_To_InBT_Seg2=0;
1781 Float_t IP_Pair_To_InBT_SegSum=0;
1782 Float_t IP_Pair_To_InBT_SegSmaller=0;
1783 Float_t IP_InBT_To_Vtx=0;
1784 Float_t IP_Seg1_To_Vtx=0;
1785 Float_t IP_Seg2_To_Vtx=0;
1787 Int_t NPairTriesTotal=0;
1788 Double_t paramsAC[6];
1789 Double_t paramsB[4];
1793 if (
NULL==InitiatorBT) {
1796 InBT->
SetX(pat->
X());
1797 InBT->
SetY(pat->
Y());
1798 InBT->
SetZ(pat->
Z());
1801 InBT->
SetMC(-999,-999);
1802 cout <<
"WARNING EdbShowerAlg_GS::FindPairs InBT==NULL. Created a dummy InBT:" << endl;
1819 if (
gEDBDEBUGLEVEL>2) cout <<
"EdbShowerAlg_GS::FindPairs eRecoMode==1: Propagate InBT half a plate back for the vertex." << endl;
1820 vtx->
SetXYZ(InBT->
X()-650*InBT->
TX(),InBT->
Y()-650*InBT->
TY(),InBT->
Z()-650);
1823 if (
gEDBDEBUGLEVEL>2) cout <<
"EdbShowerAlg_GS::FindPairs eRecoMode==0: Take InBT position for the vertex." << endl;
1825 vtx->
SetXYZ(InBT->
X(),InBT->
Y(),InBT->
Z());
1828 IP_InBT_To_Vtx=
CalcIP(InBT,vtx);
1846 Int_t pat_one_bt_cnt_max,pat_two_bt_cnt_max=0;
1852 for (Int_t pat_one_cnt=0; pat_one_cnt<
npat; ++pat_one_cnt) {
1857 distZ=pat_one->
Z()-InBT->
Z();
1859 cout <<
"EdbShowerAlg_GS::FindPairs Check if dist Z to vtx (BT) is ok: distZ=" << distZ << endl;
1862 if (distZ<-1000)
continue;
1867 if (
gEDBDEBUGLEVEL>2) cout <<
"EdbShowerAlg_GS::FindPairs pat_one_cnt=" << pat_one_cnt <<
" pat_one->Z() = " << pat_one->
Z() <<
" pat_one_bt_cnt_max= "<< pat_one_bt_cnt_max <<endl;
1871 for (Int_t pat_two_cnt=0; pat_two_cnt<
npat; ++pat_two_cnt) {
1874 if (TMath::Abs(pat_one_cnt-pat_two_cnt)>
eParaValue[5])
continue;
1879 distZ=pat_two->
Z()-InBT->
Z();
1881 if (distZ<-1000)
continue;
1883 if (
gEDBDEBUGLEVEL>2) cout <<
"EdbShowerAlg_GS::FindPairs pat_two_cnt=" << pat_two_cnt <<
" pat_two->Z() = " << pat_two->
Z() <<
" pat_two_bt_cnt_max= "<< pat_two_bt_cnt_max <<endl;
1887 for (Int_t pat_one_bt_cnt=0; pat_one_bt_cnt<pat_one_bt_cnt_max; ++pat_one_bt_cnt) {
1890 IP_Pair_To_InBT_Seg =
CalcIP(Segment,vtx);
1891 IP_Pair_To_InBT=IP_Pair_To_InBT_Seg;
1892 IP_Seg1_To_Vtx =
CalcIP(Segment,vtx);
1899 for (Int_t pat_two_bt_cnt=0; pat_two_bt_cnt<pat_two_bt_cnt_max; ++pat_two_bt_cnt) {
1905 if (Segment2==Segment)
continue;
1906 if (Segment2->
ID()==Segment->
ID()&&Segment2->
PID()==Segment->
PID())
continue;
1918 if ((Segment2->
Flag()+Segment->
Flag())!=0)
continue;
1928 distZ=Segment->
Z()-InBT->
Z();
1936 TObjArray *segments =
new TObjArray(2);
1937 segments->Add(Segment);
1938 segments->Add(Segment2);
1940 if (vetex ->
Z()> TMath::Min(Segment->
Z(),Segment2->
Z()) )
continue;
1943 x_av=Segment2->
X()+(Segment->
X()-Segment2->
X())/2.0;
1944 y_av=Segment2->
Y()+(Segment->
Y()-Segment2->
Y())/2.0;
1945 z_av=Segment2->
Z()+(Segment->
Z()-Segment2->
Z())/2.0;
1946 tx_av=Segment2->
TX()+(Segment->
TX()-Segment2->
TX())/2.0;
1947 ty_av=Segment2->
TY()+(Segment->
TY()-Segment2->
TY())/2.0;
1948 Segment_Sum->
SetX(x_av);
1949 Segment_Sum->
SetY(y_av);
1950 Segment_Sum->
SetTX(tx_av);
1951 Segment_Sum->
SetTY(ty_av);
1952 Segment_Sum->
SetZ(z_av);
1955 IP_Pair_To_InBT_Seg2 =
CalcIP(Segment2,vtx);
1956 if (IP_Pair_To_InBT_Seg2>
eParaValue[0])
continue;
1958 IP_Seg2_To_Vtx =
CalcIP(Segment2,vtx);
1959 IP_Pair_To_InBT_SegSum=
CalcIP(Segment_Sum, vtx);
1961 Float_t IP_Seg1ToVtxSeg1Seg2=0;
1962 Float_t IP_Seg2ToVtxSeg1Seg2=0;
1963 IP_Seg1ToVtxSeg1Seg2 =
CalcIP(Segment ,vetex);
1964 IP_Seg2ToVtxSeg1Seg2 =
CalcIP(Segment2,vetex);
1967 cout <<
"EdbShowerAlg_GS::FindPairs IP_Pair_To_InBT_Seg = " << IP_Pair_To_InBT_Seg << endl;
1968 cout <<
"EdbShowerAlg_GS::FindPairs IP_Pair_To_InBT_Seg2 = " << IP_Pair_To_InBT_Seg2 << endl;
1969 cout <<
"EdbShowerAlg_GS::FindPairs IP_Pair_To_InBT_SegSum= " << IP_Pair_To_InBT_SegSum << endl;
1970 cout <<
"EdbShowerAlg_GS::FindPairs IP_Seg1ToVtxSeg1Seg2= " << IP_Seg1ToVtxSeg1Seg2 << endl;
1971 cout <<
"EdbShowerAlg_GS::FindPairs IP_Seg2ToVtxSeg1Seg2= " << IP_Seg2ToVtxSeg1Seg2 << endl;
1975 if ( IP_Pair_To_InBT_Seg>IP_Pair_To_InBT_Seg2 ) {
1976 IP_Pair_To_InBT_SegSmaller=0;
1979 IP_Pair_To_InBT_SegSmaller=1;
1997 if (Segment2->
Flag()+Segment->
Flag()==0&&TMath::Abs(Segment2->
Flag())==11&&Segment->
MCEvt()>0) {
2000 else if (Segment2->
Flag()+Segment->
Flag()!=0&&TMath::Abs(Segment2->
Flag())==11&&Segment->
MCEvt()>0) {
2028 cout <<
"------------- Print eValueGSNN ------------- " << endl;
2031 cout <<
"------------- Print eValueGSNN_var00= " <<
eValueGSNN_var00 <<
" ---- " << endl;
2032 cout <<
"------------- Print eValueGSNN_var01= " <<
eValueGSNN_var01 <<
" ---- " << endl;
2033 cout <<
"------------- Print eValueGSNN_var02= " <<
eValueGSNN_var02 <<
" ---- " << endl;
2034 cout <<
"------------- Print eValueGSNN_var03= " <<
eValueGSNN_var03 <<
" ---- " << endl;
2035 cout <<
"------------- Print eValueGSNN_var04= " <<
eValueGSNN_var04 <<
" ---- " << endl;
2036 cout <<
"------------- Print eValueGSNN_var05= " <<
eValueGSNN_var05 <<
" ---- " << endl;
2072 cout <<
"EdbShowerAlg_GS::FindPairs ParamsB: ";
2073 for (
int hj=0; hj<nparams; hj++) cout <<
" " << paramsB[hj];
2075 cout <<
"EdbShowerAlg_GS::FindPairs value=eANNPair->Evaluate(0,params) = ";
2076 value=
eANNPair->Evaluate(0,paramsB);
2078 cout << value << endl;
2079 cout <<
"EdbShowerAlg_GS::FindPairs -------- " << endl;
2083 cout <<
"EdbShowerAlg_GS::FindPairs ParamsAC: ";
2084 for (
int hj=0; hj<nparams; hj++) cout <<
" " << paramsAC[hj];
2086 cout <<
"EdbShowerAlg_GS::FindPairs value=eANNPair->Evaluate(0,params) = ";
2087 value=
eANNPair->Evaluate(0,paramsAC);
2089 cout << value << endl;
2090 cout <<
"EdbShowerAlg_GS::FindPairs -------- " << endl;
2097 value=
eANNPair->Evaluate(0,paramsB);
2100 value=
eANNPair->Evaluate(0,paramsAC);
2116 cout <<
"EdbShowerAlg_GS::FindPairs This Pair has passed all cuts w.r.t to InBT:" << endl;
2117 cout <<
"EdbShowerAlg_GS::FindPairs IP_Pair_To_InBT = " << IP_Pair_To_InBT << endl;
2118 cout <<
"EdbShowerAlg_GS::FindPairs GetMinimumDist(Segment,Segment2) = " <<
GetMinimumDist(Segment,Segment2) << endl;
2119 cout <<
"EdbShowerAlg_GS::FindPairs CalcIP(Segment_Sum,InBT) = " << IP_Pair_To_InBT << endl;
2120 cout <<
"EdbShowerAlg_GS::FindPairs IP_Pair_To_InBT_Seg = " << IP_Pair_To_InBT_Seg << endl;
2121 cout <<
"EdbShowerAlg_GS::FindPairs IP_Pair_To_InBT_Seg2 = " << IP_Pair_To_InBT_Seg2 << endl;
2122 cout <<
"EdbShowerAlg_GS::FindPairs GetSpatialDist(Segment_Sum,InBT) = " <<
GetSpatialDist(Segment_Sum,InBT) << endl;
2123 cout <<
"EdbShowerAlg_GS::FindPairs IP_InBT_To_Vtx = " << IP_InBT_To_Vtx << endl;
2124 cout <<
"EdbShowerAlg_GS::FindPairs IP_Seg1_To_Vtx = " << IP_Seg1_To_Vtx << endl;
2125 cout <<
"EdbShowerAlg_GS::FindPairs IP_Seg2_To_Vtx = " << IP_Seg2_To_Vtx << endl;
2126 cout <<
"InBT: Print InBT: " << InBT ->
X() <<
" " << InBT ->
Y() <<
" " << InBT ->
Z() <<endl;
2127 cout <<
"Vtx: Print MC XYZ: " << vtx ->
MCEvt() <<
" " << vtx ->
X() <<
" " << vtx ->
Y() <<
" " << vtx ->
Z() <<endl;
2138 RecoShower -> AddSegment(Segment);
2139 RecoShower -> AddSegment(Segment2);
2141 RecoShower->
SetZ(TMath::Min(Segment->
Z(),Segment2->
Z()));
2142 RecoShower->
SetX(Segment_Sum->
X());
2143 RecoShower->
SetY(Segment_Sum->
Y());
2144 RecoShower->
SetTX(Segment_Sum->
TX());
2145 RecoShower->
SetTY(Segment_Sum->
TY());
2155 cout <<
"Added shower at " << RecoShower <<
" to reco shower array. Until now: ";
2156 cout << RecoShowerArrayN <<
" entries in it: Print Shower:" << endl;
2168 cout <<
"EdbShowerAlg_GS::FindPairs For the InBT/Vtx at __" << InBT <<
"__, we have searched " << NPairTriesTotal <<
" pair combinations in the PVRec volume." << endl;
2169 cout <<
"EdbShowerAlg_GS::FindPairs For the InBT/Vtx at __" << InBT <<
"__, we have found " <<
RecoShowerArray->GetEntries() <<
" compatible pairs in the PVRec volume." << endl;
2177 Log(3,
"EdbShowerAlg_GS::FindPairs",
"Starting FindPairs(InBT,eAli_Sub) now....done.");
Int_t npat
Definition: Xi2HatStartScript.C:33
Definition: EdbPattern.h:280
EdbPattern * GetPatternZLowestHighest(Bool_t lowestZ=kTRUE) const
Definition: EdbPattern.cxx:1982
Int_t Npatterns() const
Definition: EdbPattern.h:380
EdbPattern * GetPattern(int id) const
Definition: EdbPattern.cxx:1887
void SetPID(int pid)
Definition: EdbSegP.h:126
void SetY(Float_t y)
Definition: EdbSegP.h:175
void SetTX(Float_t tx)
Definition: EdbSegP.h:176
Int_t ID() const
Definition: EdbSegP.h:144
void SetID(int id)
Definition: EdbSegP.h:125
void SetX(Float_t x)
Definition: EdbSegP.h:174
void SetTY(Float_t ty)
Definition: EdbSegP.h:177
Float_t Z() const
Definition: EdbPattern.h:87
Float_t Y() const
Definition: EdbPattern.h:86
Int_t GetN() const
Definition: EdbPattern.h:65
EdbSegP * GetSegment(int i) const
Definition: EdbPattern.h:66
Float_t X() const
Definition: EdbPattern.h:85
Bool_t CheckPairDuplications(Int_t SegPID, Int_t SegID, Int_t Seg2PID, Int_t Seg2ID, TArrayI *SegmentPIDArray, TArrayI *SegmentIDArray, TArrayI *Segment2PIDArray, TArrayI *Segment2IDArray, Int_t RecoShowerArrayN)
Definition: EdbShowerAlg.cxx:1158
Float_t eANNPairCut[3]
Definition: EdbShowerAlg.h:221
Bool_t eCutModeFull
Definition: EdbShowerAlg.h:206
Double_t GetSpatialDist(EdbSegP *s1, EdbSegP *s2)
Definition: EdbShowerAlg.cxx:633
Float_t eParaValue[10]
Definition: EdbShowerAlg.h:41