]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Time information added in Digits
authorcheynis <cheynis@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 23 Mar 2006 11:17:32 +0000 (11:17 +0000)
committercheynis <cheynis@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 23 Mar 2006 11:17:32 +0000 (11:17 +0000)
VZERO/AliVZERO.cxx
VZERO/AliVZEROBuffer.cxx
VZERO/AliVZEROBuffer.h
VZERO/AliVZERODigitizer.cxx
VZERO/AliVZERODigitizer.h
VZERO/AliVZEROdigit.cxx
VZERO/AliVZEROdigit.h

index ffa8864ad3958695b05ba98d2bba53b16a7f09a2..007d5c0c9b5f7e9d240fc52914bed16badf941b2 100755 (executable)
@@ -282,13 +282,14 @@ void AliVZERO::Digits2Raw()
         AliVZEROdigit* fVZERODigit = (AliVZEROdigit*) VZEROdigits->At(k);                      
        Int_t ADC  = fVZERODigit->ADC();
        Int_t cell = fVZERODigit->CellNumber();
         AliVZEROdigit* fVZERODigit = (AliVZEROdigit*) VZEROdigits->At(k);                      
        Int_t ADC  = fVZERODigit->ADC();
        Int_t cell = fVZERODigit->CellNumber();
+       Int_t ToF  = fVZERODigit->ToF();
         if(fVerbose == 1) { cout <<"DDL: "<<fileName<< "\tdigit number: "<< k<<"\tcell: "
         if(fVerbose == 1) { cout <<"DDL: "<<fileName<< "\tdigit number: "<< k<<"\tcell: "
-                           <<cell<<"\tADC: "<< ADC << endl;} 
+                           <<cell<<"\tADC: "<< ADC << "\tToF: "<< ToF << endl;} 
        if(fVerbose == 2) {
            ftxt<<"DDL: "<<fileName<< "\tdigit number: "<< k<<"\tcell: "
                           <<cell<<"\tADC: "<< ADC << endl;           
        }
        if(fVerbose == 2) {
            ftxt<<"DDL: "<<fileName<< "\tdigit number: "<< k<<"\tcell: "
                           <<cell<<"\tADC: "<< ADC << endl;           
        }
-        buffer->WriteBinary(cell, ADC);
+        buffer->WriteBinary(cell, ADC, ToF);
     }
   if(fVerbose==2) ftxt.close();
   }
     }
   if(fVerbose==2) ftxt.close();
   }
index 73df47db2f42614f48fe99dc07e0bd381551bfcc..9c0ae340d608445ce74fe87065a35c4f8dc511e9 100644 (file)
@@ -74,18 +74,20 @@ AliVZEROBuffer& AliVZEROBuffer::operator=(const AliVZEROBuffer &source){
 }
 
 //_____________________________________________________________________________
 }
 
 //_____________________________________________________________________________
-void AliVZEROBuffer::WriteBinary(Int_t cell,Int_t ADC){
+void AliVZEROBuffer::WriteBinary(Int_t cell,Int_t ADC, Int_t ToF){
   // It writes VZERO digits as a raw data file. 
   // Being called by AliVZERODDL.C
 
   struct DataFile{
     Int_t cell;
     Int_t ADC;
   // It writes VZERO digits as a raw data file. 
   // Being called by AliVZERODDL.C
 
   struct DataFile{
     Int_t cell;
     Int_t ADC;
+    Int_t ToF;
   };
   
   DataFile  data;
   data.cell = cell;
   data.ADC  = ADC;
   };
   
   DataFile  data;
   data.cell = cell;
   data.ADC  = ADC;
+  data.ToF  = ToF;
 
   ofstream ftxt;
   ftxt.open("VZEROdigits.txt",ios::app);
 
   ofstream ftxt;
   ftxt.open("VZEROdigits.txt",ios::app);
index 54391d681d0c30527644e0d4c36a8ed5e113967d..1b52c7660aeba3e0907bbef25ec03103429d2f1b 100644 (file)
@@ -24,7 +24,7 @@ public:
   virtual ~AliVZEROBuffer(); //destructor
   AliVZEROBuffer(const AliVZEROBuffer &source); // copy constructor
   AliVZEROBuffer& operator=(const AliVZEROBuffer &source); // ass. op.
   virtual ~AliVZEROBuffer(); //destructor
   AliVZEROBuffer(const AliVZEROBuffer &source); // copy constructor
   AliVZEROBuffer& operator=(const AliVZEROBuffer &source); // ass. op.
-  void    WriteBinary(Int_t cell,Int_t ADC);
+  void    WriteBinary(Int_t cell,Int_t ADC, Int_t ToF);
   UInt_t  GetDigNumber()const{return fNumberOfDigits;}
   void    SetVerbose(Int_t val){fVerbose=val;}
   Int_t   GetVerbose() const{return  fVerbose;} 
   UInt_t  GetDigNumber()const{return fNumberOfDigits;}
   void    SetVerbose(Int_t val){fVerbose=val;}
   Int_t   GetVerbose() const{return  fVerbose;} 
index 87b286d7a7e7003c1667b8e942b6021b735862ff..c09722ab8a73b319d4521dc25602521f565cda6e 100644 (file)
@@ -57,7 +57,7 @@ ClassImp(AliVZERODigitizer)
   // constructor
   
   fNdigits = 0;
   // constructor
   
   fNdigits = 0;
-  fDigits = 0 ;
+  fDigits  = 0;
   
   fPhotoCathodeEfficiency =   0.18;
   fPMVoltage              =  768.0;
   
   fPhotoCathodeEfficiency =   0.18;
   fPMVoltage              =  768.0;
@@ -94,12 +94,11 @@ void AliVZERODigitizer::Exec(Option_t* /*option*/)
   // Creates digits from hits
   //
   
   // Creates digits from hits
   //
   
-  fNdigits = 0;
-  Int_t map[96];
-  Float_t cPM = fPhotoCathodeEfficiency * fPMGain;
+  Int_t      adc[96]; 
+  Float_t   time[96];    
+  fNdigits      =    0;  
+  Float_t cPM   = fPhotoCathodeEfficiency * fPMGain;
              
              
-  for(Int_t i=0; i<96; i++) map[i] = 0; 
-          
   AliRunLoader* outRunLoader = 
     AliRunLoader::GetRunLoader(fManager->GetOutputFolderName());    
   if (!outRunLoader) {
   AliRunLoader* outRunLoader = 
     AliRunLoader::GetRunLoader(fManager->GetOutputFolderName());    
   if (!outRunLoader) {
@@ -141,6 +140,10 @@ void AliVZERODigitizer::Exec(Option_t* /*option*/)
       Error("Exec", "Cannot get TreeH for input %d", iInput);
       continue; 
     }
       Error("Exec", "Cannot get TreeH for input %d", iInput);
       continue; 
     }
+    
+    Float_t timeV0 = 1e12;      
+    for(Int_t i=0; i<96; i++) { adc[i]  = 0; time[i] = 0.0; }
+             
     TClonesArray* hits = vzero->Hits();
              
 //  Now makes Digits from hits
     TClonesArray* hits = vzero->Hits();
              
 //  Now makes Digits from hits
@@ -154,24 +157,29 @@ void AliVZERODigitizer::Exec(Option_t* /*option*/)
        AliVZEROhit* hit = (AliVZEROhit *)hits->UncheckedAt(iHit);
        Int_t nPhot = hit->Nphot();
        Int_t cell  = hit->Cell();                                    
        AliVZEROhit* hit = (AliVZEROhit *)hits->UncheckedAt(iHit);
        Int_t nPhot = hit->Nphot();
        Int_t cell  = hit->Cell();                                    
-       map[cell] += nPhot;
+       adc[cell] += nPhot;
+       Float_t dt_scintillator = gRandom->Gaus(0,1);
+       time[cell] = dt_scintillator + 1e9*hit->Tof();
+       if(time[cell] < timeV0) timeV0 = time[cell];
       }           // hit   loop
     }             // track loop
 
     loader->UnloadHits();
 
   }               // input loop
       }           // hit   loop
     }             // track loop
 
     loader->UnloadHits();
 
   }               // input loop
-            
-  for (Int_t i=0; i<96; i++) {
-    Float_t q1 = Float_t ( map[i] )* cPM * kQe;
-    Float_t noise = gRandom->Gaus(10.5,3.22);
-    Float_t pmResponse  =  q1/kC*TMath::Power(ktheta/kthau,1/(1-ktheta/kthau)) 
+         
+  for (Int_t i=0; i<96; i++) {    
+     Float_t q1 = Float_t ( adc[i] )* cPM * kQe;
+     Float_t noise = gRandom->Gaus(10.5,3.22);
+     Float_t pmResponse  =  q1/kC*TMath::Power(ktheta/kthau,1/(1-ktheta/kthau)) 
       + noise*1e-3;
       + noise*1e-3;
-    map[i] = Int_t( pmResponse * 200.0);
-    if(map[i] > 3) {
-//    printf(" Event, cell, adc = %d %d %d\n", outRunLoader->GetEventNumber(),i, map[i]);
-      AddDigit(i, map[i]);
+     adc[i] = Int_t( pmResponse * 50.0);
+     if(adc[i] > 0) {
+//         printf(" Event, cell, adc, tof = %d %d %d %f\n", 
+//                  outRunLoader->GetEventNumber(),i, adc[i], time[i]*100.0);
+         AddDigit(i, adc[i], int(time[i]*100.0) );
     } 
     } 
+
   }
 
   treeD->Fill();
   }
 
   treeD->Fill();
@@ -181,13 +189,13 @@ void AliVZERODigitizer::Exec(Option_t* /*option*/)
 }
 
 //____________________________________________________________________________
 }
 
 //____________________________________________________________________________
-void AliVZERODigitizer::AddDigit(Int_t cellnumber, Int_t adc) 
+void AliVZERODigitizer::AddDigit(Int_t cellnumber, Int_t adc, Int_t tof
  { 
  
 // Adds Digit 
  
   TClonesArray &ldigits = *fDigits;  
  { 
  
 // Adds Digit 
  
   TClonesArray &ldigits = *fDigits;  
-  new(ldigits[fNdigits++]) AliVZEROdigit(cellnumber,adc);
+  new(ldigits[fNdigits++]) AliVZEROdigit(cellnumber,adc,tof);
 }
 //____________________________________________________________________________
 void AliVZERODigitizer::ResetDigit()
 }
 //____________________________________________________________________________
 void AliVZERODigitizer::ResetDigit()
index 029c7aba7cf061e21b6264d22ddbf12c69049afe..e8d6f66898d4d537d686a3cf91afc07fc7eacc5c 100644 (file)
@@ -30,7 +30,7 @@ public:
   virtual Bool_t Init();
   virtual void   Exec(Option_t* option=0);
 
   virtual Bool_t Init();
   virtual void   Exec(Option_t* option=0);
 
-  void AddDigit(Int_t cellnumber, Int_t adc);
+  void AddDigit(Int_t cellnumber, Int_t adc, Int_t tof);
   void ResetDigit();
 
  private:
   void ResetDigit();
 
  private:
index 8744ef83108f546610c665520eb0157c139ec701..d7c71f0d19f1d7bcb4abb6c0296adc936a8b4769 100644 (file)
@@ -21,6 +21,7 @@ AliVZEROdigit::AliVZEROdigit()
 {
   fCellNumber = 0;
   fADC        = 0;
 {
   fCellNumber = 0;
   fADC        = 0;
+  fToF        = 0;
 }
 
 AliVZEROdigit::AliVZEROdigit(Int_t* tracks, Int_t *digits):
 }
 
 AliVZEROdigit::AliVZEROdigit(Int_t* tracks, Int_t *digits):
@@ -35,10 +36,11 @@ AliVZEROdigit::AliVZEROdigit(Int_t* tracks, Int_t *digits):
   fEvent      =  digits[0];  
 }
 
   fEvent      =  digits[0];  
 }
 
-AliVZEROdigit::AliVZEROdigit(Int_t cellnumber, Int_t adc)
+AliVZEROdigit::AliVZEROdigit(Int_t cellnumber, Int_t adc, Int_t tof)
 {  
   fCellNumber = cellnumber;
   fADC        = adc;
 {  
   fCellNumber = cellnumber;
   fADC        = adc;
+  fToF        = tof;
 }
 
 
 }
 
 
index 34ef1a47aee2943def8b30d16cb6aed5159266a5..893d5b75a54291aa33c597e69b429c10d0c82ece 100644 (file)
@@ -13,10 +13,11 @@ class AliVZEROdigit: public AliDigit  {
  public:
     AliVZEROdigit();
     AliVZEROdigit(Int_t* tracks, Int_t* digits);
  public:
     AliVZEROdigit();
     AliVZEROdigit(Int_t* tracks, Int_t* digits);
-    AliVZEROdigit(Int_t /* cellnumber */, Int_t /* adc */);
+    AliVZEROdigit(Int_t /* cellnumber */, Int_t /* adc */, Int_t /* tof */);
     virtual ~AliVZEROdigit() {};
     Int_t   CellNumber()  const {return fCellNumber;}    
     Int_t   ADC() const {return fADC;}
     virtual ~AliVZEROdigit() {};
     Int_t   CellNumber()  const {return fCellNumber;}    
     Int_t   ADC() const {return fADC;}
+    Int_t   ToF() const {return fToF;}
      
   private:
     Int_t  fTrack;         // Track number
      
   private:
     Int_t  fTrack;         // Track number
@@ -25,6 +26,7 @@ class AliVZEROdigit: public AliDigit  {
     Int_t  fEvent;         // Event number  
     Int_t  fCellNumber;    // Scintillator cell number
     Int_t  fADC;           // ADC response
     Int_t  fEvent;         // Event number  
     Int_t  fCellNumber;    // Scintillator cell number
     Int_t  fADC;           // ADC response
+    Int_t  fToF;           // Time of Flight
     
     ClassDef(AliVZEROdigit,1)  //Digit (Header) object for set : VZERO
 };
     
     ClassDef(AliVZEROdigit,1)  //Digit (Header) object for set : VZERO
 };