All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Attributes | List of all members
sbn::RangePAllPID Class Reference
Inheritance diagram for sbn::RangePAllPID:

Public Member Functions

 RangePAllPID (fhicl::ParameterSet const &p)
 
 RangePAllPID (RangePAllPID const &)=delete
 
 RangePAllPID (RangePAllPID &&)=delete
 
RangePAllPIDoperator= (RangePAllPID const &)=delete
 
RangePAllPIDoperator= (RangePAllPID &&)=delete
 
void produce (art::Event &e) override
 

Private Attributes

trkf::TrackMomentumCalculator fRangeCalculator
 
art::InputTag fTrackLabel
 
double fMuonMass
 
double fPionMass
 

Detailed Description

Definition at line 33 of file RangePAllPID_module.cc.

Constructor & Destructor Documentation

sbn::RangePAllPID::RangePAllPID ( fhicl::ParameterSet const &  p)
explicit

Definition at line 60 of file RangePAllPID_module.cc.

61  : EDProducer{p},
62  fRangeCalculator(p.get<float>("MinTrackLength", 10.)),
63  fTrackLabel(p.get<art::InputTag>("TrackLabel", "pandoraTrack"))
64 {
65  for (unsigned i = 0; i < names.size(); i++) {
66  produces<std::vector<sbn::RangeP>>(names[i]);
67  produces<art::Assns<recob::Track, sbn::RangeP>>(names[i]);
68  }
69 
70  const TDatabasePDG *PDGTable = TDatabasePDG::Instance();
71  fMuonMass = PDGTable->GetParticle(13)->Mass();
72  fPionMass = PDGTable->GetParticle(211)->Mass();
73 }
pdgs p
Definition: selectors.fcl:22
trkf::TrackMomentumCalculator fRangeCalculator
static const std::vector< std::string > names
art::InputTag fTrackLabel
static const TDatabasePDG * PDGTable(new TDatabasePDG)
sbn::RangePAllPID::RangePAllPID ( RangePAllPID const &  )
delete
sbn::RangePAllPID::RangePAllPID ( RangePAllPID &&  )
delete

Member Function Documentation

RangePAllPID& sbn::RangePAllPID::operator= ( RangePAllPID const &  )
delete
RangePAllPID& sbn::RangePAllPID::operator= ( RangePAllPID &&  )
delete
void sbn::RangePAllPID::produce ( art::Event &  e)
override

Definition at line 75 of file RangePAllPID_module.cc.

76 {
77  art::Handle<std::vector<recob::Track>> track_handle;
78  e.getByLabel(fTrackLabel, track_handle);
79 
80  std::vector<art::Ptr<recob::Track>> tracks;
81  art::fill_ptr_vector(tracks, track_handle);
82 
83  for (unsigned i = 0; i < PIDs.size(); i++) {
84  std::unique_ptr<std::vector<sbn::RangeP>> rangecol(new std::vector<sbn::RangeP>);
85  std::unique_ptr<art::Assns<recob::Track, sbn::RangeP>> assn(new art::Assns<recob::Track, sbn::RangeP>);
86 
87  for (const art::Ptr<recob::Track> track: tracks) {
88  sbn::RangeP rangep;
89  // Rescale the input and output as described by https://inspirehep.net/literature/1766384 (eq. 6.2)
90  if (PIDs[i] == 211) {
92  }
93  else {
94  rangep.range_p = fRangeCalculator.GetTrackMomentum(track->Length(), PIDs[i]);
95  }
96  rangep.trackID = track->ID();
97  rangecol->push_back(rangep);
98  util::CreateAssn(*this, e, *rangecol, track, *assn, names[i]);
99  }
100 
101  e.put(std::move(rangecol), names[i]);
102  e.put(std::move(assn), names[i]);
103  }
104 
105 }
ClusterModuleLabel join with tracks
static const std::vector< int > PIDs
process_name use argoneut_mc_hitfinder track
int trackID
Definition: RangeP.h:8
trkf::TrackMomentumCalculator fRangeCalculator
static const std::vector< std::string > names
art::InputTag fTrackLabel
float range_p
Definition: RangeP.h:7
bool CreateAssn(art::Event &evt, std::vector< T > const &a, art::Ptr< U > const &b, art::Assns< U, T > &assn, std::string a_instance, size_t index=UINT_MAX)
Creates a single one-to-one association.
do i e
double GetTrackMomentum(double trkrange, int pdg) const

Member Data Documentation

double sbn::RangePAllPID::fMuonMass
private

Definition at line 52 of file RangePAllPID_module.cc.

double sbn::RangePAllPID::fPionMass
private

Definition at line 53 of file RangePAllPID_module.cc.

trkf::TrackMomentumCalculator sbn::RangePAllPID::fRangeCalculator
private

Definition at line 50 of file RangePAllPID_module.cc.

art::InputTag sbn::RangePAllPID::fTrackLabel
private

Definition at line 51 of file RangePAllPID_module.cc.


The documentation for this class was generated from the following file: