18 #include "Utilities/AssociationUtil.h" 39 this->produces< std::vector<rb::Vertex> > ();
40 this->produces< art::Assns<rb::Vertex, rb::Cluster> >();
45 # define SET(N) { f##N = p.get<__typeof__(f##N)>(#N); } 46 SET(ObeyPreselection);
65 std::unique_ptr< std::vector<rb::Vertex> >
66 vtx(
new std::vector<rb::Vertex>);
67 std::unique_ptr< art::Assns<rb::Vertex, rb::Cluster> >
83 for(i = 0; i < slice->size(); ++
i) {
93 std::vector<const rb::Track*> tracks = trackh.at(i);
97 for (j=0; j<tracks.size(); ++
j) {
99 TVector3 st = tracks[
j]->Start();
101 TVector3 direct = tracks[
j]->Dir();
103 double start[3] = {st.X(),st.Y(),st.Z()};
105 double dir[3] = {-direct.X(),-direct.Y(),-direct.Z()};
109 bool is_inside =
true;
112 is_inside &= (start[2]>0)&&(start[2]<geom->
DetLength());
115 geom->
DEdge(start,dir,enterp);
118 double oppDir[3] = {direct.X(), direct.Y(), direct.Z()};
122 std::copy(std::begin(start),
std::end(start), std::begin(enterp));
128 p1.SetX(st.X() + (1000*direct.X()));
129 p1.SetY(st.Y() + (1000*direct.Y()));
130 p1.SetZ(st.Z() + (1000*direct.Z()));
132 double newStart[3] = {st.X(), st.Y(), st.Z()};
133 std::copy(std::begin(newStart),
std::end(newStart), std::begin(enterp));
137 double t0 = tracks[
j]->MinTNS();
152 evt.
put(std::move(vtx));
153 evt.
put(std::move(vtx_to_slice));
A 3D position and time representing an interaction vertex.
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.
bool fObeyPreselection
Check rb::IsFiltered?
CosmicRayVertex(fhicl::ParameterSet const &p)
A collection of associated CellHits.
void reconfigure(const fhicl::ParameterSet &p)
bool ClampRayToDetectorVolume(TVector3 *p0, TVector3 *p1, const GeometryBase *geom)
If either endpoint is outside the detector move it to the edge.
DEFINE_ART_MODULE(TestTMapFile)
std::string fTrackLabel
Where to look for tracks?
ProductID put(std::unique_ptr< PROD > &&product)
double DEdge(const double *x0, const double *dx, double *exitp=0) const
Encapsulate the geometry of one entire detector (near, far, ndos)
Collect Geo headers and supply basic geometry functions.
bool IsFiltered(const art::Event &evt, art::Ptr< T > x, const std::vector< std::string > &labels)
Is this Ptr marked "filtered out"?
double DetHalfHeight() const
Vertex location in position and time.
virtual ~CosmicRayVertex()
Place a vertex on the detector wall for a cosmic-ray track.
void produce(art::Event &evt)
std::string fSliceLabel
Where to get slices?
double DetHalfWidth() const
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
bool IntersectsDetector(double *xyz_cm, double *dxyz) const
bool IsNoise() const
Is the noise flag set?
Encapsulate the geometry of one entire detector (near, far, ndos)