/*
$Id$
$Log$
+ Revision 1.37 2002/10/14 14:57:07 hristov
+ Merging the VirtualMC branch to the main development branch (HEAD)
+
+ Revision 1.32.4.4 2002/10/14 13:14:08 hristov
+ Updating VirtualMC to v3-09-02
+
+ Revision 1.36 2002/09/11 10:32:41 hristov
+ Use new for arrays with variable size
+
+ Revision 1.35 2002/09/09 17:23:28 nilsen
+ Minor changes in support of changes to AliITSdigitS?D class'.
+
+ Revision 1.34 2002/06/07 16:32:28 nilsen
+ Latest SDD changes to speed up the SDD simulation code.
+
+ Revision 1.33 2002/04/24 22:02:31 nilsen
+ New SDigits and Digits routines, and related changes, (including new
+ noise values).
+
*/
-#include <iostream.h>
+#include <Riostream.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
fMaxNofSamples = 0;
fITS = 0;
fTreeB = 0;
+ fAnodeFire = 0;
SetScaleFourier();
SetPerpendTracksFlag();
SetCrosstalkFlag();
fNofMaps = fSegmentation->Npz();
fMaxNofSamples = fSegmentation->Npx();
-
+ fAnodeFire = new Bool_t [fNofMaps];
+
Float_t sddLength = fSegmentation->Dx();
Float_t sddWidth = fSegmentation->Dz();
} // end if
const char *kopt=fResponse->ZeroSuppOption();
- if (strstr(fParam,"file") ) {
+ if (strstr(fParam.Data(),"file") ) {
fD.Set(fNofMaps);
fT1.Set(fNofMaps);
if (strstr(kopt,"2D")) {
if(fInZI) delete [] fInZI;
if(fOutZR) delete [] fOutZR;
if(fOutZI) delete [] fOutZI;
+ if(fAnodeFire) delete [] fAnodeFire;
}
//______________________________________________________________________
void AliITSsimulationSDD::InitSimulationModule( Int_t module, Int_t event ) {
fModule = module;
fEvent = event;
ClearMaps();
+ memset(fAnodeFire,0,sizeof(Bool_t)*fNofMaps);
}
//______________________________________________________________________
void AliITSsimulationSDD::ClearMaps() {
// Add Summable digits to module maps.
Int_t nItems = pItemArray->GetEntries();
Double_t maxadc = fResponse->MaxAdc();
- Bool_t sig = kFALSE;
+ //Bool_t sig = kFALSE;
// cout << "Adding "<< nItems <<" SDigits to module " << fModule << endl;
for( Int_t i=0; i<nItems; i++ ) {
Error( "AliITSsimulationSDD",
"Error reading, SDigits module %d != current module %d: exit\n",
pItem->GetModule(), fModule );
- return sig;
+ return kFALSE;
} // end if
- if(pItem->GetSignal()>0.0 ) sig = kTRUE;
+ // if(pItem->GetSignal()>0.0 ) sig = kTRUE;
+
fpList->AddItemTo( mask, pItem ); // Add SignalAfterElect + noise
AliITSpListItem * pItem2 = fpList->GetpListItem( pItem->GetIndex() );
Double_t sigAE = pItem2->GetSignalAfterElect();
Int_t it;
fpList->GetMapIndex( pItem->GetIndex(), ia, it );
fHitMap2->SetHit( ia, it, sigAE );
+ fAnodeFire[ia] = kTRUE;
}
- return sig;
+ return kTRUE;
}
//______________________________________________________________________
void AliITSsimulationSDD::FinishSDigitiseModule() {
fHitMap2->SetHit(index, it-1, charge);
fpList->AddSignal(index,it-1,itrack,ii-1,
mod->GetIndex(),timeAmplitude);
+ fAnodeFire[index] = kTRUE;
} // end if anodeAmplitude and loop over time in window
} // loop over anodes in window
} // end loop over "sub-hits"
//____________________________________________
void AliITSsimulationSDD::AddDigit( Int_t i, Int_t j, Int_t signal ) {
// Adds a Digit.
- Int_t digits[3], tracks[3], hits[3];
- Float_t phys, charges[3];
+ Int_t size = AliITSdigitSPD::GetNTracks();
+ Int_t digits[3];
+ Int_t * tracks = new Int_t[size];
+ Int_t * hits = new Int_t[size];
+ Float_t phys;
+ Float_t * charges = new Float_t[size];
if( fResponse->Do10to8() ) signal = Convert8to10( signal );
digits[0] = i;
AliITSpListItem *pItem = fpList->GetpListItem( i, j );
if( pItem == 0 ) {
phys = 0.0;
- for( Int_t l=0; l<3; l++ ) {
+ for( Int_t l=0; l<size; l++ ) {
tracks[l] = 0;
hits[l] = 0;
charges[l] = 0.0;
if( idtrack >= 0 ) phys = pItem->GetSignal();
else phys = 0.0;
- for( Int_t l=0; l<3; l++ ) {
+ for( Int_t l=0; l<size; l++ ) if(l<pItem->GetMaxKept()) {
tracks[l] = pItem->GetTrack( l );
hits[l] = pItem->GetHit( l );
charges[l] = pItem->GetSignal( l );
- }
+ }else{
+ tracks[l] = -3;
+ hits[l] = -1;
+ charges[l] = 0.0;
+ }// end for if
}
fITS->AddSimDigit( 1, phys, digits, tracks, hits, charges );
+ delete [] tracks;
+ delete [] hits;
+ delete [] charges;
}
/*
Float_t maxadc = fResponse->MaxAdc();
if(!fDoFFT) {
for (i=0;i<fNofMaps;i++) {
+ if( !fAnodeFire[i] ) continue;
if (read && i<fNofMaps) GetAnodeBaseline(i,baseline,noise);
for(k=0; k<fScaleSize*fMaxNofSamples; k++) {
fInZR[k] = fHitMap2->GetSignal(i,k);
} // end if DoFFT
for (i=0;i<fNofMaps;i++) {
+ if( !fAnodeFire[i] ) continue;
if (read && i<fNofMaps) GetAnodeBaseline(i,baseline,noise);
for(k=0; k<fScaleSize*fMaxNofSamples; k++) {
fInZR[k] = fHitMap2->GetSignal(i,k);
// Albert W.) :
// Read 2D zero-suppression parameters for SDD
- if (!strstr(fParam,"file")) return;
+ if (!strstr(fParam.Data(),"file")) return;
Int_t na,pos,tempTh;
Float_t mu,sigma;
// Torino people should give input
// Read 1D zero-suppression parameters for SDD
- if (!strstr(fParam,"file")) return;
+ if (!strstr(fParam.Data(),"file")) return;
Int_t na,pos,tempTh;
Float_t mu,sigma;
for (i=0; i<fNofMaps/2; i++) {
Bool_t firstSignal=kTRUE;
Int_t idx=i+k*fNofMaps/2;
+ if( !fAnodeFire[idx] ) continue;
CompressionParam(idx,decr,thres);
for (j=0; j<fMaxNofSamples; j++) {
Int_t signal=(Int_t)(fHitMap2->GetSignal(idx,j));
static AliITS *aliITS = (AliITS*)gAlice->GetModule("ITS");
for( Int_t i=0; i<fNofMaps; i++ ) {
+ if( !fAnodeFire[i] ) continue;
for( Int_t j=0; j<fMaxNofSamples; j++ ) {
Double_t sig = fHitMap2->GetSignal( i, j );
if( sig > 0.2 ) {