Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-09 07:49:23

0001 #include "NP.hh"
0002 #include "SBnd.h"
0003 #include "stree.h"
0004 
0005 int main(int argc, char** argv)
0006 {
0007     const char* specs_ = R"(
0008 Red///Green
0009 Green///Blue
0010 Blue///Cyan
0011 Cyan///Magenta
0012 Magenta///Yellow
0013 )"; 
0014 
0015     std::vector<std::string> specs ; 
0016     SBnd::GetSpecsFromString(specs, specs_ ); 
0017 
0018     NP* bnd = NP::MakeFlat<float>( specs.size(), 4, 2, 761, 4 ); 
0019     bnd->set_names(specs); 
0020 
0021     stree st ; 
0022 
0023     st.add_material("Red",   0u) ; 
0024     st.add_material("Green", 1u) ; 
0025     st.add_material("Blue",  2u) ; 
0026     st.add_material("Cyan",  3u) ; 
0027     st.add_material("Magenta", 4u) ; 
0028     st.add_material("Yellow", 5u) ; 
0029 
0030     SBnd sbn(bnd); 
0031     sbn.fillMaterialLine( &st ); 
0032     std::cout << st.desc_mt() << std::endl ; 
0033 
0034     st.init_mtindex_to_mtline(); 
0035 
0036 
0037 
0038     for(unsigned i=0 ; i < st.mtindex.size() ; i++)
0039     {
0040         int mtindex = st.mtindex[i] ;
0041         //int mtline = st.mtindex_to_mtline.at(mtindex) ;
0042         int mtline = st.lookup_mtline(mtindex); 
0043 
0044         std::cout 
0045             << " mtindex " << std::setw(3) << mtindex 
0046             << " mtline " << std::setw(3) << mtline 
0047             << std::endl
0048             ; 
0049     }    
0050     for(unsigned i=0 ; i < 10 ; i++)
0051     {
0052         int mtindex = i ;
0053         int mtline = st.lookup_mtline(i); 
0054         std::cout 
0055             << " mtindex " << std::setw(3) << mtindex 
0056             << " mtline " << std::setw(3) << mtline 
0057             << std::endl
0058             ; 
0059     }
0060 
0061     std::cout << sbn.desc() << std::endl ; 
0062 
0063     return 0 ; 
0064 }