]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/ITSHitsToDigits.C
stdlib.h included (HP,Sun)
[u/mrichter/AliRoot.git] / ITS / ITSHitsToDigits.C
index 936722ed2b423716760fb586a935d4b206ed41f3..7b072d3b9f13330120caa72b3829ae707806a32f 100644 (file)
@@ -49,47 +49,43 @@ void ITSHitsToDigits (Int_t evNumber1=0,Int_t evNumber2=0,Int_t nsignal  =25, In
 
    // SDD
    // SDD compression param: 2 fDecrease, 2fTmin, 2fTmax or disable, 2 fTolerance
-   Float_t baseline = 10.;
-   Float_t noise = 1.75;
-
-   //Float_t fCutAmp = baseline + 2.*noise;
-               
-       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
-
-
+                
    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->SetMinVal(4);
+
+   //res1->SetChargeLoss(0.);
+   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->SetDiffCoeff(3.6,40.);
-   res1->SetMagicValue(96.95);
+   //   res1->SetElectronics(2);  // 1 = Pascal, 2 = OLA
+
+   res1->Print();
+
+   //cout << "SDD segmentation" << endl;
 
    AliITSsegmentationSDD *seg1=(AliITSsegmentationSDD*)iDetType->GetSegmentationModel();
    if (!seg1) {
        seg1 = new AliITSsegmentationSDD(geom,res1);
        ITS->SetSegmentationModel(1,seg1);
    }
+   seg1->Print();
 
+   //cout << "SDD segmentation" << endl;
    AliITSsimulationSDD *sim1=new AliITSsimulationSDD(seg1,res1);
-   sim1->SetDoFFT(1);
-   sim1->SetCheckNoise(kFALSE);
-
    ITS->SetSimulationModel(1,sim1);
+   sim1->Print();
    
    
 
@@ -121,18 +117,38 @@ void ITSHitsToDigits (Int_t evNumber1=0,Int_t evNumber2=0,Int_t nsignal  =25, In
 // Event Loop
 //
 
-   Int_t nbgr_ev=0;
 
+   // create the TreeD 
+
+   Int_t nparticles=gAlice->GetEvent(0);
+   printf("Create TreeD \n");
+   if(!gAlice->TreeD()) gAlice->MakeTree("D");
+   //make branch
+   ITS->MakeBranch("D");
+
+   Int_t nbgr_ev=0;
+       
+       
+       cout<<"Digitizing ITS...\n";
+   TStopwatch timer;
+       
    for (Int_t nev=evNumber1; nev<= evNumber2; nev++) {
        cout << "nev         " <<nev<<endl;
-       Int_t nparticles = gAlice->GetEvent(nev);
+       if(nev>0) {
+        nparticles = gAlice->GetEvent(nev);
+        gAlice->SetEvent(nev);
+        if(!gAlice->TreeD()) gAlice-> MakeTree("D");
+        ITS->MakeBranch("D");
+       }
        cout << "nparticles  " <<nparticles<<endl;
        if (nev < evNumber1) continue;
        if (nparticles <= 0) return;
 
        Int_t nbgr_ev=0;
        if(nsignal) nbgr_ev=Int_t(nev/nsignal);
+       timer.Start();
        ITS->HitsToDigits(nev,nbgr_ev,size," ","All"," ");
+       timer.Stop(); timer.Print();
    } // event loop 
 
    delete sim0;