Public Member Functions | Private Member Functions | Private Attributes | List of all members
DataHit Class Reference
Inheritance diagram for DataHit:
art::EDAnalyzer art::detail::Analyzer art::detail::LegacyModule art::Observer art::ModuleBase

Public Member Functions

 DataHit (fhicl::ParameterSet const &p)
 
 DataHit (DataHit const &)=delete
 
 DataHit (DataHit &&)=delete
 
DataHitoperator= (DataHit const &)=delete
 
DataHitoperator= (DataHit &&)=delete
 
void analyze (art::Event const &evt) override
 
void reconfigure (fhicl::ParameterSet const &p)
 
void beginJob () override
 
void endJob () override
 
- 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 Member Functions

void ResetVariables ()
 

Private Attributes

std::string fHitLabel
 
TTree * fDataHitTree
 
int Run
 
int SubRun
 
int Event
 
int NTotHit
 
int NColHit
 
int NIndHit
 
std::vector< int > Hit_View
 
std::vector< int > Hit_Size
 
std::vector< int > Hit_TPC
 
std::vector< int > Hit_Chan
 
std::vector< float > Hit_Time
 
std::vector< float > Hit_RMS
 
std::vector< float > Hit_SADC
 
std::vector< float > Hit_Int
 
std::vector< float > Hit_Peak
 
art::ServiceHandle< geo::Geometrygeo
 

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 49 of file DataHit_module.cc.

Constructor & Destructor Documentation

DataHit::DataHit ( fhicl::ParameterSet const &  p)
explicit

Definition at line 133 of file DataHit_module.cc.

133  :EDAnalyzer(p)
134 {
135  this->reconfigure(p);
136 }
void reconfigure(fhicl::ParameterSet const &p)
EDAnalyzer(fhicl::ParameterSet const &pset)
Definition: EDAnalyzer.h:25
p
Definition: test.py:223
DataHit::DataHit ( DataHit const &  )
delete
DataHit::DataHit ( DataHit &&  )
delete

Member Function Documentation

void DataHit::analyze ( art::Event const &  evt)
overridevirtual

Implements art::EDAnalyzer.

Definition at line 191 of file DataHit_module.cc.

192 {
193  ResetVariables();
194 
195  Run = evt.run();
196  SubRun = evt.subRun();
197  Event = evt.event();
198 
199  //GET INFORMATION ABOUT THE DETECTOR'S GEOMETRY.
200  // auto const* geo = lar::providerFrom<geo::Geometry>();
201 
202  //GET THE RECO HITS.
203  auto reco_hits = evt.getValidHandle<std::vector<recob::Hit> >(fHitLabel);
204 
205  NTotHit = reco_hits->size();
206 
207  for(int hit = 0; hit < NTotHit; ++hit)
208  {
209  recob::Hit const& ThisHit = reco_hits->at(hit);
210 
211  if(ThisHit.View() == geo::kU || ThisHit.View() == geo::kV) {
212  ++NIndHit;
213  } else {
214  ++NColHit;
215  }
216 
217  Hit_View.push_back(ThisHit.View());
218  Hit_Size.push_back(ThisHit.EndTick() - ThisHit.StartTick());
219  Hit_TPC .push_back(ThisHit.WireID().TPC);
220  int channel = ThisHit.Channel();
221  Hit_Chan.push_back(channel);
222  Hit_Time .push_back(ThisHit.PeakTime());
223  Hit_RMS .push_back(ThisHit.RMS());
224  Hit_SADC .push_back(ThisHit.SummedADC());
225  Hit_Int .push_back(ThisHit.Integral());
226  Hit_Peak .push_back(ThisHit.PeakAmplitude());
227  }
228 
229  fDataHitTree->Fill();
230 }
std::vector< int > Hit_Size
unsigned int event
Definition: DataStructs.h:636
unsigned int run
Definition: DataStructs.h:637
Planes which measure V.
Definition: geo_types.h:130
geo::WireID WireID() const
Definition: Hit.h:233
float RMS() const
RMS of the hit shape, in tick units.
Definition: Hit.h:220
std::vector< float > Hit_Int
void ResetVariables()
std::vector< float > Hit_SADC
float Integral() const
Integral under the calibrated signal waveform of the hit, in tick x ADC units.
Definition: Hit.h:224
geo::View_t View() const
View for the plane of the hit.
Definition: Hit.h:232
uint8_t channel
Definition: CRTFragment.hh:201
std::vector< int > Hit_TPC
float PeakAmplitude() const
The estimated amplitude of the hit at its peak, in ADC units.
Definition: Hit.h:221
std::string fHitLabel
Planes which measure U.
Definition: geo_types.h:129
std::vector< float > Hit_Peak
std::vector< float > Hit_Time
std::vector< int > Hit_Chan
raw::TDCtick_t StartTick() const
Initial tdc tick for hit.
Definition: Hit.h:216
Detector simulation of raw signals on wires.
std::vector< float > Hit_RMS
raw::TDCtick_t EndTick() const
Final tdc tick for hit.
Definition: Hit.h:217
float PeakTime() const
Time of the signal peak, in tick units.
Definition: Hit.h:218
float SummedADC() const
The sum of calibrated ADC counts of the hit (0. by default)
Definition: Hit.h:223
unsigned int subRun
Definition: DataStructs.h:638
2D representation of charge deposited in the TDC/wire plane
Definition: Hit.h:48
TCEvent evt
Definition: DataStructs.cxx:7
TPCID_t TPC
Index of the TPC within its cryostat.
Definition: geo_types.h:406
raw::ChannelID_t Channel() const
ID of the readout channel the hit was extracted from.
Definition: Hit.h:230
std::vector< int > Hit_View
TTree * fDataHitTree
void DataHit::beginJob ( )
overridevirtual

Reimplemented from art::EDAnalyzer.

Definition at line 165 of file DataHit_module.cc.

166 {
168 
169 
170  fDataHitTree = tfs->make<TTree>("DataHitTree","A tree of data hits");
171 
172  fDataHitTree->Branch("Run" , &Run , "Run/I" );
173  fDataHitTree->Branch("SubRun" , &SubRun , "SubRun/I" );
174  fDataHitTree->Branch("Event" , &Event , "Event/I" );
175  fDataHitTree->Branch("NTotHit" , &NTotHit , "NTotHit/I" );
176  fDataHitTree->Branch("NColHit" , &NColHit , "NColHit/I" );
177  fDataHitTree->Branch("NIndHit" , &NIndHit , "NIndHit/I" );
178 
179  fDataHitTree->Branch("Hit_View" , &Hit_View );
180  fDataHitTree->Branch("Hit_Size" , &Hit_Size );
181  fDataHitTree->Branch("Hit_TPC" , &Hit_TPC );
182  fDataHitTree->Branch("Hit_Chan" , &Hit_Chan );
183  fDataHitTree->Branch("Hit_Time" , &Hit_Time );
184  fDataHitTree->Branch("Hit_RMS" , &Hit_RMS );
185  fDataHitTree->Branch("Hit_SADC" , &Hit_SADC );
186  fDataHitTree->Branch("Hit_Int" , &Hit_Int );
187  fDataHitTree->Branch("Hit_Peak" , &Hit_Peak );
188 }
std::vector< int > Hit_Size
std::vector< float > Hit_Int
std::vector< float > Hit_SADC
std::vector< int > Hit_TPC
std::vector< float > Hit_Peak
std::vector< float > Hit_Time
std::vector< int > Hit_Chan
std::vector< float > Hit_RMS
std::vector< int > Hit_View
TTree * fDataHitTree
void DataHit::endJob ( )
overridevirtual

Reimplemented from art::EDAnalyzer.

Definition at line 232 of file DataHit_module.cc.

233 {
234 }
DataHit& DataHit::operator= ( DataHit const &  )
delete
DataHit& DataHit::operator= ( DataHit &&  )
delete
void DataHit::reconfigure ( fhicl::ParameterSet const &  p)

Definition at line 139 of file DataHit_module.cc.

140 {
141  fHitLabel = p.get<std::string>("HitLabel" );
142 }
std::string string
Definition: nybbler.cc:12
std::string fHitLabel
p
Definition: test.py:223
void DataHit::ResetVariables ( )
private

Definition at line 145 of file DataHit_module.cc.

146 {
147  Run = SubRun = Event = -1;
148 
149  NTotHit = 0;
150  NColHit = 0;
151  NIndHit = 0;
152 
153  Hit_View .clear();
154  Hit_Size .clear();
155  Hit_TPC .clear();
156  Hit_Chan .clear();
157  Hit_Time .clear();
158  Hit_RMS .clear();
159  Hit_SADC .clear();
160  Hit_Int .clear();
161  Hit_Peak .clear();
162 }
std::vector< int > Hit_Size
std::vector< float > Hit_Int
std::vector< float > Hit_SADC
std::vector< int > Hit_TPC
std::vector< float > Hit_Peak
std::vector< float > Hit_Time
std::vector< int > Hit_Chan
std::vector< float > Hit_RMS
std::vector< int > Hit_View

Member Data Documentation

int DataHit::Event
private

Definition at line 114 of file DataHit_module.cc.

TTree* DataHit::fDataHitTree
private

Definition at line 110 of file DataHit_module.cc.

std::string DataHit::fHitLabel
private

Definition at line 85 of file DataHit_module.cc.

art::ServiceHandle<geo::Geometry> DataHit::geo
private

Definition at line 130 of file DataHit_module.cc.

std::vector<int> DataHit::Hit_Chan
private

Definition at line 123 of file DataHit_module.cc.

std::vector<float> DataHit::Hit_Int
private

Definition at line 127 of file DataHit_module.cc.

std::vector<float> DataHit::Hit_Peak
private

Definition at line 128 of file DataHit_module.cc.

std::vector<float> DataHit::Hit_RMS
private

Definition at line 125 of file DataHit_module.cc.

std::vector<float> DataHit::Hit_SADC
private

Definition at line 126 of file DataHit_module.cc.

std::vector<int> DataHit::Hit_Size
private

Definition at line 121 of file DataHit_module.cc.

std::vector<float> DataHit::Hit_Time
private

Definition at line 124 of file DataHit_module.cc.

std::vector<int> DataHit::Hit_TPC
private

Definition at line 122 of file DataHit_module.cc.

std::vector<int> DataHit::Hit_View
private

Definition at line 120 of file DataHit_module.cc.

int DataHit::NColHit
private

Definition at line 117 of file DataHit_module.cc.

int DataHit::NIndHit
private

Definition at line 118 of file DataHit_module.cc.

int DataHit::NTotHit
private

Definition at line 116 of file DataHit_module.cc.

int DataHit::Run
private

Definition at line 112 of file DataHit_module.cc.

int DataHit::SubRun
private

Definition at line 113 of file DataHit_module.cc.


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