//______________________________________________________________________
void AliITSOnlineSDDTP::ReadBaselines(){
// assume baselines and good anodes are taken from previous run
- Char_t basfilnam[100];
- sprintf(basfilnam,"SDDbase_step2_ddl%02dc%02d_sid%d.data",fDDL,fCarlos,fSide);
- FILE* basf=fopen(basfilnam,"r");
+ TString basfilnam;
+ basfilnam.Form("SDDbase_step2_ddl%02dc%02d_sid%d.data",fDDL,fCarlos,fSide);
+ FILE* basf=fopen(basfilnam.Data(),"r");
if(basf==0){
AliWarning(Form("Baseline file not present (ddl %d carlos %d side %d, Set all baselines to 20",fDDL,fCarlos,fSide));
for(Int_t ian=0;ian<fgkNAnodes;ian++){
for(Int_t ian=0;ian<fgkNAnodes;ian++){
if(!fGoodAnode[ian]) continue;
if(fNEvents[ian]==0) continue;
- sum+=GetChannelGain(ian);
- sumq+=TMath::Power(GetChannelGain(ian),2);
+ Float_t chgain=GetChannelGain(ian);
+ sum+=chgain;
+ sumq+=chgain*chgain;
cnt++;
}
if(cnt>0){
mean=sum/(Float_t)cnt;
- rms=TMath::Sqrt(sumq/(Float_t)cnt-mean*mean);
+ Float_t variance=sumq/(Float_t)cnt-mean*mean;
+ if(variance>0.) rms=TMath::Sqrt(variance);
+ else rms = 0;
}else{
mean=0.;
rms=0.;
//______________________________________________________________________
void AliITSOnlineSDDTP::WriteToASCII(){
//
- Char_t outfilnam[100];
- sprintf(outfilnam,"SDDbase_ddl%02dc%02d_sid%d.data",fDDL,fCarlos,fSide);
- FILE* outf=fopen(outfilnam,"w");
+ TString outfilnam;
+ outfilnam.Form("SDDbase_ddl%02dc%02d_sid%d.data",fDDL,fCarlos,fSide);
+ FILE* outf=fopen(outfilnam.Data(),"w");
fprintf(outf,"%d %d %d\n",fCarlos,fSide,IsModuleGood());
fprintf(outf,"%d\n",fHighThreshold);
fprintf(outf,"%d\n",fLowThreshold);
fclose(outf);
}
//______________________________________________________________________
+TH1F* AliITSOnlineSDDTP::GetBaselineAnodeHisto() const {
+ //
+ TString hisnam;
+ hisnam.Form("hbase%02dc%02ds%d",fDDL,fCarlos,fSide);
+ TH1F* h=new TH1F(hisnam.Data(),"",256,-0.5,255.5);
+ for(Int_t ian=0;ian<fgkNAnodes;ian++){
+ h->SetBinContent(ian+1,GetAnodeBaseline(ian));
+ }
+ return h;
+}
+//______________________________________________________________________
+TH1F* AliITSOnlineSDDTP::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;ian<fgkNAnodes;ian++){
+ h->SetBinContent(ian+1,GetAnodeRawNoise(ian));
+ }
+ return h;
+}
+//______________________________________________________________________
+TH1F* AliITSOnlineSDDTP::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;ian<fgkNAnodes;ian++){
+ h->SetBinContent(ian+1,GetAnodeCorrNoise(ian));
+ }
+ return h;
+}
+//______________________________________________________________________
+TH1F* AliITSOnlineSDDTP::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;ian<fgkNAnodes;ian++){
+ h->SetBinContent(ian+1,GetAnodeCommonMode(ian));
+ }
+ return h;
+}
+//______________________________________________________________________
+TH1F* AliITSOnlineSDDTP::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;ian<fgkNAnodes;ian++){
+ h->SetBinContent(ian+1,float(IsAnodeGood(ian)));
+ }
+ return h;
+}
+//______________________________________________________________________
+TH1F* AliITSOnlineSDDTP::GetGainAnodeHisto() const {
+//
+ TString hisnam;
+ hisnam.Form("hgain%02dc%02ds%d",fDDL,fCarlos,fSide);
+ TH1F* h=new TH1F(hisnam.Data(),"",256,-0.5,255.5);
+ for(Int_t ian=0;ian<fgkNAnodes;ian++){
+ h->SetBinContent(ian+1,GetChannelGain(ian));
+ }
+ return h;
+}
+//______________________________________________________________________
Bool_t AliITSOnlineSDDTP::WriteToROOT(TFile *fil){
//
if(fil==0){
AliWarning("Invalid pointer to ROOT file");
return kFALSE;
}
- Char_t hisnam[20];
+ TString hisnam;
fil->cd();
- sprintf(hisnam,"hgood%02dc%02ds%d",fDDL,fCarlos,fSide);
- TH1F hgood(hisnam,"",256,-0.5,255.5);
- sprintf(hisnam,"hbase%02dc%02ds%d",fDDL,fCarlos,fSide);
- TH1F hbase(hisnam,"",256,-0.5,255.5);
- sprintf(hisnam,"hnois%02dc%02ds%d",fDDL,fCarlos,fSide);
- TH1F hnois(hisnam,"",256,-0.5,255.5);
- sprintf(hisnam,"hcmn%02dc%02ds%d",fDDL,fCarlos,fSide);
- TH1F hcmn(hisnam,"",256,-0.5,255.5);
- sprintf(hisnam,"hcorn%02dc%02ds%d",fDDL,fCarlos,fSide);
- TH1F hcorn(hisnam,"",256,-0.5,255.5);
- sprintf(hisnam,"hgain%02dc%02ds%d",fDDL,fCarlos,fSide);
- TH1F hgain(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);
+ hisnam.Form("hgain%02dc%02ds%d",fDDL,fCarlos,fSide);
+ TH1F hgain(hisnam.Data(),"",256,-0.5,255.5);
+ hisnam.Form("htptb%02dc%02ds%d",fDDL,fCarlos,fSide);
+ TH1F htptb(hisnam.Data(),"",256,-0.5,255.5);
for(Int_t ian=0;ian<fgkNAnodes;ian++){
hgood.SetBinContent(ian+1,float(IsAnodeGood(ian)));
hbase.SetBinContent(ian+1,GetAnodeBaseline(ian));
hcmn.SetBinContent(ian+1,GetAnodeCommonMode(ian));
hcorn.SetBinContent(ian+1,GetAnodeCorrNoise(ian));
hgain.SetBinContent(ian+1,GetChannelGain(ian));
+ htptb.SetBinContent(ian+1,GetTimeBinTPPeak(ian));
}
hgood.Write();
hbase.Write();
hcmn.Write();
hcorn.Write();
hgain.Write();
+ htptb.Write();
return kTRUE;
}