-
-// Loop over files to digitize
- fSignal = kTRUE;
- fCounter = 0;
- for (Int_t inputFile=0; inputFile<fManager->GetNinputs(); inputFile++)
- {
- inRL = AliRunLoader::GetRunLoader(fManager->GetInputFolderName(inputFile));
- ingime = inRL->GetLoader("RICHLoader");
-
-// Connect RICH branches
-
- if (inputFile > 0 ) fSignal = kFALSE;
- TBranch *branchHits = 0;
- TBranch *branchSDigits = 0;
-
- ingime->LoadHits("READ");
- TTree *treeH = ingime->TreeH();
- if (GetDebug()>2) {
- cerr<<" inputFile "<<inputFile<<endl;
- cerr<<" treeH, fHits "<<treeH<<" "<<fHits<<endl;
- }
- if (treeH && fHits) {
- branchHits = treeH->GetBranch("RICH");
- if (branchHits)
- {
- fHits->Clear();
- branchHits->SetAddress(&fHits);
- }
- else
- Error("Exec","branch RICH was not found");
- }
- if (GetDebug()>2) cerr<<" branchHits = "<<branchHits<<endl;
-
- if (treeH && fSDigits) {
- branchSDigits = treeH->GetBranch("RICHSDigits");
- if (branchSDigits)
- branchSDigits->SetAddress(&fSDigits);
- else
- Error("exec","branch RICHSDigits was not found");
- }
- if (GetDebug()>2) cerr<<" branchSDigits = "<<branchSDigits<<endl;
-
-
- //
- // Loop over tracks
- //
-
- Int_t ntracks =(Int_t) treeH->GetEntries();
- for (fTrack=0; fTrack<ntracks; fTrack++) {
- fHits->Clear();
- fSDigits->Clear();
- branchHits->GetEntry(fTrack);
- branchSDigits->GetEntry(fTrack);
-
-
- //
- // Loop over hits
- for(Int_t i = 0; i < fHits->GetEntriesFast(); ++i) {
- AliRICHhit* mHit = static_cast<AliRICHhit*>(fHits->At(i));
- fNch = mHit->Chamber()-1; // chamber number
- if (fNch >= kNCH) {
- cerr<<"AliRICHDigitizer: chamber nr. fNch out of range: "<<fNch<<endl;
- cerr<<" track: "<<fTrack<<endl;
- continue;
- }
- iChamber = &(pRICH->Chamber(fNch));
-
- //
- // Loop over pad hits
- for (AliRICHSDigit* mPad=
- (AliRICHSDigit*)pRICH->FirstPad(mHit,fSDigits);
- mPad;
- mPad=(AliRICHSDigit*)pRICH->NextPad(fSDigits))
- {
- Int_t iqpad = mPad->QPad(); // charge per pad
- fDigits[0]=mPad->PadX();
- fDigits[1]=mPad->PadY();
- fDigits[2]=iqpad;
- fDigits[3]=iqpad;
- fDigits[4]=mPad->HitNumber();
-
-
-
- // build the list of fired pads and update the info
- if (Exists(mPad)) {
- Update(mPad);
- } else {
- CreateNew(mPad);
- }
- } //end loop over clusters
- } // hit loop
- } // track loop
- } // end file loop
- if (GetDebug()>2) cerr<<"END OF FILE LOOP"<<endl;
-
- Int_t tracks[kMAXTRACKSPERRICHDIGIT];
- Int_t charges[kMAXTRACKSPERRICHDIGIT];
- Int_t nentries=fTDList->GetEntriesFast();
-
- for (Int_t nent=0;nent<nentries;nent++) {
- AliRICHTransientDigit *transDigit=(AliRICHTransientDigit*)fTDList->At(nent);
- if (transDigit==0) continue;
- Int_t ich=transDigit->GetChamber();
- Int_t q=transDigit->Signal();
- iChamber=&(pRICH->Chamber(ich));
- AliRICHResponse * response=iChamber->GetResponseModel();
- Int_t adcmax= (Int_t) response->MaxAdc();
-
-
- // add white noise and do zero-suppression and signal truncation (new electronics,old electronics gaus 1.2,0.2)
- //printf("Treshold: %d\n",iChamber->fTresh->GetHitIndex(transDigit->PadX(),transDigit->PadY()));
-
-// tmp change
-// Int_t pedestal = iChamber->fTresh->GetHitIndex(transDigit->PadX(),transDigit->PadY());
- Int_t pedestal = 0;
-
-
- //printf("Pedestal:%d\n",pedestal);
- //Int_t pedestal=0;
- Float_t treshold = (pedestal + 4*2.2);
-
- Float_t meanNoise = gRandom->Gaus(2.2, 0.3);
- Float_t noise = gRandom->Gaus(0, meanNoise);
- q+=(Int_t)(noise + pedestal);
- //q+=(Int_t)(noise);
- // magic number to be parametrised !!!
- if ( q <= treshold)
- {
- q = q - pedestal;