- //
- // NOISE STUDY Fourier transform
- //
- TGraph * graph;
- Bool_t random = (gRandom->Rndm()<0.0003);
- if (((*fDebugStreamer)<<"SignalN").GetSize()<kMaxDebugSize)
- if (max-median>kMin || rms06>1.*fParam->GetZeroSup() || random){
- graph =new TGraph(nchannels, dtime, dsignal);
- if (rms06>1.*fParam->GetZeroSup() || random){
- //Double_t *input, Double_t threshold, Bool_t locMax, Double_t *freq, Double_t *re, Double_t *im, Double_t *mag, Double_t *phi);
- Float_t * input = &(dsignal[fRecoParam->GetFirstBin()]);
- Float_t freq[2000], re[2000], im[2000], mag[2000], phi[2000];
- Int_t npoints = TransformFFT(input, -1,kFALSE, freq, re, im, mag, phi);
- TGraph *graphMag0 = new TGraph(npoints, freq, mag);
- TGraph *graphPhi0 = new TGraph(npoints, freq, phi);
- npoints = TransformFFT(input, 0.5,kTRUE, freq, re, im, mag, phi);
- TGraph *graphMag1 = new TGraph(npoints, freq, mag);
- TGraph *graphPhi1 = new TGraph(npoints, freq, phi);
-
- (*fDebugStreamer)<<"SignalN"<< //noise pads - or random sample of pads
- "TimeStamp="<<fTimeStamp<<
- "EventType="<<fEventType<<
- "Sector="<<uid[0]<<
- "Row="<<uid[1]<<
- "Pad="<<uid[2]<<
- "Graph.="<<graph<<
- "Max="<<max<<
- "MaxPos="<<maxPos<<
- //
- "Median="<<median<<
- "Mean="<<mean<<
- "RMS="<<rms<<
- "Mean06="<<mean06<<
- "RMS06="<<rms06<<
- "Mean09="<<mean09<<
- "RMS09="<<rms09<<
- // FFT part
- "Mag0.="<<graphMag0<<
- "Mag1.="<<graphMag1<<
- "Phi0.="<<graphPhi0<<
- "Phi1.="<<graphPhi1<<
- "\n";
- delete graphMag0;
- delete graphMag1;
- delete graphPhi0;
- delete graphPhi1;
- }
- //
- // Big signals dumping
- //
-
- if (max-median>kMin &&maxPos>AliTPCReconstructor::GetRecoParam()->GetFirstBin())
- (*fDebugStreamer)<<"SignalB"<< // pads with signal
- "TimeStamp="<<fTimeStamp<<
- "EventType="<<fEventType<<
- "Sector="<<uid[0]<<
- "Row="<<uid[1]<<
- "Pad="<<uid[2]<<
- "Graph="<<graph<<
- "Max="<<max<<
- "MaxPos="<<maxPos<<
- //
- "Median="<<median<<
- "Mean="<<mean<<
- "RMS="<<rms<<
- "Mean06="<<mean06<<
- "RMS06="<<rms06<<
- "Mean09="<<mean09<<
- "RMS09="<<rms09<<
- "\n";
- delete graph;
- }
-
- //
- //
- // Central Electrode signal analysis
- //
- Float_t ceQmax =0, ceQsum=0, ceTime=0;
- Float_t cemean = mean06, cerms=rms06 ;
- Int_t cemaxpos= 0;
- Float_t ceThreshold=5.*cerms;
- Float_t ceSumThreshold=8.*cerms;
- const Int_t kCemin=5; // range for the analysis of the ce signal +- channels from the peak
- const Int_t kCemax=5;
- for (Int_t i=nchannels-2; i>nchannels/2; i--){
- if ( (dsignal[i]-mean06)>ceThreshold && dsignal[i]>=dsignal[i+1] && dsignal[i]>=dsignal[i-1] ){
- cemaxpos=i;
- break;
- }
- }
- if (cemaxpos!=0){
- ceQmax = 0;
- Int_t cemaxpos2=0;
- for (Int_t i=cemaxpos-20; i<cemaxpos+5; i++){
- if (i<0 || i>nchannels-1) continue;
- Double_t val=dsignal[i]- cemean;
- if (val>ceQmax){
- cemaxpos2=i;
- ceQmax = val;
- }
- }
- cemaxpos = cemaxpos2;
-
- for (Int_t i=cemaxpos-kCemin; i<cemaxpos+kCemax; i++){
- if (i>0 && i<nchannels&&dsignal[i]- cemean>0){
- Double_t val=dsignal[i]- cemean;
- ceTime+=val*dtime[i];
- ceQsum+=val;
- if (val>ceQmax) ceQmax=val;
- }
- }
- if (ceQmax&&ceQsum>ceSumThreshold) {
- ceTime/=ceQsum;
- (*fDebugStreamer)<<"Signalce"<<
- "TimeStamp="<<fTimeStamp<<
- "EventType="<<fEventType<<
- "Sector="<<uid[0]<<
- "Row="<<uid[1]<<
- "Pad="<<uid[2]<<
- "Max="<<ceQmax<<
- "Qsum="<<ceQsum<<
- "Time="<<ceTime<<
- "RMS06="<<rms06<<
- //
- "\n";
- }
- }
- // end of ce signal analysis
- //
-
- //
- // Gating grid signal analysis
- //
- Double_t ggQmax =0, ggQsum=0, ggTime=0;
- Double_t ggmean = mean06, ggrms=rms06 ;
- Int_t ggmaxpos= 0;
- Double_t ggThreshold=5.*ggrms;
- Double_t ggSumThreshold=8.*ggrms;
-
- for (Int_t i=1; i<nchannels/4; i++){
- if ( (dsignal[i]-mean06)>ggThreshold && dsignal[i]>=dsignal[i+1] && dsignal[i]>=dsignal[i-1] &&
- (dsignal[i]+dsignal[i+1]+dsignal[i-1]-3*mean06)>ggSumThreshold){
- ggmaxpos=i;
- if (dsignal[i-1]>dsignal[i+1]) ggmaxpos=i-1;
- break;
- }
- }
- if (ggmaxpos!=0){
- for (Int_t i=ggmaxpos-1; i<ggmaxpos+3; i++){
- if (i>0 && i<nchannels && dsignal[i]-ggmean>0){
- Double_t val=dsignal[i]- ggmean;
- ggTime+=val*dtime[i];
- ggQsum+=val;
- if (val>ggQmax) ggQmax=val;
- }
- }
- if (ggQmax&&ggQsum>ggSumThreshold) {
- ggTime/=ggQsum;
- (*fDebugStreamer)<<"Signalgg"<<
- "TimeStamp="<<fTimeStamp<<
- "EventType="<<fEventType<<
- "Sector="<<uid[0]<<
- "Row="<<uid[1]<<
- "Pad="<<uid[2]<<
- "Max="<<ggQmax<<
- "Qsum="<<ggQsum<<
- "Time="<<ggTime<<
- "RMS06="<<rms06<<
- //
- "\n";
- }