3 #include "fhiclcpp/ParameterSet.h"
4 #include "art/Utilities/ToolMacros.h"
5 #include "art/Framework/Services/Registry/ServiceHandle.h"
6 #include "art_root_io/TFileService.h"
7 #include "art/Framework/Core/ModuleMacros.h"
8 #include "art_root_io/TFileDirectory.h"
9 #include "messagefacility/MessageLogger/MessageLogger.h"
11 #include "canvas/Persistency/Common/FindManyP.h"
25 #include "nusimdata/SimulationBase/MCParticle.h"
30 #include <Eigen/Dense>
35 #include "TProfile2D.h"
62 using HitPtrVec = std::vector<art::Ptr<recob::Hit>>;
79 tree->Branch(
"SPQuality",
"std::vector<float>", &
fSPQualityVec);
83 tree->Branch(
"LargestPH",
"std::vector<float>", &
fLargestPHVec);
84 tree->Branch(
"AveragePH",
"std::vector<float>", &
fAveragePHVec);
98 tree->Branch(
"MaxElectronDep0",
"std::vector<float>", &
fBigElecDep0Vec);
99 tree->Branch(
"MaxElectronDep1",
"std::vector<float>", &
fBigElecDep1Vec);
100 tree->Branch(
"MaxElectronDep2",
"std::vector<float>", &
fBigElecDep2Vec);
193 tree->Branch(
"NDF",
"std::vector<int>", &
fNDFHitVec);
200 tree->Branch(
"PulseHeight",
"std::vector<float>", &
fPHHitVec);
201 tree->Branch(
"RMS",
"std::vector<float>", &
fRMSHitVec);
202 tree->Branch(
"PHFraction",
"std::vector<float>", &
fPHFractionVec);
204 tree->Branch(
"PulseHeightOrder",
"std::vector<int>", &
fPHOrderHitVec);
243 int ticksSimChanMost,
245 float totNumElectrons,
247 float bestNumElectrons,
327 void configure(fhicl::ParameterSet
const & pset)
override;
335 void initializeHists(art::ServiceHandle<art::TFileService>&,
const std::string&)
override;
349 void endJob(
int numEvents)
override;
381 using TDCIDEPair = std::pair<unsigned short, const sim::IDE*>;
387 using ChargeDeposit = std::tuple<TDCIDEPair,TDCIDEPair,TDCIDEPair,float,float>;
444 fGeometry = lar::providerFrom<geo::Geometry>();
449 mf::LogInfo(
"SpacePointAnalysisMC") <<
"SpacePointAnalysisMC configured\n";
454 SpacePointAnalysisMC::~SpacePointAnalysisMC()
464 void SpacePointAnalysisMC::configure(fhicl::ParameterSet
const & pset)
466 fRecobHitLabelVec = pset.get< std::vector<art::InputTag>>(
"HitLabelVec", std::vector<art::InputTag>() = {
"cluster3d"});
467 fSpacePointLabelVec = pset.get< std::vector<art::InputTag>>(
"SpacePointLabelVec", std::vector<art::InputTag>() = {
"cluster3d"});
471 fOffsetVec = pset.get<std::vector<int> >(
"OffsetVec", std::vector<int>()={0,0,0});
472 fSimChannelMinEnergy = pset.get<
float >(
"SimChannelMinEnergy", std::numeric_limits<float>::epsilon());
473 fSimEnergyMinEnergy = pset.get<
float >(
"SimEnergyMinEnergy", std::numeric_limits<float>::epsilon());
480 void SpacePointAnalysisMC::initializeHists(art::ServiceHandle<art::TFileService>&
tfs,
const std::string& dirName)
488 void SpacePointAnalysisMC::initializeTuple(TTree* tree)
492 art::ServiceHandle<art::TFileService>
tfs;
496 fTree->Branch(
"CryostataVec",
"std::vector<int>", &
fCryoVec);
501 TTree* locTree = tfs->makeAndRegister<TTree>(
"SpacePoint_t",
"SpacePoint Tuple");
520 void SpacePointAnalysisMC::clear()
const
533 void SpacePointAnalysisMC::fillHistograms(
const art::Event& event)
const
540 art::Handle<std::vector<sim::SimChannel>> simChannelHandle;
543 if (!simChannelHandle.isValid() || simChannelHandle->empty() )
return;
545 art::Handle<std::vector<sim::SimEnergyDeposit>> simEnergyHandle;
550 art::Handle<std::vector<simb::MCParticle>> mcParticleHandle;
554 if (!mcParticleHandle.isValid())
return;
556 mf::LogDebug(
"SpacePointAnalysisMC") <<
"+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" << std::endl;
570 for(
const auto& simChannel : *simChannelHandle)
576 for(
const auto& tdcide : simChannel.TDCIDEMap())
578 for(
const auto& ide : tdcide.second)
584 ideToVoxelIDMap[&ide] = voxelID;
585 voxelIDToIDEMap[voxelID].insert(&ide);
586 chanToTDCToIDEMap[simChannel.Channel()][tdcide.first].insert(&ide);
587 simChannelVoxelIDSet.insert(voxelID);
589 trackIDChanToTDCIDEMap[ide.trackID][simChannel.Channel()].emplace_back(tdcide.first,&ide);
591 voxelIDToPlaneTDCIDEMap[voxelID][wireID.
Plane][tdcide.first].insert(&ide);
593 if (ide.energy < std::numeric_limits<float>::epsilon()) mf::LogDebug(
"SpacePointAnalysisMC") <<
">> epsilon simchan deposited energy: " << ide.energy << std::endl;
602 float bestTotDepEne(0.);
615 ChanToTDCIDEMap& chanToTDCIDEMap = trackIDChanToTDCIDEMap[bestTrackID];
618 TrackToChanChargeMap::const_iterator chanToChargeMapItr = trackToChanChargeMap.find(bestTrackID);
621 compareHitsToSim(event, chanToTDCToIDEMap, chanToChargeMapItr->second, chanToTDCIDEMap, ideToVoxelIDMap, recobHitToVoxelIDMap);
624 auto const clockData = art::ServiceHandle<detinfo::DetectorClocksService const>()->DataFor(event);
637 float& bestTotDepEne,
638 int& bestTrackID)
const
641 for(
const auto& trackIDEPair : trackIDChanToTDCIDEMap)
643 ChanToChargeMap& chanToChargeMap = trackToChanChargeMap[trackIDEPair.first];
645 float trackTotDepE(0.);
647 for(
const auto& chanTDCIDEPair : trackIDEPair.second)
652 TDCIDEPair firstPair = chanTDCIDEPair.second.front();
654 TDCIDEPair lastPair = chanTDCIDEPair.second.back();
660 float snippetDepEne(0.);
661 float snippetNumElectrons(0.);
663 for(
const auto& tdcIDEPair : chanTDCIDEPair.second)
665 float depEne = tdcIDEPair.second->energy;
667 trackTotDepE += depEne;
670 if (tdcIDEPair.first - prevPair.first > 1)
672 chargeDepositVec.emplace_back(firstPair,peakPair,prevPair,snippetDepEne,snippetNumElectrons);
674 firstPair = tdcIDEPair;
675 peakPair = firstPair;
677 snippetNumElectrons = 0.;
680 snippetDepEne += depEne;
681 snippetNumElectrons += tdcIDEPair.second->numElectrons;
683 if (depEne > peakPair.second->energy) peakPair = tdcIDEPair;
685 prevPair = tdcIDEPair;
688 chargeDepositVec.emplace_back(firstPair,peakPair,lastPair,snippetDepEne,snippetNumElectrons);
691 if (trackTotDepE > bestTotDepEne)
693 bestTrackID = trackIDEPair.first;
694 bestTotDepEne = trackTotDepE;
701 void SpacePointAnalysisMC::compareHitsToSim(
const art::Event& event,
710 using ChanToHitVecMap = std::map<raw::ChannelID_t,HitPointerVec>;
712 ChanToHitVecMap chanToHitVecMap;
715 for(
const auto& hitLabel : fRecobHitLabelVec)
717 art::Handle< std::vector<recob::Hit> > hitHandle;
718 event.getByLabel(hitLabel, hitHandle);
721 if ((*hitHandle).empty())
continue;
723 for(
const auto&
hit : *hitHandle) chanToHitVecMap[
hit.Channel()].emplace_back(&
hit);
727 for(
auto& chanToHitPair : chanToHitVecMap)
731 std::sort(hitPtrVec.begin(),
736 auto const clockData = art::ServiceHandle<detinfo::DetectorClocksService const>()->DataFor(event);
739 for(
const auto& chanToChargePair : chanToChargeMap)
745 ChanToHitVecMap::const_iterator chanToHitVecItr = chanToHitVecMap.find(channel);
748 if (chanToHitVecItr == chanToHitVecMap.end())
continue;
756 short int lastSnippetStart(-1);
761 for(
const auto& hitPtr : hitPtrVec)
768 short int snippetStart = hitPtr->StartTick();
770 if (snippetStart == lastSnippetStart)
772 lastSnippetStart = snippetStart;
774 hitVec.emplace_back(hitPtr);
780 matchHitSim(clockData, hitVec, chanToTDCToIDEMap, chargeDepositVec, chanToTDCIDEMap, ideToVoxelIDMap, recobHitToVoxelIDMap);
783 hitVec.emplace_back(hitPtr);
784 lastSnippetStart = snippetStart;
788 if (!hitVec.empty()) matchHitSim(clockData, hitVec, chanToTDCToIDEMap, chargeDepositVec, chanToTDCIDEMap, ideToVoxelIDMap, recobHitToVoxelIDMap);
803 using HitPeakTimeChargeTuple = std::tuple<int,const recob::Hit*,ChargeDepositVec::const_iterator>;
804 using HitPeakTimeChargeVec = std::vector<HitPeakTimeChargeTuple>;
806 HitPeakTimeChargeVec hitPeakTimeChargeVec;
807 float maxPulseHeight(1.);
810 for(
const auto&
hit : hitPointerVec)
813 int peakTick = std::round(
hit->PeakTime());
814 int startTick = std::max( 0,
int(std::floor(
hit->PeakTime() - 3. *
hit->RMS())));
815 int endTick = std::min(4096,
int(std::ceil(
hit->PeakTime() + 3. *
hit->RMS())));
817 int startTDC = clockData.TPCTick2TDC(startTick - fOffsetVec[
hit->WireID().Plane]);
818 int peakTDC = clockData.TPCTick2TDC(peakTick - fOffsetVec[
hit->WireID().Plane]);
819 int endTDC = clockData.TPCTick2TDC(endTick - fOffsetVec[
hit->WireID().Plane]);
821 maxPulseHeight = std::max(maxPulseHeight,
hit->PeakAmplitude());
824 ChargeDepositVec::const_iterator chargeMatchItr = chargeDepositVec.end();
826 int bestPeakDiff = std::numeric_limits<int>::max();
829 for(ChargeDepositVec::const_iterator chargeInfoItr = chargeDepositVec.begin(); chargeInfoItr != chargeDepositVec.end(); chargeInfoItr++)
832 if (endTDC > std::get<0>(*chargeInfoItr).first && startTDC < std::get<2>(*chargeInfoItr).first)
834 const TDCIDEPair& peakTDCIDE = std::get<1>(*chargeInfoItr);
836 int peakDiff = peakTDC - int(peakTDCIDE.first);
840 bestPeakDiff = peakDiff;
841 chargeMatchItr = chargeInfoItr;
847 if (chargeMatchItr == chargeDepositVec.end())
continue;
849 hitPeakTimeChargeVec.emplace_back(std::make_tuple(bestPeakDiff,
hit,chargeMatchItr));
852 if (!hitPeakTimeChargeVec.empty())
855 std::sort(hitPeakTimeChargeVec.begin(),hitPeakTimeChargeVec.end(),[](
const auto&
left,
const auto&
right){
return std::abs(std::get<0>(
left)) <
std::abs(std::get<0>(
right));});
863 for(
const auto& hitPeakCharge : hitPeakTimeChargeVec)
866 const ChargeDeposit& chargeDeposit = *std::get<2>(hitPeakCharge);
869 int peakTick = std::round(hit->
PeakTime());
870 int startTick = std::max( 0,
int(std::floor(hit->
PeakTime() - 3. * hit->
RMS())));
871 int endTick = std::min(4096,
int(std::ceil(hit->
PeakTime() + 3. * hit->
RMS())));
873 int startTDC = clockData.TPCTick2TDC(startTick - fOffsetVec[hit->
WireID().
Plane]);
874 int peakTDC = clockData.TPCTick2TDC(peakTick - fOffsetVec[hit->
WireID().
Plane]);
875 int endTDC = clockData.TPCTick2TDC(endTick - fOffsetVec[hit->
WireID().
Plane]);
877 int firstSimTick(std::get<0>(chargeDeposit).
first);
878 int lastSimTick(std::get<2>(chargeDeposit).first);
879 int maxDepTick(std::get<1>(chargeDeposit).first);
880 float maxDepEneTick(std::get<1>(chargeDeposit).
second->energy);
881 float bestNumElectrons(std::get<4>(chargeDeposit));
882 float bestDepEne(std::get<3>(chargeDeposit));
884 float totNumElectrons(0.);
885 int bestTicks(lastSimTick - firstSimTick + 1);
889 for(
const auto& tdcToIDEPair : tdcToIDEMap)
891 for(
const auto& ide : tdcToIDEPair.second)
893 totDepEne += ide->energy;
894 totNumElectrons += ide->numElectrons;
900 ChanToTDCIDEMap::const_iterator tickToTDCIDEVecItr = chanToTDCIDEMap.find(hit->
Channel());
902 if (tickToTDCIDEVecItr == chanToTDCIDEMap.end())
continue;
904 const TickTDCIDEVec& tickToTDCIDEVec = tickToTDCIDEVecItr->second;
907 for(
const auto& tickInfo : tickToTDCIDEVec)
910 if (tickInfo.first >= startTDC && tickInfo.first <= endTDC) tickIDEVec.emplace_back(tickInfo);
913 std::sort(tickIDEVec.begin(),tickIDEVec.end(),[](
const auto&
left,
const auto&
right){
return left.second->energy >
right.second->energy;});
918 int bestTicksGood(0);
921 for(
const auto& tickInfo : tickIDEVec)
924 IDEToVoxelIDMap::const_iterator ideToVoxelIDMapItr = ideToVoxelIDMap.find(tickInfo.second);
926 if (ideToVoxelIDMapItr == ideToVoxelIDMap.end())
continue;
930 sumEne += tickInfo.second->energy;
933 voxelIDSet.insert(voxelID);
935 if (sumEne > 0.9 * bestDepEne)
break;
939 recobHitToVoxelIDMap[
hit] = voxelIDSet;
941 hitObj.
fillSimInfo(bestTicks, bestTicksGood, totDepEne, totNumElectrons, bestDepEne, bestNumElectrons, maxDepEneTick);
942 hitObj.
fillMixedInfo(endTick-startTick+1, maxDepTick-startTDC, peakTDC-maxDepTick);
947 std::sort(hitPeakTimeChargeVec.begin(),hitPeakTimeChargeVec.end(),[](
const auto&
left,
const auto&
right){
return std::get<1>(
left)->PeakAmplitude() > std::get<1>(
right)->PeakAmplitude();});
950 for(
const auto& hitPeakCharge : hitPeakTimeChargeVec)
952 hitObj.
fPHOrderHitVec.emplace_back(std::get<1>(hitPeakCharge)->LocalIndex());
953 hitObj.
fPHFractionVec.emplace_back(std::get<1>(hitPeakCharge)->PeakAmplitude() / maxPulseHeight);
960 void SpacePointAnalysisMC::compareSpacePointsToSim(
const art::Event& event,
966 if (!recobHitToVoxelIDMap.empty())
969 using Triplet = std::tuple<const recob::Hit*, const recob::Hit*, const recob::Hit*>;
970 using TripletMap = std::map<Triplet,std::vector<const recob::SpacePoint*>>;
972 TripletMap tripletMap;
977 art::Handle< std::vector<recob::SpacePoint>> spacePointHandle;
978 event.getByLabel(spacePointLabel, spacePointHandle);
980 if (!spacePointHandle.isValid())
continue;
983 art::FindManyP<recob::Hit> spHitAssnVec(spacePointHandle, event, spacePointLabel);
987 for(
size_t idx = 0; idx < spacePointHandle->size(); idx++)
989 art::Ptr<recob::SpacePoint> spacePointPtr(spacePointHandle,idx);
991 std::vector<art::Ptr<recob::Hit>> associatedHits(spHitAssnVec.at(spacePointPtr.key()));
993 if (associatedHits.size() != 3)
995 mf::LogDebug(
"SpacePointAnalysisMC") <<
"I am certain this cannot happen... but here you go, space point with " << associatedHits.size() <<
" hits" << std::endl;
1000 float spQuality = spacePointPtr->Chisq();
1001 float spCharge = spacePointPtr->ErrXYZ()[1];
1002 float spAsymmetry = spacePointPtr->ErrXYZ()[3];
1003 float smallestPH = std::numeric_limits<float>::max();
1004 float largestPH = 0.;
1006 float averagePH = 0.;
1007 float averagePT = 0.;
1008 float largestDelT = 0.;
1010 std::vector<int> numIDEsHitVec;
1011 std::vector<int> simHitDeltaTVec = {0,0,0};
1012 std::vector<float> hitPeakTimeVec = {-100.,-100.,-100.};
1013 std::vector<float> bigElecDepVec = {0.,0.,0.};
1014 std::vector<unsigned short> bigTDCVec = {0,0,0};
1015 int numIDEsSpacePoint(0);
1017 int numIntersections(0);
1019 std::vector<RecobHitToVoxelIDMap::const_iterator> recobHitToVoxelIterVec;
1021 std::vector<const recob::Hit*> recobHitVec(3,
nullptr);
1024 for(
const auto& hitPtr : associatedHits)
1026 RecobHitToVoxelIDMap::const_iterator hitToVoxelItr = recobHitToVoxelIDMap.find(hitPtr.get());
1028 float peakAmplitude = hitPtr->PeakAmplitude();
1029 float peakTime = hitPtr->PeakTime();
1030 int plane = hitPtr->WireID().Plane;
1032 recobHitVec[plane] = hitPtr.get();
1035 averagePH += peakAmplitude;
1036 averagePT += peakTime;
1038 smallestPH = std::min(peakAmplitude,smallestPH);
1039 largestPH = std::max(peakAmplitude,largestPH);
1041 if (hitPtr->DegreesOfFreedom() < 2) numLongHits++;
1043 if (hitToVoxelItr == recobHitToVoxelIDMap.end())
1045 numIDEsHitVec.push_back(0);
1049 recobHitToVoxelIterVec.push_back(hitToVoxelItr);
1050 numIDEsHitVec.push_back(hitToVoxelItr->second.size());
1052 hitPeakTimeVec[plane] = clockData.
TPCTick2TDC(peakTime);
1055 Triplet hitTriplet(recobHitVec[0],recobHitVec[1],recobHitVec[2]);
1057 tripletMap[hitTriplet].emplace_back(spacePointPtr.get());
1059 averagePH /= float(numHits);
1060 averagePT /= float(numHits);
1062 for(
const auto& hitPtr : associatedHits)
1064 float delT = hitPtr->PeakTime() - averagePT;
1071 if (recobHitToVoxelIterVec.size() == 3)
1074 std::vector<sim::LArVoxelID> firstIntersectionVec(recobHitToVoxelIterVec[0]->
second.size()+recobHitToVoxelIterVec[1]->second.size());
1076 std::vector<sim::LArVoxelID>::iterator firstIntersectionItr = std::set_intersection(recobHitToVoxelIterVec[0]->
second.begin(),recobHitToVoxelIterVec[0]->second.end(),
1077 recobHitToVoxelIterVec[1]->second.begin(),recobHitToVoxelIterVec[1]->second.end(),
1078 firstIntersectionVec.begin());
1080 firstIntersectionVec.resize(firstIntersectionItr - firstIntersectionVec.begin());
1083 if (!firstIntersectionVec.empty())
1086 std::vector<sim::LArVoxelID> secondIntersectionVec(firstIntersectionVec.size()+recobHitToVoxelIterVec[2]->second.size());
1088 std::vector<sim::LArVoxelID>::iterator secondIntersectionItr = std::set_intersection(firstIntersectionVec.begin(), firstIntersectionVec.end(),
1089 recobHitToVoxelIterVec[2]->second.begin(),recobHitToVoxelIterVec[2]->second.end(),
1090 secondIntersectionVec.begin());
1092 secondIntersectionVec.resize(secondIntersectionItr - secondIntersectionVec.begin());
1098 if (!secondIntersectionVec.empty())
1102 VoxelIDToPlaneTDCIDEMap::const_iterator planeToTDCToIDESetMap = voxelToPlaneTDCIDEMap.find(voxelID);
1104 if (planeToTDCToIDESetMap->second.size() > 2)
1106 numIDEsSpacePoint += 1;
1108 for(
const auto& planeInfoPair : planeToTDCToIDESetMap->second)
1110 unsigned short plane = planeInfoPair.first;
1112 unsigned short tdcBig = 0;
1114 for(
const auto& tdcIDEPair : planeInfoPair.second)
1116 for(
const auto& ide : tdcIDEPair.second)
1118 if (phBig < ide->numElectrons)
1120 phBig = ide->numElectrons;
1121 tdcBig = tdcIDEPair.first;
1126 bigElecDepVec[plane] = phBig;
1127 bigTDCVec[plane] = tdcBig;
1130 else std::cout <<
" --> Not matching all three planes" << std::endl;
1170 std::vector<int> numSpacePointVec = {0,0,0,0,0};
1171 for(
const auto& tripletPair : tripletMap)
1173 int numSpacePoints = std::min(numSpacePointVec.size()-1,tripletPair.second.size());
1174 numSpacePointVec[numSpacePoints]++;
1176 std::cout <<
"====>> Found " << tripletMap.size() <<
" SpacePoints, numbers: ";
1186 void SpacePointAnalysisMC::endJob(
int numEvents)
short int LocalIndex() const
How well do we believe we know this hit?
void endJob(int numEvents) override
Interface for method to executve at the end of run processing.
std::vector< float > fBigElecDep2Vec
std::vector< int > fTicksSimChanMostVec
std::unordered_map< int, ChanToChargeMap > TrackToChanChargeMap
std::set< sim::LArVoxelID > VoxelIDSet
std::vector< float > fRMSHitVec
void fillMixedInfo(int hitWidth, int ticksToMax, int deltaTicks)
std::vector< int > fTimeOrderHitVec
Utilities related to art service access.
std::vector< ChargeDeposit > ChargeDepositVec
std::vector< float > fBigElecDep1Vec
std::vector< float > fBigElecDep0Vec
std::map< unsigned short, TDCToIDESetMap > PlaneToTDCToIDESetMap
art::InputTag fSimEnergyProducerLabel
std::vector< int > fHitDelta21Vec
std::unordered_map< int, ChanToTDCIDEMap > TrackIDChanToTDCIDEMap
std::vector< float > fPHFractionVec
geo::WireID WireID() const
float RMS() const
RMS of the hit shape, in tick units.
void fillHistograms(const art::Event &) const override
Interface for filling histograms.
void initializeTuple(TTree *) override
Interface for initializing the tuple variables.
void fillSimInfo(int ticksSimChannel, int ticksSimChanMost, float totDepEne, float totNumElectrons, float bestDepEne, float bestNumElectrons, float maxDepEneTick)
std::tuple< TDCIDEPair, TDCIDEPair, TDCIDEPair, float, float > ChargeDeposit
Declaration of signal hit object.
std::vector< int > fOffsetVec
Allow offsets for each plane.
void fillHitInfo(const recob::Hit *hit, int hitOrder)
void matchHitSim(const detinfo::DetectorClocksData &clockData, const HitPointerVec &, const ChanToTDCToIDEMap &, const ChargeDepositVec &, const ChanToTDCIDEMap &, const IDEToVoxelIDMap &, RecobHitToVoxelIDMap &) const
std::vector< int > fNumIDEsSpacePointVec
~SpacePointAnalysisMC()
Destructor.
int DegreesOfFreedom() const
std::vector< geo::WireID > ChannelToWire(raw::ChannelID_t const channel) const
Returns a list of wires connected to the specified TPC channel.
std::pair< unsigned short, const sim::IDE * > TDCIDEPair
std::vector< float > fAveragePHVec
Definition of basic raw digits.
float Integral() const
Integral under the calibrated signal waveform of the hit, in tick x ADC units.
art::InputTag fSimChannelProducerLabel
float GoodnessOfFit() const
Degrees of freedom in the determination of the hit signal shape (-1 by default)
std::vector< float > fEneTotDepHitVec
std::vector< int > fNumIDEsHit0Vec
short int Multiplicity() const
How many hits could this one be shared with.
void compareHitsToSim(const art::Event &, const ChanToTDCToIDEMap &, const ChanToChargeMap &, const ChanToTDCIDEMap &, const IDEToVoxelIDMap &, RecobHitToVoxelIDMap &) const
std::vector< int > fTicksMaxSimRelVec
std::vector< float > fEneMaxDepHitVec
std::vector< int > fPHOrderHitVec
float PeakAmplitude() const
The estimated amplitude of the hit at its peak, in ADC units.
float fSimChannelMinEnergy
art::InputTag fBadChannelProducerLabel
void initializeHists(art::ServiceHandle< art::TFileService > &, const std::string &) override
Interface for initializing the histograms to be filled.
std::vector< int > fTicksSimChannelVec
std::vector< art::InputTag > fSpacePointLabelVec
std::map< unsigned short, SimIDESet > TDCToIDEMap
std::vector< float > fPHHitVec
std::vector< float > fEneBestDepHitVec
std::vector< float > fSPQualityVec
std::vector< art::InputTag > fRecobHitLabelVec
unsigned int Nplanes(unsigned int tpc=0, unsigned int cstat=0) const
Returns the total number of wire planes in the specified TPC.
IDparameter< geo::WireID > WireID
Member type of validated geo::WireID parameter.
std::set< const sim::IDE *, ideCompare > SimIDESet
std::vector< int > fTicksTotHitVec
std::vector< float > fSmallestPHVec
HitSpacePointObj fHitSpacePointObj
Ionization at a point of the TPC sensitive volume.
std::map< sim::LArVoxelID, PlaneToTDCToIDESetMap > VoxelIDToPlaneTDCIDEMap
std::vector< int > fNumLongHitsVec
void compareSpacePointsToSim(const art::Event &, const detinfo::DetectorClocksData &clockData, const RecobHitToVoxelIDMap &, const VoxelIDToPlaneTDCIDEMap &) const
std::vector< int > fTPCVec
float energy
energy deposited by ionization by this track ID and time [MeV]
std::map< raw::ChannelID_t, ChargeDepositVec > ChanToChargeMap
std::vector< float > fSPTotalChargeVec
std::vector< int > fNDFHitVec
const geo::GeometryCore * fGeometry
pointer to Geometry service
HitSimObjVec fHitSimObjVec
std::vector< int > fHitDelta10Vec
std::vector< HitSimulationTupleObj > HitSimObjVec
std::vector< float > fSPAsymmetryVec
std::map< raw::ChannelID_t, TDCToIDEMap > ChanToTDCToIDEMap
std::vector< float > fLargestDelTVec
std::vector< art::Ptr< recob::Hit >> HitPtrVec
void setBranches(TTree *tree)
PlaneID_t Plane
Index of the plane within its TPC.
Description of geometry of one entire detector.
std::vector< int > fSimHitDeltaT1Vec
bool operator()(const sim::IDE *left, const sim::IDE *right) const
std::unordered_map< const sim::IDE *, sim::LArVoxelID > IDEToVoxelIDMap
std::vector< int > fNumPlanesSimMatchVec
std::vector< float > fNElecBestHitVec
std::vector< const recob::Hit * > HitPointerVec
std::vector< float > fSummedADCHitVec
std::vector< int > fTicksDiffSimHitVec
std::vector< int > fSimHitDeltaT0Vec
std::vector< int > fSimDelta21Vec
float PeakTime() const
Time of the signal peak, in tick units.
std::map< int, ViewHitMap > TrackViewHitMap
std::map< size_t, HitPtrVec > ViewHitMap
std::vector< int > fMultiplicityHitVec
std::vector< int > fSimDelta10Vec
Contains all timing reference information for the detector.
std::vector< float > fIntegralHitVec
std::vector< int > fNumIDEsHit2Vec
std::string to_string(WindowPattern const &pattern)
void configure(fhicl::ParameterSet const &pset) override
contains information for a single step in the detector simulation
std::unordered_map< unsigned short, SimIDESet > TDCToIDESetMap
std::vector< int > fSimHitDeltaT2Vec
std::vector< int > fCryoVec
void setBranches(TTree *tree)
object containing MC truth information necessary for making RawDigits and doing back tracking ...
Interface for experiment-specific channel quality info provider.
std::map< sim::LArVoxelID, SimIDESet > VoxelIDToIDESetMap
float SummedADC() const
The sum of calibrated ADC counts of the hit (0. by default)
std::vector< int > fNumIDEsHit1Vec
art::InputTag fMCParticleProducerLabel
Declaration of basic channel signal object.
std::unordered_map< raw::ChannelID_t, TickTDCIDEVec > ChanToTDCIDEMap
2D representation of charge deposited in the TDC/wire plane
art::ServiceHandle< art::TFileService > tfs
float fSimEnergyMinEnergy
std::vector< int > fLocalIndexHitVec
std::size_t count(Cont const &cont)
SpacePointAnalysisMC(fhicl::ParameterSet const &pset)
Constructor.
std::vector< int > fNumIntersectSetVec
unsigned int ChannelID_t
Type representing the ID of a readout channel.
Interface for experiment-specific service for channel quality info.
std::vector< float > fChiSquareHitVec
std::vector< int > fPlaneVec
std::vector< float > fNElecTotHitVec
Unique identifier for a given LAr voxel.
void makeTrackToChanChargeMap(const TrackIDChanToTDCIDEMap &, TrackToChanChargeMap &, float &, int &) const
raw::ChannelID_t Channel() const
ID of the readout channel the hit was extracted from.
double TPCTick2TDC(double const tick) const
std::unordered_map< const recob::Hit *, VoxelIDSet > RecobHitToVoxelIDMap
std::vector< TDCIDEPair > TickTDCIDEVec
art framework interface to geometry description
BEGIN_PROLOG could also be cout
std::vector< float > fLargestPHVec