,fSimuParam(0)
,fResponseParam(0)
,fModule(0)
+ ,fReadOutCycleOffset(0)
+ ,fReadOutCycleLength(25e-6)
,fEvent(0)
,fDebug(0)
{
,fSimuParam(sim)
,fResponseParam(0)
,fModule(0)
+ ,fReadOutCycleOffset(0)
+ ,fReadOutCycleLength(25e-6)
,fEvent(0)
,fDebug(0)
{
,fSimuParam(s.fSimuParam)
,fResponseParam(s.fResponseParam)
,fModule(s.fModule)
+ ,fReadOutCycleOffset(s.fReadOutCycleOffset)
+ ,fReadOutCycleLength(s.fReadOutCycleLength)
,fEvent(s.fEvent)
,fDebug(s.fDebug)
{
fSimuParam = s.fSimuParam;
fResponseParam = s.fResponseParam;
fModule = s.fModule;
+ fReadOutCycleOffset = s.fReadOutCycleOffset;
+ fReadOutCycleLength = s.fReadOutCycleLength;
fEvent = s.fEvent;
return *this;
}
SetSegmentation(seg);
SetResponseParam(resp);
ClearMap();
- memset(fCyclesID,0,2*kMaxROCycleAccept*sizeof(Bool_t));
+ memset(fCyclesID,0,(1+2*kMaxROCycleAccept)*sizeof(Bool_t));
//
- if (event != fEvent) GenerateReadOutCycleOffset();
SetEvent(event);
}
{
// update map with new hit
// Note: roCycle can be anything between -kMaxROCycleAccept : kMaxROCycleAccept
+ if (Abs(roCycle)>kMaxROCycleAccept) {
+ AliError(Form("CycleID %d is outside of allowed +-%d range",roCycle,kMaxROCycleAccept));
+ return;
+ }
UInt_t ind = fSensMap->GetIndex(col,row,roCycle);
- AliITSUSDigit* oldItem = (AliITSUSDigit*)fSensMap->GetItem(ind);
- if (!oldItem) {
+ AliITSUSDigit* oldItem = (AliITSUSDigit*)fSensMap->GetItem(ind);
+ if (!oldItem) {
fSensMap->RegisterItem( new(fSensMap->GetFree()) AliITSUSDigit(trk,ht,fModule->GetIndex(),ind,signal,roCycle) );
fCyclesID[roCycle+kMaxROCycleAccept] = kTRUE;
}
else oldItem->AddSignal(trk,ht,signal);
+ //
}
//______________________________________________________________________
void AliITSUSimulation::UpdateMapNoise(UInt_t col,UInt_t row,Double_t noise, Int_t roCycle)
{
// update map with new hit
+ if (Abs(roCycle)>kMaxROCycleAccept) {
+ AliError(Form("CycleID %d is outside of allowed +-%d range",roCycle,kMaxROCycleAccept));
+ return;
+ }
UInt_t ind = fSensMap->GetIndex(col,row,roCycle);
AliITSUSDigit* oldItem = (AliITSUSDigit*)fSensMap->GetItem(ind);
if (!oldItem) {
Sort((int)ngen,valA,indA,kFALSE);
return ngen;
}
+
+//______________________________________________________________________
+Double_t AliITSUSimulation::GenerateReadOutCycleOffset()
+{
+ // Generate randomly the strobe
+ // phase w.r.t to the LHC clock
+ return fReadOutCycleOffset = fReadOutCycleLength*gRandom->Rndm();
+ // fReadOutCycleOffset = 25e-9*gRandom->Rndm(); // clm: I think this way we shift too much 10-30 us! The global shift should be between the BCs?!
+ // RS: 25 ns is too small number, the staggering will not work. Let's at the moment keep fully random shift (still, no particle from correct
+ // collision will be lost) untill real number is specified
+ //
+}