]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - AD/AliADv1.cxx
First implementation of digitizer for AD
[u/mrichter/AliRoot.git] / AD / AliADv1.cxx
index 74de1bbbd74e1ef956f6e614fed3382ce83ceaea..d91dc72db85ee7a3ac0d20ef298cdb02b426d93a 100644 (file)
@@ -426,16 +426,16 @@ void AliADv1::StepManager()
       
       
    // Get sensitive volumes id (scintillator pads)
-   static Int_t idADA = TVirtualMC::GetMC()->VolId( "ADApad" );
-   static Int_t idADC = TVirtualMC::GetMC()->VolId( "ADCpad" );
+   static Int_t idADA = gMC->VolId( "ADApad" );
+   static Int_t idADC = gMC->VolId( "ADCpad" );
    
    // We keep only charged tracks : 
-   // if ( !TVirtualMC::GetMC()->TrackCharge() || !TVirtualMC::GetMC()->IsTrackAlive() ) return;   
+   // if ( !gMC->TrackCharge() || !gMC->IsTrackAlive() ) return;   
    // We keep charged and non-charged tracks : 
-   if ( !TVirtualMC::GetMC()->IsTrackAlive() ) return;   
+   if ( !gMC->IsTrackAlive() ) return;   
    
    Int_t copy;
-   Int_t current_volid = TVirtualMC::GetMC()->CurrentVolID( copy );
+   Int_t current_volid = gMC->CurrentVolID( copy );
 
    // check is the track is in a sensitive volume
    if( current_volid != idADA && current_volid != idADC ) {
@@ -445,7 +445,7 @@ void AliADv1::StepManager()
    // First read the position, otherwise weird reults! //ecv
    Double_t s[3];
    Float_t  x[3];
-   TVirtualMC::GetMC()->TrackPosition( s[0], s[1], s[2] );
+   gMC->TrackPosition( s[0], s[1], s[2] );
    for ( Int_t j=0; j<3; j++ ) x[j] = s[j];
    
    // Set detectro type: ADA or ADC
@@ -453,11 +453,11 @@ void AliADv1::StepManager()
    
    // Get sector copy (1,2,3,4) ( 1 level up from pad )
    Int_t sect;
-   TVirtualMC::GetMC()->CurrentVolOffID( 1, sect );
+   gMC->CurrentVolOffID( 1, sect );
 
    // Get Detector copy (1,2) ( 2 levels up from pad )
    Int_t detc;
-   TVirtualMC::GetMC()->CurrentVolOffID( 2, detc );
+   gMC->CurrentVolOffID( 2, detc );
    
    // Sector number 
    // ADA1 = 10-14
@@ -477,8 +477,8 @@ void AliADv1::StepManager()
       photoCathodeEfficiency = fADAPhotoCathodeEfficiency;
    }
       
-   Float_t destep_ad = TVirtualMC::GetMC()->Edep();
-   Float_t step_ad   = TVirtualMC::GetMC()->TrackStep();
+   Float_t destep_ad = gMC->Edep();
+   Float_t step_ad   = gMC->TrackStep();
    Int_t  nPhotonsInStep_ad = Int_t( destep_ad / (lightYield_ad * 1e-9) ); 
    nPhotonsInStep_ad = gRandom->Poisson( nPhotonsInStep_ad );
    
@@ -491,10 +491,10 @@ void AliADv1::StepManager()
    eloss_ad   += destep_ad;
    tlength_ad += step_ad;  
  
-   if ( TVirtualMC::GetMC()->IsTrackEntering() ) { 
+   if ( gMC->IsTrackEntering() ) { 
       nPhotons_ad = nPhotonsInStep_ad;
       Double_t p[4];
-      TVirtualMC::GetMC()->TrackMomentum( p[0], p[1], p[2], p[3] );
+      gMC->TrackMomentum( p[0], p[1], p[2], p[3] );
       Float_t pt  = TMath::Sqrt( p[0]*p[0] + p[1]*p[1] + p[2]*p[2] ); 
       TParticle *par = gAlice->GetMCApp()->Particle(gAlice->GetMCApp()->GetCurrentTrackNumber());
       Int_t imo = par->GetFirstMother();
@@ -517,7 +517,7 @@ void AliADv1::StepManager()
       hits_ad[5]  = p[0];     // Px
       hits_ad[6]  = p[1];     // Py
       hits_ad[7]  = p[2];     // Pz
-      hits_ad[8]  = 1.0e09*TVirtualMC::GetMC()->TrackTime(); // in ns!
+      hits_ad[8]  = 1.0e09*gMC->TrackTime(); // in ns!
   
       tlength_ad = 0.0;
       eloss_ad   = 0.0; 
@@ -527,7 +527,7 @@ void AliADv1::StepManager()
    
    nPhotons_ad += nPhotonsInStep_ad;
 
-   if( TVirtualMC::GetMC()->IsTrackExiting() || TVirtualMC::GetMC()->IsTrackStop() || TVirtualMC::GetMC()->IsTrackDisappeared() ) {
+   if( gMC->IsTrackExiting() || gMC->IsTrackStop() || gMC->IsTrackDisappeared() ) {
 
       // Set integer values
       vol_ad[3]  = nPhotons_ad;
@@ -568,7 +568,7 @@ void AliADv1::StepManager()
    }
        
    //   Do we need track reference ????
-   // if( TVirtualMC::GetMC()->IsTrackEntering() || TVirtualMC::GetMC()->IsTrackExiting() ) {
+   // if( gMC->IsTrackEntering() || gMC->IsTrackExiting() ) {
    //    AddTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber(), 49);
    // }
 }
@@ -579,12 +579,6 @@ void AliADv1::AddHit(Int_t track, Int_t *vol, Float_t *hits)
        new(lhits[fNhits++]) AliADhit(fIshunt,track,vol,hits);
 }
 //_________________________________________________________
-void AliADv1::AddDigits(Int_t* track, Int_t module, Float_t time)
-{
-       TClonesArray &ldigits = *fDigits;
-       new(ldigits[fNdigits++]) AliADdigit(track,module,time);
-}
-//_________________________________________________________
 void AliADv1::MakeBranch(Option_t *option)
 {