diff --git a/examples/compare.C b/examples/compare.C deleted file mode 100644 index 1664415a39d83b728b5c1188c153bc160c29ea1c..0000000000000000000000000000000000000000 --- a/examples/compare.C +++ /dev/null @@ -1,147 +0,0 @@ -{ - TFile* f = new TFile("hodtest.root"); - - TCanvas *c1 = new TCanvas("c1", "Shower Hit Maps", 1000, 1200); - c1->Divide(2, 3); - - TH1F *h1[6]; - TH1F* h[6]; - - for(int l = 0; l < 6; l++){ - h1[l] = new TH1F("","",13,0.4,13.4); - } - Double_t mean = 0.; - Double_t hits; - Double_t raw[13] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}; - Double_t ratio[77]; - Double_t err[77]; - - -//with peds and scalers -// double v[6][13] = { -// {679, 2016, 2439, 2446, 2369, 2179, 2045, 1953, 1723, 1618, 1465, 1241, 1061}, //hcalapos -// {0, 2125, 2521, 2420, 2364, 2006, 1935, 1911, 1769, 1536, 1450, 1242, 1090}, //hcalaneg -// {803, 2069, 2446, 2422, 2188, 1986, 2043, 1881, 1736, 1630, 1455, 1130, 1086}, //hcalbpos -// {788, 2034, 2372, 2217, 2141, 2002, 1956, 1938, 1700, 1605, 1442, 1219, 952}, //hcalbneg -// {915, 1964, 2276, 2066, 2122, 1880, 1969, 1854, 1576, 1500, 1403, 1189, 875}, //hcalcpos -// {7187, 1748, 1890, 1852, 1786, 1573, 1525, 1510, 1376, 1432, 1191, 1033, 809} //hcaldpos -// }; - - double v[6][13] = { - {747, 2212, 2688, 2698, 2602, 2400, 2228, 2131, 1910, 1763, 1605, 1382, 1179}, //hcalapos - {0, 2334, 2784, 2673, 2599, 2215, 2107, 2079, 1958, 1672, 1584, 1384, 1211}, //hcalaneg - {882, 2285, 2709, 2650, 2405, 2184, 2230, 2062, 1921, 1789, 1589, 1252, 1204}, //hcalbpos - {866, 2244, 2632, 2430, 2354, 2207, 2127, 2127, 1888, 1757, 1578, 1345, 1054}, //hcalbneg - {1006, 2171, 2529, 2262, 2302, 2070, 2149, 2024, 1732, 1634, 1543, 1323, 957}, //hcalcpos - {7913, 1918, 2084, 2027, 1947, 1739, 1668, 1646, 1521, 1572, 1302, 1136, 887} //hcaldpos - }; - - - // //Without thresholds - // double v[6][13] = { - // {679, 2296, 2439, 2446, 2369, 2179, 2045, 1953, 1723, 1618, 1465, 1241, 1061}; - // {0, 2125, 2521, 2420, 2364, 2006, 1935, 1911, 1769, 1536, 1450, 1242, 1090}; - // {803, 2069, 2446, 2422, 2188, 1986, 2043, 1881, 1736, 1630, 1455, 1130, 1086}; - // {788, 2034, 2372, 2217, 2141, 2002, 1956, 1938, 1700, 1605, 1442, 1219, 952}; - // {915, 1964, 2276, 2066, 2122, 1880, 1969, 1854, 1576, 1500, 1403, 1189, 875}; - // {12633, 1748, 1890, 1852, 1786, 1573, 1525, 1510, 1376, 1432, 1191, 1033, 809}; - - h[0] = chposadc1; - h[1] = chnegadc1; - h[2] = chposadc2; - h[3] = chnegadc2; - h[4] = chposadc3; - h[5] = chposadc4; - - - for (int j = 0; j < 6; j++){ - c1->cd(j+1); - h[j]->SetFillColor(kGreen); - h[j]->SetFillStyle(3345); - h[j]->Draw(); - - for(int k = 0; k < 13; k++){ - for(int i = 0; i < v[j][k]; i++){ - hits = raw[k]-0.1; - h1[j]->Fill(hits); - } - } - h1[j]->SetFillColor(kBlue); - h1[j]->SetFillStyle(3354); - h1[j]->Draw("same"); - } - -for (int i = 1; i < 14; i++){ -cout << "hitsC = " << h[0].GetBinContent(i) << endl; -} - - -/* -int n = 0; -Double_t errC; -Double_t errE; -Double_t hitsC; -Double_t hitsE; -Double_t hitsCmean = 1876.81; -Double_t hitsEmean = 1783.7; -Double_t sum1 = 0.; //chislitel -Double_t sum2 = 0.; -Double_t sum3 = 0.; -Double_t chan[77]; -Double_t r; - - for (Int_t l = 0; l < 6; l++){ -// cout << "ADC" << l+1 << ": " << endl; - for (Int_t i = 1; i < h[l].GetNbinsX() +1; i++){ - hitsC = h[l].GetBinContent(i); - hitsE = h1[l].GetBinContent(i); - if (hitsC > 0 && hitsE > 0){ - errC = 1./sqrt(hitsC); - errE = 1./sqrt(hitsE); - ratio[n] = hitsC/hitsE; -//cout << "errC = " << errC << ", errE = " << errE << "corr = " << errC*errE << endl; - err[n] = sqrt((errC**2 + errE**2 - 2*errC*errE))*ratio[n]; - mean = mean + ratio[n]; - - - - -sum1 = sum1 + (hitsC - hitsCmean)*(hitsE - hitsEmean); -sum2 = sum2 + (hitsC - hitsCmean)**2; -sum3 = sum3 + (hitsE - hitsEmean)**2; -// hitsCmean = hitsCmean + hitsC; -// hitsEmean = hitsEmean + hitsE; - chan[n] = n*1.; - n++; - } - //cout << "Hits ratio C++/ENGINE = " << err[l][i] << endl; - } - } -mean = mean/n; -//hitsCmean = hitsCmean/n; -//hitsEmean = hitsEmean/n; -r = sum1/sqrt(sum2*sum3); -cout << "r = " << r << endl; - -c1->Update(); -TCanvas *c2 = new TCanvas("c2", "RATIO", 1200, 800); -c2->cd(); -// create the TGraphErrors and draw it -gr = new TGraphErrors(n,chan,ratio,0,err); -//gr->SetLineColor(8); -gr->SetMarkerStyle(20); - TAxis *xaxis = gr->GetXaxis(); - TAxis *yaxis = gr->GetYaxis(); - //xaxis->SetLimits(10, 60); - xaxis->SetTitle("Channel"); - yaxis->SetTitle("Hits ratio (C++/Engine)"); -yaxis->SetTitleOffset(1.2); - -gr->Draw("AP"); - - TF1 *f1 = new TF1("f1","1.0527",0.,77.); - f1->Draw("same"); - -c2->Update(); -*/ -} diff --git a/src/THcShower.cxx b/src/THcShower.cxx index d0b6e2b13675246d68602d37a2761c98b08a153e..23dde2ce7011eef1f4ef815530c1953e6c57c4a4 100644 --- a/src/THcShower.cxx +++ b/src/THcShower.cxx @@ -155,6 +155,20 @@ Int_t THcShower::ReadDatabase( const TDatime& date ) prefix[0]=tolower(GetApparatus()->GetName()[0]); prefix[1]='\0'; + { + DBRequest list[]={ + {"cal_num_neg_columns", &fNegCols, kInt}, + {"cal_slop", &fSlop, kDouble}, + {"cal_fv_test", &fvTest, kDouble}, + {0} + }; + gHcParms->LoadParmValues((DBRequest*)&list, prefix); + } + + cout << "Number of neg. columns = " << fNegCols << endl; + cout << "Slop parameter = " << fSlop << endl; + cout << "Fiducial volum test flag = " << fvTest << endl; + BlockThick = new Double_t [fNLayers]; fNBlocks = new Int_t [fNLayers]; fNLayerZPos = new Double_t [fNLayers]; @@ -476,11 +490,11 @@ Int_t THcShower::ApplyCorrections( void ) } //_____________________________________________________________________________ -Double_t THcShower::TimeWalkCorrection(const Int_t& paddle, - const ESide side) -{ - return(0.0); -} +//Double_t THcShower::TimeWalkCorrection(const Int_t& paddle, +// const ESide side) +//{ +// return(0.0); +//} //_____________________________________________________________________________ Int_t THcShower::CoarseProcess( TClonesArray& ) //tracks diff --git a/src/THcShower.h b/src/THcShower.h index 744f17e6048e0d1567f0de68894e6dc04ad3eb9b..9c641fbf3915f12882c1847d5c7e293ed0546c5f 100644 --- a/src/THcShower.h +++ b/src/THcShower.h @@ -35,7 +35,8 @@ public: const TClonesArray* GetTrackHits() const { return fTrackProj; } Int_t GetNBlocks(Int_t plane) const { return fNBlocks[plane-1];} - friend class THaScCalib; + + // friend class THaScCalib; not needed? Int_t fGetPedLimit(Int_t NBlock, Int_t NLayer, Int_t Side) { if (Side!=0&&Side!=1) { @@ -73,13 +74,16 @@ protected: char** fLayerNames; Int_t fNLayers; - Int_t fNRows; + // Int_t fNRows; fNBlocks is used instead Double_t* fNLayerZPos; // Z position of front of shower counter layers Double_t* BlockThick; // Thickness of shower counter blocks, blocks Int_t* fNBlocks; // Number of shower counter blocks per layer Int_t fNtotBlocks; // Total number of shower counter blocks Double_t** YPos; //X,Y positions of shower counter blocks Double_t* XPos; + Int_t fNegCols; //number of columns with PMTTs on the negative side only. + Double_t fSlop; //Track to cluster vertical slop distance. + Int_t fvTest; //fiducial volume test flag THcShowerPlane** fPlanes; // List of plane objects @@ -108,10 +112,10 @@ protected: virtual Int_t ReadDatabase( const TDatime& date ); virtual Int_t DefineVariables( EMode mode = kDefine ); - enum ESide { kLeft = 0, kRight = 1 }; + // enum ESide { kLeft = 0, kRight = 1 }; - virtual Double_t TimeWalkCorrection(const Int_t& paddle, - const ESide side); + // virtual Double_t TimeWalkCorrection(const Int_t& paddle, + // const ESide side); void Setup(const char* name, const char* description); diff --git a/src/THcShowerPlane.h b/src/THcShowerPlane.h index 7e4c196c66d37010b0929e29a3081ea66721b53e..baf59531bb0d2f0c453c7975e4a855b216416cc1 100644 --- a/src/THcShowerPlane.h +++ b/src/THcShowerPlane.h @@ -35,7 +35,7 @@ class THcShowerPlane : public THaSubDetector { virtual Int_t CoarseProcess( TClonesArray& tracks ); virtual Int_t FineProcess( TClonesArray& tracks ); - Bool_t IsTracking() { return kFALSE; } + Bool_t IsTracking() { return kFALSE; } virtual Bool_t IsPid() { return kFALSE; } virtual Int_t ProcessHits(TClonesArray* rawhits, Int_t nexthit); @@ -84,6 +84,3 @@ class THcShowerPlane : public THaSubDetector { ClassDef(THcShowerPlane,0) }; #endif - - -