23 #include "Utilities/AssociationUtil.h" 74 produces<rb::FilterList<rb::Cluster> >();
75 produces<std::vector<rb::PID> >();
76 produces<art::Assns<rb::PID, rb::Cluster> >();
90 std::unique_ptr<std::vector<rb::PID> > pidcol(
new std::vector<rb::PID>);
126 const int sliceMax = slices->size();
127 for(
int sliceIdx = 0; sliceIdx < sliceMax; ++sliceIdx){
134 double longestTrack = 0;
140 std::vector<art::Ptr<rb::Track> > tracks = fmt.at(sliceIdx);
142 for(
unsigned int n = 0;
n < tracks.size(); ++
n){
143 const double L = tracks[
n]->TotalLength();
144 if(L > longestTrack) longestTrack =
L;
148 const double nCells = slice.
NCell();
154 const double wx = (slice.
NXCell() > 0) ? slice.
W(slice.
XCell(0).
get()) : 0;
155 const double wy = (slice.
NYCell() > 0) ? slice.
W(slice.
YCell(0).
get()) : 0;
157 double totalRecoGeV = 0;
158 for(
unsigned int hitIdx = 0; hitIdx < slice.
NCell(); ++hitIdx){
170 totalRecoGeV += rhit.
GeV();
178 if(2*totalRecoGeV < fRecoELow || 2*totalRecoGeV >
fRecoEHigh) sel =
false;
180 if(!inFid &&
fInFidCut ==
true) sel =
false;
182 if(!sel) filtcol->Add(slices, sliceIdx);
185 pidcol->push_back(
rb::PID(12, sel));
190 evt.
put(std::move(pidcol));
191 evt.
put(std::move(assns));
192 evt.
put(std::move(filtcol));
A simple list of products that have been marked "filtered out".
A pid value and corresponding pdg code.
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.
virtual double W(const rb::CellHit *chit) const
Estimate the unmeasured coordinate of chit.
unsigned int NCell(geo::View_t view) const
Number of cells in view view.
art::Ptr< rb::CellHit > XCell(unsigned int xIdx) const
Get the ith cell in the x-view.
Vertical planes which measure X.
rb::RecoHit MakeRecoHit(rb::CellHit const &cellhit, double w)
A collection of associated CellHits.
TVector3 MeanXYZ(rb::AveragingScheme=kDefaultScheme) const
DEFINE_ART_MODULE(TestTMapFile)
virtual void produce(art::Event &evt)
Calibrated quantities relying on position in the orthogonal view. To generate a rb::CellHit from a rb...
ProductID put(std::unique_ptr< PROD > &&product)
static constexpr double L
Encapsulate the geometry of one entire detector (near, far, ndos)
art::Ptr< rb::CellHit > YCell(unsigned int yIdx) const
Get the ith cell in the y-view.
bool IsCalibrated() const
You MUST check here before accessing PECorr, MIP or GeV.
bool IsFiltered(const art::Event &evt, art::Ptr< T > x, const std::vector< std::string > &labels)
Is this Ptr marked "filtered out"?
unsigned int NYCell() const
Number of cells in the y-view.
art::Ptr< rb::CellHit > Cell(geo::View_t view, unsigned int viewIdx) const
Get the ith cell from view view.
Preselection(const fhicl::ParameterSet &pset)
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
unsigned int NXCell() const
Number of cells in the x-view.
unsigned int ExtentPlane(geo::View_t view=geo::kXorY) const
bool IsNoise() const
Is the noise flag set?
Encapsulate the geometry of one entire detector (near, far, ndos)
bool isInsideFiducialVolume(const double x_cm, const double y_cm, const double z_cm) const
Is the particle inside the detector Fiducial Volume?