30 #include "art_root_io/TFileService.h" 60 std::vector<recob::Hit>
const&,
64 std::vector<sim::MCHitCollection>
const&,
93 for (HitWireAssns_t::assn_t
const& assn : HitToWire)
94 WireHitAssocVector.at(assn.second.key()).push_back(assn.first.key());
98 std::vector<recob::Hit>
const& hitVector,
101 WireHitAssocVector.resize(wireVector.size());
102 for (
size_t iwire = 0; iwire < wireVector.size(); iwire++) {
103 for (
size_t ihit = 0; ihit < hitVector.size(); ihit++) {
104 if (hitVector[ihit].Channel() == wireVector[iwire].Channel())
105 WireHitAssocVector[iwire].push_back(ihit);
111 std::vector<sim::MCHitCollection>
const& mcHitVector,
112 std::vector<std::vector<int>>& WireMCHitAssocVector)
115 WireMCHitAssocVector.clear();
116 WireMCHitAssocVector.resize(wireVector.size());
121 std::map<unsigned int, std::vector<int>> mcHitIndicesByChannel;
122 for (
unsigned int icol = 0; icol < mcHitVector.size(); icol++)
123 mcHitIndicesByChannel[mcHitVector[icol].Channel()].push_back(icol);
125 for (
unsigned int iwire = 0; iwire < wireVector.size(); iwire++)
126 WireMCHitAssocVector[iwire].insert(WireMCHitAssocVector[iwire].
end(),
127 mcHitIndicesByChannel[wireVector[iwire].Channel()].begin(),
128 mcHitIndicesByChannel[wireVector[iwire].Channel()].end());
134 unsigned int eventNumber = e.
id().
event();
135 unsigned int runNumber = e.
run();
145 std::vector<std::vector<int>> WireMCHitAssocVector;
150 std::vector<art::Handle<std::vector<recob::Hit>>> hitHandles(nHitModules);
153 std::vector<std::vector<std::vector<int>>> WireHitAssocVectors(nHitModules);
154 for (
size_t iter = 0; iter < nHitModules; iter++) {
164 WireHitAssocVectors[iter].resize(wireVector.size());
181 wireVector, mcHitVector, WireMCHitAssocVector, clock_data, eventNumber, runNumber);
187 wireDataTree = tfs->make<TTree>(
"wireDataTree",
"WireDataTree");
196 std::string firstArg(
"hitData_");
198 std::string secArg(
"HitDataTree_");
200 TTree* intermediateTree = tfs->make<TTree>(firstArg.c_str(), secArg.c_str());
void LoadHitAssocPair(std::vector< recob::Hit > const &, std::vector< std::vector< int >> const &, std::string const &)
void createMCAssocVector(std::vector< recob::Wire > const &, std::vector< sim::MCHitCollection > const &, std::vector< std::vector< int >> &)
void SetHitDataTree(std::vector< TTree * > &trees)
std::vector< std::string > fHitModuleLabels
std::string fWireModuleLabel
std::vector< TTree * > hitDataTree
Declaration of signal hit object.
std::string fMCHitModuleLabel
EDAnalyzer(fhicl::ParameterSet const &pset)
void SetWireDataTree(TTree *)
decltype(auto) constexpr end(T &&obj)
ADL-aware version of std::end.
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
#define DEFINE_ART_MODULE(klass)
T get(std::string const &key) const
details::FindAllP< recob::Hit, recob::Wire > HitToWire
Query object connecting a hit to a wire.
void AnalyzeWires(std::vector< recob::Wire > const &, std::vector< sim::MCHitCollection > const &, std::vector< std::vector< int >> const &, detinfo::DetectorClocksData const &, unsigned int, unsigned int)
Detector simulation of raw signals on wires.
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
HitAnaModule(fhicl::ParameterSet const &p)
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
void createAssocVector(HitWireAssns_t const &, std::vector< std::vector< int >> &)
EventNumber_t event() const
Declaration of basic channel signal object.
void analyze(art::Event const &e) override