X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=ITS%2FAliITSOnlineSDDCMN.cxx;h=f31cce3c8c7fdc379e7cb216862e443b2bad70ca;hb=6753619d78e8b3631036f0f6386f358732f02004;hp=a87f71dc3594e53a49e09490ae07f9c5e3fb870f;hpb=7f34756596656aaab6aa1b243b61ec4f2894b390;p=u%2Fmrichter%2FAliRoot.git diff --git a/ITS/AliITSOnlineSDDCMN.cxx b/ITS/AliITSOnlineSDDCMN.cxx index a87f71dc359..f31cce3c8c7 100644 --- a/ITS/AliITSOnlineSDDCMN.cxx +++ b/ITS/AliITSOnlineSDDCMN.cxx @@ -12,6 +12,7 @@ * about the suitability of this software for any purpose. It is * * provided "as is" without express or implied warranty. * **************************************************************************/ +#include #include "AliITSOnlineSDDCMN.h" #include "AliLog.h" #include @@ -29,7 +30,7 @@ ClassImp(AliITSOnlineSDDCMN) //______________________________________________________________________ - AliITSOnlineSDDCMN::AliITSOnlineSDDCMN():AliITSOnlineSDD(),fNEvents(0),fMinCorrNoise(0.),fMaxCorrNoise(0.),fNSigmaNoise(0.) + AliITSOnlineSDDCMN::AliITSOnlineSDDCMN():AliITSOnlineSDD(),fNEvents(0),fLowThreshold(0),fHighThreshold(0),fMinCorrNoise(0.),fMaxCorrNoise(0.),fNSigmaNoise(0.) { // default constructor Reset(); @@ -38,7 +39,7 @@ ClassImp(AliITSOnlineSDDCMN) SetNSigmaNoise(); } //______________________________________________________________________ - AliITSOnlineSDDCMN::AliITSOnlineSDDCMN(Int_t mod, Int_t sid):AliITSOnlineSDD(mod,sid),fNEvents(0),fMinCorrNoise(0.),fMaxCorrNoise(0.),fNSigmaNoise(0.) + AliITSOnlineSDDCMN::AliITSOnlineSDDCMN(Int_t nddl, Int_t ncarlos, Int_t sid):AliITSOnlineSDD(nddl,ncarlos,sid),fNEvents(0),fLowThreshold(0),fHighThreshold(0),fMinCorrNoise(0.),fMaxCorrNoise(0.),fNSigmaNoise(0.) { // default constructor Reset(); @@ -52,10 +53,12 @@ AliITSOnlineSDDCMN::~AliITSOnlineSDDCMN(){ } //______________________________________________________________________ void AliITSOnlineSDDCMN::Reset(){ + // fNEvents=0; for(Int_t i=0;ifMaxCorrNoise || GetAnodeCorrNoise(ian)GetNbinsX(); TH2F* hcorrd=new TH2F("hcorrd","",hrawd->GetNbinsX(),hrawd->GetXaxis()->GetXmin(),hrawd->GetXaxis()->GetXmax(),hrawd->GetNbinsY(),hrawd->GetYaxis()->GetXmin(),hrawd->GetYaxis()->GetXmax()); - for(Int_t itb=0;itbSetBinContent(itb+1,ian+1,cntCorr); } } + return hcorrd; +} +//______________________________________________________________________ +void AliITSOnlineSDDCMN::AddEvent(TH2F* hrawd){ + // + fNEvents++; + TH2F* hcorrd=GetCleanEvent(hrawd); for(Int_t ian=0;ianGetBinContent(itb+1,ian+1)-fBaseline[ian],2); + Int_t cnt=0; + for(Int_t itb=fFirstGoodTB;itb<=fLastGoodTB;itb++){ + Float_t cntdiff=hcorrd->GetBinContent(itb+1,ian+1)-fBaseline[ian]; + sumQ+=cntdiff*cntdiff; + cnt++; } - fSumCorrNoise[ian]+=TMath::Sqrt(sumQ/tbmax); + fSumCorrNoise[ian]+=TMath::Sqrt(sumQ/(Float_t)cnt); } delete hcorrd; } //______________________________________________________________________ -Float_t AliITSOnlineSDDCMN::CalcMeanNoise(){ +Float_t AliITSOnlineSDDCMN::CalcMeanNoise() const{ // Float_t meanns=0.; Int_t cnt=0; @@ -148,13 +166,137 @@ Float_t AliITSOnlineSDDCMN::CalcMeanNoise(){ return meanns; } //______________________________________________________________________ -void AliITSOnlineSDDCMN::WriteToFXS(){ +void AliITSOnlineSDDCMN::WriteToASCII(){ // - Char_t outfilnam[100]; - sprintf(outfilnam,"SDDbase_step2_mod%03d_sid%d.data",fModuleId,fSide); - FILE* outf=fopen(outfilnam,"w"); + TString outfilnam; + outfilnam.Form("SDDbase_step2_ddl%02dc%02d_sid%d.data",fDDL,fCarlos,fSide); + FILE* outf=fopen(outfilnam.Data(),"w"); + fprintf(outf,"%d\n",fHighThreshold); + fprintf(outf,"%d\n",fLowThreshold); for(Int_t ian=0;ianSetBinContent(ian+1,GetAnodeBaseline(ian)); + } + return h; +} +//______________________________________________________________________ +TH1F* AliITSOnlineSDDCMN::GetRawNoiseAnodeHisto() const { + // + TString hisnam; + hisnam.Form("hnois%02dc%02ds%d",fDDL,fCarlos,fSide); + TH1F* h=new TH1F(hisnam.Data(),"",256,-0.5,255.5); + for(Int_t ian=0;ianSetBinContent(ian+1,GetAnodeRawNoise(ian)); + } + return h; +} +//______________________________________________________________________ +TH1F* AliITSOnlineSDDCMN::GetCorrNoiseAnodeHisto() const { + // + TString hisnam; + hisnam.Form("hcorn%02dc%02ds%d",fDDL,fCarlos,fSide); + TH1F* h=new TH1F(hisnam.Data(),"",256,-0.5,255.5); + for(Int_t ian=0;ianSetBinContent(ian+1,GetAnodeCorrNoise(ian)); + } + return h; +} +//______________________________________________________________________ +TH1F* AliITSOnlineSDDCMN::GetCMNCoefAnodeHisto() const { +// + TString hisnam; + hisnam.Form("hcmn%02dc%02ds%d",fDDL,fCarlos,fSide); + TH1F* h=new TH1F(hisnam.Data(),"",256,-0.5,255.5); + for(Int_t ian=0;ianSetBinContent(ian+1,GetAnodeCommonMode(ian)); + } + return h; +} +//______________________________________________________________________ +TH1F* AliITSOnlineSDDCMN::GetStatusAnodeHisto() const { +// + TString hisnam; + hisnam.Form("hgood%02dc%02ds%d",fDDL,fCarlos,fSide); + TH1F* h=new TH1F(hisnam.Data(),"",256,-0.5,255.5); + for(Int_t ian=0;ianSetBinContent(ian+1,float(IsAnodeGood(ian))); + } + return h; +} +//______________________________________________________________________ +TH1F* AliITSOnlineSDDCMN::GetBaselineHisto() const { + // + TString hisnam; + hisnam.Form("hdbd%02dc%02ds%d",fDDL,fCarlos,fSide); + TH1F* h=new TH1F(hisnam.Data(),"",100,0.,150.); + for(Int_t ian=0;ianFill(GetAnodeBaseline(ian)); + } + return h; +} +//______________________________________________________________________ +TH1F* AliITSOnlineSDDCMN::GetRawNoiseHisto() const { + // + TString hisnam; + hisnam.Form("hdnd%02dc%02ds%d",fDDL,fCarlos,fSide); + TH1F* h=new TH1F(hisnam.Data(),"",100,0.,8.); + for(Int_t ian=0;ianFill(GetAnodeRawNoise(ian)); + } + return h; +} +//______________________________________________________________________ +TH1F* AliITSOnlineSDDCMN::GetCorrNoiseHisto() const { + // + TString hisnam; + hisnam.Form("hdcd%02dc%02ds%d",fDDL,fCarlos,fSide); + TH1F* h=new TH1F(hisnam.Data(),"",100,0.,8.); + for(Int_t ian=0;ianFill(GetAnodeCorrNoise(ian)); + } + return h; +} +//______________________________________________________________________ +Bool_t AliITSOnlineSDDCMN::WriteToROOT(TFile *fil){ + // + if(fil==0){ + AliWarning("Invalid pointer to ROOT file"); + return kFALSE; + } + TString hisnam; + fil->cd(); + hisnam.Form("hgood%02dc%02ds%d",fDDL,fCarlos,fSide); + TH1F hgood(hisnam.Data(),"",256,-0.5,255.5); + hisnam.Form("hbase%02dc%02ds%d",fDDL,fCarlos,fSide); + TH1F hbase(hisnam.Data(),"",256,-0.5,255.5); + hisnam.Form("hnois%02dc%02ds%d",fDDL,fCarlos,fSide); + TH1F hnois(hisnam.Data(),"",256,-0.5,255.5); + hisnam.Form("hcmn%02dc%02ds%d",fDDL,fCarlos,fSide); + TH1F hcmn(hisnam.Data(),"",256,-0.5,255.5); + hisnam.Form("hcorn%02dc%02ds%d",fDDL,fCarlos,fSide); + TH1F hcorn(hisnam.Data(),"",256,-0.5,255.5); + for(Int_t ian=0;ian