14 class StMuEEmcPreAnalysisMaker;
22 StMuEEmcPreAnalysisMaker *muEEmcAnal;
29 void runEEmcPreAnalysis ( Int_t nevents = 100,
31 Char_t *muDst =
"MuDst/mcPi0n_field_onpi0_10000_06TC05_5.MuDst.root",
32 Char_t *output =
"output.root"
37 void runEEmcPreAnalysis ( Int_t nevents, Int_t smdhist, Char_t *muDst, Char_t *output ) {
41 TFile *f =
new TFile( output,
"RECREATE" );
47 TH2F *hPre1VsTow =
new TH2F(
"hPre1VsTow",
"Preshower(1) energy deposit vs reco tower E", 100, 0., 20., 100, 0., 0.2);
48 TH2F *hPre2VsTow =
new TH2F(
"hPre2VsTow",
"Preshower(2) energy deposit vs reco tower E", 100, 0., 20., 100, 0., 0.2);
49 TH2F *hPostVsTow =
new TH2F(
"hPostVsTow",
"Postshower energy deposit vs reco tower E", 100, 0., 20., 100, 0., 0.2);
50 TH2F *hPre1VsPre2 =
new TH2F(
"hPre1VsPre2",
"Preshower(1) energy deposit vs preshower(2) energy deposit", 100, 0., 0.2, 100, 0., 0.2);
57 gROOT -> LoadMacro(
"$STAR/StRoot/StMuDSTMaker/COMMON/macros/loadSharedLibraries.C");
58 loadSharedLibraries();
59 gSystem->Load(
"StEEmcUtil.so");
60 gSystem->Load(
"StMuEEmcPreAnalysisMaker.so");
61 gSystem->Load(
"StDbLib");
62 gSystem->Load(
"StDbBroker");
63 gSystem->Load(
"St_db_Maker");
64 gSystem->Load(
"StEEmcDbMaker");
71 muDstMaker =
new StMuDstMaker(0,0,
"",muDst,
"MuDst.root",1);
72 muDb = StMuDbReader::instance();
77 muEEmcAnal =
new StMuEEmcPreAnalysisMaker();
85 eemcDb = (
StEEmcDb*)chain->GetDataSet(
"StEEmcDb");
88 eemcDb -> setTimeStampDay(20040101);
89 eemcDb -> setPreferedFlavor(
"set492",
"eemcPMTcal" );
98 while ( !status && ievent < nevents ) {
100 if ( !ievent % 100 ) std::cout <<
"Processing event number " << ievent << std::endl;
106 status = chain ->
Make();
109 StMuEEmcTower *seed = muEEmcAnal -> getHighTower();
120 Float_t energy = seed -> getEnergy(0);
121 Float_t energy_pre1 = seed -> getEnergy(1);
122 Float_t energy_pre2 = seed -> getEnergy(2);
123 Float_t energy_post = seed -> getEnergy(3);
125 StMuEEmcStrip *ufirst = seed -> getFirstStrip(
'U');
126 StMuEEmcStrip *vfirst = seed -> getFirstStrip(
'V');
127 StMuEEmcStrip *ulast = seed -> getLastStrip(
'U');
128 StMuEEmcStrip *vlast = seed -> getLastStrip(
'V');
130 std::cout << ievent <<
" seed: "
131 << std::setw(7) << std::setprecision(3) << energy <<
" "
132 << std::setw(7) << std::setprecision(3) << energy_pre1 <<
" "
133 << std::setw(7) << std::setprecision(3) << energy_pre2 <<
" "
134 << std::setw(7) << std::setprecision(3) << energy_post <<
" "
135 << std::setw(3) << ufirst -> getId() <<
" "
136 << std::setw(3) << ulast -> getId() <<
" "
137 << std::setw(3) << vfirst -> getId() <<
" "
138 << std::setw(3) << vlast -> getId() <<
" "
141 StMuEEmcTower *neighbor;
143 for ( Int_t i = 0; i < 8; i++ ) {
147 neighbor = seed -> getNeighbor(i);
148 if ( !neighbor )
continue;
150 energy += neighbor -> getEnergy(0);
151 energy_pre1 += neighbor -> getEnergy(1);
152 energy_pre2 += neighbor -> getEnergy(2);
153 energy_post += neighbor -> getEnergy(3);
155 StMuEEmcStrip *mytmp = neighbor -> getFirstStrip(
'U');
156 if ( mytmp -> getId() < ufirst -> getId() ) ufirst = mytmp;
157 mytmp = neighbor -> getFirstStrip(
'V');
158 if ( mytmp -> getId() < vfirst -> getId() ) vfirst = mytmp;
159 mytmp = neighbor -> getLastStrip(
'U');
160 if ( mytmp -> getId() > ulast -> getId() ) ulast = mytmp;
161 mytmp = neighbor -> getLastStrip(
'V');
162 if ( mytmp -> getId() > vlast -> getId() ) vlast = mytmp;
167 hPre1VsTow -> Fill( energy, energy_pre1 );
168 hPre2VsTow -> Fill( energy, energy_pre2 );
169 hPostVsTow -> Fill( energy, energy_post );
170 hPre1VsPre2-> Fill( energy_pre2, energy_pre1 );
177 if ( !(ievent % smdhist) ) {
182 TString myname =
"uEvent"; myname += ievent;
183 TString mytitle =
"U SMD strip energy distribution";
184 Int_t min = ufirst -> getId() - 1;
185 Int_t max = ulast -> getId() + 1;
186 Int_t nbin = ( max - min + 1 );
187 TH1F *uhist =
new TH1F(myname,mytitle,nbin,min,max);
189 StMuEEmcStrip *strip;
190 for ( strip = ufirst; strip <= ulast; strip++ ) {
193 Int_t
id = strip -> getId() - min;
194 Float_t myenergy = strip -> getEnergy();
195 Float_t nphoto = (myenergy>0.) ? strip -> getNumPhotoElectrons() : 1;
197 uhist -> SetBinContent(
id, myenergy );
198 uhist -> SetBinError (
id, myenergy / sqrt(nphoto) );
202 myname =
"vEvent"; myname += ievent;
203 mytitle =
"V SMD strip energy distribution";
204 min = vfirst -> getId() - 1;
205 max = vlast -> getId() + 1;
206 nbin = ( max - min + 1 );
207 TH1F *vhist =
new TH1F(myname,mytitle,nbin,min,max);
209 for ( strip = vfirst; strip <= vlast; strip++ ) {
212 Int_t
id = strip -> getId() - min;
213 Float_t myenergy = strip -> getEnergy();
214 Float_t nphoto = (myenergy>0.) ? strip -> getNumPhotoElectrons() : 1;
216 vhist -> SetBinContent(
id, myenergy );
217 vhist -> SetBinError (
id, myenergy / sqrt(nphoto) );
227 std::cout << ievent <<
" cluster: "
228 << std::setw(7) << std::setprecision(3) << energy <<
" "
229 << std::setw(7) << std::setprecision(3) << energy_pre1 <<
" "
230 << std::setw(7) << std::setprecision(3) << energy_pre2 <<
" "
231 << std::setw(7) << std::setprecision(3) << energy_post <<
" "
232 << std::setw(3) << ufirst -> getId() <<
" "
233 << std::setw(3) << ulast -> getId() <<
" "
234 << std::setw(3) << vfirst -> getId() <<
" "
235 << std::setw(3) << vlast -> getId() <<
" "
virtual void Clear(Option_t *opt="")
User defined functions.
virtual Int_t Write(const char *name=0, Int_t option=0, Int_t bufsize=0)
virtual void ls(Option_t *option="") const