/************************************************************************** * Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. * * * * Author: The ALICE Off-line Project. * * Contributors are mentioned in the code where appropriate. * * * * Permission to use, copy, modify and distribute this software and its * * documentation strictly for non-commercial purposes is hereby granted * * without fee, provided that the above copyright notice appears in all * * copies and that both the copyright notice and this permission notice * * appear in the supporting documentation. The authors make no claims * * 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 #include /////////////////////////////////////////////////////////////////// // // // Implementation of the class used for analysis of SDD noise // // corrected for common mode // // Origin: F.Prino, Torino, prino@to.infn.it // // // /////////////////////////////////////////////////////////////////// ClassImp(AliITSOnlineSDDCMN) //______________________________________________________________________ AliITSOnlineSDDCMN::AliITSOnlineSDDCMN():AliITSOnlineSDD(),fNEvents(0),fMinCorrNoise(0.),fMaxCorrNoise(0.),fNSigmaNoise(0.) { // default constructor Reset(); SetMinNoise(); SetMaxNoise(); SetNSigmaNoise(); } //______________________________________________________________________ AliITSOnlineSDDCMN::AliITSOnlineSDDCMN(Int_t mod, Int_t sid):AliITSOnlineSDD(mod,sid),fNEvents(0),fMinCorrNoise(0.),fMaxCorrNoise(0.),fNSigmaNoise(0.) { // default constructor Reset(); SetMinNoise(); SetMaxNoise(); SetNSigmaNoise(); } //______________________________________________________________________ AliITSOnlineSDDCMN::~AliITSOnlineSDDCMN(){ // Destructor } //______________________________________________________________________ void AliITSOnlineSDDCMN::Reset(){ // fNEvents=0; for(Int_t i=0;ifMaxCorrNoise || GetAnodeCorrNoise(ian)fNSigmaNoise*CalcMeanNoise()) fGoodAnode[ian]=0; } } //______________________________________________________________________ void AliITSOnlineSDDCMN::AddEvent(TH2F* hrawd){ // fNEvents++; const Int_t nTimeBins=fLastGoodTB-fFirstGoodTB+1; 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=fFirstGoodTB;itb<=fLastGoodTB;itb++){ Float_t sumEven=0., sumOdd=0.; Int_t countEven=0, countOdd=0; for(Int_t ian=0;ianGetBinContent(itb+1,ian+1)-fBaseline[ian]; countEven++; } for(Int_t ian=1;ianGetBinContent(itb+1,ian+1)-fBaseline[ian]; countOdd++; } for(Int_t ian=0;ianGetBinContent(itb+1,ian+1)-fCMN[ian]*meanN; hcorrd->SetBinContent(itb+1,ian+1,cntCorr); } } for(Int_t ian=0;ianGetBinContent(itb+1,ian+1)-fBaseline[ian],2); } fSumCorrNoise[ian]+=TMath::Sqrt(sumQ/(Float_t)nTimeBins); } delete hcorrd; } //______________________________________________________________________ Float_t AliITSOnlineSDDCMN::CalcMeanNoise() const{ // Float_t meanns=0.; Int_t cnt=0; for(Int_t ian=0;ian0) meanns/=(Float_t)cnt; return meanns; } //______________________________________________________________________ void AliITSOnlineSDDCMN::WriteToASCII(){ // Char_t outfilnam[100]; sprintf(outfilnam,"SDDbase_step2_mod%03d_sid%d.data",fModuleId,fSide); FILE* outf=fopen(outfilnam,"w"); for(Int_t ian=0;iancd(); 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); for(Int_t ian=0;ian