]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/ITSDigitsToClusters.C
Make the macro compatible with the new AliRun
[u/mrichter/AliRoot.git] / ITS / ITSDigitsToClusters.C
index ff792bb5cfea19f48ea9260c1af3b511126ceae8..e443f04a49cf91f5395dbad35c9b6c5829378abe 100644 (file)
@@ -45,10 +45,24 @@ void ITSDigitsToClusters (Int_t evNumber1=0,Int_t evNumber2=0)
    AliITSgeom *geom = ITS->GetITSgeom();
 
 
+   // NOTE: if you foresee to have (in segmentation or response) parameter
+   // values other than the default ones, and these values are used not only in
+   // simulation but in cluster finder as well, please set them via your
+   // local Config.C - the streamer will take care of writing the correct
+   // info and you'll no longer be obliged to set them again for your cluster
+   // finder as it's done in this macro (ugly and impractical, no? )
+
+
+
    // Set the models for cluster finding
 
    // SPD
 
+
+
+   ITS->MakeTreeC();
+   Int_t nparticles=gAlice->GetEvent(0);
+
    AliITSDetType *iDetType=ITS->DetType(0);
    AliITSsegmentationSPD *seg0=(AliITSsegmentationSPD*)iDetType->GetSegmentationModel();
    TClonesArray *dig0  = ITS->DigitsAddress(0);
@@ -56,15 +70,15 @@ void ITSDigitsToClusters (Int_t evNumber1=0,Int_t evNumber2=0)
    AliITSClusterFinderSPD *rec0=new AliITSClusterFinderSPD(seg0,dig0,recp0);
    ITS->SetReconstructionModel(0,rec0);
    // test
-   //printf("SPD dimensions %f %f \n",seg0->Dx(),seg0->Dz());
-   //printf("SPD npixels %d %d \n",seg0->Npz(),seg0->Npx());
+   printf("SPD dimensions %f %f \n",seg0->Dx(),seg0->Dz());
+   printf("SPD npixels %d %d \n",seg0->Npz(),seg0->Npx());
 
 
    // SDD
 
    Float_t baseline = 10.;
    Float_t noise = 1.67;
-   Int_t thres = (Int_t)(baseline+3*noise);
+   Float_t thres = baseline+3*noise;
    printf("thresh %d\n",thres);
 
    AliITSDetType *iDetType=ITS->DetType(1);
@@ -74,14 +88,11 @@ void ITSDigitsToClusters (Int_t evNumber1=0,Int_t evNumber2=0)
    if (!seg1) seg1 = new AliITSsegmentationSDD(geom);
    AliITSresponseSDD *res1 = (AliITSresponseSDD*)iDetType->GetResponseModel();
    if (!res1) res1=new AliITSresponseSDD();
-
-   //res1->SetNoiseParam(noise,baseline);
-
-   res1->SetNoiseParam(noise,baseline);
+   res1->SetMagicValue(900.);
    Float_t magic = res1->MagicValue();
    Float_t top = res1->MaxAdc();
    thres *= top/magic;
-       
+   res1->SetNoiseParam(noise,baseline);
    Float_t n,b;
    res1->GetNoiseParam(n,b);
     printf("SDD: noise baseline %f %f zs option %s data type %s\n",n,b,res1->ZeroSuppOption(),res1->DataType());
@@ -94,7 +105,7 @@ void ITSDigitsToClusters (Int_t evNumber1=0,Int_t evNumber2=0)
    AliITSClusterFinderSDD *rec1=new AliITSClusterFinderSDD(seg1,res1,dig1,recp1);
    rec1->SetMinNCells(6);
    rec1->SetTimeCorr(70.);
-   rec1->SetCutAmplitude(thres);
+   rec1->SetCutAmplitude((int)thres);
    ITS->SetReconstructionModel(1,rec1);
 
    // SSD
@@ -102,8 +113,7 @@ void ITSDigitsToClusters (Int_t evNumber1=0,Int_t evNumber2=0)
    AliITSDetType *iDetType=ITS->DetType(2);
    AliITSsegmentationSSD *seg2=(AliITSsegmentationSSD*)iDetType->GetSegmentationModel();
    TClonesArray *dig2  = ITS->DigitsAddress(2);
-   TClonesArray *recp2  = ITS->ClustersAddress(2);
-   AliITSClusterFinderSSD *rec2=new AliITSClusterFinderSSD(seg2,dig2,recp2);
+   AliITSClusterFinderSSD *rec2=new AliITSClusterFinderSSD(seg2,dig2);
    ITS->SetReconstructionModel(2,rec2);
    // test
    //printf("SSD dimensions %f %f \n",seg2->Dx(),seg2->Dz());
@@ -116,7 +126,9 @@ void ITSDigitsToClusters (Int_t evNumber1=0,Int_t evNumber2=0)
 //
 
    for (int nev=evNumber1; nev<= evNumber2; nev++) {
-       Int_t nparticles = gAlice->GetEvent(nev);
+       if(nev>0) {
+        nparticles = gAlice->GetEvent(nev);
+       }     
        cout << "nev         " <<nev<<endl;
        cout << "nparticles  " <<nparticles<<endl;
        if (nev < evNumber1) continue;
@@ -126,8 +138,9 @@ void ITSDigitsToClusters (Int_t evNumber1=0,Int_t evNumber2=0)
        Int_t nent=TD->GetEntries();
        printf("Found %d entries in the tree (must be one per module per event!)\n",nent);
        //Int_t nmodules=geom->GetLastSSD();
-       //Int_t last_entry=nent-(nmodules+1);
-       Int_t last_entry=1;
+       //Int_t last_entry=nent-nmodules;
+       //Int_t last_entry=1;
+       Int_t last_entry=0;
        ITS->DigitsToRecPoints(nev,last_entry,"All");
    } // event loop