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

Public Member Functions

 ProtoDUNE_opdet_eventdisplay (const fhicl::ParameterSet &)
 
virtual ~ProtoDUNE_opdet_eventdisplay ()
 
void beginJob ()
 
void analyze (const art::Event &)
 
 ProtoDUNE_opdet_eventdisplay (const fhicl::ParameterSet &)
 
virtual ~ProtoDUNE_opdet_eventdisplay ()
 
void beginJob ()
 
void analyze (const art::Event &)
 
- 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

std::string fOpFlashModuleLabel
 
std::string fOpHitModuleLabel
 
float fSampleFreq
 
float fTimeBegin
 
float fTimeEnd
 
float fYMin
 
float fYMax
 
float fZMin
 
float fZMax
 
int PosHistYRes
 
int PosHistZRes
 
Int_t fEventID
 
Int_t fFlashID
 
Int_t fHitID
 
Float_t fFlashTime
 
Int_t fOpChannel
 
Float_t fPeakTimeAbs
 
Float_t fPeakTime
 
Float_t fPE
 
Float_t fYOpCenter
 
Float_t fZOpCenter
 
Float_t fXOpCenter
 
std::vector< int > fFlashIDVector
 
std::vector< float > fYCenterVector
 
std::vector< float > fZCenterVector
 
std::vector< float > fYWidthVector
 
std::vector< float > fZWidthVector
 
std::vector< float > fFlashTimeVector
 
std::vector< float > fAbsTimeVector
 
std::vector< int > fFlashFrameVector
 
std::vector< boolfInBeamFrameVector
 
std::vector< int > fOnBeamTimeVector
 
std::vector< float > fTotalPEVector
 
std::vector< float > fPEsPerFlashPerChannelVector
 

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 65 of file ProtoDUNE_opdet_eventdisplay_module.cc.

Constructor & Destructor Documentation

opdet::ProtoDUNE_opdet_eventdisplay::ProtoDUNE_opdet_eventdisplay ( const fhicl::ParameterSet )
opdet::ProtoDUNE_opdet_eventdisplay::~ProtoDUNE_opdet_eventdisplay ( )
virtual

Definition at line 188 of file ProtoDUNE_opdet_eventdisplay_module.cc.

189  {}
opdet::ProtoDUNE_opdet_eventdisplay::ProtoDUNE_opdet_eventdisplay ( const fhicl::ParameterSet )
virtual opdet::ProtoDUNE_opdet_eventdisplay::~ProtoDUNE_opdet_eventdisplay ( )
virtual

Member Function Documentation

void opdet::ProtoDUNE_opdet_eventdisplay::analyze ( const art::Event evt)

Definition at line 196 of file ProtoDUNE_opdet_eventdisplay_module.cc.

197  {
198 
199  float displace[288]={0};
200 
201  for(int j=0;j<287;j++) displace[j]=j;
202  for(int j=0;j<284;j+=4){
203  displace[j]=-100;
204  displace[j+1]=-40;
205  displace[j+2]=5;
206  displace[j+3]=60;
207  if((j>=132 && j<=143) || (j>=264 && j<=275)){
208  displace[j]=-100;
209  displace[j+1]=-75;
210  displace[j+2]=-60;
211  displace[j+3]=-40;
212  displace[j+4]=-20;
213  displace[j+5]=-5;
214  displace[j+6]=5;
215  displace[j+7]=20;
216  displace[j+8]=40;
217  displace[j+9]=60;
218  displace[j+10]=75;
219  displace[j+11]=100;
220  j+=8;
221  }
222 
223  }
224 
225  Float_t binsz[] = {0,10, 29, 48, 66, 84, 102, 120, 138, 156, 174, 192, 211, 230, 240, 257, 278, 296, 314, 332, 350, 368, 386, 404, 422, 441, 460, 470, 489, 508, 526, 544, 562, 580, 598, 616, 634, 650, 671, 690, 700};
226  Int_t binnumz = sizeof(binsz)/sizeof(Float_t) - 1;
227 
228  Float_t binsy[]={-600,-540, -480, -420, -360, -300, -240, -180, -120, -60, 0, 60, 120, 180, 240, 300, 360, 420, 480, 540, 600};
229  Int_t binnumy = sizeof(binsy)/sizeof(Float_t) - 1;
230 
231 
232 
233  // Get flashes from event
234  auto FlashHandle = evt.getHandle< std::vector< recob::OpFlash > >(fOpFlashModuleLabel);
235 
236  // Get assosciations between flashes and hits
237  art::FindManyP< recob::OpHit > Assns(FlashHandle, evt, fOpFlashModuleLabel);
238 
239  // Create string for histogram name
240  char HistName[50];
241 
242  fFlashID = 0;
243 
244  // Access ART's TFileService, which will handle creating and writing
245  // histograms for us.
247 
248  //std::vector<TH1D*> FlashHist;
249  std::vector<TH2D*> DispHist;
250 
251  fEventID = evt.id().event();
252 
253  sprintf(HistName, "Event %d Disps", evt.id().event());
254 
256  //unsigned int NOpChannels = geom->NOpChannels();
257 
258  // For every OpFlash in the vector
259  for(unsigned int i = 0; i < FlashHandle->size(); ++i)
260  {
261 
262  // Get OpFlash
263  art::Ptr< recob::OpFlash > TheFlashPtr(FlashHandle, i);
264  recob::OpFlash TheFlash = *TheFlashPtr;
265 
266  fFlashTime = TheFlash.Time();
267  fFlashID = i; //++;
268 
269 
270  TH2D * ThisEventDisp = nullptr;
271  ThisEventDisp = tfs->make<TH2D>(HistName,"PE from OpHits in OpFlash;z ;DaS RaS (y)",
272  binnumz, binsz,
273  binnumy, binsy);
274 
275 
276  double xyz[3];
277  auto OpHitHandle = evt.getHandle< std::vector< recob::OpHit > >(fOpHitModuleLabel);
278 
279  for(size_t i=0; i!=OpHitHandle->size(); ++i)
280  {
281  fOpChannel = OpHitHandle->at(i).OpChannel();
282  geom->OpDetGeoFromOpChannel(fOpChannel).GetCenter(xyz);
283  fXOpCenter = xyz[0];
284  fYOpCenter = xyz[1];
285  fZOpCenter = xyz[2];
286  fPeakTimeAbs = OpHitHandle->at(i).PeakTimeAbs();
287  fPeakTime = OpHitHandle->at(i).PeakTime();
288  fPE = OpHitHandle->at(i).PE();
289  fHitID = i;
290  //fPerOpHitTree->Fill();
291  //ThisEventDisp->Fill(fZOpCenter, fYOpCenter,fPE);
292  if(fXOpCenter >0){
293  if(fOpChannel>=132 && fOpChannel<=143)
294  ThisEventDisp->Fill(fZOpCenter+displace[fOpChannel], fYOpCenter,fPE);
295  else{
296  ThisEventDisp->Fill(fZOpCenter+displace[fOpChannel], fYOpCenter,fPE);
297  ThisEventDisp->Fill(fZOpCenter+displace[fOpChannel]+18, fYOpCenter,fPE);
298  ThisEventDisp->Fill(fZOpCenter+displace[fOpChannel]+36, fYOpCenter,fPE);
299  }
300  }
301  else if(fXOpCenter<0){
302  if(fOpChannel>=264 && fOpChannel<=275)
303  ThisEventDisp->Fill(fZOpCenter+displace[fOpChannel], fYOpCenter-600,fPE);
304  else{
305  ThisEventDisp->Fill(fZOpCenter+displace[fOpChannel], fYOpCenter-600,fPE);
306  ThisEventDisp->Fill(fZOpCenter+displace[fOpChannel]+18, fYOpCenter-600,fPE);
307  ThisEventDisp->Fill(fZOpCenter+displace[fOpChannel]+38, fYOpCenter-600,fPE);
308  }
309  }
310  TLine *line = new TLine(0,0,600,0);
311  line->SetLineColor(kBlack);
312  line->Draw();
313  }
314 
315 
316 
317 
318 
319  }
320 
321 
322  }
Handle< PROD > getHandle(SelectorBase const &) const
Definition: DataViewImpl.h:382
double Time() const
Definition: OpFlash.h:106
void line(double t, double *p, double &x, double &y, double &z)
EventNumber_t event() const
Definition: EventID.h:116
EventID id() const
Definition: Event.cc:34
void opdet::ProtoDUNE_opdet_eventdisplay::analyze ( const art::Event )
void opdet::ProtoDUNE_opdet_eventdisplay::beginJob ( )
virtual

Reimplemented from art::EDAnalyzer.

void opdet::ProtoDUNE_opdet_eventdisplay::beginJob ( )
virtual

Reimplemented from art::EDAnalyzer.

Definition at line 192 of file ProtoDUNE_opdet_eventdisplay_module.cc.

193  {}

Member Data Documentation

std::vector< float > opdet::ProtoDUNE_opdet_eventdisplay::fAbsTimeVector
private

Definition at line 138 of file ProtoDUNE_opdet_eventdisplay_module.cc.

Int_t opdet::ProtoDUNE_opdet_eventdisplay::fEventID
private

Definition at line 102 of file ProtoDUNE_opdet_eventdisplay_module.cc.

std::vector< int > opdet::ProtoDUNE_opdet_eventdisplay::fFlashFrameVector
private

Definition at line 139 of file ProtoDUNE_opdet_eventdisplay_module.cc.

Int_t opdet::ProtoDUNE_opdet_eventdisplay::fFlashID
private

Definition at line 103 of file ProtoDUNE_opdet_eventdisplay_module.cc.

std::vector< int > opdet::ProtoDUNE_opdet_eventdisplay::fFlashIDVector
private

Definition at line 132 of file ProtoDUNE_opdet_eventdisplay_module.cc.

Float_t opdet::ProtoDUNE_opdet_eventdisplay::fFlashTime
private

Definition at line 105 of file ProtoDUNE_opdet_eventdisplay_module.cc.

std::vector< float > opdet::ProtoDUNE_opdet_eventdisplay::fFlashTimeVector
private

Definition at line 137 of file ProtoDUNE_opdet_eventdisplay_module.cc.

Int_t opdet::ProtoDUNE_opdet_eventdisplay::fHitID
private

Definition at line 104 of file ProtoDUNE_opdet_eventdisplay_module.cc.

std::vector< bool > opdet::ProtoDUNE_opdet_eventdisplay::fInBeamFrameVector
private

Definition at line 140 of file ProtoDUNE_opdet_eventdisplay_module.cc.

std::vector< int > opdet::ProtoDUNE_opdet_eventdisplay::fOnBeamTimeVector
private

Definition at line 141 of file ProtoDUNE_opdet_eventdisplay_module.cc.

Int_t opdet::ProtoDUNE_opdet_eventdisplay::fOpChannel
private

Definition at line 118 of file ProtoDUNE_opdet_eventdisplay_module.cc.

std::string opdet::ProtoDUNE_opdet_eventdisplay::fOpFlashModuleLabel
private

Definition at line 85 of file ProtoDUNE_opdet_eventdisplay_module.cc.

std::string opdet::ProtoDUNE_opdet_eventdisplay::fOpHitModuleLabel
private

Definition at line 86 of file ProtoDUNE_opdet_eventdisplay_module.cc.

Float_t opdet::ProtoDUNE_opdet_eventdisplay::fPE
private

Definition at line 125 of file ProtoDUNE_opdet_eventdisplay_module.cc.

Float_t opdet::ProtoDUNE_opdet_eventdisplay::fPeakTime
private

Definition at line 120 of file ProtoDUNE_opdet_eventdisplay_module.cc.

Float_t opdet::ProtoDUNE_opdet_eventdisplay::fPeakTimeAbs
private

Definition at line 119 of file ProtoDUNE_opdet_eventdisplay_module.cc.

std::vector< float > opdet::ProtoDUNE_opdet_eventdisplay::fPEsPerFlashPerChannelVector
private

Definition at line 144 of file ProtoDUNE_opdet_eventdisplay_module.cc.

float opdet::ProtoDUNE_opdet_eventdisplay::fSampleFreq
private

Definition at line 87 of file ProtoDUNE_opdet_eventdisplay_module.cc.

float opdet::ProtoDUNE_opdet_eventdisplay::fTimeBegin
private

Definition at line 88 of file ProtoDUNE_opdet_eventdisplay_module.cc.

float opdet::ProtoDUNE_opdet_eventdisplay::fTimeEnd
private

Definition at line 89 of file ProtoDUNE_opdet_eventdisplay_module.cc.

std::vector< float > opdet::ProtoDUNE_opdet_eventdisplay::fTotalPEVector
private

Definition at line 142 of file ProtoDUNE_opdet_eventdisplay_module.cc.

Float_t opdet::ProtoDUNE_opdet_eventdisplay::fXOpCenter
private

Definition at line 129 of file ProtoDUNE_opdet_eventdisplay_module.cc.

std::vector< float > opdet::ProtoDUNE_opdet_eventdisplay::fYCenterVector
private

Definition at line 133 of file ProtoDUNE_opdet_eventdisplay_module.cc.

float opdet::ProtoDUNE_opdet_eventdisplay::fYMax
private

Definition at line 91 of file ProtoDUNE_opdet_eventdisplay_module.cc.

float opdet::ProtoDUNE_opdet_eventdisplay::fYMin
private

Definition at line 91 of file ProtoDUNE_opdet_eventdisplay_module.cc.

Float_t opdet::ProtoDUNE_opdet_eventdisplay::fYOpCenter
private

Definition at line 127 of file ProtoDUNE_opdet_eventdisplay_module.cc.

std::vector< float > opdet::ProtoDUNE_opdet_eventdisplay::fYWidthVector
private

Definition at line 135 of file ProtoDUNE_opdet_eventdisplay_module.cc.

std::vector< float > opdet::ProtoDUNE_opdet_eventdisplay::fZCenterVector
private

Definition at line 134 of file ProtoDUNE_opdet_eventdisplay_module.cc.

float opdet::ProtoDUNE_opdet_eventdisplay::fZMax
private

Definition at line 91 of file ProtoDUNE_opdet_eventdisplay_module.cc.

float opdet::ProtoDUNE_opdet_eventdisplay::fZMin
private

Definition at line 91 of file ProtoDUNE_opdet_eventdisplay_module.cc.

Float_t opdet::ProtoDUNE_opdet_eventdisplay::fZOpCenter
private

Definition at line 128 of file ProtoDUNE_opdet_eventdisplay_module.cc.

std::vector< float > opdet::ProtoDUNE_opdet_eventdisplay::fZWidthVector
private

Definition at line 136 of file ProtoDUNE_opdet_eventdisplay_module.cc.

int opdet::ProtoDUNE_opdet_eventdisplay::PosHistYRes
private

Definition at line 93 of file ProtoDUNE_opdet_eventdisplay_module.cc.

int opdet::ProtoDUNE_opdet_eventdisplay::PosHistZRes
private

Definition at line 93 of file ProtoDUNE_opdet_eventdisplay_module.cc.


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