72 std::unique_ptr<std::vector<sbnd::crt::FEBData> > FEBDataOut(
new std::vector<sbnd::crt::FEBData>);
73 art::PtrMaker<sbnd::crt::FEBData> makeDataPtr(
e);
75 std::unique_ptr<std::vector<sim::AuxDetIDE> > auxDetIdes(
new std::vector<sim::AuxDetIDE>);
76 art::PtrMaker<sim::AuxDetIDE> makeIdePtr(
e);
78 std::unique_ptr<art::Assns<sbnd::crt::FEBData, sim::AuxDetIDE, sbnd::crt::FEBTruthInfo>> Dataassn
79 (
new art::Assns<sbnd::crt::FEBData, sim::AuxDetIDE, sbnd::crt::FEBTruthInfo>);
82 art::Handle<std::vector<sim::AuxDetSimChannel> > channels;
85 if (!channels.isValid()) {
86 mf::LogWarning(
"CRTDetSim") <<
"No AuxDetSimChannel..." << std::endl;
95 for(
auto const& adsc : *channels) {
97 if(adsc.AuxDetID() == UINT_MAX || adsc.AuxDetSensitiveID() == UINT_MAX) {
98 mf::LogWarning(
"CRTDetSim") <<
"AuxDetSimChannel with ID: UINT_MAX\n"
99 <<
"skipping channel...";
103 if(adsc.AuxDetIDEs().size() > 0) {
104 mf::LogDebug(
"CRTDetSim") <<
"Adding AuxDetSimChannel with AuxDetID " << adsc.AuxDetID()
105 <<
", AuxDetSensitiveID " << adsc.AuxDetSensitiveID() << std::endl;
117 std::vector<std::pair<sbnd::crt::FEBData, std::vector<sim::AuxDetIDE>>> data =
fDetAlg.
GetData();
125 for (
size_t i = 0; i < data.size(); i++) {
127 auto & dataPair = data[i];
128 auto & feb = dataPair.first;
129 auto & ides = dataPair.second;
130 auto & idxs = auxdata.at(i);
132 FEBDataOut->push_back(feb);
133 art::Ptr<FEBData> dataPtr = makeDataPtr(FEBDataOut->size()-1);
135 for(
size_t j = 0; j < ides.size(); j++){
136 auto const& ide = ides[j];
137 auxDetIdes->push_back(ide);
138 FEBTruthInfo
const feb_truth_info {idxs[j]};
139 mf::LogDebug(
"CRTDetSim") <<
"Adding " << idxs[j] <<
" to FEBTruthInfo." << std::endl;
140 art::Ptr<sim::AuxDetIDE> idePtr = makeIdePtr(auxDetIdes->size()-1);
141 Dataassn->addSingle(dataPtr, idePtr, feb_truth_info);
145 mf::LogInfo(
"CRTDetSim") <<
"Number of FEBData objects produced: " << FEBDataOut->size() <<
"\n";
147 e.put(std::move(FEBDataOut));
148 e.put(std::move(auxDetIdes));
149 e.put(std::move(Dataassn));
std::vector< std::pair< sbnd::crt::FEBData, std::vector< AuxDetIDE > > > GetData()
void FillTaggers(const uint32_t adid, const uint32_t adsid, std::vector< AuxDetIDE > ides)
std::string fG4ModuleLabel
std::vector< std::vector< int > > GetAuxData()
CRTDetSimAlg fDetAlg
Instance of the CRT detector simulation algorithm.