// // This is a rip-off of MultiTrace. Code common between MultiTimeDistribution // and MultiTrace needs to be factored out. // // $Id: MultiTimeDistribution.h 21160 2012-05-15 13:43:26Z javierg $ #ifndef _utl_MultiTimeDistribution_h_ #define _utl_MultiTimeDistribution_h_ #include #include namespace utl { template class LabeledTimeDistribution : public LabeledObject > { public: LabeledTimeDistribution(const int label, TimeDistribution& td) : LabeledObject >(label, td) { } LabeledTimeDistribution(const std::pair*> pair) : LabeledObject >(pair) { } TimeDistribution& GetTimeDistribution() { return LabeledObject >::GetObject(); } const TimeDistribution& GetTimeDistribution() const { return LabeledObject >::GetObject(); } }; /** \brief A collection of TimeDistribution,which provides methods to access different sources. \author Stefano Argiro', Darko Veberic \date Jan 2003 \date 14 Nov 2005 revision \version $Id: MultiTimeDistribution.h 21160 2012-05-15 13:43:26Z javierg $
  • MultiTimeDistribution::GetTimeDistribution(sevt::StationConstants::eElectron) gives the electron component,
  • MultiTimeDistribution::GetTimeDistribution(sevt::StationConstants::eMuon) gives the muon component
  • MultiTimeDistribution::GetTimeDistribution() or
  • MultiTimeDistribution::GetTimeDistribution(sevt::StationConstants::eTotal) gives the total
For the FD case examples are:
  • MultiTimeDistribution::GetTimeDistribution(fevt::FdConstants::eFluorDirect)
  • MultiTimeDistribution::GetTimeDistribution(fevt::FdConstants::eCherRayleighScattered)
\param T is the type stored in the TimeDistribution (double, int etc) \warning: this class is for developer convenience, not meant for the average user \ingroup stl time */ template class MultiTimeDistribution : public MultiObject, LabeledTimeDistribution > { public: /// Returns the trace for /par source TimeDistribution& GetTimeDistribution(const int label = 0) { return MultiObject, LabeledTimeDistribution >::GetObject(label); } const TimeDistribution& GetTimeDistribution(const int label = 0) const { return MultiObject, LabeledTimeDistribution >::GetObject(label); } /** Creates a new TimeDistribution of size /par size and binning * /par binsize and assign source /par source */ void AddTimeDistribution(const double binSize, const int label) { this->AddObject(new TimeDistribution(binSize), label); } /** Copies trace in the internal list * and assign source /par source -The original can be deleted */ void AddTimeDistribution(const TimeDistribution& td, const int label) { this->AddObject(td, label); } }; // To keep the forward declarations consistent // modify TimeDistribution-fwd when chaniging/adding below typedef utl::MultiTimeDistribution MultiTimeDistributionD; typedef utl::MultiTimeDistribution MultiTimeDistributionI; } #endif // Configure (x)emacs for this file ... // Local Variables: // mode: c++ // compile-command: "cd ..; make -k" // End: