/************************************************************************** * 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 "AliITSOnlineSDDTP.h" #include "AliLog.h" #include #include /////////////////////////////////////////////////////////////////// // // // Implemetation of the class SDD Test Pulse analysis // // Origin: F.Prino, Torino, prino@to.infn.it // // // /////////////////////////////////////////////////////////////////// ClassImp(AliITSOnlineSDDTP) //______________________________________________________________________ AliITSOnlineSDDTP::AliITSOnlineSDDTP():AliITSOnlineSDD(),fNEvents(0),fDAC(0.),fNSigmaGain(0.) { // default constructor Reset(); SetNSigmaGain(); } //______________________________________________________________________ AliITSOnlineSDDTP::AliITSOnlineSDDTP(Int_t mod, Int_t sid, Float_t xDAC):AliITSOnlineSDD(mod,sid),fNEvents(0),fDAC(xDAC),fNSigmaGain(0.) { // standard constructor Reset(); SetNSigmaGain(); } //______________________________________________________________________ AliITSOnlineSDDTP::~AliITSOnlineSDDTP(){ // Destructor } //______________________________________________________________________ void AliITSOnlineSDDTP::Reset(){ // fNEvents=0; for(Int_t i=0;iGetNbinsX(); for(Int_t ian=0;ianGetBinContent(itb+1,ian+1); if(cnt>auxmax){ auxmax=cnt; auxtb=itb; } } fSumTPPeak[ian]+=auxmax-fBaseline[ian]; fTPPos[ian]+=auxtb; } } //______________________________________________________________________ void AliITSOnlineSDDTP::ReadBaselines(){ // assume baselines and good anodes are taken from previous run Char_t basfilnam[100]; sprintf(basfilnam,"SDDbase_step2_mod%03d_sid%d.data",fModuleId,fSide); FILE* basf=fopen(basfilnam,"r"); if(basf==0){ AliWarning("Baselinefile not present, Set all baselines to 50\n"); for(Int_t ian=0;ianhilim) fGoodAnode[ian]=0; } } //______________________________________________________________________ void AliITSOnlineSDDTP::StatGain(Float_t &mean, Float_t &rms){ // Float_t sum=0.,sumq=0.; Int_t cnt=0; for(Int_t ian=0;ian0){ mean=sum/(Float_t)cnt; rms=TMath::Sqrt(sumq/(Float_t)cnt-mean*mean); }else{ mean=0.; rms=0.; } return; } //______________________________________________________________________ void AliITSOnlineSDDTP::WriteToFXS(){ // Char_t basfilnam[100]; sprintf(basfilnam,"SDDbase_step2_mod%03d_sid%d.data",fModuleId,fSide); FILE* basf=fopen(basfilnam,"r"); if(basf==0){ AliWarning("Baseline file not present, launch baseline analysis first\n"); return; } Int_t n,ok; Float_t base,rms,cmn,corrnoi; Float_t noise[fgkNAnodes],cmncoef[fgkNAnodes],corrnoise[fgkNAnodes]; for(Int_t ian=0;ian