/************************************************************************** * Copyright(c) 1998-2000, ALICE Experiment at CERN, All rights reserved. * * * * Author: The ALICE Off-line Project. * * Contributors are mentioned in the code where appropriate. * * * * Permission to use, copy, modify and distribute this software and its * * documentation strictly for non-commercial purposes is hereby granted * * without fee, provided that the above copyright notice appears in all * * copies and that both the copyright notice and this permission notice * * appear in the supporting documentation. The authors make no claims * * about the suitability of this software for any purpose. It is * * provided "as is" without express or implied warranty. * **************************************************************************/ #include #include #include #include #include #include #include "AliSTARTDigitizer.h" #include "AliSTART.h" #include "AliSTARThit.h" #include "AliSTARThitPhoton.h" #include "AliSTARTdigit.h" #include "AliRunDigitizer.h" #include #include "AliRun.h" #include #include #include #include #include ClassImp(AliSTARTDigitizer) //___________________________________________ AliSTARTDigitizer::AliSTARTDigitizer() :AliDigitizer() { // Default ctor - don't use it ; } //___________________________________________ AliSTARTDigitizer::AliSTARTDigitizer(AliRunDigitizer* manager) :AliDigitizer(manager) { // cout<<"AliSTARTDigitizer::AliSTARTDigitizer"<GetOutputFolderName()); pOutStartLoader = outRL->GetLoader("STARTLoader"); #ifdef DEBUG cout<<"AliSTARTDigitizer::>Hits2Digits start...\n"; #endif // // From hits to digits // Int_t hit, nhits; Float_t meanTime; Int_t countEr[13],countEl[13]; Int_t volume,pmt,tr,tl,sumRight; Int_t bestRightADC,bestLeftADC; Float_t besttimeleftGaus, besttimerightGaus; Float_t timeright[13]={13*0}; Float_t timeleft[13]={13*0}; Float_t channelWidth=2.5; //ps Int_t channelWidthADC=1; //ps // Int_t thresholdAmpl=10; AliSTARThit *startHit; TBranch *brHits=0; TBranch *brHitPhoton=0; pOutStartLoader->LoadDigits("UPDATE");//probably it is necessary to load them before fdigits= new AliSTARTdigit(); pOutStartLoader->GetDigitsDataLoader()->GetBaseLoader(0)->Post(fdigits); Int_t nFiles=fManager->GetNinputs(); for (Int_t inputFile=0; inputFileGetInputFolderName(inputFile)); if (!inRL->GetAliRun()) inRL->LoadgAlice(); AliSTART *fSTART = (AliSTART*) inRL->GetAliRun()->GetDetector("START"); pInStartLoader = inRL->GetLoader("STARTLoader"); pInStartLoader->LoadHits("READ");//probably it is necessary to load them before TClonesArray *fHits = fSTART->Hits (); TTree *th = pInStartLoader->TreeH(); brHits = th->GetBranch("START"); brHitPhoton = th->GetBranch("STARThitPhoton"); if (brHits) { fSTART->SetHitsAddressBranch(brHits,brHitPhoton); }else{ cerr<<"EXEC Branch START hit not found"<GetEntries(); #ifdef DEBUG Info("Digitizer",ntracks); #endif if (ntracks<=0) return; // Start loop on tracks in the hits containers for (Int_t track=0; trackGetEntry(track); nhits = fHits->GetEntriesFast(); for (hit=0;hitUncheckedAt(hit); if (!startHit) { ::Error("Exec","The unchecked hit doesn't exist"); break; } pmt=startHit->Pmt(); volume = startHit->Volume(); if(volume==1){ timeright[pmt] = startHit->Time(); if(timeright[pmt]Time(); if(timeleft[pmt]Gaus(besttimeleft,0.05); bestLeftADC=Int_t (besttimeleftGaus*1000/channelWidth); besttimerightGaus=gRandom->Gaus(besttimeright,0.05); bestRightADC=Int_t (besttimerightGaus*1000/channelWidth); timeDiff=besttimerightGaus-besttimeleftGaus; #ifdef DEBUG cout<<" timediff in ns "<UnloadDigits(); } //------------------------------------------------------------------------ Bool_t AliSTARTDigitizer::RegisterPhotoE(/*AliSTARThitPhoton *hit*/) { Double_t pP = 0.2; Double_t p; p = gRandom->Rndm(); if (p > pP) return kFALSE; return kTRUE; } //----------------------------------------------------------------------------