1 void ITSstoreFindableTracks(const char *nfile = "galice", Int_t evnum = 0)
3 TFile *froot = new TFile(Form("%s.root", nfile), "READ");
5 gAlice = (AliRun*)froot->Get("gAlice");
7 cout << "gAlice not found in file!!!" << endl;
11 AliITS *ITS = (AliITS*)gAlice->GetModule("ITS");
13 Int_t nparts = gAlice->GetEvent(evnum);
14 cout << "Tracks saved in event " << evnum << ": " << nparts << endl;
16 TClonesArray *recPoints = ITS->RecPoints();
17 TTree *treeRec = gAlice->TreeR();
18 Int_t ntracks = gAlice->GetNtrack(); //FCA correction
19 Int_t nmodules = treeRec->GetEntries();
23 Int_t layer, nlads, ndets;
24 AliITSgeom *gm = ITS->GetITSgeom();
25 for (layer = 0; layer < 6; layer++) {
26 nlads = gm->GetNladders(layer+1);
27 ndets = gm->GetNdetectors(layer+1);
28 modmin[layer] = gm->GetModuleIndex(layer+1, 1, 1);
29 modmax[layer] = gm->GetModuleIndex(layer+1, nlads, ndets);
32 Int_t track, *goodITS[6];
33 for (layer = 0; layer < 6; layer++) {
34 goodITS[layer] = new Int_t[ntracks];
35 for(track = 0; track < ntracks; track++) goodITS[layer][track] = 0;
38 Int_t irec, index, npoints = 0;
39 for (Int_t layer = 1; layer <= 6; layer++) {
40 for (Int_t mod = modmin[layer-1]; mod <= modmax[layer-1]; mod++) {
41 ITS->ResetRecPoints();
42 treeRec->GetEvent(mod);
43 cout << "\rLayer " << layer << ", module: " << mod << flush;
44 TObjArrayIter *iter = (TObjArrayIter*)recPoints->MakeIterator();
45 while ((recp = (AliITSRecPoint*)iter.Next())) {
46 for (index = 0; index < 3; index++) {
47 track = recp->GetLabel(index);
48 if(track < 0) continue;
50 cerr << " Error on track number \n";
53 goodITS[layer-1][track] = 1;
60 // histos filled with neural results
61 TFile *fnew = new TFile(Form("%s_fnd.root", nfile), "RECREATE");
63 TTree *tree = new TTree("tree", "Tree of tracks");
65 Int_t count = 0, prim = 0;
67 tree->Branch("count", &count, "count/I");
68 tree->Branch("prim", &prim, "prim/I");
69 tree->Branch("pt", &pt, "pt/D");
71 for(track = 0; track < ntracks; track++) {
74 part = gAlice->Particle(track);
75 if (!(track % 10000)) cout << "\rStoring track " << track << flush;
76 if (part->GetFirstMother() == -1) prim = 1;
77 for (layer = 0; layer < 6; layer++) count += goodITS[layer][track];
83 tree->Write("tree", TObject::kOverwrite);