+ //
+ if (uid[0]<roc->GetNSectors()
+ && uid[1]< roc->GetNRows(uid[0]) &&
+ uid[2] <roc->GetNPads(uid[0], uid[1])){
+ TObjArray * sectorArray = (TObjArray*)fAmplitudeHisto->UncheckedAt(uid[0]);
+ if (!sectorArray){
+ Int_t npads =roc->GetNChannels(uid[0]);
+ sectorArray = new TObjArray(npads);
+ fAmplitudeHisto->AddAt(sectorArray, uid[0]);
+ }
+ Int_t position = uid[2]+roc->GetRowIndexes(uid[0])[uid[1]];
+ TH1F * histo = (TH1F*)sectorArray->UncheckedAt(position);
+ if (!histo){
+ char hname[100];
+ sprintf(hname,"Amp_%d_%d_%d",uid[0],uid[1],uid[2]);
+ TFile * backup = gFile;
+ fDebugStreamer->GetFile()->cd();
+ histo = new TH1F(hname, hname, 100, 5,100);
+ //histo->SetDirectory(0); // histogram not connected to directory -(File)
+ sectorArray->AddAt(histo, position);
+ if (backup) backup->cd();
+ }
+ for (Int_t i=0; i<nchannels; i++){
+ histo->Fill(signal[i]);
+ }
+ }
+ //
+ //
+ //
+ Float_t kMin =fRecoParam->GetDumpAmplitudeMin(); // minimal signal to be dumped
+ Float_t *dsignal = new Float_t[nchannels];
+ Float_t *dtime = new Float_t[nchannels];
+ for (Int_t i=0; i<nchannels; i++){
+ dtime[i] = i;
+ dsignal[i] = signal[i];
+ }
+ //
+ // Digital noise
+ //
+ // if (max-median>30.*TMath::Max(1.,Double_t(rms06)) && (((*fDebugStreamer)<<"SignalDN").GetSize()<kMaxDebugSize)){
+// //
+// //
+// TGraph * graph =new TGraph(nchannels, dtime, dsignal);
+// //
+// //
+// // jumps left - right
+// Int_t njumps0=0;
+// Double_t deltaT0[2000];
+// Double_t deltaA0[2000];
+// Int_t lastJump0 = fRecoParam->GetFirstBin();
+// Int_t njumps1=0;
+// Double_t deltaT1[2000];
+// Double_t deltaA1[2000];
+// Int_t lastJump1 = fRecoParam->GetFirstBin();
+// Int_t njumps2=0;
+// Double_t deltaT2[2000];
+// Double_t deltaA2[2000];
+// Int_t lastJump2 = fRecoParam->GetFirstBin();
+
+// for (Int_t itime=fRecoParam->GetFirstBin()+1; itime<fRecoParam->GetLastBin()-1; itime++){
+// if (TMath::Abs(dsignal[itime]-dsignal[itime-1])>30.*TMath::Max(1.,Double_t(rms06)) &&
+// TMath::Abs(dsignal[itime]-dsignal[itime+1])>30.*TMath::Max(1.,Double_t(rms06)) &&
+// (dsignal[itime-1]-median<5.*rms06) &&
+// (dsignal[itime+1]-median<5.*rms06)
+// ){
+// deltaA0[njumps0] = dsignal[itime]-dsignal[itime-1];
+// deltaT0[njumps0] = itime-lastJump0;
+// lastJump0 = itime;
+// njumps0++;
+// }
+// if (TMath::Abs(dsignal[itime]-dsignal[itime-1])>30.*TMath::Max(1.,Double_t(rms06)) &&
+// (dsignal[itime-1]-median<5.*rms06)
+// ) {
+// deltaA1[njumps1] = dsignal[itime]-dsignal[itime-1];
+// deltaT1[njumps1] = itime-lastJump1;
+// lastJump1 = itime;
+// njumps1++;
+// }
+// if (TMath::Abs(dsignal[itime]-dsignal[itime+1])>30.*TMath::Max(1.,Double_t(rms06)) &&
+// (dsignal[itime+1]-median<5.*rms06)
+// ) {
+// deltaA2[njumps2] = dsignal[itime]-dsignal[itime+1];
+// deltaT2[njumps2] = itime-lastJump2;
+// lastJump2 = itime;
+// njumps2++;
+// }
+// }
+// //
+// if (njumps0>0 || njumps1>0 || njumps2>0){
+// TGraph *graphDN0 = new TGraph(njumps0, deltaT0, deltaA0);
+// TGraph *graphDN1 = new TGraph(njumps1, deltaT1, deltaA1);
+// TGraph *graphDN2 = new TGraph(njumps2, deltaT2, deltaA2);
+// (*fDebugStreamer)<<"SignalDN"<< //digital - 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<<
+// "Graph.="<<graph<<
+// "P0GraphDN0.="<<graphDN0<<
+// "P1GraphDN1.="<<graphDN1<<
+// "P2GraphDN2.="<<graphDN2<<
+// //
+// "Median="<<median<<
+// "Mean="<<mean<<
+// "RMS="<<rms<<
+// "Mean06="<<mean06<<
+// "RMS06="<<rms06<<
+// "Mean09="<<mean09<<
+// "RMS09="<<rms09<<
+// "\n";
+// delete graphDN0;
+// delete graphDN1;
+// delete graphDN2;
+// }
+// delete graph;
+// }
+
+ //
+ // 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;
+ }