Detector class

A detector class should inherits from the FairDetector class, the header file will looks like:




mydet.h


#ifndef FAIRTUTORIALDET_H
#define FAIRTUTORIALDET_H

#include "FairDetector.h"
class FairVolume;
class TClonesArray;

class FairTutorialDet: public FairDetector {
public:
    /**  Name :  Detector Name
        Active: kTRUE for active detectors  (ProcessHits() will be called)
                kFALSE for inactive detectors
    */
    FairTutorialDet(const char * Name, Bool_t Active);
    /** default constructor    */
    FairTutorialDet();
    /** destructor     */
    virtual ~FairTutorialDet();
    /** Initialization of the detector is done here    */
    virtual void   Initialize();
    /** this method is called for each step during dsimulation (see FairMCApplication::Stepping()) */
    virtual Bool_t ProcessHits( FairVolume *v=0);
    /** Registers the produced collections in FairRootManager.     */
    virtual void   Register();
    /** Gets the produced collections */
    virtual TClonesArray* GetCollection(Int_t iColl) const ;
    /** has to be called after each event to reset the containers        */
    virtual void   Reset();
    /** Create the detector geometry        */
    void ConstructGeometry();

    /** This method is an example of how to add your own point of type FairTutorialDetPoint to the clones array */
     FairTutorialDetPoint* FairTutorialDet::AddHit(Int_t trackID, Int_t detID, TVector3 pos,
                               TVector3 mom, Double_t time, Double_t length,Double_t eLoss)

    /**	The following methods can be implemented if you need to
        make any optional action in your detector during the transport.
    */

    /**Special cuts on media specific for this detector can be implemneted here*/
    virtual void   SetSpecialPhysicsCuts(){;}
    /** This method is called after proccessing an event*/
    virtual void   EndOfEvent(){;}
    /**This method is called after tracking of a primary particle is finished */
    virtual void   FinishPrimary(){;}
    /**This is called at the end of a run*/
    virtual void   FinishRun(){;}
    /**This method is called when primary track start*/
    virtual void   BeginPrimary(){;}
    /**called after a track is finished (stopped/vanished/absorbed)*/
    virtual void   PostTrack(){;}
    /**called before a new track start stepping*/
    virtual void   PreTrack(){;}
    /**called at the begining of an event*/
    virtual void   BeginEvent(){;}

Private:

     /** container for data points */
     TClonesArray  *fMyPointCollection;
     ClassDef(FairTutorialDet,1)
};
#endif //FAIRTUTORIALDET_H