Classes | Functions
remid Namespace Reference

A PID for muons. More...

Classes

struct  Counts
 
class  RecoMuon
 
class  ReMId
 
class  ReMIdDedx
 
class  ReMIdDedxFD
 
class  ReMIdDedxRock
 
class  ReMIdDedxStudies
 
class  ReMIdTrain
 
class  ReMIdValidate
 A module to analyze remid objects produced by the RecoMuon module. More...
 

Functions

unsigned int HighestPIDTrack (const std::vector< art::Ptr< rb::Track > > &sliceTracks, const std::string &remidModuleLabel, const art::Event &e)
 
unsigned int HighestPIDTrack (std::vector< art::Ptr< rb::Track > > const &sliceTracks, art::InputTag const &remidTag, art::Event const &e)
 

Detailed Description

A PID for muons.

A module for analyzing the ReMId objects in neutrino interactions.

Author
Nicholas Raddatz - radda.nosp@m.tz@p.nosp@m.hysic.nosp@m.s.um.nosp@m.n.edu
Date
September 2012

Function Documentation

unsigned int remid::HighestPIDTrack ( const std::vector< art::Ptr< rb::Track > > &  sliceTracks,
const std::string &  remidModuleLabel,
const art::Event e 
)

Function which finds index of the best ReMId track among a vector of tracks. Requires the event to fetch associated ReMId objects and the module label

Definition at line 249 of file ReMId.cxx.

References getGoodRuns4SAM::tag.

Referenced by numue::NumuEAna::analyze(), numue::NumuEAlg::FDEnergy(), skim::SkimmerAna::FillNumuHistograms(), skim::CosmicBeamComparison::FillNumuHistograms(), fnex::NuMuAnalysisSetup::FillVars(), numue::NumuEAlg::GetUCMuonENonSingle(), numue::NumuEAlg::GetUCMuonESingle(), skim::EvaluatorNumuCCpi::Initialize(), skim::EvaluatorNumu::Initialize(), numue::NumuEAlg::MCTruthEnergyVariables(), numue::NumuEAlg::NDEnergy(), qeef::QeFinder::produce(), wsnumu::WSNumu::produce(), cosrej::CosRej::produce(), xsrec::MakeXSecCCPi0Inc::produce(), caf::CAFMaker::produce(), and numue::NumuEAlg::QEFormulaEnergy().

252  {
253 
254  art::InputTag tag(remidModuleLabel);
255  return remid::HighestPIDTrack(sliceTracks, tag, e);
256  }
unsigned int HighestPIDTrack(const std::vector< art::Ptr< rb::Track > > &sliceTracks, const std::string &remidModuleLabel, const art::Event &e)
Definition: ReMId.cxx:249
unsigned int remid::HighestPIDTrack ( std::vector< art::Ptr< rb::Track > > const &  sliceTracks,
art::InputTag const &  remidTag,
art::Event const &  e 
)

Definition at line 259 of file ReMId.cxx.

References make_syst_table_plots::c, allTimeWatchdog::endl, geo::kXorY, cet::sqlite::max(), rb::PID::Value(), and POTSpillRate::view.

262  {
263  int bestTrack = -1;
264  double highestPID = -2.0;
265  double bestTrackLength = 0.0;
266  double bestStartZ = std::numeric_limits<double>::max();
267  double bestADC = std::numeric_limits<double>::max();
268 
269  art::FindOneP<remid::ReMId> tracksToReMId(sliceTracks, e, remidTag);
270 
271  for(size_t c = 0; c < sliceTracks.size(); ++c){
272 
273  geo::View_t view = sliceTracks[c]->View();
274 
275  //Only use 3D tracks
276  if (view != geo::kXorY){
277  continue;
278  } //End of loop over 2d tracks
279 
280  if(tracksToReMId.isValid()){
281  art::Ptr<remid::ReMId> trackReMId = tracksToReMId.at(c);
282 
283  // If the PID is lower, we can bail, nothing to update
284  if(trackReMId->Value() < highestPID) continue;
285 
286  if(trackReMId->Value() == highestPID)
287  { // If the new guy is shorter, we can bail
288  if (sliceTracks[c]->TotalLength() < bestTrackLength) continue;
289 
290  // If equal, need to fall to the next level, low start Z
291  if (sliceTracks[c]->TotalLength() == bestTrackLength){
292 
293  // If start Z is higher, we can bail
294  if (sliceTracks[c]->Start().Z() > bestStartZ) continue;
295 
296  // If equal, need to fall to the next level, total ADC
297  // You might think this is stupid, but it's equivalent to flipping
298  // a coin which always lands on the same side. This is good, this
299  // will happen so rarely that you should just pee up a rope.
300  // Use lower ADC
301  if (sliceTracks[c]->Start().Z() == bestStartZ){
302 
303  if(sliceTracks[c]->TotalADC() > bestADC) continue;
304 
305  if(sliceTracks[c]->TotalADC() == bestADC)
306  throw cet::exception("ReMId Matched Track Exception")<<std::endl
307  << "Can't break a tie between two ReMId/tracks. "
308  << "This should have never happend, but it did. "
309  << "The numu group is going to have to reflect on this "
310  << "and find a way to fix it." << std::endl;
311 
312  }
313 
314 
315  }
316  }
317 
318 
319 
320  highestPID = trackReMId->Value();
321  bestTrackLength = sliceTracks[c]->TotalLength();
322  bestStartZ = sliceTracks[c]->Start().Z();
323  bestADC = sliceTracks[c]->TotalADC();
324  bestTrack = c;
325 
326 
327  }//End of valid ReMId object
328 
329  }//End of for loop over tracks
330 
331 
332  if (bestTrack < 0)
333  return 999;
334 
335  return (unsigned int)bestTrack;
336 
337 
338  }
X or Y views.
Definition: PlaneGeo.h:30
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
::xsd::cxx::tree::exception< char > exception
Definition: Database.h:225
virtual TVector3 Start() const
Definition: Prong.h:73
double Value() const
Definition: PID.h:22
virtual double TotalLength() const
Length (cm) of all the track segments.
Definition: Track.cxx:213
double TotalADC() const
Sum of the ADC of all the contained hits.
Definition: Cluster.cxx:360
Float_t e
Definition: plot.C:35
T max(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Definition: statistics.h:68
Definition: fwd.h:28