]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
new Digits structure
authoralla <alla@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 23 Jul 2002 11:48:05 +0000 (11:48 +0000)
committeralla <alla@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 23 Jul 2002 11:48:05 +0000 (11:48 +0000)
15 files changed:
START/AliSTART.cxx
START/AliSTART.h
START/AliSTARTDigitizer.cxx
START/AliSTARTDigitizer.h
START/AliSTARTdigit.cxx
START/AliSTARTdigit.h
START/AliSTARTv1.cxx
START/AliSTARTvertex.cxx
START/Makefile
START/STARTDigit.C
START/STARTLinkDef.h
START/VertexMaker.C
START/libSTART.pkg
START/readDigits.C
START/readVertex.C

index 4d4945196999c65af6235c1db2815f549b68036f..bfbad933763285151f272293f12c6e1598bce070 100755 (executable)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.23  2001/09/19 18:41:45  alla
+Asimmetric START geometry
+
 Revision 1.22  2001/07/27 13:03:12  hristov
 Default Branch split level set to 99
 
@@ -115,6 +118,7 @@ Introduction of the Copyright and cvs Log
 #include "AliSTARTdigit.h"
 #include "AliMC.h"
 #include "AliSTARThit.h"
+#include "AliSTARThitPhoton.h"
 #include "AliSTARTvertex.h"
 
 ClassImp(AliSTART)
@@ -130,6 +134,7 @@ AliSTART::AliSTART()
   fIshunt   = 1;
   fHits     = 0;
   fDigits   = 0;
+  fPhotons  = 0;
 }
  
 //_____________________________________________________________________________
@@ -145,9 +150,13 @@ AliSTART::AliSTART(const char *name, const char *title)
   // Initialise Hit array
   fHits       = new TClonesArray("AliSTARThit",  405);
   gAlice->AddHitList(fHits);
+
+  fPhotons  = new TClonesArray("AliSTARThitPhoton", 10000);
+  gAlice->AddHitList (fPhotons);
   
   fIshunt     =  1;
   fIdSens   =  0;
+  fNPhotons =  0;
   SetMarkerColor(kRed);
 }
 
@@ -157,6 +166,10 @@ AliSTART::~AliSTART() {
     fHits->Delete();
     delete fHits;
   }
+  if (fPhotons) {
+    fPhotons->Delete();
+    delete fPhotons;
+  }
 }
  
 //_____________________________________________________________________________
@@ -169,6 +182,15 @@ void AliSTART::AddHit(Int_t track, Int_t *vol, Float_t *hits)
   new(lhits[fNhits++]) AliSTARThit(fIshunt,track,vol,hits);
 }
 
+//_____________________________________________________________________________
+void AliSTART::AddHitPhoton(Int_t track, Int_t *vol, Float_t *hits)
+{
+  //  Add a START hit of photons
+  
+  TClonesArray &lhits = *fPhotons;
+  new(lhits[fNPhotons++]) AliSTARThitPhoton(fIshunt,track,vol,hits);
+}
+
 //_____________________________________________________________________________
 
 void AliSTART::AddDigit(Int_t *tracks,Int_t *digits)
@@ -242,13 +264,21 @@ void AliSTART::MakeBranch(Option_t* option, const char *file)
   // Specific START branches
   //
   // Create Tree branches for the START.
-  Int_t buffersize = 400;
-  char branchname[10];
+  Int_t buffersize = 4000;
+  char branchname[20];
   sprintf(branchname,"%s",GetName());
 
   AliDetector::MakeBranch(option,file);
 
   const char *cD = strstr(option,"D");
+  const char *cH = strstr(option,"H");
+  
+  if (cH)
+  {
+     sprintf (branchname, "%shitPhoton", GetName());
+     MakeBranchInTree (gAlice->TreeH(), branchname, &fPhotons, 50000, file);
+  } 
+
   
   if (cD) {
     digits = new AliSTARTdigit();
@@ -265,6 +295,33 @@ void AliSTART::MakeBranch(Option_t* option, const char *file)
   */
 }    
 
+//_____________________________________________________________________________
+void AliSTART::ResetHits()
+{
+  AliDetector::ResetHits();
+  
+  fNPhotons = 0;
+  if (fPhotons)  fPhotons->Clear();
+}
+
+//_____________________________________________________________________________
+void AliSTART::SetTreeAddress()
+{
+  TBranch      *branch;
+  TTree                *treeH;
+
+  AliDetector::SetTreeAddress();
+  treeH = gAlice->TreeH();
+  
+  if (treeH)
+    if (fPhotons)
+    {
+       branch = treeH->GetBranch ("STARThitPhoton");
+       if (branch)  branch->SetAddress (&fPhotons);
+    }
+}
+
+
 //_____________________________________________________________________________
 
 void AliSTART::Hit2digit(Int_t evnum) 
@@ -272,6 +329,7 @@ void AliSTART::Hit2digit(Int_t evnum)
   //
   // From hits to digits
   //
+  /*
   Float_t x,y,e;
   Int_t nbytes = 0;
   Int_t hit;
@@ -376,7 +434,7 @@ void AliSTART::Hit2digit(Int_t evnum)
     td->Fill();
     printf("digits-> %d \n",digits->GetTime());
     td->Write();
-
+  */
 }
 
 
index 31aaad4dae698d12f04a4ac6f63a726f0d1a07ff..083b863e035bd5ddac66e1ff607a2027eb5d120f 100755 (executable)
@@ -25,6 +25,7 @@ public:
    AliSTART(const char *name, const char *title);
    virtual       ~AliSTART();
    virtual void   AddHit(Int_t track, Int_t *vol, Float_t *hits);
+   virtual void   AddHitPhoton(Int_t track, Int_t *vol, Float_t *hits);
    virtual void   AddDigit(Int_t *tracks, Int_t *digits);
    virtual void   BuildGeometry();
    virtual void   CreateGeometry(){}
@@ -33,17 +34,24 @@ public:
    virtual void   DrawDetector(){}
    virtual Int_t  IsVersion()const {return 0;}
    virtual void   Init();
-   virtual void SetHitsAddressBranch(TBranch *b){b->SetAddress(&fHits);}
+   virtual void SetHitsAddressBranch(TBranch *b1,TBranch *b2)
+     {b1->SetAddress(&fHits); b2=0;}
    void Hit2digit(Int_t iEventNum);
    void Hit2digit(){return;}
    virtual void   MakeBranch(Option_t *opt=" ", const char *file=0);
    virtual void   StepManager(){}
+   virtual void   ResetHits();
+   virtual void   SetTreeAddress();
+   TClonesArray   *Photons() {return fPhotons;}
    
 protected:
    Int_t fIdSens;    // Sensetive Cherenkov radiator
+   Int_t       fNPhotons;              // Number of photons plan to photokatod
+
+   TClonesArray                *fPhotons;      // List of photons
 
 private:
-  ClassDef(AliSTART,1)  //Base class for the T0 aka START detector
+  ClassDef(AliSTART,2)  //Base class for the T0 aka START detector
 };
 
 //_____________________________________________________________________________
index 3ad3d451dd0747905d791020b37b7b787c1d2a36..65b473a1f4ea335f7469df87fb6c1180efce58aa 100644 (file)
 #include <TFile.h>
 #include <TDirectory.h>
 #include <TRandom.h>
+#include <TArrayI.h>
+#include <TH1.h>
 
 
 #include "AliSTARTDigitizer.h"
 #include "AliSTART.h"
 #include "AliSTARThit.h"
+#include "AliSTARThitPhoton.h"
 #include "AliSTARTdigit.h"
 #include "AliRunDigitizer.h"
-
+#include "AliHeader.h"
+#include "AliGenEventHeader.h"
 #include "AliRun.h"
 #include "AliPDG.h"
 
@@ -80,48 +84,93 @@ Bool_t AliSTARTDigitizer::Init()
 void AliSTARTDigitizer::Exec(Option_t* option)
 {
 
-
-
+  cout<<" AliSTARTDigitizer::Exec"<<endl;
 #ifdef DEBUG
   cout<<"AliSTARTDigitizer::>SDigits2Digits start...\n";
 #endif
   //
   // From hits to digits
   //
-  Int_t hit;
-  Int_t nhits;
-  Int_t volume,pmt;
+  Int_t hit, nhits;
+  Int_t CountEr[13],CountEl[13];                                                       //!!!
+  Int_t volume,pmt,tr,tl,sumRight;
   char nameDigits[20];
-  Float_t timediff,timeright,timeleft,timeav;
+  Float_t timediff,timeav;
   Float_t besttimeright,besttimeleft,meanTime;
-  Int_t channelWidth=10;
+  Int_t  bestRightADC,bestLeftADC;
+  Float_t besttimeleftGaus, besttimerightGaus;
+  Float_t timeright[13]={13*0};
+  Float_t timeleft[13]={13*0};
+  Float_t channelWidth=2.5; //ps
+  Int_t channelWidthADC=1; //ps
+  Int_t thresholdAmpl=10;
+
+  ftimeRightTDC = new TArrayI(12); 
+  ftimeLeftTDC = new TArrayI(12); 
+  fRightADC = new TArrayI(12); 
+  fLeftADC = new TArrayI(12); 
+  
+
   fHits = new TClonesArray ("AliSTARThit", 1000);
+  fPhotons = new TClonesArray ("AliSTARThitPhoton", 10000);                    //!!!
   AliSTART *START  = (AliSTART*) gAlice->GetDetector("START");
 
   AliSTARThit  *startHit;
+  AliSTARThitPhoton  *startHitPhoton;                                          //!!!
   TBranch *brHits=0;
+  TBranch *brHitPhoton=0;
   fdigits= new AliSTARTdigit();
 
   Int_t nFiles=fManager->GetNinputs();
   for (Int_t inputFile=0; inputFile<nFiles;  inputFile++) {
-    sprintf(nameDigits,"START_D_%d",fManager->GetOutputEventNr());
+
  
+
     besttimeright=9999.;
     besttimeleft=9999.;
     Int_t timeDiff=0;
     Int_t timeAv=0;
+    sumRight=0;
+    for (Int_t i0=0; i0<13; i0++)
+      {
+       timeright[i0]=0; timeleft[i0]=0;
+       CountEr[i0]=0;   CountEl[i0]=0;
+      }
     TClonesArray *STARThits = START->Hits ();
+    TClonesArray *STARThitsPhotons = START->Photons ();
 
    TTree *th = fManager->GetInputTreeH(inputFile);
     brHits = th->GetBranch("START");
+    brHitPhoton = th->GetBranch("STARThitPhoton");
     if (brHits) {
-      START->SetHitsAddressBranch(brHits);
+      START->SetHitsAddressBranch(brHits,brHitPhoton);
     }else{
       cerr<<"EXEC Branch START hit not found"<<endl;
       exit(111);
     } 
     Int_t ntracks    = (Int_t) th->GetEntries();
+    cout<<" ntracks "<<ntracks<<endl;
     if (ntracks<=0) return;
+    // Start loop on tracks in the photon hits containers 
+    // for amplitude
+    if(brHitPhoton) {
+      for (Int_t track=0; track<ntracks;track++) {
+       brHitPhoton -> GetEntry(track);;
+       nhits = STARThitsPhotons->GetEntriesFast();
+       for (hit=0;hit<nhits;hit++) {
+         startHitPhoton   = (AliSTARThitPhoton*) 
+          STARThitsPhotons ->UncheckedAt(hit);
+         pmt=startHitPhoton->fPmt;
+         volume = startHitPhoton->fArray;
+         if(RegisterPhotoE(startHitPhoton)) 
+           {
+             if (volume == 1) CountEr[pmt]++;
+             if (volume == 2) CountEl[pmt]++;
+           }
+       } //hit photons
+      } //track photons
+    } // was photons
+
     // Start loop on tracks in the hits containers
     for (Int_t track=0; track<ntracks;track++) {
       brHits->GetEntry(track);
@@ -131,65 +180,120 @@ void AliSTARTDigitizer::Exec(Option_t* option)
        pmt=startHit->fPmt;
        volume = startHit->fVolume;
        if(volume==1){
-         timeright = startHit->fTime;
-         if(timeright<besttimeright) {
-           besttimeright=timeright;
+         timeright[pmt] = startHit->fTime;
+         if(timeright[pmt]<besttimeright)
+           //&&CountEr[pmt-1]>thresholdAmpl)
+           {
+           besttimeright=timeright[pmt];
          } //timeright
        }//time for right shoulder
        if(volume==2){            
-         timeleft = startHit->fTime;
-         if(timeleft<besttimeleft) {
-           besttimeleft=timeleft;
+         timeleft[pmt] = startHit->fTime;
+         if(timeleft[pmt]<besttimeleft)
+           //&&CountEl[pmt-1]>thresholdAmpl) 
+           {
+           besttimeleft=timeleft[pmt];
+           
          } //timeleftbest
        }//time for left shoulder
       } //hit loop
     } //track loop
  
+    // z position
+    cout<<" right time  "<<besttimeright<<
+      " right distance "<<besttimeright*30<<endl;;
+    cout<<" left time  "<<besttimeleft<<
+      " right distance "<<besttimeleft*30<<endl;;
+  
+
     //folding with experimental time distribution
-    Float_t besttimerightGaus=gRandom->Gaus(besttimeright,0.05);
+    
+    besttimerightGaus=gRandom->Gaus(besttimeright,0.05);
+    //    cout<<" besttimerightGaus "<<besttimerightGaus<<endl;
+    bestRightADC=(Int_t) besttimerightGaus*1000/channelWidth;
     Float_t koef=69.7/350.;
     besttimeleft=koef*besttimeleft;
-    Float_t besttimeleftGaus=gRandom->Gaus(besttimeleft,0.05);
+    besttimeleftGaus=gRandom->Gaus(besttimeleft,0.05);
+    
+    bestLeftADC=(Int_t) besttimeleftGaus*1000/channelWidth;
     timediff=besttimerightGaus-besttimeleftGaus;
+    cout<<" timediff in ns "<<timediff<<" z= "<<timediff*30<<endl;
     meanTime=(besttimerightGaus+besttimeleftGaus)/2.;
-    if ( TMath::Abs(timediff)<TMath::Abs(3.) && meanTime<TMath::Abs(5.)) 
-     {
-       //we assume centre of bunch is 5ns after TTS signal
-       //TOF values are relative of the end of bunch
-       Float_t ppBunch=25;
-    
-       ppBunch=ppBunch-10/2;
-       Float_t t1=1000.*besttimeleftGaus;
-       Float_t t2=1000.*besttimerightGaus;
-       t1=t1/channelWidth+ppBunch; //time in ps to channelWidth
-       t2=t2/channelWidth+ppBunch; //time in ps to channelWidth
-       timeav=(t1+t2)/2.;
-     
-       // Time to TDC signal
-       // 256 channels for timediff, range 1ns
-       
-       timediff=128+1000*timediff/channelWidth; // time in ps 
-
-       timeAv = (Int_t)(timeav);   // time (ps) channel numbres
-       timeDiff = (Int_t)(timediff); // time ( ps) channel numbres
-       fdigits->Set(timeAv,timeDiff);
-       fdigits->Print();
-     }
+    if ( TMath::Abs(timediff)<TMath::Abs(0.3) ) 
+      {
+       Float_t t1=1000.*besttimeleftGaus;
+       Float_t t2=1000.*besttimerightGaus;
+       t1=t1/channelWidth;   //time in ps to channelWidth
+       t2=t2/channelWidth;   //time in ps to channelWidth
+       timeav=(t1+t2)/2.;
+       
+       // Time to TDC signal
+       // 256 channels for timediff, range 1ns
+       
+       timediff=512+1000*timediff/channelWidth; // time in ps 
+       
+       timeAv = (Int_t)(timeav);   // time  channel numbres
+       timeDiff = (Int_t)(timediff); // time  channel numbres
+       //       fill digits
+       fdigits->SetTimeBestLeft(bestLeftADC);
+       fdigits->SetTimeBestRight(bestRightADC);
+       fdigits->SetMeanTime(timeAv);
+       fdigits->SetTimeDiff(timeDiff);
+       for (Int_t i=0; i<12; i++)
+         {
+           //  fill TDC
+           timeright[i+1]=gRandom->Gaus(timeright[i+1],0.05);
+           timeleft[i+1]=gRandom->Gaus(timeleft[i+1],0.05);
+           tr= Int_t (timeright[i+1]*1000/channelWidth); 
+           if(tr<200) tr=0;
+           tl= Int_t (timeleft[i+1]*1000/channelWidth); 
+           if(tl<1000) tl=0;
+           
+           ftimeRightTDC->AddAt(tr,i);
+           ftimeLeftTDC->AddAt(tl,i);
+           //fill ADC
+           Int_t al=( Int_t ) CountEl[i+1]/ channelWidthADC;
+           Int_t ar=( Int_t ) CountEr[i+1]/ channelWidthADC;
+           fRightADC->AddAt(ar,i);
+           fLeftADC ->AddAt(al,i);
+           sumRight+=CountEr[i+1];
+         }
+       fdigits->SetTimeRight(*ftimeRightTDC);
+       fdigits->SetTimeLeft(*ftimeLeftTDC);
+       fdigits->SetADCRight(*fRightADC);
+       fdigits->SetADCLeft(*fLeftADC);
+       // cout<<" before sum"<<endl;
+       fdigits->SetSumADCRight(sumRight);
+      }
     else
       {timeAv=999999; timeDiff=99999;}
-
-// trick to find out output dir:
+    
+    // trick to find out output dir:
     TTree *outTree = fManager->GetTreeD();
     if (!outTree) {
       cerr<<"something wrong with output...."<<endl;
       exit(111);
     }
+
     TDirectory *wd = gDirectory;
     outTree->GetDirectory()->cd();
+    sprintf(nameDigits,"START_D_%d",fManager->GetOutputEventNr());
     fdigits->Write(nameDigits);
+    cout<<nameDigits<<endl;
     wd->cd();
   }
-
 }
 
 
+//------------------------------------------------------------------------
+Bool_t AliSTARTDigitizer::RegisterPhotoE(AliSTARThitPhoton *hit)
+{
+    Double_t    P = 0.2;    
+    Double_t    p;
+    
+    p = gRandom->Rndm();
+    if (p > P)
+      return kFALSE;
+    
+    return kTRUE;
+}
index 0b16e1b5b7f358a29c8788e885a80730ff4a487c..fac625c545b5a6389b4a7fe7c8d300338e7b3ec2 100644 (file)
@@ -8,6 +8,7 @@
 class AliRunDigitizer;
 class AliSTART;
 class AliSTARThit;
+class AliSTARThitPhoton;
 class AliSTARTdigit;
 
 class AliSTARTDigitizer : public AliDigitizer {
@@ -18,17 +19,25 @@ class AliSTARTDigitizer : public AliDigitizer {
   virtual ~AliSTARTDigitizer();
   virtual Bool_t Init();
   TClonesArray *Hits() const {return fHits;}
-  
+  TClonesArray *Photons() const {return fPhotons;}
+  //  TArrayI *timeRightADC() {return ftimeRightADC;}
+  // TArrayI *timeLeftADC() {return ftimeLeftADC;}
   // Do the main work
   void Exec(Option_t* option=0) ;
+  Bool_t RegisterPhotoE(AliSTARThitPhoton *hit);                       //!!!
   
   enum {kBgTag = -1};
 
 private:
 
   AliSTART *START;
+  TClonesArray *fPhotons   ;                                           //!!! 
   TClonesArray *fHits      ; // List of summable digits
   AliSTARTdigit *fdigits   ; // digits
+  TArrayI *ftimeRightTDC    ;
+  TArrayI *ftimeLeftTDC     ;
+  TArrayI *fRightADC    ;
+  TArrayI *fLeftADC     ;
      
     ClassDef(AliSTARTDigitizer,0)
 };    
index f8a9da6ce7aa14f137993354c926241ece0f044a..ee007344408c1d15155755a1db487067edefe75c 100644 (file)
@@ -14,6 +14,9 @@
  **************************************************************************/
 /*
 $Log$
+Revision 1.4  2000/10/13 13:14:08  hristov
+Bug fixes and code cleaning
+
 Revision 1.3  2000/07/13 16:41:29  fca
 New START corrected for coding conventions
 
@@ -22,8 +25,123 @@ New AliSTART
 
 */ 
 
+#include <TArrayI.h>
 #include "AliSTARTdigit.h"
+#include <iostream.h>
 
 ClassImp(AliSTARTdigit)
 
+//------------------------------------
+ AliSTARTdigit::AliSTARTdigit() : TObject()
+{
+  fTimeAverage=9999;
+  fTimeDiff=9999;
+  fTimeBestRight=9999;
+  fTimeBestLeft=9999;
+
+  fTimeRight = new TArrayI(12);  
+  fTimeLeft  = new TArrayI(12);  
+  fADCRight = new TArrayI(12);  
+  fADCLeft  = new TArrayI(12);  
+}
+//-----------------------------------
+void AliSTARTdigit::SetTimeRight (TArrayI &o)
+{
+  fTimeRight = new TArrayI(12);  
+
+  Int_t i;
+  for (i=0; i<12; i++)
+    {
+      Int_t buf=o.At(i);
+      fTimeRight->AddAt(buf,i);
+    }
+}
+//--------------------------------------------
+void AliSTARTdigit::SetTimeLeft (TArrayI &o)
+{
+
+  fTimeLeft  = new TArrayI(12);  
+  Int_t i;
+  for (i=0; i<12; i++)
+    {
+      Int_t buf=o.At(i);
+      fTimeLeft->AddAt(buf,i);
+    }
+}
+//--------------------------------------------
+void AliSTARTdigit::GetTimeLeft (TArrayI &o)
+{
+
+  Int_t i;
+  for (i=0; i<12; i++)
+    {
+      o[i]=fTimeLeft->At(i);
+    }
+}
+//--------------------------------------------
+void AliSTARTdigit::GetTimeRight (TArrayI &o)
+{
+
+  Int_t i;
+  for (i=0; i<12; i++)
+    {
+      o[i]=fTimeRight->At(i);
+    }
+}
+//--------------------------------------------
+void AliSTARTdigit::GetADCLeft (TArrayI &o)
+{
+
+  Int_t i;
+  for (i=0; i<12; i++)
+    {
+      o[i]=fADCLeft->At(i);
+    }
+}
+//--------------------------------------------
+void AliSTARTdigit::GetADCRight (TArrayI &o)
+{
+
+ Int_t i;
+  for (i=0; i<12; i++)
+    {
+      o[i]=fADCRight->At(i);
+    }
+}
+//--------------------------------------------
+void AliSTARTdigit::SetADCLeft (TArrayI &o)
+{
+
+  fADCLeft  = new TArrayI(12);  
+  Int_t i;
+  //  Float_t fProcessKoef=1; // for pb 0.001
+  for (i=0; i<12; i++)
+    {
+      Int_t buf=(o.At(i));
+      fADCLeft->AddAt(buf,i);
+    }
+}
+//--------------------------------------------
+void AliSTARTdigit::SetADCRight (TArrayI &o)
+{
+
+  //  Float_t fProcessKoef=1; // for pb 0.001
+  fADCRight  = new TArrayI(12);  
+  Int_t i;
+  for (i=0; i<12; i++)
+    {
+      Int_t buf=(o.At(i));
+      fADCRight->AddAt(buf,i);
+    }
+}
+//------------------------------------------------------
+void AliSTARTdigit::Print()
+{
+  printf("AliSTARTdigit: fTimeAverage=%d, fTimeDiff=%d\n",
+        fTimeAverage, fTimeDiff);
+  cout<<" BestTimeRigh "<<fTimeBestRight<<
+    " TimeBestLeft "<<fTimeBestLeft<<endl;
+
+
 
+}
index d3dbadeac91265045e49ce709e6d43614bd6b842..8a7c2e61766fa09398bd1fdc0c1b5c467348e01a 100644 (file)
@@ -5,40 +5,49 @@
 
 /* $Id$ */
 #include <TObject.h>
+#include <TArrayI.h>
 
 //___________________________________________
 class AliSTARTdigit: public TObject  {
 ////////////////////////////////////////////////////////////////////////
- protected:
-    Int_t fTimeAverage;     // Average time
-    Int_t fTimeDiff;  // Time difference
-
-
  public:
-    AliSTARTdigit(Int_t Timeav=999999, Int_t Timediff=999999);
+    AliSTARTdigit();
     virtual ~AliSTARTdigit() {}
-    void Set(Int_t, Int_t);
-    Int_t GetTime();
+    void SetTimeDiff(Int_t time) {fTimeDiff=time;}
+    void SetMeanTime(Int_t time) {fTimeAverage=time;}
+    Stat_t  GetTimeDiff() {return fTimeDiff;}
+    Stat_t  GetMeanTime() {return fTimeAverage;}
+    Stat_t  GetBestTimeRight() {return fTimeBestRight ;}
+    Stat_t  GetBestTimeLeft() {return fTimeBestLeft ;}
+    Stat_t  GetSumADCRight() {return fSumADCRight ;}
     void Print(); 
-
+    void SetTimeBestRight( Int_t time) {fTimeBestRight = time;}
+    void SetTimeBestLeft( Int_t time) {fTimeBestLeft = time;}
+    void SetSumADCRight( Int_t ADC) {fSumADCRight = ADC;}
+    //    void SetProcessKoef( Float_t pp) {fProcessKoef = pp;}
+    virtual void SetTimeRight (TArrayI &o);
+    virtual void SetTimeLeft (TArrayI &o);
+    virtual void GetTimeRight (TArrayI &o);
+    virtual void GetTimeLeft (TArrayI &o);
+    virtual void SetADCRight (TArrayI &o);
+    virtual void SetADCLeft (TArrayI &o);
+    virtual void GetADCRight (TArrayI &o);
+    virtual void GetADCLeft (TArrayI &o);
+  private: 
+    //    Float_t fProcessKoef;  // for pp fProcessKoef=1 ; for Pb-Pb - 0.001
+    Int_t fTimeAverage;     // Average time
+    Int_t fTimeDiff;        // Time difference
+    Int_t fTimeBestRight;   //TOF first particle on the right
+    Int_t fTimeBestLeft;    //TOF first particle on the left
+    Int_t fSumADCRight;    // multiplicity on the right side
+    TArrayI *fTimeRight;    // right array's TDC
+    TArrayI *fTimeLeft;     // left arraya's TDC
+    TArrayI *fADCRight;    // right array's ADC
+    TArrayI *fADCLeft;     // left arraya's ADC
 
     ClassDef(AliSTARTdigit,1)  //Digit (Header) object for set:START
 };
 
-inline  AliSTARTdigit::AliSTARTdigit(Int_t Timeav, Int_t Timediff):fTimeAverage(Timeav),fTimeDiff(Timediff)
-{
-  //
-  // Create START digit
-  //     
-}
-inline Int_t AliSTARTdigit::GetTime(){return fTimeDiff;}
-inline void AliSTARTdigit::Set(Int_t Timeav, Int_t Timediff)
-  {fTimeAverage=Timeav; fTimeDiff=Timediff;}
-
-inline void AliSTARTdigit::Print(){
-  printf("AliSTARTdigit: fTimeAverage=%d, fTimeDiff=%d\n",
-        fTimeAverage, fTimeDiff);
-}
 
 #endif
 
index 31595ce4cc7ad0759885cd168f741b65deee0e88..4053469d1db0ab1ac226b004d69fd8be98530810 100755 (executable)
@@ -382,8 +382,8 @@ void AliSTARTv1::StepManager()
   TClonesArray &lhits = *fHits;
   
   if(!gMC->IsTrackAlive()) return; // particle has disappeared
-  Float_t charge = gMC->TrackCharge();
-  if(TMath::Abs(charge)<=0.) return; //take only charged particles
+  //  Float_t charge = gMC->TrackCharge();
+  //  if(TMath::Abs(charge)<=0.) return; //take only charged particles
   id=gMC->CurrentVolID(copy);
   
   
index 2f9a791a220bb18d45e16a4d7445657564aa2278..8bbb5334293e26600294bc2a3de8bea9a0a7efe3 100644 (file)
@@ -14,6 +14,9 @@
  **************************************************************************/
 /*
 $Log$
+Revision 1.8  2002/04/16 10:52:41  hristov
+Wrong usage of exit() corrected (Sun)
+
 Revision 1.7  2002/04/15 08:04:01  alla
 Digits and reconstruction with TObject
 
@@ -82,7 +85,7 @@ void AliSTARTvertex::Reconstruct(Int_t evNumber=1)
 
  // Event ------------------------- LOOP  
    
-  gAlice->GetEvent(evNumber);
+  // gAlice->GetEvent(evNumber);
 
   sprintf(nameTD,"START_D_%d",evNumber);
   TObject *td = (TObject*)gDirectory->Get(nameTD);
@@ -94,33 +97,30 @@ void AliSTARTvertex::Reconstruct(Int_t evNumber=1)
   }
   td->Read(nameTD);
   digits->Read(nameTD);
-  digits->Dump();
-  if(digits->GetTime()!=999999)
+  if(digits->GetTimeDiff()<TMath::Abs(1000))
     {
-      timediff=digits->GetTime();     //time in number of channels
-      timePs=(timediff-128)*10.;       // time in Ps channel_width =10ps
-      Float_t c = 299792458/1.e9;  //speed of light cm/ps
-      //Float_t c = 0.3;  //speed of light mm/ps
+      timediff=digits->GetTimeDiff();     //time in number of channels
+      timePs=(512-timediff)*2.5;       // time in Ps channel_width =10ps
+      cout<<"timediff "<< timediff<<" timePs "<<timePs<<endl;
+      // Float_t c = 299792458/1.e9;  //speed of light cm/ps
+      Float_t c = 0.3;  //speed of light mm/ps
       Float_t Zposit=timePs*c;// for 0 vertex
       cout<<" Zposit "<<Zposit<<endl;
       fvertex->Set((Int_t) Zposit);
       }
-    TTree *outTree = gAlice->TreeR();
-    if (!outTree) {
-      cerr<<"something wrong with output...."<<endl;
-      exit(111);
-    }
-    TTree *outTreeR = gAlice->TreeR();
+     /*
+        TTree *outTreeR = gAlice->TreeR();
     if (!outTreeR) {
       cerr<<"something wrong with output...."<<endl;
       exit(111);
     }
+    */
   sprintf(nameTR,"START_R_%d",evNumber);
   printf("%s\n",nameTR);
-    TDirectory *wd = gDirectory;
-    outTreeR->GetDirectory()->cd();
+  //  TDirectory *wd = gDirectory;
+  //  outTreeR->GetDirectory()->cd();
     fvertex->Write(nameTR);
-    wd->cd();
+    //  wd->cd();
 }
 
 
index dddd17edc0f23fa5852bb18cc77dfef8055e758a..f0e59152561a4c480eb2ad8968873f83bc2d965f 100644 (file)
@@ -10,7 +10,7 @@ PACKAGE = START
 
 # C++ sources
 
-SRCS          = AliSTART.cxx AliSTARTv0.cxx AliSTARTv1.cxx AliSTARThit.cxx AliSTARTdigit.cxx AliSTARTvertex.cxx AliSTARTDigitizer.cxx 
+SRCS          = AliSTART.cxx AliSTARTv0.cxx AliSTARTv1.cxx AliSTARTv2.cxx AliSTARThit.cxx AliSTARThitPhoton.cxx AliSTARTdigit.cxx AliSTARTvertex.cxx AliSTARTDigitizer.cxx 
 
 # C++ Headers
 
index c58aa783cb843a1875ac3f3bad255e9bf48fe5dc..1274ee76ef01fd73cb6341f14fb1a77ecad519ac 100644 (file)
@@ -9,7 +9,7 @@ void STARTDigit ()
 
   AliRunDigitizer * manager = new AliRunDigitizer(1,1);
   manager->SetInputStream(0,"galice.root");
-  manager->SetOutputFile("digits.root");
+  //  manager->SetOutputFile("digits.root");
   AliSTARTDigitizer *START = new AliSTARTDigitizer(manager);
   manager->Exec("");
 }
index c6a869c9d06222942cab43ea049c83ec76afb54d..9c6ba854c35bf9cb0187f761a90b61df17d9eb0b 100755 (executable)
@@ -11,7 +11,9 @@
 #pragma link C++ class  AliSTART+;
 #pragma link C++ class  AliSTARTv0+;
 #pragma link C++ class  AliSTARTv1+;
+#pragma link C++ class  AliSTARTv2+;
 #pragma link C++ class  AliSTARThit+;
+#pragma link C++ class  AliSTARThitPhoton+;
 #pragma link C++ class  AliSTARTdigit+;
 #pragma link C++ class  AliSTARTvertex+;
 #pragma link C++ class  AliSTARTDigitizer+;
index b0222ff1747cd0aeb4457041aa39d7c16e3c9055..c75bee510683d5a715a744cb04c7b73db98b0860 100644 (file)
@@ -9,7 +9,7 @@ void VertexMaker(Int_t evNumber=1)
   
   // Connect the Root Galice file containing Geometry, Kine and Hits
     TFile *file =  (TFile*)gROOT->GetListOfFiles()->FindObject("galice.root");
-    if (!file) file = new TFile("digits.root","UPDATE");
+    if (!file) file = new TFile("~/w0/START/galice.root","UPDATE");
    
   // Get AliRun object from file or create it if not on file
   if (!gAlice) {
index d93d5e01f49817c6be83b1018c2513fb83907b13..dade74f548c79f47aeb9a7bd1224ca8581bc3e76 100644 (file)
@@ -1,4 +1,4 @@
-SRCS= AliSTART.cxx AliSTARTv0.cxx AliSTARTv1.cxx AliSTARThit.cxx AliSTARTdigit.cxx AliSTARTvertex.cxx AliSTARTDigitizer.cxx
+SRCS= AliSTART.cxx AliSTARTv0.cxx AliSTARTv1.cxx AliSTARTv2.cxx AliSTARThit.cxx AliSTARTdigit.cxx AliSTARTvertex.cxx AliSTARTDigitizer.cxx
 
 HDRS= $(SRCS:.cxx=.h)
 
index f96c17f3bed6e70df3b905d0826457f4985ea963..ee6f59cb8f9ccffec8ef90b3a175f7de73ea504c 100644 (file)
@@ -10,7 +10,7 @@ void readDigits(Int_t evNumber=1)
   // Connect the Root Galice file containing Geometry, Kine and Hits
   TFile *file =  (TFile*)gROOT->GetListOfFiles()->FindObject("galice.root");
   //TFile *file =  (TFile*)gROOT->GetListOfFiles()->FindObject("galice.root");
-  if (!file) file = new TFile("production.root","UPDATE");
+  if (!file) file = new TFile("galice.root","UPDATE");
   
   // Get AliRun object from file or create it if not on file
   if (!gAlice) {
@@ -21,40 +21,88 @@ void readDigits(Int_t evNumber=1)
   char nameTD[8],nameTR[8];
 
   TH1F *hTimediff = new TH1F("hTimediff","Time difference",100,0,200);
-  TH1F *hTimePs = new TH1F("hTimePs","Time in Ps",100,2000,3000);
-  
+  TH1F *hTimePs = new TH1F("hTimePs","Time in Ps",100,-200,200);
+  TH1F *hMeanTime = new TH1F("hMeanTime","Time in Ps",100,2000,2500);
+  TH1F *hallADC = new TH1F("hallright","ADC summary right",100,0,200);
+  TH1F *hADCright = new TH1F("hADCright","ADC right",100,0,200);
+  TH1F *hADCleft = new TH1F("hADCleft","ADC left",100,0,200);
+  TH1F *hTimeright = new TH1F("hTimeright","Time right",100,2000.,3200.);
+  TH1F *hTimeleft = new TH1F("hTimeleft","Time left",100,2000.,3200.);
+  TH1F *hBestTimeright = new TH1F("hBestTimeright","First time right",
+                                 100,2000.,3200);
+  TH1F *hBestTimeleft = new TH1F("hBestTimeleft","First time left",
+                                100,11000.,13000.);
+   
   digits = new AliSTARTdigit();
-
+  timeRight = new TArrayI(12);
+  timeLeft = new TArrayI(12);
+  ADCRight = new TArrayI(12);
+  ADCLeft = new TArrayI(12);
 
  // Event ------------------------- LOOP  
-  for (j=0; j<evNumber; j++){
-    gAlice->GetEvent(j);
+  for (Int_t j=0; j<evNumber; j++){
+    //  gAlice->GetEvent(j);
     sprintf(nameTD,"START_D_%d",j);
     printf("%s\n",nameTD);
-  TObject *td = (TObject*)gDirectory->Get(nameTD);
-  digits->Read(nameTD);
-  digits->Dump();
-  printf("time %d\n",digits->GetTime());
+    TObject *td = (TObject*)gDirectory->Get(nameTD);
+    digits->Read(nameTD);
+  // digits->Dump();
+  // digits->Print();
+    printf("time %d\n",digits->GetTimeDiff());
     
-    if(digits->GetTime()!=999999){
-      Int_t timediff = digits->GetMeanTime();
+    if(digits->GetTimeDiff()!=999999){
+      Int_t timediff = digits->GetTimeDiff();
       //     Double_t timePs=(timediff-128)*10.; // time in Ps channel_width =10ps
-      Double_t timePs=(timediff)*10.; // time in Ps channel_width =10ps
+      Int_t timePs=(512-timediff)*2.5.; // time in Ps channel_width =10ps
       cout<<"timediff "<<timediff<<" timePs "<<timePs<<endl;
       hTimediff->Fill(timediff);
       hTimePs->Fill(timePs);
+      Int_t mean=digits->GetMeanTime();
+      cout<<" mean "<<mean<<endl;
+      mean=mean*2.5;
+      hMeanTime->Fill(mean);
+      Int_t br=digits->GetBestTimeRight(); 
+      Int_t bl=digits->GetBestTimeLeft();
+      cout<<"BestTimeRight "<<br*2.5<<" BestTimeLeft "<<bl*2.5<<endl;
+      hBestTimeright->Fill(br*2.5); 
+      hBestTimeleft ->Fill(bl*2.5); 
+      digits->GetTimeRight(*timeRight );
+      digits->GetTimeLeft(*timeLeft );
+      digits->GetADCRight(*ADCRight );
+      digits->GetADCLeft(*ADCLeft );
+       for (Int_t i=0; i<12; i++) 
+       {
+         Int_t t=timeRight.At(i);
+         Int_t ADC=ADCRight.At(i);
+         hTimeright->Fill(t*2.5);
+         hADCright->Fill(ADC);
+       }
+       for (Int_t i=0; i<12; i++) 
+       {
+         Int_t ADC=ADCRight.At(i);
+         Int_t t=timeLeft.At(i);
+         hTimeleft->Fill(t*2.5);
+         hADCleft->Fill(ADC);
+       }
     }
   }
   
-      Hfile = new TFile("figs.root","UPDATE","Histograms for STASRT digits");
-    printf("Writting histograms to root file \n");
-    Hfile->cd();
-//Create a canvas, set the view range, show histograms
-    gStyle->SetOptStat(111111);
+  Hfile = new TFile("Figdigits.root","RECREATE","Histograms for START digits");
+  printf("Writting histograms to root file \n");
+  Hfile->cd();
+  //Create a canvas, set the view range, show histograms
+  gStyle->SetOptStat(111111);
   //  TCanvas *c1 = new TCanvas("c1","Alice START Time ",400,10,600,600);
+  hADCright->Write();
+  hADCleft->Write();
+  hTimeright->Write();
+  hTimeleft->Write();
   hTimePs->SetXTitle("arriving time, ps");
   hTimePs->SetYTitle("number of events");
   hTimePs->Write();
+  hMeanTime->Write();
+  hBestTimeright->Write(); 
+  hBestTimeleft ->Write(); 
   Hfile->Close();
     
  
index f35b68c22283bbc06dbec41b08d1e2a0b9fd8d58..0136056cb81702ca845e2535e4b75121bd962413 100644 (file)
@@ -10,7 +10,7 @@ void readVertex(Int_t evNumber=1)
   // Connect the Root Galice file containing Geometry, Kine and Hits
 
   TFile *file =  (TFile*)gROOT->GetListOfFiles()->FindObject("galice.root");
-  if (!file) file = new TFile("production.root","UPDATE");
+  if (!file) file = new TFile("~/w0/START/galice.root","UPDATE");
   
   // Get AliRun object from file or create it if not on file
   if (!gAlice) {
@@ -20,8 +20,9 @@ void readVertex(Int_t evNumber=1)
   }
   char nameTD[8],nameTR[8];
 
-  TH1F *hVertex = new TH1F("hVertex","Z position of vertex",100,-350,350);
-  TH1F *hRealVertex = new TH1F("hRealVertex","Z position of vertex",100,-350,350);
+  TH1F *hVertex = new TH1F("hVertex","Z position of vertex",100,-100,100);
+  TH1F *hRealVertex = new TH1F("hRealVertex","Z position of vertex",
+                              100,-100,100);
   
   digits = new AliSTARTdigit();
   vertex = new AliSTARTvertex();
@@ -47,7 +48,7 @@ void readVertex(Int_t evNumber=1)
     hRealVertex->Fill(zRealVertex);
        
   }
-    Hfile = new TFile("figs.root","UPDATE","Histograms for START Vertex");
+    Hfile = new TFile("figs.root","RECREATE","Histograms for START Vertex");
    printf("Writting histograms to root file \n");
    Hfile->cd();