29 #include "art_root_io/TFileService.h" 59 std::vector<recob::Hit>
const&,
63 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());
99 std::vector<recob::Hit>
const& hitVector,
102 WireHitAssocVector.resize(wireVector.size());
103 for (
size_t iwire = 0; iwire < wireVector.size(); iwire++) {
104 for (
size_t ihit = 0; ihit < hitVector.size(); ihit++) {
105 if (hitVector[ihit].Channel() == wireVector[iwire].Channel())
106 WireHitAssocVector[iwire].
push_back(ihit);
113 std::vector<sim::MCHitCollection>
const& mcHitVector,
114 std::vector<std::vector<int>>& WireMCHitAssocVector)
117 WireMCHitAssocVector.clear();
118 WireMCHitAssocVector.resize(wireVector.size());
123 std::map<unsigned int, std::vector<int>> mcHitIndicesByChannel;
124 for (
unsigned int icol = 0; icol < mcHitVector.size(); icol++)
125 mcHitIndicesByChannel[mcHitVector[icol].Channel()].push_back(icol);
127 for (
unsigned int iwire = 0; iwire < wireVector.size(); iwire++)
128 WireMCHitAssocVector[iwire].insert(WireMCHitAssocVector[iwire].
end(),
129 mcHitIndicesByChannel[wireVector[iwire].Channel()].begin(),
130 mcHitIndicesByChannel[wireVector[iwire].Channel()].end());
137 unsigned int eventNumber = e.
id().
event();
138 unsigned int runNumber = e.
run();
148 std::vector<std::vector<int>> WireMCHitAssocVector;
153 std::vector<art::Handle<std::vector<recob::Hit>>> hitHandles(nHitModules);
156 std::vector<std::vector<std::vector<int>>> WireHitAssocVectors(nHitModules);
157 for (
size_t iter = 0; iter < nHitModules; iter++) {
167 WireHitAssocVectors[iter].resize(wireVector.size());
184 wireVector, mcHitVector, WireMCHitAssocVector, clock_data, eventNumber, runNumber);
191 wireDataTree = tfs->make<TTree>(
"wireDataTree",
"WireDataTree");
204 TTree* intermediateTree = tfs->make<TTree>(firstArg.c_str(), secArg.c_str());
end
while True: pbar.update(maxval-len(onlies[E][S])) #print iS, "/", len(onlies[E][S]) found = False for...
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
std::string fMCHitModuleLabel
EDAnalyzer(fhicl::ParameterSet const &pset)
void SetWireDataTree(TTree *)
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
fInnerVessel push_back(Point(-578.400000, 0.000000, 0.000000))
#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.
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
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.
Declaration of signal hit object.
HitAnaModule(fhicl::ParameterSet const &p)
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