#include <DataReducer.h>
Classes | |
class | MyData |
Public Types | |
typedef std::pair< EcalLogicID, T > | DataItem |
typedef std::map< EcalLogicID, T > | DataMap |
typedef std::list< MyData< T > >::iterator | iterator |
typedef std::list< std::pair < Tm, DataMap > >::iterator | list_iterator |
typedef std::map< EcalLogicID, T >::iterator | map_iterator |
typedef DataReducer< T > | self |
Public Member Functions | |
DataReducer () | |
void | getReducedDataList (std::list< std::pair< Tm, DataMap > > *my_new_list) |
void | setDataList (std::list< MyData< T > > _list) |
~DataReducer () | |
Static Public Attributes | |
static const int | TIMELIMIT = 60 |
Private Attributes | |
std::list< MyData< T > > | m_list |
bool | m_printout |
Definition at line 23 of file DataReducer.h.
typedef std::pair< EcalLogicID, T > DataReducer< T >::DataItem |
Definition at line 29 of file DataReducer.h.
typedef std::map< EcalLogicID, T > DataReducer< T >::DataMap |
Definition at line 30 of file DataReducer.h.
Definition at line 52 of file DataReducer.h.
typedef std::list< std::pair< Tm, DataMap > >::iterator DataReducer< T >::list_iterator |
Definition at line 31 of file DataReducer.h.
typedef std::map< EcalLogicID, T >::iterator DataReducer< T >::map_iterator |
Definition at line 32 of file DataReducer.h.
typedef DataReducer<T> DataReducer< T >::self |
Definition at line 28 of file DataReducer.h.
DataReducer< T >::DataReducer | ( | ) | [inline] |
Definition at line 55 of file DataReducer.h.
References DataReducer< T >::m_printout.
{ m_printout=false; };
DataReducer< T >::~DataReducer | ( | ) | [inline] |
Definition at line 56 of file DataReducer.h.
{};
void DataReducer< T >::getReducedDataList | ( | std::list< std::pair< Tm, DataMap > > * | my_new_list | ) | [inline] |
Definition at line 67 of file DataReducer.h.
References gather_cfg::cout, createTree::dd, EcalLogicID::getLogicID(), i, DataReducer< T >::m_list, DataReducer< T >::m_printout, Tm::microsTime(), Tm::str(), lumiQTWidget::t, and DataReducer< T >::TIMELIMIT.
Referenced by RunDCSHVDat::fetchHistoricalData().
{ /* *************************************** to get reduced data list *************************************** */ std::cout << " we are in getReducedDataList "<< std::endl; // std::list< std::pair< Tm, DataMap > > my_new_list ; iterator i; std::cout << " created iterator "<< std::endl; bool firstpass=true; unsigned int s_old=0; for ( i=m_list.begin(); i!=m_list.end(); i++){ Tm t = (*i).m_iData.first; DataItem d = (*i).m_iData.second; bool new_time_change=true; DataMap the_data; list_iterator it_good=my_new_list->end(); if(!firstpass) { list_iterator it; int last_state=-1; for(it =my_new_list->begin(); it!= my_new_list->end(); ++it) { // check on the state std::pair< Tm, DataMap > pair_new_list = *it; Tm t_l = pair_new_list.first; DataMap dd = pair_new_list.second; map_iterator ip; for(ip =dd.begin(); ip!= dd.end(); ++ip) { EcalLogicID ecid = ip->first; T dcs_dat = ip->second; if(ecid.getLogicID()==d.first.getLogicID() ) last_state= dcs_dat.getStatus(); } long long diff_time= (t.microsTime() - t_l.microsTime()) /1000000 ; if(diff_time<0) diff_time=-diff_time; if( diff_time < TIMELIMIT ) { // data change happened at the same moment new_time_change=false; // add data to the list the_data = pair_new_list.second; it_good=it; } } if(last_state != d.second.getStatus()){ if(!new_time_change ) { std::pair< Tm, DataMap > pair_new_list = *it_good; Tm t_good = pair_new_list.first; the_data = pair_new_list.second; the_data.insert(d); std::pair< Tm, DataMap > pair_new_good; pair_new_good.first=t_good; pair_new_good.second=the_data; my_new_list->erase(it_good); my_new_list->push_back(pair_new_good); } else if(new_time_change) { std::pair< Tm, DataMap > p_new; p_new.first=t; DataMap a_map; a_map.insert( d ); p_new.second=a_map; my_new_list->push_back(p_new); } } list_iterator it3; if(my_new_list->size() > s_old) { s_old=my_new_list->size(); if(m_printout){ std::cout << "************"<< std::endl; for(it3 =my_new_list->begin(); it3!= my_new_list->end(); ++it3) { std::pair< Tm, DataMap > pair_new_list3 = *it3; Tm t3 = pair_new_list3.first; std::cout << " T =" << t3.str()<< std::endl; } std::cout << "************"<< std::endl; } } } else { // first pass write it anyway std::pair< Tm, DataMap > p_new; p_new.first=t; DataMap a_map; a_map.insert( d ); p_new.second=a_map; my_new_list->insert(my_new_list->begin(),p_new); firstpass=false; } } if(m_printout) { list_iterator it3; for(it3 =my_new_list->begin(); it3!= my_new_list->end(); ++it3) { std::pair< Tm, DataMap > pair_new_list3 = *it3; Tm t3 = pair_new_list3.first; std::cout << " T =" << t3.str()<< std::endl; } } };
void DataReducer< T >::setDataList | ( | std::list< MyData< T > > | _list | ) | [inline] |
Definition at line 60 of file DataReducer.h.
References DataReducer< T >::m_list.
Referenced by RunDCSHVDat::fetchHistoricalData().
std::list< MyData<T> > DataReducer< T >::m_list [private] |
Definition at line 188 of file DataReducer.h.
Referenced by DataReducer< T >::getReducedDataList(), and DataReducer< T >::setDataList().
bool DataReducer< T >::m_printout [private] |
Definition at line 194 of file DataReducer.h.
Referenced by DataReducer< T >::DataReducer(), and DataReducer< T >::getReducedDataList().
const int DataReducer< T >::TIMELIMIT = 60 [static] |
Definition at line 58 of file DataReducer.h.
Referenced by DataReducer< T >::getReducedDataList().