Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2024-09-27 07:03:26

0001 // SPDX-License-Identifier: LGPL-3.0-or-later
0002 // Copyright (C) 2023 Christopher Dilks
0003 
0004 #include "HistosDAG.h"
0005 
0006 ClassImp(HistosDAG)
0007 
0008 // build the DAG from specified bin scheme
0009 void HistosDAG::Build(std::map<TString,BinSet*> binSchemes) {
0010 
0011   // build the DAG, given the bin scheme
0012   // - require `"finalState"` bin to be the first layer
0013   BuildDAG(binSchemes,{"finalState"});
0014 
0015   // leaf operator, to create Histos objects
0016   LeafOp([this](NodePath *P){
0017     TString histosN = CreatePayloadName(P);
0018     TString histosT = CreatePayloadTitle("",P);
0019     if(debug) {
0020       std::cout << "At path " << P->PathString() << ": ";
0021       std::cout << "Create " << histosN << std::endl;
0022     };
0023     // instantiate Histos object
0024     Histos *H = new Histos(histosN,histosT);
0025     // add CutDefs to Histos object
0026     for(Node *N : P->GetBinNodes()) { H->AddCutDef(N->GetCut()); };
0027     // append to `histosMap`
0028     InsertPayloadData(P,H);
0029   });
0030 
0031   // execution
0032   if(debug) std::cout << "Begin Histos instantiation..." << std::endl;
0033   ExecuteAndClearOps();
0034 };