- TIter next(clusterStore.CreateIterator());
-
- while ( ( clus = static_cast<AliMUONVCluster*>(next()) ) )
- {
- // new AliMUONHitForRec from raw cluster
- // and increment number of AliMUONHitForRec's (total and in chamber)
- AliMUONHitForRec* hitForRec = new ((*fHitsForRecPtr)[fNHitsForRec]) AliMUONHitForRec(clus);
- fNHitsForRec++;
- // more information into HitForRec
- hitForRec->SetNonBendingReso2(clus->GetErrX2());
- hitForRec->SetBendingReso2(clus->GetErrY2());
- // original raw cluster
- Int_t ch = AliMpDEManager::GetChamberId(clus->GetDetElemId());
- hitForRec->SetChamberNumber(ch);
- hitForRec->SetHitNumber(iclus);
- // Z coordinate of the raw cluster (cm)
- hitForRec->SetZ(clus->GetZ());
- if (AliLog::GetDebugLevel("MUON","AliMUONTrackReconstructor") >= 3) {
- cout << "Chamber " << ch <<" raw cluster " << iclus << " : " << endl;
- clus->Print("full");
- cout << "AliMUONHitForRec number (1...): " << fNHitsForRec << endl;
- hitForRec->Print("full");
- }
- ++iclus;
- } // end of chamber loop
-
- SortHitsForRecWithIncreasingChamber();
-
- AliDebug(1,"End of AddHitsForRecFromRawClusters");
-
- if (AliLog::GetGlobalDebugLevel() > 0)
- {
- AliDebug(1, Form("NHitsForRec: %d",fNHitsForRec));
- for (Int_t ch = 0; ch < AliMUONConstants::NTrackingCh(); ch++)
- {
- AliDebug(1, Form("Chamber(0...): %d",ch));
- AliDebug(1, Form("NHitsForRec: %d", fNHitsForRecPerChamber[ch]));
- AliDebug(1, Form("Index(first HitForRec): %d", fIndexOfFirstHitForRecPerChamber[ch]));
- for (Int_t hit = fIndexOfFirstHitForRecPerChamber[ch];
- hit < fIndexOfFirstHitForRecPerChamber[ch] + fNHitsForRecPerChamber[ch];
- hit++) {
- AliDebug(1, Form("HitForRec index(0...): %d",hit));
- ((*fHitsForRecPtr)[hit])->Dump();
- }
- }
- }
-}
-
- //__________________________________________________________________________
-void AliMUONVTrackReconstructor::SortHitsForRecWithIncreasingChamber()
-{
- /// Sort HitsForRec's in increasing order with respect to chamber number.
- /// Uses the function "Compare".
- /// Update the information for HitsForRec per chamber too.
- Int_t ch, nhits, prevch;
- fHitsForRecPtr->Sort();
- for (ch = 0; ch < AliMUONConstants::NTrackingCh(); ch++) {
- fNHitsForRecPerChamber[ch] = 0;
- fIndexOfFirstHitForRecPerChamber[ch] = 0;
- }
- prevch = 0; // previous chamber
- nhits = 0; // number of hits in current chamber
- // Loop over HitsForRec
- for (Int_t hit = 0; hit < fNHitsForRec; hit++) {
- // chamber number (0...)
- ch = ((AliMUONHitForRec*) ((*fHitsForRecPtr)[hit]))->GetChamberNumber();
- // increment number of hits in current chamber
- (fNHitsForRecPerChamber[ch])++;
- // update index of first HitForRec in current chamber
- // if chamber number different from previous one
- if (ch != prevch) {
- fIndexOfFirstHitForRecPerChamber[ch] = hit;
- prevch = ch;
- }
- }
- return;
-}
-
- //__________________________________________________________________________
-void AliMUONVTrackReconstructor::MakeTracks()
-{
- /// To make the tracks from the list of segments and points in all stations
- AliDebug(1,"Enter MakeTracks");