Skip to content

Commit 115b91d

Browse files
authored
Make use of already designated topology bits (#773)
Several already-designated bits in StTrackTopologyMap have remained unused (zeros). However, there are StTrack flags set in StiStEventFiller for exactly these that can be used to set the bits in the topology map. This does require swapping the order of setting the flags to precede filling the topology maps in StiStEventFiller. This PR does nothing to alter the intent of bits in the topology map, i.e. no change to any structure in StEvent itself, but does add accessor functions. The advantage of filling the track topology map over the track flags is that it is propagated all the way to the PicoDst, while the track flags are not, thereby giving PicoDst users a handle on this information about the tracks without changing anything about the PicoDst structure. I plan to follow this PR with another that makes use of currently undesignated bits in the track topology map to include additional track flags that may be useful to PicoDst users as well.
1 parent 5ece687 commit 115b91d

File tree

4 files changed

+89
-9
lines changed

4 files changed

+89
-9
lines changed

StRoot/StEvent/StTrackTopologyMap.cxx

Lines changed: 67 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
* 50 18 TPC row=43
8383
* 51 19 TPC row=44
8484
* 52 20 TPC row=45
85-
* 53 21 Mwpc
85+
* 53 21 Mwpc / TPC prompt hit
8686
* 54 22 CTB
8787
* 55 23 ToF
8888
* 56 24 RICH
@@ -318,6 +318,66 @@ StTrackTopologyMap::hasHitInSsdLayer(unsigned int layer) const
318318
}
319319
}
320320

321+
bool
322+
StTrackTopologyMap::hasHitInMwpc() const
323+
{
324+
if(ftpcFormat())
325+
return false;
326+
else {
327+
return bit(53);
328+
}
329+
}
330+
331+
bool
332+
StTrackTopologyMap::hasHitInCtb() const
333+
{
334+
if(ftpcFormat())
335+
return false;
336+
else {
337+
return bit(54);
338+
}
339+
}
340+
341+
bool
342+
StTrackTopologyMap::hasHitInTof() const
343+
{
344+
if(ftpcFormat())
345+
return false;
346+
else {
347+
return bit(55);
348+
}
349+
}
350+
351+
bool
352+
StTrackTopologyMap::hasHitInRich() const
353+
{
354+
if(ftpcFormat())
355+
return false;
356+
else {
357+
return bit(56);
358+
}
359+
}
360+
361+
bool
362+
StTrackTopologyMap::hasHitInBemc() const
363+
{
364+
if(ftpcFormat())
365+
return false;
366+
else {
367+
return bit(57);
368+
}
369+
}
370+
371+
bool
372+
StTrackTopologyMap::hasHitInEemc() const
373+
{
374+
if(ftpcFormat())
375+
return false;
376+
else {
377+
return bit(58);
378+
}
379+
}
380+
321381
bool
322382
StTrackTopologyMap::hasHitInRow(StDetectorId id, unsigned int row) const
323383
{
@@ -389,28 +449,28 @@ StTrackTopologyMap::numberOfHits(StDetectorId id) const
389449
break;
390450
case kMwpcWestId:
391451
case kMwpcEastId:
392-
if (bit(53)) n++;
452+
if (hasHitInMwpc()) n++;
393453
break;
394454
case kCtbId:
395-
if (bit(54)) n++;
455+
if (hasHitInCtb()) n++;
396456
break;
397457
case kTofId:
398-
if (bit(55)) n++;
458+
if (hasHitInTof()) n++;
399459
break;
400460
case kRichId:
401-
if (bit(56)) n++;
461+
if (hasHitInRich()) n++;
402462
break;
403463
case kBarrelEmcTowerId:
404464
case kBarrelEmcPreShowerId:
405465
case kBarrelSmdEtaStripId:
406466
case kBarrelSmdPhiStripId:
407-
if (bit(57)) n++;
467+
if (hasHitInBemc()) n++;
408468
break;
409469
case kEndcapEmcTowerId:
410470
case kEndcapEmcPreShowerId:
411471
case kEndcapSmdUStripId:
412472
case kEndcapSmdVStripId:
413-
if (bit(58)) n++;
473+
if (hasHitInEemc()) n++;
414474
break;
415475
default:
416476
n = 0;

StRoot/StEvent/StTrackTopologyMap.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,13 @@ class StTrackTopologyMap : public StObject {
8787
bool hasHitInIstLayer(unsigned int) const; // first layer = 1
8888
bool hasHitInSsdLayer(unsigned int) const; // first layer = 1
8989
bool hasHitInSstLayer(unsigned int) const;
90+
bool hasHitInMwpc() const;
91+
bool hasHitInTpcPrompt() const;
92+
bool hasHitInCtb() const;
93+
bool hasHitInTof() const;
94+
bool hasHitInRich() const;
95+
bool hasHitInBemc() const;
96+
bool hasHitInEemc() const;
9097

9198
bool trackTpcOnly() const;
9299
bool trackSvtOnly() const;
@@ -121,4 +128,9 @@ inline bool StTrackTopologyMap::hasHitInSstLayer(unsigned int val) const
121128
return hasHitInSsdLayer(val);
122129
}
123130

131+
inline bool StTrackTopologyMap::hasHitInTpcPrompt() const
132+
{
133+
return hasHitInMwpc();
134+
}
135+
124136
#endif

StRoot/StEventUtilities/StuFixTopoMap.cxx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
* map[1] Bit number Quantity
3636
* ------ ---------- --------
3737
* 0-20 TPC, remaining 21 padrows
38-
* 21 Track extrapolates to MWC (no=0, yes=1)
38+
* 21 Track extrapolates to MWC (no=0, yes=1) (or has prompt hits)
3939
* 22 Track extrapolates to CTB (no=0, yes=1)
4040
* 23 Track extrapolates to TOF (no=0, yes=1)
4141
* 24 Track extrapolates to RCH (no=0, yes=1)
@@ -142,6 +142,14 @@ bool StuFixTopoMap(StTrack* track)
142142
}
143143
else {
144144

145+
// Tracks with hits on other detectors
146+
if (track->isPromptTrack()) word2 |= 1U<<21; // Prompt hit is an MWPC hit
147+
if (track->isCtbMatched()) word2 |= 1U<<22;
148+
if (track->isToFMatched() ||
149+
track->isBToFMatched()) word2 |= 1U<<23;
150+
if (track->isBemcMatched()) word2 |= 1U<<25;
151+
if (track->isEemcMatched()) word2 |= 1U<<26;
152+
145153
// ???
146154
if (info->numberOfReferencedPoints(kPxlId) ||
147155
info->numberOfReferencedPoints(kSstId) ||

StRoot/StiMaker/StiStEventFiller.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1343,8 +1343,8 @@ void StiStEventFiller::fillTrack(StTrack* gTrack, StiKalmanTrack* track,StTrackD
13431343
fillGeometry(gTrack, track, true ); // outer geometry
13441344
fillFitTraits(gTrack, track);
13451345
gTrack->setDetectorInfo(detInfo);
1346-
StuFixTopoMap(gTrack);
13471346
fillFlags(gTrack);
1347+
StuFixTopoMap(gTrack);
13481348
if (!track->isPrimary()) fillDca(gTrack,track);
13491349
return;
13501350
}

0 commit comments

Comments
 (0)