StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StBarrelMonitor_histo.cxx
1 // *-- Author : Jan Balewski
2 //
3 // $Id: StBarrelMonitor_histo.cxx,v 1.2 2010/04/15 19:13:30 mattheww Exp $
4 
5 #include <stdio.h>
6 #include <TFile.h>
7 #include <TH1.h>
8 #include <TH2.h>
9 #include <TH3.h>
10 #include <TList.h>
11 #include <TLine.h>
12 #include <StMessMgr.h>
13 
14 #include "StBarrelMonitorMaker.h"
15 //________________________________________________
16 //________________________________________________
17 void StBarrelMonitorMaker::initHistos() {
18 
19  memset(hTile,0,sizeof(hTile));
20  initHistosTiles(kBTow); //int ibp
21  initHistosTiles(kBPrs); //int ibp
22 
23  initAuxBprsHistos();
24 
25  LOG_INFO<<Form("initHistos done")<<endm;
26 }
27 
28 //________________________________________________
29 //________________________________________________
30 void StBarrelMonitorMaker::initAuxBprsHistos(){
31 
32  char tt1[100], tt2[500];
33 
34  if(par_calibPass & kPassPedSub){
35  int icr;
36  for(icr=0;icr<mxBprsCrate;icr++) {
37  sprintf(tt1,"bprsPedResCr%d",icr);
38  sprintf(tt2,"bprs pedResidua, crate=%d; rawADC-ped ",icr);
39  hBprsA[icr]=new TH1F(tt1,tt2,200,-50,50);
40  HList->Add( hBprsA[icr]);
41  }
42  }
43 
44  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);
45  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);
46  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);
47  HList->Add( hTonko0);
48  HList->Add( hTonko1);
49  HList->Add( hTonko2);
50 
51 }
52 //________________________________________________
53 //________________________________________________
54 TH1F *StBarrelMonitorMaker::addBprsEveHisto( int *cap){
55 
56  char tt1[100], tt2[500];
57  sprintf(tt1,"bprsRawAdc_eve%03d",nInpEve);
58  sprintf(tt2,"bprs raw ADC, capsID:%d:%d:%d:%d: eve=%d; softID",cap[0],cap[1],cap[2],cap[3],nInpEve);
59  // printf("SAVE=%s=\n",tt2);
60  TH1F *h=new TH1F(tt1,tt2,mxBtow,0.5,mxBtow+0.5);
61  HList->Add( h);
62  return h;
63 }
64 
65 //________________________________________________
66 //________________________________________________
67 void StBarrelMonitorMaker::initHistosTiles(int ibp){
68 
69  char tt1[100], tt2[500];
70  LOG_INFO<<Form("initHistos=%s",cTile4[ibp])<<endm;
71  assert(ibp>=0 && ibp<mxBTile);
72 
73  int nb=200;
74  float adc1=-50;
75  if(!(par_calibPass & kPassPedSub)){
76  adc1=0;
77  if(ibp==kBPrs) adc1=100;
78  }
79 
80  float adc2=adc1+nb;
81 
82  sprintf(tt1,"%s_c0",cTile4[ibp]);
83 
84  sprintf(tt2,"%s pedestal residua ; %s softID; rawADC-ped",cTile4[ibp],cTile4[ibp]);
85  if(!(par_calibPass & kPassPedSub) ) sprintf(tt2,"%s rawADC ; %s softID; rawADC",cTile4[ibp],cTile4[ibp]);
86 
87  TH2F *h=new TH2F(tt1,tt2,mxBtow,0.5,mxBtow+0.5, nb,adc1,adc2);
88  HList->Add( h);
89  hTile[ibp]=h;
90 
91  // init cap dependent histo for bprs, one set only
92  if(ibp==kBPrs && par_bprsHisto==2) {
93  sprintf(tt1,"bprs3D_c0");
94  if(!(par_calibPass & kPassPedSub)) sprintf(tt2,"bprs rawADC 3D ; BPRS soft ID; rawADC; capID ");
95  else
96  sprintf(tt2,"bprs ADC 3D ; BPRS soft ID; rawADC-capPed; capID ");
97  hBprs3D=new TH3F(tt1,tt2,mxBtow,0.5,mxBtow+0.5, nb,adc1,adc2,mxBcap,-0.5,mxBcap-0.5);
98  HList->Add( hBprs3D);
99  }
100 
101 
102 }
103 
104 #if 0
105  Lx=h->GetListOfFunctions(); assert(Lx);
106  ln=new TLine(par_isoMinT3x3adc,0,par_isoMinT3x3adc,100000);
107  ln->SetLineColor(kRed); Lx->Add(ln);
108  ln=new TLine(par_isoMaxT3x3adc,0,par_isoMinT3x3adc,100000);
109  ln->SetLineColor(kRed); Lx->Add(ln);
110  hC[6]=h;
111 
112 #endif