/************************************************************************** * 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 "AliITSOnlineSDDInjectors.h" #include #include #include /* $Id$ */ /////////////////////////////////////////////////////////////////// // // // Implementation of the class used for SDD injector analysis // // Origin: F.Prino, Torino, prino@to.infn.it // // // /////////////////////////////////////////////////////////////////// ClassImp(AliITSOnlineSDDInjectors) const Float_t AliITSOnlineSDDInjectors::fgkSaturation = 1008.; //______________________________________________________________________ AliITSOnlineSDDInjectors::AliITSOnlineSDDInjectors():AliITSOnlineSDD(),fHisto(),fTbZero(0.),fParam(),fPolOrder(0),fMinDriftVel(0.),fMaxDriftVel(0.),fThreshold(0.),fTimeDiffTB() { // default constructor SetMinDriftVel(); SetMaxDriftVel(); SetRangeLine1(); SetRangeLine2(); SetRangeLine3(); SetPositions(); SetPolOrder(); SetThreshold(); SetTimeDiffTB(); } //______________________________________________________________________ AliITSOnlineSDDInjectors::AliITSOnlineSDDInjectors(Int_t nddl, Int_t ncarlos, Int_t sid):AliITSOnlineSDD(nddl,ncarlos,sid),fHisto(),fTbZero(0.),fParam(),fPolOrder(0),fMinDriftVel(0.),fMaxDriftVel(0.),fThreshold(0.),fTimeDiffTB() { // standard constructor SetMinDriftVel(); SetMaxDriftVel(); SetRangeLine1(); SetRangeLine2(); SetRangeLine3(); SetPositions(); SetPolOrder(); SetThreshold(); SetTimeDiffTB(); } //______________________________________________________________________ AliITSOnlineSDDInjectors::~AliITSOnlineSDDInjectors(){ // Destructor if(fHisto) delete fHisto; if(fParam) delete [] fParam; } //______________________________________________________________________ void AliITSOnlineSDDInjectors::SetPositions(){ // Float_t kLinFromCenterUm[3]={31860.,17460.,660.}; Float_t kAnodeFromCenterUm=35085; for(Int_t i=0;i<3;i++){ fPosition[i]=kAnodeFromCenterUm-kLinFromCenterUm[i]; fPosition[i]/=10000.; // from microns to cm } } //______________________________________________________________________ void AliITSOnlineSDDInjectors::Reset(){ // for(Int_t i=0;i0){ g->SetPoint(ipt,GetAnodeNumber(i),fDriftVel[i]); g->SetPointError(ipt,0,fSigmaDriftVel[i]); ipt++; } } return g; } //______________________________________________________________________ void AliITSOnlineSDDInjectors::CalcTimeBinZero(){ // Float_t tzero=0.,intCont=0.; for(Int_t ian=0;ianGetBinContent(itb,ian+1); if(cont>fThreshold){ tzero+=cont*float(itb); intCont+=cont; } } } if(intCont>0) fTbZero=tzero/intCont; } //______________________________________________________________________ void AliITSOnlineSDDInjectors::FitDriftVelocityVsAnode(){ // fits the anode dependence of drift velocity with a polynomial const Int_t kNn=fPolOrder+1; Float_t **mat = new Float_t*[kNn]; for(Int_t i=0; i < kNn; i++) mat[i] = new Float_t[kNn]; Float_t *vect = new Float_t[kNn]; for(Int_t k1=0;k10) mat[k1][k2]+=TMath::Power(x,k1+k2)/TMath::Power(fSigmaDriftVel[n],2); } } } for(Int_t k1=0;k10) vect[k1]+=fDriftVel[n]*TMath::Power(x,k1)/TMath::Power(fSigmaDriftVel[n],2); } } Int_t *iPivot = new Int_t[kNn]; Int_t *indxR = new Int_t[kNn]; Int_t *indxC = new Int_t[kNn]; for(Int_t i=0;i=big){ big=TMath::Abs(mat[j][k]); iRow=j; iCol=k; } } } } } iPivot[iCol]++; Float_t aux; if(iRow!=iCol){ for(Int_t l=0;l1){ Float_t slope=(sumWEI*sumXY-sumY*sumX)/(sumWEI*sumXX-sumX*sumX); Float_t eslope=TMath::Sqrt(sumWEI/(sumWEI*sumXX-sumX*sumX)); if(slope!=0){ vel=1./slope*10000./25.;// micron/ns evel=eslope/slope/slope*10000./25.;// micron/ns } } if(npt==1){ Float_t slope=(sumY-tzero)/sumX; Float_t eslope=erry/sumX; if(slope!=0){ vel=1./slope*10000./25.;// micron/ns evel=eslope/slope/slope*10000./25.;// micron/ns } } if(vel>fMaxDriftVel||vel32) return ian; if(!fSide){ ian=iInjLine*8; if(iInjLine==32) ian--; }else{ ian=iInjLine*8-1; if(iInjLine==0) ian=0; } return ian; } //______________________________________________________________________ Int_t AliITSOnlineSDDInjectors::GetLineNumberFromAnode(Int_t nAnode) const{ // Int_t iLine=-1; if(!fSide){ if(nAnode%8==0) iLine=nAnode/8; if(nAnode==255) iLine=32; }else{ if(nAnode%8==7) iLine=1+nAnode/8; if(nAnode==0) iLine=0; } if(nAnode>=256) iLine=-1; return iLine; } //______________________________________________________________________ Int_t AliITSOnlineSDDInjectors::GetAnodeStatus(Int_t nAnode) const{ // Int_t iii=GetLineNumberFromAnode(nAnode); Int_t istatus=0; if(iii>=0){ for(Int_t ninj=0;ninj<3;ninj++) istatus+=fGoodInj[iii][ninj]<GetBinContent(jjj,ian+1); Float_t c2=fHisto->GetBinContent(jjj+1,ian+1); Float_t c3=fHisto->GetBinContent(jjj+2,ian+1); if(c1>fThreshold && c2>fThreshold && c3>fThreshold){ fGoodInj[iii][ninj]=1; break; } } // for(Int_t jjj=fTbMin[ninj];jjjGetBinContent(jjj,ian+1); // if(c1>=fgkSaturation){ // fGoodInj[iii][ninj]=0; // break; // } // } } } } //______________________________________________________________________ void AliITSOnlineSDDInjectors::FindCentroids(){ // for(Int_t iii=0;iiiGetBinContent(jjj,ian+1); if(cont>maxcont){ maxcont=cont; ilmax=jjj; } } Float_t intCont=0; Int_t jjj=ilmax; while(1){ Float_t cont=fHisto->GetBinContent(jjj,ian+1); if(contGetBinContent(jjj,ian+1); if(cont0){ fCentroid[iii][ninj]/=intCont; fRMSCentroid[iii][ninj]=TMath::Sqrt(fRMSCentroid[iii][ninj]/intCont-fCentroid[iii][ninj]*fCentroid[iii][ninj]); } else{ fCentroid[iii][ninj]=0.; fRMSCentroid[iii][ninj]=0.; fGoodInj[iii][ninj]=0; } if(fRMSCentroid[iii][ninj]==0) fGoodInj[iii][ninj]=0; } } } //______________________________________________________________________ void AliITSOnlineSDDInjectors::PrintInjMap(){ // for(Int_t iii=0;iii