18 #include "cetlib_except/exception.h" 24 #include "DAQChannelMap/DAQChannelMap.h" 28 #include "NovaDAQConventions/DAQConventions.h" 29 #include "Utilities/func/MathUtil.h" 35 #include "Utilities/AssociationUtil.h" 41 namespace caldp {
class PCHit; }
61 void GetTrueEnergyPathAndLightForCell(
const rb::Track* track,
67 double & poissonLambda)
const;
73 std::vector<caldp::PCHit>* pcHitsXY,
74 std::vector<caldp::PCHit>* pcHitsZ,
75 std::vector<caldp::PCHit>* pcHitsAvg)
const;
77 void ProcessTrackTrajectory(
const rb::Track* track,
79 std::set<double>
const& zPlaneBounds,
80 std::vector<caldp::PCHit>* pcHitsTraj)
const;
82 void ProcessTrackForBelowThresholdHits(
const rb::Track* track,
84 std::vector<caldp::PCHit>* pcHitsXYThresh)
const;
86 void ProcessTrackForFLSHits(
const rb::Track* track2,
88 std::vector<caldp::PCHit>* pcHitsXY)
const;
95 double const& truePath,
97 double const& poissonLambda,
138 produces< std::vector<caldp::PCHit> >(fQualXYName);
139 produces< std::vector<caldp::PCHit> >(fQualZName);
140 produces< std::vector<caldp::PCHit> >(fQualAvgName);
141 produces< std::vector<caldp::PCHit> >(fQualTrajName);
142 produces< std::vector<caldp::PCHit> >(fQualXYThreshName);
143 produces< std::vector<caldp::PCHit> >(fQualXYFLSName);
145 produces< art::Assns<caldp::PCHit, rb::Track> >(fQualXYName);
146 produces< art::Assns<caldp::PCHit, rb::Track> >(fQualZName);
147 produces< art::Assns<caldp::PCHit, rb::Track> >(fQualAvgName);
148 produces< art::Assns<caldp::PCHit, rb::Track> >(fQualTrajName);
149 produces< art::Assns<caldp::PCHit, rb::Track> >(fQualXYThreshName);
150 produces< art::Assns<caldp::PCHit, rb::Track> >(fQualXYFLSName);
155 PCHitsList::~PCHitsList()
172 fIsBeam = pset.
get<
bool >(
"IsBeam");
173 fPathCut = pset.
get<
double >(
"PathCut");
174 fMinPath = pset.
get<
double >(
"MinPathlength");
175 fExtentZCut = pset.
get<
int >(
"ExtentZCut");
176 fDirZCut = pset.
get<
double >(
"DirZCut");
177 fCompletenessCut = pset.
get<
double >(
"CompletenessCut");
178 fMaxVtxDistFromEdge = pset.
get<
double >(
"MaxVtxDistFromEdge", 10.);
179 fMaxEndDistFromEdge = pset.
get<
double >(
"MaxEndDistFromEdge", 10.);
180 fBadStepSizeLimit = pset.
get<
double >(
"BadStepSizeLimit", 2. );
181 fMaxCellsPerPlane = pset.
get<
double >(
"MaxCellsPerPlane", 6. );
182 fMaxDeltaEndPlane = pset.
get<
double >(
"MaxDeltaEndPlane", 3. );
183 fMaxPlaneAsymmetry = pset.
get<
double >(
"MaxPlaneAsymmetry", 0.1);
193 std::unique_ptr< std::vector<caldp::PCHit> > pcHitsXY (
new std::vector<caldp::PCHit>);
194 std::unique_ptr< std::vector<caldp::PCHit> > pcHitsZ (
new std::vector<caldp::PCHit>);
195 std::unique_ptr< std::vector<caldp::PCHit> > pcHitsAvg (
new std::vector<caldp::PCHit>);
196 std::unique_ptr< std::vector<caldp::PCHit> > pcHitsTraj (
new std::vector<caldp::PCHit>);
197 std::unique_ptr< std::vector<caldp::PCHit> > pcHitsXYThresh(
new std::vector<caldp::PCHit>);
198 std::unique_ptr< std::vector<caldp::PCHit> > pcHitsXYFLS (
new std::vector<caldp::PCHit>);
211 std::vector< art::Ptr<rb::Track> > tracks;
219 std::set<double> planeZBounds;
222 for(
size_t itrk = 0; itrk < tracks.size(); ++itrk){
226 const std::vector<art::Ptr<rb::Cluster> > slices = fmpslc.at(itrk);
227 if(slices.size() != 1)
228 throw cet::exception(
"PCHitsList") <<
"incorrect number of slices associated to track";
234 const size_t xyBeginIdx = pcHitsXY->size();
235 const size_t zBeginIdx = pcHitsZ->size();
236 const size_t avgBeginIdx = pcHitsAvg->size();
237 const size_t trajBeginIdx = pcHitsTraj->size();
238 const size_t xyThreshBeginIdx = pcHitsXYThresh->size();
239 const size_t xyFLSBeginIdx = pcHitsXYFLS->size();
243 LOG_DEBUG(
"PCHitsList") <<
"TRACK " << itrk <<
": " << track->
NCell() <<
" cells to process.";
246 if( !this->IsGoodTrack(*track, slice) )
continue;
249 ProcessTrack(track.
get(),
255 ProcessTrackTrajectory(track.
get(),
260 ProcessTrackForBelowThresholdHits(track.
get(),
262 pcHitsXYThresh.get());
264 ProcessTrackForFLSHits(track.
get(),
271 util::CreateAssn(*
this, e, *pcHitsXY, track, *hitAssnsXY, xyBeginIdx, UINT_MAX, fQualXYName);
272 util::CreateAssn(*
this, e, *pcHitsZ, track, *hitAssnsZ, zBeginIdx, UINT_MAX, fQualZName);
273 util::CreateAssn(*
this, e, *pcHitsAvg, track, *hitAssnsAvg, avgBeginIdx, UINT_MAX, fQualAvgName);
274 util::CreateAssn(*
this, e, *pcHitsTraj, track, *hitAssnsTraj, trajBeginIdx, UINT_MAX, fQualTrajName);
275 util::CreateAssn(*
this, e, *pcHitsXYThresh, track, *hitAssnsXYThresh, xyThreshBeginIdx, UINT_MAX, fQualXYThreshName);
276 util::CreateAssn(*
this, e, *pcHitsXYFLS, track, *hitAssnsXYFLS, xyFLSBeginIdx, UINT_MAX, fQualXYFLSName);
281 <<
"SUMMARY: Size of XY vector = " << pcHitsXY->size()
282 <<
", Size of Z vector = " << pcHitsZ->size()
283 <<
", Size of Avg vector = " << pcHitsAvg->size();
285 e.
put(std::move(pcHitsXY), fQualXYName);
286 e.
put(std::move(pcHitsZ), fQualZName);
287 e.
put(std::move(pcHitsAvg), fQualAvgName);
288 e.
put(std::move(pcHitsTraj), fQualTrajName);
289 e.
put(std::move(pcHitsXYThresh), fQualXYThreshName);
290 e.
put(std::move(pcHitsXYFLS), fQualXYFLSName);
291 e.
put(std::move(hitAssnsXY), fQualXYName);
292 e.
put(std::move(hitAssnsZ), fQualZName);
293 e.
put(std::move(hitAssnsAvg), fQualAvgName);
294 e.
put(std::move(hitAssnsTraj), fQualTrajName);
295 e.
put(std::move(hitAssnsXYThresh), fQualXYThreshName);
296 e.
put(std::move(hitAssnsXYFLS), fQualXYFLSName);
298 LOG_DEBUG(
"PCHitsList") <<
"Event finished successfully.";
311 LOG_DEBUG(
"PCHitsList") <<
"!---->Failed NCell Cut!";
316 const TVector3 dr = track.
Dir().Unit();
330 LOG_DEBUG(
"PCHitsList") <<
"!---->Failed Direction Cut!";
336 throw cet::exception(
"SkipEvent") <<
"ERROR: Direction was not a unit vector. Skipping Event.\n";
347 std::abs(track.
Dir().Z()) < fDirZCut)
return false;
353 track.
NYCell() < fCompletenessCut*slice.
NYCell())
return false;
359 std::set<unsigned short> xPlaneList;
360 std::set<unsigned short> yPlaneList;
361 for(
size_t c = 0;
c < track.
NCell(); ++
c){
366 double xCells = track.
NXCell();
367 double yCells = track.
NYCell();
368 double xPlanes = 1. * xPlaneList.size();
369 double yPlanes = 1. * yPlaneList.size();
370 double cellsPerPlaneX = (xPlanes > 0) ? xCells/xPlanes : 999.;
371 double cellsPerPlaneY = (yPlanes > 0) ? yCells/yPlanes : 999.;
372 if(
std::max(cellsPerPlaneX, cellsPerPlaneY) > fMaxCellsPerPlane )
return false;
383 if(
std::abs(xStart - yStart) > fMaxDeltaEndPlane ||
384 std::abs(xEnd - yEnd ) > fMaxDeltaEndPlane ||
385 std::abs(xPlanes - yPlanes) > fMaxPlaneAsymmetry*(xPlanes + yPlanes) )
return false;
390 if(!this->GoodSteps(track) )
return false;
397 if( !fIsBeam &&
std::abs(fLiveGeom->DistToEdgeXY(track.
Start())) > fMaxVtxDistFromEdge &&
398 std::abs(fLiveGeom->DistToEdgeZ (track.
Start())) > fMaxVtxDistFromEdge &&
400 std::abs(fLiveGeom->DistanceToEdgeInMC(track.
Start(), junk)) > fMaxVtxDistFromEdge) ) {
408 if( !fIsBeam && (fLiveGeom->DistToEdgeXY(track.
Stop()) < -fMaxEndDistFromEdge ||
409 fLiveGeom->DistToEdgeZ (track.
Stop()) < -fMaxEndDistFromEdge) &&
411 fLiveGeom->DistanceToEdgeInMC(track.
Stop(), junk) < -fMaxEndDistFromEdge) ) {
432 if(size < 3)
return false;
434 std::vector<float> stepsize(size, 0.);
435 float largestStep = -1.;
436 for(
size_t t = 1;
t < size+1; ++
t){
439 stepsize[
t-1] = (tp1 - tp2).
Mag();
440 largestStep =
std::max(stepsize[
t-1], largestStep);
444 std::sort(stepsize.begin(), stepsize.end());
448 median = 0.5*(stepsize[size/2] + stepsize[(size/2) - 1]);
450 median = stepsize[size/2];
458 if(largestStep > median*fBadStepSizeLimit)
return false;
471 double & poissonLambda)
const 474 if (fBT->HaveTruthInfo()){
475 const std::vector<cheat::TrackIDE> ides = fBT->HitToTrackIDE(track->
Cell(ihit));
477 for(
size_t n = 0;
n < ides.size(); ++
n){
478 mev += ides[
n].energy*1000;
483 auto particle = fBT->ParticleNavigator()[ides[
n].trackID];
485 std::vector<sim::FLSHit> flsHits = fBT->ParticleToFLSHit(particle->TrackId(), particle->PdgCode());
486 for(
auto fls : flsHits){
487 if(fls.GetPlaneID() == track->
Cell(ihit)->
Plane() &&
488 fls.GetCellID() == track->
Cell(ihit)->
Cell() ){
489 truePath = fls.GetTotalPathLength();
497 const std::vector<sim::PhotonSignal> pes = fBT->HitToPhotonSignal(track->
Cell(ihit));
498 for(
size_t n = 0;
n < pes.size(); ++
n){
499 truePE += pes[
n].NPhoton();
500 poissonLambda += pes[
n].PoissonLambda();
515 double enter[3],
exit[3];
519 (fGeom->Plane(ip)->Cell(ic))->LocalToWorld(local_enter,enter);
520 (fGeom->Plane(ip)->Cell(ic))->LocalToWorld(local_exit ,exit);
523 return ( enter[1] + exit[1] )/2;
527 return -( enter[0] + exit[0] )/2;
528 return ( enter[0] + exit[0] )/2;
539 std::vector<caldp::PCHit>* pcHitsXY,
540 std::vector<caldp::PCHit>* pcHitsZ,
541 std::vector<caldp::PCHit>* pcHitsAvg)
const 543 std::vector<rb::CellHit> chits;
544 for(
unsigned int ihit = 0; ihit < track->
NCell(); ++ihit){
545 chits.push_back(*track->
Cell(ihit).
get());
549 std::vector<EPathQuality> quals;
553 if(chits.size() != quals.size() ||
554 chits.size() != paths.size()){
555 throw cet::exception(
"SkipEvent") <<
"ERROR: Number of pathlengths or qualities != number of cells. Skipping Event.\n";
559 for(
size_t ihit = 0; ihit < chits.size(); ++ihit){
565 const double path = paths[ihit];
568 if(path > fPathCut)
continue;
573 double poissonLambda = 0.;
574 double truePath = 0.;
575 double trueW = -9999.;
576 this->GetTrueEnergyPathAndLightForCell(track, ihit, mev, truePath, trueW, truePE, poissonLambda);
579 path, mev, truePE, truePath, trueW, poissonLambda,
586 <<
"Quality XY! - hit=" << ihit <<
" FILLS TO -> plane=" << chit.
Plane()
587 <<
" cell=" << chit.
Cell() <<
" pe=" << chit.
PE() <<
" path=" << path
588 <<
" W=" << track->
W(&chit) <<
" mev=" << mev;
589 pcHitsXY->push_back(pchit);
594 <<
"Quality Z! - hit=" << ihit <<
" FILLS TO -> plane=" << chit.
Plane()
595 <<
" cell=" << chit.
Cell() <<
" pe=" << chit.
PE() <<
" path=" << path
596 <<
" W=" << track->
W(&chit) <<
" mev=" << mev;
597 pcHitsZ->push_back(pchit);
602 <<
"Quality Avg! - hit=" << ihit <<
" FILLS TO -> plane=" << chit.
Plane()
603 <<
" cell=" << chit.
Cell() <<
" pe=" << chit.
PE() <<
" path=" << path
604 <<
" W=" << track->
W(&chit) <<
" mev=" << mev;
605 pcHitsAvg->push_back(pchit);
609 LOG_DEBUG(
"PCHitsList") <<
"!!!!!!BAD hit/track!!!!!! - hit=" << ihit;
614 throw cet::exception(
"SkipEvent") <<
"ERROR: Unknown Path Quality type. Skipping Event.\n";
625 std::set<double>
const& zPlaneBounds,
626 std::vector<caldp::PCHit>* pcHitsTraj)
const 632 if(boundaryMap.empty())
return;
634 for(
unsigned int ihit = 0; ihit < track->
NCell(); ++ihit){
637 std::pair<uint32_t, uint32_t>
pc = {chit.
Plane(), chit.
Cell()};
640 fGeom->Plane(chit.
Plane())->Cell(chit.
Cell())->GetCenter(xyz);
641 xyz[1-chit.
View()] = track->
W(&chit);
644 TVector3 point(xyz[0], xyz[1], xyz[2]);
647 << ihit <<
"/" << track->
NCell()
648 <<
" recohit: " << point.X()
649 <<
" " << point.Y() <<
" " << point.Z();
655 if( !fLiveGeom->IsPointLive(point) && !fLiveGeom->InMuonCatcher(point) ){
660 << point.X() <<
"," << point.Y() <<
"," << point.Z();
668 if(path > fPathCut || path < fMinPath)
continue;
673 double trueW = -9999.;
674 double truePath = 0.;
675 double poissonLambda = 0.;
676 this->GetTrueEnergyPathAndLightForCell(track, ihit, mev, truePath, trueW, truePE, poissonLambda);
678 pcHitsTraj->push_back(CellHitToPCHit(&chit, track,
679 path, mev, truePE, truePath, trueW, poissonLambda,
684 <<
"caught exception \n" << e
685 <<
"\n cell " << pc.first <<
" " << pc.second <<
" not added to PCHitsList";
695 std::vector<caldp::PCHit>* pcHitsXYThresh)
const 697 std::map<geo::OfflineChan, double> trueE;
698 std::map<geo::OfflineChan, double> truePE;
699 std::map<geo::OfflineChan, double> truePath;
700 std::map<geo::OfflineChan, double> trueW;
701 std::map<geo::OfflineChan, double> poissonLambda;
702 if(fBT->HaveTruthInfo()){
703 const std::vector<const sim::Particle*>
parts = fBT->HitsToParticle(track->
AllCells());
705 const int id = parts[0]->TrackId();
706 std::set<geo::OfflineChan> flsChans;
707 const std::vector<sim::FLSHit> flss = fBT->ParticleToFLSHit(
id);
710 trueE[
chan] += 1000*fls.GetEdep();
711 truePath[
chan] = fls.GetTotalPathLength();
712 trueW[
chan] = TrueW(fls);
713 flsChans.insert(
chan);
720 const std::vector<sim::PhotonSignal> pes = fBT->CellToPhotonSignal(
chan.Plane(),
chan.Cell());
722 truePE[
chan] += pe.NPhoton();
723 poissonLambda[
chan] += pe.PoissonLambda();
731 std::vector<EPathQuality> threshQuals;
732 std::vector<double> threshPaths;
733 std::vector<geo::OfflineChan> threshChans;
737 for(
unsigned int threshIdx = 0; threshIdx < threshQuals.size(); ++threshIdx){
738 const double path = threshPaths[threshIdx];
741 if(path > 10)
continue;
743 const int plane = threshChans[threshIdx].Plane();
744 const int cell = threshChans[threshIdx].Cell();
754 truePE[chan], truePath[chan], trueW[chan], poissonLambda[chan],
758 pcHitsXYThresh->push_back(pchit);
766 std::vector<caldp::PCHit>* pcHitsXY)
const 768 if(!fBT->HaveTruthInfo())
return;
774 std::map<geo::OfflineChan, double> extrasTruthMap;
775 std::map<geo::OfflineChan, double> extrasPEMap;
776 std::map<geo::OfflineChan, double> extrasTruePath;
777 std::map<geo::OfflineChan, double> extrasTrueW;
778 std::map<geo::OfflineChan, double> extrasPoissonLambda;
779 std::vector<geo::OfflineChan> extras;
781 const std::vector<const sim::Particle*>
parts = fBT->HitsToParticle(track->
AllCells());
783 const int id = parts[0]->TrackId();
784 const std::vector<sim::FLSHit> flss = fBT->ParticleToFLSHit(
id);
785 const unsigned int nFLS = flss.size();
786 std::set<geo::OfflineChan> extraset;
787 std::set<geo::OfflineChan> flsCells;
788 for(
unsigned int flsIdx = 0; flsIdx < nFLS; ++flsIdx){
791 extraset.insert(
chan);
798 flsCells.insert(
chan);
805 const std::vector<sim::PhotonSignal> pes = fBT->CellToPhotonSignal(
chan.Plane(),
chan.Cell());
807 extrasPEMap[
chan] += pe.NPhoton();
808 extrasPoissonLambda[
chan] += pe.PoissonLambda();
814 extras.insert(extras.end(), extraset.begin(), extraset.end());
817 const double meant = track->
MeanTNS();
823 std::vector<EPathQuality> quals;
827 for(
unsigned int ihit = 0; ihit < extras.size(); ++ihit){
831 const double path = paths[ihit];
833 if(path > 10)
continue;
837 const double mev = extrasTruthMap[
chan];
838 const double truePE = extrasPEMap[
chan];
839 const double truePath = extrasTruePath[
chan];
840 const double trueW = extrasTrueW[
chan];
841 const double poissonLambda = extrasPoissonLambda[
chan];
847 if(hmap.CellExists(chan.
Plane(), chan.
Cell())){
856 path, mev, truePE, truePath, trueW, poissonLambda,
859 pcHitsXY->push_back(pchit);
870 double const& truePE,
871 double const& truePath,
873 double const& poissonLambda,
879 uint32_t pixel = cmap->
getPixel(dchan);
884 double w = trk->
W(chit);
891 if(
std::abs(xyzd[0]) > fGeom->DetHalfWidth() ||
892 std::abs(xyzd[1]) > fGeom->DetHalfHeight() ||
893 xyzd[2] > fGeom->DetLength() ||
894 xyzd[2] < 0.0) xyzd[3] = -1.0;
T max(const caf::Proxy< T > &a, T b)
#define LOG_DEBUG(stream)
float GetEntryX() const
Entry point of the particle (position, time and energy)
size_t NTrajectoryPoints() const
std::vector< geo::OfflineChan > OfflineChans() const
Positions of all the CellHits.
back track the reconstruction to the simulation
static bool CreateAssn(art::EDProducer const &prod, art::Event &evt, std::vector< T > &a, art::Ptr< U > b, art::Assns< T, U > &assn, size_t indx=UINT_MAX, std::string const &instance=std::string())
Create a 1 to 1 association between a new product and one already in the event.
std::string fQualXYThreshName
void SetTNS(float aTNS)
Set hit time (ns)
diblock
print "ROW IS " print row
unsigned int NCell(geo::View_t view) const
Number of cells in view view.
void SetPE(float aPE)
Set PE value.
TVector3 TrajectoryPoint(unsigned int i) const
The ith point on the trajectory, a 3-vector in cm.
void SetTNS(float tns, bool good)
int fExtentZCut
Only keep tracks crossing this distance in z.
int GetPlaneID() const
Plane ID.
void SetAPD(int aAPD)
Set apd value.
void SetPixel(int aPixel)
Set pixel value.
zBoundMap MakeZBoundaryMap(std::set< double > const &planeZBounds, std::vector< TVector3 > const &trajectory)
Return a map of the z position of each trajectory point on a track to the bounding positions of where...
virtual double W(const rb::CellHit *chit) const
Estimate the unmeasured coordinate of chit.
void SetFlightLen(float aLen)
Set path length from start of track.
std::string fQualXYFLSName
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
unsigned short Plane() const
void SetPoissonLambda(float aLambda)
Set number of simulated photons at readout before fluctuations.
int GetCellID() const
Cell ID.
double fMaxPlaneAsymmetry
float GetTotalPathLength() const
Get path length of all steps in FLSHit.
void SetTruePE(float aTruePE)
Set True PE value.
Vertical planes which measure X.
std::vector< double > BestPathEstimates(std::vector< geo::OfflineChan > const &chans, std::map< unsigned int, TVector3 > const &directions, std::vector< EPathQuality > &quals, std::vector< geo::OfflineChan > const &extras)
A collection of associated CellHits.
::xsd::cxx::tree::exception< char > exception
A rb::Prong with full reconstructed trajectory.
A single unit of energy deposition in the liquid scintillator.
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
geo::OfflineChan OfflineChan() const
DEFINE_ART_MODULE(TestTMapFile)
virtual TVector3 Start() const
float GetExitX() const
Exit point of the particle (position, time and energy)
double fMaxEndDistFromEdge
Only keep tracks whose final point is not more than this distance from the edge.
lchan encodeLChan(int detId, plane_t plane, cell_t cell) const
double fBadStepSizeLimit
Only keep tracks without steps outside this limit, see GoodSteps comments.
Horizontal planes which measure Y.
void SetTrueW(float aTrueW)
Set True W value.
"Pre-calibration hit". Common input to calibration procedures
art::PtrVector< rb::CellHit > AllCells() const
Get all cells from both views.
art::ServiceHandle< geo::Geometry > fGeom
int isnan(const stan::math::var &a)
void SetView(geo::View_t view)
void SetPlane(unsigned short plane)
Provides efficient lookup of CellHits by plane and cell number.
ProductID put(std::unique_ptr< PROD > &&product)
unsigned short Cell() const
Track finder for cosmic rays.
double fCompletenessCut
Only keep tracks with more than this fraction of slice hits included in each view.
void SetCell(unsigned short cell)
Far Detector at Ash River, MN.
void SetView(geo::View_t aView)
Set view value.
void SetReadDist(float aDist)
Set distance to cell readout.
void SetPath(float aPath)
Set Path value.
static DAQChannelMap * getInstance(int detID)
void SetGoodTime(bool aGoodT)
Set quality of timing fit.
float GetXAverage(const int step) const
Get X-average for the step. This is in local coordinates.
T get(std::string const &key) const
virtual TVector3 Dir() const
Unit vector describing prong direction.
void GetXYZD(geo::OfflineChan chan, double w, double *xyzd)
Return position in world coordninates and distance to the readout.
void SetDCM(int aDCM)
Set dcm value.
void SetDiblock(int aDiblock)
Set diblock value.
art::ServiceHandle< geo::LiveGeometry > fLiveGeom
#define LOG_WARNING(category)
unsigned short Plane() const
virtual double DistanceFromStart(double z) const
void FindBelowThresholdCalibCandidates(const std::vector< geo::OfflineChan > &trkchans, const std::map< unsigned int, TVector3 > &directions, std::vector< EPathQuality > &quals, std::vector< double > &paths, std::vector< geo::OfflineChan > &chans)
Find empty cells that would have contributed to the calibration if they'd been hit. We assume they fell below threshold.
unsigned int NYCell() const
Number of cells in the y-view.
Histograms used by attenuation calibration.
unsigned int MinPlane(geo::View_t view=geo::kXorY) const
std::map< unsigned int, TVector3 > PlaneDirMap() const
map of the direction cosines at each plane (ie z)
art::Ptr< rb::CellHit > Cell(geo::View_t view, unsigned int viewIdx) const
Get the ith cell from view view.
pixel_t getPixel(dchan daqchan) const
Decode the pixel id from a dchan.
A rawdata::RawDigit with channel information decoded.
unsigned short Cell() const
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
void SetPlane(int aPlane)
Set plane value.
double pythag(double x, double y)
2D Euclidean distance
art::ServiceHandle< ds::DetectorService > fDS
unsigned int NXCell() const
Number of cells in the x-view.
double MeanTNS(rb::AveragingScheme scheme=kDefaultScheme) const
std::vector< TVector3 > const & Trajectory() const
return a constant reference to the track trajectory points
double fMaxVtxDistFromEdge
Only keep tracks with an initial point within this dist (cm) from the edge.
double fPathCut
Only keep hits with pathlength less than this.
std::string fQualTrajName
double fDirZCut
Only keep tracks shallower than this.
cmap::CMap class source code
void SetW(float aW)
Set W value.
unsigned int MaxPlane(geo::View_t view=geo::kXorY) const
dcm_id_t getDCM(dchan daqchan) const
Decode the dcm ID from a dchan.
dchan encodeDChan(int detID, diblock_t diblock, dcm_id_t dcm, feb_t feb, pixel_t pixel) const
float GetEdep() const
Get total Energy deposited into the cell for the whole FLSHit.
TVector3 Stop() const
Position of the final trajectory point.
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
void FindZBoundaries(std::set< double > &planeZBounds)
Find the boundaries in the z direction of planes in the detector.
double fMinPath
Only keep hits with pathlength greater than this.
float GetYAverage(const int step) const
Get Y-average for the step. This is in local coordinates.
uint32_t dchan
< DAQ Channel Map Package
void SetTruePath(float aTruePath)
Set True path length value.
virtual void Clear()
Forget about all owned cell hits.
diblock_t getDiBlock(dchan daqchan) const
Decode the diblock ID from a dchan.
Encapsulate the geometry of one entire detector (near, far, ndos)
double fMaxCellsPerPlane
Only keep tracks with fewer <cells/plane> than this limit.
art::ServiceHandle< cheat::BackTracker > fBT
void SetCell(int aCell)
Set cell value.
feb_t getFEB(dchan daqchan) const
Decode the feb id from a dchan.
float PathLengthInCell(zBoundMap const &zBounds, TVector3 const &recoHitLoc, std::pair< uint32_t, uint32_t > const &pc)
Return the path length of a track in the cell in question.
void SetTrueMeV(float aTrueMeV)
Set True energy (MeV) value.