140 std::unique_ptr< std::vector<sbn::crt::CRTHit> > CRTHitcol(
new std::vector<sbn::crt::CRTHit>);
141 std::unique_ptr< art::Assns<sbn::crt::CRTHit, sbnd::crt::CRTData> > Hitassn(
new art::Assns<sbn::crt::CRTHit, sbnd::crt::CRTData>);
142 art::PtrMaker<sbn::crt::CRTHit> makeHitPtr(event);
147 art::Handle< std::vector<sbnd::crt::CRTData>> crtListHandle;
148 std::vector<art::Ptr<sbnd::crt::CRTData> > crtList;
150 art::fill_ptr_vector(crtList, crtListHandle);
152 auto const clockData = art::ServiceHandle<detinfo::DetectorClocksService const>()->DataFor(event);
153 auto const detProp = art::ServiceHandle<detinfo::DetectorPropertiesService const>()->DataFor(event, clockData);
158 mf::LogInfo(
"CRTSimHitProducer")
159 <<
"Number of SiPM hits = "<<crtList.size();
161 std::vector<std::pair<sbn::crt::CRTHit, std::vector<int>>> crtHitPairs =
hitAlg.
CreateCRTHits(taggerStrips);
163 for(
auto const& crtHitPair : crtHitPairs){
164 CRTHitcol->push_back(crtHitPair.first);
165 art::Ptr<sbn::crt::CRTHit> hitPtr = makeHitPtr(CRTHitcol->size()-1);
167 for(
auto const& data_i : crtHitPair.second){
168 Hitassn->addSingle(hitPtr, crtList[data_i]);
173 event.put(std::move(CRTHitcol));
174 event.put(std::move(Hitassn));
176 mf::LogInfo(
"CRTSimHitProducer")
177 <<
"Number of CRT hits produced = "<<nHits;
std::map< std::pair< std::string, unsigned >, std::vector< CRTStrip > > CreateTaggerStrips(detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, std::vector< art::Ptr< sbnd::crt::CRTData >> data)
std::vector< std::pair< sbn::crt::CRTHit, std::vector< int > > > CreateCRTHits(std::map< std::pair< std::string, unsigned >, std::vector< CRTStrip >> taggerStrips)
art::InputTag fCrtModuleLabel
name of crt producer