X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=ITS%2FAliITSOnlineSDDCMN.cxx;h=982843df153ce77b9b6a7b1216c424d61317d883;hb=1e6316d80d67319641fce8159daf330d6c0af244;hp=34927692ed5a5372b9cb32669c4fbf54c78d86c7;hpb=3083967f0982cb9634a39ee6046c42d515fd3f2f;p=u%2Fmrichter%2FAliRoot.git diff --git a/ITS/AliITSOnlineSDDCMN.cxx b/ITS/AliITSOnlineSDDCMN.cxx index 34927692ed5..982843df153 100644 --- a/ITS/AliITSOnlineSDDCMN.cxx +++ b/ITS/AliITSOnlineSDDCMN.cxx @@ -30,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(); @@ -39,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(); @@ -53,7 +53,7 @@ AliITSOnlineSDDCMN::~AliITSOnlineSDDCMN(){ } //______________________________________________________________________ void AliITSOnlineSDDCMN::Reset(){ - // + // Reset counters fNEvents=0; for(Int_t i=0;ifMaxCorrNoise || GetAnodeCorrNoise(ian)GetNbinsX(); +TH2F* AliITSOnlineSDDCMN::GetCleanEvent(TH2F* hrawd) const { + // Fills an histogram with counts corrected for common mode noise + 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){ + // analyzes one event and adds its ontribution to the various counters + + 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() const{ - // + // compute average noise + Float_t meanns=0.; Int_t cnt=0; for(Int_t ian=0;ianSetBinContent(ian+1,GetAnodeBaseline(ian)); + } + return h; +} +//______________________________________________________________________ +TH1F* AliITSOnlineSDDCMN::GetRawNoiseAnodeHisto() const { + // produce histogram with raw noise vs. anode number + 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 { + // produce histogram with corrected noise vs. anode number + 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 { + // produce histogram with coefficients for common mode noise subtraction + 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 { + // produce histogram with status bit of each anode + 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 { + // produce histogram with baseline distribution + 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 { + // produce histogram with raw noise distribution + 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 { + // produce histogram with corrected noise distribution + 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){ - // + // writes output into a root file if(fil==0){ AliWarning("Invalid pointer to ROOT file"); return kFALSE; } - Char_t hisnam[20]; + TString hisnam; fil->cd(); - sprintf(hisnam,"hgood%03ds%d",fModuleId,fSide); - TH1F hgood(hisnam,"",256,-0.5,255.5); - sprintf(hisnam,"hbase%03ds%d",fModuleId,fSide); - TH1F hbase(hisnam,"",256,-0.5,255.5); - sprintf(hisnam,"hnois%03ds%d",fModuleId,fSide); - TH1F hnois(hisnam,"",256,-0.5,255.5); - sprintf(hisnam,"hcmn%03ds%d",fModuleId,fSide); - TH1F hcmn(hisnam,"",256,-0.5,255.5); - sprintf(hisnam,"hcorn%03ds%d",fModuleId,fSide); - TH1F hcorn(hisnam,"",256,-0.5,255.5); + 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