Passing input file to a header file

Hey Experts!
I have a technical question, can we pass an input file to a header file?
PtCorr_mix.h (4.3 KB)
In the attached file I’m passing file.list as the input file, can I pass that as an input variable to the header file?


Try with:

    PtCorr_mix(TTree *tree = 0, const char *ifname = "file.list");

and then:

PtCorr_mix::PtCorr_mix(TTree *tree, const char *ifname) {
  if (tree == 0) {
    TChain *chain = new TChain("Spectra"," ");

    if (!(ifname && ifname[0])) { // just a precaution
      Printf(" Give the input file");
    ifstream is(ifname);
    // ...
1 Like

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