]> 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 c6cd0565824ca7f8c5b84fd0d746c0124a102b2f..3961f98e17e0d5624958cbc5b903d3694517b3d0 100644 (file)
@@ -45,37 +45,33 @@ 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
-  Float_t fCutAmp = baseline + 2.*noise;
-  Int_t cp[8]={0,0,fCutAmp,fCutAmp,0,0,0,0};
-
   AliITSDetType *iDetType=ITS->DetType(1);
   AliITSresponseSDD *res1 = (AliITSresponseSDD*)iDetType->GetResponseModel();
   if (!res1) {
     res1=new AliITSresponseSDD();
     ITS->SetResponseModel(1,res1);
   }
-  //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
@@ -86,8 +82,12 @@ Int_t AliITSHits2Digits()
   AliITSsimulationSSD *sim2=new AliITSsimulationSSD(seg2,res2);
   ITS->SetSimulationModel(2,sim2);
 
-
   cerr<<"Digitizing ITS...\n";
+
+   if(!gAlice->TreeD()) gAlice->MakeTree("D");
+   printf("TreeD %p\n",gAlice->TreeD());
+   //make branch
+   ITS->MakeBranch("D");
   
   TStopwatch timer;
   timer.Start();