42 fCurrentFileNumber(0u),
56 fEndOfFrames.
SetModeIO(ConfAgent::kWrite);
70 NarvalInterface::process_config(directory_path,error_code);
72 if ( (*error_code) == 0u ) {
85 ::fclose(fCurrentFile);
87 std::cout <<
" -BasicAFP: the input file has just been closed " << fCurrentFileName <<
std::endl;
91 std::string
tmp = fPath;
92 if ( tmp.size() > 0 && !(tmp.at(tmp.size()-1) ==
'/') )
95 std::ostringstream filename;
96 filename << tmp << fBaseForName
97 << std::setfill(
'0') << std::setw(4) << fCurrentFileNumber++ << std::setfill(
' ')
99 fCurrentFileName = filename.str();
101 fCurrentFile = ::fopen(fCurrentFileName.c_str(),
"wb");
102 if ( fCurrentFile != 0x0 ) {
103 Log <<
info <<
"A new output file has just been open "
104 << fCurrentFileName <<
nline;
106 fEndOfFrames.
SetFile(fCurrentFile,fMaxSize);
109 size_t len = fCurrentFileName.length();
110 size_t lpt = fCurrentFileName.find_last_of(
'/');
111 fCurrentName = fCurrentFileName.substr(lpt+1, len-lpt-1);
140 if (
GetFrameIO().GetCurrentBlockOUT()->IsEoB() ) {
145 if (
GetFrameIO().GetCurrentBlockIN()->IsEoB() )
153 std::cout << std::setw(2) << fMyID;
154 std::cout << std::left << std::setw(24) <<
"-BasicAFC:" << std::right
155 <<
" " << std::setw(5) << nevtsOut-nevtsIn
156 <<
" evts (" << std::setw(8) << in.
GetSize() <<
")"
157 <<
" Tot = " << std::setw(8) << nevtsOut
171 fVertex = AgataFrameTrigger::Build(
"GVertex",
"",
"meta:vertex");
176 std::string conffile =
GetConfPath() +
"BasicAFC.conf";
178 std::ifstream filein(conffile.data());
179 if ( filein.is_open() == true ) {
181 std::string pathforfiles, basename;
182 UInt_t starting_number;
183 filein >> pathforfiles >> basename >> starting_number;
185 if ( filein.good() ) {
186 fPath = pathforfiles;
187 fBaseForName = basename;
188 fCurrentFileNumber = starting_number;
207 ::fclose(fCurrentFile);
header file for BasicAFC.cpp
virtual Long64_t GetSize(UInt_t=0u) const
size of the current block
UInt_t GetPID() const
To get the ID number for that algorithm.
LogMessage & error(LogMessage &)
LogMessage & warning(LogMessage &)
LogMessage & nline(LogMessage &)
virtual void SetModeIO(ConfAgent::EMode mode)
virtual void process_reset(UInt_t *error_code)
Destructor implementation.
void SetModel(ConfAgent::EModel model)
virtual Bool_t Register(DFTrigger *)
To register a trigger.
LogMessage & info(LogMessage &)
manipulator to modify the LogMessage
virtual void process_initialise(UInt_t *error_code)
Constructor implementation.
const std::string & GetConfPath()
To get the algo path associated with the current actor.
virtual void SetPID(unsigned int pid)
To set the Process ID number.
virtual void Detach(FrameBlock *in, FrameBlock *out)
void SetStatus(EStatus stat)
virtual void SetProcessMethod(const char *)
To set the current method.
It defines the interface needed to be a consumer.
LogMessage & dolog(LogMessage &)
virtual void ClearMessage()
To clear the current message.
static void process_config(const Char_t *, UInt_t *)
to init globals (static) from a directory
virtual UInt_t ProcessBlock(ADF::FrameBlock &)
virtual method to be implemented
ADF::LogMessage & endl(ADF::LogMessage &log)
virtual void SetFile(FILE *file, Long64_t max_size=kMaxUInt_t)
header file for RunAgent.cpp
virtual void Print(std::ostream &out=std::cout) const
Print some informations (statistics)
UInt_t GetFramesWritten() const
virtual void Attach(FrameBlock *in, FrameBlock *out)
Attach a block to this. Rewind called if DoRewind set to true (Default)
virtual Bool_t RecordGlobalConfiguration(const std::string="NO")
write the current configuration in the output data
virtual std::string & GetProcessName()
To get the Process name.
LogMessage Log
to send messages to the log server
virtual void SetName(const char *name)
Bool_t NewFile()
open a new file