10 #include "StFeePedMaker.h"
12 #include "StMuDSTMaker/COMMON/StMuEvent.h"
13 #include "StMuDSTMaker/COMMON/StMuDst.h"
14 #include "StMuDSTMaker/COMMON/StMuDstMaker.h"
16 #include "StMuDSTMaker/EZTREE/EztEventHeader.h"
17 #include "StMuDSTMaker/EZTREE/EztEmcRawData.h"
35 StFeePedMaker::~StFeePedMaker(){
42 StFeePedMaker::saveHisto(TString fname){
43 TString outName=fname+
".hist.root";
44 TFile f( outName,
"recreate");
46 printf(
"%d histos are written to '%s' ...\n",HList->GetEntries(),outName.Data());
55 StFeePedMaker::Init(){
61 for(i=0;i<MaxTwCrates;i++) {
62 int crate=i+MinTwCrateID;
63 for (j=0;j<MaxTwCrateCh;j++){
64 char tt1[100], tt2[100];
65 sprintf(tt1,
"cr%d_ch%3.3d",crate,j);
66 sprintf(tt2,
"Pedestals for Crate %d and FEE ch %d",crate,j);
67 TH1F* h=
new TH1F(tt1,tt2,400,-0.5,395.5);
69 int k=MaxTwCrateCh*i+j;
74 printf(
"Initialized %d tower histos\n",MxTwFeeCh);
76 return StMaker::Init();
93 gMessMgr->Message(
"",
"D") <<
GetName()<<
"::Make() is called "<<endm;
98 gMessMgr->Message(
"",
"E") <<
GetName()<<
"::Make() no EztEventHeader, skip event "<<endm;
102 int token= header->getToken();
113 for(icr=0;icr<eETow->getNBlocks();icr++) {
114 if(eETow->isCrateVoid(icr))
continue;
115 if(eETow->purgeCrateOFF(icr))
continue;
117 eETow->tagHeadValid(icr,token, crID,lenCount,trigComm,errFlag);
118 UShort_t isSick=eETow->getCorruption(icr);
124 if(nOK!=MaxTwCrates)
return kStOK;
129 for(icr=0;icr<eETow->getNBlocks();icr++) {
130 if(eETow->isCrateVoid(icr))
continue;
132 const UShort_t*
data=eETow->data(icr);
133 for(i=0;i<eETow->sizeData(icr);i++) {
135 if(chan>=MaxTwCrateCh)
continue;
138 int k=icr*MaxTwCrateCh+chan;
140 assert(k>=0 && k<MxTwFeeCh);
152 StFeePedMaker::fitPed(TH1F *h,
int Xlow,
int Xhigh) {
154 if (h->GetEntries() < sumMin)
return -1;
157 float *y=h->GetArray();
164 if(ym>y[i])
continue;
169 if (sum < sumMin)
return -2;
171 float xm=h->GetBinCenter(j);
177 TF1* fitF =
new TF1(
"pedFun",
"gaus");
178 fitF->SetLineColor(kGreen);;
179 fitF->SetLineWidth(1);;
180 h->Fit(fitF,
"RQ+W",
"",x1,x2);
static EztEventHeader * eztHeader()
returns pointer to eztHeader
static EztEmcRawData * eztETow()
returns pointer to ETOW
virtual const char * GetName() const
special overload