42 #include "StPeCLumiMaker.h"
43 #include "StEventTypes.h"
45 #include "StMessMgr.h"
48 #ifndef ST_NO_NAMESPACES
52 #include "StTriggerDetectorCollection.h"
53 #include "StCtbTriggerDetector.h"
54 #include "StMwcTriggerDetector.h"
55 #include "StVpdTriggerDetector.h"
56 #include "StZdcTriggerDetector.h"
57 #include "StFtpcHitCollection.h"
58 #include "StFtpcPlaneHitCollection.h"
59 #include "StFtpcSectorHitCollection.h"
61 #include "StMcEventTypes.hh"
62 #include "StMcEventMaker/StMcEventMaker.h"
63 #include "StIOMaker/StIOMaker.h"
67 static const char rcsid[] =
"$Id: StPeCLumiMaker.cxx,v 1.7 2007/04/28 17:56:33 perev Exp $";
76 StPeCLumiMaker::~StPeCLumiMaker() {}
78 Int_t StPeCLumiMaker::Init() {
79 cout <<
"StPeCLumiMaker::Init, Do nothing!";
80 return StMaker::Init();
83 Int_t StPeCLumiMaker::InitRun(Int_t runnr) {
86 cout<<
"StPeCLumiMaker: Initializing..run " << runnr <<endl;
90 TString uDstFileName(
"StPeCMaker.tree.root");
93 uDstFileName = pIOMaker->GetFile() ;
94 const char* ccc =
"/" ;
95 Ssiz_t slashPosition = uDstFileName.Last(*ccc) ;
96 if ( slashPosition != -1 &&
97 slashPosition < uDstFileName.Length() )
98 uDstFileName.Remove(0,slashPosition+1);
101 cout << uDstFileName << endl;
103 TString tEvt(
"event");
104 TString tEvtSel(
"evtsel");
105 TString tuDst(
"lumiDst");
106 TString tuDstSel(
"lumiDstSel");
107 uDstFileName.ReplaceAll(tDst,tuDst);
108 uDstFileName.ReplaceAll(tEvt,tuDst);
109 uDstFileName.ReplaceAll(tEvtSel,tuDstSel);
110 cout <<
"StPeCLumiMaker: uDst output file: " << uDstFileName << endl;
114 m_outfile =
new TFile( uDstFileName,
"recreate");
121 uDstTree =
new TTree(
"uDst",
"Pcol uDst",99);
125 uDstTree->Branch (
"LumiEntry",
"StPeCLumiEntry",&LumiEntry,64000,1);
128 cout<<
"StPeCLumiMaker: Initialization done!"<<endl;
130 return StMaker::InitRun(runnr);
142 cout<<
"StPeCLumiMaker: Reading muDst"<<endl;
144 cout<<
"StPeCLumiMaker: Number of tracks "<<NTracks<<endl;
148 if( NTracks > StPeCnMaxTracks ){
149 cout<<
"StPeCLumiMaker: Number of tracks: "<<NTracks<<endl;
150 cout<<
"Not a peripheral event (NTracks>15)"<<endl;
154 cout<<
"StPeCLumiMaker: Event has no tracks!"<<endl;
160 int tw = trig.triggerWord();
161 cout <<
"Trigger word " << tw << endl;
162 if (tw == 0x3001 || tw==0x3002 || tw == 0x3011 || tw == 0x1001 ) {
163 cout <<
"UPC trigger filter event" << endl;
168 LumiEntry->fill(muDst );
180 event = (
StEvent *) GetInputDS(
"StEvent");
185 StSPtrVecTrackNode& tempn =
event->trackNodes();
186 Int_t NTracks=tempn.size();
187 cout<<
"StPeCLumiMaker: Number of tracks: "<<NTracks<<endl;
191 if( NTracks > StPeCnMaxTracks ){
192 cout<<
"StPeCLumiMaker: Number of tracks: "<<NTracks<<endl;
193 cout<<
"Not a peripheral event (NTracks>15)"<<endl;
197 cout<<
"StPeCLumiMaker: Event has no tracks!"<<endl;
201 int tw =
event->l0Trigger()->triggerWord();
202 cout <<
"Trigger word " << tw << endl;
203 if (tw == 0x3001 || tw==0x3002 || tw == 0x3011 || tw == 0x1001 ) {
204 cout <<
"UPC trigger filter event" << endl;
210 LumiEntry->fill( event );
217 cout<<
"StPeCLumiMaker: There was no StEvent! Return."<<endl;
224 cout <<
"StPeCLumiMaker: Finish" << endl;
static TObjArray * globalTracks()
returns pointer to the global tracks list
static StMuEvent * event()
returns pointer to current StMuEvent (class holding the event wise information, e.g. event number, run number)