// -------------------------------------------------------- // ---- PndSdsDigi header file --- // ---- Created 19.10.07 by T.Stockmanns --- // -------------------------------------------------------- /** PndSdsDigi.h *@author T.Stockmanns ** ** \brief Base class for Digi information ** ** **/ #ifndef PNDSDSDIGI_H #define PNDSDSDIGI_H #include "FairTimeStamp.h" #include "TObject.h" #include "TString.h" #include "PndDetectorList.h" #include #include class PndSdsDigi : public FairTimeStamp { friend std::ostream& operator<< (std::ostream& out, PndSdsDigi& digi){ out << "PndSds Digi in sensor: " << digi.GetSensorID() << " FE: " << digi.GetFE() << " " << " charge: " << digi.GetCharge() << " e" << " timestamp: "< indices = digi.GetIndices(); for (unsigned int i = 0; i < indices.size(); i++){ std::cout << digi.GetIndex(i) << " " << std::endl; } return out; } public: PndSdsDigi(); PndSdsDigi(std::vector index, Int_t detID, Int_t sensorID, Int_t fe, Double_t charge, Double_t timestamp = -1); PndSdsDigi(Int_t index, Int_t detID, Int_t fSensorID, Int_t fe, Double_t charge, Double_t timestamp = -1); /**GetID(gGeoManager->GetPath()) information * \param fe front end ID * \param charge deposited charge in electrons */ virtual ~PndSdsDigi(){}; Int_t GetFE() const { return fFE;} //TString GetDetName() const { return fDetName; } Int_t GetSensorID() const { return fSensorID; } Double_t GetCharge() const { return fCharge; } Int_t GetDetID() const { return fDetID;} std::vector GetIndices() const { return fIndex;} Int_t GetIndex(int i = 0) const{ return fIndex[i];} Int_t GetNIndices() const { return fIndex.size();} Double_t GetTimeStamp() const { return fTimeStamp;} virtual void AddIndex(int index) { fIndex.push_back(index); AddLink(FairLink(fDetID, index)); } virtual void AddIndex(std::vector index) { fIndex = index; AddLinks(FairMultiLinkedData(fDetID, index)); } void SetCharge(double charge){fCharge = charge;} void AddCharge(double charge){fCharge += charge;} virtual void Print() { std::cout << *this; } protected: std::vector fIndex; // indice of mc points contributing to this digi Int_t fDetID; // branch ID of mc point array Int_t fSensorID; // Geometry ID for sensor volume Int_t fFE; // Frontend number Double_t fCharge; // collected charge ClassDef(PndSdsDigi,4); }; #endif