CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
evf::RecoEventOutputModuleForFU< Consumer > Class Template Reference

#include <RecoEventOutputModuleForFU.h>

Inheritance diagram for evf::RecoEventOutputModuleForFU< Consumer >:
edm::StreamerOutputModuleBase edm::one::OutputModule< one::WatchRuns, one::WatchLuminosityBlocks > edm::one::OutputModuleBase edm::EDConsumerBase

Public Member Functions

 RecoEventOutputModuleForFU (edm::ParameterSet const &ps)
 
virtual ~RecoEventOutputModuleForFU ()
 
- Public Member Functions inherited from edm::StreamerOutputModuleBase
 StreamerOutputModuleBase (ParameterSet const &ps)
 
virtual ~StreamerOutputModuleBase ()
 
- Public Member Functions inherited from edm::one::OutputModule< one::WatchRuns, one::WatchLuminosityBlocks >
 OutputModule (edm::ParameterSet const &iPSet)
 
- Public Member Functions inherited from edm::one::OutputModuleBase
BranchIDLists const * branchIDLists ()
 
std::array< bool, NumBranchTypes > const & hasNewlyDroppedBranch () const
 
SelectedProductsForBranchType const & keptProducts () const
 
int maxEvents () const
 
const ModuleDescriptionmoduleDescription () const
 
OutputModuleBaseoperator= (OutputModuleBase const &)=delete
 
 OutputModuleBase (ParameterSet const &pset)
 
 OutputModuleBase (OutputModuleBase const &)=delete
 
std::string const & processName () const
 
int remainingEvents () const
 
bool selected (BranchDescription const &desc) const
 
void selectProducts (ProductRegistry const &preg, ThinnedAssociationsHelper const &)
 
SubProcessParentageHelper const * subProcessParentageHelper () const
 
ThinnedAssociationsHelper const * thinnedAssociationsHelper () const
 
bool wantAllEvents () const
 
virtual ~OutputModuleBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::StreamerOutputModuleBase
static void fillDescription (ParameterSetDescription &desc)
 
- Static Public Member Functions inherited from edm::one::OutputModuleBase
static const std::string & baseType ()
 
static void fillDescription (ParameterSetDescription &desc)
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 

Private Member Functions

virtual void beginJob () override
 
virtual void beginLuminosityBlock (edm::LuminosityBlockForOutput const &) override
 
virtual void doOutputEvent (EventMsgBuilder const &msg) override
 
virtual void doOutputHeader (InitMsgBuilder const &init_message) override
 
virtual void endLuminosityBlock (edm::LuminosityBlockForOutput const &) override
 
void initRun ()
 
virtual void start () override
 
virtual void stop () override
 

Private Attributes

jsoncollector::IntJ accepted_
 
std::auto_ptr< Consumer > c_
 
jsoncollector::IntJ errorEvents_
 
jsoncollector::IntJ fileAdler32_
 
jsoncollector::StringJ filelist_
 
jsoncollector::IntJ filesize_
 
evf::FastMonitoringServicefms_
 
jsoncollector::IntJ hltErrorEvents_
 
jsoncollector::StringJ inputFiles_
 
boost::shared_ptr< jsoncollector::FastMonitorjsonMonitor_
 
jsoncollector::StringJ mergeType_
 
boost::filesystem::path openDatChecksumFilePath_
 
boost::filesystem::path openDatFilePath_
 
unsigned char * outBuf_ = 0
 
jsoncollector::DataPointDefinition outJsonDef_
 
jsoncollector::IntJ processed_
 
bool readAdler32Check_ =false
 
jsoncollector::IntJ retCodeMask_
 
std::string stream_label_
 
jsoncollector::StringJ transferDestination_
 

Additional Inherited Members

- Public Types inherited from edm::one::OutputModuleBase
typedef OutputModuleBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::one::OutputModuleBase
void configure (OutputModuleDescription const &desc)
 
ModuleDescription const & description () const
 
void doBeginJob ()
 
bool doBeginLuminosityBlock (LuminosityBlockPrincipal const &lbp, EventSetup const &c, ModuleCallingContext const *)
 
bool doBeginRun (RunPrincipal const &rp, EventSetup const &c, ModuleCallingContext const *)
 
void doEndJob ()
 
bool doEndLuminosityBlock (LuminosityBlockPrincipal const &lbp, EventSetup const &c, ModuleCallingContext const *)
 
bool doEndRun (RunPrincipal const &rp, EventSetup const &c, ModuleCallingContext const *)
 
bool doEvent (EventPrincipal const &ep, EventSetup const &c, ActivityRegistry *, ModuleCallingContext const *)
 
void doPreallocate (PreallocationConfiguration const &)
 
std::map< BranchID::value_type, BranchID::value_type > const & droppedBranchIDToKeptBranchID ()
 
ParameterSetID selectorConfig () const
 
void setEventSelectionInfo (std::map< std::string, std::vector< std::pair< std::string, int > > > const &outputModulePathPositions, bool anyProductProduced)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

template<typename Consumer>
class evf::RecoEventOutputModuleForFU< Consumer >

Definition at line 24 of file RecoEventOutputModuleForFU.h.

Constructor & Destructor Documentation

template<typename Consumer >
evf::RecoEventOutputModuleForFU< Consumer >::RecoEventOutputModuleForFU ( edm::ParameterSet const &  ps)
explicit

Consumers are supposed to provide void doOutputHeader(InitMsgBuilder const& init_message) void doOutputEvent(EventMsgBuilder const& msg) void start() void stop() static void fillDescription(ParameterSetDescription&)

Definition at line 76 of file RecoEventOutputModuleForFU.h.

References Exception, evf::RecoEventOutputModuleForFU< Consumer >::fms_, evf::RecoEventOutputModuleForFU< Consumer >::stream_label_, and AlCaHLTBitMon_QueryRunRegistry::string.

76  :
79  c_(new Consumer(ps)),
80  stream_label_(ps.getParameter<std::string>("@module_label")),
81  processed_(0),
82  accepted_(0),
83  errorEvents_(0),
84  retCodeMask_(0),
85  filelist_(),
86  filesize_(0),
87  inputFiles_(),
88  fileAdler32_(1),
90  mergeType_(),
91  hltErrorEvents_(0),
92  outBuf_(new unsigned char[1024*1024])
93  {
94  //replace hltOutoputA with stream if the HLT menu uses this convention
95  std::string testPrefix="hltOutput";
96  if (stream_label_.find(testPrefix)==0)
97  stream_label_=std::string("stream")+stream_label_.substr(testPrefix.size());
98 
99  if (stream_label_.find("_")!=std::string::npos) {
100  throw cms::Exception("RecoEventOutputModuleForFU")
101  << "Underscore character is reserved can not be used for stream names in FFF, but was detected in stream name -: " << stream_label_;
102  }
103 
104  std::string stream_label_lo = stream_label_;
105  boost::algorithm::to_lower(stream_label_lo);
106  auto streampos = stream_label_lo.rfind("stream");
107  if (streampos !=0 && streampos!=std::string::npos)
108  throw cms::Exception("RecoEventOutputModuleForFU")
109  << "stream (case-insensitive) sequence was found in stream suffix. This is reserved and can not be used for names in FFF based HLT, but was detected in stream name";
110 
112  }
OutputModuleBase(ParameterSet const &pset)
template<typename Consumer >
evf::RecoEventOutputModuleForFU< Consumer >::~RecoEventOutputModuleForFU ( )
virtual

Definition at line 182 of file RecoEventOutputModuleForFU.h.

182 {}

Member Function Documentation

template<typename Consumer >
void evf::RecoEventOutputModuleForFU< Consumer >::beginJob ( void  )
overrideprivatevirtual
template<typename Consumer >
void evf::RecoEventOutputModuleForFU< Consumer >::beginLuminosityBlock ( edm::LuminosityBlockForOutput const &  ls)
overrideprivatevirtual

Definition at line 267 of file RecoEventOutputModuleForFU.h.

References evf::RecoEventOutputModuleForFU< Consumer >::c_, evf::RecoEventOutputModuleForFU< Consumer >::filelist_, edm::LuminosityBlockForOutput::luminosityBlock(), evf::RecoEventOutputModuleForFU< Consumer >::openDatChecksumFilePath_, evf::RecoEventOutputModuleForFU< Consumer >::openDatFilePath_, and evf::RecoEventOutputModuleForFU< Consumer >::stream_label_.

268  {
269  //edm::LogInfo("RecoEventOutputModuleForFU") << "begin lumi";
270  openDatFilePath_ = edm::Service<evf::EvFDaqDirector>()->getOpenDatFilePath(ls.luminosityBlock(),stream_label_);
271  openDatChecksumFilePath_ = edm::Service<evf::EvFDaqDirector>()->getOpenDatFilePath(ls.luminosityBlock(),stream_label_);
272  c_->setOutputFile(openDatFilePath_.string());
273  filelist_ = openDatFilePath_.filename().string();
274  }
boost::filesystem::path openDatChecksumFilePath_
def ls(path, rec=False)
Definition: eostools.py:348
template<typename Consumer >
void evf::RecoEventOutputModuleForFU< Consumer >::doOutputEvent ( EventMsgBuilder const &  msg)
overrideprivatevirtual

Implements edm::StreamerOutputModuleBase.

Definition at line 243 of file RecoEventOutputModuleForFU.h.

References evf::RecoEventOutputModuleForFU< Consumer >::accepted_, evf::RecoEventOutputModuleForFU< Consumer >::c_, and jsoncollector::IntJ::value().

243  {
244  accepted_.value()++;
245  c_->doOutputEvent(msg); // You can't use msg in RecoEventOutputModuleForFU after this point
246  }
template<typename Consumer >
void evf::RecoEventOutputModuleForFU< Consumer >::doOutputHeader ( InitMsgBuilder const &  init_message)
overrideprivatevirtual

Implements edm::StreamerOutputModuleBase.

Definition at line 206 of file RecoEventOutputModuleForFU.h.

References cms::Adler32(), evf::RecoEventOutputModuleForFU< Consumer >::c_, Exception, evf::RecoEventOutputModuleForFU< Consumer >::outBuf_, TrackRefitter_38T_cff::src, trackingPlots::stat, evf::RecoEventOutputModuleForFU< Consumer >::stream_label_, and AlCaHLTBitMon_QueryRunRegistry::string.

207  {
208  c_->doOutputHeader(init_message);
209 
210  const std::string openIniFileName = edm::Service<evf::EvFDaqDirector>()->getOpenInitFilePath(stream_label_);
211  struct stat istat;
212  stat(openIniFileName.c_str(), &istat);
213  //read back file to check integrity of what was written
214  off_t readInput=0;
215  uint32_t adlera=1,adlerb=0;
216  FILE *src = fopen(openIniFileName.c_str(),"r");
217  while (readInput<istat.st_size)
218  {
219  size_t toRead= readInput+1024*1024 < istat.st_size ? 1024*1024 : istat.st_size-readInput;
220  fread(outBuf_,toRead,1,src);
221  cms::Adler32((const char*)outBuf_,toRead,adlera,adlerb);
222  readInput+=toRead;
223  }
224  fclose(src);
225  //free output buffer if micromerge is not done by the module
226  if (edm::Service<evf::EvFDaqDirector>()->microMergeDisabled()) {
227  delete [] outBuf_;
228  outBuf_=nullptr;
229  }
230  uint32_t adler32c = (adlerb << 16) | adlera;
231  if (adler32c != c_->get_adler32_ini()) {
232  throw cms::Exception("RecoEventOutputModuleForFU") << "Checksum mismatch of ini file -: " << openIniFileName
233  << " expected:" << c_->get_adler32_ini() << " obtained:" << adler32c;
234  }
235  else {
236  edm::LogWarning("RecoEventOutputModuleForFU") << "Ini file checksum -: "<< stream_label_ << " " << adler32c;
237  boost::filesystem::rename(openIniFileName,edm::Service<evf::EvFDaqDirector>()->getInitFilePath(stream_label_));
238  }
239  }
void Adler32(char const *data, size_t len, uint32_t &a, uint32_t &b)
template<typename Consumer >
void evf::RecoEventOutputModuleForFU< Consumer >::endLuminosityBlock ( edm::LuminosityBlockForOutput const &  ls)
overrideprivatevirtual

Definition at line 277 of file RecoEventOutputModuleForFU.h.

References evf::RecoEventOutputModuleForFU< Consumer >::accepted_, cms::Adler32(), evf::RecoEventOutputModuleForFU< Consumer >::c_, Exception, evf::RecoEventOutputModuleForFU< Consumer >::fileAdler32_, evf::RecoEventOutputModuleForFU< Consumer >::filelist_, evf::RecoEventOutputModuleForFU< Consumer >::filesize_, evf::RecoEventOutputModuleForFU< Consumer >::fms_, evf::FastMonitoringService::getEventsProcessedForLumi(), evf::RecoEventOutputModuleForFU< Consumer >::jsonMonitor_, edm::LuminosityBlockForOutput::luminosityBlock(), NULL, evf::RecoEventOutputModuleForFU< Consumer >::openDatFilePath_, evf::RecoEventOutputModuleForFU< Consumer >::outBuf_, evf::RecoEventOutputModuleForFU< Consumer >::processed_, evf::RecoEventOutputModuleForFU< Consumer >::readAdler32Check_, TrackRefitter_38T_cff::src, trackingPlots::stat, evf::RecoEventOutputModuleForFU< Consumer >::stream_label_, AlCaHLTBitMon_QueryRunRegistry::string, and jsoncollector::IntJ::value().

278  {
279  //edm::LogInfo("RecoEventOutputModuleForFU") << "end lumi";
280  long filesize=0;
281  fileAdler32_.value() = c_->get_adler32();
282  c_->closeOutputFile();
283  bool abortFlag = false;
284  processed_.value() = fms_->getEventsProcessedForLumi(ls.luminosityBlock(),&abortFlag);
285 
286  if (abortFlag) {
287  edm::LogInfo("RecoEventOutputModuleForFU") << "output suppressed";
288  return;
289  }
290 
291  if(processed_.value()!=0) {
292 
293  //lock
294  struct stat istat;
295  if (!edm::Service<evf::EvFDaqDirector>()->microMergeDisabled()) {
296  FILE *des = edm::Service<evf::EvFDaqDirector>()->maybeCreateAndLockFileHeadForStream(ls.luminosityBlock(),stream_label_);
297 
298  std::string deschecksum = edm::Service<evf::EvFDaqDirector>()->getMergedDatChecksumFilePath(ls.luminosityBlock(), stream_label_);
299 
300  struct stat istat;
301  FILE * cf = NULL;
302  uint32_t mergedAdler32=1;
303  //get adler32 accumulated checksum for the merged file
304  if (!stat(deschecksum.c_str(), &istat)) {
305  if (istat.st_size) {
306  cf = fopen(deschecksum.c_str(),"r");
307  if (!cf) throw cms::Exception("RecoEventOutputModuleForFU") << "Unable to open checksum file -: " << deschecksum.c_str();
308  fscanf(cf,"%u",&mergedAdler32);
309  fclose(cf);
310  }
311  else edm::LogWarning("RecoEventOutputModuleForFU") << "Checksum file size is empty -: "<< deschecksum.c_str();
312  }
313 
314  FILE *src = fopen(openDatFilePath_.string().c_str(),"r");
315 
316  stat(openDatFilePath_.string().c_str(), &istat);
317  off_t readInput=0;
318  uint32_t adlera=1;
319  uint32_t adlerb=0;
320  while (readInput<istat.st_size) {
321  size_t toRead= readInput+1024*1024 < istat.st_size ? 1024*1024 : istat.st_size-readInput;
322  fread(outBuf_,toRead,1,src);
323  fwrite(outBuf_,toRead,1,des);
324  if (readAdler32Check_)
325  cms::Adler32((const char*)outBuf_,toRead,adlera,adlerb);
326  readInput+=toRead;
327  filesize+=toRead;
328  }
329 
330  //write new string representation of the checksum value
331  cf = fopen(deschecksum.c_str(),"w");
332  if (!cf) throw cms::Exception("RecoEventOutputModuleForFU") << "Unable to open or rewind checksum file for writing -:" << deschecksum.c_str();
333 
334  //write adler32 combine to checksum file
335  mergedAdler32 = adler32_combine(mergedAdler32,fileAdler32_.value(),filesize);
336 
337  fprintf(cf,"%u",mergedAdler32);
338  fclose(cf);
339 
340  edm::Service<evf::EvFDaqDirector>()->unlockAndCloseMergeStream();
341  fclose(src);
342 
343  if (readAdler32Check_ && ((adlerb << 16) | adlera) != fileAdler32_.value()) {
344 
345  throw cms::Exception("RecoEventOutputModuleForFU") << "Adler32 checksum mismatch after reading file -: "
346  << openDatFilePath_.string() <<" in LS " << ls.luminosityBlock() << std::endl;
347  }
348  }
349  else { //no micromerge by HLT
350  stat(openDatFilePath_.string().c_str(), &istat);
351  filesize = istat.st_size;
352  boost::filesystem::rename(openDatFilePath_.string().c_str(), edm::Service<evf::EvFDaqDirector>()->getDatFilePath(ls.luminosityBlock(),stream_label_));
353  }
354  } else {
355  //return if not in empty lumisection mode
356  if (!edm::Service<evf::EvFDaqDirector>()->emptyLumisectionMode()) {
357  remove(openDatFilePath_.string().c_str());
358  return;
359  }
360  filelist_ = "";
361  fileAdler32_.value()=-1;
362  }
363 
364  //remove file
365  remove(openDatFilePath_.string().c_str());
366  filesize_=filesize;
367 
368  jsonMonitor_->snap(ls.luminosityBlock());
369  const std::string outputJsonNameStream =
370  edm::Service<evf::EvFDaqDirector>()->getOutputJsonFilePath(ls.luminosityBlock(),stream_label_);
371  jsonMonitor_->outputFullJSON(outputJsonNameStream,ls.luminosityBlock());
372 
373  // reset monitoring params
374  accepted_.value() = 0;
375  filelist_ = "";
376  }
unsigned int getEventsProcessedForLumi(unsigned int lumi, bool *abortFlag=0)
boost::shared_ptr< jsoncollector::FastMonitor > jsonMonitor_
#define NULL
Definition: scimark2.h:8
void Adler32(char const *data, size_t len, uint32_t &a, uint32_t &b)
def ls(path, rec=False)
Definition: eostools.py:348
template<typename Consumer >
void evf::RecoEventOutputModuleForFU< Consumer >::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 250 of file RecoEventOutputModuleForFU.h.

References edm::ConfigurationDescriptions::add(), and edm::StreamerOutputModuleBase::fillDescription().

250  {
253  Consumer::fillDescription(desc);
254  descriptions.add("EvFOutputModule", desc);
255  }
static void fillDescription(ParameterSetDescription &desc)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
template<typename Consumer >
void evf::RecoEventOutputModuleForFU< Consumer >::initRun ( void  )
private

Definition at line 115 of file RecoEventOutputModuleForFU.h.

References evf::RecoEventOutputModuleForFU< Consumer >::accepted_, jsoncollector::DataPointDefinition::addLegendItem(), jsoncollector::DataPointDefinition::ADLER32, jsoncollector::DataPointDefinition::BINARYOR, jsoncollector::DataPointDefinition::CAT, ws_sso_content_reader::content, evf::RecoEventOutputModuleForFU< Consumer >::errorEvents_, evf::RecoEventOutputModuleForFU< Consumer >::fileAdler32_, evf::RecoEventOutputModuleForFU< Consumer >::filelist_, evf::RecoEventOutputModuleForFU< Consumer >::filesize_, evf::RecoEventOutputModuleForFU< Consumer >::hltErrorEvents_, evf::RecoEventOutputModuleForFU< Consumer >::inputFiles_, evf::RecoEventOutputModuleForFU< Consumer >::jsonMonitor_, LogDebug, jsoncollector::DataPointDefinition::MERGE, evf::RecoEventOutputModuleForFU< Consumer >::mergeType_, evf::RecoEventOutputModuleForFU< Consumer >::outJsonDef_, evf::RecoEventOutputModuleForFU< Consumer >::processed_, evf::RecoEventOutputModuleForFU< Consumer >::readAdler32Check_, evf::RecoEventOutputModuleForFU< Consumer >::retCodeMask_, jsoncollector::DataPointDefinition::SAME, jsoncollector::JSONSerializer::serialize(), jsoncollector::DataPointDefinition::setDefaultGroup(), jsoncollector::JsonMonitorable::setName(), AlCaHLTBitMon_QueryRunRegistry::string, jsoncollector::DataPointDefinition::SUM, evf::RecoEventOutputModuleForFU< Consumer >::transferDestination_, and jsoncollector::FileIO::writeStringToFile().

Referenced by evf::RecoEventOutputModuleForFU< Consumer >::start().

116  {
117  std::string baseRunDir = edm::Service<evf::EvFDaqDirector>()->baseRunDir();
118  readAdler32Check_ = edm::Service<evf::EvFDaqDirector>()->outputAdler32Recheck();
119  LogDebug("RecoEventOutputModuleForFU") << "writing .dat files to -: " << baseRunDir;
120  // create open dir if not already there
121  edm::Service<evf::EvFDaqDirector>()->createRunOpendirMaybe();
122 
123  processed_.setName("Processed");
124  accepted_.setName("Accepted");
125  errorEvents_.setName("ErrorEvents");
126  retCodeMask_.setName("ReturnCodeMask");
127  filelist_.setName("Filelist");
128  filesize_.setName("Filesize");
129  inputFiles_.setName("InputFiles");
130  fileAdler32_.setName("FileAdler32");
131  transferDestination_.setName("TransferDestination");
132  mergeType_.setName("MergeType");
133  hltErrorEvents_.setName("HLTErrorEvents");
134 
147  std::stringstream tmpss,ss;
148  tmpss << baseRunDir << "/open/" << "output_" << getpid() << ".jsd";
149  ss << baseRunDir << "/" << "output_" << getpid() << ".jsd";
150  std::string outTmpJsonDefName = tmpss.str();
151  std::string outJsonDefName = ss.str();
152 
153  edm::Service<evf::EvFDaqDirector>()->lockInitLock();
154  struct stat fstat;
155  if (stat (outJsonDefName.c_str(), &fstat) != 0) { //file does not exist
156  LogDebug("RecoEventOutputModuleForFU") << "writing output definition file -: " << outJsonDefName;
159  jsoncollector::FileIO::writeStringToFile(outTmpJsonDefName, content);
160  boost::filesystem::rename(outTmpJsonDefName,outJsonDefName);
161  }
162  edm::Service<evf::EvFDaqDirector>()->unlockInitLock();
163 
165  jsonMonitor_->setDefPath(outJsonDefName);
166  jsonMonitor_->registerGlobalMonitorable(&processed_,false);
167  jsonMonitor_->registerGlobalMonitorable(&accepted_,false);
168  jsonMonitor_->registerGlobalMonitorable(&errorEvents_,false);
169  jsonMonitor_->registerGlobalMonitorable(&retCodeMask_,false);
170  jsonMonitor_->registerGlobalMonitorable(&filelist_,false);
171  jsonMonitor_->registerGlobalMonitorable(&filesize_,false);
172  jsonMonitor_->registerGlobalMonitorable(&inputFiles_,false);
173  jsonMonitor_->registerGlobalMonitorable(&fileAdler32_,false);
174  jsonMonitor_->registerGlobalMonitorable(&transferDestination_,false);
175  jsonMonitor_->registerGlobalMonitorable(&mergeType_,false);
176  jsonMonitor_->registerGlobalMonitorable(&hltErrorEvents_,false);
177  jsonMonitor_->commit(nullptr);
178 
179  }
#define LogDebug(id)
void addLegendItem(std::string const &name, std::string const &type, std::string const &operation)
boost::shared_ptr< jsoncollector::FastMonitor > jsonMonitor_
static bool serialize(JsonSerializable *pObj, std::string &output)
virtual void setName(std::string name)
static void writeStringToFile(std::string const &filename, std::string &content)
Definition: FileIO.cc:21
jsoncollector::DataPointDefinition outJsonDef_
void setDefaultGroup(std::string const &group)
template<typename Consumer >
void evf::RecoEventOutputModuleForFU< Consumer >::start ( void  )
overrideprivatevirtual

Implements edm::StreamerOutputModuleBase.

Definition at line 186 of file RecoEventOutputModuleForFU.h.

References evf::RecoEventOutputModuleForFU< Consumer >::c_, evf::RecoEventOutputModuleForFU< Consumer >::initRun(), evf::RecoEventOutputModuleForFU< Consumer >::stream_label_, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by progressbar.ProgressBar::__next__(), Types.LuminosityBlockRange::cppID(), and Types.EventRange::cppID().

187  {
188  initRun();
189  const std::string openInitFileName = edm::Service<evf::EvFDaqDirector>()->getOpenInitFilePath(stream_label_);
190  edm::LogInfo("RecoEventOutputModuleForFU") << "start() method, initializing streams. init stream -: "
191  << openInitFileName;
192  c_->setInitMessageFile(openInitFileName);
193  c_->start();
194 
195  }
template<typename Consumer >
void evf::RecoEventOutputModuleForFU< Consumer >::stop ( )
overrideprivatevirtual

Implements edm::StreamerOutputModuleBase.

Definition at line 199 of file RecoEventOutputModuleForFU.h.

References evf::RecoEventOutputModuleForFU< Consumer >::c_.

200  {
201  c_->stop();
202  }

Member Data Documentation

template<typename Consumer >
jsoncollector::IntJ evf::RecoEventOutputModuleForFU< Consumer >::accepted_
mutableprivate
template<typename Consumer >
std::auto_ptr<Consumer> evf::RecoEventOutputModuleForFU< Consumer >::c_
private
template<typename Consumer >
jsoncollector::IntJ evf::RecoEventOutputModuleForFU< Consumer >::errorEvents_
private
template<typename Consumer >
jsoncollector::IntJ evf::RecoEventOutputModuleForFU< Consumer >::fileAdler32_
private
template<typename Consumer >
jsoncollector::StringJ evf::RecoEventOutputModuleForFU< Consumer >::filelist_
private
template<typename Consumer >
jsoncollector::IntJ evf::RecoEventOutputModuleForFU< Consumer >::filesize_
private
template<typename Consumer >
evf::FastMonitoringService* evf::RecoEventOutputModuleForFU< Consumer >::fms_
private
template<typename Consumer >
jsoncollector::IntJ evf::RecoEventOutputModuleForFU< Consumer >::hltErrorEvents_
private
template<typename Consumer >
jsoncollector::StringJ evf::RecoEventOutputModuleForFU< Consumer >::inputFiles_
private
template<typename Consumer >
boost::shared_ptr<jsoncollector::FastMonitor> evf::RecoEventOutputModuleForFU< Consumer >::jsonMonitor_
private
template<typename Consumer >
jsoncollector::StringJ evf::RecoEventOutputModuleForFU< Consumer >::mergeType_
private
template<typename Consumer >
boost::filesystem::path evf::RecoEventOutputModuleForFU< Consumer >::openDatChecksumFilePath_
private
template<typename Consumer >
boost::filesystem::path evf::RecoEventOutputModuleForFU< Consumer >::openDatFilePath_
private
template<typename Consumer >
unsigned char* evf::RecoEventOutputModuleForFU< Consumer >::outBuf_ = 0
private
template<typename Consumer >
jsoncollector::DataPointDefinition evf::RecoEventOutputModuleForFU< Consumer >::outJsonDef_
private
template<typename Consumer >
jsoncollector::IntJ evf::RecoEventOutputModuleForFU< Consumer >::processed_
private
template<typename Consumer >
bool evf::RecoEventOutputModuleForFU< Consumer >::readAdler32Check_ =false
private
template<typename Consumer >
jsoncollector::IntJ evf::RecoEventOutputModuleForFU< Consumer >::retCodeMask_
private
template<typename Consumer >
std::string evf::RecoEventOutputModuleForFU< Consumer >::stream_label_
private
template<typename Consumer >
jsoncollector::StringJ evf::RecoEventOutputModuleForFU< Consumer >::transferDestination_
private