add a detector

This page will describe the mechanism for adding a new detector to the analysis. This should only be done rarely as many detectors should fit into one of the already defined Detector Types.

To add a new detector first a class must be constructed which defines its behavior by creating a .h and .cpp file. For example, the following section defines a new detector class called NewDet.

  //file NewDet.h - adding a new detector to analysis
  using namespace std;

  // add detector
  class NewDet{
  private:
     //list of private variables
  public:
     int init();
     int newdetplot(rawevent &);

     NewDet();
  }

  //file NewDet.cpp - adding a new detector to analysis
  NewDet::NewDet()
  {
     //add any special instructions for object creation
  }
  
  int NewDet::init()
  {
     //add initialization
  }

  int NewDet::newdetplot(&revt)
  {
     //define plotting routines.
  }

Once a class exists for your new detector you must create an instance of it in the detector_driver. Insert a new variable of your class into the detector_driver.

  NewDet newdetector;
and initialize it with the other objects
  newdetector.init();

For your new detector determine what the corresponding detector type will be and add it to the temppoint and temppointvalid arrays to enable quick access to the detector_summary during event processing.

  temppoint.push_back( & ((revt.det_sum["newdettype"])) );
  temppointvalid.push_back(0);

Now you can use your new detector type by first checking the temppointvalid array and if valid retrieving the new detector multiplicty to determine if it fired in a given event. You can then pass the rawevent into your newly created NewDet class for additional analysis

  newdetector.newdetplot(revt);

Generated on Wed May 14 10:07:06 2008 for pixie16 by  doxygen 1.5.5