StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StBlankStEventMaker.cxx
1 /***************************************************************************
2  *
3  * $Id: StBlankStEventMaker.cxx,v 1.2 2005/11/26 02:27:40 perev Exp $
4  * Author: Frank Laue, BNL, laue@bnl.gov
5  ***************************************************************************/
6 #include "StBlankStEventMaker.h"
7 
8 #include "StMuDSTMaker/COMMON/StMuDstMaker.h"
9 #include "StMuDSTMaker/COMMON/StMuDst.h"
10 #include "StMuDSTMaker/COMMON/StMuDebug.h"
11 #include "StEvent/StEventTypes.h"
12 #include "StEvent/StTriggerIdCollection.h"
13 #include "StEvent/StTriggerId.h"
14 #include "StEvent/StTpcDedxPidAlgorithm.h"
15 #include "StMuDSTMaker/COMMON/StMuEmcUtil.h"
16 #include "StEvent/StEmcCollection.h"
17 
18 // tracks
19 //#include "StEvent/StVector.h"
20 #include "StEvent/StGlobalTrack.h"
21 
23  mStEvent =0;
24 }
25 
26 StBlankStEventMaker::~StBlankStEventMaker() {
27 
28  /* no=op */
29 }
30 
31 
32 void StBlankStEventMaker::Clear(const char*) {
33  mStEvent = 0;
35 }
36 
38  static int run =3010006;
39  run++;
40 
41  mStEvent = (StEvent*)GetDataSet("StEvent");
42  if (!mStEvent) {
43  mStEvent = new StEvent();
44  AddData(mStEvent); // add StEvent to the .data tree
45  }
46  StEventInfo* info = new StEventInfo();
47  mStEvent->setInfo( info );
48 
49  StRunInfo* runInfo = new StRunInfo();
50  runInfo->setRunId(run);
51  mStEvent->setRunInfo( runInfo);
52 
53  StEventSummary* summary = new StEventSummary();
54  mStEvent->setSummary( summary);
55 
56  // set chain date to be the same of event date
57  StEvtHddr *hd = (StEvtHddr*)GetDataSet("EvtHddr");// needed for database only
58  if(!hd) { hd = new StEvtHddr(); AddData(hd); }
59  hd->SetGMTime(mStEvent->time());
60  hd->SetRunNumber(run);
61 
62  // now CREATE the EMC stuff and put it in the StEvent
64  mStEvent->setEmcCollection(emc);
65 
66  // now create globa tracks Collection
67  StSPtrVecTrackNode &trackNodes = mStEvent->trackNodes();
68  StTrackNode *node;
69  //vecGlobalTracks??
70  // int maxId=200;
71  StGlobalTrack *gtrack = 0;
72 
73  // add fake tracks
74  int i;
75  for (i=0; i<5; i++) {
76  gtrack = new StGlobalTrack(); // create an empty track
77  gtrack->setFlag(12+i); // put some notrivial value
78  gtrack->setLength(100.+i);// put some notrivial value
79  node = new StTrackNode();
80  node->addTrack(gtrack); // node<->track association
81  trackNodes.push_back(node);
82  }
83 
84 
85  cout << "*****************" << GetName() << endl;
86  return 0;
87 }
88 
89 ClassImp(StBlankStEventMaker)
90 
91 /***************************************************************************
92  *
93  */
virtual void AddData(TDataSet *data, const char *dir=".data")
User methods.
Definition: StMaker.cxx:332
virtual void Clear(Option_t *option="")
User defined functions.
Definition: StMaker.cxx:634
int Make()
create a StEvent from the muDst and put it into the .data tree structure. Also time stamp gets writte...
virtual const char * GetName() const
special overload
Definition: StMaker.cxx:237
StBlankStEventMaker(const char *self="blank")
Default constructor; get pointer to StMuDstMaker.