]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSHits2Digits.C
Memory leak corrected (M.Bondila)
[u/mrichter/AliRoot.git] / ITS / AliITSHits2Digits.C
index 1f9bbcfca3461ae423df8c122aa0e674d37240f6..3961f98e17e0d5624958cbc5b903d3694517b3d0 100644 (file)
@@ -45,10 +45,7 @@ Int_t AliITSHits2Digits()
   // end test
 
   // SDD
-  //Set response functions
-  Float_t baseline = 10.;
-  Float_t noise = 1.75;
-
+  // Set response parameters
   // SDD compression param: 2 fDecrease, 2fTmin, 2fTmax or disable, 2 fTolerance
   AliITSDetType *iDetType=ITS->DetType(1);
   AliITSresponseSDD *res1 = (AliITSresponseSDD*)iDetType->GetResponseModel();
@@ -56,33 +53,25 @@ Int_t AliITSHits2Digits()
     res1=new AliITSresponseSDD();
     ITS->SetResponseModel(1,res1);
   }
-   res1->SetMagicValue(900.);
-
-   Float_t maxadc = res1->MaxAdc();    
-   Float_t topValue = res1->MagicValue();
-   Float_t norm = maxadc/topValue;
-
-   Float_t fCutAmp = baseline + 2.*noise;
-   fCutAmp *= norm;
-   Int_t cp[8]={0,0,fCutAmp,fCutAmp,0,0,0,0}; //1D
-
-  //res1->SetZeroSupp("2D");
-  res1->SetZeroSupp("1D");
-  res1->SetNoiseParam(noise,baseline);
-  res1->SetDo10to8(kTRUE);
-  res1->SetCompressParam(cp);
-  res1->SetMinVal(4);
-  res1->SetDiffCoeff(3.6,40.);
-  //res1->SetMagicValue(96.95);
-
+   Float_t baseline;
+   Float_t noise;
+   res1->GetNoiseParam(noise,baseline);
+   Float_t noise_after_el = res1->GetNoiseAfterElectronics();
+   cout << "noise_after_el: " << noise_after_el << endl; 
+   Float_t fCutAmp;
+   fCutAmp = baseline;
+   fCutAmp += (2.*noise_after_el);  // noise
+   cout << "Cut amplitude: " << fCutAmp << endl;
+   Int_t cp[8]={0,0,fCutAmp,fCutAmp,0,0,0,0};
+   res1->SetCompressParam(cp);
+
+   res1->Print();
   AliITSsegmentationSDD *seg1=(AliITSsegmentationSDD*)iDetType->GetSegmentationModel();
   if (!seg1) {
     seg1 = new AliITSsegmentationSDD(geom,res1);
     ITS->SetSegmentationModel(1,seg1);
   }
   AliITSsimulationSDD *sim1=new AliITSsimulationSDD(seg1,res1);
-  sim1->SetDoFFT(1);
-  sim1->SetCheckNoise(kFALSE);
   ITS->SetSimulationModel(1,sim1);
 
   // SSD