/search.css" rel="stylesheet" type="text/css"/> /search.js">
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

RecRpcTrigger.cc
Go to the documentation of this file.
00001 #include "Event/RecRpcTrigger.h"
00002 
00003 using DayaBay::RecRpcTrigger;
00004 using DayaBay::RecRpcCluster;
00005 
00006 RecRpcTrigger::RecRpcTrigger(const RecRpcTrigger& obj)
00007     : m_detector(obj.m_detector),
00008       m_triggerNumber(obj.m_triggerNumber),
00009       m_triggerTime(obj.m_triggerTime),
00010       m_triggerType(obj.m_triggerType),
00011       m_tracks(obj.m_tracks),
00012       m_header(obj.m_header)
00013 {
00014     std::vector<const RecRpcCluster*>::const_iterator end = obj.m_clusters.end();
00015     for (std::vector<const RecRpcCluster*>::const_iterator it = obj.m_clusters.begin();
00016          it != end;
00017          ++it ) {
00018         m_clusters.push_back(new RecRpcCluster(*(*it)));
00019     }
00020 }
00021 
00022 RecRpcTrigger& RecRpcTrigger::operator=(const RecRpcTrigger& obj)
00023 {
00024     if ( &obj != this ) {
00025         m_detector      = obj.m_detector;
00026         m_triggerNumber = obj.m_triggerNumber;
00027         m_triggerTime   = obj.m_triggerTime;
00028         m_triggerType   = obj.m_triggerType;
00029         m_tracks        = obj.m_tracks;
00030         m_header        = obj.m_header;
00031         //clear the current clusters
00032         std::vector<const RecRpcCluster*>::const_iterator end = m_clusters.end();
00033         for (std::vector<const RecRpcCluster*>::const_iterator it = m_clusters.begin();
00034                 it != end;
00035                 ++it ) {
00036             delete (*it);
00037         }
00038         m_clusters.clear();
00039         //assign the new clusters
00040         end = obj.m_clusters.end();
00041         for (std::vector<const RecRpcCluster*>::const_iterator it = obj.m_clusters.begin();
00042                 it != end;
00043                 ++it ) {
00044             m_clusters.push_back(new RecRpcCluster(*(*it)));
00045         }
00046     }
00047 
00048     return *this;
00049 }
00050 
00051 RecRpcTrigger::~RecRpcTrigger()
00052 {
00053     std::vector<const RecRpcCluster*>::const_iterator end = m_clusters.end();
00054     for (std::vector<const RecRpcCluster*>::const_iterator it = m_clusters.begin();
00055          it != end;
00056          ++it ) {
00057         delete (*it);
00058     }
00059 }
00060 
00061 unsigned int RecRpcTrigger::combinationType() const
00062 {
00063     if ( m_combinationType == 0 ) {
00064         unsigned int& _type = const_cast<unsigned int&>(m_combinationType);
00065         std::vector<const RecRpcCluster*>::const_iterator end = m_clusters.end();
00066         for (std::vector<const RecRpcCluster*>::const_iterator it = m_clusters.begin();
00067                 it != end;
00068                 ++it ) {
00069             _type |= (*it)->type();
00070         }
00071     }
00072     return m_combinationType;
00073 }
00074 
00075 const DayaBay::RecRpcCluster* RecRpcTrigger::getCluster(int index) const
00076 {
00077     return m_clusters.at(index);
00078 }
00079 
00080 void RecRpcTrigger::addCluster(const DayaBay::RecRpcCluster* cluster)
00081 {
00082     m_clusters.push_back(cluster);
00083 }
00084 
00085 int RecRpcTrigger::numCluster() const
00086 {
00087     return m_clusters.size();
00088 }
00089 
00090 const DayaBay::RecRpcTrack& RecRpcTrigger::getTrack(int index) const
00091 {
00092     return m_tracks.at(index);
00093 }
00094 
00095 void RecRpcTrigger::addTrack(const DayaBay::RecRpcTrack& track)
00096 {
00097     m_tracks.push_back(track);
00098 }
00099 
00100 int RecRpcTrigger::numTrack() const
00101 {
00102     return m_tracks.size();
00103 }
00104 
00105 int RecRpcTrigger::maxHitsInLayer() const
00106 {
00107     int max = 0;
00108     std::vector<const RecRpcCluster*>::const_iterator end = m_clusters.end();
00109     for (std::vector<const RecRpcCluster*>::const_iterator it = m_clusters.begin();
00110          it != end;
00111          ++it ) {
00112         int max_c = (*it)->maxHitsInLayer();
00113         if ( max_c > max ) {
00114             max = max_c;
00115         }
00116     }
00117     return max;
00118 }
00119 
00120 bool RecRpcTrigger::is4of4() const
00121 {
00122     std::vector<const RecRpcCluster*>::const_iterator end = m_clusters.end();
00123     for (std::vector<const RecRpcCluster*>::const_iterator it = m_clusters.begin();
00124          it != end;
00125          ++it ) {
00126         if ( (*it)->is4of4() ) return true;
00127     }
00128     return false;
00129 }
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Fri May 16 2014 10:00:28 for RecEvent by doxygen 1.7.4