7 #include "StEventCompendiumMaker.h"
9 #include "StDetectorDbMaker/St_MagFactorC.h"
10 #include "StMessMgr.h"
12 #include "StEventSummary.h"
13 #include "StContainers.h"
14 #include "StTrackNode.h"
16 #include "StTrackGeometry.h"
17 #include "StPrimaryVertex.h"
19 static const char rcsid[] =
"$Id: StEventCompendiumMaker.cxx,v 1.5 2018/09/28 20:17:35 fisyak Exp $";
24 rEvent = (
StEvent*) GetInputDS(
"StEvent");
26 gMessMgr->Warning() <<
"StEventCompendiumMaker::Make: No StEvent found, bail out!" << endm;
29 fillEventSummary(rEvent);
31 rEvent->summary()->Dump();
36 void StEventCompendiumMaker::fillEventSummary(
StEvent* e) {
38 if (!e->trackNodes().size()){
39 cout <<
"fillEventSummary: Zero tracks nodes in StEvent...\n" << endl;
42 int glb_trk_good(0), glb_trk_plus(0), glb_trk_minus(0);
44 float mean_pt(0), mean_pt2(0), mean_eta(0), rms_eta(0);
46 const StSPtrVecTrackNode& nodes = e->trackNodes();
47 for (
size_t itrk=0; itrk < nodes.size(); itrk++) {
53 if ( gtrk->flag() <= 0 )
continue;
58 if(ptrk && ptrk->flag()>0) prim_trk_good++;
61 if ( gtrk->geometry()->charge() > 0 ) glb_trk_plus++;
62 if ( gtrk->geometry()->charge() < 0 ) glb_trk_minus++;
66 float eta = mom.pseudoRapidity();
67 float pt = mom.perp();
77 summary->setNumberOfTracks(nodes.size());
78 summary->setNumberOfGoodTracks(glb_trk_good);
79 summary->setNumberOfGoodPrimaryTracks(prim_trk_good);
80 summary->setNumberOfGoodTracks(positive,glb_trk_plus);
81 summary->setNumberOfGoodTracks(negative,glb_trk_minus);
83 summary->setNumberOfVertices(e->numberOfPrimaryVertices());
86 summary->setNumberOfVerticesForType(kV0VtxId,e->v0Vertices().size());
87 summary->setNumberOfVerticesForType(kXiVtxId,e->xiVertices().size());
88 summary->setNumberOfVerticesForType(kKinkVtxId,e->kinkVertices().size());
95 size_t nPileupVert = 0;
96 for (
size_t i=0; i<e->numberOfPrimaryVertices();++i) {
97 StVertexId vtx_id = e->primaryVertex(i)->type();
98 if(vtx_id == kOtherVtxId) nPileupVert++ ;
100 summary->setNumberOfPileupVertices(nPileupVert);
103 if (glb_trk_good > 0) {
104 summary->setMeanPt(mean_pt/(
float)glb_trk_good);
105 summary->setMeanPt2(mean_pt2/(
float)glb_trk_good);
106 summary->setMeanEta(mean_eta/(
float)glb_trk_good);
107 summary->setRmsEta(sqrt(rms_eta/(
float)glb_trk_good));
111 if (e->primaryVertex()) {
112 summary->setPrimaryVertexPosition(e->primaryVertex()->position());
Class for Making a Compendium of the information in StEvent.