// $Header: MCPartPrint.cxx $

#include "MCPartPrint.h"
#include "math.h"

//______________________________________________________________________
// MCPartPrint
//
//  A very simple "processing" module.  It really has no processing to
//  do, but does write out MC particle information when spew is requested.

ClassImp(MCPartPrint)

 MCPartPrint::MCPartPrint() {
  // Constructor
};

 void  MCPartPrint::doit(Event* event) {
  // No real processing for this module.

  m_event = event;
}


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
void 
 MCPartPrint::spew(FILE* ofile)const
{
  // Write out the MC particle information (ascii)

  fprintf(ofile,"MCPrint n %i n", 
	  m_event->MCparticles()->GetEntries());
  TIter next(m_event->MCparticles());
  McPart* mc;
  while(mc = (McPart*)next() ) {

    Float_t* mom;
    Float_t* pos;
    Float_t* calMom;
    Float_t* calPos;
    mom = mc->GetMomentum();
    pos = mc->GetPosition();
    calMom = mc->GetCalMom();
    calPos = mc->GetCalPos();
    
    fprintf(ofile,
	    "%i %i %i %i %f Point(%f,%f,%f) ( %f,%f,%f)%f (%f,%f,%f) (%f,%f,%f) n",
	    (int)(mc),
	    (int)(mc->GetParnt()),
	    mc->GetType(),
	    mc->GetStatus(),
	    mc->GetCharge(),
	    pos[0],
	    pos[1],
	    pos[2],
	    mom[0],
	    mom[1],
	    mom[2],
	    mom[3],
	    calPos[0],
	    calPos[1],
	    calPos[2],
	    calMom[0],
	    calMom[1],
	    calMom[2]);
  }
  fprintf(ofile,"endn");
}



ROOT page - Class index - Top of the page

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.