]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
New START corrected for coding conventions
authorfca <fca@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 13 Jul 2000 16:41:29 +0000 (16:41 +0000)
committerfca <fca@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 13 Jul 2000 16:41:29 +0000 (16:41 +0000)
17 files changed:
START/AliSTART.cxx
START/AliSTART.h
START/AliSTARTdigit.cxx
START/AliSTARTdigit.h
START/AliSTARThit.h
START/AliSTARTv0.cxx
START/AliSTARTv1.cxx
START/AliSTARTvertex.cxx
START/AliSTARTvertex.h
START/DigitMaker.C [new file with mode: 0644]
START/DrawSTART.C
START/Makefile
START/STARTLinkDef.h
START/ViewSTART.C
START/readDigits.C [new file with mode: 0644]
START/readVertex.C [new file with mode: 0644]
START/vertex.C [new file with mode: 0644]

index b37874b976568e7364180dd5834d01b20ec12992..aafe78dd17c8e0e9a03868bba91d88605ef0f0f0 100755 (executable)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
 
 /*
 $Log$
+Revision 1.8  2000/03/27 17:24:25  alla
+Modifing geometry
+
 Revision 1.6  2000/01/21 15:45:23  fca
 New Version from Alla
 
 Revision 1.6  2000/01/21 15:45:23  fca
 New Version from Alla
 
@@ -67,7 +70,9 @@ Introduction of the Copyright and cvs Log
 #include "AliSTARTvertex.h"
 
 ClassImp(AliSTART)
 #include "AliSTARTvertex.h"
 
 ClassImp(AliSTART)
-  AliSTARTdigit *digits; 
+
+static  AliSTARTdigit *digits; 
+
 //_____________________________________________________________________________
 AliSTART::AliSTART()
 {
 //_____________________________________________________________________________
 AliSTART::AliSTART()
 {
@@ -127,25 +132,25 @@ void AliSTART::BuildGeometry()
   //
   // Build simple ROOT TNode geometry for event display
   //
   //
   // Build simple ROOT TNode geometry for event display
   //
-  TNode *Node, *Top;
+  TNode *node, *top;
   const int kColorSTART  = 19;
   //
   const int kColorSTART  = 19;
   //
-  Top=gAlice->GetGeometry()->GetNode("alice");
+  top=gAlice->GetGeometry()->GetNode("alice");
 
   // START define the different volumes
   new TRotMatrix("rot999","rot999",  90,0,90,90,180,0);
 
   new TTUBE("S_STR1","START  volume 1","void",5.,10.7,5.3);
 
   // START define the different volumes
   new TRotMatrix("rot999","rot999",  90,0,90,90,180,0);
 
   new TTUBE("S_STR1","START  volume 1","void",5.,10.7,5.3);
-  Top->cd();
-  Node = new TNode("STR1","STR1","S_STR1",0,0,75.,"");
-  Node->SetLineColor(kColorSTART);
-  fNodes->Add(Node);
+  top->cd();
+  node = new TNode("STR1","STR1","S_STR1",0,0,75.,"");
+  node->SetLineColor(kColorSTART);
+  fNodes->Add(node);
 
   new TTUBE("S_STR2","START volume 2","void",5.,10.7,5.3);
 
   new TTUBE("S_STR2","START volume 2","void",5.,10.7,5.3);
-  Top->cd();
-  Node = new TNode("STR2","STR2","S_STR2",0,0,-75,"rot999");
-  Node->SetLineColor(kColorSTART);
-  fNodes->Add(Node);
+  top->cd();
+  node = new TNode("STR2","STR2","S_STR2",0,0,-75,"rot999");
+  node->SetLineColor(kColorSTART);
+  fNodes->Add(node);
 }
  
 //_____________________________________________________________________________
 }
  
 //_____________________________________________________________________________
@@ -184,7 +189,9 @@ void AliSTART::Init()
 //---------------------------------------------------------------------------
 void AliSTART::MakeBranch(Option_t* option)
 {
 //---------------------------------------------------------------------------
 void AliSTART::MakeBranch(Option_t* option)
 {
-  
+  //
+  // Specific START branches
+  //
   AliSTARTdigit *digits; 
   // Create Tree branches for the START.
   Int_t buffersize = 400;
   AliSTARTdigit *digits; 
   // Create Tree branches for the START.
   Int_t buffersize = 400;
@@ -193,9 +200,9 @@ void AliSTART::MakeBranch(Option_t* option)
 
   AliDetector::MakeBranch(option);
 
 
   AliDetector::MakeBranch(option);
 
-  TTree *TD = gAlice->TreeD();
+  TTree *td = gAlice->TreeD();
   digits = new AliSTARTdigit();
   digits = new AliSTARTdigit();
-  TD->Branch(branchname,"AliSTARTdigit",&digits, buffersize);
+  td->Branch(branchname,"AliSTARTdigit",&digits, buffersize);
   printf("Making Branch %s for digits\n",branchname);
     
 /*
   printf("Making Branch %s for digits\n",branchname);
     
 /*
@@ -208,16 +215,18 @@ void AliSTART::MakeBranch(Option_t* option)
 
 void AliSTART::Hit2digit(Int_t evnum) 
 {
 
 void AliSTART::Hit2digit(Int_t evnum) 
 {
-  
-  Float_t x,y,z,e;
+  //
+  // From hits to digits
+  //
+  Float_t x,y,e;
   Int_t nbytes = 0;
   Int_t nbytes = 0;
-  Int_t j,hit;
+  Int_t hit;
   Int_t nhits;
   Int_t volume,pmt;
   char nameTH[8],nameTD[8];
   Float_t timediff,timeright,timeleft,timeav;
   Float_t besttimeright,besttimeleft,meanTime;
   Int_t nhits;
   Int_t volume,pmt;
   char nameTH[8],nameTD[8];
   Float_t timediff,timeright,timeleft,timeav;
   Float_t besttimeright,besttimeleft,meanTime;
-  Int_t channel_width=10;
+  Int_t channelWidth=10;
 
   TParticle *particle;
   AliSTARThit  *startHit;
 
   TParticle *particle;
   AliSTARThit  *startHit;
@@ -228,45 +237,34 @@ void AliSTART::Hit2digit(Int_t evnum)
   digits= new AliSTARTdigit();
   TBranch *bDig=0;
 
   digits= new AliSTARTdigit();
   TBranch *bDig=0;
 
-  /*    
-  // Create histograms
-  
-   TH1F *hTimediff = new TH1F("hTimediff","Time different",100,-2,2);
-   TH1F *hMeanTime = new TH1F("hMeanTime","Mean Time",100,2.2,2.8);
-  
-   TH1F *hTime1stright = new TH1F("hTime1stright","Time flight of 1st  particle right", 100,1.5,3.2);
-   TH1F *hTime1stleft = new  TH1F("hTime1sleft","Time flight of 1st particle left",100,1.5,3.2);
-  
-  */ 
-   //   AliSTART *START  = (AliSTART*) gAlice->GetDetector("START");
   
  // Event ------------------------- LOOP  
  
     sprintf(nameTD,"TreeD%d",evnum);
   
  // Event ------------------------- LOOP  
  
     sprintf(nameTD,"TreeD%d",evnum);
-    TTree *TD = new TTree(nameTD,"START");
-    bDig = TD->Branch("START","AliSTARTdigit",&digits,buffersize,split);
+    TTree *td = new TTree(nameTD,"START");
+    bDig = td->Branch("START","AliSTARTdigit",&digits,buffersize,split);
 
     besttimeright=9999.;
     besttimeleft=9999.;
 
     besttimeright=9999.;
     besttimeleft=9999.;
-    Int_t Timediff=0;
-    Int_t Timeav=0;
+    Int_t timeDiff=0;
+    Int_t timeAv=0;
 
     Int_t nparticles = gAlice->GetEvent(evnum);
     if (nparticles <= 0) return;
     printf("\n nparticles %d\n",nparticles);
     
 
     Int_t nparticles = gAlice->GetEvent(evnum);
     if (nparticles <= 0) return;
     printf("\n nparticles %d\n",nparticles);
     
-    TClonesArray *Particles = gAlice->Particles();
+    TClonesArray *particles = gAlice->Particles();
    
     sprintf(nameTH,"TreeH%d",evnum);
     printf("%s\n",nameTH);
    
     sprintf(nameTH,"TreeH%d",evnum);
     printf("%s\n",nameTH);
-    TTree *TH = gAlice->TreeH();
-    Int_t ntracks    = (Int_t) TH->GetEntries();
+    TTree *th = gAlice->TreeH();
+    Int_t ntracks    = (Int_t) th->GetEntries();
     if (ntracks<=0) return;
     // Start loop on tracks in the hits containers
     for (Int_t track=0; track<ntracks;track++) {
       gAlice->ResetHits();
     if (ntracks<=0) return;
     // Start loop on tracks in the hits containers
     for (Int_t track=0; track<ntracks;track++) {
       gAlice->ResetHits();
-      nbytes += TH->GetEvent(track);
-      particle=(TParticle*)Particles->UncheckedAt(track);
+      nbytes += th->GetEvent(track);
+      particle=(TParticle*)particles->UncheckedAt(track);
       nhits =fHits->GetEntriesFast();
       
       for (hit=0;hit<nhits;hit++) {
       nhits =fHits->GetEntriesFast();
       
       for (hit=0;hit<nhits;hit++) {
@@ -293,39 +291,40 @@ void AliSTART::Hit2digit(Int_t evnum)
     } //track loop
 
     //folding with experimental time distribution
     } //track loop
 
     //folding with experimental time distribution
-   Float_t besttimerightGaus=gRandom->Gaus(besttimeright,0.05);
-   Float_t besttimeleftGaus=gRandom->Gaus(besttimeleft,0.05);
-   timediff=besttimerightGaus-besttimeleftGaus;
-   meanTime=(besttimerightGaus+besttimeleftGaus)/2.;
-  if ( TMath::Abs(timediff)<2. && meanTime<3.) 
+    Float_t besttimerightGaus=gRandom->Gaus(besttimeright,0.05);
+    Float_t besttimeleftGaus=gRandom->Gaus(besttimeleft,0.05);
+    timediff=besttimerightGaus-besttimeleftGaus;
+    meanTime=(besttimerightGaus+besttimeleftGaus)/2.;
+    if ( TMath::Abs(timediff)<2. && meanTime<3.) 
      {
      {
-     //we assume centre of bunch is 5ns after TTS signal
-     //TOF values are relative of the end of bunch
-       //      hTimediff->Fill(timediff);
-       //hMeanTime->Fill(meanTime);
-       Float_t pp_bunch=25;
+       //we assume centre of bunch is 5ns after TTS signal
+       //TOF values are relative of the end of bunch
+       Float_t ppBunch=25;
     
     
-       pp_bunch=pp_bunch-10/2;
+       ppBunch=ppBunch-10/2;
        Float_t t1=1000.*besttimeleftGaus;
        Float_t t2=1000.*besttimerightGaus;
        Float_t t1=1000.*besttimeleftGaus;
        Float_t t2=1000.*besttimerightGaus;
-       t1=t1/channel_width+pp_bunch; //time in ps to channel_width
-       t2=t2/channel_width+pp_bunch; //time in ps to channel_width
+       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
        
      
        timeav=(t1+t2)/2.;
      
        // Time to TDC signal
        // 256 channels for timediff, range 1ns
        
-       timediff=128+1000*timediff/channel_width; // time in ps
-
-       Timeav = (Int_t)(timeav);   // time in ps
-       Timediff = (Int_t)(timediff); // time in ps
-       digits->Set(Timeav,Timediff);
-       TD->Fill();
+       timediff=128+1000*timediff/channelWidth; // time in ps 
+
+       timeAv = (Int_t)(timeav);   // time (ps) channel numbres
+       timeDiff = (Int_t)(timediff); // time ( ps) channel numbres
+       digits->Set(timeAv,timeDiff);
+     }
+       else
+        {timeAv=999999; timeDiff=99999;}
+       td->Fill();
        digits->MyDump();
        digits->MyDump();
-       TD->Write();
-     } //timediff
+       printf("digits-> %d \n",digits->GetTime());
+       td->Write();
+       //     } //timediff
    
 
 } // end macro
    
 
 } // end macro
@@ -340,5 +339,6 @@ void AliSTART::Hit2digit(Int_t evnum)
 
 
 
 
 
 
+
  
 
  
 
index 08c0164dd62c8bd6316faefb52fd7f4b0fbacdb7..ef58e0dd3cc555809f77432dd1b1d3e70b1c9ef1 100755 (executable)
@@ -1,5 +1,5 @@
-#ifndef START_H
-#define START_H
+#ifndef ALISTART_H
+#define ALISTART_H
 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
  * See cxx source for full Copyright notice                               */
 
 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
  * See cxx source for full Copyright notice                               */
 
@@ -18,16 +18,14 @@ R__EXTERN TDirectory *  gDirectory;
  
 class AliSTART : public AliDetector {
 
  
 class AliSTART : public AliDetector {
 
-public:
-  Int_t fZposit;
 
 
 public:
    AliSTART();
    AliSTART(const char *name, const char *title);
    virtual       ~AliSTART() {}
 
 
 public:
    AliSTART();
    AliSTART(const char *name, const char *title);
    virtual       ~AliSTART() {}
-   virtual void   AddHit(Int_t, Int_t*, Float_t*);
-   virtual void   AddDigit(Int_t*, Int_t*);
+   virtual void   AddHit(Int_t track, Int_t *vol, Float_t *hits);
+   virtual void   AddDigit(Int_t *tracks, Int_t *digits);
    virtual void   BuildGeometry();
    virtual void   CreateGeometry(){}
    virtual void   CreateMaterials(){} 
    virtual void   BuildGeometry();
    virtual void   CreateGeometry(){}
    virtual void   CreateMaterials(){} 
@@ -39,15 +37,6 @@ public:
    void Hit2digit(){return;}
    virtual void   MakeBranch(Option_t *opt=" ");
    virtual void   StepManager(){}
    void Hit2digit(){return;}
    virtual void   MakeBranch(Option_t *opt=" ");
    virtual void   StepManager(){}
-  /*
-   TTree   *fTreeD;        //tree
-   TTree * GetTree() { return fTreeD;}//return reference to actual tree 
-   Bool_t  SetTree(Int_t nevent=0, TDirectory *dir = gDirectory);//map tree from given directory
-   Bool_t  MakeTree(Int_t nevent=0);//map tree from given directory
-   */   
-   
-   //  void Fill();
-   //   void Write();
    
 protected:
    Int_t fIdSens;    // Sensetive Cherenkov radiator
    
 protected:
    Int_t fIdSens;    // Sensetive Cherenkov radiator
index 60cd3b292ae99b913ea292c650ab8ca14d32835c..72fc1477484299bf1327cb9f3c8c11d17ae61014 100644 (file)
@@ -14,6 +14,9 @@
  **************************************************************************/
 /*
 $Log$
  **************************************************************************/
 /*
 $Log$
+Revision 1.2  2000/03/24 17:40:35  alla
+New AliSTART
+
 */ 
 #include <iostream.h>
 #include <fstream.h>
 */ 
 #include <iostream.h>
 #include <fstream.h>
@@ -33,10 +36,10 @@ AliSTARTdigit::AliSTARTdigit(Int_t Timeav, Int_t Timediff)
   // AliSTARTdigit data members from the array digits. The array of track
   // numbers are passed to the AliDigit creator. The order of the elements
   // in the digits array are fEvent = digits[0], fAmplitude = digits[1],
   // AliSTARTdigit data members from the array digits. The array of track
   // numbers are passed to the AliDigit creator. The order of the elements
   // in the digits array are fEvent = digits[0], fAmplitude = digits[1],
-  // fTime_average = digits[1], fTime_diff = digits[1], and fDet = digits[4].
+  // fTimeAverage = digits[1], fTimeDiff = digits[1], and fDet = digits[4].
   // Therefore the array digits is expected to be at least 5 elements long.
   //
   // Therefore the array digits is expected to be at least 5 elements long.
   //
-  Timeav = fTime_average;
-  Timediff = fTime_diff;
+  Timeav = fTimeAverage;
+  Timediff = fTimeDiff;
 
 }
 
 }
index f98762f86c7905c81873a8d280fbfb51f9701ac3..7070499eeb7cd970c224dc319a447a8708cb6bf5 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef STARTDIGIT_H
-#define STARTDIGIT_H
+#ifndef ALISTARTDIGIT_H
+#define ALISTARTDIGIT_H
 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
  * See cxx source for full Copyright notice                               */
 
 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
  * See cxx source for full Copyright notice                               */
 
@@ -9,9 +9,9 @@
 //___________________________________________
 class AliSTARTdigit: public TObject  {
 ////////////////////////////////////////////////////////////////////////
 //___________________________________________
 class AliSTARTdigit: public TObject  {
 ////////////////////////////////////////////////////////////////////////
- public:
-    Int_t fTime_average;     // Average time
-    Int_t fTime_diff;  // Time difference
+ protected:
+    Int_t fTimeAverage;     // Average time
+    Int_t fTimeDiff;  // Time difference
 
 
  public:
 
 
  public:
@@ -19,19 +19,21 @@ class AliSTARTdigit: public TObject  {
     AliSTARTdigit(Int_t , Int_t );
     virtual ~AliSTARTdigit() {}
     void Set(Int_t, Int_t);
     AliSTARTdigit(Int_t , Int_t );
     virtual ~AliSTARTdigit() {}
     void Set(Int_t, Int_t);
+    Int_t GetTime();
     void MyDump(); 
 
 
     ClassDef(AliSTARTdigit,1)  //Digit (Header) object for set:START
 };
 
     void MyDump(); 
 
 
     ClassDef(AliSTARTdigit,1)  //Digit (Header) object for set:START
 };
 
-inline AliSTARTdigit::AliSTARTdigit(){fTime_average=99999.;fTime_diff=99999.;}
+inline AliSTARTdigit::AliSTARTdigit(){fTimeAverage=999999;fTimeDiff=999999;}
+inline Int_t AliSTARTdigit::GetTime(){return fTimeDiff;}
 inline void AliSTARTdigit::Set(Int_t Timeav, Int_t Timediff)
 inline void AliSTARTdigit::Set(Int_t Timeav, Int_t Timediff)
-  {fTime_average=Timeav; fTime_diff=Timediff;}
+  {fTimeAverage=Timeav; fTimeDiff=Timediff;}
 
 inline void AliSTARTdigit::MyDump(){
 
 inline void AliSTARTdigit::MyDump(){
-  printf("AliSTARTdigit: fTime_average=%d, fTime_diff=%d\n",
-        fTime_average, fTime_diff);
+  printf("AliSTARTdigit: fTimeAverage=%d, fTimeDiff=%d\n",
+        fTimeAverage, fTimeDiff);
 }
 
 #endif
 }
 
 #endif
index c98a147c6da210f4bedcf32ebf47cf61ea21a18c..1032b85e693de1892fef72b1b00b07557ea6444c 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef AliSTARThit_H
-#define AliSTARThit_H
+#ifndef ALISTARTHIT_H
+#define ALISTARTHIT_H
 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
  * See cxx source for full Copyright notice                               */
 
 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
  * See cxx source for full Copyright notice                               */
 
index 8706954bdab40db59d7f55412debfc4df33e0b4f..f4db1dc81353ac86dce0f8e37ad4a7e20f8e36bf 100755 (executable)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
 
 /*
 $Log$
+Revision 1.7  2000/01/21 15:45:23  fca
+New Version from Alla
+
 Revision 1.6  1999/11/12 15:04:00  fca
 Modifications from A.Maevskaya
 
 Revision 1.6  1999/11/12 15:04:00  fca
 Modifications from A.Maevskaya
 
@@ -115,7 +118,7 @@ void AliSTARTv0::CreateGeometry()
     gMC->Gsvolu("PMT ","TUBE",idtmed[3],ppmt,3);     
     gMC->Gsvolu("DIVI","TUBE",idtmed[3],pdivider,3);     
 
     gMC->Gsvolu("PMT ","TUBE",idtmed[3],ppmt,3);     
     gMC->Gsvolu("DIVI","TUBE",idtmed[3],pdivider,3);     
 
-// first ring: 13 units of Scintillator+PMT+divider
+// first ring: 12 units of Scintillator+PMT+divider
     Double_t dang1 = 2*TMath::Pi()/12;
     for (is=1; is<=12; is++)
       {  
     Double_t dang1 = 2*TMath::Pi()/12;
     for (is=1; is<=12; is++)
       {  
@@ -216,8 +219,8 @@ void AliSTARTv0::CreateGeometry()
 //------------------------------------------------------------------------
 void AliSTARTv0::CreateMaterials()
 {
 //------------------------------------------------------------------------
 void AliSTARTv0::CreateMaterials()
 {
-   Int_t ISXFLD   = gAlice->Field()->Integ();
-   Float_t SXMGMX = gAlice->Field()->Max();
+   Int_t isxfld   = gAlice->Field()->Integ();
+   Float_t sxmgmx = gAlice->Field()->Max();
    Float_t a,z,d,radl,absl,buf[1];
    Int_t nbuf;
 
    Float_t a,z,d,radl,absl,buf[1];
    Int_t nbuf;
 
@@ -286,14 +289,14 @@ void AliSTARTv0::CreateMaterials()
    AliMixture( 7, "Ribber $",aribber,zribber,denribber,-3,wribber);
    
    
    AliMixture( 7, "Ribber $",aribber,zribber,denribber,-3,wribber);
    
    
-   AliMedium(1, "START Air$", 2, 0, ISXFLD, SXMGMX, 10., .1, 1., .003, .003);
-   AliMedium(2, "Scintillator$", 5, 1, ISXFLD, SXMGMX, 10., .01, 1., .003, .003);
-   AliMedium(3, "Vacuum$", 1, 0, ISXFLD, SXMGMX, 10., .01, .1, .003, .003);
-   AliMedium(4, "Ceramic$", 9, 0, ISXFLD, SXMGMX, 10., .01, .1, .003, .003);
-   AliMedium(6, "Glass$", 4, 0, ISXFLD, SXMGMX, 10., .01, .1, .003, .003);
-   AliMedium(8, "Steel$", 0, 0, ISXFLD, SXMGMX, 1., .001, 1., .001, .001);
-   AliMedium(11, "Brass  $", 6, 0, ISXFLD, SXMGMX, 10., .01, .1, .003, .003);
-   AliMedium(9, "Ribber  $", 7, 0, ISXFLD, SXMGMX, 10., .01, .1, .003, .003);
+   AliMedium(1, "START Air$", 2, 0, isxfld, sxmgmx, 10., .1, 1., .003, .003);
+   AliMedium(2, "Scintillator$", 5, 1, isxfld, sxmgmx, 10., .01, 1., .003, .003);
+   AliMedium(3, "Vacuum$", 1, 0, isxfld, sxmgmx, 10., .01, .1, .003, .003);
+   AliMedium(4, "Ceramic$", 9, 0, isxfld, sxmgmx, 10., .01, .1, .003, .003);
+   AliMedium(6, "Glass$", 4, 0, isxfld, sxmgmx, 10., .01, .1, .003, .003);
+   AliMedium(8, "Steel$", 0, 0, isxfld, sxmgmx, 1., .001, 1., .001, .001);
+   AliMedium(11, "Brass  $", 6, 0, isxfld, sxmgmx, 10., .01, .1, .003, .003);
+   AliMedium(9, "Ribber  $", 7, 0, isxfld, sxmgmx, 10., .01, .1, .003, .003);
 
 //  geant3->Gsckov(idtmed[2105], 14, ppckov, absco_quarz, effic_all,rindex_quarz);
 
 
 //  geant3->Gsckov(idtmed[2105], 14, ppckov, absco_quarz, effic_all,rindex_quarz);
 
index 253624cd40ae1df0d7075c14ee30475cad49e062..396466df12513a69411eb3d31ed292b27cda4bab 100755 (executable)
@@ -75,6 +75,7 @@ void AliSTARTv1::CreateGeometry()
   Float_t x,y,z;
 
   Float_t pstart[3]={4.5,10.7,5.3};
   Float_t x,y,z;
 
   Float_t pstart[3]={4.5,10.7,5.3};
+  Float_t pinstart[3]={0.,1.3,5.25};
   Float_t ppmt[3]={0.,1.3,3.5};
   Float_t pdivider[3]={0.,1.2,1.75};
   Float_t pdiv2[3]={0.,1.2,1.25};
   Float_t ppmt[3]={0.,1.3,3.5};
   Float_t pdivider[3]={0.,1.2,1.75};
   Float_t pdiv2[3]={0.,1.2,1.25};
@@ -106,6 +107,7 @@ void AliSTARTv1::CreateGeometry()
     gMC->Gspos("STRT",2,"ALIC",0.,0.,-zdet,idrotm[901],"ONLY");
 
 //START interior
     gMC->Gspos("STRT",2,"ALIC",0.,0.,-zdet,idrotm[901],"ONLY");
 
 //START interior
+    gMC->Gsvolu("INST","TUBE",idtmed[1],pinstart,3);
     gMC->Gsvolu("PMT ","TUBE",idtmed[3],ppmt,3);     
     gMC->Gsvolu("DIVI","TUBE",idtmed[3],pdivider,3);     
 
     gMC->Gsvolu("PMT ","TUBE",idtmed[3],ppmt,3);     
     gMC->Gsvolu("DIVI","TUBE",idtmed[3],pdivider,3);     
 
@@ -119,12 +121,18 @@ void AliSTARTv1::CreateGeometry()
                  theta,    180.+30.*is); 
        x=6.5*TMath::Sin(is*dang1);
        y=6.5*TMath::Cos(is*dang1);
                  theta,    180.+30.*is); 
        x=6.5*TMath::Sin(is*dang1);
        y=6.5*TMath::Cos(is*dang1);
-       z=-pstart[2]+ppmt[2];
-       gMC->Gspos("PMT ",is,"STRT",x,y,z,idrotm[901+is],"ONLY");
+       z=-pstart[2]+pinstart[2];
+       gMC->Gspos("INST",is,"STRT",x,y,z,idrotm[901+is],"ONLY");
        printf("z PMT %f\n",z);
        printf("z PMT %f\n",z);
-       z=z+ppmt[2]+pdiv2[2]-pdiv1[2];
+
+       
+       x=0;
+       y=0;
+       z=-pinstart[2]+ppmt[2];
        printf(" is %d, z Divider %f\n",is,z);
        printf(" is %d, z Divider %f\n",is,z);
-       gMC->Gspos("DIVI",is,"STRT",x,y,z,idrotm[901+is],"ONLY");
+       gMC->Gspos("PMT ",is,"INST",x,y,z,0,"ONLY");
+       z=pinstart[2]-pdivider[2];
+       gMC->Gspos("DIVI",is,"INST",x,y,z,0,"ONLY");
       }
      /*  
 //second ring: 20 units of Scintillator+PMT+divider
       }
      /*  
 //second ring: 20 units of Scintillator+PMT+divider
@@ -214,8 +222,8 @@ void AliSTARTv1::CreateGeometry()
 //------------------------------------------------------------------------
 void AliSTARTv1::CreateMaterials()
 {
 //------------------------------------------------------------------------
 void AliSTARTv1::CreateMaterials()
 {
-   Int_t ISXFLD   = gAlice->Field()->Integ();
-   Float_t SXMGMX = gAlice->Field()->Max();
+   Int_t isxfld   = gAlice->Field()->Integ();
+   Float_t sxmgmx = gAlice->Field()->Max();
    Float_t a,z,d,radl,absl,buf[1];
    Int_t nbuf;
 
    Float_t a,z,d,radl,absl,buf[1];
    Int_t nbuf;
 
@@ -258,9 +266,6 @@ void AliSTARTv1::CreateMaterials()
    Float_t absco_quarz[14] = { 20.126,16.27,13.49,11.728,9.224,8.38,7.44,7.17,
                                6.324,4.483,1.6,.323,.073,0. };
    */
    Float_t absco_quarz[14] = { 20.126,16.27,13.49,11.728,9.224,8.38,7.44,7.17,
                                6.324,4.483,1.6,.323,.073,0. };
    */
-   Int_t *idtmed = fIdtmed->GetArray()-2100;
-    
-   //  TGeant3 *geant3 = (TGeant3*) gMC;
     
 //*** Definition Of avaible START materials ***
    AliMaterial(0, "START Steel$", 55.850,26.,7.87,1.76,999);
     
 //*** Definition Of avaible START materials ***
    AliMaterial(0, "START Steel$", 55.850,26.,7.87,1.76,999);
@@ -284,14 +289,14 @@ void AliSTARTv1::CreateMaterials()
    AliMixture( 7, "Ribber $",aribber,zribber,denribber,-3,wribber);
    
    
    AliMixture( 7, "Ribber $",aribber,zribber,denribber,-3,wribber);
    
    
-   AliMedium(1, "START Air$", 2, 0, ISXFLD, SXMGMX, 10., .1, 1., .003, .003);
-   AliMedium(2, "Scintillator$", 5, 1, ISXFLD, SXMGMX, 10., .01, 1., .003, .003);
-   AliMedium(3, "Vacuum$", 1, 0, ISXFLD, SXMGMX, 10., .01, .1, .003, .003);
-   AliMedium(4, "Ceramic$", 9, 0, ISXFLD, SXMGMX, 10., .01, .1, .003, .003);
-   AliMedium(6, "Glass$", 4, 0, ISXFLD, SXMGMX, 10., .01, .1, .003, .003);
-   AliMedium(8, "Steel$", 0, 0, ISXFLD, SXMGMX, 1., .001, 1., .001, .001);
-   AliMedium(9, "Ribber  $", 7, 0, ISXFLD, SXMGMX, 10., .01, .1, .003, .003);
-   AliMedium(11, "Brass  $", 6, 0, ISXFLD, SXMGMX, 10., .01, .1, .003, .003);
+   AliMedium(1, "START Air$", 2, 0, isxfld, sxmgmx, 10., .1, 1., .003, .003);
+   AliMedium(2, "Scintillator$", 5, 1, isxfld, sxmgmx, 10., .01, 1., .003, .003);
+   AliMedium(3, "Vacuum$", 1, 0, isxfld, sxmgmx, 10., .01, .1, .003, .003);
+   AliMedium(4, "Ceramic$", 9, 0, isxfld, sxmgmx, 10., .01, .1, .003, .003);
+   AliMedium(6, "Glass$", 4, 0, isxfld, sxmgmx, 10., .01, .1, .003, .003);
+   AliMedium(8, "Steel$", 0, 0, isxfld, sxmgmx, 1., .001, 1., .001, .001);
+   AliMedium(9, "Ribber  $", 7, 0, isxfld, sxmgmx, 10., .01, .1, .003, .003);
+   AliMedium(11, "Brass  $", 6, 0, isxfld, sxmgmx, 10., .01, .1, .003, .003);
    cout<<"++++++++++++++Medium set++++++++++"<<endl;
 
 //  geant3->Gsckov(idtmed[2105], 14, ppckov, absco_quarz, effic_all,rindex_quarz);
    cout<<"++++++++++++++Medium set++++++++++"<<endl;
 
 //  geant3->Gsckov(idtmed[2105], 14, ppckov, absco_quarz, effic_all,rindex_quarz);
@@ -308,7 +313,8 @@ void AliSTARTv1::DrawDetector()
   gMC->Gsatt("ALIC","SEEN",0);
   //
   //Set volumes visible
   gMC->Gsatt("ALIC","SEEN",0);
   //
   //Set volumes visible
-  gMC->Gsatt("STRT","SEEN",0);
+  //  gMC->Gsatt("STRT","SEEN",0);
+  gMC->Gsatt("INST","SEEN",0);
   gMC->Gsatt("PMT ","SEEN",1);
   gMC->Gsatt("DIVI","SEEN",1);
   //
   gMC->Gsatt("PMT ","SEEN",1);
   gMC->Gsatt("DIVI","SEEN",1);
   //
@@ -369,8 +375,9 @@ void AliSTARTv1::StepManager()
       hits[2] = pos[2];
       Float_t etot=gMC->Etot();
       hits[4]=etot;
       hits[2] = pos[2];
       Float_t etot=gMC->Etot();
       hits[4]=etot;
-      Int_t part= gMC->TrackPid();
-      hits[5]=part;
+      Int_t iPart= gMC->TrackPid();
+      Int_t partID=gMC->IdFromPDG(iPart);
+      hits[5]=partID;
       Float_t ttime=gMC->TrackTime();
       hits[6]=ttime*1e9;
       edep=0;
       Float_t ttime=gMC->TrackTime();
       hits[6]=ttime*1e9;
       edep=0;
@@ -389,7 +396,7 @@ void AliSTARTv1::StepManager()
       Int_t i;
       for (i=0; i<=6; i++){
        printf(" HITS on START Exit %f\n",hits[i]); } 
       Int_t i;
       for (i=0; i<=6; i++){
        printf(" HITS on START Exit %f\n",hits[i]); } 
-      for (i=0; i<=1; i++) { printf("START vol %d\n",vol[i]);}
+      //      for (i=0; i<=1; i++) { printf("START vol %d\n",vol[i]);}
      
       new(lhits[fNhits++]) AliSTARThit(fIshunt,gAlice->CurrentTrack(),vol,hits);      
     }
      
       new(lhits[fNhits++]) AliSTARThit(fIshunt,gAlice->CurrentTrack(),vol,hits);      
     }
index ff87eafae174e55813dd2bd6013f4b8489527352..d9b3509a8c9a8c23125852ab3d0e7a2583763b86 100644 (file)
@@ -14,6 +14,9 @@
  **************************************************************************/
 /*
 $Log$
  **************************************************************************/
 /*
 $Log$
+Revision 1.1  2000/03/24 17:46:58  alla
+Vertex reconstruction
+
 */ 
 #include <TObject.h>
 #include "AliSTARTvertex.h"
 */ 
 #include <TObject.h>
 #include "AliSTARTvertex.h"
@@ -28,7 +31,6 @@ ClassImp(AliSTARTvertex)
 AliSTARTvertex::AliSTARTvertex( Int_t * Zposit)
 {
   //
 AliSTARTvertex::AliSTARTvertex( Int_t * Zposit)
 {
   //
-  // Create START digit
   //     The creator for the AliSTARTvertex class. This routine fills the
   // AliSTARTvertex data members from the array vertex.
   // The order of the elements in the vertex array are
   //     The creator for the AliSTARTvertex class. This routine fills the
   // AliSTARTvertex data members from the array vertex.
   // The order of the elements in the vertex array are
@@ -58,36 +60,38 @@ void AliSTARTvertex::Reconstruct(Int_t evNumber=1)
   // TParticle *particle;
   digits = new AliSTARTdigit();
   vertex = new AliSTARTvertex();
   // TParticle *particle;
   digits = new AliSTARTdigit();
   vertex = new AliSTARTvertex();
-  // AliSTART *START  = (AliSTART*) gAlice->GetDetector("START");
 
  // Event ------------------------- LOOP  
    
 
  // Event ------------------------- LOOP  
    
-    sprintf(nameTD,"TreeD%d",evNumber);
-    printf("%s\n",nameTD);
-    TTree *TD = (TTree*)gDirectory->Get(nameTD);
-    bd = TD->GetBranch("START");
-    bd->SetAddress(&digits);
-    bd->GetEvent(0);
-    printf(" Digits: "); digits->MyDump();
-    
-    sprintf(nameTR,"TreeR%d",evNumber);
-    TTree *TR = new TTree(nameTR,"START");
-    bRec = TR->Branch("START","AliSTARTvertex",&vertex,buffersize,split);
+  sprintf(nameTD,"TreeD%d",evNumber);
+  printf("%s\n",nameTD);
+  TTree *td = (TTree*)gDirectory->Get(nameTD);
+  bd = td->GetBranch("START");
+  bd->SetAddress(&digits);
+  bd->GetEvent(0);
+  printf(" Digits: "); digits->MyDump();    
+  sprintf(nameTR,"TreeR%d",evNumber);
+  TTree *tr = new TTree(nameTR,"START");
+  bRec = tr->Branch("START","AliSTARTvertex",&vertex,buffersize,split);
 
 
-    //  TD->Print(); TD->Show(0); TD->GetBranch("START")->Dump();
+  //  td->Print(); td->Show(0); td->GetBranch("START")->Dump();
+        digits->MyDump();
+       printf("digits-> %d \n",digits->GetTime());
   
   
-    if(digits->fTime_average!=0)
-      {
-      timediff=digits->fTime_diff;     //time in number of channels
-      timePs=(timediff-128)*10.;       // time in Ps
+  if(digits->GetTime()!=999999)
+    {
+      timediff=digits->GetTime();     //time in number of channels
+      timePs=(timediff-128)*10.;       // time in Ps channel_width =10ps
       printf(" timediff %d in PS %f\n",timediff,timePs);
       Float_t c = 299792458/1.e9;  //speed of light cm/ps
       printf(" timediff %d in PS %f\n",timediff,timePs);
       Float_t c = 299792458/1.e9;  //speed of light cm/ps
-      Float_t Zposit=timePs*c;
-      printf(" Z position %f\n",Zposit);
+      //Float_t c = 0.3;  //speed of light mm/ps
+      Float_t Zposit=timePs*c;// for 0 vertex
+      //    Float_t Zposit=timePs*c/2.;// for spread vertex
+      //      printf(" Z position %f\n",Zposit);
       //      vertex->GetVertex();
       vertex->Set(Zposit);
       //      vertex->GetVertex();
       vertex->Set(Zposit);
-      TR->Fill();
-      TR->Write();
+      tr->Fill();
+      tr->Write();
       //hTimediff->Fill(timePs);
       //hVertex->Fill(Zposit);
       }
       //hTimediff->Fill(timePs);
       //hVertex->Fill(Zposit);
       }
index 6aa0dc70d0e871f0c023ab0e99f3b1a5a6656922..5887727e9574338b14d52770a4a060bfd8ed8910 100644 (file)
@@ -11,7 +11,7 @@ class AliSTARTvertex   : public TObject {
 
 
 ////////////////////////////////////////////////////////////////////////
 
 
 ////////////////////////////////////////////////////////////////////////
- public:
+ private:
   Int_t fZposition;        // Z position of vertex
 
  public:
   Int_t fZposition;        // Z position of vertex
 
  public:
diff --git a/START/DigitMaker.C b/START/DigitMaker.C
new file mode 100644 (file)
index 0000000..1b47fcb
--- /dev/null
@@ -0,0 +1,75 @@
+void DigitMaker (Int_t evNumber=1) 
+{
+  /////////////////////////////////////////////////////////////////////////
+  //   This macro is a small example of a ROOT macro
+  //   illustrating how to read the output of GALICE
+  //   and fill some histograms.
+  //   
+  //     Root > .L anal.C   //this loads the macro in memory
+  //     Root > anal();     //by default process first event   
+  //     Root > anal(2);    //process third event
+  //Begin_Html
+  /*
+    <img src="gif/anal.gif">
+  */
+  //End_Html
+  /////////////////////////////////////////////////////////////////////////
+  
+  
+  // Dynamically link some shared libs
+  if (gClassTable->GetID("AliRun") < 0) {
+    gROOT->LoadMacro("loadlibs.C");
+    loadlibs();
+  }
+  
+  // Connect the Root Galice file containing Geometry, Kine and Hits
+  TFile *file =  (TFile*)gROOT->GetListOfFiles()->FindObject("galice.root");
+  if (!file) file = new TFile("galice.root","UPDATE");
+  
+  // Get AliRun object from file or create it if not on file
+  if (!gAlice) {
+    gAlice = (AliRun*)file->Get("gAlice");
+    if (gAlice) printf("AliRun object found on file\n");
+    if (!gAlice) gAlice = new AliRun("gAlice","Alice test program");
+  }
+
+  TParticle *particle;
+  AliSTARThit  *startHit;
+
+  Int_t buffersize=256;
+  Int_t split=1;
+
+  digits= new AliSTARTdigit();
+  TBranch *bDig=0;
+  printf("Branch\n");
+
+  
+  AliSTART *START  = (AliSTART*) gAlice->GetDetector("START");
+  
+ // Event ------------------------- LOOP  
+  
+  for (j=0; j<evNumber; j++){
+
+   
+    START->Hit2digit(j); 
+
+  }// event loop
+
+  file->Write();
+  file->Close();
+
+}//endmacro
+
+
+
+
+
+
+
+
+
+
+
+
+
index 0c323cdde78550063ce18a4e0e8563fb3d7b7617..80448d2643ea52f1bd7bd675cc0fabfc65994a72 100755 (executable)
@@ -10,7 +10,8 @@ void DrawSTART()
    gMC->SetClipBox(".");
    //  gMC->SetClipBox("*", 0, 1000, -1000, 1000, -1000, 1000);
    gMC->DefaultRange();
    gMC->SetClipBox(".");
    //  gMC->SetClipBox("*", 0, 1000, -1000, 1000, -1000, 1000);
    gMC->DefaultRange();
-   gMC->Gdraw("alic", 40, 30, 0, 6, 9, .08, .08);
+   //gMC->Gdraw("alic", 40, 30, 0, -8, 2, 1, 1);
+   gMC->Gdraw("alic", 40, 30, 0, 10, 9, 1., 1.);
    gMC->Gdhead(1111, "START Detector");
    gMC->Gdhead(1111, "START Detector");
-   gMC->Gdman(13, 9, "MAN");
+   //  gMC->Gdman(13, 9, "MAN");
 }
 }
index e1f58684356fc52afdd32fb99ec8e700e13c101c..fcd0a8ed4bb7d9302e15be80ab1e5b60e2add00a 100644 (file)
@@ -1,3 +1,4 @@
+
 ###############################START Makefile##################################
 
 # Include machine specific definitions
 ###############################START Makefile##################################
 
 # Include machine specific definitions
@@ -9,7 +10,7 @@ PACKAGE = START
 
 # C++ sources
 
 
 # C++ sources
 
-SRCS          = AliSTART.cxx AliSTARTv0.cxx AliSTARThit.cxx AliSTARTdigit.cxx
+SRCS          = AliSTART.cxx AliSTARTv0.cxx AliSTARTv1.cxx AliSTARThit.cxx AliSTARTdigit.cxx AliSTARTvertex.cxx
 
 # C++ Headers
 
 
 # C++ Headers
 
index 6538c363e10fd556a32e2693e42505262be602ac..6d3196b0af1ce5a7dacd3883d1f0a388d5a56657 100755 (executable)
@@ -10,7 +10,9 @@
  
 #pragma link C++ class  AliSTART;
 #pragma link C++ class  AliSTARTv0;
  
 #pragma link C++ class  AliSTART;
 #pragma link C++ class  AliSTARTv0;
+#pragma link C++ class  AliSTARTv1;
 #pragma link C++ class  AliSTARThit;
 #pragma link C++ class  AliSTARTdigit;
 #pragma link C++ class  AliSTARThit;
 #pragma link C++ class  AliSTARTdigit;
+#pragma link C++ class  AliSTARTvertex;
 
 #endif
 
 #endif
index 095aad2d1924c328d511b0ea874a8d8fa96c0d7f..4d1ba28dc31712160badec69a25ad4d777d83663 100755 (executable)
@@ -1,7 +1,8 @@
 void ViewSTART()
 {
 void ViewSTART()
 {
-   gMC->Gsatt("STRT","seen",0);
-   gMC->Gsatt("PMT ","seen",1);
+  //   gMC->Gsatt("STRT","seen",0);
+   gMC->Gsatt("INST","seen",0);
+   gMC->Gsatt("PMT","seen",1);
    gMC->Gsatt("DIVI","seen",1);
 }
 
    gMC->Gsatt("DIVI","seen",1);
 }
 
diff --git a/START/readDigits.C b/START/readDigits.C
new file mode 100644 (file)
index 0000000..9ab99bd
--- /dev/null
@@ -0,0 +1,67 @@
+void readDigits(Int_t evNumber=1) 
+{
+  // Dynamically link some shared libs
+  if (gClassTable->GetID("AliRun") < 0) {
+    gROOT->LoadMacro("loadlibs.C");
+    loadlibs();
+  }
+  
+  // 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("galice.root","UPDATE");
+  
+  // Get AliRun object from file or create it if not on file
+  if (!gAlice) {
+    gAlice = (AliRun*)file->Get("gAlice");
+    if (gAlice) printf("AliRun object found on file\n");
+    if (!gAlice) gAlice = new AliRun("gAlice","Alice test program");
+  }
+  char nameTD[8],nameTR[8];
+
+  TH1F *hTimediff = new TH1F("hTimediff","Time difference",100,0,256);
+  TH1F *hTimePs = new TH1F("hTimePs","Time in Ps",100,-2000,2000);
+  
+  digits = new AliSTARTdigit();
+  TBranch *bd;
+
+
+ // Event ------------------------- LOOP  
+  for (j=0; j<evNumber; j++){
+    sprintf(nameTD,"TreeD%d",j);
+    printf("%s\n",nameTD);
+    TTree *TD = (TTree*)gDirectory->Get(nameTD);
+    bd = TD->GetBranch("START");
+    bd->SetAddress(&digits);
+    bd->GetEvent(0); 
+    //    printf(" Digits: %d \n ",digits->GetTime()); 
+    
+    printf("time %d\n",digits->GetTime());
+    
+    if(digits->GetTime()!=999999){
+      Int_t timediff = digits->GetTime();
+      Double_t timePs=(timediff-128)*10.; // time in Ps channel_width =10ps
+      //      cout<<"timediff "<<timediff<<" timePs "<<timePs<<endl;
+      hTimediff->Fill(timediff);
+      hTimePs->Fill(timePs);
+    }
+  }
+
+    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);
+  TCanvas *c1 = new TCanvas("c1","Alice START Time ",400,10,600,600);
+  hTimePs->SetXTitle("arriving time, ps");
+  hTimePs->SetYTitle("number of events");
+  hTimePs->Write();
+
+    
+} // end of macro
+
+
+
+
diff --git a/START/readVertex.C b/START/readVertex.C
new file mode 100644 (file)
index 0000000..a7da4b3
--- /dev/null
@@ -0,0 +1,69 @@
+void readVertex(Int_t evNumber=1) 
+{
+  // Dynamically link some shared libs
+  if (gClassTable->GetID("AliRun") < 0) {
+    gROOT->LoadMacro("loadlibs.C");
+    loadlibs();
+  }
+  
+  // Connect the Root Galice file containing Geometry, Kine and Hits
+
+  TFile *file =  (TFile*)gROOT->GetListOfFiles()->FindObject("galice.root");
+  if (!file) file = new TFile("galice.root","UPDATE");
+  
+  // Get AliRun object from file or create it if not on file
+  if (!gAlice) {
+    gAlice = (AliRun*)file->Get("gAlice");
+    if (gAlice) printf("AliRun object found on file\n");
+    if (!gAlice) gAlice = new AliRun("gAlice","Alice test program");
+  }
+  char nameTD[8],nameTR[8];
+
+  TH1F *hVertex = new TH1F("hVertex","Z position of vertex",100,-350,350);
+  
+  digits = new AliSTARTdigit();
+  vertex = new AliSTARTvertex();
+  TBranch *bd;
+  TBranch *bRec;
+
+ // Event ------------------------- LOOP  
+  for (j=0; j<evNumber; j++){
+    sprintf(nameTD,"TreeD%d",j);
+    printf("%s\n",nameTD);
+    TTree *TD = (TTree*)gDirectory->Get(nameTD);
+    bd = TD->GetBranch("START");
+    bd->SetAddress(&digits);
+    bd->GetEvent(0); 
+    printf(" Digits: %d \n ",digits->GetTime()); 
+    
+    
+    sprintf(nameTR,"TreeR%d",j);
+    printf("%s\n",nameTR);
+    TTree *TR = (TTree*)gDirectory->Get(nameTR);
+    bRec = TR->GetBranch("START");
+    bRec->SetAddress(&vertex);
+    bRec->GetEvent(0);
+    if(digits->GetTime()!=999999){
+      hVertex->Fill(vertex->GetVertex());
+      // printf(" Z position %f\n",vertex->GetVertex());
+    }
+  }
+    Hfile = new TFile("figs1.root","RECREATE","Histograms for START Vertex");
+   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 (vertex)",400,10,600,600);
+
+  hVertex->SetXTitle("vertex position, mm");
+  hVertex->SetYTitle("number of events");
+  hVertex->Write();
+
+} // end of macro
+
+
+
+
diff --git a/START/vertex.C b/START/vertex.C
new file mode 100644 (file)
index 0000000..802b547
--- /dev/null
@@ -0,0 +1,37 @@
+void VertexMaker(Int_t evNumber=1) 
+{
+  
+  // Dynamically link some shared libs
+  if (gClassTable->GetID("AliRun") < 0) {
+    gROOT->LoadMacro("loadlibs.C");
+    loadlibs();
+  }
+  
+  // Connect the Root Galice file containing Geometry, Kine and Hits
+    TFile *file =  (TFile*)gROOT->GetListOfFiles()->FindObject("galice.root");
+    if (!file) file = new TFile("galice.root","UPDATE");
+   
+  // Get AliRun object from file or create it if not on file
+  if (!gAlice) {
+    gAlice = (AliRun*)file->Get("gAlice");
+    if (gAlice) printf("AliRun object found on file\n");
+    if (!gAlice) gAlice = new AliRun("gAlice","Alice test program");
+  }
+
+
+  vertex= new AliSTARTvertex();
+  TBranch *bRec=0;
+
+  
+ // Event ------------------------- LOOP  
+  for (j=0; j<evNumber; j++){
+    vertex->Reconstruct(j);
+  }
+  file->Write();
+  file->Close();
+
+} // end of macro
+
+
+
+