]> git.uio.no Git - u/mrichter/AliRoot.git/blob - RICH/api.txt
START positions
[u/mrichter/AliRoot.git] / RICH / api.txt
1 How to open session:
2         use static method  AliRunLoader::Open("galice.root","AlicE","update")
3 How to get total number of events in galice.root:
4         use AliRun::GetEventsPerRun()        
5 How to avoid using gAlice:
6         detector->GetLoader()->GetRunLoader()->GetAliRun() returns gAlice global pointer.
7 How to retrieve pointer to alice run loader:
8         use pRICH->GetLoader()->GetRunLoader() (all detector classes inherit from AliDetector which has GetLoader())
9         use method AliRun::GetRunLoader for gAlice (deprecated)
10 How to get pointers to different root trees:
11         TreeE belongs to AliRunLoader, available after AliRunLoader::LoadHeader()
12         TreeK belongs to AliRunLoader, available after AliRunLoader::LoadKinematics()
13         TreeH belongs to AliLoader   , available after AliLoader::LoadHits()
14         TreeS belongs to AliLoader   , available after AliLoader::LoadSDigits()
15         TreeD belongs to AliLoader   , available after AliLoader::LoadDigits()
16         TreeR belongs to AliLoader   , available after AliLoader::LoadRecPoints()
17         all methods return 0 on success. 
18 How to get event of interest:
19         AliRunLoader::GetEvent(event_number) returns 0 on success
20 How to deal with the stack of particles?
21         - first of all, the stack includes primary as well as secondary particles
22         - pointer to the stack is taken:
23                 AliRun::Stack() (global gAlice of type AliRun - deprecated way to do)
24                 AliRunLoader::Stack() but before one needs to load event header by AliRunLoader::LoadHeader() otherwise both methods return 0.
25                 Moreover loading header gives the information about number of particles only. 
26                 To retrieve the list of particle one also needs to load kinematics by AliRunLoader::LoadKinematics()        
27         - total amount of particles in stack for a given event:        
28                 AliStack::GetNtrack() 
29                 AliRun::GetEvent() (after LoadHeader())
30         - total amount of primary particles in stack for a given event (after LoadHeader()): 
31                 AliStack::GetNprimary() 
32 How to retrieve hits:
33         Hits are stored on primary by primary basis. Hits for the given primary is TClonesArray.
34         To retrieve all hits one needs to do:
35         -initialize the root tree and containers:   pRich->GetLoader()->LoadHits();  (AliLoader::LoadHits() returns 0 on success)
36         -read number of entries in TreeH:           pRich->GetLoader()->TreeH()->GetEntries()
37         -then for each entry:                       pRich->GetLoader()->TreeH()->GetEntry(i)
38 How to retrieve sdigits? 
39         Sdigits stored in tree S with the branch of TClonesArray, all sdigits in a single TClonesArray
40         So the tree has only one entry.
41         One needs to say:
42         -pRich->GetLoader()->LoadSDigits(); this one open file, get the tree and invoke AliRICH::SetTreeAddress()    
43 How to retrieve digits? 
44         Digits stored in tree D with the 7 branches of TClonesArray, one per chamber, all digits of a given chamber in a single TClonesArray
45         So the tree has only one entry.
46         -One needs to say:
47           pRich->GetLoader()->LoadDigits(); this one opens file, gets the tree and invoke AliRICH::SetTreeAddress() which in turn corresponds 
48           branches of the tree to the digits containers in memory. There are 7 containers, one per chamber, all of them belong to AliRICH.
49         -Then one needs to take the tree entry (only one) to the memory:
50           pRich->GetLoader()->TreeD()->GetEntry(0) 
51         -Finally pRich->Digits(chamber_number) returns the pointer to TClonesArray of AliRICHdigit          
52 What are the debug methods avail:
53         AliLog::SetGlobalDebugLevel(AliLog::kDebug)
54 How to get info for a given particle number:
55         Header and Kinematics trees must be loaded, then possible to retrieve pointer to Stack of particles
56         Int_t AliRunLoader::LoadHeader(); Int_t AliRunLoader::LoadKinematics()
57         AliStack *AliRunLoader::Stack()
58         TParticle *AliStack::Particle(tid)
59         TParticle::Print()
60 How to deal with AliRunDigitizer:
61         AliRunDigitizer::Exec() just call AliRunDigitizer::Digitize()   
62 What are the meanings of different VMC flags:         
63         gMC->IsTrackAlive()
64         gMC->IsTrackStop()
65         gMC->IsTrackDisappeared()
66 How to get pad number for a local position:
67         use static TVector AliRICHParam::Loc2Pad(TVector2 position);
68 Why list of chambers belongs to AliRICHParam:
69
70 How to check if a given stack particle is primary:
71         Stack is TClonesArray of TParticle. TParticle::GetMother(0) returns -1 if it's primary (no mother)         
72 How to loop over all possible object:         
73   for(Int_t iEventN=0;iEventN < GetLoader()->GetRunLoader()->GetAliRun()->GetEventsPerRun();iEventN++){//events loop
74     for(Int_t iEntryN=0;iEntryN < GetLoader()->TreeH()->GetEntries();iEntryN++){//TreeH loop
75       GetLoader()->TreeH()->GetEntry(iEntryN);//get current entry (prim)  
76       for(Int_t iHitN=0;iHitN<Hits()->GetEntries();iHitN++){//hits loop
77         AliVHMPIDHit *pHit=(AliVHMPIDHit*)Hits()->At(iHitN);//get current hit 
78         
79       }//hits loop
80     }//TreeH loop
81   }//events loop
82
83
84 RICH full simulation-reconstruction sequence
85
86 hits->sdigit:
87         Responsible method is AliRICH::Hits2SDigits
88         One hit may affect one or more pads.
89         Hit position is taken on the anode wires plane as the most of avalanche is developed there.
90         This position is not directly available, track intersections with entrance and exit of amplification gap are only stored.
91         So the position in the middle of the gap is calculated as average out of pHit->In() and pHit->Out() positions.
92         Then, total charge collected for this hit is calculated by AliRICHParam::Hit2Qdc.    
93         Area of disintegration is a list of pads affected by current hit. This is a parameter of Mathienson    
94 sdigits->digits:
95         The necessety of sdigits is dictated by the fact that trasport engine transports track by track. It means that it may happen that the same
96         pad is affected by few tracks. But this might be known after the trasport of full event only. 
97
98 Generalized structure of AliReconstruction:
99
100 Run()
101 {
102   if(there is galice.root)                                          |
103     AliRunLoader::Open(....)                                        | this is done in InitRunLoader()
104   else                                                              |
105     if(raw data process requested)                                  |
106       create galice.root on the base of AliRawReader::NextEvent     |   
107   
108   for(all detectors){                                               |
109    if(detector not selected to run) skip this detector              |
110    reconstructor=get detector's reconstructor                       | this is done in RunLocalReconstruction()
111    if(detector HasLocalReconstruction) skip this detector           | IMPORTANT! if HasLocalReconstruction() returns YES use RunLocalEventReconstruction instead
112    if(run upon raw data)                                            |  
113      reconstructor->Reconstruct(fRunLoader, fRawReader);            |   
114    else                                                             |
115      reconstructor->Reconstruct(fRunLoader);                        |
116   }
117
118   for(all events){                                                      
119   
120     for(all detectors){                                                 |            
121       if(detector not selected to run) skip this detector               |
122       reconstructor=get detector's reconstructor                        | 
123       loader=get detector's loader                                      | this is done in RunLocalEventReconstruction()
124       if(raw data process requested and detector HasDigitConversion){   | 
125         loader->LoadDigits("update");                                   | open file and invoke  detector->SetTreeAddress();
126         loader->CleanDigits();                                          |   
127         loader->MakeDigitsContainer();                                  | create tree
128         reconstructor->Reconstruct(fRawReader,loader->TreeD());         | expected to fill TreeD out of raw reader
129         loader->WriteDigits("overwrite");                               | 
130         loader->UnloadDigits();                                         |  
131       }                                                                 |
132       if(detector do not HasLocalReconstruction) skip this detector     | IMPORTANT! assumed that this detector is already processed in RunLocalReconstruction()
133       loader->LoadRecPoints("update");                                  |
134       loader->CleanRecPoints();                                         |
135       loader->MakeRecPointsContainer();                                 | 
136       if(fRawReader && reconstructor do not HasDigitConversion()){      | 
137         reconstructor->Reconstruct(fRawReader, loader->TreeR());        | expected to fill TreeR out of raw reader
138       }else{                                                            |
139         loader->LoadDigits("read");                                     |
140         reconstructor->Reconstruct(loader->TreeD(),loader->TreeR());    | the only operations inside are pDigTree->GetEntry(0) and pCluTree->Fill();
141         loader->UnloadDigits();                                         | 
142       }                                                                 |
143       loader->WriteRecPoints("OVERWRITE");                              |
144       loader->UnloadRecPoints();                                        |
145     }//detectors loop                                                   |
146     
147   }//events loop 
148 }