ntupleEvent.cxx 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /***************************************************************************
  2. *
  3. * $Id: 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. #include "StHbtMaker/Cut/ntupleEvent.h"
  13. #ifdef __ROOT__
  14. ClassImp(ntupleEvent)
  15. //______________________________
  16. ntupleEvent::ntupleEvent()
  17. {
  18. // create tree
  19. mTree = new TTree("EventTree","A Tree with all Event in order to set the cuts");
  20. // create Branch
  21. mTree->Branch("track",&mEvent,"ctbMult/I:numOfTpcHits/I:numOfTracks/I:numOfGoodTracks/I:vertexZ/F:vertexX/F:vertexY/F");
  22. }
  23. //_____________________________
  24. ntupleEvent::~ntupleEvent()
  25. {
  26. // clean up
  27. delete mTree;
  28. }
  29. //________________________________
  30. bool ntupleEvent::Pass(const StHbtEvent* event)
  31. {
  32. // extract event info and fill tree
  33. mEvent.ctbMult = event->CtbMult() ;
  34. mEvent.numOfTpcHits = event->NumberOfTpcHits() ;
  35. mEvent.numOfTracks = event->NumberOfTracks() ;
  36. mEvent.numOfGoodTracks = event->NumberOfGoodTracks() ;
  37. mEvent.vertexZ = event->PrimVertPos().z() ;
  38. mEvent.vertexX = event->PrimVertPos().x() ;
  39. mEvent.vertexY = event->PrimVertPos().y() ;
  40. mTree->Fill();
  41. return true;
  42. }
  43. //________________________________
  44. StHbtString ntupleEvent::Report()
  45. {
  46. StHbtString t;
  47. char Ctemp[100];
  48. sprintf(Ctemp,"No actual event cut applied ! This cut class just fills a tree.\n");
  49. t+=Ctemp;
  50. return t;
  51. };
  52. #endif // ifdef ROOT