==== Now loop over the Grouped plates and search for spectrum peaks in each groupedPlate...
Set the bin arrays for the Spectrum...
Fit each grouped Plate with Spectrum...
Fill interimSpectrum For Drawing... without the THRESHOLD_SMOOTHED_DEST Cut to find Maximum
Fill interimSpectrum For Drawing...only when Entry is > THRESHOLD_SMOOTHED_DEST * Maximum THRESHOLD_SMOOTHED_DEST is in % Units of Maxium...
==== Now loop over the Grouped plates and search for spectrum peaks in each groupedPlate...
Set the bin arrays for the Spectrum...
Fit each grouped Plate with Spectrum...
Fill interimSpectrum For Drawing... without the THRESHOLD_SMOOTHED_DEST Cut to find Maximum
Fill interimSpectrum For Drawing...only when Entry is > THRESHOLD_SMOOTHED_DEST * Maximum THRESHOLD_SMOOTHED_DEST is in % Units of Maxium...
1893{
1894 Log(2,
"ShowRec.cpp",
"--- void ReconstructShowers_CL() ---");
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913 Float_t BOXSIZE=50;
1914 Float_t ClusterBoxSizeX=BOXSIZE;
1915 Float_t ClusterBoxSizeY=ClusterBoxSizeX;
1916 Float_t ClusterBoxSize[]= {ClusterBoxSizeX,ClusterBoxSizeY};
1917
1918
1919
1920
1921 Float_t LeftX=-11000;
1922 Float_t RightX=21000;
1923 Float_t LeftY=-11000;
1924 Float_t RightY=16000;
1925
1926 cout << " ......."<<endl;
1927
1928 Float_t VIEWSIZE=1000;
1929 Float_t gAliSub_Length_X=VIEWSIZE;
1930 Float_t gAliSub_Length_Y=VIEWSIZE;
1931
1932
1933 Int_t NbinsX=Int_t((RightX-LeftX)/ClusterBoxSizeX);
1934 Int_t NbinsY=Int_t((RightY-LeftY)/ClusterBoxSizeY);
1935
1936
1937 cout << " ......."<<endl;
1938
1940 Int_t NbinsZ=NPLATES;
1941
1942
1943 Int_t NbinsX_gAliSub=Int_t((gAliSub_Length_X)/ClusterBoxSizeX);
1944 Int_t NbinsY_gAliSub=Int_t((gAliSub_Length_Y)/ClusterBoxSizeY);
1945
1946
1947 Float_t ** source = new float *[NbinsX];
1948 for (Int_t cnti=0; cnti<NbinsX; cnti++) {
1949 source[cnti]=new float[NbinsY];
1950 }
1951 Float_t ** dest = new float *[NbinsX];
1952 for (Int_t cnti=0; cnti<NbinsX; cnti++) {
1953 dest[cnti]=new float[NbinsY];
1954 }
1955
1956
1957 Float_t ** source_gAliSub = new float *[NbinsX_gAliSub];
1958 for (Int_t cnti=0; cnti<NbinsX_gAliSub; cnti++) {
1959 source_gAliSub[cnti]=new float[NbinsY_gAliSub];
1960 }
1961 Float_t ** dest_gAliSub = new float *[NbinsX_gAliSub];
1962 for (Int_t cnti=0; cnti<NbinsX_gAliSub; cnti++) {
1963 dest_gAliSub[cnti]=new float[NbinsY_gAliSub];
1964 }
1965
1966
1967 Bool_t FillTANData=kTRUE;
1968 cout << " ......."<<endl;
1969
1970
1971 Int_t PLATESPERGROUP=1;
1972 Int_t FIRSTPLATE=0;
1973 Int_t LASTPLATE=0;
1975 Int_t NGroupedPLATES=ceil( (Double_t)NPLATES/(Double_t)PLATESPERGROUP);
1976
1977
1978 Float_t* fPositionX;
1979 Float_t* fPositionY;
1980 Int_t fNPeaks;
1981
1982
1983 Float_t StartPosX,StartPosY,StartPosTX,StartPosTY;
1984
1985
1986 Float_t ZPosGroupedPlates[50];
1991
1992 for (Int_t i=0; i<NGroupedPLATES; i++) {
1995 cout << "i PLATESPERGROUP NGroupedPLATES ZPosGroupedPlates[i] " << i << " " << PLATESPERGROUP << " " << NGroupedPLATES << " " << ZPosGroupedPlates[i] << " " << endl;
1996 }
1997
2000 cout << "NbinsX = " << NbinsX << endl;
2001 cout << "NbinsY = " << NbinsY << endl;
2002 cout << "NbinsZ = " << NbinsZ << endl;
2003 cout << "NbinsX_gAliSub = " << NbinsX_gAliSub << endl;
2004 cout << "NbinsY_gAliSub = " << NbinsY_gAliSub << endl;
2005 cout << "FIRSTPLATE= "<<FIRSTPLATE<<endl;
2006 cout << "LASTPLATE= "<<LASTPLATE<<endl;
2007 cout <<
"MAXPLATE= "<<
MAXPLATE<<endl;
2008 cout << "NPLATES= "<<NPLATES<<endl;
2009 cout << "NGroupedPLATES= "<<NGroupedPLATES<<endl;
2010 cout << "PLATESPERGROUP= "<<PLATESPERGROUP<<endl;
2011 }
2013
2014
2015
2017
2021
2024
2025
2028
2029
2030
2031
2035 Float_t local_gAli_pat_interim_halfsize=0;
2036
2040
2041 TClonesArray *as;
2045
2046
2047
2048
2049
2050
2052
2053
2054
2058 if ((i%modulo)==0) cout << i <<" : 5% more done"<<endl;
2059 }
2060
2061
2062
2063
2065
2070
2071 Int_t local_NBT=0;
2072 Int_t local_NBTMC=0;
2073 Int_t local_NBTallMC=0;
2074 Int_t local_NBTeMC=0;
2075 float_t local_pure=-1;
2076 float_t local_purall=-1;
2077 Int_t npat_int=0;
2078 Int_t npat_total=0;
2079 Int_t npatN=0;
2080 Int_t npat_Neff=0;
2081 Int_t NBT_Neff=0;
2082 Int_t NBTMC_Neff=0;
2083 Int_t NBTMCe_Neff=0;
2084
2085
2087 cout << endl << endl << "--- Starting Shower for Number " << i << " now: "<<endl;
2089 }
2090
2091
2092
2093
2094
2096
2098
2099
2100
2101
2102
2103 StartPosX=InBT->
X();
2104 StartPosY=InBT->
Y();
2105 StartPosTX=InBT->
TX();
2106 StartPosTY=InBT->
TY();
2107
2108
2109
2110
2111
2112
2113 cout << "Reset now some other histos"<<endl;
2114 for (Int_t h=0; h<50; h++) {
2118 }
2119
2120 cout << "Reset now some other SetNameTitle "<<endl;
2124 Hist2DimOnlyBGAllPlates->SetBins( NbinsX_gAliSub, StartPosX-gAliSub_Length_X/2.0, StartPosX +gAliSub_Length_X/2.0, NbinsY_gAliSub, StartPosY-gAliSub_Length_Y/2.0, StartPosY +gAliSub_Length_Y/2.0);
2125 Hist2DimOnlySimOneEventAllPlates->SetBins( NbinsX_gAliSub, StartPosX-gAliSub_Length_X/2.0, StartPosX +gAliSub_Length_X/2.0, NbinsY_gAliSub, StartPosY-gAliSub_Length_Y/2.0, StartPosY +gAliSub_Length_Y/2.0);
2126 Hist2DimBGAndSimOneEventAllPlates->SetBins( NbinsX_gAliSub, StartPosX-gAliSub_Length_X/2.0, StartPosX +gAliSub_Length_X/2.0, NbinsY_gAliSub, StartPosY-gAliSub_Length_Y/2.0, StartPosY +gAliSub_Length_Y/2.0);
2127
2128 cout << "Reset now some other SetNameTitle "<<endl;
2130 Hist3DimOnlyBG->SetBins( NbinsX_gAliSub, StartPosX -gAliSub_Length_X/2.0, StartPosX +gAliSub_Length_X/2.0, NbinsY_gAliSub, StartPosY -gAliSub_Length_Y/2.0, StartPosY +gAliSub_Length_Y/2.0, NGroupedPLATES, (FIRSTPLATE-1)*1300, NbinsZ*1300);
2132 Hist3DimRecoEvent_gAli->SetBins( NbinsX, LeftX, RightX, NbinsY, LeftY, RightY, NGroupedPLATES, (FIRSTPLATE-1)*1300, (LASTPLATE)*1300);
2133
2134 cout << "Reset now some other SetNameTitle "<<endl;
2140
2141
2142
2143
2144
2145 Float_t InBT_X=InBT->
X();
2146 Float_t InBT_TX=InBT->
TX();
2147 Float_t InBT_X_Extrapolated;
2148 Float_t InBT_Y=InBT->
Y();
2149 Float_t InBT_TY=InBT->
TY();
2150 Float_t InBT_Y_Extrapolated;
2151 Float_t InBT_Z=InBT->
Z();
2152 for (Int_t h=0; h<NGroupedPLATES; h++) {
2153
2154 Float_t zdiff=ZPosGroupedPlates[h]-InBT_Z;
2155 InBT_X_Extrapolated=InBT_X+InBT_TX*zdiff;
2156 InBT_Y_Extrapolated=InBT_Y+InBT_TY*zdiff;
2157 cout << "h InBT_X InBT_TX InBT_Z ZPosGroupedPlates[h] zdiff InBT_X_Extrapolated " << h << " " << InBT_X << " " << InBT_TX << " " << InBT_Z << " " << ZPosGroupedPlates[h] << " " << zdiff << " " <<InBT_X_Extrapolated << endl;
2158 cout << "h InBT_Y InBT_TY InBT_Z ZPosGroupedPlates[h] zdiff InBT_Y_Extrapolated " << h << " " << InBT_Y << " " << InBT_TY << " " << InBT_Z << " " << ZPosGroupedPlates[h] << " " << zdiff << " " <<InBT_Y_Extrapolated << endl;
2159 Hist2DimOnlyBGOneGroupedPlate[h]->SetBins(NbinsX_gAliSub, InBT_X_Extrapolated-gAliSub_Length_X/2.0,InBT_X_Extrapolated+gAliSub_Length_X/2.0, NbinsY_gAliSub,InBT_Y_Extrapolated-gAliSub_Length_Y/2.0,InBT_Y_Extrapolated+gAliSub_Length_Y/2.0);
2160 Hist2DimOnlySimOneEventOneGroupedPlate[h]->SetBins(NbinsX_gAliSub, InBT_X_Extrapolated-gAliSub_Length_X/2.0,InBT_X_Extrapolated+gAliSub_Length_X/2.0, NbinsY_gAliSub,InBT_Y_Extrapolated-gAliSub_Length_Y/2.0,InBT_Y_Extrapolated+gAliSub_Length_Y/2.0);
2161 Hist2DimBGAndSimOneEventOneGroupedPlate[h]->SetBins(NbinsX_gAliSub, InBT_X_Extrapolated-gAliSub_Length_X/2.0,InBT_X_Extrapolated+gAliSub_Length_X/2.0, NbinsY_gAliSub,InBT_Y_Extrapolated-gAliSub_Length_Y/2.0,InBT_Y_Extrapolated+gAliSub_Length_Y/2.0);
2162 }
2163
2164
2165
2166
2167
2168
2169
2170 Int_t val, val_tan;
2171 Int_t local_gAli_npat=local_gAli->
Npatterns();
2172 if (
gEDBDEBUGLEVEL>2) cout <<
"--- local_gAli_npat= " << local_gAli_npat << endl;
2173
2174
2175
2176 for (Int_t patterloop_cnt=local_gAli_npat-1; patterloop_cnt>=0; --patterloop_cnt) {
2177 if (
gEDBDEBUGLEVEL>3) cout <<
"--- --- Doing patterloop_cnt= " << patterloop_cnt << endl;
2178
2181
2182 cout <<
"===DEBUG patterloop_cnt= " << patterloop_cnt <<
" Z pos (k) " << local_gAli->
GetPattern(patterloop_cnt)->
Z() << endl;
2183 cout << "===DEBUG (patterloop_cnt) EdbSegments in the Pattern (total): " << as->GetEntries() << endl;
2184
2185 for (Int_t h=0; h<as->GetEntries(); h++) {
2189 cout << "entry, val "<<h << " " << val<<endl;
2192 if (FillTANData) {
2194 cout << "(TAN) entry, val_tan "<<h << " " << val_tan<<endl;
2195 if (val_tan>=NGroupedPLATES) {
2197 ++val_tan;
2198 cout << "(TAN) val_tan changed to "<<h << " " << val_tan<<endl;
2199 }
2202 }
2203 if (sa->
MCEvt()<0)
continue;
2205 cout <<
"=== ==DEBUG Filling i with MCEvt "<< i <<
"("<<
GLOBAL_InBT_MC <<
") X,Y,Z: "<<sa->
X()<<
" "<<sa->
Y()<<
" "<<sa->
Z()<<
" "<<sa->
MCEvt()<<
" to val= " <<val <<endl;
2207 if (FillTANData) {
2209 }
2210 }
2211
2212 }
2213
2214
2215 cout<<endl<<endl;
2216 cout <<"Loop over the Grouped plates and search for spectrum peaks in each groupedPlate."<<endl;
2219 for (Int_t h=0; h<NGroupedPLATES; h++) {
2220
2222 for (Int_t cnti = 0; cnti < NbinsX_gAliSub; cnti++) {
2223 for (Int_t cntj = 0; cntj < NbinsY_gAliSub; cntj++) {
2224 source[cnti][cntj] = 0;
2225 dest[cnti][cntj] = 0;
2227 }
2228 }
2231 Int_t nfound=0;
2232 cout << " Do now peak search..."<<endl;
2233 nfound =
spectrum2dim->SearchHighRes(source, dest, NbinsX_gAliSub, NbinsY_gAliSub, 2, 20, kTRUE, 10, kFALSE, 5);
2234 cout << " Peak search finished. Go on."<<endl;
2239 Int_t interimsbin=0;
2240 TAxis *xax;
2241 TAxis *yax;
2242 TAxis *zax;
2243 Double_t xax_bin_value;
2244 Double_t yax_bin_value;
2245 Double_t zax_bin_value;
2246 Double_t value;
2247
2249 for (Int_t ii = 0; ii < NbinsX_gAliSub; ii++) {
2250 for (Int_t jj = 0; jj < NbinsY_gAliSub; jj++) {
2251 value=dest[ii][jj];
2253 }
2254 }
2255 Float_t THRESHOLD_SMOOTHED_DEST=0.5;
2256 cout <<
"THRESHOLD_SMOOTHED_DEST spectrum_interim->GetMaximum() : " << THRESHOLD_SMOOTHED_DEST <<
" " <<
spectrum_interim->GetMaximum()<< endl;
2257 cout << "----------_"<<endl;
2258
2260
2263 for (Int_t ii = 0; ii < NbinsX_gAliSub; ii++) {
2264 for (Int_t jj = 0; jj < NbinsY_gAliSub; jj++) {
2265
2266 if (dest[ii][jj]<THRESHOLD_SMOOTHED_DEST*spec_int_maximum) continue;
2267 value=dest[ii][jj];
2271 zax_bin_value=ZPosGroupedPlates[h];
2272
2274 }
2275 }
2276 cout <<
"THRESHOLD_SMOOTHED_DEST spectrum_interim->GetMaximum() : " << THRESHOLD_SMOOTHED_DEST <<
" " <<
spectrum_interim->GetMaximum()<< endl;
2277 cout << "----------_"<<endl;
2278
2279
2280
2281 }
2284
2285
2286
2287
2288
2289 return;
2290
2291
2292
2293
2294
2295 if (
gEDBDEBUGLEVEL>2) cout <<
"--- local_gAli_npat= " << local_gAli_npat << endl;
2296
2297
2298
2299 for (Int_t patterloop_cnt=local_gAli_npat-1; patterloop_cnt>=0; --patterloop_cnt) {
2300 if (
gEDBDEBUGLEVEL>3) cout <<
"--- --- Doing patterloop_cnt= " << patterloop_cnt << endl;
2301
2302 for (Int_t btloop_cnt=0; btloop_cnt<local_gAli->
GetPattern(patterloop_cnt)->
GetN(); ++btloop_cnt) {
2305
2306
2309
2310
2311
2312
2313
2314 if (seg->
X()==InBT->
X()&&seg->
Y()==InBT->
Y()) {
2315 ;
2316 }
2317 else {
2319 }
2320 }
2321
2323 CalcTrackDensity(pat_interim,local_gAli_pat_interim_halfsize,npat_int,npat_total,npatN);
2324
2325
2327 }
2328
2330
2331
2332
2333
2334
2335
2337 Int_t NBT=0;
2338 Int_t NBTMC=0;
2339 Int_t NBTallMC=0;
2340 Int_t NBTeMC=0;
2341 Double_t eff, purall, pure;
2343
2344
2350 }
2352 }
2353
2354
2355
2356
2357
2360
2361
2362
2363
2364
2367 }
2368
2369
2370
2371
2372
2373
2376 delete local_gAli;
2377 local_gAli=0;
2379
2380 }
2381
2382
2383
2387
2388
2389 return;
2390}
void Reco_CL_BuildGlobalHistogramsOnHeap()
Definition: ShowRec.cpp:1872
Int_t Reco_CL_AssignZValueToGroup(Double_t z, Double_t z0, Int_t NGroupedPLATES, Int_t PLATESPerGroup)
Definition: ShowRec.cpp:1860
TH2F * spectrum_interim
Definition: ShowRec.h:358
TH3F * Hist3DimRecoEvent_gAli
Definition: ShowRec.h:354
TH3F * Hist3DimOnlyBG
Definition: ShowRec.h:353
TH2F * Hist2DimBGAndSimOneEventAllPlates
Definition: ShowRec.h:349
TH2F * Hist2DimOnlyBGAllPlates
Definition: ShowRec.h:347
TH2F * Hist2DimOnlySimOneEventAllPlates
Definition: ShowRec.h:348
TSpectrum2 * spectrum2dim
Definition: ShowRec.h:357
TClonesArray * GetSegments() const
Definition: EdbPattern.h:69
int MAXPLATE
Definition: shower_btr.C:19