Not able to read files within a directory while using TProof

Dear experts,
I am quite new to the feature of TProof (in fact started to try my hands at it today only). So when I run few files by explicit addition of them in chain, the code works.
TProof *plite = TProof::Open("");
TChain *fChain = new TChain(“HGCalTBAnalyzer/HGCTB”);

However when I try to read all the files from a directory changing this code as pointed out below, it give me an error :
Error in TDSet::Process: not a correctly initialized TDSet

And unfortunately I am not able to understand where this is coming from. Can anyone please help?

Thanks a lot and Best regards

TProof *plite = TProof::Open("");
TChain *fChain = new TChain(“HGCalTBAnalyzer/HGCTB”);

TString location = “root://”;
TString path = “/eos/cms//store/group/upgrade/HGCAL/simulation/2017/JulyTBv1/mc/CRAB_PrivateMC/crab_Ele100GeV/170820_214312/0000/”;

TSystemDirectory sourceDir(“hi”,path);
TList* fileList = sourceDir.GetListOfFiles();
TIter next(fileList);
TSystemFile* filename;
int fileNumber = 0;
int maxFiles = -1;
while ((filename = (TSystemFile*)next()) && fileNumber > maxFiles){
if(fileNumber > 1)
TString FullPathInputFile = (location+path+filename->GetName());
fChain->Add(FullPathInputFile); } }


Dear sandhya,

With your code snippet, fileNumber is always 0 and therefore the chain empty.
Can you check that?

G Ganis

Ah, that’s a stupid mistake. Thanks a lot for this. It works fine now. :slight_smile:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.