Changeset 19808


Ignore:
Timestamp:
10/27/19 16:43:15 (5 years ago)
Author:
tbretz
Message:
Here, we can simply enable all branches for which an address was set.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/root2sql.cc

    r19804 r19808  
    412412    while ((o=Next()))
    413413    {
    414         TLeaf *L = T->GetLeaf(o->GetName());
     414        TLeaf *L = dynamic_cast<TLeaf*>(o);//c.GetLeaf(o->GetName());
     415        if (!L)
     416            continue;
    415417
    416418        if (verbose>2)
     
    495497    UInt_t datatype = 0;
    496498    const bool has_datatype = T->SetBranchAddress("DataType.fVal", &datatype) >= 0;
    497 
    498     // Setiing up branch status (must be after all SetBranchAddress)
     499    if (has_datatype && verbose>0)
     500        cout << "Rows with DataType.fVal!=1 will be skipped." << endl;
     501
     502    // -------------------------------------------------------------------------
     503    // Setting up branch status (must be after all SetBranchAddress)
    499504    T->SetBranchStatus("*", 0);
    500     for (auto c=vec.cbegin(); c!=vec.cend(); c++)
    501         if (c->type!=FileEntry::kConst)
    502             T->SetBranchStatus(c->branch.c_str(), 1);
    503 
    504     if (has_datatype)
    505     {
    506         T->SetBranchStatus("DataType.fVal", 1);
    507         if (verbose>0)
    508             cout << "Rows with DataType.fVal!=1 will be skipped." << endl;
    509     }
    510 
     505
     506    Next.Reset();
     507    while ((o=Next()))
     508    {
     509        const TLeaf *L = dynamic_cast<TLeaf*>(o);//c.GetLeaf(o->GetName());
     510        if (!L)
     511            continue;
     512
     513        const TBranch *B = L->GetBranch();
     514        if (!B)
     515            continue;
     516
     517        if (!B->GetAddress())
     518            continue;
     519
     520        c.SetBranchStatus(B->GetName(), 1);
     521        if (verbose>2)
     522            cout << "Enable Branch: " << B->GetName() << endl;
     523    }
    511524
    512525    // -------------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.