5 void calcRmsFluctuation(
const char* fileName)
8 gSystem->Load(
"St_base");
9 gSystem->Load(
"StChain");
10 gSystem->Load(
"StUtilities");
13 gSystem->Load(
"libStDb_Tables.so");
14 gSystem->Load(
"St_Tables.so");
15 gSystem->Load(
"StDbLib");
16 gSystem->Load(
"StDbBroker");
17 gSystem->Load(
"geometry");
18 gSystem->Load(
"St_db_Maker");
19 gSystem->Load(
"StDaqLib");
20 gSystem->Load(
"StDAQMaker");
21 gSystem->Load(
"StSvtClassLibrary");
22 gSystem->Load(
"StSvtDaqMaker");
23 gSystem->Load(
"StSvtDbMaker");
24 gSystem->Load(
"StSvtCalibMaker");
26 TFile *file =
new TFile(
"rms.root",
"NEW");
28 TH1F *histAll =
new TH1F(
"histAll",
"RMS fluctuation per anode",1000,0.,20.);
29 TH1F *hist =
new TH1F(
"hist",
"RMS fluctuation per anode",1000,0.,20.);
30 TH1F *hist2 =
new TH1F(
"hist2",
"RMS mean per anode",1000,0.,20.);
31 TH2F *hist2D =
new TH2F(
"hist2D",
"RMS fluctuation per anode vs RMS mean value",100,0.,20.,100,0.,20.);
48 svtDaqMk->SetSvtRMSPed();
57 svtDaqMk->GetSvtRMSPed();
70 float rms, rmsTotal=0, rmsSqTotal=0, rmsMean=0, rmsSqMean=0, rmsErr=0;
73 for (
int barrel = 1;barrel <= fSvtRms->getNumberOfBarrels();barrel++) {
74 for (
int ladder = 1;ladder <= fSvtRms->getNumberOfLadders(barrel);ladder++) {
75 for (
int wafer = 1;wafer <= fSvtRms->getNumberOfWafers(barrel);wafer++) {
76 for (
int hybrid = 1;hybrid <= fSvtRms->getNumberOfHybrids();hybrid++) {
79 index_hyb = fSvtRms->getHybridIndex(barrel, ladder, wafer, hybrid);
80 if (index_hyb < 0)
continue;
83 for (
int anode=1; anode<=240; anode++) {
85 rmsTotal=0; rmsSqTotal=0;
86 for (
int time=0; time<128; time++) {
87 rms = rms_temp->At(rms_temp->getPixelIndex(anode, time))/16;
88 rms_temp->AddAt(rms,rms_temp->getPixelIndex(anode, time));
90 rmsSqTotal += rms*rms;
93 rmsMean = rmsTotal/128;
94 rmsSqMean = rmsSqTotal/128;
95 rmsErr = sqrt(rmsSqMean - rmsMean*rmsMean);
99 hist2D->Fill(rmsMean,rmsErr);
102 rms = rms_temp->At(rms_temp->getPixelIndex(120,64));
103 cout <<
"index = " << index_hyb <<
", rms = " << rms << endl;
virtual TObject * GetObject() const
The depricated method (left here for the sake of the backward compatibility)