1 #include "StGammaEEmcLeakage.h"
4 #include "StEEmcUtil/EEmcGeom/EEmcGeomSimple.h"
5 #include "StGammaTower.h"
25 StGammaEEmcLeakage::StGammaEEmcLeakage()
28 const Char_t *fname =
"/afs/rhic.bnl.gov/star/users/jwebb/2008/tower-leakage/eemc-shape.root";
29 const Int_t numberOfEtabins=12;
31 mFile=
new TFile(fname);
34 mNumberOfEtabins=numberOfEtabins;
35 for ( Int_t i=0;i<numberOfEtabins;i++ )
37 mEnergyFractions.push_back( (TH2F*)mFile->Get( Form(
"h12TC%02ifrac",i+1) ) );
38 mEnergyFractions.back()->Print();
43 StGammaEEmcLeakage::~StGammaEEmcLeakage()
45 mEnergyFractions.clear();
53 const Float_t zplane = 288.0;
55 TVector3 position = gamma;
56 position.SetMagThetaPhi( zplane / position.CosTheta(),
61 Int_t tSec, tSub, tEta;
62 if ( !mEEmcGeom -> getTower( position, tSec, tSub, tEta ) )
return 0.0;
64 TVector3 tTower = mEEmcGeom->
getTowerCenter( (UInt_t)tSec, (UInt_t)tSub, (UInt_t)tEta );
66 tTower.SetMagThetaPhi( zplane / tTower.CosTheta(),
71 TH2F *hFraction = mEnergyFractions[ tEta ];
75 Float_t phi = TVector2::Phi_mpi_pi( position.Phi() - tTower.Phi() );
78 Float_t D_eta = position.Perp() * TMath::Cos( phi ) - tTower.Perp();
79 Float_t D_phi = position.Perp() * TMath::Sin( phi );
83 Int_t bin1 = hFraction -> FindBin( +D_phi, D_eta );
84 Int_t bin2 = hFraction -> FindBin( -D_phi, D_eta );
88 Int_t nmax=hFraction->GetNbinsX();
89 Int_t nmay=hFraction->GetNbinsY();
91 if ( bin1<=0 || bin2<=0 ) {
92 std::cout <<
"bin <= 0" << std::endl;
95 if ( bin1 > nmax || bin2 > nmax ) {
96 std::cout <<
"bin > max" << std::endl;
100 Float_t frac1 = hFraction -> GetBinContent( bin1 );
101 Float_t frac2 = hFraction -> GetBinContent( bin2 );
103 Float_t f = (frac1+frac2)/2.0;
107 std::cout <<
"=========================================================+" << std::endl;
108 std::cout <<
"frac=" << f << std::endl;
111 std::cout <<
"D_eta=" << D_eta<<
" D_phi=" << D_phi << std::endl;
112 std::cout <<
"bin1=" << bin1 <<
" bin2=" << bin2 <<
" frac1=" << frac1 <<
" frac2=" << frac2 << std::endl;
130 const Float_t zplane = 288.0;
131 TVector3 position = gamma;
132 position.SetMagThetaPhi( zplane / position.CosTheta(),
138 Int_t tSec, tSub, tEta;
139 if ( !mEEmcGeom -> getTower( position, tSec, tSub, tEta ) )
return NULL;
142 TVector3 tTower = mEEmcGeom->
getTowerCenter( (UInt_t)tSec, (UInt_t)tSub, (UInt_t)tEta );
144 tTower.SetMagThetaPhi( zplane / tTower.CosTheta(),
150 TH2F *hFraction = mEnergyFractions[ tEta ];
151 TCanvas *c =
new TCanvas();
152 hFraction->Draw(
"colz");
156 Float_t phi = TVector2::Phi_mpi_pi( gamma.Phi() - tTower.Phi() );
159 Float_t D_eta = position.Perp() * TMath::Cos( phi ) - tTower.Perp();
160 Float_t D_phi = position.Perp() * TMath::Sin( phi );
162 TMarker *m=
new TMarker(D_phi,D_eta,22);
TVector3 getTowerCenter(const UInt_t sec, const UInt_t sub, const UInt_t etabin) const
TCanvas * draw(const TVector3 &gamma)
Float_t expectation(const TVector3 &gamma)