Public Member Functions | Private Attributes | List of all members
HitSdpPlotter::HitSdpPlotter Class Reference

#include <HitSdpPlotter.h>

Inheritance diagram for HitSdpPlotter::HitSdpPlotter:
art::EDAnalyzer art::detail::Analyzer art::detail::LegacyModule art::Observer art::ModuleBase

Public Member Functions

 HitSdpPlotter (fhicl::ParameterSet const &pSet)
 
virtual void beginJob ()
 
virtual void analyze (const art::Event &evt) override
 
virtual void endJob ()
 
- Public Member Functions inherited from art::EDAnalyzer
 EDAnalyzer (fhicl::ParameterSet const &pset)
 
template<typename Config >
 EDAnalyzer (Table< Config > const &config)
 
std::string workerType () const
 
- Public Member Functions inherited from art::detail::Analyzer
virtual ~Analyzer () noexcept
 
 Analyzer (fhicl::ParameterSet const &pset)
 
template<typename Config >
 Analyzer (Table< Config > const &config)
 
void doBeginJob (SharedResources const &resources)
 
void doEndJob ()
 
void doRespondToOpenInputFile (FileBlock const &fb)
 
void doRespondToCloseInputFile (FileBlock const &fb)
 
void doRespondToOpenOutputFiles (FileBlock const &fb)
 
void doRespondToCloseOutputFiles (FileBlock const &fb)
 
bool doBeginRun (RunPrincipal &rp, ModuleContext const &mc)
 
bool doEndRun (RunPrincipal &rp, ModuleContext const &mc)
 
bool doBeginSubRun (SubRunPrincipal &srp, ModuleContext const &mc)
 
bool doEndSubRun (SubRunPrincipal &srp, ModuleContext const &mc)
 
bool doEvent (EventPrincipal &ep, ModuleContext const &mc, std::atomic< std::size_t > &counts_run, std::atomic< std::size_t > &counts_passed, std::atomic< std::size_t > &counts_failed)
 
- Public Member Functions inherited from art::Observer
 ~Observer () noexcept
 
 Observer (Observer const &)=delete
 
 Observer (Observer &&)=delete
 
Observeroperator= (Observer const &)=delete
 
Observeroperator= (Observer &&)=delete
 
void registerProducts (ProductDescriptions &, ModuleDescription const &)
 
void fillDescriptions (ModuleDescription const &)
 
fhicl::ParameterSetID selectorConfig () const
 
- Public Member Functions inherited from art::ModuleBase
virtual ~ModuleBase () noexcept
 
 ModuleBase ()
 
ModuleDescription const & moduleDescription () const
 
void setModuleDescription (ModuleDescription const &)
 
std::array< std::vector< ProductInfo >, NumBranchTypes > const & getConsumables () const
 
void sortConsumables (std::string const &current_process_name)
 
template<typename T , BranchType BT>
ViewToken< T > consumesView (InputTag const &tag)
 
template<typename T , BranchType BT>
ViewToken< T > mayConsumeView (InputTag const &tag)
 

Private Attributes

art::InputTag private_OpHitLabel
 
art::InputTag private_BtrLabel
 
art::ServiceHandle< art::TFileService > private_service_tfs
 
art::ServiceHandle< geo::Geometryprivate_service_geom
 
art::ServiceHandle< cheat::PhotonBackTrackerServiceprivate_service_pbt
 
std::unique_ptr< art::TFileDirectory > mDir
 
std::map< UInt_t, TH1D * > sdp_time_hists
 
std::map< UInt_t, TH1D * > detTimeHist
 
TH1D * widths
 

Additional Inherited Members

- Public Types inherited from art::EDAnalyzer
using WorkerType = WorkerT< EDAnalyzer >
 
using ModuleType = EDAnalyzer
 
- Protected Member Functions inherited from art::Observer
std::string const & processName () const
 
bool wantAllEvents () const noexcept
 
bool wantEvent (ScheduleID id, Event const &e) const
 
Handle< TriggerResultsgetTriggerResults (Event const &e) const
 
 Observer (fhicl::ParameterSet const &config)
 
 Observer (std::vector< std::string > const &select_paths, std::vector< std::string > const &reject_paths, fhicl::ParameterSet const &config)
 
- Protected Member Functions inherited from art::ModuleBase
ConsumesCollectorconsumesCollector ()
 
template<typename T , BranchType = InEvent>
ProductToken< T > consumes (InputTag const &)
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > consumesView (InputTag const &)
 
template<typename T , BranchType = InEvent>
void consumesMany ()
 
template<typename T , BranchType = InEvent>
ProductToken< T > mayConsume (InputTag const &)
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > mayConsumeView (InputTag const &)
 
template<typename T , BranchType = InEvent>
void mayConsumeMany ()
 

Detailed Description

Definition at line 51 of file HitSdpPlotter.h.

Constructor & Destructor Documentation

HitSdpPlotter::HitSdpPlotter::HitSdpPlotter ( fhicl::ParameterSet const &  pSet)

Definition at line 19 of file HitSdpPlotter_module.cc.

20  :EDAnalyzer(pSet),
21  private_OpHitLabel(pSet.get<art::InputTag>("OpHitLabel", "ophit")),
22  private_BtrLabel(pSet.get<art::InputTag>("BTRLabel", "largeant"))
23  { }
EDAnalyzer(fhicl::ParameterSet const &pset)
Definition: EDAnalyzer.h:25
art::InputTag private_OpHitLabel
Definition: HitSdpPlotter.h:65

Member Function Documentation

void HitSdpPlotter::HitSdpPlotter::analyze ( const art::Event evt)
overridevirtual

Definition at line 44 of file HitSdpPlotter_module.cc.

44  {
45 
46  std::vector<art::Ptr<recob::OpHit>> ophitList;
47  auto ophitHandle = evt.getHandle<std::vector<recob::OpHit> >(private_OpHitLabel);
48  if (ophitHandle)
49  art::fill_ptr_vector(ophitList, ophitHandle);
50 
51  std::vector<art::Ptr<sim::OpDetBacktrackerRecord>> btrList;
52  auto btrHandle = evt.getHandle<std::vector<sim::OpDetBacktrackerRecord> >(private_BtrLabel);
53  if (btrHandle)
54  art::fill_ptr_vector(btrList, btrHandle);
55 
56  for( auto& btr : btrList ){
57  TH1D* dummy = 0;
58  UInt_t opdet = btr->OpDetNum();
59  auto empIt = sdp_time_hists.emplace(std::make_pair(opdet, dummy));
60  if(empIt.second==true){
61  TString histName = TString("SDPTime")+TString(std::to_string(opdet))+TString("Hist");
62  TString histTitle = TString("PD ")+TString(std::to_string(opdet))+TString(" SDP Times.");
63  TH1D* tmphist1 = mDir->make<TH1D>(histName, histTitle, 30000, -1500000, 1500000);
64  empIt.first->second = std::move(tmphist1);
65  }
66  auto time_sdps = btr->timePDclockSDPsMap();
67  for( auto& time_sdp : time_sdps ){
68  double time = time_sdp.first;
69  empIt.first->second->Fill(time);
70  }
71  }
72 
73  for ( auto& ophit : ophitList ){
74  TH1D* dummy = 0;
75  UInt_t opdet = private_service_geom->OpDetFromOpChannel(ophit->OpChannel());
76  auto empIt = detTimeHist.emplace(std::make_pair(opdet, dummy));
77  //auto empIt = detTimeHist.emplace(std::make_pair(opdet, TH1D*(0)));
78 // auto empLowIt = detLowerTimeHist.emplace(std::make_pair(opdet, dummy));
79  //auto empLowIt = detLowerTimeHist.emplace(std::make_pair(opdet, TH1D*(0)));
80 // auto empUpIt = detUpperTimeHist.emplace(std::make_pair(opdet, dummy));
81  //auto empUpIt = detUpperTimeHist.emplace(std::make_pair(opdet, TH1D*(0)));
82  if(empIt.second==true){
83  TString histName = TString("PD")+TString(std::to_string(opdet))+TString("Hist");
84  TString histTitle = TString("PD ")+TString(std::to_string(opdet))+TString(" OpHit Times.");
85  /*
86  TString histLowName = TString("PD")+TString(std::to_string(opdet))+TString("LowHist");
87  TString histLowTitle = TString("PD ")+TString(std::to_string(opdet))+TString(" OpHit Lower Times.");
88  TString histUpName = TString("PD")+TString(std::to_string(opdet))+TString("UpHist");
89  TString histUpTitle = TString("PD ")+TString(std::to_string(opdet))+TString(" OpHit Upper Times.");
90  */
91  TH1D* tmphist1 = mDir->make<TH1D>(histName, histTitle, 30000, -1500000, 1500000);
92  empIt.first->second = std::move(tmphist1);
93  //TH1D* tmphist2 = mDir->make<TH1D>(histLowName, histLowTitle, 3000000, -1500000, 1500000);
94  //empLowIt.first->second = std::move(tmphist2);
95  //TH1D* tmphist3 = mDir->make<TH1D>(histUpName, histUpTitle, 3000000, -1500000, 1500000);
96  //empUpIt.first->second = std::move(tmphist3);
97  }
98  if((private_service_pbt->OpHitToSimSDPs_Ps(ophit)).size()>1){
99  double time = ophit->PeakTime() * 1000;
100  double width = ophit->Width() * 1000;
101  widths->Fill(width);
102  empIt.first->second->Fill(time);
103  //empLowIt.first->second->Fill(time - width);
104  //empUpIt.first->second->Fill(time + width);
105  }
106  }
107 
108 
109  } //end analyze
const std::vector< const sim::SDP * > OpHitToSimSDPs_Ps(recob::OpHit const &opHit)
Handle< PROD > getHandle(SelectorBase const &) const
Definition: DataViewImpl.h:382
std::map< UInt_t, TH1D * > detTimeHist
Definition: HitSdpPlotter.h:72
std::unique_ptr< art::TFileDirectory > mDir
Definition: HitSdpPlotter.h:70
unsigned int OpDetFromOpChannel(int opChannel) const
Convert unique channel to detector number.
art::ServiceHandle< geo::Geometry > private_service_geom
Definition: HitSdpPlotter.h:68
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
Definition: StdUtils.h:92
std::map< UInt_t, TH1D * > sdp_time_hists
Definition: HitSdpPlotter.h:71
art::InputTag private_OpHitLabel
Definition: HitSdpPlotter.h:65
def move(depos, offset)
Definition: depos.py:107
art::ServiceHandle< cheat::PhotonBackTrackerService > private_service_pbt
Definition: HitSdpPlotter.h:69
cet::LibraryManager dummy("noplugin")
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
Definition: Ptr.h:297
std::string to_string(ModuleType const mt)
Definition: ModuleType.h:34
void HitSdpPlotter::HitSdpPlotter::beginJob ( )
virtual

Reimplemented from art::EDAnalyzer.

Definition at line 35 of file HitSdpPlotter_module.cc.

35  {
36 //int nOpDets=private_geom->NOpDets();
37  mDir = std::make_unique<art::TFileDirectory>(private_service_tfs->mkdir("hists","hists"));
38  widths = private_service_tfs->make<TH1D>("ophit_widths", "width of ophits", 1000, -1, 2001);
39 
40  //PEs On X Axis
41  }
std::unique_ptr< art::TFileDirectory > mDir
Definition: HitSdpPlotter.h:70
art::ServiceHandle< art::TFileService > private_service_tfs
Definition: HitSdpPlotter.h:67
void HitSdpPlotter::HitSdpPlotter::endJob ( )
virtual

Reimplemented from art::EDAnalyzer.

Definition at line 112 of file HitSdpPlotter_module.cc.

112  {
113  }

Member Data Documentation

std::map<UInt_t, TH1D*> HitSdpPlotter::HitSdpPlotter::detTimeHist
private

Definition at line 72 of file HitSdpPlotter.h.

std::unique_ptr<art::TFileDirectory> HitSdpPlotter::HitSdpPlotter::mDir
private

Definition at line 70 of file HitSdpPlotter.h.

art::InputTag HitSdpPlotter::HitSdpPlotter::private_BtrLabel
private

Definition at line 66 of file HitSdpPlotter.h.

art::InputTag HitSdpPlotter::HitSdpPlotter::private_OpHitLabel
private

Definition at line 65 of file HitSdpPlotter.h.

art::ServiceHandle<geo::Geometry> HitSdpPlotter::HitSdpPlotter::private_service_geom
private

Definition at line 68 of file HitSdpPlotter.h.

art::ServiceHandle<cheat::PhotonBackTrackerService> HitSdpPlotter::HitSdpPlotter::private_service_pbt
private

Definition at line 69 of file HitSdpPlotter.h.

art::ServiceHandle<art::TFileService> HitSdpPlotter::HitSdpPlotter::private_service_tfs
private

Definition at line 67 of file HitSdpPlotter.h.

std::map<UInt_t, TH1D*> HitSdpPlotter::HitSdpPlotter::sdp_time_hists
private

Definition at line 71 of file HitSdpPlotter.h.

TH1D* HitSdpPlotter::HitSdpPlotter::widths
private

Definition at line 73 of file HitSdpPlotter.h.


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