00001
00002
00003
00004
00005 #include <stdio.h>
00006 #include <TFile.h>
00007 #include <TH1.h>
00008 #include <TH2.h>
00009 #include <TH3.h>
00010 #include <TList.h>
00011 #include <TLine.h>
00012 #include <StMessMgr.h>
00013
00014 #include "StBarrelMonitorMaker.h"
00015
00016
00017 void StBarrelMonitorMaker::initHistos() {
00018
00019 memset(hTile,0,sizeof(hTile));
00020 initHistosTiles(kBTow);
00021 initHistosTiles(kBPrs);
00022
00023 initAuxBprsHistos();
00024
00025 LOG_INFO<<Form("initHistos done")<<endm;
00026 }
00027
00028
00029
00030 void StBarrelMonitorMaker::initAuxBprsHistos(){
00031
00032 char tt1[100], tt2[500];
00033
00034 if(par_calibPass & kPassPedSub){
00035 int icr;
00036 for(icr=0;icr<mxBprsCrate;icr++) {
00037 sprintf(tt1,"bprsPedResCr%d",icr);
00038 sprintf(tt2,"bprs pedResidua, crate=%d; rawADC-ped ",icr);
00039 hBprsA[icr]=new TH1F(tt1,tt2,200,-50,50);
00040 HList->Add( hBprsA[icr]);
00041 }
00042 }
00043
00044 hTonko0=new TH2D("bprsTnk0","entries per caps, all events; BPRS soft ID, capID",mxBtow,0.5,mxBtow+0.5,mxBcap,-0.5,mxBcap-0.5);
00045 hTonko1=new TH2D("bprsTnk1","rawAdc sum per cap , all events; BPRS soft ID, capID",mxBtow,0.5,mxBtow+0.5,mxBcap,-0.5,mxBcap-0.5);
00046 hTonko2=new TH2D("bprsTnk2","rawADc^2 sum per cap , all events; BPRS soft ID, capID",mxBtow,0.5,mxBtow+0.5,mxBcap,-0.5,mxBcap-0.5);
00047 HList->Add( hTonko0);
00048 HList->Add( hTonko1);
00049 HList->Add( hTonko2);
00050
00051 }
00052
00053
00054 TH1F *StBarrelMonitorMaker::addBprsEveHisto( int *cap){
00055
00056 char tt1[100], tt2[500];
00057 sprintf(tt1,"bprsRawAdc_eve%03d",nInpEve);
00058 sprintf(tt2,"bprs raw ADC, capsID:%d:%d:%d:%d: eve=%d; softID",cap[0],cap[1],cap[2],cap[3],nInpEve);
00059
00060 TH1F *h=new TH1F(tt1,tt2,mxBtow,0.5,mxBtow+0.5);
00061 HList->Add( h);
00062 return h;
00063 }
00064
00065
00066
00067 void StBarrelMonitorMaker::initHistosTiles(int ibp){
00068
00069 char tt1[100], tt2[500];
00070 LOG_INFO<<Form("initHistos=%s",cTile4[ibp])<<endm;
00071 assert(ibp>=0 && ibp<mxBTile);
00072
00073 int nb=200;
00074 float adc1=-50;
00075 if(!(par_calibPass & kPassPedSub)){
00076 adc1=0;
00077 if(ibp==kBPrs) adc1=100;
00078 }
00079
00080 float adc2=adc1+nb;
00081
00082 sprintf(tt1,"%s_c0",cTile4[ibp]);
00083
00084 sprintf(tt2,"%s pedestal residua ; %s softID; rawADC-ped",cTile4[ibp],cTile4[ibp]);
00085 if(!(par_calibPass & kPassPedSub) ) sprintf(tt2,"%s rawADC ; %s softID; rawADC",cTile4[ibp],cTile4[ibp]);
00086
00087 TH2F *h=new TH2F(tt1,tt2,mxBtow,0.5,mxBtow+0.5, nb,adc1,adc2);
00088 HList->Add( h);
00089 hTile[ibp]=h;
00090
00091
00092 if(ibp==kBPrs && par_bprsHisto==2) {
00093 sprintf(tt1,"bprs3D_c0");
00094 if(!(par_calibPass & kPassPedSub)) sprintf(tt2,"bprs rawADC 3D ; BPRS soft ID; rawADC; capID ");
00095 else
00096 sprintf(tt2,"bprs ADC 3D ; BPRS soft ID; rawADC-capPed; capID ");
00097 hBprs3D=new TH3F(tt1,tt2,mxBtow,0.5,mxBtow+0.5, nb,adc1,adc2,mxBcap,-0.5,mxBcap-0.5);
00098 HList->Add( hBprs3D);
00099 }
00100
00101
00102 }
00103
00104 #if 0
00105 Lx=h->GetListOfFunctions(); assert(Lx);
00106 ln=new TLine(par_isoMinT3x3adc,0,par_isoMinT3x3adc,100000);
00107 ln->SetLineColor(kRed); Lx->Add(ln);
00108 ln=new TLine(par_isoMaxT3x3adc,0,par_isoMinT3x3adc,100000);
00109 ln->SetLineColor(kRed); Lx->Add(ln);
00110 hC[6]=h;
00111
00112 #endif