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

In This Package:

Public Member Functions | Public Attributes
Scraper::dq::CQOrdering::CQOrdering Class Reference

List of all members.

Public Member Functions

def __init__
def __call__
def getChannellist
def channels

Public Attributes

 channellist

Detailed Description

get a list of ordered channel ids by querying cablemap in offline_db 

Definition at line 18 of file CQOrdering.py.


Constructor & Destructor Documentation

def Scraper::dq::CQOrdering::CQOrdering::__init__ (   self)
constructor 

Definition at line 21 of file CQOrdering.py.

00022                       :
00023         """ constructor """
00024         self.channellist = defaultdict(dict)
00025         return


Member Function Documentation

def Scraper::dq::CQOrdering::CQOrdering::__call__ (   self,
  site,
  det,
  ts 
)
call 

Definition at line 26 of file CQOrdering.py.

00027                                      :
00028         """ call """
00029         return self.getChannellist(site, det, ts)

def Scraper::dq::CQOrdering::CQOrdering::getChannellist (   self,
  thissite,
  thisdet,
  timestamp 
)
query offline db for the cable map from AdPmtSensor<-->FeeChannelId 

Definition at line 30 of file CQOrdering.py.

00031                                                           :
00032         """ query offline db for the cable map from AdPmtSensor<-->FeeChannelId """
00033         # dict key
00034         site_det = '%d_%d' % (thissite, thisdet)
00035         date = timestamp.GetDate()
00036         if date not in self.channellist[site_det].keys():
00037             self.channellist[site_det].clear()
00038             self.channellist[site_det][date] = []
00039             rpt = GCableMap.Rpt()
00040             rpt.ctx( site       = thissite,
00041                      subsite    = thisdet,
00042                      simflag    = SimFlag.kData,
00043                      timestamp  = timestamp )
00044             rptlen = len(rpt)
00045             for idx in range(rptlen):
00046                 record = rpt[idx]
00047                 elecchanid = record.GetChannelId()
00048                 pmt = AdPmtSensor( record.GetSensorId().fullPackedData() )
00049                 if pmt.is8inch(): # 8" PMT only
00050                     self.channellist[site_det][date].append( elecchanid.fullPackedData() )
00051             self.channellist[site_det][date] = sorted(self.channellist[site_det][date])
00052             assert len(self.channellist[site_det][date])==192, '%d PMTs found in db!' % len(self.channellist[site_det][date])
00053             assert len(self.channellist[site_det][date])==len(set(self.channellist[site_det][date])), 'duplicated channelid found in db!'
00054         return self.channellist[site_det][date]

def Scraper::dq::CQOrdering::CQOrdering::channels (   self,
  sitemask,
  subsite,
  timestart 
)
:param sitemask:
:param subsite:
:param timestart: `datetime.datetime` instance
:return: list of channelids

Definition at line 55 of file CQOrdering.py.

00056                                                     :
00057         """
00058         :param sitemask:
00059         :param subsite:
00060         :param timestart: `datetime.datetime` instance
00061         :return: list of channelids
00062         """
00063         ts = TimeStamp(calendar.timegm(timestart.timetuple()))
00064         return self(sitemask, subsite, ts) 


Member Data Documentation

Definition at line 21 of file CQOrdering.py.


The documentation for this class was generated from the following file:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Fri May 16 2014 09:50:03 for Scraper by doxygen 1.7.4