ATLAS Offline Software
Functions
make_jetstream.h File Reference
#include "SimpleJetStream.h"
#include "CombinationsJetStream.h"
#include "JetStreamer.h"
#include <memory>
#include <vector>
Include dependency graph for make_jetstream.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

std::unique_ptr< IJetStreammake_jetstream (std::vector< std::vector< std::size_t >> indices, std::vector< std::size_t > repeats, std::size_t sid)
 

Function Documentation

◆ make_jetstream()

std::unique_ptr<IJetStream> make_jetstream ( std::vector< std::vector< std::size_t >>  indices,
std::vector< std::size_t >  repeats,
std::size_t  sid 
)

Definition at line 28 of file make_jetstream.h.

30  {
31  if (indices.size()==1) {
32  auto null_stream = std::unique_ptr<IJetStream>{nullptr};
33  auto base_case = std::unique_ptr<IJetStream>(nullptr);
34  auto repeat = repeats.at(0);
35  if (repeat == 1) {
36  base_case.reset(new SimpleJetStream(indices.at(0),
37  std::move(null_stream),
38  sid));
39  } else {
40  base_case.reset(new CombinationsJetStream(indices.at(0),
41  std::move(null_stream),
42  repeat,
43  sid));
44  }
45  return base_case;
46 
47  }
48 
49  auto inds = indices.back();
50  indices.pop_back();
51 
52  auto repeat = repeats.back();
53  repeats.pop_back();
54 
55  auto n_sid = sid;
56  auto right_stream = make_jetstream(indices, repeats, ++n_sid);
57  auto stream = std::unique_ptr<IJetStream>(nullptr);
58  if (repeat == 1) {
59  stream.reset(new SimpleJetStream(inds,
60  std::move(right_stream),
61  sid));
62  } else {
63  stream.reset(new CombinationsJetStream(inds,
64  std::move(right_stream),
65  repeat,
66  sid));
67  }
68 
69  return stream;
70 }
Trk::indices
std::pair< long int, long int > indices
Definition: AlSymMatBase.h:24
AthenaPoolTestWrite.stream
string stream
Definition: AthenaPoolTestWrite.py:12
CombinationsJetStream
Definition: CombinationsJetStream.h:35
SimpleJetStream
Definition: SimpleJetStream.h:26
make_jetstream
std::unique_ptr< IJetStream > make_jetstream(std::vector< std::vector< std::size_t >> indices, std::vector< std::size_t > repeats, std::size_t sid)
Definition: make_jetstream.h:28