52 #include "St_emc_Maker.h"
53 #include "St_DataSetIter.h"
56 const TString detname[] = {
57 "bemc",
"bprs",
"bsmde",
"bsmdp",
58 "eemc",
"eprs",
"esmde",
"esmdp"
61 St_emc_Maker::St_emc_Maker(
const char *name,
const char *title):
StMaker(name,title){
65 St_emc_Maker::~St_emc_Maker(){ }
67 Int_t St_emc_Maker::Init(){
70 const char *title_h[] = {
71 "Barrel EMC hits",
"Barrel PRS hits",
"Barrel SMD-Eta hits",
"Barrel SMD-Phi hits",
72 "Endcap EMC hits",
"Endcap PRS hits",
"Endcap SMD-u hits",
"Endcap SMD-v hits"};
73 const char *title_e[] = {
74 "Barrel EMC energy",
"Barrel PRS energy",
"Barrel SMD-Eta energy",
"Barrel SMD-Phi energy",
75 "Endcap EMC energy",
"Endcap PRS energy",
"Endcap SMD-u energy",
"Endcap SMD-v energy"};
76 const Int_t nx[] = {40,40,300,20,12,12,12,12};
77 const Float_t xl[] = {-1.0,-1.0,-1.0,-1.0, 0.5 , 0.5, 0.5, 0.5};
78 const Float_t xu[] = { 1.0, 1.0, 1.0, 1.0, 12.5,12.5,12.5,12.5};
79 const Int_t ny[] = {120, 120, 60, 900, 60, 60, 60, 60};
80 m_nhit =
new TH2F(
"EmcNHitsVsDet" ,
"Number of hit(log) .vs. Detector #",100,0.0,4.5,8,0.5,8.5);
81 m_etot =
new TH2F(
"EmcEtotVsDet" ,
"Total energy(log) .vs. Detector #",100,-4.0,4.5,8,0.5,8.5);
82 for (i=0; i<MAXDET; i++){
83 TString name_h = detname[i] +
"Hits";
84 TString name_e = detname[i] +
"Energy";
85 Float_t rpi = M_PI + 0.00001;
86 m_hits[i] =
new TH2F(name_h,title_h[i],nx[i],xl[i],xu[i],ny[i],-rpi, rpi);
87 m_energy[i] =
new TH2F(name_e,title_e[i],nx[i],xl[i],xu[i],ny[i],-rpi, rpi);
90 return StMaker::Init();
95 mEmcCalib = GetInputDB(
"calib");
97 cout <<
"Warning in St_emc_Maker: Database not found" << endl;
103 if (!GetData()->GetList()){
105 St_DataSet *emcRaw = GetDataSet(
"emc_raw/.data");
109 St_emc_hits *adc = 0;
110 St_emc_hits dummy; TString tit = dummy.GetTitle();
111 while ((adc = (St_emc_hits *)itr())) {
112 if(adc->GetTitle() == tit){
113 TString name = adc->GetName();
114 name.ReplaceAll(
"emc_hits_",
"");
115 for(
int i=4; i<8; i++){
if(detname[i]==name){
goto SKIP;}}
117 hit->setEmcCalib(mEmcCalib);
130 if(hit->GetTitle() == tit){
131 TString name_hits =
"emc_hits_" + TString(hit->GetName());
132 AddData(hit->copyToTable(name_hits));
142 void St_emc_Maker::MakeHistograms(){
146 Float_t eta, phi, ene;
150 TString tit = dummy.GetTitle();
152 if(hit->GetTitle() == tit){
155 det = hit->Detector();
156 m_nhit->Fill(log10((Float_t)hit->NHit()),(Float_t)det);
157 m_etot->Fill(log10(hit->EnergySum()),(Float_t)det);
158 for(i = 0; i < n; i++){
159 ene = hit->HitEnergy(i);
162 if(hit->getEtaPhi(
id, eta, phi) == 0){
163 m_hits[det-1]->Fill(eta,phi);
164 m_energy[det-1]->Fill(eta,phi,ene);
167 printf(
" <W> St_emc_Maker::MakeHistograms() => det %i bad id %i id energy %f \n"
virtual void AddData(TDataSet *data, const char *dir=".data")
User methods.