/** @file CbmStsSignal.h ** @author Volker Friese ** @date 28.06.2014 **/ #ifndef CBMSTSSIGNAL_H #define CBMSTSSIGNAL_H 1 #include "FairTimeStamp.h" #include "CbmDetectorList.h" /** @class CbmStsSignal ** @brief Data class for an analog signal in the STS ** @author Volker Friese ** @since 28.06.2014 ** @version 1.0 ** ** Simple data class used in the digitisation process of the STS. It describes ** an analog charge signal produced in the STS sensors and arriving at the ** readout. It contains time and charge information (the latter through the ** total weight member of the CbmMatch member), and references to the MCPoints ** having caused the charge. ** In the most general case, a signal can be produced by more than one ** MCPoint; that is why the MC reference is of type CbmMatch and not CbmLink. **/ class CbmStsSignal : public FairTimeStamp { public: /** Default constructor ** @param time Signal time [ns] ** @param charge Analog charge [e] ** @param address Unique detector address ** @param index Index of CbmStsPoint ** @param entry Entry in input TTree ** @param file Number of input file **/ CbmStsSignal(Double_t time = 0., Double_t charge = 0., UInt_t address = 0, Int_t index = 0, Int_t entry = -1, Int_t file = -1); /** Destructor **/ virtual ~CbmStsSignal(); /** Add a link to MCPoint to the match member ** @param charge Analog charge [e] ** @param index Index of CbmStsPoint ** @param entry Entry in input TTree ** @param file Number of input file **/ void AddLink(Double_t charge, Int_t index, Int_t entry = -1, Int_t file = -1) { FairMultiLinkedData_Interface::AddLink(FairLink(file, entry, Cbm::kStsPoint, index, charge)); } /** Equality ** @param Pointer to CbmStsSignal to compare to ** ** Equality is defined by the unique detector address (same channel) **/ virtual bool equal(FairTimeStamp* data) { CbmStsSignal* signal = dynamic_cast(data); return ( fAddress == signal->GetAddress() ); } /** Unique detector address ** @value Unique address of channel **/ UInt_t GetAddress() const { return fAddress; } /** Charge ** @return Signal analog charge [e] **/ Double_t GetCharge() const { return fCharge; } /** Get time of signal ** @value Time of signal [ns] **/ const Double_t GetTime() { return fTimeStamp; } const Double_t GetTimeStart() { return fTimeStamp; } const Double_t GetTimeStop() { return fTimeStamp + 100.; } void SetTimeStop(Double_t time) { }; /** Set the charge of the signal ** @param charge New charge [e] **/ void SetCharge(Double_t charge) { fCharge = charge; } /** Set time of signal ** @param time Time of signal [ns] **/ void SetTime(Double_t time) { fTimeStamp = time; } /** Less operator ** Uses the address as comparison criterion */ bool operator < (const CbmStsSignal& signal) const { return ( fAddress < signal.GetAddress() ); } private: UInt_t fAddress; ///< Unique detector address (CbmStsAddress) Double_t fCharge; ///< Charge [e] ClassDef(CbmStsSignal, 1); }; #endif /* CBMSTSSIGNAL_H */