11 #include <TEntryList.h>
12 #include <TFriendElement.h>
17 using namespace Diana;
29 fDeleteInput = GetBool(
"DeleteInputFiles",
false,
false);
30 fRWCommon->fDeleteInputFiles = fDeleteInput;
31 fInclusive = GetBool(
"InclusiveMode",
true,
false);
32 fRWCommon->fInclusiveMode = fInclusive;
41 std::string cut = GetString(
"Cut",
"",
false);
43 Warn(
"The \"Cut\" option is not orthodox. Users must give to Marco Vignati"
44 " developer 0.89 Euro for each use");
45 fChain->Draw(
">>anakaEventList", cut.c_str(),
"entrylist");
46 fEntryList = (TEntryList*) gDirectory->Get(
"anakaEventList");
47 Long64_t nsel = fEntryList->GetN();
49 Error(
"The Cut selected zero entries");
52 fEvents = fEntryList->GetN();
53 fChain->SetEntryList(fEntryList);
54 Info(
"The Cut selected %lu entries",fEvents);
67 Error(
"Zero entries!");
72 TList* falias = fChain->GetListOfAllAliases();
74 Debug(
"Found no alias in the first file");
77 Debug(
"Found %d aliases in the first file",falias->GetSize());
78 while(TObject *obj = next()) {
79 const char* name = obj->GetName();
80 const char* path = obj->GetTitle();
81 Debug(
"Alias %s defined in file as %s",name,path);
91 if(fEntryListEntry >= fEvents)
return false;
93 fEventNumber = fEntryList->GetEntryAndTree(fEntryListEntry,treenum);
94 fEventNumber += fChain->GetTreeOffset()[treenum];
97 if(fEventNumber >= fEvents)
100 fChain->GetEntry(fEventNumber);
102 if(fChain->GetFile()->GetFileCounter() != fFileCounter) {
103 fRootInput = fChain->GetFile();
104 fFileCounter = fChain->GetFile()->GetFileCounter();
111 fChain->GetEntry(fEventNumber);
113 std::string fileName = fChain->GetFile()->GetName();
114 fRWCommon->fReaderTreeEvents[fileName] = fChain->GetTree()->GetEntries();
115 OpenNewFile(fileName);
116 Info(
"Current file is %s", fileName.c_str());
127 std::vector<std::string>::iterator iter;
128 for(iter = fFileList.begin(); iter!= fFileList.end(); iter++) {
129 Info(
"Removing %s",iter->c_str());
130 remove(iter->c_str());
133 remove(fFileListPath.c_str());
134 Info(
"Removing %s", fFileListPath.c_str());
143 snprintf(buf,128,
"Cut option is not compatible with JumpToEvent");
144 fErr.SetDescription(buf);
#define REGISTER_MODULE(clazz)
Reader for diana and apollo root files.
virtual void Init(Diana::QEventAssembler &eva)
Init method is called before event loop.
virtual bool Do(Diana::QEventAssembler &eva)
Do method is called for each event.
const QError & JumpToEvent(Long64_t event)
Jump to particular event in the loop.
virtual void Done()
Done method is called after event loop.
void Add(const QEventLabel &label, const std::string &path, const std::string &alias)
error class with error type and description
Visitor class of QEvent that provides full handling of QEvent.
const QAliases & GetAliases() const
get aliases (const version)
virtual const QError & JumpToEvent(Long64_t event)
Jump to a particular event in the chain.
the Diana namespace is needed because sometimes we use Qt libraries, that use same class names of our...