8 #include <TDirectoryFile.h>
23 #include <JANA/JApplication.h>
24 #include <JANA/JFactory.h>
71 vector<const Df250PulseData*> df250dats;
72 vector<const Df250PulseIntegral*> df250pis;
73 vector<const Df125PulseIntegral*> df125pis;
78 japp->RootWriteLock();
80 for(
unsigned int i=0; i<df250dats.size(); i++){
81 TH2D *
h = GetHist(df250dats[i]);
83 if(h) h->Fill(df250dats[i]->
pedestal/df250dats[i]->nsamples_pedestal, (
double)df250dats[i]->channel);
86 for(
unsigned int i=0; i<df250pis.size(); i++){
87 TH2D *
h = GetHist(df250pis[i]);
88 if(h) h->Fill(df250pis[i]->
pedestal, (
double)df250pis[i]->channel);
91 for(
unsigned int i=0; i<df125pis.size(); i++){
92 TH2D *
h = GetHist(df125pis[i]);
93 if(h) h->Fill(df125pis[i]->
pedestal, (
double)df125pis[i]->channel);
130 map<csc_t, TH2D*>::iterator iter = all_hists.find(csc);
131 if(iter != all_hists.end()) h= iter->second;
136 TDirectory *save_dir = gDirectory;
139 char rocdirname[256];
141 TDirectory *rocdir = (TDirectory*)gDirectory->FindObject(rocdirname);
142 if(!rocdir) rocdir =
new TDirectoryFile(rocdirname, rocdirname);
152 double xmin = -100.0;
153 double xmax = +100.0;
179 sprintf(title,
"Pedestals for %s roc=%d slot=%d", mod_name.c_str(), hit->
rocid, hit->
slot);
180 h =
new TH2D(hname, title, Nbins, xmin, xmax, Nchan, -0.5, (
double)Nchan-0.5);
181 h->SetXTitle(
"measured pedestal (scaled to total samples)");
jerror_t brun(jana::JEventLoop *eventLoop, int32_t runnumber)
Called everytime a new run number is detected.
jerror_t evnt(jana::JEventLoop *eventLoop, uint64_t eventnumber)
Called every event.
sprintf(text,"Post KinFit Cut")
~JEventProcessor_pedestals()
jerror_t erun(void)
Called everytime run number changes, provided brun has been called.
JEventProcessor_pedestals()
This class holds the Crate, Slot, Channel address for a digitized value from the DAQ system...
TH2D * GetHist(const DDAQAddress *hit)
string GetName(void) const
jerror_t init(void)
Called once at program start.
static TH1I * pedestal[nChan]
jerror_t fini(void)
Called after last event of last event source has been processed.