- Float_t xmean = 0;
- Float_t zmean = 0;
- Float_t qsum = 0;
- Int_t idigit,ndigits;
-
- // 2. go through the current digit list and sum digits in pads
-
- ndigits = cpvDigits->GetEntriesFast();
- for (idigit=0; idigit<ndigits-1; idigit++) {
- AliPHOSCPVDigit *cpvDigit1 = (AliPHOSCPVDigit*) cpvDigits->UncheckedAt(idigit);
- Float_t x1 = cpvDigit1->GetXpad() ;
- Float_t z1 = cpvDigit1->GetYpad() ;
- for (Int_t jdigit=idigit+1; jdigit<ndigits; jdigit++) {
- AliPHOSCPVDigit *cpvDigit2 = (AliPHOSCPVDigit*) cpvDigits->UncheckedAt(jdigit);
- Float_t x2 = cpvDigit2->GetXpad() ;
- Float_t z2 = cpvDigit2->GetYpad() ;
- if (x1==x2 && z1==z2) {
- Float_t qsum = cpvDigit1->GetQpad() + cpvDigit2->GetQpad() ;
- cpvDigit2->SetQpad(qsum) ;
- cpvDigits->RemoveAt(idigit) ;
- }
- }
- }
- cpvDigits->Compress() ;
-
- // 3. add digits to temporary hit list fTmpHits
-
- ndigits = cpvDigits->GetEntriesFast();
- for (idigit=0; idigit<ndigits; idigit++) {
- AliPHOSCPVDigit *cpvDigit = (AliPHOSCPVDigit*) cpvDigits->UncheckedAt(idigit);
- relid[0] = moduleNumber + 1 ; // CPV (or PHOS) module number
- relid[1] =-1 ; // means CPV
- relid[2] = cpvDigit->GetXpad() ; // column number of a pad
- relid[3] = cpvDigit->GetYpad() ; // row number of a pad
-
- // get the absolute Id number
- fGeom->RelToAbsNumbering(relid, absid) ;
-
- // add current digit to the temporary hit list
- xyze[0] = 0. ;
- xyze[1] = 0. ;
- xyze[2] = 0. ;
- xyze[3] = cpvDigit->GetQpad() ; // amplitude in a pad
- primary = -1; // No need in primary for CPV
- AddHit(fIshunt, primary, tracknumber, absid, xyze);
-
- if (cpvDigit->GetQpad() > 0.02) {
- xmean += cpvDigit->GetQpad() * (cpvDigit->GetXpad() + 0.5);
- zmean += cpvDigit->GetQpad() * (cpvDigit->GetYpad() + 0.5);
- qsum += cpvDigit->GetQpad();
- }