15 #include "NovaDAQConventions/DAQConventions.h" 20 #include "Utilities/AssociationUtil.h" 105 produces< rb::FilterList<rb::Cluster> >();
106 produces< std::vector<Veto> >();
107 produces< art::Assns<Veto, rb::Cluster> >();
122 switch(geom->
DetId()){
136 assert(0 &&
"Unknown detector");
152 fMinPZ = pset.
get<
unsigned int >(
"MinPZ");
155 std::cout <<
"CosmicVeto settings: angle cut: ";
156 if(fUseBetterCut) std::cout <<
"v2, throughgoing cut: v1, nhit cut: ";
157 if(!fUseBetterCut) std::cout <<
"v1, throughgoing cut: v1, nhit cut: ";
158 if(!fDoNCellLowCut) std::cout <<
"none" <<
std::endl;
159 if(fDoNCellLowCut) std::cout << fNCellLow <<
std::endl;
162 std::cout<<
"Not applying cuts to events in time with NuMI\n";
170 std::unique_ptr< std::vector<presel::Veto> > vetocol(
new std::vector<presel::Veto>);
181 const int sliceMax = slices->size();
183 for(
int sliceIdx = 0; sliceIdx < sliceMax; ++sliceIdx){
191 float fwddist = 100.0, bakdist = 100.0;
193 bool passanglenew=
true, passangleold=
true, passthru=
true;
195 const double nCells = slice.
NCell();
200 if(fmpTrack.isValid()){
201 std::vector< art::Ptr<rb::Track> > tracks = fmpTrack.at(sliceIdx);
202 if(tracks.size()>0) {
210 TVector3 dirfor = track->
Dir().Unit();
211 TVector3 dirbak = -dirfor;
217 diry = track->
Dir().Y();
221 ratio = (track->
NCell()*1.0) / (1.0*nCells);
223 double anglediff = (
angle*
angle) - (diry*diry);
224 double anglevar =
fabs(
angle) * (diry+1.0);
241 if(!passthru && ratio > 0.8) sel =
false;
245 if(fmpTrack.isValid()) {
247 if(slice.
NCell() > 50 && slice.
NCell() <= 135 &&
248 anglediff < ((1.1/85)*slice.
NCell()-1.65)) passangleold =
false;
249 if(slice.
NCell() > 135 && slice.
NCell() <= 250 &&
250 anglediff < ((.6/115)*slice.
NCell()-.6)) passangleold =
false;
251 if(slice.
NCell() > 250 && slice.
NCell() <= 500 &&
252 anglediff < ((.1/250)*slice.
NCell()+0.6)) passangleold =
false;
253 if(slice.
NCell() > 500 && anglediff < 0.8) passangleold =
false;
260 slice.
MaxY() > 400 &&
262 passanglenew =
false;
276 bool fromOutside = (slice.
MaxY() > 400 ||
277 slice.
MinY() < -700 ||
278 slice.
MaxX() > 650 ||
279 slice.
MinX() < -650 ||
280 zDistToFront < 100 ||
286 passanglenew =
false;
296 if(!passangleold) sel =
false;
300 if(!passanglenew) sel =
false;
322 TVector3 minp = slice.
MinXYZ();
343 filtcol->Add(slices, sliceIdx);
345 vetocol->push_back(sliceinfo);
350 evt.
put(std::move(filtcol));
351 evt.
put(std::move(vetocol));
352 evt.
put(std::move(vetoinfo));
fhicl::ParameterSet fPSetFD
A simple list of products that have been marked "filtered out".
cosrej::CosRejFxs * fCosRejFxs
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.
unsigned int NCell(geo::View_t view) const
Number of cells in view view.
fvar< T > fabs(const fvar< T > &x)
fhicl::ParameterSet fPSetTB
static bool IsInBeamWindow(const int run, const double time)
A collection of associated CellHits.
void SetAngleVarOld(double)
double DistToFront(TVector3 vertex)
double DistToBack(TVector3 vertex)
def ratio(spec1, spec2, nbins, pot, binrange=(0, 1))
DEFINE_ART_MODULE(TestTMapFile)
virtual TVector3 Start() const
fhicl::ParameterSet fPSetND
CosmicVeto(fhicl::ParameterSet const &pset)
ProductID put(std::unique_ptr< PROD > &&product)
A class detailing the cuts made on a particular slice.
double ProjectedLiveDistanceToEdge(TVector3 vertex, TVector3 dir)
Far Detector at Ash River, MN.
Prototype Near Detector on the surface at FNAL.
T get(std::string const &key) const
float getAngle(TVector3 trackdir)
novadaq::cnv::DetId DetId() const
Prefer ds::DetectorService::DetId() instead.
virtual TVector3 Dir() const
Unit vector describing prong direction.
Near Detector in the NuMI cavern.
void SetNCell(unsigned int)
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
double MeanTNS(rb::AveragingScheme scheme=kDefaultScheme) const
unsigned int ExtentPlane(geo::View_t view=geo::kXorY) const
virtual void produce(art::Event &evt)
assert(nhit_max >=nhit_nbins)
void SetPassNuMICut(bool)
void SetPassAngleFirstAna(bool)
bool IsNoise() const
Is the noise flag set?
TVector3 Stop() const
Position of the final trajectory point.
void SetPassThruOld(bool)
fhicl::ParameterSet fPSetNDOS
Encapsulate the geometry of one entire detector (near, far, ndos)
void beginRun(art::Run &run)