StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StPicoDstVtxSeedMaker.cxx
1 // //
3 // StPicoDstVtxSeedMaker class //
4 // Author: G. Van Buren, BNL //
5 // Description: calculates mean primary vertex positions from //
6 // suitable events to use as seeds in finding better //
7 // primary vertex positions (helpful for low //
8 // multiplicity events like pp collisions) //
9 // using PicoDst //
10 // //
12 
13 #include "StPicoDstVtxSeedMaker.h"
14 #include "StPicoDstMaker/StPicoDstMaker.h"
15 #include "StPicoEvent/StPicoDst.h"
16 #include "StPicoEvent/StPicoEvent.h"
17 #include "StPicoEvent/StPicoTrack.h"
18 #include "StMessMgr.h"
19 
20 
21 ClassImp(StPicoDstVtxSeedMaker)
22 //_____________________________________________________________________________
24  StVertexSeedMaker(name), picodst(0), event(0) {
25 }
26 //_____________________________________________________________________________
28  StPicoDstMaker* picodstMaker = (StPicoDstMaker*) GetMaker("PicoDst");
29  if (!picodstMaker) {
30  gMessMgr->Error("StPicoDstVtxSeedMaker: No StPicoDstMaker(\"PicoDst\") found!");
31  return kStErr;
32  }
33  picodst = picodstMaker->picoDst();
34  if (!picodst) {
35  gMessMgr->Error("StPicoDstVtxSeedMaker: No PicoDst found!");
36  return kStErr;
37  }
38  event = picodst->event();
39  if (!event) {
40  gMessMgr->Error("StPicoDstVtxSeedMaker: No PicoEvent found!");
41  return kStErr;
42  }
43 
44  return StVertexSeedMaker::Make();
45 }
46 //_____________________________________________________________________________
47 bool StPicoDstVtxSeedMaker::CheckTriggers() {
48  bool notTrig = kTRUE;
49 
50  // Check trigger ids
51  vector<unsigned int> idVec = event->triggerIds();
52  for (unsigned int iTrg = 0;
53  (notTrig) && (iTrg < idVec.size()) ; iTrg++) {
54  if (ValidTrigger(idVec[iTrg])) notTrig = kFALSE;
55  }
56  return notTrig;
57 }
58 //_____________________________________________________________________________
59 int StPicoDstVtxSeedMaker::GetEventData() {
60  // Get primary vertex from MuEvent
61  zdc = event->ZDCx();
62  fill = event->fillId();
63  run = event->runId();
64  // timeEvent not saved in PicoDst
65 
66  TVector3 pvert = event->primaryVertex();
67  TVector3 epvert = event->primaryVertexError();
68  zvertex = pvert.z();
69  yvertex = pvert.y();
70  xvertex = pvert.x();
71  eyvertex = epvert.y();
72  exvertex = epvert.x();
73 
74  vpd_zvertex = event->vzVpd();
75 
76  rank = event->ranking();
77 
78  // Number of good primary tracks for this vertex
79  mult = 0;
80 
81  // picodst doesn't store track count with HFT hits...
82  // ...find it ourselves
83  hmatch = 0;
84  for (int trkn=0; trkn<(int) picodst->numberOfTracks(); trkn++) {
85  StPicoTrack* primTrk = picodst->track(trkn);
86  if (! primTrk->isPrimary()) continue;
87  mult++;
88  if (primTrk->isHft()) hmatch++;
89  }
90 
91  // hits not saved in PicoDst
92  itpc = 0; otpc = 0;
93 
94  //detmap will store number of matches in other detectors
95  detmap = 0;
96 
97  // cap at 7 in detmap (bits 0,1,2)
98  Packer( 0,3,bmatch,event->nBEMCMatch());
99 
100  // cap at 7 in detmap (bits 3,4,5)
101  Packer( 3,3,ematch,0);
102 
103  // cap at 7 in detmap (bits 6,7,8)
104  Packer( 6,3,tmatch,event->nBTOFMatch());
105 
106  // cap at 3 in detmap (bits 9,10)
107  Packer( 9,2,cmatch,0);
108 
109  // cap at 7 in detmap (bits 11,12,13)
110  Packer(11,3,hmatch,hmatch);
111 
112  // cap at 3 in detmap (bits 14,15)
113  Packer(14,2,pmatch,0);
114 
115  // cap at 3 in detmap (bits 16,17,18)
116  Packer(16,3,pct ,0);
117 
118  return kStOk;
119 }
120 //_____________________________________________________________________________
121 void StPicoDstVtxSeedMaker::PrintInfo() {
122  LOG_INFO << "\n**************************************************************"
123  << "\n* $Id: StPicoDstVtxSeedMaker.cxx,v 1.3 2018/08/02 04:08:09 genevb Exp $"
124  << "\n**************************************************************" << endm;
125 
126  if (Debug()) StVertexSeedMaker::PrintInfo();
127 }
128 //_____________________________________________________________________________
129 // $Id: StPicoDstVtxSeedMaker.cxx,v 1.3 2018/08/02 04:08:09 genevb Exp $
130 // $Log: StPicoDstVtxSeedMaker.cxx,v $
131 // Revision 1.3 2018/08/02 04:08:09 genevb
132 // Changed return type in StPicoEvent
133 //
134 // Revision 1.2 2018/04/04 11:01:39 jeromel
135 // Changed location pf include
136 //
137 // Revision 1.1 2017/08/08 03:58:20 genevb
138 // Add vertex-seed-finding with picoDsts
139 //
140 //
141 //
Bool_t isPrimary() const
Return if track is primary.
Definition: StPicoTrack.h:178
Class that converts MuDst into PicoDst.
UShort_t nBTOFMatch() const
Return number of tracks that matched TOF.
Definition: StPicoEvent.h:62
Bool_t isHft() const
Return if trach has hit in HFT.
Definition: StPicoTrack.h:161
static StPicoEvent * event()
Return pointer to current StPicoEvent (class holding the event wise information)
Definition: StPicoDst.h:63
virtual Int_t Make()
UShort_t nBEMCMatch() const
Return number of tracks that matched BEMC.
Definition: StPicoEvent.h:60
Holds information about track parameters.
Definition: StPicoTrack.h:35
static UInt_t numberOfTracks()
Return number of tracks.
Definition: StPicoDst.h:104
StPicoDst * picoDst()
Returns null pointer if no StPicoDst.
static StPicoTrack * track(Int_t i)
Return pointer to i-th track.
Definition: StPicoDst.h:65
BeamLine Constraint calibration base class.
Definition: Stypes.h:44
Definition: Stypes.h:41