|
void | get_MC_particle_list (sim::ParticleList const &, std::vector< simb::MCParticle > &) |
|
simb::Origin_t | get_MC_particle_origin (simb::MCParticle const &) |
|
float | update_MC_particle_time (simb::MCParticle const &, bool &, geo::Geometry const &) |
|
void | match_flashes_to_tracks (std::vector< recob::OpFlash > const &, std::vector< recob::Track > const &) |
|
void | compare_track_and_flash (recob::Track const &, recob::OpFlash const &, bool &) |
|
void | match_flashes_to_particles (std::vector< recob::OpFlash > const &, std::vector< simb::MCParticle > const &, float const &, geo::Geometry const &) |
|
void | compare_particle_and_flash (simb::MCParticle const &, recob::OpFlash const &, bool &, float const &, geo::Geometry const &) |
|
void | match_flashes_to_particles (std::vector< recob::Track > const &, std::vector< simb::MCParticle > const &, geo::Geometry const &) |
|
void | compare_particle_and_track (simb::MCParticle const &, recob::Track const &, bool &, geo::Geometry const &) |
|
void | FillMatchTree_PF (std::vector< recob::OpFlash > const &, std::vector< simb::MCParticle > const &, float const &, geo::Geometry const &) |
|
Definition at line 44 of file OpticalRecoAna_module.cc.
opreco::OpticalRecoAna::OpticalRecoAna |
( |
const fhicl::ParameterSet & |
pset | ) |
|
Definition at line 137 of file OpticalRecoAna_module.cc.
144 fPEMin = pset.get<
float>(
"PEMin");
std::string fFlashModuleLabel
std::vector< flash_match > fFlash_match_vector
std::string fTrackModuleLabel
std::vector< particle_match > fParticle_match_vector
std::vector< track_match > fTrack_match_vector
void opreco::OpticalRecoAna::analyze |
( |
const art::Event & |
evt | ) |
|
Definition at line 209 of file OpticalRecoAna_module.cc.
213 const bool is_MC= !(
evt.isRealData());
219 art::Handle< std::vector<recob::OpFlash> > flash_handle;
221 std::vector<recob::OpFlash>
const& flash_vector(*flash_handle);
224 MF_LOG_INFO (
"OpticalRecoAna")
225 <<
"Number of flashes is " << flash_vector.size() << std::flush;
240 art::ServiceHandle<cheat::ParticleInventoryService const> pi_serv;
241 std::vector<simb::MCParticle> particle_list;
245 mf::LogInfo(
"OpticalRecoAna")
246 <<
"Number of MC particles is " << particle_list.size();
249 art::ServiceHandle<opdet::OpDigiProperties const> odp;
250 const float ns_per_PMT_tick = 1e3;
251 art::ServiceHandle<geo::Geometry const> geometry_handle;
264 for(
auto const& my_flash : flash_vector){
265 if(my_flash.OnBeamTime()==1) n_flashes++;
void match_flashes_to_particles(std::vector< recob::OpFlash > const &, std::vector< simb::MCParticle > const &, float const &, geo::Geometry const &)
std::string fFlashModuleLabel
std::vector< flash_match > fFlash_match_vector
std::vector< particle_match > fParticle_match_vector
void get_MC_particle_list(sim::ParticleList const &, std::vector< simb::MCParticle > &)
void opreco::OpticalRecoAna::beginJob |
( |
| ) |
|
Definition at line 155 of file OpticalRecoAna_module.cc.
157 art::ServiceHandle<art::TFileService const>
tfs;
158 fTimeDiff = tfs->make<TH1F>(
"htdiff",
"Time difference between particles and flashes; t_diff (ns); flash/particle pairs",1e3,-5e6,5e6);
159 fTimeDiff_fine = tfs->make<TH1F>(
"htdiff_fine",
"Time difference between particles and flashes; t_diff (ns); flash/particle pairs",100,-1000,1000);
160 fNBeamFlashes = tfs->make<TH1I>(
"hNBeamFlashes",
"Number of flashes OnBeamTime per event; N_{Flashes}; Events",5,0,5);
162 fMatchTree_PF = tfs->make<TTree>(
"MatchTree_PF",
"MatchTree_PF");
163 fMatchTree_PF->Branch(
"Run",&
fRun,
"Run/I");
164 fMatchTree_PF->Branch(
"Event",&
fEvent,
"Event/I");
165 fMatchTree_PF->Branch(
"p_id",&
fParticleID,
"p_id/I");
167 fMatchTree_PF->Branch(
"p_vx",&
fParticleVx,
"p_vx/F");
168 fMatchTree_PF->Branch(
"p_vy",&
fParticleVy,
"p_vy/F");
169 fMatchTree_PF->Branch(
"p_vz",&
fParticleVz,
"p_vz/F");
172 fMatchTree_PF->Branch(
"FlashID",&
fFlashID,
"flash_id/I");
173 fMatchTree_PF->Branch(
"f_time",&
fFlashTime,
"f_time/F");
175 fMatchTree_PF->Branch(
"f_y",&
fFlashY,
"f_y/F");
176 fMatchTree_PF->Branch(
"f_z",&
fFlashZ,
"f_z/F");
177 fMatchTree_PF->Branch(
"f_ywidth",&
fFlashYWidth,
"f_ywidth/F");
178 fMatchTree_PF->Branch(
"f_zwidth",&
fFlashYWidth,
"f_zwidth/F");
180 fMatchTree_PF->Branch(
"f_pe",&
fFlashPE,
"f_pe/F");
181 fMatchTree_PF->Branch(
"matchIndex",&
fMatchIndex,
"matchIndex/I");
TTree * fMatchTree_PF_NotNu
art::ServiceHandle< art::TFileService > tfs
void opreco::OpticalRecoAna::compare_particle_and_flash |
( |
simb::MCParticle const & |
particle, |
|
|
recob::OpFlash const & |
flash, |
|
|
bool & |
matching, |
|
|
float const & |
ns_per_PMT_tick, |
|
|
geo::Geometry const & |
geometry |
|
) |
| |
|
private |
void opreco::OpticalRecoAna::compare_particle_and_track |
( |
simb::MCParticle const & |
particle, |
|
|
recob::Track const & |
track, |
|
|
bool & |
matching, |
|
|
geo::Geometry const & |
geometry |
|
) |
| |
|
private |
void opreco::OpticalRecoAna::compare_track_and_flash |
( |
recob::Track const & |
track, |
|
|
recob::OpFlash const & |
flash, |
|
|
bool & |
matching |
|
) |
| |
|
private |
void opreco::OpticalRecoAna::FillMatchTree_PF |
( |
std::vector< recob::OpFlash > const & |
flash_vector, |
|
|
std::vector< simb::MCParticle > const & |
particle_vector, |
|
|
float const & |
ns_per_PMT_tick, |
|
|
geo::Geometry const & |
geometry |
|
) |
| |
|
private |
Definition at line 460 of file OpticalRecoAna_module.cc.
465 for(
size_t i_flash=0; i_flash < flash_vector.size(); i_flash++){
468 const float flash_time = my_flash.
Time()*ns_per_PMT_tick;
472 simb::MCParticle
const& my_particle( particle_vector.at(i_particle) );
473 bool pass_check =
false;
476 if(my_particle.Mother()==0 && my_particle.TrackId()>1e4){
const geo::GeometryCore * geometry
std::vector< flash_match > fFlash_match_vector
float update_MC_particle_time(simb::MCParticle const &, bool &, geo::Geometry const &)
void opreco::OpticalRecoAna::get_MC_particle_list |
( |
sim::ParticleList const & |
plist, |
|
|
std::vector< simb::MCParticle > & |
particle_vector |
|
) |
| |
|
private |
Definition at line 282 of file OpticalRecoAna_module.cc.
284 for(sim::ParticleList::const_iterator ipart = plist.begin(); ipart != plist.end(); ++ipart) {
286 const simb::MCParticle* particle = (*ipart).second;
310 particle_vector.emplace_back(*particle);
simb::Origin_t opreco::OpticalRecoAna::get_MC_particle_origin |
( |
simb::MCParticle const & |
particle | ) |
|
|
private |
Definition at line 277 of file OpticalRecoAna_module.cc.
278 art::ServiceHandle<cheat::ParticleInventoryService const> pi_serv;
279 return (pi_serv->TrackIdToMCTruth_P(particle.TrackId()))->Origin();
void opreco::OpticalRecoAna::match_flashes_to_particles |
( |
std::vector< recob::OpFlash > const & |
flash_vector, |
|
|
std::vector< simb::MCParticle > const & |
particle_vector, |
|
|
float const & |
ns_per_PMT_tick, |
|
|
geo::Geometry const & |
geometry |
|
) |
| |
|
private |
Definition at line 379 of file OpticalRecoAna_module.cc.
386 int lastFlashID = -1;
388 for(
size_t i_particle=0; i_particle < particle_vector.size(); i_particle++){
390 simb::MCParticle
const& my_particle( particle_vector.at(i_particle) );
391 bool pass_check =
false;
393 if(!pass_check)
continue;
397 for(
size_t i_flash=0; i_flash < flash_vector.size(); i_flash++){
400 if(my_flash.TotalPE() <
fPEMin)
continue;
402 const float flash_time = my_flash.
Time()*ns_per_PMT_tick;
407 fTimeDiff->Fill(particle_time-flash_time);
445 else if( nonbeam_match ){
const geo::GeometryCore * geometry
std::vector< flash_match > fFlash_match_vector
simb::Origin_t get_MC_particle_origin(simb::MCParticle const &)
TTree * fMatchTree_PF_NotNu
std::vector< particle_match > fParticle_match_vector
float update_MC_particle_time(simb::MCParticle const &, bool &, geo::Geometry const &)
void opreco::OpticalRecoAna::match_flashes_to_particles |
( |
std::vector< recob::Track > const & |
track_vector, |
|
|
std::vector< simb::MCParticle > const & |
particle_vector, |
|
|
geo::Geometry const & |
geometry |
|
) |
| |
|
private |
Definition at line 509 of file OpticalRecoAna_module.cc.
514 for(
size_t i_track=0; i_track < track_vector.size(); i_track++){
516 recob::Track const& my_track( track_vector.at(i_track) );
518 for(
size_t i_particle=0; i_particle < particle_vector.size(); i_particle++){
520 simb::MCParticle
const& my_particle( particle_vector.at(i_particle) );
const geo::GeometryCore * geometry
std::vector< particle_match > fParticle_match_vector
void compare_particle_and_track(simb::MCParticle const &, recob::Track const &, bool &, geo::Geometry const &)
std::vector< track_match > fTrack_match_vector
Track from a non-cascading particle.A recob::Track consists of a recob::TrackTrajectory, plus additional members relevant for a "fitted" track:
void opreco::OpticalRecoAna::match_flashes_to_tracks |
( |
std::vector< recob::OpFlash > const & |
flash_vector, |
|
|
std::vector< recob::Track > const & |
track_vector |
|
) |
| |
|
private |
Definition at line 348 of file OpticalRecoAna_module.cc.
352 for(
size_t i_flash=0; i_flash < flash_vector.size(); i_flash++){
355 if(my_flash.TotalPE() <
fPEMin)
continue;
357 for(
size_t i_track=0; i_track < track_vector.size(); i_track++){
359 recob::Track const& my_track( track_vector.at(i_track) );
void compare_track_and_flash(recob::Track const &, recob::OpFlash const &, bool &)
std::vector< flash_match > fFlash_match_vector
std::vector< track_match > fTrack_match_vector
Track from a non-cascading particle.A recob::Track consists of a recob::TrackTrajectory, plus additional members relevant for a "fitted" track:
float opreco::OpticalRecoAna::update_MC_particle_time |
( |
simb::MCParticle const & |
particle, |
|
|
bool & |
pass_check, |
|
|
geo::Geometry const & |
geometry |
|
) |
| |
|
private |
Definition at line 319 of file OpticalRecoAna_module.cc.
323 unsigned int tpc = 0;
324 unsigned int cstat = 0;
326 const size_t numtraj = particle.NumberTrajectoryPoints();
328 while(t_iter < numtraj){
331 double pos[3] = {particle.Vx(t_iter), particle.Vy(t_iter), particle.Vz(t_iter)};
334 catch(cet::exception &
e){
341 if(t_iter == numtraj)
345 return particle.T(t_iter);
const geo::GeometryCore * geometry
geo::TPCGeo const & PositionToTPC(geo::Point_t const &point) const
Returns the TPC at specified location.
int opreco::OpticalRecoAna::fEvent |
|
private |
std::vector<flash_match> opreco::OpticalRecoAna::fFlash_match_vector |
|
private |
int opreco::OpticalRecoAna::fFlashID |
|
private |
std::string opreco::OpticalRecoAna::fFlashModuleLabel |
|
private |
int opreco::OpticalRecoAna::fFlashOnBeamTime |
|
private |
float opreco::OpticalRecoAna::fFlashPE |
|
private |
float opreco::OpticalRecoAna::fFlashTime |
|
private |
float opreco::OpticalRecoAna::fFlashTimeWidth |
|
private |
float opreco::OpticalRecoAna::fFlashY |
|
private |
float opreco::OpticalRecoAna::fFlashYWidth |
|
private |
float opreco::OpticalRecoAna::fFlashZ |
|
private |
float opreco::OpticalRecoAna::fFlashZWidth |
|
private |
float opreco::OpticalRecoAna::fKineticEnergyMin |
|
private |
int opreco::OpticalRecoAna::fMatchIndex |
|
private |
int opreco::OpticalRecoAna::fMatchIndex_NotNu |
|
private |
TTree* opreco::OpticalRecoAna::fMatchTree_PF |
|
private |
TTree* opreco::OpticalRecoAna::fMatchTree_PF_NotNu |
|
private |
TH1I* opreco::OpticalRecoAna::fNBeamFlashes |
|
private |
std::vector<particle_match> opreco::OpticalRecoAna::fParticle_match_vector |
|
private |
int opreco::OpticalRecoAna::fParticleID |
|
private |
int opreco::OpticalRecoAna::fParticleMother |
|
private |
float opreco::OpticalRecoAna::fParticleTime |
|
private |
int opreco::OpticalRecoAna::fParticleTrackID |
|
private |
float opreco::OpticalRecoAna::fParticleVx |
|
private |
float opreco::OpticalRecoAna::fParticleVy |
|
private |
float opreco::OpticalRecoAna::fParticleVz |
|
private |
float opreco::OpticalRecoAna::fPEMin |
|
private |
int opreco::OpticalRecoAna::fRun |
|
private |
TH1F* opreco::OpticalRecoAna::fTimeDiff |
|
private |
TH1F* opreco::OpticalRecoAna::fTimeDiff_fine |
|
private |
float opreco::OpticalRecoAna::fTimeMatchMax |
|
private |
std::vector<track_match> opreco::OpticalRecoAna::fTrack_match_vector |
|
private |
std::string opreco::OpticalRecoAna::fTrackModuleLabel |
|
private |
The documentation for this class was generated from the following file: