StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ntupleEvent.cxx
1 /***************************************************************************
2  *
3  * 12 July 2000
4  *
5  * Author: Dominik Flierl, flierl@bnl.gov
6  ***************************************************************************
7  *
8  * Description:
9  * fill event information into an ntuple in order to determine the cuts
10  *
11  ***************************************************************************/
12 
13 
14 #include "StHbtMaker/Cut/ntupleEvent.h"
15 
16 #ifdef __ROOT__
17 ClassImp(ntupleEvent)
18 
19 //______________________________
20 ntupleEvent::ntupleEvent()
21 {
22  // create tree
23  mTree = new TTree("EventTree","A Tree with all Event in order to set the cuts");
24  // create Branch
25  mTree->Branch("track",&mEvent,"ctbMult/I:numOfTpcHits/I:numOfTracks/I:numOfGoodTracks/I:vertexZ/F:vertexX/F:vertexY/F");
26 }
27 //_____________________________
28 ntupleEvent::~ntupleEvent()
29 {
30  // clean up
31  delete mTree;
32 }
33 //________________________________
34 bool ntupleEvent::Pass(const StHbtEvent* event)
35 {
36  // extract event info and fill tree
37  mEvent.ctbMult = event->CtbMult() ;
38  mEvent.numOfTpcHits = event->NumberOfTpcHits() ;
39  mEvent.numOfTracks = event->NumberOfTracks() ;
40  mEvent.numOfGoodTracks = event->NumberOfGoodTracks() ;
41  mEvent.vertexZ = event->PrimVertPos().z() ;
42  mEvent.vertexX = event->PrimVertPos().x() ;
43  mEvent.vertexY = event->PrimVertPos().y() ;
44  mTree->Fill();
45  return true;
46 }
47 //________________________________
48 StHbtString ntupleEvent::Report()
49 {
50  StHbtString t;
51  char Ctemp[100];
52  sprintf(Ctemp,"No actual event cut applied ! This cut class just fills a tree.\n");
53  t+=Ctemp;
54  return t;
55 };
56 
57 #endif // ifdef ROOT
58