All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Functions
ana::CosmicIdUtils Namespace Reference

Functions

bool BeamFlash (std::vector< double > flashes, double beamTimeMin, double beamTimeMax)
 
geo::TPCID DetectedInTPC (const std::vector< art::Ptr< recob::Hit >> &hits)
 
std::set< geo::TPCIDDetectedInTPCS (const std::vector< art::Ptr< recob::Hit >> &hits)
 

Function Documentation

bool ana::CosmicIdUtils::BeamFlash ( std::vector< double >  flashes,
double  beamTimeMin,
double  beamTimeMax 
)

Definition at line 8 of file Util.cc.

8  {
9  //
10  bool beamFlash = false;
11  std::sort(flashes.begin(), flashes.end());
12  // Loop over flashes in tpc 0
13  for(size_t i = 0; i < flashes.size(); i++){
14  double time = flashes[i];
15  if(time > beamTimeMin && time < beamTimeMax) beamFlash = true;
16  }
17 
18  return beamFlash;
19  }
geo::TPCID ana::CosmicIdUtils::DetectedInTPC ( const std::vector< art::Ptr< recob::Hit >> &  hits)

Definition at line 30 of file Util.cc.

30  {
31  geo::TPCID ret; // constructor defaults to invalid
32  for (const art::Ptr<recob::Hit> hit: hits) {
33  if (!ret) ret = hit->WireID().asTPCID();
34  else if (ret != hit->WireID().asTPCID()) {
35  geo::TPCID invalid;
36  return invalid;
37  }
38  }
39  return ret;
40  }
process_name hit
Definition: cheaterreco.fcl:51
The data type to uniquely identify a TPC.
Definition: geo_types.h:386
std::set< geo::TPCID > ana::CosmicIdUtils::DetectedInTPCS ( const std::vector< art::Ptr< recob::Hit >> &  hits)

Definition at line 21 of file Util.cc.

21  {
22  std::set<geo::TPCID> ret;
23  for (const art::Ptr<recob::Hit> hit: hits) {
24  ret.insert(hit->WireID().asTPCID());
25  }
26  return ret;
27  }
process_name hit
Definition: cheaterreco.fcl:51