-//
-// Loop over pad hits
- for (AliRICHPadHit* mPad=
- (AliRICHPadHit*)pRICH->FirstPad(mHit,fPadHits);
- mPad;
- mPad=(AliRICHPadHit*)pRICH->NextPad(fPadHits))
- {
- Int_t cathode = mPad->fCathode; // cathode number
- Int_t ipx = mPad->fPadX; // pad number on X
- Int_t ipy = mPad->fPadY; // pad number on Y
- Int_t iqpad = mPad->fQpad; // charge per pad
- //
- //
- //printf("X:%d, Y:%d, Q:%d\n",ipx,ipy,iqpad);
-
- Float_t thex, they;
- segmentation=iChamber->GetSegmentationModel(cathode);
- segmentation->GetPadCxy(ipx,ipy,thex,they);
- new((*pAddress)[countadr++]) TVector(2);
- TVector &trinfo=*((TVector*) (*pAddress)[countadr-1]);
- trinfo(0)=(Float_t)track;
- trinfo(1)=(Float_t)iqpad;
-
- digits[0]=ipx;
- digits[1]=ipy;
- digits[2]=iqpad;
-
- AliRICHTransientDigit* pdigit;
- // build the list of fired pads and update the info
- if (!pHitMap[nch]->TestHit(ipx, ipy)) {
- list->AddAtAndExpand(new AliRICHTransientDigit(nch,digits),counter);
- pHitMap[nch]->SetHit(ipx, ipy, counter);
- counter++;
- pdigit=(AliRICHTransientDigit*)list->At(list->GetLast());
- // list of tracks
- TObjArray *trlist=(TObjArray*)pdigit->TrackList();
- trlist->Add(&trinfo);
- } else {
- pdigit=(AliRICHTransientDigit*) pHitMap[nch]->GetHit(ipx, ipy);
- // update charge
- (*pdigit).fSignal+=iqpad;
- // update list of tracks
- TObjArray* trlist=(TObjArray*)pdigit->TrackList();
- Int_t lastEntry=trlist->GetLast();
- TVector *ptrkP=(TVector*)trlist->At(lastEntry);
- TVector &ptrk=*ptrkP;
- Int_t lastTrack=Int_t(ptrk(0));
- Int_t lastCharge=Int_t(ptrk(1));
- if (lastTrack==track) {
- lastCharge+=iqpad;
- trlist->RemoveAt(lastEntry);
- trinfo(0)=lastTrack;
- trinfo(1)=lastCharge;
- trlist->AddAt(&trinfo,lastEntry);
- } else {
- trlist->Add(&trinfo);
- }
- // check the track list
- Int_t nptracks=trlist->GetEntriesFast();
- if (nptracks > 2) {
- printf("Attention - tracks: %d (>2)\n",nptracks);
- //printf("cat,nch,ix,iy %d %d %d %d \n",icat+1,nch,ipx,ipy);
- for (Int_t tr=0;tr<nptracks;tr++) {
- TVector *pptrkP=(TVector*)trlist->At(tr);
- TVector &pptrk=*pptrkP;
- trk[tr]=Int_t(pptrk(0));
- chtrk[tr]=Int_t(pptrk(1));
- }
- } // end if nptracks
- } // end if pdigit
- } //end loop over clusters
- }// track type condition
- } // hit loop
- } // track loop
-
- // open the file with background
-
- if (addBackground ) {
- ntracks =(Int_t)TrH1->GetEntries();
- //printf("background - icat,ntracks1 %d %d\n",icat,ntracks);
- //printf("background - Start loop over tracks \n");
-//
-// Loop over tracks
-//
- for (Int_t trak=0; trak<ntracks; trak++) {
- if (fHits2) fHits2->Clear();
- if (fClusters2) fClusters2->Clear();
- TrH1->GetEvent(trak);
-//
-// Loop over hits
- AliRICHHit* mHit;
- for(int j=0;j<fHits2->GetEntriesFast();++j)
- {
- mHit=(AliRICHHit*) (*fHits2)[j];
- Int_t nch = mHit->fChamber-1; // chamber number
- if (nch >6) continue;
- iChamber = &(pRICH->Chamber(nch));
- Int_t rmin = (Int_t)iChamber->RInner();
- Int_t rmax = (Int_t)iChamber->ROuter();
-//
-// Loop over pad hits
- for (AliRICHPadHit* mPad=
- (AliRICHPadHit*)pRICH->FirstPad(mHit,fClusters2);
- mPad;
- mPad=(AliRICHPadHit*)pRICH->NextPad(fClusters2))
- {
- Int_t cathode = mPad->fCathode; // cathode number
- Int_t ipx = mPad->fPadX; // pad number on X
- Int_t ipy = mPad->fPadY; // pad number on Y
- Int_t iqpad = mPad->fQpad; // charge per pad
- if (trak==3 && nch==0 && icat==0) printf("bgr - trak,iqpad,ipx,ipy %d %d %d %d\n",trak,iqpad,ipx,ipy);
-//
-//
- Float_t thex, they;
- segmentation=iChamber->GetSegmentationModel(cathode);
- segmentation->GetPadCxy(ipx,ipy,thex,they);
- Float_t rpad=TMath::Sqrt(thex*thex+they*they);
- if (rpad < rmin || iqpad ==0 || rpad > rmax) continue;
- new((*pAddress)[countadr++]) TVector(2);
- TVector &trinfo=*((TVector*) (*pAddress)[countadr-1]);
- trinfo(0)=-1; // tag background
- trinfo(1)=-1;
- digits[0]=ipx;
- digits[1]=ipy;
- digits[2]=iqpad;
- if (trak <4 && icat==0 && nch==0)
- printf("bgr - pHitMap[nch]->TestHit(ipx, ipy),trak %d %d\n",
- pHitMap[nch]->TestHit(ipx, ipy),trak);
- AliRICHTransientDigit* pdigit;
- // build the list of fired pads and update the info
- if (!pHitMap[nch]->TestHit(ipx, ipy)) {
- list->AddAtAndExpand(new AliRICHTransientDigit(nch,digits),counter);
-
- pHitMap[nch]->SetHit(ipx, ipy, counter);
- counter++;
- printf("bgr new elem in list - counter %d\n",counter);
-
- pdigit=(AliRICHTransientDigit*)list->At(list->GetLast());
- // list of tracks
- TObjArray *trlist=(TObjArray*)pdigit->TrackList();
- trlist->Add(&trinfo);
- } else {
- pdigit=(AliRICHTransientDigit*) pHitMap[nch]->GetHit(ipx, ipy);
- // update charge
- (*pdigit).fSignal+=iqpad;
- // update list of tracks
- TObjArray* trlist=(TObjArray*)pdigit->TrackList();
- Int_t lastEntry=trlist->GetLast();
- TVector *ptrkP=(TVector*)trlist->At(lastEntry);
- TVector &ptrk=*ptrkP;
- Int_t lastTrack=Int_t(ptrk(0));
- if (lastTrack==-1) {
- continue;
- } else {
- trlist->Add(&trinfo);
- }
- // check the track list
- Int_t nptracks=trlist->GetEntriesFast();
- if (nptracks > 0) {
- for (Int_t tr=0;tr<nptracks;tr++) {
- TVector *pptrkP=(TVector*)trlist->At(tr);
- TVector &pptrk=*pptrkP;
- trk[tr]=Int_t(pptrk(0));
- chtrk[tr]=Int_t(pptrk(1));
- }
- } // end if nptracks
- } // end if pdigit
- } //end loop over clusters
- } // hit loop
- } // track loop
+ Float_t thex, they;
+ segmentation=iChamber->GetSegmentationModel(cathode);
+ segmentation->GetPadCxy(ipx,ipy,thex,they);
+ Float_t rpad=TMath::Sqrt(thex*thex+they*they);
+ if (rpad < rmin || iqpad ==0 || rpad > rmax) continue;
+ new((*pAddress)[countadr++]) TVector(2);
+ TVector &trinfo=*((TVector*) (*pAddress)[countadr-1]);
+ trinfo(0)=-1; // tag background
+ trinfo(1)=-1;
+ digits[0]=ipx;
+ digits[1]=ipy;
+ digits[2]=iqpad;
+ if (trak <4 && nch==0)
+ printf("bgr - pHitMap[nch]->TestHit(ipx, ipy),trak %d %d\n",
+ pHitMap[nch]->TestHit(ipx, ipy),trak);
+ AliRICHTransientDigit* pdigit;
+ // build the list of fired pads and update the info
+ if (!pHitMap[nch]->TestHit(ipx, ipy)) {
+ list->AddAtAndExpand(new AliRICHTransientDigit(nch,digits),counter);
+
+ pHitMap[nch]->SetHit(ipx, ipy, counter);
+ counter++;
+ printf("bgr new elem in list - counter %d\n",counter);
+
+ pdigit=(AliRICHTransientDigit*)list->At(list->GetLast());
+ // list of tracks
+ TObjArray *trlist=(TObjArray*)pdigit->TrackList();
+ trlist->Add(&trinfo);
+ } else {
+ pdigit=(AliRICHTransientDigit*) pHitMap[nch]->GetHit(ipx, ipy);
+ // update charge
+ (*pdigit).fSignal+=iqpad;
+ // update list of tracks
+ TObjArray* trlist=(TObjArray*)pdigit->TrackList();
+ Int_t lastEntry=trlist->GetLast();
+ TVector *ptrkP=(TVector*)trlist->At(lastEntry);
+ TVector &ptrk=*ptrkP;
+ Int_t lastTrack=Int_t(ptrk(0));
+ if (lastTrack==-1) {
+ continue;
+ } else {
+ trlist->Add(&trinfo);
+ }
+ // check the track list
+ Int_t nptracks=trlist->GetEntriesFast();
+ if (nptracks > 0) {
+ for (Int_t tr=0;tr<nptracks;tr++) {
+ TVector *pptrkP=(TVector*)trlist->At(tr);
+ TVector &pptrk=*pptrkP;
+ trk[tr]=Int_t(pptrk(0));
+ chtrk[tr]=Int_t(pptrk(1));
+ }
+ } // end if nptracks
+ } // end if pdigit
+ } //end loop over clusters
+ } // hit loop
+ } // track loop