20 #include "NovaDAQConventions/DAQConventions.h" 21 #include "Utilities/AssociationUtil.h" 69 produces< std::vector<rb::Track> >();
70 produces< art::Assns<rb::Track, rb::Cluster> >();
74 for(
int i = 0;
i < 2; ++
i)
for(
int j = 0;
j < 2; ++
j)
fTable[
i][
j] = 0;
103 std::unique_ptr<std::vector<rb::Track> > outTracks(
new std::vector<rb::Track>);
111 for(
size_t trIdx = 0; trIdx < tracks->size(); ++trIdx){
118 outTracks->push_back(*trk);
121 const std::vector<art::Ptr<rb::Cluster> > slices = fmpslc.at(trIdx);
122 assert(slices.size() == 1);
131 ++
fTable[stopper][trueStopper];
136 const bool ret = !outTracks->empty();
137 evt.
put(std::move(outTracks));
138 evt.
put(std::move(assns));
154 std::cout <<
"Stopper efficiency table. x-axis selection, y-axis truth:" <<
std::endl;
162 std::cout <<
"Stopper efficiency table (considering tracks stopping in the fiducial volume). x-axis selection, y-axis truth:" <<
std::endl;
176 const TVector3 v1 = trk->
Start();
177 const TVector3 v2 = trk->
Stop();
178 const TVector3 stop = (v1.Y() < v2.Y()) ? v1 : v2;
181 const double y1 = v1.Y();
182 const double z1 = v1.Z();
183 const double x2 = v2.X();
184 const double y2 = v2.Y();
185 const double z2 = v2.Z();
191 int hitsperplane [geom->
NPlanes()];
192 for (
unsigned int k=0; k<geom->
NPlanes(); k++) hitsperplane[k]=0;
194 for(
size_t i = 0;
i < trk->
NCell(); ++
i){
196 hitsperplane[chit->
Plane()]++;
199 double planesperlength = 0;
202 for (
unsigned int k=0; k<geom->
NPlanes(); k++)
if(hitsperplane[k]!=0) {
203 planesperlength += 1/
len;
204 if (k<4) earlyhits ++;
206 double cellsperlength = trk->
NCell() /
len;
209 switch(geom->
DetId()){
232 if( (z2 < 25) || (z2 > 1250) ) {
242 if(y2 < -geom->DetHalfHeight() + 30) {
248 if( (planesperlength < 0.12) || (planesperlength > 0.16) ) {
253 if( (cellsperlength < 0.12) || (cellsperlength > 0.2) ) {
285 if( (z2 < 25) || (z2 > geom->
DetLength() - 25 ) ) {
295 if(y2 < -geom->DetHalfHeight() + 30) {
301 if( (planesperlength < 0.12) || (planesperlength > 0.16) ) {
306 if( (cellsperlength < 0.12) || (cellsperlength > 0.2) ) {
315 assert(0 &&
"Unknown detector");
328 if(parts.empty())
return false;
339 double x0=(start.X()*stop.Z()-stop.X()*start.Z())/(stop.Z()-start.Z());
340 double y0=(start.Y()*stop.Z()-stop.Y()*start.Z())/(stop.Z()-start.Z());
342 if(start.Z() > 0)
return false;
347 if(stop.Z() < 0)
return false;
348 if(stop.Z() > geom->
DetLength())
return false;
360 if(parts.empty())
return false;
371 double x0=(start.X()*stop.Z()-stop.X()*start.Z())/(stop.Z()-start.Z());
372 double y0=(start.Y()*stop.Z()-stop.Y()*start.Z())/(stop.Z()-start.Z());
374 if(start.Z() > 25)
return false;
380 if(stop.Z() < 0)
return false;
381 if(stop.Z() > 1250)
return false;
back track the reconstruction to the simulation
const TLorentzVector & Position(const int i=0) const
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.
~RockMuonStopperSelection()
unsigned int NCell(geo::View_t view) const
Number of cells in view view.
fvar< T > fabs(const fvar< T > &x)
const TLorentzVector & EndPosition() const
RockMuonStopperSelection(const fhicl::ParameterSet &pset)
Float_t y1[n_points_granero]
Selects stopping cosmics.
unsigned short Plane() const
bool IsTrulyInFiducial(const rb::Track *trk) const
A rb::Prong with full reconstructed trajectory.
DEFINE_ART_MODULE(TestTMapFile)
virtual TVector3 Start() const
art::PtrVector< rb::CellHit > AllCells() const
Get all cells from both views.
ProductID put(std::unique_ptr< PROD > &&product)
virtual double TotalLength() const
Length (cm) of all the track segments.
Track finder for cosmic rays.
bool IsContainedStopper(const rb::Track *trk)
Far Detector at Ash River, MN.
Prototype Near Detector on the surface at FNAL.
T get(std::string const &key) const
novadaq::cnv::DetId DetId() const
Prefer ds::DetectorService::DetId() instead.
Near Detector in the NuMI cavern.
EventNumber_t event() const
double DetHalfHeight() const
art::Ptr< rb::CellHit > Cell(geo::View_t view, unsigned int viewIdx) const
Get the ith cell from view view.
double DetHalfWidth() const
virtual bool filter(art::Event &evt)
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
void reconfigure(const fhicl::ParameterSet &pset)
bool IsTrulyContainedStopper(const rb::Track *trk) const
assert(nhit_max >=nhit_nbins)
unsigned int NPlanes() const
TVector3 Stop() const
Position of the final trajectory point.
Encapsulate the geometry of one entire detector (near, far, ndos)
std::string fTrackLabel
Where to find Tracks to reconstruct.
std::vector< const sim::Particle * > HitsToParticle(const std::vector< const rb::CellHit * > &hits) const
Returns vector of sim::Particle objects contributing to the given collection of hits.