//----------------------------------------------------------- // File and Version Information: // $Id$ // // Description: // Tpc Digitization // Persisted data. Raw data // // // Environment: // Software developed for the PANDA Detector at FAIR. // // Author List: // Sebastian Neubert TUM (original author) // //----------------------------------------------------------- #ifndef TPCDIGI_HH #define TPCDIGI_HH // Base Class Headers ---------------- #include // Collaborating Class Headers ------- #include // remove if you do not need streaming op #include "McIdCollection.h" #include #include #include #include // Collaborating Class Declarations -- #include "TpcSample.h" class TpcDigi : public TObject { public: // Constructors/Destructors --------- TpcDigi(); TpcDigi(const double Amp, const double T, const unsigned int PadID, const McIdCollection& mcid, const unsigned int index = 0, const bool saturated=false); ~TpcDigi(){;} // Operators friend bool operator == (const TpcDigi& lhs, const TpcDigi& rhs); friend bool operator < (const TpcDigi& lhs, const TpcDigi& rhs); friend std::ostream& operator<< (std::ostream& s, const TpcDigi& me); // Accessors ----------------------- double amp() const {return famp;} double t() const {return ft;} unsigned int padId() const {return fpadID;} const McIdCollection& mcId() const {return fmcid;} void shiftEventIds(int shift){fmcid.ShiftEventIds(shift);} double tlength() const {return ftlength;} unsigned int index() const {return findex;} unsigned int nMcIds() const {return fmcid.nIDs();} double maxMcWeight() const {return fmcid.MaxRelWeight();} bool isSaturated() const {return fsaturated;} double getMaxSampleAmp(){return fmaxSampleAmp;} // Modifiers ----------------------- void amp(double val) {famp=val;} void t(double val) { ft=val;} void padId(unsigned int val) {fpadID=val;} void mcId(const McIdCollection& val) {fmcid=val;} void tlength(double dt){ftlength=dt;} void index(unsigned int caindex){findex = caindex;} void setSaturation(bool saturated=true){fsaturated=saturated;} void setMaxSampleAmp(double val){fmaxSampleAmp=val;} //Samples map------------------- unsigned int nSample() const { return fsamples.size(); } void addSample(int sampleIndex,double ampFrac); const std::map* getSampleMap() const { return &fsamples; } // void setSamples(std::vector samples){ // fsamples = samples; // } // std::vector getSamples(){ // return fsamples; // } // Operations ---------------------- void Print() const { std::cout << "===== TpcDigi::print() =====" << std::endl; std::cout << "padId " << padId() << " | amp " << amp() << " | t " << t() << std::endl; } private: // Private Data Members ------------ double famp; /// Amplitude in ADC channels, can be fractional from PSA double fmaxSampleAmp; double ft; /// Time in clock ticks ("samples"), can be fractional from PSA unsigned int fpadID; unsigned int findex; /// Position of Digi in TClonesArray (needed for FairLinks to work with TpcCluster) bool fsaturated; /// flag for saturated digis double ftlength; /// optional: range in t from which digi was constructed //TODO: Initalize correctly? McIdCollection fmcid; /// AWESOME neubert invention needed for Event Mixing and not understood by collaboration for past 5 years (as of date spring 2011, lets see how long they take) // Private Methods ----------------- //Saving indices of samples and their relative weight std::map fsamples; // public: ClassDef(TpcDigi,5) }; class PndTpcDigi : public TpcDigi { public: ClassDef(PndTpcDigi,11) }; #endif //-------------------------------------------------------------- // $Log: TpcDigi.hh,v $ // // Revision 1.5 2010/04/20 11:42:32 mvandenb // Integration of sample vector // // Revision 1.4 2006/02/24 14:39:34 sneubert // moved McIds to package MciData /// // Revision 1.3 2006/02/24 13:38:00 sneubert // Code revision done // // Revision 1.2 2006/01/29 20:26:30 sneubert // initial creation // // Revision 1.1 2005/10/14 12:28:35 sneubert // added TpcDigi // //--------------------------------------------------------------