#include "iostream.h" void ITSDigitsToClustersDubna (Int_t evNumber1=0,Int_t evNumber2=0) { ///////////////////////////////////////////////////////////////////////// // This macro is a small example of a ROOT macro // illustrating how to read the output of GALICE // and do some analysis. // ///////////////////////////////////////////////////////////////////////// // Dynamically link some shared libs if (gClassTable->GetID("AliRun") < 0) { gROOT->LoadMacro("loadlibs.C"); loadlibs(); } else { delete gAlice; gAlice=0; } // Connect the Root Galice file containing Geometry, Kine and Hits TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject("galice.root"); printf("file %p\n",file); if (file) file->Close(); file = new TFile("galice.root","UPDATE"); file->ls(); printf ("I'm after Map \n"); // Get AliRun object from file or create it if not on file if (!gAlice) { gAlice = (AliRun*)file->Get("gAlice"); if (gAlice) printf("AliRun object found on file\n"); if (!gAlice) gAlice = new AliRun("gAlice","Alice test program"); } printf ("I'm after gAlice \n"); AliITS *ITS = (AliITS*) gAlice->GetModule("ITS"); if (!ITS) return; 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 // 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); TClonesArray *recp0 = ITS->ClustersAddress(0); AliITSClusterFinderSPDdubna *rec0=new AliITSClusterFinderSPDdubna(seg0,dig0,recp0); ITS->SetReconstructionModel(0,rec0); // SDD AliITSDetType *iDetType=ITS->DetType(1); AliITSgeom *geom = ITS->GetITSgeom(); AliITSsegmentationSDD *seg1=(AliITSsegmentationSDD*)iDetType->GetSegmentationModel(); if (!seg1) seg1 = new AliITSsegmentationSDD(geom); AliITSresponseSDD *res1 = (AliITSresponseSDD*)iDetType->GetResponseModel(); if (!res1) res1=new AliITSresponseSDD("simulated"); Float_t baseline,noise; res1->GetNoiseParam(noise,baseline); Float_t noise_after_el = res1->GetNoiseAfterElectronics(); Float_t thres = baseline; thres += (4.*noise_after_el); // TB // (4.*noise_after_el); printf("thres %f\n",thres); res1->Print(); TClonesArray *dig1 = ITS->DigitsAddress(1); TClonesArray *recp1 = ITS->ClustersAddress(1); AliITSClusterFinderSDD *rec1=new AliITSClusterFinderSDD(seg1,res1,dig1,recp1); rec1->SetCutAmplitude((int)thres); ITS->SetReconstructionModel(1,rec1); rec1->Print(); // SSD AliITSDetType *iDetType=ITS->DetType(2); AliITSsegmentationSSD *seg2=(AliITSsegmentationSSD*)iDetType->GetSegmentationModel(); seg2->SetDetSize(72960.,40000.,303.); TClonesArray *dig2 = ITS->DigitsAddress(2); AliITSClusterFinderSSD *rec2=new AliITSClusterFinderSSD(seg2,dig2); ITS->SetReconstructionModel(2,rec2); // test //printf("SSD dimensions %f %f \n",seg2->Dx(),seg2->Dz()); //printf("SSD nstrips %d %d \n",seg2->Npz(),seg2->Npx()); // // Event Loop // cout << "Looking for clusters...\n"; TStopwatch timer; if(!gAlice->TreeR()) gAlice->MakeTree("R"); //make branch ITS->MakeBranch("R"); for (int nev=evNumber1; nev<= evNumber2; nev++) { if(nev>0) { nparticles = gAlice->GetEvent(nev); gAlice->SetEvent(nev); if(!gAlice->TreeR()) gAlice-> MakeTree("R"); ITS->MakeBranch("R"); } cout << "nev " <DigitsToRecPoints(nev,last_entry,"All"); timer.Stop(); timer.Print(); } // event loop delete rec0; delete rec1; delete rec2; file->Close(); }