18 #include <JANA/JApplication.h>
19 #include <JANA/JFactory.h>
50 japp->RootWriteLock();
52 m_tree =
new TTree(
"fcalBlockHits",
"FCAL Block Hits" );
54 m_tree->Branch(
"nHits", &m_nHits,
"nHits/I" );
55 m_tree->Branch(
"chan", m_chan,
"chan[nHits]/I" );
56 m_tree->Branch(
"x", m_x,
"x[nHits]/F" );
57 m_tree->Branch(
"y", m_y,
"y[nHits]/F" );
58 m_tree->Branch(
"E", m_E,
"E[nHits]/F" );
59 m_tree->Branch(
"t", m_t,
"t[nHits]/F" );
60 m_tree->Branch(
"integ", m_integ,
"integ[nHits]/F" );
61 m_tree->Branch(
"ped", m_ped,
"ped[nHits]/F" );
62 m_tree->Branch(
"peak", m_peak,
"peak[nHits]/F" );
64 m_tree->Branch(
"run", &m_run,
"run/I" );
65 m_tree->Branch(
"event", &m_event,
"event/L" );
66 m_tree->Branch(
"eTot", &m_eTot,
"eTot/F" );
93 vector< const DFCALHit* > hits;
96 if( hits.size() > kMaxHits )
return NOERROR;
98 vector<const DFCALGeometry*> fcalGeomVect;
99 loop->Get( fcalGeomVect );
100 if (fcalGeomVect.size() < 1)
101 return OBJECT_NOT_AVAILABLE;
104 japp->RootFillLock(
this);
106 m_event = eventnumber;
111 for( vector< const DFCALHit* >::const_iterator hit = hits.begin();
115 vector< const DFCALDigiHit* > digiHits;
116 (**hit).Get( digiHits );
117 if( digiHits.size() != 1 ) std::cout <<
"ERROR: wrong size!! " << std::endl;
121 m_chan[m_nHits] = fcalGeom.
channel( (**hit).row, (**hit).column );
122 m_x[m_nHits] = (**hit).x;
123 m_y[m_nHits] = (**hit).y;
124 m_E[m_nHits] = (**hit).E;
125 m_t[m_nHits] = (**hit).t;
130 m_peak[m_nHits] = dHit.
pulse_peak - m_ped[m_nHits];
139 japp->RootFillUnLock(
this);
161 japp->RootWriteLock();
jerror_t brun(jana::JEventLoop *eventLoop, int32_t runnumber)
Called everytime a new run number is detected.
uint32_t pulse_peak
maximum sample in pulse
uint32_t nsamples_integral
number of samples used in integral
~JEventProcessor_FCALLEDTree()
jerror_t evnt(jana::JEventLoop *eventLoop, uint64_t eventnumber)
Called every event.
JEventProcessor_FCALLEDTree()
uint32_t pedestal
pedestal info used by FPGA (if any)
jerror_t erun(void)
Called everytime run number changes, provided brun has been called.
jerror_t init(void)
Called once at program start.
uint32_t pulse_integral
identified pulse integral as returned by FPGA algorithm
uint32_t nsamples_pedestal
number of samples used in pedestal
int channel(int row, int column) const
jerror_t fini(void)
Called after last event of last event source has been processed.