// // File : EyeFadcData.hh // // Purpose: Header file for EyeFadcData.cc, // containing TEyeFADCData class declaration // // $Id: EyeFadcData.hh 12083 2011-02-21 17:11:42Z mathes $ // #ifndef _EyeFadcData_hh_ #define _EyeFadcData_hh_ #include #include #include #include #include #include // --- forward declarations class TFADCData; /** @file EyeFadcData.hh * Declaration of the class TEyeFADCData. * @author H.-J. Mathes, FzK */ /** Class to hold all pixels FADC traces. * * Some implemenatation details: * * For the implementation of this class we could choose either the TObjArray, * the TClonesArray or a STL container to hold the TFADCData objects. As the * TFADCData class itself allocates further storage, according to the * TClonesArray documentation, TClonesArray could not be used. */ class TEyeFADCData : public TObject { public: /** Constructor for the class TEyeFADCData. * * The following field are initialized: * @li the number of traces stored is set to 0. * @li new container object is created for internal purposes. * @li */ TEyeFADCData(Int_t num_fadc = FdUtil::Fd::kEYE_NEXTPIXELS); /** Copy constructor of the class TEyeFADCData. */ TEyeFADCData(const TEyeFADCData&); /** Assignment operator for the class TEyeFADCData. */ TEyeFADCData& operator=(const TEyeFADCData&); /** Destructor of the class TEyeFADCData. */ virtual ~TEyeFADCData(); /** operator==() for the class TEyeFADCData (required by operator=()). */ bool operator==(const TEyeFADCData& rhs) const { return this == &rhs; } /** Add a single FADC data trace. * * The passed FADC data trace TFADCData is not owned by this object. * Instead a new TFADCData object is created and its content is copied * from the passed object. The FADC data trace is inserted into the * container that it could be retrieved using its Eye pixel number * (1...6*480). * * Access times (measured on 500 MHz PIII): * @li 3..4 usec when owning the added TFADCData object. This must be * indicated by the special flag 'is_owner' * @li 8..27 usec (average = 21 usec) when creating, copying and adding * a TFADCData object (cloning). */ void AddFADCData(TFADCData*,bool is_owner=false); // void AddFADCData(TMirrorFADCData*); /** Clear the contents of the TEyeFADCData object. */ void Clear(Option_t *option=""); /** Print the contents of the TEyeFADCData to the specified ostream. */ virtual void Show(std::ostream& ostr=std::cout) const; /** Get the single FADC data trace specified by FdPixelNumber. * * Access times (measured on 500 MHz PIII): * @li 2 usec without type check (is the TObject in the container really a * TFADCData object ?). * @li 4 usec with type check. * * Note: You mustn't free the returned pointer! */ const TFADCData * GetFADCData(FdUtil::Fd::FdPixelNumber) const; /** Get the single FADC data trace specified by PixelNumber. * * Note: You mustn't free the returned pointer! */ const TFADCData * GetFADCData(FdUtil::Fd::PixelNumber) const; // TFADCData* GetFADCData(UInt_t); /** Return iterator for the internal TFADCData. * * This iterator allows then using the TIterator::Reset() and * the TIterator::Next() method to access the pixels FADC data sequentially. * * @see http://root.cern.ch/? */ TIterator* GetIterator(Bool_t dir=kIterForward) const { return fFADCData->MakeIterator( dir ); } /** Remove a single FADC data trace from the container. * * To check, whether two traces are identical, first the objects addresses * and then their pixel ids are compared with each other (even if they * contain different data). */ void RemoveFADCData(const TFADCData*); private: Version_t fStreamerVersion; //! version read from file UInt_t fNTraces; // Number of FADC traces stored TObjArray *fFADCData; // Container to store the FADC traces ClassDef(TEyeFADCData,EyeEVENTVERSIONv1) }; #endif // _EyeFadcData_hh_