21 TH1F *hnHitsOffline =
new TH1F(
"hnHitsOffline",
"nHits, global tracks", 42, 3.5, 45.5);
22 TH2F *hdEdx =
new TH2F(
"hdEdx",
"dEdx vs p", 1000, 0, 2.5, 1200, 0, 30);
24 TH1F *hpt =
new TH1F(
"hpt",
"pt", 200, 0, 7);
27 TNtuple *trackNtuple =
new TNtuple(
"trackNtuple",
"l3t tracks",
28 "px:py:pz:r0:phi0:z0:q:nHits:dedx:nDedx:chi2xy:chi2sz");
39 void readL3Events(Int_t nEvents,
const Char_t **fileList)
42 cout << endl << endl <<
" readL3Events - input # events = " << nEvents << endl;
44 while (fileList[ilist]) {
45 cout <<
" readL3Events - input fileList = " << fileList[ilist] << endl;
49 gSystem->Load(
"St_base");
50 gSystem->Load(
"StarRoot");
51 gSystem->Load(
"StChain");
52 gSystem->Load(
"StUtilities");
53 gSystem->Load(
"libglobal_Tables");
54 gSystem->Load(
"StAnalysisUtilities");
55 gSystem->Load(
"StIOMaker");
56 gSystem->Load(
"StarClassLibrary");
57 gSystem->Load(
"StEvent");
69 setFiles=
new StFile(fileList);
75 IOMk->SetBranch(
"*",0,
"0");
79 IOMk->SetBranch(
"eventBranch",0,
"r");
84 Int_t iInit = chain->Init();
90 while (iEvent<(nEvents+1) && istat!=2) {
96 istat = chain->
Make(iEvent);
97 cout <<
"\n\n====================== ";
98 cout <<
"Working on Event number " << (iEvent) << endl;
101 myEvent = (
StEvent*) chain->GetInputDS(
"StEvent");
103 cout <<
"No StEvent found.\n";
110 cout <<
"No l0 trigger found.\n";
113 else printf(
"Trigger Word: 0x%x\n", myL0Trigger->triggerWord());
118 cout <<
"No l3 found inside StEvent.\n";
125 if (!myL3EventSummary) {
126 cout <<
"No l3 event summary found." << endl;
131 cout <<
"Global Counters: #processed = " << myL3EventSummary->numberOfProcessedEvents()
132 <<
", #reconstructed = " << myL3EventSummary->numberOfReconstructedEvents()
133 <<
", #tracks = " << myL3EventSummary->numberOfTracks()
136 printf(
"L0 trigger word: %x\n", myL3EventSummary->l0TriggerWord());
139 if (myL3EventSummary->unbiasedTrigger()==
true)
140 cout <<
"unbiased Trigger: YES" << endl;
142 cout <<
"unbiased Trigger: NO" << endl;
145 unsigned int nAlgorithms = myL3EventSummary->numberOfAlgorithms();
146 cout <<
"Number of L3 algorithms for this run: " << nAlgorithms << endl;
147 const StSPtrVecL3AlgorithmInfo& myL3AlgInfo = myL3EventSummary->algorithms();
148 for (
int i=0; i<nAlgorithms; i++) {
149 int algId = myL3AlgInfo[i]->id();
150 const int nProcessed = myL3AlgInfo[i]->numberOfProcessedEvents();
151 const int nAccept = myL3AlgInfo[i]->numberOfAcceptedEvents();
152 const int nBuild = myL3AlgInfo[i]->numberOfBuildEvents();
153 if (myL3AlgInfo[i]->build()) cout <<
"**";
154 cout <<
" alg id " << algId
155 <<
":\t #proc " << nProcessed
156 <<
"\t #accept " << nAccept
157 <<
"\t #build " << nBuild
158 <<
"\t preScale " << myL3AlgInfo[i]->preScale()
159 <<
"\t postScale " << myL3AlgInfo[i]->postScale()
161 for (
int j=0; j<myL3AlgInfo[i]->intParameterSize(); j++) {
162 cout << myL3AlgInfo[i]->intParameter(j) <<
" ";
164 cout <<
"\t floatPara ";
165 for (
int k=0; k<myL3AlgInfo[i]->floatParameterSize(); k++) {
166 cout << myL3AlgInfo[i]->floatParameter(k) <<
" ";
172 const StPtrVecL3AlgorithmInfo& myL3TriggerAlgInfo = myL3EventSummary->algorithmsAcceptingEvent();
173 cout <<
"Number of L3 algorithms which triggered this event: "
174 << myL3TriggerAlgInfo->size() << endl;
175 cout <<
"triggered algorithms: ";
176 for (
int i=0; i<myL3TriggerAlgInfo->size(); i++) {
177 cout << myL3TriggerAlgInfo[i]->id() <<
" ";
182 if (myL3Trigger->primaryVertex()) {
183 cout <<
"L3 Vertex = ( " << myL3Trigger->primaryVertex()->position()->x()
184 <<
", " << myL3Trigger->primaryVertex()->position()->y()
185 <<
", " << myL3Trigger->primaryVertex()->position()->z()
191 StSPtrVecTrackNode& mtracknodes = (StSPtrVecTrackNode&) myL3Trigger->trackNodes();
192 cout <<
" nubmer of tracks " << mtracknodes->size() << endl;
193 for (Int_t i=0; i<mtracknodes->size(); i++) {
196 Float_t px = mtracknodes[i]->track(0)->geometry()->momentum()->x();
197 Float_t py = mtracknodes[i]->track(0)->geometry()->momentum()->y();
198 Float_t pz = mtracknodes[i]->track(0)->geometry()->momentum()->z();
200 Short_t nHits = mtracknodes[i]->track(0)->detectorInfo()->numberOfPoints();
201 Short_t q = mtracknodes[i]->track(0)->geometry()->charge();
202 Float_t psi = mtracknodes[i]->track(0)->geometry()->psi();
203 Float_t tanl = tan(mtracknodes[i]->
track(0)->geometry()->dipAngle());
204 Float_t curv = mtracknodes[i]->track(0)->geometry()->curvature();
206 Float_t r0 = mtracknodes[i]->track(0)->geometry()->origin()->perp();
207 Float_t phi0 = mtracknodes[i]->track(0)->geometry()->origin()->phi();
208 Float_t z0 = mtracknodes[i]->track(0)->geometry()->origin()->z();
213 Float_t chi2xy = (Float_t) mtracknodes[i]->
track(0)->fitTraits()->chi2(0) / nHits;
214 Float_t chi2sz = (Float_t) mtracknodes[i]->
track(0)->fitTraits()->chi2(1) / nHits;
216 StSPtrVecTrackPidTraits &traits = mtracknodes[i]->track(0)->pidTraits();
222 nDedx = pid->numberOfPoints();
226 trackNtuple->Fill(px, py, pz, r0, phi0, z0,
227 (Float_t) q, (Float_t) nHits, dedx, (Float_t) nDedx, chi2xy, chi2sz);
229 Float_t pt = sqrt(px*px +py*py);
232 hnHitsOffline->Fill(nHits);
237 if (nHits>22 && dedx>0) {
238 hdEdx->Fill(mtracknodes[i]->
track(0)->geometry()->momentum()->mag(), dedx);
242 if (i<5 || i%1000==0) {
243 cout <<
"L3 Track : " << i <<
"\t";
244 cout <<
"px : " << Double_t (mtracknodes[i]->
track(0)->geometry()->momentum()->x()) <<
"\t";
245 cout <<
"py : " << Double_t (mtracknodes[i]->
track(0)->geometry()->momentum()->y()) <<
"\t";
246 cout <<
"pz : " << Double_t ( mtracknodes[i]->
track(0)->geometry()->momentum()->z()) <<
"\t";
252 cout <<
"dca : " << mtracknodes[i]->track(0)->impactParameter() <<
"\t";
253 cout <<
"dedx : " << dedx <<
"\n";
286 void readL3Events(
const Int_t nEvents,
const Char_t *file)
288 cout <<
"*file = " << file << endl;
289 const char *fileListQQ[]={0,0};
291 readL3Events(nEvents, fileListQQ);
virtual void SetIOMode(Option_t *iomode="w")
number of transactions
virtual void Clear(Option_t *option="")
User defined functions.