31 : max_to_filt(0), maxflist(0), maxftype(0)
38 : max_to_filt(0), maxflist(0), maxftype(0)
64 Int_t status = evOpen((
char*)fname, (
char*)readwrite, &
handle);
65 fIsGood = (status == S_SUCCESS);
78 fIsGood = (status == S_SUCCESS);
89 cout <<
"codaRead ERROR: tried to access a file with handle = 0" << endl;
90 cout <<
"You need to call codaOpen(filename)" << endl;
91 cout <<
"or use the constructor with (filename) arg" << endl;
95 Int_t status = S_SUCCESS;
99 if( status == S_EVFILE_TRUNC ) {
109 }
while( status == S_EVFILE_TRUNC );
111 if( status == S_SUCCESS )
114 fIsGood = (status == S_SUCCESS || status == EOF );
124 cout <<
"codaWrite ERROR: tried to access file with handle = 0" << endl;
128 fIsGood = (status == S_SUCCESS);
155 cout <<
"filterToFile: ERROR: ";
156 cout <<
"Input and output files cannot be same " << endl;
157 cout <<
"This is to protect you against overwriting data" << endl;
163 cout <<
"filterToFile: ERROR: ";
164 cout <<
"Output file `" << output_file <<
"' exists " << endl;
165 cout <<
"You must remove it by hand first. " << endl;
166 cout <<
"This forces you to think and not overwrite data." << endl;
171 unique_ptr<THaCodaFile> fout{
new THaCodaFile(output_file,
"w")};
172 if( !fout->isGood()) {
181 UInt_t evtype = rawbuff[1] >> 16;
182 UInt_t evnum = rawbuff[4];
184 cout <<
"Input evtype " << dec << evtype;
185 cout <<
" evnum " << evnum << endl;
187 cout <<
"evtype size = " <<
evtypes.size() << endl;
188 cout <<
"evlist size = " <<
evlist.size() << endl;
211 cout <<
"Filtering event, nfilt " << dec << nfilt << endl;
216 cout <<
"Error in filterToFile ! " << endl;
217 cout <<
"codaWrite returned status " << fout_status << endl;
231 fout_status = fout->codaClose();
233 return fIsGood ? fout_status : status;
243 evtypes.push_back(evtype_to_filt);
250 if(
evlist.capacity() < 1024 )
253 evlist.push_back(event_to_filt);
Option_t Option_t TPoint TPoint const char mode
R__EXTERN TSystem * gSystem
Bool_t grow(UInt_t newsize=0)
void staterr(const char *tried_to, Int_t status) const
UInt_t getBuffSize() const
static Int_t ReturnCode(Int_t evio_retcode)
void addEvTypeFilt(UInt_t evtype_to_filt)
virtual bool isOpen() const
virtual Int_t codaOpen(const char *filename, Int_t mode=1)
std::vector< UInt_t > evtypes
void init(const char *fname="")
void setMaxEvFilt(UInt_t max_event)
Int_t filterToFile(const char *output_file)
virtual Int_t codaClose()
std::vector< UInt_t > evlist
Int_t codaWrite(const UInt_t *evbuffer)
void addEvListFilt(UInt_t event_to_filt)
virtual Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
bool operator()(T val) const