6 #include "StReadRare.h"
7 #include "StRareEvent.h"
8 #include "StRareTrack.h"
9 #include "StL3RareTrack.h"
10 #include "StEventTypes.h"
28 mDEdxnHitsRatio = 0.3;
34 mHistoFile =
new TString(
"/direct/star+data01/pwg/spectra/struck/2001/RarePlots.root");
38 StReadRare::StReadRare(Int_t nEvents,
const Char_t* histoFileName)
51 mDEdxnHitsRatio = 0.3;
57 mHistoFile =
new TString(histoFileName);
61 void StReadRare::Init()
64 hOffP =
new TH1F(
"hOffP",
"offline p", 100, 0, 10);
65 hL3P =
new TH1F(
"hL3P",
"L3 p", 100, 0, 10);
67 hL3Dca =
new TH1F(
"hL3Dca",
"dca l3 tracks", 400, 0, 20);
69 hOffdEdx =
new TH2F(
"hOffdEdx",
"dedx offline tracks", 1000, 0, 2.5, 1200, 0, 50);
70 hL3dEdx =
new TH2F(
"hL3dEdx",
"dedx l3 tracks", 1000, 0, 2.5, 1200, 0, 50);
72 hOffZ =
new TH1F(
"hOffZ",
"Z=ln(I_m/I_expect(anti-He3)), offline", 60, -3, 3);
73 hL3Z =
new TH1F(
"hL3Z",
"Z=ln(I_m/I_expect(anti-He3)), L3", 60, -3, 3);
75 hCandidateMatch =
new TH1F(
"hCandidateMatch",
"0:offline-L3 match, -1:offline only, +1:L3 only", 10, -2.5, 2.5);
76 hOffCandidatedEdx =
new TH2F(
"hOffCandidatedEdx",
"dedx offline candidate tracks", 800, 0, 5, 1200, 0, 60);
77 hOffCandidateZ =
new TH1F(
"hOffCandidateZ",
"Z=ln(I_m/I_expect(anti-He3)), offline candidate", 60, -3, 3);
78 hL3CandidatedEdx =
new TH2F(
"hL3CandidatedEdx",
"dedx L3 candidate tracks", 800, 0, 5, 1200, 0, 60);
79 hL3CandidatedEdxMatch =
new TH2F(
"hL3CandidatedEdxMatch",
"dedx L3 candidate tracks, match to offline", 800, 0, 5, 1200, 0, 60);
80 hL3CandidatedEdxTriggeredMatch =
new TH2F(
"hL3CandidatedEdxTriggeredMatch",
"dedx L3 candidate tracks, match to offline, triggered", 800, 0, 5, 1200, 0, 60);
81 hL3CandidateDca =
new TH1F(
"hL3CandidateDca",
"dca l3 candidate tracks", 400, 0, 10);
82 hL3CandidateZ =
new TH1F(
"hL3CandidateZ",
"Z=ln(I_m/I_expect(anti-He3)), l3 candidate tracks", 60, -3, 3);
86 mChain =
new TChain(
"RareTree");
87 mChain->Add(
"/direct/star+data02/scratch/struck/test/new291/st_phys*.root");
88 mChain->Add(
"/direct/star+data02/scratch/struck/test/new292/st_phys*.root");
89 mChain->Add(
"/direct/star+data02/scratch/struck/test/new294/st_phys*.root");
97 mNEvents = (Int_t) mChain->GetEntries();
98 printf(
"Total # events: %i\n", mNEvents);
102 Int_t StReadRare::Run()
105 mChain->SetBranchAddress(
"StRareEvent", &event);
106 printf(
"StReadRare::Start Run.\nTotal # events: %i\n", mNEvents);
108 for (
int i=0; i<mNEvents; i++) {
109 printf(
"Event:%d\n",i);
115 if (event->l3Flag()==kTRUE) {
116 printf(
" event TRIGGERED!!\n");
119 int candidateIndex = 0;
120 bool candidateEvent = kFALSE;
123 for (
int j=0; j<
event->numberOfTracks(); j++) {
125 float p = track->p();
126 float dedx = track->dedx();
129 && (track->npntfit()>=mMinHitsOffline)
130 && track->chargesign()<0
131 && (((float)track->ndedx())/((
float)track->npntfit())>=mDEdxnHitsRatio)) {
133 hOffdEdx->Fill(p, dedx);
135 float ionExpected = 2 * 4.598 * (1 + 7.89177 / (4 * p*p));
136 hOffZ->Fill(TMath::Log(dedx/ionExpected));
138 if (dedx>(mCutFraction * ionExpected)) {
139 hOffCandidatedEdx->Fill(p, dedx);
140 hOffCandidateZ->Fill(TMath::Log(dedx/ionExpected));
142 candidateEvent = kTRUE;
148 for (
int j=0; j<
event->numberOfL3Tracks(); j++) {
150 float p = l3track->p();
151 float dedx = l3track->dedx();
153 hL3Dca->Fill(l3track->dca2d());
155 && (l3track->npntfit()>=mMinHits)
156 && (l3track->chargesign()<0)
157 && (l3track->dca2d()<mMaxDCA)) {
159 hL3dEdx->Fill(p, dedx);
161 float ionExpected = 2 * 4.598 * (1 + 7.89177 / (4 * p*p));
162 hL3Z->Fill(TMath::Log(dedx/ionExpected));
166 && (dedx>(mCutFraction*ionExpected))) {
167 hL3CandidatedEdx->Fill(p, dedx);
168 hL3CandidateZ->Fill(TMath::Log(dedx/ionExpected));
170 if (candidateEvent==kTRUE) {
171 hL3CandidatedEdxMatch->Fill(p, dedx);
173 if (event->l3Flag()==kTRUE)
174 hL3CandidatedEdxTriggeredMatch->Fill(p, dedx);
177 candidateEvent = kTRUE;
178 hL3CandidateDca->Fill(l3track->dca2d());
184 if (candidateEvent==kTRUE)
185 hCandidateMatch->Fill(candidateIndex);
192 Int_t StReadRare::Finish()
194 TFile *rFile =
new TFile(mHistoFile->Data(),
"RECREATE");
202 hCandidateMatch->Write();
203 hOffCandidatedEdx->Write();
204 hOffCandidateZ->Write();
205 hL3CandidatedEdx->Write();
206 hL3CandidatedEdxMatch->Write();
207 hL3CandidatedEdxTriggeredMatch->Write();
208 hL3CandidateDca->Write();
209 hL3CandidateZ->Write();