57 incSvc->removeListener(
this, IncidentType::BeginInputFile );
58 incSvc->addListener(
this, IncidentType::BeginInputFile, 0,
true );
59 incSvc->removeListener(
this, IncidentType::EndInputFile );
60 incSvc->addListener(
this, IncidentType::EndInputFile, 0,
true );
61 incSvc->removeListener(
this,
"MetaDataStop" );
62 incSvc->addListener(
this,
"MetaDataStop", 0,
true );
69 return StatusCode::SUCCESS;
153 SmartIF<IProperty> evtSelector{service(evtSelName,
false)};
155 ATH_MSG_ERROR(
"currentFile(): Couldn't find the service: " << evtSelName);
return 0;
160 const StringArrayProperty& inputCollectionsName =
dynamic_cast<const StringArrayProperty&
>(evtSelector->getProperty(
"InputCollections"));
162 ATH_MSG_VERBOSE(
"nOpenFile=" << gROOT->GetListOfFiles()->GetSize() <<
". nFilesInInputCollection=" << inputCollectionsName.value().size());
163 if(
msgLvl(MSG::VERBOSE)) {
164 for(
int i=0;i<gROOT->GetListOfFiles()->GetSize();i++) {
165 ATH_MSG_VERBOSE(
"Open file: " << gROOT->GetListOfFiles()->At(i)->GetName());
171 for(
int i=0;i<gROOT->GetListOfFiles()->GetSize();i++) {
172 TFile *g = (TFile*)gROOT->GetListOfFiles()->At(i);
175 TString s(g->GetName());
176 TObjArray* tokens = s.Tokenize(
"/");
177 TObjString* lastToken =
static_cast<TObjString*
>(tokens->Last());
178 TString sToCompare(
"");
179 bool shortComparison(
false);
180 if(tokens->GetEntries()>1) {
181 TString beforeSlash((
static_cast<TObjString*
>(tokens->At(tokens->GetEntries()-2)))->GetString());
182 if(beforeSlash.Length()>0) sToCompare += beforeSlash;
185 shortComparison=
true;
187 sToCompare += lastToken->GetString();
188 TString sToCompare_short(lastToken->GetString());
191 for(
unsigned int j=0;j<inputCollectionsName.value().size();j++) {
192 TString t(inputCollectionsName.value()[j].c_str());
195 ATH_MSG_VERBOSE(
"Current File is: " << inputCollectionsName.value()[j]);
199 TObjArray* tokens = t.Tokenize(
"/");
200 TObjString* lastToken =
dynamic_cast<TObjString*
>(tokens->Last());
205 TString tToCompare =
"";
206 bool shortComparison2(
false);
207 if(tokens->GetEntries()>1) {
208 TObjString* beforeSlashStr =
dynamic_cast<TObjString*
>(tokens->At(tokens->GetEntries()-2));
209 if (!beforeSlashStr) {
213 TString beforeSlash(beforeSlashStr->GetString());
214 if(beforeSlash.Length()>0) tToCompare += beforeSlash;
217 shortComparison2=
true;
219 tToCompare += lastToken->GetString();
220 TString tToCompare_short(lastToken->GetString());
223 if(shortComparison || shortComparison2) {
224 if(sToCompare_short.EqualTo(tToCompare_short)) {
225 ATH_MSG_VERBOSE(
"Current File is: " << inputCollectionsName.value()[j]);
230 if(sToCompare.EqualTo(tToCompare)) {
231 ATH_MSG_VERBOSE(
"Current File is: " << inputCollectionsName.value()[j]);
239 ATH_MSG_ERROR(
"currentFile(): Couldn't load InputCollections property of " << evtSelName);
return 0;
242 ATH_MSG_ERROR(
"currentFile(): Could not find the current file!");