35 TFile*
f = TFile::Open(inFilename.c_str(),
"UPDATE");
38 if (
f == 0 || !
f->IsOpen()) {
39 std::cerr <<
"--> HLTEgammaPostProcess: Input file not opened" << std::endl;
46 std::cerr <<
"--> HLTEgammaPostProcess: Input file " << inFilename <<
" cannot be opened. " << std::endl;
52 if (
f->GetSize() < 1000.) {
53 std::cerr <<
"--> HLTEgammaPostProcess: Input file empty" << std::endl;
60 TIter next_run(
f->GetListOfKeys());
64 while ((key_run =
dynamic_cast<TKey*
>(next_run())) != 0) {
65 TObject* obj_run = key_run->ReadObj();
66 TDirectory* tdir_run =
dynamic_cast<TDirectory*
>(obj_run);
75 std::string runDirName(tdir_run->GetName());
80 if (runDirName.find(
"run") == std::string::npos) {
86 TString egammamonDirName = runDirName +
"/HLT/EgammaSigTE";
87 TDirectory* egammamonDir(0);
88 if (!(egammamonDir =
f->GetDirectory(egammamonDirName))) {
89 std::cout <<
"--> HLTEgammaPostProcess: directory " << egammamonDirName <<
" not found." << std::endl;
95 TString offgammaDirName = egammamonDirName +
"/OfflinePhoton";
96 TString offeleDirName = egammamonDirName +
"/OfflineElectron";
97 TDirectory* offgammaDir(0);
98 TDirectory* offeleDir(0);
99 if (!(offgammaDir =
f->GetDirectory(offgammaDirName))) {
100 std::cout <<
"--> HLTEgammaPostProcess: offline directory " << offgammaDirName <<
" not found, will abort.\n";
104 if (!(offeleDir =
f->GetDirectory(offeleDirName))) {
105 std::cout <<
"--> HLTEgammaPostProcess: offline directory " << offeleDirName <<
" not found, will abort.\n";
133 std::vector<TString> phoStage;
134 phoStage.push_back(
"L1");
135 phoStage.push_back(
"L2Calo");
136 phoStage.push_back(
"EFCalo");
139 std::vector<TString> eleStage;
140 eleStage.push_back(
"L1");
141 eleStage.push_back(
"L2Calo");
142 eleStage.push_back(
"L2ID");
143 eleStage.push_back(
"EFCalo");
144 eleStage.push_back(
"EFID");
147 TIter next_trig(egammamonDir->GetListOfKeys());
149 while ((key_trig =
dynamic_cast<TKey*
>(next_trig())) != 0) {
151 bool photon_chain(
false);
152 bool electron_chain(
false);
153 TObject* obj_trig = key_trig->ReadObj();
154 TDirectory* dir_trig =
dynamic_cast<TDirectory*
>(obj_trig);
163 TString trigger_name = dir_trig->GetName();
166 if (trigger_name.Contains(
"Offline")) {
172 if (trigger_name.BeginsWith(
"g") || trigger_name.BeginsWith(
"2g")) photon_chain =
true;
173 else if (trigger_name.BeginsWith(
"e") || trigger_name.BeginsWith(
"2e")) electron_chain =
true;
175 std::cout <<
"--> HLTEgammaPostProcess: Non-electron/photon chain detected, will be skipped!\n";
196 if (electron_chain) {