2 #include <JANA/JApplication.h>
25 #include <TDirectory.h>
32 #include <JANA/JApplication.h>
33 #include <JANA/JFactory.h>
74 TDirectory *
main = gDirectory;
75 gDirectory->mkdir(
"FCAL_pedestals")->cd();
78 for (
int i = 0; i <
nChan; ++i) {
79 pedestal[i] =
new TH1I(Form(
"pedestal_%i",i),Form(
"Pedestal for Channel %i",i),500,90,120);
96 dynamic_cast<DApplication*
>(eventLoop->GetJApplication());
104 cerr <<
"No geometry accessbile." << endl;
105 return RESOURCE_UNAVAILABLE;
115 uint64_t eventnumber)
119 eventLoop->GetSingle(locTrigger);
126 vector< const DFCALGeometry* > geomVec;
127 eventLoop->Get( geomVec );
129 if( geomVec.size() != 1 ){
131 cerr <<
"No geometry accessbile." << endl;
132 return RESOURCE_UNAVAILABLE;
135 fcalGeom = geomVec[0];
137 vector< const DFCALDigiHit* > digiHits;
138 eventLoop->Get( digiHits );
142 japp->RootFillLock(
this);
144 for( vector< const DFCALDigiHit* >::const_iterator dHitItr = digiHits.begin();
145 dHitItr != digiHits.end(); ++dHitItr ){
150 if( !fcalGeom->isBlockActive( m_r, m_c ) )
continue;
151 m_chan = fcalGeom->channel( dHit.
row, dHit.
column );
154 if( m_pedestal > 0 ) {
159 japp->RootFillUnLock(
this);
JEventProcessor_FCALpedestals()
uint32_t Get_L1FrontPanelTriggerBits(void) const
jerror_t brun(jana::JEventLoop *eventLoop, int32_t runnumber)
Called everytime a new run number is detected.
bool GetFCALZ(double &z_fcal) const
z-location of front face of CCAL in cm
uint32_t pedestal
pedestal info used by FPGA (if any)
jerror_t evnt(jana::JEventLoop *eventLoop, uint64_t eventnumber)
Called every event.
DGeometry * GetDGeometry(unsigned int run_number)
uint32_t nsamples_pedestal
number of samples used in pedestal
static TH1I * pedestal[nChan]
jerror_t erun(void)
Called everytime run number changes, provided brun has been called.
jerror_t init(void)
Called once at program start.
jerror_t fini(void)
Called after last event of last event source has been processed.
~JEventProcessor_FCALpedestals()
int main(int argc, char *argv[])