49 if (plane != NULL )plane->
print();
61 Double_t xStart[2] = {0, 0};
62 Double_t tStart[2] = {0, 0};
67 for(UInt_t ndet=0;ndet<2;ndet++) {
70 if ( m == NULL )
continue;
74 Double_t meanNoise = 0, qNoise = 0;
76 TH2F* hNoise =
new TH2F(
"hNoise",
"",511,0,511,4096,-300,3796);
77 TH2F* hNoiseTot =
new TH2F(
"hNoiseTot",
"",511,0,511,1000,-3000,1e5);
78 TH2F* hSignal =
new TH2F(
"hSignal",
"",511,0,511,4096,-300,3796);
79 Double_t xNoiseMin = 511, xNoiseMax = 1, qNoiseMax = 1;
83 for(Int_t i=0;i<
NADC;i++){
87 TArrayD* arr =
new TArrayD(
NCHAN);
88 for(Int_t j=0;j<
NCHAN;j++){
104 if(qTot>0) nbinsStart++;
107 Double_t truncSig = 0, truncMean = 0;
112 hSigma2[ndet]->Fill(truncSig/truncMean);
115 Double_t qNoiseT = 0;
119 hSigma[ndet]->Fill(truncSig);
120 for(Int_t j=0;j<
NCHAN;j++){
123 if( q < 0 )
continue;
124 hSigmaVsMean[ndet]->Fill(truncSig,TMath::Abs(q-truncMean)/truncSig);
127 hSigmaVsMeanCut[ndet]->Fill(truncSig,TMath::Abs(q-truncMean)/truncSig);
133 if(xNoiseMin>i) xNoiseMin = i;
134 if(xNoiseMax<i) xNoiseMax = i;
135 if(qNoiseMax<q2) qNoiseMax = q2;
143 hNoiseTot->Fill(i,qNoiseT);
150 xStart[ndet] /= qStart;
151 tStart[ndet] /= qStart;
156 TProfile* pNoise = hNoise->ProfileX(Form(
"pNoise%d",ndet));
158 Double_t mean = 0, qTot = 0;
159 Int_t binmax = pNoise->GetMaximumBin();
160 for(Int_t bin = binmax-2; bin<binmax+3; bin++){
161 Double_t q = pNoise->GetBinContent(bin);
167 Double_t qSignal = 0;
169 for(Int_t i = 0; i<511;i++){
170 Double_t qSigTot = 0, qSigMax = 0;
171 for(Int_t j = 0; j<4096; j++){
172 hNoiseShape[ndet]->Fill(i-mean/qTot,hNoise->GetYaxis()->GetBinCenter(j+1),hNoise->GetBinContent(i+1,j+1));
173 hNoiseShapeTot[ndet]->Fill(i-mean/qTot,hNoiseTot->GetYaxis()->GetBinCenter(j+1),hNoiseTot->GetBinContent(i+1,j+1));
174 hNoiseShapeNorm[ndet]->Fill(i-mean/qTot,hNoise->GetYaxis()->GetBinCenter(j+1)/TMath::Abs(qTot),hNoise->GetBinContent(i+1,j+1));
176 Double_t qSig = hNoise->GetYaxis()->GetBinCenter(j+1);
177 qSigTot += qSig*hSignal->GetBinContent(i+1,j+1);
178 if(qSig>qSigMax && hSignal->GetBinContent(i+1,j+1)>0) qSigMax = qSig;
182 if(TMath::Abs(i-mean/qTot+13)<10) qSignal += qSigTot;
193 for(Int_t j=0;j<
NCHAN;j++){
195 for(Int_t i=0;i<
NADC;i++){
197 if(q < 0 && nPix == 0)
continue;
201 Info(
"process",
"Remove small cluster on channel %d, t = %d",j,i);
202 for(Int_t iTmp = i - nPix; iTmp<i; iTmp++)
213 reco->
SetTstart(0.5*(tStart[0]+tStart[1]));
216 std::cout <<
"Event " <<
nEvents <<
" done" << std::endl;
228 const Int_t nbinsQ = 100;
229 Double_t xminQ = 250;
230 Double_t xmaxQ = 1e7;
231 Double_t logxminQ = TMath::Log(xminQ);
232 Double_t logxmaxQ = TMath::Log(xmaxQ);
233 Double_t binwidthQ = (logxmaxQ-logxminQ)/nbinsQ;
234 Double_t xbinsQ[nbinsQ+1];
236 for (Int_t i=1;i<=nbinsQ;i++)
237 xbinsQ[i] = TMath::Exp(logxminQ+i*binwidthQ);
238 hSignalVsNoise[0] =
new TH2F(
"hSignalVsNoiseX",
";Q_{noise} [ADC];Q_{signal} [ADC]",nbinsQ,xbinsQ,nbinsQ,xbinsQ);
239 hSignalVsNoise[1] =
new TH2F(
"hSignalVsNoiseY",
";Q_{noise} [ADC];Q_{signal} [ADC]",nbinsQ,xbinsQ,nbinsQ,xbinsQ);
241 hNoiseShape[0] =
new TH2F(
"hNoiseShapeX",
";t-t_{noise} [30ns];q [ADCch]",1000,-250,250,4096,-300,3796);
242 hNoiseShape[1] =
new TH2F(
"hNoiseShapeY",
";t-t_{noise} [30ns];q [ADCch]",1000,-250,250,4096,-300,3796);
243 hNoiseShapeTot[0] =
new TH2F(
"hNoiseShapeTotX",
";t-t_{noise} [30ns];q [ADCch]",1000,-250,250,1000,-3000,1e5);
244 hNoiseShapeTot[1] =
new TH2F(
"hNoiseShapeTotY",
";t-t_{noise} [30ns];q [ADCch]",1000,-250,250,1000,-3000,1e5);
245 hNoiseShapeNorm[0] =
new TH2F(
"hNoiseShapeNormX",
";t-t_{noise} [30ns];q_{norm}",1000,-250,250,500,-1,1);
246 hNoiseShapeNorm[1] =
new TH2F(
"hNoiseShapeNormY",
";t-t_{noise} [30ns];q_{norm}",1000,-250,250,500,-1,1);
247 hSignalShape[0] =
new TH2F(
"hSignalShapeX",
";t-t_{noise} [30ns];q_{tot} [ADCch]",1000,-250,250,4096,-300,3796);
248 hSignalShape[1] =
new TH2F(
"hSignalShapeY",
";t-t_{noise} [30ns];q_{tot} [ADCch]",1000,-250,250,4096,-300,3796);
249 hSignalShape2[0] =
new TH2F(
"hSignalShape2X",
";t-t_{noise} [30ns];q_{max} [ADCch]",1000,-250,250,4096,-300,3796);
250 hSignalShape2[1] =
new TH2F(
"hSignalShape2Y",
";t-t_{noise} [30ns];q_{max} [ADCch]",1000,-250,250,4096,-300,3796);
252 hSigma[0] =
new TH1F(
"hSigmaX",
";#sigma_{trunc}",500,0,200);
253 hSigma[1] =
new TH1F(
"hSigmaY",
";#sigma_{trunc}",500,0,200);
254 hSigmaVsMean[0] =
new TH2F(
"hSigmaVsMeanX",
";#sigma_{trunc};(q-#mu_{trunc})/#sigma_{trunc}",500,0,200,500,0,50);
255 hSigmaVsMean[1] =
new TH2F(
"hSigmaVsMeanY",
";#sigma_{trunc};(q-#mu_{trunc})/#sigma_{trunc}",500,0,200,500,0,50);
256 hSigmaVsMeanCut[0] =
new TH2F(
"hSigmaVsMeanCutX",
";#sigma_{trunc};(q-#mu_{trunc})/#sigma_{trunc}",500,0,200,500,0,50);
257 hSigmaVsMeanCut[1] =
new TH2F(
"hSigmaVsMeanCutY",
";#sigma_{trunc};(q-#mu_{trunc})/#sigma_{trunc}",500,0,200,500,0,50);
258 hSigmaVsTruncH[0] =
new TH2F(
"hSigmaVsTruncHX",
";#sigma_{trunc};truncH",500,0,200,20,0,100);
259 hSigmaVsTruncH[1] =
new TH2F(
"hSigmaVsTruncHY",
";#sigma_{trunc};truncH",500,0,200,20,0,100);
260 hSigma2[0] =
new TH1F(
"hSigma2X",
";#sigma_{trunc}/#mu_{trunc}",500,0,5);
261 hSigma2[1] =
new TH1F(
"hSigma2Y",
";#sigma_{trunc}/#mu_{trunc}",500,0,5);
313 Int_t size = vect->GetSize();
315 Double_t truncMean = 0;
316 Double_t truncSigma = 0;
317 Int_t* index =
new Int_t[size];
318 TMath::Sort(size,vect->GetArray(),index,kFALSE);
319 Int_t t = 0, tLow, tHigh;
322 while(vect->At(index[t])<10&&t<size-1) t++;
323 tLow = TMath::FloorNint(t + (size - t)*tl);
324 tHigh = TMath::FloorNint(t + (size - t)*th);
326 for(Int_t tind = tLow; tind<tHigh; tind++){
327 truncMean += vect->At(index[tind]);
328 truncSigma += vect->At(index[tind])*vect->At(index[tind]);
334 if(tHigh-tLow < 15)
return 0;
336 truncMean /= (tHigh-tLow);
337 truncSigma /= (tHigh-tLow);
338 truncSigma -= truncMean*truncMean;
341 truncS = TMath::Sqrt(truncSigma);
HarpoRecoEvent * GetRecoEvent()
Double_t GetRawData(Int_t i, Int_t j)
Analysis and suppression of baseline fluctuations.
Double_t GetData(Int_t i, Int_t j)
Set/Get Data Cell.
TH2F * hNoiseShapeNorm[2]
Bool_t isExist(ULong_t det)
Detecror date exist //! Number of Real Detectors.
Object containing the reconstruction information for one event (with array of HarpoRecoClusters Harpo...
Double_t TruncSigma(TArrayD *vect, Double_t &truncS, Double_t &truncM, Double_t tl, Double_t th)
TFile * OpenHistFile(const char *ananame)
unpacked dcc data The class contains the data map for DCC or Feminos The data is stored as a 2D TMatr...
void print()
Ovreloaded medod whic do all job.
TH2F * hSigmaVsMeanCut[2]
void SetTstart(Double_t val)
HarpoEventHeader * GetHeader()
const ULong_t gkNDetectors
HarpoDccMap * GetDccMap(Long_t plane=XDCC)
void SetYstart(Double_t val)
void SetRawData(Int_t i, Int_t j, Double_t val)
void SetXstart(Double_t val)
R__EXTERN HarpoDetSet * gHDetSet
void Save(char *mode=NULL)