177 if (
evt.isRealData()) {
178 throw cet::exception(
"HitFinderAna: ") <<
"Not for use on Data yet...\n";
181 art::Handle<std::vector<recob::Hit>> hitHandle;
184 art::ServiceHandle<cheat::BackTrackerService const> bt_serv;
185 art::ServiceHandle<cheat::ParticleInventoryService const> pi_serv;
186 auto const clockData = art::ServiceHandle<detinfo::DetectorClocksService const>()->DataFor(
evt);
188 sim::ParticleList
const& _particleList = pi_serv->ParticleList();
190 MF_LOG_VERBATIM(
"HitFinderAna") << _particleList;
192 art::ServiceHandle<geo::Geometry const> geom;
194 std::map<geo::PlaneID, std::vector<art::Ptr<recob::Hit>>> planeIDToHits;
195 for (
size_t h = 0;
h < hitHandle->size(); ++
h)
196 planeIDToHits[hitHandle->at(
h).WireID().planeID()].push_back(
197 art::Ptr<recob::Hit>(hitHandle,
h));
199 for (
auto mapitr : planeIDToHits) {
208 auto itr = mapitr.second.begin();
209 while (itr != mapitr.second.end()) {
214 std::vector<sim::TrackIDE> trackides = bt_serv->HitToTrackIDEs(clockData, *itr);
215 std::vector<sim::TrackIDE>::iterator idesitr = trackides.begin();
216 std::vector<double> xyz = bt_serv->HitToXYZ(clockData, *itr);
223 for (
unsigned int kk = 0; kk < 3; ++kk) {
227 while (idesitr != trackides.end()) {
229 if (_particleList.find((*idesitr).trackID) != _particleList.end()) {
230 const simb::MCParticle* particle = _particleList.at((*idesitr).trackID);
240 else if (pid.
Plane == 1 &&
fNp1 < 9000) {
245 for (
unsigned int kk = 0; kk < 3; ++kk) {
249 while (idesitr != trackides.end()) {
251 if (_particleList.find((*idesitr).trackID) != _particleList.end()) {
252 const simb::MCParticle* particle = _particleList.at((*idesitr).trackID);
261 else if (pid.
Plane == 2 &&
fNp2 < 9000) {
266 for (
unsigned int kk = 0; kk < 3; ++kk) {
270 while (idesitr != trackides.end()) {
272 if (_particleList.find((*idesitr).trackID) != _particleList.end()) {
273 const simb::MCParticle* particle = _particleList.at((*idesitr).trackID);
The data type to uniquely identify a Plane.
std::string fFFTHitFinderModuleLabel
PlaneID_t Plane
Index of the plane within its TPC.