/*
$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
#include "AliSTARTvertex.h"
ClassImp(AliSTART)
- AliSTARTdigit *digits;
+
+static AliSTARTdigit *digits;
+
//_____________________________________________________________________________
AliSTART::AliSTART()
{
//
// Build simple ROOT TNode geometry for event display
//
- TNode *Node, *Top;
+ TNode *node, *top;
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);
- 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);
- 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);
}
//_____________________________________________________________________________
//---------------------------------------------------------------------------
void AliSTART::MakeBranch(Option_t* option)
{
-
+ //
+ // Specific START branches
+ //
AliSTARTdigit *digits;
// Create Tree branches for the START.
Int_t buffersize = 400;
AliDetector::MakeBranch(option);
- TTree *TD = gAlice->TreeD();
+ TTree *td = gAlice->TreeD();
digits = new AliSTARTdigit();
- TD->Branch(branchname,"AliSTARTdigit",&digits, buffersize);
+ td->Branch(branchname,"AliSTARTdigit",&digits, buffersize);
printf("Making Branch %s for digits\n",branchname);
/*
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 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 channel_width=10;
+ Int_t channelWidth=10;
TParticle *particle;
AliSTARThit *startHit;
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);
- 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.;
- 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);
- TClonesArray *Particles = gAlice->Particles();
+ TClonesArray *particles = gAlice->Particles();
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();
- 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++) {
} //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;
- 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
- 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();
- TD->Write();
- } //timediff
+ printf("digits-> %d \n",digits->GetTime());
+ td->Write();
+ // } //timediff
} // end macro
+
-#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 */
class AliSTART : public AliDetector {
-public:
- Int_t fZposit;
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(){}
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
**************************************************************************/
/*
$Log$
+Revision 1.2 2000/03/24 17:40:35 alla
+New AliSTART
+
*/
#include <iostream.h>
#include <fstream.h>
// 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.
//
- Timeav = fTime_average;
- Timediff = fTime_diff;
+ Timeav = fTimeAverage;
+ Timediff = fTimeDiff;
}
-#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 */
//___________________________________________
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:
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
};
-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)
- {fTime_average=Timeav; fTime_diff=Timediff;}
+ {fTimeAverage=Timeav; fTimeDiff=Timediff;}
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
-#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 */
/*
$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
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++)
{
//------------------------------------------------------------------------
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;
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);
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};
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);
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);
- 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);
- 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
//------------------------------------------------------------------------
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 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);
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);
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);
//
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;
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);
}
**************************************************************************/
/*
$Log$
+Revision 1.1 2000/03/24 17:46:58 alla
+Vertex reconstruction
+
*/
#include <TObject.h>
#include "AliSTARTvertex.h"
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
// TParticle *particle;
digits = new AliSTARTdigit();
vertex = new AliSTARTvertex();
- // AliSTART *START = (AliSTART*) gAlice->GetDetector("START");
// 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
- 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);
- TR->Fill();
- TR->Write();
+ tr->Fill();
+ tr->Write();
//hTimediff->Fill(timePs);
//hVertex->Fill(Zposit);
}
////////////////////////////////////////////////////////////////////////
- public:
+ private:
Int_t fZposition; // Z position of vertex
public:
--- /dev/null
+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
+
+
+
+
+
+
+
+
+
+
+
+
+
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->Gdman(13, 9, "MAN");
+ // gMC->Gdman(13, 9, "MAN");
}
+
###############################START Makefile##################################
# Include machine specific definitions
# 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
#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 AliSTARTvertex;
#endif
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);
}
--- /dev/null
+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
+
+
+
+
--- /dev/null
+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
+
+
+
+
--- /dev/null
+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
+
+
+
+