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

Public Member Functions

 OpDetWFDump (fhicl::ParameterSet const &p)
 
 OpDetWFDump (OpDetWFDump const &)=delete
 
 OpDetWFDump (OpDetWFDump &&)=delete
 
OpDetWFDumpoperator= (OpDetWFDump const &)=delete
 
OpDetWFDumpoperator= (OpDetWFDump &&)=delete
 
void analyze (art::Event const &e) override
 
void beginJob () override
 
void endJob () override
 

Private Attributes

TFile * _f
 
TTree * _wftree
 
TTree * _hittree
 
std::vector< float > _wf
 
int _ch
 
double _tstart
 
double _tend
 
double _tpeak
 
double _amp
 
double _area
 

Detailed Description

Definition at line 32 of file OpDetWFDump_module.cc.

Constructor & Destructor Documentation

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

Definition at line 64 of file OpDetWFDump_module.cc.

65  : EDAnalyzer{p}, _wftree{nullptr} // ,
66  // More initializers here.
67 {
68  // Call appropriate consumes<>() for any products to be retrieved by this module.
69  _wftree = nullptr;
70 }
pdgs p
Definition: selectors.fcl:22
OpDetWFDump::OpDetWFDump ( OpDetWFDump const &  )
delete
OpDetWFDump::OpDetWFDump ( OpDetWFDump &&  )
delete

Member Function Documentation

void OpDetWFDump::analyze ( art::Event const &  e)
override

Definition at line 102 of file OpDetWFDump_module.cc.

103 {
104  auto const* ts = lar::providerFrom<detinfo::DetectorClocksService>();
105  // Implementation of required member function here.
106  art::Handle< std::vector< raw::OpDetWaveform > > hwf;
107  e.getByLabel("opdaq",hwf);
108 
109  if(!hwf.isValid()){
110  std::cout << "Invalid producer..." << std::endl;
111  }
112 
113  std::cout << "Number of photon channel: " <<hwf->size() << std::endl;
114  // unsigned int nChannels = pmtHandle->size();
115  auto geop = lar::providerFrom<geo::Geometry>();
116 
117  std::cout << geop->Ncryostats() << " cryostats" << std::endl;
118 
119  for(auto const& opwf : (*hwf)) {
120  std::cout << opwf.ChannelNumber() << " ... " << opwf.size() << std::endl;
121  _wf.resize(opwf.size());
122  //std::cout<<_wftree<<std::endl;
123  for(size_t i=0; i<_wf.size(); ++i) { _wf.at(i) = opwf.at(i); }
124  _ch=opwf.ChannelNumber();
125  _tstart=opwf.TimeStamp();
126  _wftree->Fill();
127  }
128 
129  std::cout << (*hwf)[0].TimeStamp() << " ... " << ts->TriggerTime() << " ... " << ts->BeamGateTime() << " ... " << ts->G4ToElecTime(0.) << std::endl;
130 
131  art::Handle< std::vector< recob::OpHit> > hhit;
132  e.getByLabel("opreco",hhit);
133 
134  if(!hhit.isValid())
135  std::cout << "aho" << std::endl;
136 
137  for(auto const& oph : (*hhit)) {
138  _ch=oph.OpChannel();
139  _tpeak = oph.PeakTime();
140  _amp = oph.Amplitude();
141  _area = oph.Area();
142  _hittree->Fill();
143  }
144 
145 }
do i e
BEGIN_PROLOG could also be cout
std::vector< float > _wf
void OpDetWFDump::beginJob ( )
override

Definition at line 72 of file OpDetWFDump_module.cc.

73 {
74  if(!_wftree) {
75  _f = TFile::Open("opdetwf.root","RECREATE");
76 
77  _wftree = new TTree("anatree","anatree");
78  //_wftree->Branch("wf","std::vector<float>",&_wf);
79  _wftree->Branch("wf",&_wf);
80  _wftree->Branch("ch",&_ch,"ch/I");
81  _wftree->Branch("tstart",&_tstart,"tstart/D");
82 
83  _hittree = new TTree("hittree","hittree");
84  _hittree->Branch("ch",&_ch,"ch/I");
85  _hittree->Branch("tpeak",&_tpeak,"tpeak/D");
86  _hittree->Branch("amp",&_amp,"amp/D");
87  _hittree->Branch("area",&_area,"area/D");
88  }
89  std::cout<<_wftree<<std::endl;
90 }
BEGIN_PROLOG could also be cout
std::vector< float > _wf
void OpDetWFDump::endJob ( )
override

Definition at line 92 of file OpDetWFDump_module.cc.

93 {
94  if(_wftree) {
95  _f->cd();
96  _wftree->Write();
97  _hittree->Write();
98  _f->Close();
99  }
100 }
OpDetWFDump& OpDetWFDump::operator= ( OpDetWFDump const &  )
delete
OpDetWFDump& OpDetWFDump::operator= ( OpDetWFDump &&  )
delete

Member Data Documentation

double OpDetWFDump::_amp
private

Definition at line 59 of file OpDetWFDump_module.cc.

double OpDetWFDump::_area
private

Definition at line 60 of file OpDetWFDump_module.cc.

int OpDetWFDump::_ch
private

Definition at line 55 of file OpDetWFDump_module.cc.

TFile* OpDetWFDump::_f
private

Definition at line 51 of file OpDetWFDump_module.cc.

TTree* OpDetWFDump::_hittree
private

Definition at line 53 of file OpDetWFDump_module.cc.

double OpDetWFDump::_tend
private

Definition at line 57 of file OpDetWFDump_module.cc.

double OpDetWFDump::_tpeak
private

Definition at line 58 of file OpDetWFDump_module.cc.

double OpDetWFDump::_tstart
private

Definition at line 56 of file OpDetWFDump_module.cc.

std::vector<float> OpDetWFDump::_wf
private

Definition at line 54 of file OpDetWFDump_module.cc.

TTree* OpDetWFDump::_wftree
private

Definition at line 52 of file OpDetWFDump_module.cc.


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