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

#include <OpFlashAnaAlg.h>

Classes

struct  FlashAnaStruct
 
struct  HitAnaStruct
 

Public Member Functions

 OpFlashAnaAlg ()
 
void SetOpFlashTree (TTree *, bool makeOpDetPEHist=true)
 
void SetOpHitTree (TTree *)
 
void FillOpFlashes (const std::vector< recob::OpFlash > &)
 
void FillOpHits (const std::vector< recob::OpHit > &)
 

Private Member Functions

void FillOpFlashTree (const std::vector< recob::OpFlash > &)
 
void FillOpHitTree (const std::vector< recob::OpHit > &)
 

Private Attributes

FlashAnaStruct fOpFlashAnaStruct
 
bool fMakeOpDetPEHist
 
TTree * fOpFlashTree
 
HitAnaStruct fOpHitAnaStruct
 
TTree * fOpHitTree
 

Detailed Description

Definition at line 24 of file OpFlashAnaAlg.h.

Constructor & Destructor Documentation

opdet::OpFlashAnaAlg::OpFlashAnaAlg ( )
inline

Definition at line 28 of file OpFlashAnaAlg.h.

28 { fMakeOpDetPEHist=false; }

Member Function Documentation

void opdet::OpFlashAnaAlg::FillOpFlashes ( const std::vector< recob::OpFlash > &  flashVector)

Definition at line 29 of file OpFlashAnaAlg.cxx.

30 {
31  if(fOpFlashTree) FillOpFlashTree(flashVector);
32 }
void FillOpFlashTree(const std::vector< recob::OpFlash > &)
void opdet::OpFlashAnaAlg::FillOpFlashTree ( const std::vector< recob::OpFlash > &  flashVector)
private

Definition at line 39 of file OpFlashAnaAlg.cxx.

40 {
41  for(auto const& flash : flashVector){
42 
43  fOpFlashAnaStruct.FlashTime = flash.Time();
44  fOpFlashAnaStruct.FlashTimeWidth = flash.TimeWidth();
45  fOpFlashAnaStruct.FlashAbsTime = flash.AbsTime();
46  fOpFlashAnaStruct.FlashFrame = flash.Frame();
47  fOpFlashAnaStruct.FlashY = flash.YCenter();
48  fOpFlashAnaStruct.FlashYWidth = flash.YWidth();
49  fOpFlashAnaStruct.FlashZ = flash.ZCenter();
50  fOpFlashAnaStruct.FlashZWidth = flash.ZWidth();
51  fOpFlashAnaStruct.FlashInBeamFrame = flash.InBeamFrame();
52  fOpFlashAnaStruct.FlashOnBeamTime = flash.OnBeamTime();
53  fOpFlashAnaStruct.FlashFastToTotal = flash.FastToTotal();
54  fOpFlashAnaStruct.FlashTotalPE = flash.TotalPE();
55 
56  if(fMakeOpDetPEHist){
57  int n_opdets = flash.WireCenters().size();
58  fOpFlashAnaStruct.FlashOpDetPEHist->SetBins(n_opdets,-0.5,(float)n_opdets-0.5);
59  for(int i=0; i<n_opdets; i++)
60  fOpFlashAnaStruct.FlashOpDetPEHist->SetBinContent(i+1,flash.PE(i));
61  }
62 
63  fOpFlashTree->Fill();
64  }
65 }
FlashAnaStruct fOpFlashAnaStruct
Definition: OpFlashAnaAlg.h:60
void opdet::OpFlashAnaAlg::FillOpHits ( const std::vector< recob::OpHit > &  hitVector)

Definition at line 34 of file OpFlashAnaAlg.cxx.

35 {
36  if(fOpHitTree) FillOpHitTree(hitVector);
37 }
void FillOpHitTree(const std::vector< recob::OpHit > &)
void opdet::OpFlashAnaAlg::FillOpHitTree ( const std::vector< recob::OpHit > &  hitVector)
private

Definition at line 67 of file OpFlashAnaAlg.cxx.

68 {
69  for(auto const& hit : hitVector){
70 
71  fOpHitAnaStruct.HitPeakTime = hit.PeakTime();
72  fOpHitAnaStruct.HitPeakTimeAbs = hit.PeakTimeAbs();
73  fOpHitAnaStruct.HitWidth = hit.Width();
74  fOpHitAnaStruct.HitArea = hit.Area();
75  fOpHitAnaStruct.HitAmplitude = hit.Amplitude();
76  fOpHitAnaStruct.HitFastToTotal = hit.FastToTotal();
77  fOpHitAnaStruct.HitPE = hit.PE();
78  fOpHitAnaStruct.HitFrame = hit.Frame();
79  fOpHitAnaStruct.HitOpChannel = hit.OpChannel();
80 
81  fOpHitTree->Fill();
82  }
83 }
process_name hit
Definition: cheaterreco.fcl:51
HitAnaStruct fOpHitAnaStruct
Definition: OpFlashAnaAlg.h:83
void opdet::OpFlashAnaAlg::SetOpFlashTree ( TTree *  tree,
bool  makeOpDetPEHist = true 
)

Definition at line 5 of file OpFlashAnaAlg.cxx.

6 {
7  fOpFlashTree = tree;
8  fMakeOpDetPEHist = makeOpDetPEHist;
9 
10  fOpFlashTree->Branch(fOpFlashTree->GetName(),
12  fOpFlashAnaStruct.LeafList.c_str());
13  if(fMakeOpDetPEHist){
14  fOpFlashAnaStruct.FlashOpDetPEHist->SetName("hOpDetPEs");
15  fOpFlashAnaStruct.FlashOpDetPEHist->SetTitle("PEs per Optical Detector; OpDet Number; PE");
16  fOpFlashTree->Branch("flash_OpDetPEHist","TH1D",&(fOpFlashAnaStruct.FlashOpDetPEHist));
17  }
18 
19 }
FlashAnaStruct fOpFlashAnaStruct
Definition: OpFlashAnaAlg.h:60
void opdet::OpFlashAnaAlg::SetOpHitTree ( TTree *  tree)

Definition at line 21 of file OpFlashAnaAlg.cxx.

22 {
23  fOpHitTree = tree;
24  fOpHitTree->Branch(fOpHitTree->GetName(),
26  fOpHitAnaStruct.LeafList.c_str());
27 }
HitAnaStruct fOpHitAnaStruct
Definition: OpFlashAnaAlg.h:83

Member Data Documentation

bool opdet::OpFlashAnaAlg::fMakeOpDetPEHist
private

Definition at line 61 of file OpFlashAnaAlg.h.

FlashAnaStruct opdet::OpFlashAnaAlg::fOpFlashAnaStruct
private

Definition at line 60 of file OpFlashAnaAlg.h.

TTree* opdet::OpFlashAnaAlg::fOpFlashTree
private

Definition at line 63 of file OpFlashAnaAlg.h.

HitAnaStruct opdet::OpFlashAnaAlg::fOpHitAnaStruct
private

Definition at line 83 of file OpFlashAnaAlg.h.

TTree* opdet::OpFlashAnaAlg::fOpHitTree
private

Definition at line 85 of file OpFlashAnaAlg.h.


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