/************************************************************************** * 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 "AliSTARTdigit.h" #include "AliRunDigitizer.h" #include "AliRun.h" #include "AliPDG.h" #include #include #include ClassImp(AliSTARTDigitizer) //___________________________________________ AliSTARTDigitizer::AliSTARTDigitizer() :AliDigitizer() { // Default ctor - don't use it ; } //___________________________________________ AliSTARTDigitizer::AliSTARTDigitizer(AliRunDigitizer* manager) :AliDigitizer(manager) { cout<<"AliSTARTDigitizer::AliSTARTDigitizer"<2) // cerr<<"AliSTARTDigitizer::AliSTARTDigitizer" // <<"(AliRunDigitizer* manager) was processed"<SDigits2Digits start...\n"; #endif // // From hits to digits // Int_t hit; Int_t nhits; Int_t volume,pmt; char nameDigits[20]; Float_t timediff,timeright,timeleft,timeav; Float_t besttimeright,besttimeleft,meanTime; Int_t channelWidth=10; fHits = new TClonesArray ("AliSTARThit", 1000); AliSTART *START = (AliSTART*) gAlice->GetDetector("START"); AliSTARThit *startHit; TBranch *brHits=0; fdigits= new AliSTARTdigit(); Int_t nFiles=fManager->GetNinputs(); for (Int_t inputFile=0; inputFileGetOutputEventNr()); besttimeright=9999.; besttimeleft=9999.; Int_t timeDiff=0; Int_t timeAv=0; TClonesArray *STARThits = START->Hits (); TTree *th = fManager->GetInputTreeH(inputFile); brHits = th->GetBranch("START"); if (brHits) { START->SetHitsAddressBranch(brHits); }else{ cerr<<"EXEC Branch START hit not found"<GetEntries(); if (ntracks<=0) return; // Start loop on tracks in the hits containers for (Int_t track=0; trackGetEntry(track); nhits = STARThits->GetEntriesFast(); for (hit=0;hitUncheckedAt(hit); pmt=startHit->fPmt; volume = startHit->fVolume; if(volume==1){ timeright = startHit->fTime; if(timerightfTime; // printf("timeleft %f\n",timeleft); if(timeleftGaus(besttimeright,0.05); Float_t besttimeleftGaus=gRandom->Gaus(besttimeleft,0.05); timediff=besttimerightGaus-besttimeleftGaus; meanTime=(besttimerightGaus+besttimeleftGaus)/2.; if ( TMath::Abs(timediff)Set(timeAv,timeDiff); fdigits->Print(); } else {timeAv=999999; timeDiff=99999;} // trick to find out output dir: TTree *outTree = fManager->GetTreeD(); if (!outTree) { cerr<<"something wrong with output...."<GetDirectory()->cd(); fdigits->Write(nameDigits); wd->cd(); } }