CMS 3D CMS Logo

stor::SMFUSenderEntry Struct Reference

#include <EventFilter/StorageManager/interface/SMFUSenderEntry.h>

List of all members.

Public Member Functions

bool addFrame (const unsigned int frameCount, const unsigned int numFrames, const uint32 regSize, const std::string outModName)
void addReg2Entry (const unsigned int frameCount, const unsigned int numFramesToAllocate, const std::string outModName, const uint32 outModId, const uint32 regSize)
 returns true if frame added completes the registry
unsigned int getAlleventsReceived () const
unsigned int getAllframesReceived () const
unsigned long long getAlltotalSizeReceived () const
unsigned int getconnectStatus () const
unsigned int getcurrFrames (const std::string outModName)
bool getDataStatus ()
SMFUSenderDatCollection getDatCollection () const
unsigned int geteventsReceived (const std::string outModName)
unsigned int getframesReceived (const std::string outModName)
unsigned int gethltInstance () const
unsigned int gethltLocalId () const
unsigned int gethltTid () const
bool getisLocal () const
unsigned int getlastEventID () const
unsigned int getlastFrameNum (const std::string outModName)
double getlastLatency () const
unsigned int getlastRunID () const
unsigned int getlastTotalFrameNum (const std::string outModName)
unsigned int getnumOutMod () const
uint32 getrbBufferID () const
SMFUSenderRegCollection getRegistryCollection () const
unsigned int getregistrySize (const std::string outModName)
unsigned int getrunNumber () const
double getStopWTime ()
unsigned int gettotalBadEvents () const
unsigned int gettotalOutOfOrder () const
unsigned long long gettotalSizeReceived (const std::string outModName)
unsigned int gettotFrames (const std::string outModName)
boost::shared_ptr< std::vector
< char > > 
getvhltClassName ()
boost::shared_ptr< std::vector
< char > > 
getvhltURL ()
bool match (const char *hltURL, const char *hltClassName, const unsigned int hltLocalId, const unsigned int hltInstance, const unsigned int hltTid, const uint32 rbBufferID, const std::string outModName)
bool matchFirst (const char *hltURL, const char *hltClassName, const unsigned int hltLocalId, const unsigned int hltInstance, const unsigned int hltTid, const uint32 outModId)
bool matchFirst (const char *hltURL, const char *hltClassName, const unsigned int hltLocalId, const unsigned int hltInstance, const unsigned int hltTid, const std::string outModName)
bool matchFirst (const char *hltURL, const char *hltClassName, const unsigned int hltLocalId, const unsigned int hltInstance, const unsigned int hltTid)
bool regIsCopied (const std::string outModName)
bool sameOutMod (const uint32 outModId)
bool sameOutMod (const std::string outModName)
void setDataStatus ()
void setisLocal (const bool local)
void setrunNumber (const unsigned int run)
 SMFUSenderEntry (const char *hltURL, const char *hltClassName, const unsigned int hltLocalId, const unsigned int hltInstance, const unsigned int hltTid, const unsigned int frameCount, const unsigned int numFramesToAllocate, const std::string outModName, const uint32 outModId, const uint32 rbBufferID, const uint32 regSize)
bool update4Data (const unsigned int runNumber, const unsigned int eventNumber, const unsigned int frameNum, const unsigned int totalFrames, const unsigned int origdatasize, const uint32 outModId)

Private Member Functions

bool sameClassName (const char *hltClassName)
bool sameURL (const char *hltURL)

Private Attributes

toolbox::Chrono chrono_
unsigned int connectStatus_
SMFUSenderDatCollection datCollection_
boost::mutex entry_lock_
unsigned int eventsReceived_
unsigned int framesReceived_
char hltClassName_ [MAX_I2O_SM_URLCHARS]
unsigned int hltInstance_
unsigned int hltLocalId_
unsigned int hltTid_
char hltURL_ [MAX_I2O_SM_URLCHARS]
bool isLocal_
unsigned int lastEventID_
double lastLatency_
unsigned int lastRunID_
const uint32 rbBufferID_
SMFUSenderRegCollection registryCollection_
unsigned int runNumber_
unsigned int totalBadEvents_
unsigned int totalOutOfOrder_
unsigned long long totalSizeReceived_


Detailed Description

Definition at line 37 of file SMFUSenderEntry.h.


Constructor & Destructor Documentation

SMFUSenderEntry::SMFUSenderEntry ( const char *  hltURL,
const char *  hltClassName,
const unsigned int  hltLocalId,
const unsigned int  hltInstance,
const unsigned int  hltTid,
const unsigned int  frameCount,
const unsigned int  numFramesToAllocate,
const std::string  outModName,
const uint32  outModId,
const uint32  rbBufferID,
const uint32  regSize 
)

Definition at line 15 of file SMFUSenderEntry.cc.

References chrono_, connectStatus_, edmNew::copy(), stor::SMFUSenderRegCollection::currFramesMap_, datCollection_, lat::endl(), eventsReceived_, stor::SMFUSenderDatCollection::eventsReceivedMap_, FDEBUG, framesReceived_, stor::SMFUSenderDatCollection::framesReceivedMap_, hltClassName_, hltInstance_, hltTid_, hltURL_, isLocal_, lastEventID_, stor::SMFUSenderDatCollection::lastEventIDMap_, stor::SMFUSenderDatCollection::lastFrameNumMap_, lastLatency_, lastRunID_, stor::SMFUSenderDatCollection::lastTotalFrameNumMap_, MAX_I2O_SM_URLCHARS, stor::SMFUSenderRegCollection::outModId2ModName_, stor::SMFUSenderRegCollection::outModName2ModId_, stor::SMFUSenderRegCollection::outModName_, registryCollection_, stor::SMFUSenderRegCollection::registrySizeMap_, runNumber_, totalBadEvents_, totalOutOfOrder_, totalSizeReceived_, stor::SMFUSenderDatCollection::totalSizeReceivedMap_, and stor::SMFUSenderRegCollection::totFramesMap_.

00025                                       :
00026   hltLocalId_(hltLocalId), 
00027   hltInstance_(hltInstance), 
00028   hltTid_(hltTid),
00029   rbBufferID_(rbBufferID)
00030 {
00031   copy(hltURL, hltURL+MAX_I2O_SM_URLCHARS, hltURL_);
00032   copy(hltClassName, hltClassName+MAX_I2O_SM_URLCHARS, hltClassName_);
00033   registryCollection_.outModName_.push_back(outModName);
00034   registryCollection_.outModName2ModId_.insert(std::make_pair(outModName, outModId));
00035   registryCollection_.outModId2ModName_.insert(std::make_pair(outModId, outModName));
00036   registryCollection_.registrySizeMap_.insert(std::make_pair(outModName, regSize));
00037   registryCollection_.totFramesMap_.insert(std::make_pair(outModName, numFramesToAllocate));
00038   registryCollection_.currFramesMap_.insert(std::make_pair(outModName, 1));
00039   /*
00040      Connect status
00041      Bit 1 = 0 disconnected (was connected before)
00042            = 1 connected and received at least one registry frame
00043      Bit 2 = 0 not yet received a data frame
00044            = 1 received at least one data frame
00045   */
00046   connectStatus_ = 1;
00047   lastLatency_ = 0.0;
00048   runNumber_ = 0;
00049   isLocal_ = false;
00050   framesReceived_ = 1;
00051   eventsReceived_ = 0;
00052   lastEventID_ = 0;
00053   lastRunID_ = 0;
00054   totalOutOfOrder_ = 0;
00055   totalSizeReceived_ = 0;
00056   totalBadEvents_ = 0;
00057   // initialize the datCollection TODO
00058   datCollection_.framesReceivedMap_.insert(std::make_pair(outModName, 1));
00059   datCollection_.eventsReceivedMap_.insert(std::make_pair(outModName, 0));
00060   datCollection_.lastEventIDMap_.insert(std::make_pair(outModName, 0));
00061   datCollection_.lastFrameNumMap_.insert(std::make_pair(outModName, 0));
00062   datCollection_.lastTotalFrameNumMap_.insert(std::make_pair(outModName, 0));
00063   // why is framesReceived = 0 but size zero! Because for data only?
00064   datCollection_.totalSizeReceivedMap_.insert(std::make_pair(outModName, 0));
00065   chrono_.start(0);
00066 
00067   FDEBUG(9) << "SMFUSenderEntry: Making a SMFUSenderEntry struct for "
00068             << hltURL_ << " class " << hltClassName_  << " instance "
00069             << hltInstance_ << " Tid " << hltTid_ << std::endl;
00070 }


Member Function Documentation

bool SMFUSenderEntry::addFrame ( const unsigned int  frameCount,
const unsigned int  numFrames,
const uint32  regSize,
const std::string  outModName 
)

Definition at line 100 of file SMFUSenderEntry.cc.

References stor::SMFUSenderRegCollection::currFramesMap_, entry_lock_, registryCollection_, and sl.

00102 {
00103    // should test total frames is the same, and other tests are possible
00104    // add a received registry fragment frame for this FU Sender
00105    boost::mutex::scoped_lock sl(entry_lock_);
00106    ++(registryCollection_.currFramesMap_[outModName]);
00107    return(true);
00108 }

void SMFUSenderEntry::addReg2Entry ( const unsigned int  frameCount,
const unsigned int  numFramesToAllocate,
const std::string  outModName,
const uint32  outModId,
const uint32  regSize 
)

returns true if frame added completes the registry

Definition at line 303 of file SMFUSenderEntry.cc.

References chrono_, stor::SMFUSenderRegCollection::currFramesMap_, datCollection_, lat::endl(), stor::SMFUSenderDatCollection::eventsReceivedMap_, FDEBUG, framesReceived_, stor::SMFUSenderDatCollection::framesReceivedMap_, hltClassName_, hltInstance_, hltTid_, hltURL_, stor::SMFUSenderDatCollection::lastEventIDMap_, stor::SMFUSenderDatCollection::lastFrameNumMap_, lastLatency_, stor::SMFUSenderDatCollection::lastTotalFrameNumMap_, stor::SMFUSenderRegCollection::outModId2ModName_, stor::SMFUSenderRegCollection::outModName2ModId_, stor::SMFUSenderRegCollection::outModName_, registryCollection_, stor::SMFUSenderRegCollection::registrySizeMap_, stor::SMFUSenderDatCollection::totalSizeReceivedMap_, and stor::SMFUSenderRegCollection::totFramesMap_.

00306 {
00307   registryCollection_.outModName_.push_back(outModName);
00308   registryCollection_.outModName2ModId_.insert(std::make_pair(outModName, outModId));
00309   registryCollection_.outModId2ModName_.insert(std::make_pair(outModId, outModName));
00310   registryCollection_.registrySizeMap_.insert(std::make_pair(outModName, regSize));
00311   registryCollection_.totFramesMap_.insert(std::make_pair(outModName, numFramesToAllocate));
00312   registryCollection_.currFramesMap_.insert(std::make_pair(outModName, 1));
00313   ++framesReceived_;
00314   // initialize the datCollection
00315   datCollection_.framesReceivedMap_.insert(std::make_pair(outModName, 1));
00316   datCollection_.eventsReceivedMap_.insert(std::make_pair(outModName, 0));
00317   datCollection_.lastEventIDMap_.insert(std::make_pair(outModName, 0));
00318   datCollection_.lastFrameNumMap_.insert(std::make_pair(outModName, 0));
00319   datCollection_.lastTotalFrameNumMap_.insert(std::make_pair(outModName, 0));
00320   // why is framesReceived = 0 but size zero! (because not data, just registry)
00321   datCollection_.totalSizeReceivedMap_.insert(std::make_pair(outModName, 0));
00322   chrono_.stop(0);
00323   lastLatency_ = (double) chrono_.dusecs(); //microseconds
00324   chrono_.start(0);
00325 
00326   FDEBUG(9) << "SMFUSenderEntry: Making a SMFUSenderEntry struct for "
00327             << hltURL_ << " class " << hltClassName_  << " instance "
00328             << hltInstance_ << " Tid " << hltTid_ << std::endl;
00329 }

unsigned int stor::SMFUSenderEntry::getAlleventsReceived (  )  const [inline]

Definition at line 117 of file SMFUSenderEntry.h.

References eventsReceived_.

00117 {return eventsReceived_;}

unsigned int stor::SMFUSenderEntry::getAllframesReceived (  )  const [inline]

Definition at line 115 of file SMFUSenderEntry.h.

References framesReceived_.

00115 {return framesReceived_;}

unsigned long long stor::SMFUSenderEntry::getAlltotalSizeReceived (  )  const [inline]

Definition at line 124 of file SMFUSenderEntry.h.

References totalSizeReceived_.

00124 {return totalSizeReceived_;}

unsigned int stor::SMFUSenderEntry::getconnectStatus (  )  const [inline]

Definition at line 111 of file SMFUSenderEntry.h.

References connectStatus_.

00111 {return connectStatus_;}

unsigned int SMFUSenderEntry::getcurrFrames ( const std::string  outModName  ) 

Definition at line 357 of file SMFUSenderEntry.cc.

References stor::SMFUSenderRegCollection::currFramesMap_, and registryCollection_.

00358 {
00359   return registryCollection_.currFramesMap_[outModName];
00360 }

bool SMFUSenderEntry::getDataStatus (  ) 

Definition at line 227 of file SMFUSenderEntry.cc.

References connectStatus_.

00228 {
00229    // test if second bit is set
00230    if((connectStatus_ & 2) > 0) return true;
00231    else return false;
00232 }

SMFUSenderDatCollection stor::SMFUSenderEntry::getDatCollection (  )  const [inline]

Definition at line 107 of file SMFUSenderEntry.h.

References datCollection_.

00107 {return datCollection_;}

unsigned int SMFUSenderEntry::geteventsReceived ( const std::string  outModName  ) 

Definition at line 367 of file SMFUSenderEntry.cc.

References datCollection_, and stor::SMFUSenderDatCollection::eventsReceivedMap_.

00368 {
00369   return datCollection_.eventsReceivedMap_[outModName];
00370 }

unsigned int SMFUSenderEntry::getframesReceived ( const std::string  outModName  ) 

Definition at line 362 of file SMFUSenderEntry.cc.

References datCollection_, and stor::SMFUSenderDatCollection::framesReceivedMap_.

00363 {
00364   return datCollection_.framesReceivedMap_[outModName];
00365 }

unsigned int stor::SMFUSenderEntry::gethltInstance (  )  const [inline]

Definition at line 102 of file SMFUSenderEntry.h.

References hltInstance_.

00102 {return hltInstance_;}

unsigned int stor::SMFUSenderEntry::gethltLocalId (  )  const [inline]

Definition at line 101 of file SMFUSenderEntry.h.

References hltLocalId_.

00101 {return hltLocalId_;}

unsigned int stor::SMFUSenderEntry::gethltTid (  )  const [inline]

Definition at line 103 of file SMFUSenderEntry.h.

References hltTid_.

00103 {return hltTid_;}

bool stor::SMFUSenderEntry::getisLocal (  )  const [inline]

Definition at line 114 of file SMFUSenderEntry.h.

References isLocal_.

00114 {return isLocal_;}

unsigned int stor::SMFUSenderEntry::getlastEventID (  )  const [inline]

Definition at line 119 of file SMFUSenderEntry.h.

References lastEventID_.

00119 {return lastEventID_;}

unsigned int SMFUSenderEntry::getlastFrameNum ( const std::string  outModName  ) 

Definition at line 372 of file SMFUSenderEntry.cc.

References datCollection_, and stor::SMFUSenderDatCollection::lastFrameNumMap_.

00373 {
00374   return datCollection_.lastFrameNumMap_[outModName];
00375 }

double stor::SMFUSenderEntry::getlastLatency (  )  const [inline]

Definition at line 112 of file SMFUSenderEntry.h.

References lastLatency_.

00112 {return lastLatency_;}

unsigned int stor::SMFUSenderEntry::getlastRunID (  )  const [inline]

Definition at line 120 of file SMFUSenderEntry.h.

References lastRunID_.

00120 {return lastRunID_;}

unsigned int SMFUSenderEntry::getlastTotalFrameNum ( const std::string  outModName  ) 

Definition at line 377 of file SMFUSenderEntry.cc.

References datCollection_, and stor::SMFUSenderDatCollection::lastTotalFrameNumMap_.

00378 {
00379   return datCollection_.lastTotalFrameNumMap_[outModName];
00380 }

unsigned int stor::SMFUSenderEntry::getnumOutMod (  )  const [inline]

Definition at line 105 of file SMFUSenderEntry.h.

References stor::SMFUSenderRegCollection::outModName_, and registryCollection_.

00105 {return registryCollection_.outModName_.size();}

uint32 stor::SMFUSenderEntry::getrbBufferID (  )  const [inline]

Definition at line 104 of file SMFUSenderEntry.h.

References rbBufferID_.

00104 {return rbBufferID_;}

SMFUSenderRegCollection stor::SMFUSenderEntry::getRegistryCollection (  )  const [inline]

Definition at line 106 of file SMFUSenderEntry.h.

References registryCollection_.

00106 {return registryCollection_;}

unsigned int SMFUSenderEntry::getregistrySize ( const std::string  outModName  ) 

Definition at line 347 of file SMFUSenderEntry.cc.

References registryCollection_, and stor::SMFUSenderRegCollection::registrySizeMap_.

00348 {
00349   return registryCollection_.registrySizeMap_[outModName];
00350 }

unsigned int stor::SMFUSenderEntry::getrunNumber (  )  const [inline]

Definition at line 113 of file SMFUSenderEntry.h.

References runNumber_.

00113 {return runNumber_;}

double SMFUSenderEntry::getStopWTime (  ) 

Definition at line 197 of file SMFUSenderEntry.cc.

References chrono_, entry_lock_, and sl.

00198 {
00199    boost::mutex::scoped_lock sl(entry_lock_); // should check if this is needed
00200    chrono_.stop(0); // note that this does not actually stop the stopwatch
00201 
00202    // 30-Jul-2008, KAB: changed the units of the return value from
00203    // microseconds to milliseconds
00204    return ((double) chrono_.dsecs() * 1000.0);
00205 }

unsigned int stor::SMFUSenderEntry::gettotalBadEvents (  )  const [inline]

Definition at line 126 of file SMFUSenderEntry.h.

References totalBadEvents_.

00126 {return totalBadEvents_;}

unsigned int stor::SMFUSenderEntry::gettotalOutOfOrder (  )  const [inline]

Definition at line 123 of file SMFUSenderEntry.h.

References totalOutOfOrder_.

00123 {return totalOutOfOrder_;}

unsigned long long SMFUSenderEntry::gettotalSizeReceived ( const std::string  outModName  ) 

Definition at line 382 of file SMFUSenderEntry.cc.

References datCollection_, and stor::SMFUSenderDatCollection::totalSizeReceivedMap_.

00383 {
00384   return datCollection_.totalSizeReceivedMap_[outModName];
00385 }

unsigned int SMFUSenderEntry::gettotFrames ( const std::string  outModName  ) 

Definition at line 352 of file SMFUSenderEntry.cc.

References registryCollection_, and stor::SMFUSenderRegCollection::totFramesMap_.

00353 {
00354   return registryCollection_.totFramesMap_[outModName];
00355 }

boost::shared_ptr< std::vector< char > > SMFUSenderEntry::getvhltClassName (  ) 

Definition at line 217 of file SMFUSenderEntry.cc.

References edmNew::copy(), hltClassName_, and i.

00218 {
00219   int i = 0;
00220   while (hltClassName_[i] != '\0') i = i + 1;
00221   boost::shared_ptr<std::vector<char> > hltClassName(new vector<char>);
00222   hltClassName->resize(i);
00223   copy(hltClassName_, hltClassName_+i, &(hltClassName->at(0)) );
00224   return hltClassName;
00225 }

boost::shared_ptr< std::vector< char > > SMFUSenderEntry::getvhltURL (  ) 

Definition at line 207 of file SMFUSenderEntry.cc.

References edmNew::copy(), hltURL_, and i.

00208 {
00209   int i = 0;
00210   while (hltURL_[i] != '\0') i = i + 1;
00211   boost::shared_ptr<std::vector<char> > hltURL(new vector<char>);
00212   hltURL->resize(i);
00213   copy(hltURL_, hltURL_+i, &(hltURL->at(0)) );
00214   return hltURL;
00215 }

bool SMFUSenderEntry::match ( const char *  hltURL,
const char *  hltClassName,
const unsigned int  hltLocalId,
const unsigned int  hltInstance,
const unsigned int  hltTid,
const uint32  rbBufferID,
const std::string  outModName 
)

Definition at line 254 of file SMFUSenderEntry.cc.

References hltInstance_, hltLocalId_, hltTid_, rbBufferID_, sameClassName(), sameOutMod(), and sameURL().

00260 {
00261    if(hltLocalId_ == hltLocalId && hltInstance_ == hltInstance &&
00262       hltTid_ == hltTid && sameURL(hltURL) && sameClassName(hltClassName) &&
00263       rbBufferID_ == rbBufferID && sameOutMod(outModName))
00264    {
00265       return true;
00266    } else {
00267       return false;
00268    }
00269 }

bool SMFUSenderEntry::matchFirst ( const char *  hltURL,
const char *  hltClassName,
const unsigned int  hltLocalId,
const unsigned int  hltInstance,
const unsigned int  hltTid,
const uint32  outModId 
)

Definition at line 287 of file SMFUSenderEntry.cc.

References hltInstance_, hltLocalId_, hltTid_, sameClassName(), sameOutMod(), and sameURL().

00292 {
00293    if(hltLocalId_ == hltLocalId && hltInstance_ == hltInstance &&
00294       hltTid_ == hltTid && sameURL(hltURL) && sameClassName(hltClassName) &&
00295       sameOutMod(outModId))
00296    {
00297       return true;
00298    } else {
00299       return false;
00300    }
00301 }

bool SMFUSenderEntry::matchFirst ( const char *  hltURL,
const char *  hltClassName,
const unsigned int  hltLocalId,
const unsigned int  hltInstance,
const unsigned int  hltTid,
const std::string  outModName 
)

Definition at line 271 of file SMFUSenderEntry.cc.

References hltInstance_, hltLocalId_, hltTid_, sameClassName(), sameOutMod(), and sameURL().

00276 {
00277    if(hltLocalId_ == hltLocalId && hltInstance_ == hltInstance &&
00278       hltTid_ == hltTid && sameURL(hltURL) && sameClassName(hltClassName) &&
00279       sameOutMod(outModName))
00280    {
00281       return true;
00282    } else {
00283       return false;
00284    }
00285 }

bool SMFUSenderEntry::matchFirst ( const char *  hltURL,
const char *  hltClassName,
const unsigned int  hltLocalId,
const unsigned int  hltInstance,
const unsigned int  hltTid 
)

Definition at line 240 of file SMFUSenderEntry.cc.

References hltInstance_, hltLocalId_, hltTid_, sameClassName(), and sameURL().

00244 {
00245    if(hltLocalId_ == hltLocalId && hltInstance_ == hltInstance &&
00246       hltTid_ == hltTid && sameURL(hltURL) && sameClassName(hltClassName))
00247    {
00248       return true;
00249    } else {
00250       return false;
00251    }
00252 }

bool SMFUSenderEntry::regIsCopied ( const std::string  outModName  ) 

Definition at line 234 of file SMFUSenderEntry.cc.

References registryCollection_, and stor::SMFUSenderRegCollection::registrySizeMap_.

00235 {
00236    if(registryCollection_.registrySizeMap_[outModName] > 0) return true;
00237    else return false;
00238 }

bool SMFUSenderEntry::sameClassName ( const char *  hltClassName  )  [private]

Definition at line 86 of file SMFUSenderEntry.cc.

References lat::endl(), FDEBUG, hltClassName_, and i.

Referenced by match(), and matchFirst().

00087 {
00088   int i = 0;
00089   while (hltClassName[i] != '\0') {
00090     if(hltClassName_[i] != hltClassName[i]) {
00091       FDEBUG(9) << "sameClassName: failed char test at " << i << std::endl;
00092       return false;
00093     }
00094     i = i + 1;
00095   }
00096   FDEBUG(10) << "sameClassName: same classname " << std::endl;
00097   return true;
00098 }

bool SMFUSenderEntry::sameOutMod ( const uint32  outModId  ) 

Definition at line 339 of file SMFUSenderEntry.cc.

References stor::SMFUSenderRegCollection::outModId2ModName_, and registryCollection_.

00340 {
00341   if(registryCollection_.outModId2ModName_.find(outModId) != registryCollection_.outModId2ModName_.end())
00342     return true;
00343   else
00344     return false;
00345 }

bool SMFUSenderEntry::sameOutMod ( const std::string  outModName  ) 

Definition at line 331 of file SMFUSenderEntry.cc.

References stor::SMFUSenderRegCollection::outModName2ModId_, and registryCollection_.

Referenced by match(), and matchFirst().

00332 {
00333   if(registryCollection_.outModName2ModId_.find(outModName) != registryCollection_.outModName2ModId_.end())
00334     return true;
00335   else
00336     return false;
00337 }

bool SMFUSenderEntry::sameURL ( const char *  hltURL  )  [private]

Definition at line 72 of file SMFUSenderEntry.cc.

References lat::endl(), FDEBUG, hltURL_, and i.

Referenced by match(), and matchFirst().

00073 {
00074   int i = 0;
00075   while (hltURL[i] != '\0') {
00076     if(hltURL_[i] != hltURL[i]) {
00077       FDEBUG(9) << "sameURL: failed char test at " << i << std::endl;
00078       return false;
00079     }
00080     i = i + 1;
00081   }
00082   FDEBUG(10) << "sameURL: same url " << std::endl;
00083   return true;
00084 }

void SMFUSenderEntry::setDataStatus (  ) 

Definition at line 178 of file SMFUSenderEntry.cc.

References connectStatus_, entry_lock_, and sl.

00179 {
00180    boost::mutex::scoped_lock sl(entry_lock_);
00181    // set second bit (received at least one data frame)
00182    connectStatus_ = connectStatus_ | 2;
00183 }

void SMFUSenderEntry::setisLocal ( const bool  local  ) 

Definition at line 191 of file SMFUSenderEntry.cc.

References entry_lock_, isLocal_, and sl.

00192 {
00193    boost::mutex::scoped_lock sl(entry_lock_);
00194    isLocal_ = local;
00195 }

void SMFUSenderEntry::setrunNumber ( const unsigned int  run  ) 

Definition at line 185 of file SMFUSenderEntry.cc.

References entry_lock_, runNumber_, and sl.

00186 {
00187    boost::mutex::scoped_lock sl(entry_lock_);
00188    runNumber_ = run;
00189 }

bool SMFUSenderEntry::update4Data ( const unsigned int  runNumber,
const unsigned int  eventNumber,
const unsigned int  frameNum,
const unsigned int  totalFrames,
const unsigned int  origdatasize,
const uint32  outModId 
)

Definition at line 110 of file SMFUSenderEntry.cc.

References chrono_, datCollection_, entry_lock_, eventsReceived_, stor::SMFUSenderDatCollection::eventsReceivedMap_, framesReceived_, stor::SMFUSenderDatCollection::framesReceivedMap_, lastEventID_, stor::SMFUSenderDatCollection::lastEventIDMap_, stor::SMFUSenderDatCollection::lastFrameNumMap_, lastLatency_, lastRunID_, stor::SMFUSenderDatCollection::lastTotalFrameNumMap_, stor::SMFUSenderRegCollection::outModId2ModName_, registryCollection_, sl, totalBadEvents_, totalOutOfOrder_, totalSizeReceived_, and stor::SMFUSenderDatCollection::totalSizeReceivedMap_.

00113 {
00114    // update statistics for a received data fragment frame for this FU sender
00115    boost::mutex::scoped_lock sl(entry_lock_);
00116    std::string outModName = registryCollection_.outModId2ModName_[outModId];
00117    ++framesReceived_;
00118    ++(datCollection_.framesReceivedMap_[outModName]);
00119    lastRunID_ = runNumber;
00120    chrono_.stop(0);
00121    lastLatency_ = (double) chrono_.dusecs(); //microseconds
00122    chrono_.start(0);
00123    bool problemFound = false;
00124    bool fullEvent = false;
00125    if(totalFrames == 1) 
00126    {
00127       // there is only one frame in this event assume frameNum = 1!
00128       ++eventsReceived_;
00129       ++(datCollection_.eventsReceivedMap_[outModName]);
00130       fullEvent = true;
00131       lastEventID_ = eventNumber;
00132       datCollection_.lastEventIDMap_[outModName] = eventNumber;
00133       datCollection_.lastFrameNumMap_[outModName] = frameNum;
00134       datCollection_.lastTotalFrameNumMap_[outModName] = totalFrames;
00135       totalSizeReceived_ = totalSizeReceived_ + origdatasize;
00136       datCollection_.totalSizeReceivedMap_[outModName] += origdatasize;
00137    } else {
00138       // flag and count if frame (event fragment) out of order
00139       if(datCollection_.lastEventIDMap_[outModName] == eventNumber) 
00140       {
00141         // check if in order and if last frame in a chain
00142         if(frameNum != datCollection_.lastFrameNumMap_[outModName] + 1) {
00143           ++totalOutOfOrder_;
00144         }
00145         if(totalFrames != datCollection_.lastTotalFrameNumMap_[outModName]) {
00146           // this is a real problem! Corrupt data frame
00147           problemFound = true;
00148         }
00149         // if last frame in n-of-m assume it completes an event
00150         // frame count starts from 1
00151         if(frameNum == totalFrames) { //should check totalFrames
00152           ++eventsReceived_;
00153           ++(datCollection_.eventsReceivedMap_[outModName]);
00154           fullEvent = true;          
00155           // Note only to increment total size on whole events to
00156           // get the correct average event size
00157           totalSizeReceived_ = totalSizeReceived_ + origdatasize;
00158           datCollection_.totalSizeReceivedMap_[outModName] += origdatasize;
00159         } 
00160         datCollection_.lastFrameNumMap_[outModName] = frameNum;
00161       } else { // first frame from new event
00162         // new event (assume run number does not change)
00163         lastEventID_ = eventNumber;
00164         datCollection_.lastEventIDMap_[outModName] = eventNumber;
00165         if(datCollection_.lastFrameNumMap_[outModName] != datCollection_.lastTotalFrameNumMap_[outModName] &&
00166            datCollection_.framesReceivedMap_[outModName] != 1) {
00167            // missing or frame out of order (may count multiply!)
00168            ++totalOutOfOrder_;
00169         }
00170         datCollection_.lastFrameNumMap_[outModName] = frameNum;
00171         datCollection_.lastTotalFrameNumMap_[outModName] = totalFrames;
00172       }
00173    } // totalFrames=1 or not
00174    if(problemFound) ++totalBadEvents_;
00175    return fullEvent;
00176 }


Member Data Documentation

toolbox::Chrono stor::SMFUSenderEntry::chrono_ [private]

Definition at line 72 of file SMFUSenderEntry.h.

Referenced by addReg2Entry(), getStopWTime(), SMFUSenderEntry(), and update4Data().

unsigned int stor::SMFUSenderEntry::connectStatus_ [private]

Definition at line 59 of file SMFUSenderEntry.h.

Referenced by getconnectStatus(), getDataStatus(), setDataStatus(), and SMFUSenderEntry().

SMFUSenderDatCollection stor::SMFUSenderEntry::datCollection_ [private]

Definition at line 64 of file SMFUSenderEntry.h.

Referenced by addReg2Entry(), getDatCollection(), geteventsReceived(), getframesReceived(), getlastFrameNum(), getlastTotalFrameNum(), gettotalSizeReceived(), SMFUSenderEntry(), and update4Data().

boost::mutex stor::SMFUSenderEntry::entry_lock_ [private]

Definition at line 73 of file SMFUSenderEntry.h.

Referenced by addFrame(), getStopWTime(), setDataStatus(), setisLocal(), setrunNumber(), and update4Data().

unsigned int stor::SMFUSenderEntry::eventsReceived_ [private]

Definition at line 66 of file SMFUSenderEntry.h.

Referenced by getAlleventsReceived(), SMFUSenderEntry(), and update4Data().

unsigned int stor::SMFUSenderEntry::framesReceived_ [private]

Definition at line 65 of file SMFUSenderEntry.h.

Referenced by addReg2Entry(), getAllframesReceived(), SMFUSenderEntry(), and update4Data().

char stor::SMFUSenderEntry::hltClassName_[MAX_I2O_SM_URLCHARS] [private]

Definition at line 53 of file SMFUSenderEntry.h.

Referenced by addReg2Entry(), getvhltClassName(), sameClassName(), and SMFUSenderEntry().

unsigned int stor::SMFUSenderEntry::hltInstance_ [private]

Definition at line 55 of file SMFUSenderEntry.h.

Referenced by addReg2Entry(), gethltInstance(), match(), matchFirst(), and SMFUSenderEntry().

unsigned int stor::SMFUSenderEntry::hltLocalId_ [private]

Definition at line 54 of file SMFUSenderEntry.h.

Referenced by gethltLocalId(), match(), and matchFirst().

unsigned int stor::SMFUSenderEntry::hltTid_ [private]

Definition at line 56 of file SMFUSenderEntry.h.

Referenced by addReg2Entry(), gethltTid(), match(), matchFirst(), and SMFUSenderEntry().

char stor::SMFUSenderEntry::hltURL_[MAX_I2O_SM_URLCHARS] [private]

Definition at line 52 of file SMFUSenderEntry.h.

Referenced by addReg2Entry(), getvhltURL(), sameURL(), and SMFUSenderEntry().

bool stor::SMFUSenderEntry::isLocal_ [private]

Definition at line 62 of file SMFUSenderEntry.h.

Referenced by getisLocal(), setisLocal(), and SMFUSenderEntry().

unsigned int stor::SMFUSenderEntry::lastEventID_ [private]

Definition at line 67 of file SMFUSenderEntry.h.

Referenced by getlastEventID(), SMFUSenderEntry(), and update4Data().

double stor::SMFUSenderEntry::lastLatency_ [private]

Definition at line 60 of file SMFUSenderEntry.h.

Referenced by addReg2Entry(), getlastLatency(), SMFUSenderEntry(), and update4Data().

unsigned int stor::SMFUSenderEntry::lastRunID_ [private]

Definition at line 68 of file SMFUSenderEntry.h.

Referenced by getlastRunID(), SMFUSenderEntry(), and update4Data().

const uint32 stor::SMFUSenderEntry::rbBufferID_ [private]

Definition at line 57 of file SMFUSenderEntry.h.

Referenced by getrbBufferID(), and match().

SMFUSenderRegCollection stor::SMFUSenderEntry::registryCollection_ [private]

Definition at line 58 of file SMFUSenderEntry.h.

Referenced by addFrame(), addReg2Entry(), getcurrFrames(), getnumOutMod(), getRegistryCollection(), getregistrySize(), gettotFrames(), regIsCopied(), sameOutMod(), SMFUSenderEntry(), and update4Data().

unsigned int stor::SMFUSenderEntry::runNumber_ [private]

Definition at line 61 of file SMFUSenderEntry.h.

Referenced by getrunNumber(), setrunNumber(), and SMFUSenderEntry().

unsigned int stor::SMFUSenderEntry::totalBadEvents_ [private]

Definition at line 71 of file SMFUSenderEntry.h.

Referenced by gettotalBadEvents(), SMFUSenderEntry(), and update4Data().

unsigned int stor::SMFUSenderEntry::totalOutOfOrder_ [private]

Definition at line 69 of file SMFUSenderEntry.h.

Referenced by gettotalOutOfOrder(), SMFUSenderEntry(), and update4Data().

unsigned long long stor::SMFUSenderEntry::totalSizeReceived_ [private]

Definition at line 70 of file SMFUSenderEntry.h.

Referenced by getAlltotalSizeReceived(), SMFUSenderEntry(), and update4Data().


The documentation for this struct was generated from the following files:
Generated on Tue Jun 9 18:52:53 2009 for CMSSW by  doxygen 1.5.4