66 std::vector<recob::Hit>
const&,
70 std::vector<sim::MCHitCollection>
const&,
99 std::vector< std::vector<int> > & WireHitAssocVector
105 for (HitWireAssns_t::assn_t
const& assn: HitToWire)
106 WireHitAssocVector.at(assn.second.key()).push_back(assn.first.key());
111 std::vector<recob::Hit>
const& hitVector,
112 std::vector< std::vector<int> > & WireHitAssocVector)
114 WireHitAssocVector.resize(wireVector.size());
115 for(
size_t iwire=0; iwire<wireVector.size(); iwire++){
116 for(
size_t ihit=0; ihit<hitVector.size(); ihit++){
117 if(hitVector[ihit].Channel()==wireVector[iwire].Channel())
118 WireHitAssocVector[iwire].push_back(ihit);
124 std::vector<sim::MCHitCollection>
const& mcHitVector,
125 std::vector< std::vector<int> > & WireMCHitAssocVector){
127 WireMCHitAssocVector.clear(); WireMCHitAssocVector.resize(wireVector.size());
132 std::map<unsigned int,std::vector<int> > mcHitIndicesByChannel;
133 for(
unsigned int icol=0; icol<mcHitVector.size(); icol++)
134 mcHitIndicesByChannel[mcHitVector[icol].Channel()].push_back(icol);
137 for(
unsigned int iwire=0; iwire<wireVector.size(); iwire++)
138 WireMCHitAssocVector[iwire].insert(WireMCHitAssocVector[iwire].
end(),
139 mcHitIndicesByChannel[wireVector[iwire].Channel()].begin(),
140 mcHitIndicesByChannel[wireVector[iwire].Channel()].end());
147 unsigned int eventNumber = e.
id().
event();
148 unsigned int runNumber = e.
run();
158 std::vector<recob::Wire>
const& wireVector(*wireHandle);
163 std::vector<sim::MCHitCollection>
const& mcHitVector(*mcHitHandle);
166 std::vector< std::vector<int> > WireMCHitAssocVector;
171 std::vector< art::Handle< std::vector<recob::Hit> > > hitHandles(nHitModules);
174 std::vector< std::vector< std::vector<int> > > WireHitAssocVectors(nHitModules);
175 for(
size_t iter=0; iter < nHitModules; iter++){
185 WireHitAssocVectors[iter].resize(wireVector.size());
194 WireHitAssocVectors[iter],
216 std::string firstArg(
"hitData_");
218 std::string secArg(
"HitDataTree_");
220 TTree* intermediateTree = tfs->
make<TTree>(firstArg.c_str(),secArg.c_str());
void SetHitDataTree(std::vector< TTree * > &trees)
std::vector< std::string > fHitModuleLabels
std::string fWireModuleLabel
Declaration of signal hit object.
std::string fMCHitModuleLabel
void reconfigure(fhicl::ParameterSet const &p)
void LoadHitAssocPair(std::vector< recob::Hit > const &, std::vector< std::vector< int > > const &, std::string const &)
void SetWireDataTree(TTree *)
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
void createAssocVector(HitWireAssns_t const &, std::vector< std::vector< int > > &)
#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.
EDAnalyzer(Table< Config > const &config)
Detector simulation of raw signals on wires.
Conversion of times between different formats and references.
void createMCAssocVector(std::vector< recob::Wire > const &, std::vector< sim::MCHitCollection > const &, std::vector< std::vector< int > > &)
T * make(ARGS...args) const
HitAnaModule(fhicl::ParameterSet const &p)
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
EventNumber_t event() const
Declaration of basic channel signal object.
std::vector< evd::details::RawDigitInfo_t >::const_iterator end(RawDigitCacheDataClass const &cache)
void analyze(art::Event const &e) override
void AnalyzeWires(std::vector< recob::Wire > const &, std::vector< sim::MCHitCollection > const &, std::vector< std::vector< int > > const &, const detinfo::DetectorClocks *, unsigned int, unsigned int)
std::vector< TTree * > hitDataTree