/*
$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
#include "AliSTARTdigit.h"
#include "AliMC.h"
#include "AliSTARThit.h"
+#include "AliSTARThitPhoton.h"
#include "AliSTARTvertex.h"
ClassImp(AliSTART)
fIshunt = 1;
fHits = 0;
fDigits = 0;
+ fPhotons = 0;
}
//_____________________________________________________________________________
// 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);
}
fHits->Delete();
delete fHits;
}
+ if (fPhotons) {
+ fPhotons->Delete();
+ delete fPhotons;
+ }
}
//_____________________________________________________________________________
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)
// 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();
*/
}
+//_____________________________________________________________________________
+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)
//
// From hits to digits
//
+ /*
Float_t x,y,e;
Int_t nbytes = 0;
Int_t hit;
td->Fill();
printf("digits-> %d \n",digits->GetTime());
td->Write();
-
+ */
}
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(){}
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
};
//_____________________________________________________________________________
#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"
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);
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;
+}
class AliRunDigitizer;
class AliSTART;
class AliSTARThit;
+class AliSTARThitPhoton;
class AliSTARTdigit;
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)
};
**************************************************************************/
/*
$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
*/
+#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;
+
+
+}
/* $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
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);
**************************************************************************/
/*
$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
// Event ------------------------- LOOP
- gAlice->GetEvent(evNumber);
+ // gAlice->GetEvent(evNumber);
sprintf(nameTD,"START_D_%d",evNumber);
TObject *td = (TObject*)gDirectory->Get(nameTD);
}
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();
}
# 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
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("");
}
#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+;
// 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) {
-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)
// 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) {
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();
// 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) {
}
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();
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();