From db173afc0d05e61c47de1e6ae0af77fb7e0bd263 Mon Sep 17 00:00:00 2001 From: alla Date: Mon, 11 Apr 2005 05:44:36 +0000 Subject: [PATCH 1/1] RAWDATA closer to reality --- START/AliSTART.cxx | 146 ++++++++++++++++--- START/AliSTART.h | 18 ++- START/AliSTARTDigitizer.cxx | 207 +++++++++++++++------------ START/AliSTARTDigitizer.h | 11 +- START/AliSTARTRawData.cxx | 213 +++++++++++++++++----------- START/AliSTARTRawData.h | 24 ++-- START/AliSTARTRawReader.cxx | 218 +++++++++++++++++++--------- START/AliSTARTRawReader.h | 31 ++-- START/AliSTARTRecPoint.cxx | 64 +-------- START/AliSTARTRecPoint.h | 33 +++-- START/AliSTARTReconstructor.cxx | 132 ++++++++++++----- START/AliSTARTReconstructor.h | 14 +- START/AliSTARTdigit.cxx | 111 ++++++++++++--- START/AliSTARTdigit.h | 72 ++++++---- START/AliSTARTv1.cxx | 242 +++++++++++++++++--------------- START/AliSTARTv1.h | 4 +- START/STARTrecLinkDef.h | 2 + START/STARTsimLinkDef.h | 1 - START/libSTARTrec.pkg | 2 +- START/libSTARTsim.pkg | 2 +- 20 files changed, 971 insertions(+), 576 deletions(-) diff --git a/START/AliSTART.cxx b/START/AliSTART.cxx index ca20910629e..097c099abc7 100755 --- a/START/AliSTART.cxx +++ b/START/AliSTART.cxx @@ -53,13 +53,14 @@ #include "AliMC.h" #include "AliLoader.h" #include "AliRun.h" - +#include "TClonesArray.h" #include "AliSTART.h" #include "AliSTARTLoader.h" #include "AliSTARTdigit.h" #include "AliSTARThit.h" #include "AliSTARTDigitizer.h" #include "AliSTARTRawData.h" +#include "AliSTARTRecPoint.h" ClassImp(AliSTART) @@ -74,6 +75,7 @@ AliSTART::AliSTART() fIshunt = 1; fHits = 0; fDigits = 0; + fRecPoints = 0; } //_____________________________________________________________________________ @@ -89,6 +91,8 @@ AliSTART::AliSTART(const char *name, const char *title) // Initialise Hit array fHits = new TClonesArray("AliSTARThit", 405); gAlice->GetMCApp()->AddHitList(fHits); + fDigits = new AliSTARTdigit(); + fRecPoints = new AliSTARTRecPoint(); fIshunt = 1; fIdSens = 0; SetMarkerColor(kRed); @@ -96,10 +100,24 @@ AliSTART::AliSTART(const char *name, const char *title) //_____________________________________________________________________________ AliSTART::~AliSTART() { + if (fHits) { fHits->Delete(); delete fHits; + cout<<" delete fHits; "<Delete(); + delete fDigits; + cout<<" delete fDigits; "<Delete(); + delete fRecPoints; + cout<<" delete fRecPoints; "< SetTimeBestRight(besttimeright); + fDigits->SetTimeBestLeft(besttimeleft); + fDigits-> SetMeanTime(meantime); + fDigits-> SetDiffTime(timediff); + fDigits-> SetSumMult(*sumMult); + fDigits->SetTime(*time); + fDigits->SetTimeAmp(*timeAmp); + fDigits->SetADC(*adc); + fDigits->SetADCAmp(*adcAmp); } + //_____________________________________________________________________________ void AliSTART::BuildGeometry() { @@ -183,20 +217,43 @@ void AliSTART::Init() void AliSTART::MakeBranch(Option_t* option) { // - // Specific START branches +// Create Tree branches for the START. + + // Options: + // + // H Make a branch of TClonesArray of AliSTARTHit's + // D Make a branch of TClonesArray of AliSTARTDigit's + // + // R Make a branch of AliSTARTRecPoints // - // Create Tree branches for the START. char branchname[20]; sprintf(branchname,"%s",GetName()); const char *cH = strstr(option,"H"); - - if (cH && fLoader->TreeH()) + const char *cD = strstr(option,"D"); + const char *cR = strstr(option,"R"); + + if (cH && fLoader->TreeH()) { if (fHits == 0x0) fHits = new TClonesArray("AliSTARThit", 405); + AliDetector::MakeBranch(option); } + + + if (cD && fLoader->TreeD()) + { + if (fDigits == 0x0) fDigits = new AliSTARTdigit(); + // MakeBranchInTree(fLoader->TreeD(), branchname, + // &fDigits, 405, 0); + fLoader->TreeD()->Branch(branchname,"AliSTARTdigit",&fDigits,405,1); + } + if (cR && fLoader->TreeR()) + { + if (fRecPoints == 0x0) fRecPoints = new AliSTARTRecPoint(); + MakeBranchInTree(fLoader->TreeR(), branchname, + &fRecPoints, 405, 0); + } - AliDetector::MakeBranch(option); } //_____________________________________________________________________________ @@ -205,6 +262,14 @@ void AliSTART::ResetHits() AliDetector::ResetHits(); } +//____________________________________________________________________ +void AliSTART::ResetDigits() +{ + // + // Reset number of digits and the digits array for this detector + // + if (fDigits) fDigits->Clear(); +} //_____________________________________________________________________________ void AliSTART::SetTreeAddress() @@ -219,16 +284,36 @@ void AliSTART::SetTreeAddress() } AliDetector::SetTreeAddress(); - + TTree *treeD = fLoader->TreeD(); + if (treeD) { + if (fDigits == 0x0) fDigits = new AliSTARTdigit(); + TBranch* branch = treeD->GetBranch ("START"); + if (branch) branch->SetAddress(&fDigits); + } + + TTree *treeR = fLoader->TreeR(); + if (treeR) { + if (fRecPoints == 0x0) fRecPoints = new AliSTARTRecPoint() ; + TBranch* branch = treeR->GetBranch ("START"); + if (branch) branch->SetAddress(&fRecPoints); + } + } -//______________________________________________________________________ -AliLoader* AliSTART::MakeLoader(const char* topfoldername) -{ - AliDebug(2,Form(" Creating AliSTARTLoader ")); - fLoader = new AliSTARTLoader(GetName(), topfoldername); - return fLoader; +//_____________________________________________________________________________ +void AliSTART::MakeBranchInTreeD(TTree *treeD, const char *file) +{ + // + // Create TreeD branches for the FMD + // + const Int_t kBufferSize = 4000; + char branchname[20]; + sprintf(branchname,"%s",GetName()); + if(treeD) + { + MakeBranchInTree(treeD, branchname,&fDigits, kBufferSize, file); + } } //_____________________________________________________________________________ @@ -242,16 +327,31 @@ void AliSTART::Digits2Raw() // // Starting from the START digits, writes the Raw Data objects // - AliSTARTLoader* pStartLoader = (AliSTARTLoader*)fLoader; - pStartLoader ->LoadDigits(); - AliSTARTdigit* fDigits=pStartLoader->Digits(); +// AliSTARTLoader* pStartLoader = (AliSTARTLoader*)fLoader; + fLoader ->LoadDigits("read"); + TTree* treeD = fLoader->TreeD(); + if (!treeD) { + AliError("no digits tree"); + return; + } + if (fDigits == 0x0) fDigits = new AliSTARTdigit(); + + TBranch *branch = treeD->GetBranch("START"); + if (branch) { + branch->SetAddress(&fDigits); + }else{ + AliError("Branch START DIGIT not found"); + exit(111); + } AliSTARTRawData rawWriter; rawWriter.SetVerbose(0); - + AliDebug(2,Form(" Formatting raw data for START ")); + branch->GetEntry(0); + // rawWriter.RawDataSTART(treeD->GetBranch("START")); + rawWriter.RawDataSTART(fDigits); + + + fLoader->UnloadDigits(); - rawWriter.RawDataSTART (fDigits); - - pStartLoader->UnloadDigits(); - } diff --git a/START/AliSTART.h b/START/AliSTART.h index 6a856bd6312..aabbbee538c 100755 --- a/START/AliSTART.h +++ b/START/AliSTART.h @@ -9,6 +9,9 @@ #include #include +#include +#include "AliSTARTRecPoint.h" +#include "AliSTARTdigit.h" class TDirectory; class TFile; @@ -26,7 +29,9 @@ public: AliSTART(const char *name, const char *title); virtual ~AliSTART(); virtual void AddHit(Int_t track, Int_t *vol, Float_t *hits); - virtual void AddDigit(Int_t *tracks, Int_t *digits); + virtual void AddDigit(Int_t besttimeright, Int_t besttimeleft, Int_t meantime, + Int_t timediff, TArrayI *sumMult, + TArrayI *time, TArrayI *adc, TArrayI *timeAmp, TArrayI *adcAmp); virtual void BuildGeometry(); virtual void CreateGeometry(){} virtual void CreateMaterials(){} @@ -39,15 +44,18 @@ public: virtual void MakeBranch(Option_t *opt=" "); virtual void StepManager(){} virtual void ResetHits(); - virtual void SetTreeAddress(); - virtual AliLoader* MakeLoader(const char* topfoldername); + virtual void ResetDigits(); + virtual void SetTreeAddress(); + virtual void MakeBranchInTreeD(TTree *treeD, const char *file=0); + // virtual AliLoader* MakeLoader(const char* topfoldername); virtual AliDigitizer* CreateDigitizer(AliRunDigitizer* manager) const; void Digits2Raw (); protected: - Int_t fIdSens; // Sensetive Cherenkov radiator + Int_t fIdSens; // Sensetive Cherenkov photocathode + AliSTARTdigit *fDigits; + AliSTARTRecPoint *fRecPoints; -private: ClassDef(AliSTART,4) //Base class for the T0 aka START detector }; diff --git a/START/AliSTARTDigitizer.cxx b/START/AliSTARTDigitizer.cxx index 4c66a32656e..25caf7e20f3 100644 --- a/START/AliSTARTDigitizer.cxx +++ b/START/AliSTARTDigitizer.cxx @@ -54,6 +54,9 @@ AliSTARTDigitizer::AliSTARTDigitizer(AliRunDigitizer* manager) fdigits(0), ftimeTDC(0), fADC(0), + ftimeTDCAmp(0), + fADCAmp(0), + fSumMult(0), fEff(0) { // cout<<"AliSTARTDigitizer::AliSTARTDigitizer"<Get("hEff")->Clone(); @@ -86,6 +92,9 @@ AliSTARTDigitizer::~AliSTARTDigitizer() delete ftimeTDC; delete fADC; delete fEff; + delete ftimeTDCAmp; + delete fADCAmp; + delete fSumMult; } //------------------------------------------------------------------------ @@ -112,74 +121,72 @@ void AliSTARTDigitizer::Exec(Option_t* /*option*/) */ - AliRunLoader *inRL, *outRL;//in and out Run Loaders - AliLoader *pInStartLoader, *pOutStartLoader;// in and out STARTLoaders - - outRL = AliRunLoader::GetRunLoader(fManager->GetOutputFolderName()); - pOutStartLoader = outRL->GetLoader("STARTLoader"); + //output loader + AliRunLoader *outRL = AliRunLoader::GetRunLoader(fManager->GetOutputFolderName()); + AliLoader * pOutStartLoader = outRL->GetLoader("STARTLoader"); + AliSTART *fSTART = (AliSTART*)outRL ->GetAliRun()->GetDetector("START"); AliDebug(1,"start..."); - + cout<<" AliSTARTDigitizer::Exec "<T-> coefficients !!!! should be asked!!! + Float_t ph2mV = 150./500.; + Int_t threshold =50; //photoelectrons + Int_t mV2channel=200000/(25*25); //5V -> 200ns + AliSTARThit *startHit; TBranch *brHits=0; - pOutStartLoader->LoadDigits("UPDATE");//probably it is necessary to load them before - fdigits= new AliSTARTdigit(); - pOutStartLoader->GetDigitsDataLoader()->GetBaseLoader(0)->Post(fdigits); - Int_t nFiles=fManager->GetNinputs(); for (Int_t inputFile=0; inputFileGetInputFolderName(inputFile)); + for ( Int_t imu=0; imu<3; imu++) sumMult[imu]=0; + AliRunLoader * inRL = AliRunLoader::GetRunLoader(fManager->GetInputFolderName(inputFile)); + AliLoader * pInStartLoader = inRL->GetLoader("STARTLoader"); if (!inRL->GetAliRun()) inRL->LoadgAlice(); - AliSTART *fSTART = (AliSTART*) inRL->GetAliRun()->GetDetector("START"); - pInStartLoader = inRL->GetLoader("STARTLoader"); + + //read Hits pInStartLoader->LoadHits("READ");//probably it is necessary to load them before TClonesArray *fHits = fSTART->Hits (); - TTree *th = pInStartLoader->TreeH(); brHits = th->GetBranch("START"); if (brHits) { fSTART->SetHitsAddressBranch(brHits); }else{ - AliError("Branch START hit not found"); + AliError("Branch START hit not found"); exit(111); } Int_t ntracks = (Int_t) th->GetEntries(); - + if (ntracks<=0) return; // Start loop on tracks in the hits containers for (Int_t track=0; trackGetEntry(track); nhits = fHits->GetEntriesFast(); - for (hit=0;hitUncheckedAt(hit); if (!startHit) { @@ -188,79 +195,101 @@ void AliSTARTDigitizer::Exec(Option_t* /*option*/) } pmt=startHit->Pmt(); Int_t numpmt=pmt-1; - Double_t e=startHit->Etot(); - // cout<<"AliSTARTDigitizer::Exec >> e "<Time()<Etot(); volume = startHit->Volume(); - if(e>0 && RegisterPhotoE(e)) { - countE[numpmt]++; - besttime[numpmt] = startHit->Time(); - if(besttime[numpmt]0 && RegisterPhotoE(e)) { + countE[numpmt]++; + besttime[numpmt] = startHit->Time(); + if(besttime[numpmt]Gaus(time[ipmt],0.025); + //spread time right&left by 25ps && besttime + for (Int_t ipmt=0; ipmt<12; ipmt++){ + if(countE[ipmt] > threshold) { + timeGaus[ipmt]=gRandom->Gaus(time[ipmt],25); if(timeGaus[ipmt]Gaus(time[ipmt],0.025); + } + for ( Int_t ipmt=12; ipmt<24; ipmt++){ + if(countE[ipmt] > threshold) { + timeGaus[ipmt]=gRandom->Gaus(time[ipmt],25); if(timeGaus[ipmt]SetTimeBestLeft(bestLeftTDC); - fdigits->SetTimeBestRight(bestRightTDC); - fdigits->SetMeanTime(iTimeAv); - - //ADC features - - for (Int_t i=0; i<36; i++) + bestLeftTDC=Int_t (besttimeleftR/channelWidth); + bestRightTDC=Int_t (besttimeright/channelWidth); + timeDiff=Int_t ((besttimeright-besttimeleftR)/channelWidth); + meanTime=Int_t (((besttimeright+besttimeleft)/2.)/channelWidth); + AliDebug(2,Form(" time in ns %f ", besttimeleft)); + for (Int_t i=0; i<24; i++) { - // fill TDC - tr= Int_t (timeGaus[i]*1000/channelWidth); - if(timeGaus[i]>100) tr=0; - ftimeTDC->AddAt(tr,i); + tr= Int_t (timeGaus[i]/channelWidth); + if(timeGaus[i]>50000) tr=0; //fill ADC - Int_t al= countE[i]; //1024 - channel width shoul be change - fADC->AddAt(al,i); + Int_t al= countE[i]; + // QTC procedure: + // phe -> mV 0.3; 1MIP ->500phe -> ln (amp (mV)) = 5; + // max 200ns, HIJING mean 50000phe -> 15000mv -> ln = 15 (s zapasom) + // channel 25ps + if (al>threshold) { + qt=Int_t (TMath::Log(al*ph2mV) * mV2channel); + qtAmp=Int_t (TMath::Log(al*10*ph2mV) * mV2channel); + cout<AddAt(qt,i); + ftimeTDC->AddAt(tr,i); + fADCAmp->AddAt(qtAmp,i); + ftimeTDCAmp->AddAt(tr,i); //now is the same as non-amplified but will be change + } } //pmt loop - - fdigits->SetTime(*ftimeTDC); - fdigits->SetADC(*fADC); - - pInStartLoader->UnloadHits(); - + for (Int_t im=0; im<3; im++) + { + if (sumMult[im]>threshold){ + Int_t sum=Int_t (TMath::Log(sumMult[im]*ph2mV) * mV2channel); + Int_t sumAmp=Int_t (TMath::Log(10*sumMult[im]*ph2mV) * mV2channel); + fSumMult->AddAt(sum,im); + fSumMult->AddAt(sumAmp,im+3); + } + } + + fSTART->AddDigit(bestRightTDC,bestLeftTDC,meanTime,timeDiff,fSumMult, + ftimeTDC,fADC,ftimeTDCAmp,fADCAmp); + pOutStartLoader->UnloadHits(); } //input streams loop - + + //load digits + pOutStartLoader->LoadDigits("UPDATE"); + TTree *treeD = pOutStartLoader->TreeD(); + if (treeD == 0x0) { + pOutStartLoader->MakeTree("D"); + treeD = pOutStartLoader->TreeD(); + } + fSTART->MakeBranch("D"); + treeD->Reset(); + treeD->Fill(); + pOutStartLoader->WriteDigits("OVERWRITE"); + + fSTART->ResetDigits(); pOutStartLoader->UnloadDigits(); + } diff --git a/START/AliSTARTDigitizer.h b/START/AliSTARTDigitizer.h index 4d597e1f9fe..11cf1b77804 100644 --- a/START/AliSTARTDigitizer.h +++ b/START/AliSTARTDigitizer.h @@ -21,20 +21,25 @@ class AliSTARTDigitizer : public AliDigitizer { virtual Bool_t Init(); TClonesArray *Hits() const {return fHits;} TArrayI *timeTDC() {return ftimeTDC;} - TArrayI * ADC() {return fADC;} //for slow simulation + TArrayI * ADC() {return fADC;} + TArrayI *timeTDCAmp() {return ftimeTDCAmp;} + TArrayI * ADCAmp() {return fADCAmp;} + TArrayI *SumMult() {return fSumMult;} // Do the main work void Exec (Option_t* /*option=0*/) ; - Bool_t RegisterPhotoE(Double_t e); + Bool_t RegisterPhotoE(Double_t energy); enum {kBgTag = -1}; private: AliSTART *fSTART; //! - TClonesArray *fPhotons ; //! Number of Cherenkov photons TClonesArray *fHits ; //! List of hits AliSTARTdigit *fdigits ; //! digits TArrayI *ftimeTDC ; //! array of TDC signal from right side TArrayI *fADC ;//! array of ADC signal from left sida + TArrayI *ftimeTDCAmp ; //! array of TDC amplified signal from right side + TArrayI *fADCAmp ;//! array of ADC amplified signal from left sida + TArrayI *fSumMult; // multiplicity TH1* fEff; //! efficiency histogram ClassDef(AliSTARTDigitizer,1) diff --git a/START/AliSTARTRawData.cxx b/START/AliSTARTRawData.cxx index d2510e498ca..73af4aa96e1 100644 --- a/START/AliSTARTRawData.cxx +++ b/START/AliSTARTRawData.cxx @@ -26,11 +26,12 @@ #include "AliSTART.h" #include "AliSTARTRawData.h" #include "AliSTARTdigit.h" -#include "AliSTARTLoader.h" +//#include "AliSTARTLoader.h" #include #include - +#include +#include #include "AliRawDataHeader.h" ClassImp(AliSTARTRawData) @@ -42,11 +43,13 @@ AliSTARTRawData::AliSTARTRawData():TObject() fIndex=-1; fDigits = NULL; - - ftimeTDC = new TArrayI(24); - fADC = new TArrayI(24); - - this->Dump(); + + ftimeTDC = new TArrayI(24); + fADC = new TArrayI(24); + ftimeTDCAmp = new TArrayI(24); + fADCAmp = new TArrayI(24); + fSumMult = new TArrayI(6); + // this->Dump(); } @@ -67,14 +70,15 @@ AliSTARTRawData::~AliSTARTRawData() // // Destructor // - if (fDigits) { delete fDigits; fDigits = NULL; - delete ftimeTDC; - delete fADC; } - + delete ftimeTDC; + delete fADC; + delete ftimeTDCAmp; + delete fADCAmp; + delete fSumMult; } //_____________________________________________________________________________ @@ -97,31 +101,27 @@ void AliSTARTRawData::GetDigits(AliSTARTdigit *fDigits, UInt_t *buf) //read START digits and fill TDC and ADC arrays - cout<<"GetDigits(AliSTARTdigit *fDigits, UInt_t *buf) "<Print(); - - // Get the digits array - - fDigits->GetTime(*ftimeTDC); - fDigits->GetADC(*fADC); - fBestTimeRight=fDigits->GetBestTimeRight(); - fBestTimeLeft=fDigits->GetBestTimeLeft(); - fMeanTime = fDigits-> GetMeanTime(); - + fDigits->GetTime(*ftimeTDC); + fDigits->GetADC(*fADC); + fDigits->GetTimeAmp(*ftimeTDCAmp); + fDigits->GetADCAmp(*fADCAmp); + fDigits->GetSumMult(*fSumMult); // Loop through all PMT - for (Int_t det = 0; det < 24; det++) { Int_t time=ftimeTDC->At(det); - Int_t ADC=fADC->At(det); - printf(" right det %x time %x ADC %x \n",det,time,ADC); - //conver ADC to time (preliminary algorithm) + Int_t qtc=fADC->At(det); + Int_t timeAmp=ftimeTDCAmp->At(det); + Int_t qtcAmp=fADCAmp->At(det); + //conver ADC to time (preliminary algorithm) // DDL 1 0-5 -#PMT, 6-31 - empty @@ -133,13 +133,14 @@ void AliSTARTRawData::GetDigits(AliSTARTdigit *fDigits, UInt_t *buf) word=0; baseWord=0; - //TDC + //TDC word=error; PackWord(baseWord,word,0, 7); // Error flag word=time; PackWord(baseWord,word,8,31); // time-of-flight fIndex++; buf[fIndex]=baseWord; + word=0; baseWord=0; @@ -154,10 +155,11 @@ void AliSTARTRawData::GetDigits(AliSTARTdigit *fDigits, UInt_t *buf) // amplified TDC word=error; PackWord(baseWord,word,0, 7); // Error flag - word=time; + word=timeAmp; PackWord(baseWord,word,8,31); // time-of-flight fIndex++; buf[fIndex]=baseWord; + word=0; baseWord=0; @@ -172,12 +174,13 @@ void AliSTARTRawData::GetDigits(AliSTARTdigit *fDigits, UInt_t *buf) // ADC -> TDC word=error; PackWord(baseWord,word,0, 7); // Error flag - word=ADC; + word=time; PackWord(baseWord,word,8,31); // time-of-flight fIndex++; buf[fIndex]=baseWord; - //Amplified ADC -> TDC + + // ADC -> TDC :QTC word=0; baseWord=0; @@ -188,90 +191,142 @@ void AliSTARTRawData::GetDigits(AliSTARTdigit *fDigits, UInt_t *buf) baseWord=0; word=error; PackWord(baseWord,word,0, 7); // Error flag - word=ADC; + word=time+qtc; PackWord(baseWord,word,8,31); // time-of-flight fIndex++; buf[fIndex]=baseWord; + word=0; baseWord=0; + // DDL 4 amplified QTC charge * 10 + word=det;; + PackWord(baseWord,word, 0, 5); // number of PMT on the right side + fIndex++; + buf[fIndex]=baseWord; + word=0; + baseWord=0; + // ADC -> TDC + word=error; + PackWord(baseWord,word,0, 7); // Error flag + word=timeAmp; + PackWord(baseWord,word,8,31); // time-of-flight + fIndex++; + buf[fIndex]=baseWord; + + //Amplified ADC -> TDC + word=0; + baseWord=0; + + word=det;; + PackWord(baseWord,word, 0, 5); // number of PMT on the right side + fIndex++; + buf[fIndex]=baseWord; + baseWord=0; + word=error; + PackWord(baseWord,word,0, 7); // Error flag + word=time+qtcAmp; + PackWord(baseWord,word,8,31); // time-of-flight + fIndex++; + buf[fIndex]=baseWord; + + word=0; + baseWord=0; } - /* - //timemean + + + word=0; + baseWord=0; fIndex++; - buf[fIndex]=baseWord; word=25; PackWord(baseWord,word, 0, 5); // number of PMT on the right side - word=fMeanTime; + word=fDigits->MeanTime(); PackWord(baseWord,word, 6, 31); // TDC on the right side from Marin - printf("meantime buf[%i]=%x\n",fIndex,buf[fIndex]); - - fIndex++; buf[fIndex]=baseWord; - + baseWord=0; - word=error; PackWord(baseWord,word,0, 7); // Error flag - word=fMeanTime; + word=fDigits->MeanTime(); PackWord(baseWord,word,8,31); // time-of-flight - fIndex++; buf[fIndex]=baseWord; - - printf("meantime buf[%i]=%x\n",fIndex,buf[fIndex]); - + + // besttime right & left - fIndex++; - cout<<" left "<BestTimeRight(); PackWord(baseWord,word, 6, 31); // TDC on the right side from Marin - printf("best buf[%i]=%x\n",fIndex,buf[fIndex]); - fIndex++; buf[fIndex]=baseWord; - + baseWord=0; - word=error; PackWord(baseWord,word,0, 7); // Error flag - word=fBestTimeRight; + word=fDigits->BestTimeRight(); PackWord(baseWord,word,8,31); // time-of-flight - fIndex++; buf[fIndex]=baseWord; - - printf("4 right buf[%i]=%x\n",fIndex,buf[fIndex]); - + word=27; PackWord(baseWord,word, 0, 5); // number of PMT on the right side - word=fBestTimeLeft; + word=fDigits->BestTimeLeft(); PackWord(baseWord,word, 6, 31); // TDC on the right side from Marin - printf("5 left buf[%i]=%x\n",fIndex,buf[fIndex]); - fIndex++; buf[fIndex]=baseWord; - + baseWord=0; - + word=error; PackWord(baseWord,word,0, 7); // Error flag - word=fBestTimeLeft; + word=fDigits->BestTimeLeft(); PackWord(baseWord,word,8,31); // time-of-flight - fIndex++; buf[fIndex]=baseWord; - - printf("5 left buf[%i]=%x\n",fIndex,buf[fIndex]); - */ - word=0; + + // time difference + word=28; + PackWord(baseWord,word, 0, 5); // number of PMT on the right side + word=fDigits->TimeDiff(); + PackWord(baseWord,word, 6, 31); // TDC on the right side from Marin + fIndex++; + buf[fIndex]=baseWord; + baseWord=0; - + + word=error; + PackWord(baseWord,word,0, 7); // Error flag + word=fDigits->TimeDiff(); + PackWord(baseWord,word,8,31); // time-of-flight + fIndex++; + buf[fIndex]=baseWord; + + // multiplicity + + for (Int_t i=0; i<6; i++) + { + Int_t mult=fSumMult->At(i); + word=29+i; + PackWord(baseWord,word, 0, 5); + word=mult; + PackWord(baseWord,word, 6, 31); // TDC on the right side from Marin + fIndex++; + buf[fIndex]=baseWord; + + baseWord=0; + word=error; + PackWord(baseWord,word,0, 7); // Error flag + word=mult; + PackWord(baseWord,word,8,31); // time QTC + fIndex++; + buf[fIndex]=baseWord; + } + cout<GetAddress(); char fileName[15]; ofstream outfile; // logical name of the output file AliRawDataHeader header; - cout<<" AliRawDataHeader header; start "<GetEvent(); - - //For each DDL file, buf contains the array of data words in Binary format - //fIndex gives the number of 32 bits words in the buffer for each DDL file - cout<<" AliSTARTRawData::RawDataSTART "< #include "TMath.h" @@ -10,30 +10,21 @@ #include "AliLog.h" ClassImp(AliSTARTRawReader) - - AliSTARTRawReader::AliSTARTRawReader (): TTask("STARTRawReader","read raw data"), - fPMTId(-1), - fTimeTDC1(0), - fChargeADC1(0), - fTimeTDC2(0), - fChargeADC2(0) + + AliSTARTRawReader::AliSTARTRawReader (AliRawReader *rawReader, TTree* tree) + : TTask("STARTRawReader","read raw START data"), + fTree(tree), + fRawReader(rawReader) { // // create an object to read STARTraw digits AliDebug(1,"Start "); - fTimeTDC1 = new TArrayI(24); - fChargeADC1 = new TArrayI(24); - fTimeTDC2 = new TArrayI(24); - fChargeADC2 = new TArrayI(24); + } AliSTARTRawReader::~AliSTARTRawReader () { - delete fTimeTDC1; - delete fTimeTDC2; - delete fChargeADC1 ; - delete fChargeADC2; - + // } //------------------------------------------------------------------------------------------------ @@ -51,98 +42,193 @@ UInt_t AliSTARTRawReader::UnpackWord(UInt_t packedWord, Int_t startBit, Int_t st return word; } //--------------------------------------------------------------------------------------- -Bool_t AliSTARTRawReader::NextThing( AliRawReader *fRawReader) +void AliSTARTRawReader::NextThing() { // read the next raw digit // returns kFALSE if there is no digit left - UInt_t word, unpackword; - UInt_t fADC, fTime; + Int_t time, adc, pmt; + TArrayI *timeTDC1 = new TArrayI(24); + TArrayI * chargeTDC1 = new TArrayI(24); + TArrayI *timeTDC2 = new TArrayI(24); + TArrayI *chargeTDC2 = new TArrayI(24); + TArrayI *sumMult = new TArrayI(6); + fRawReader->Select(13); - if (!fRawReader->ReadNextInt(fData)) return kFALSE; - + if (!fRawReader->ReadHeader()){ + Error("ReadSTARTRaw","Couldn't read header"); + return; + } + AliSTARTdigit *fDigits = new AliSTARTdigit(); + fTree->Branch("START","AliSTARTdigit",&fDigits,400,1); - Int_t size=fRawReader->GetDataSize(); - for (Int_t i=0; iReadNextInt(word); + for (Int_t i=0; i<24; i++) { word=0; unpackword=0; fRawReader->ReadNextInt(word); unpackword=UnpackWord(word,0,5); - fPMTId=unpackword; + pmt=unpackword; word=0; unpackword=0; - fRawReader->ReadNextInt(word); unpackword=UnpackWord(word,8,31); - fTime=unpackword; - fTimeTDC1->AddAt(fTime,fPMTId); + time=unpackword; + timeTDC1->AddAt(time,pmt); + word=0; unpackword=0; - fRawReader->ReadNextInt(word); unpackword=UnpackWord(word,0,5); - fPMTId=unpackword; + pmt=unpackword; word=0; unpackword=0; - fRawReader->ReadNextInt(word); - unpackword=UnpackWord(word,8,31); - fTime=unpackword; - fTimeTDC2->AddAt(fTime,fPMTId); - + time=unpackword; + timeTDC2->AddAt(time,pmt); + + // QTC word=0; unpackword=0; fRawReader->ReadNextInt(word); unpackword=UnpackWord(word,0,5); - fPMTId=unpackword; + pmt=unpackword; word=0; unpackword=0; - fRawReader->ReadNextInt(word); unpackword= UnpackWord(word,8,31); - fADC=unpackword; - fChargeADC1 -> AddAt(fADC, fPMTId); - + time=unpackword; //T1 + word=0; unpackword=0; fRawReader->ReadNextInt(word); unpackword=UnpackWord(word,0,5); - fPMTId=unpackword; + pmt=unpackword; + word=0; + unpackword=0; + fRawReader->ReadNextInt(word); + unpackword= UnpackWord(word,8,31); + adc=unpackword-time; // T1+ T2 (A) + chargeTDC1->AddAt(adc,pmt); + //QTC amplified word=0; unpackword=0; fRawReader->ReadNextInt(word); - + unpackword=UnpackWord(word,0,5); + pmt=unpackword; + word=0; + unpackword=0; + fRawReader->ReadNextInt(word); unpackword= UnpackWord(word,8,31); - fADC=unpackword; - fChargeADC2 -> AddAt(fADC, fPMTId); - } - return kTRUE; + time=unpackword; //T1 + + word=0; + unpackword=0; -} + fRawReader->ReadNextInt(word); + unpackword=UnpackWord(word,0,5); + pmt=unpackword; + word=0; + unpackword=0; + fRawReader->ReadNextInt(word); + unpackword= UnpackWord(word,8,31); + adc=unpackword-time; // T1+ T2 (A) + chargeTDC2->AddAt(adc,pmt); -//-------------------------------------------- -void AliSTARTRawReader::GetTime (TArrayI &o) -{ - // - Int_t i; - for (i=0; i<24; i++) - { - o[i]=fTimeTDC1->At(i); - } -} -//-------------------------------------------- -//-------------------------------------------- -void AliSTARTRawReader::GetADC (TArrayI &o) -{ - // - Int_t i; - for (i=0; i<24; i++) - { - o[i]=fChargeADC1->At(i); + } + fDigits->SetTime(*timeTDC1); + fDigits->SetADC(*chargeTDC1); + + + word=0; + unpackword=0; + + fRawReader->ReadNextInt(word); + unpackword=UnpackWord(word,0,5); + pmt=unpackword; + + word=0; + unpackword=0; + + fRawReader->ReadNextInt(word); + unpackword=UnpackWord(word,8,31); + time=unpackword; + fDigits->SetMeanTime(time); + + // Best time right &left + word=0; + unpackword=0; + + fRawReader->ReadNextInt(word); + unpackword=UnpackWord(word,0,5); + pmt=unpackword; + + word=0; + unpackword=0; + + fRawReader->ReadNextInt(word); + unpackword=UnpackWord(word,8,31); + time=unpackword; + fDigits->SetTimeBestRight(time); + + + // best time left + word=0; + unpackword=0; + + fRawReader->ReadNextInt(word); + unpackword=UnpackWord(word,0,5); + pmt=unpackword; + + word=0; + unpackword=0; + + fRawReader->ReadNextInt(word); + unpackword=UnpackWord(word,8,31); + time=unpackword; + fDigits->SetTimeBestLeft(time); + + + // best time differece + word=0; + unpackword=0; + + fRawReader->ReadNextInt(word); + unpackword=UnpackWord(word,0,5); + pmt=unpackword; + + word=0; + unpackword=0; + + fRawReader->ReadNextInt(word); + unpackword=UnpackWord(word,8,31); + time=unpackword; + fDigits->SetDiffTime(time); + + // multiplicity + for (Int_t im=0; im<6; im++) + { + word=0; + unpackword=0; + fRawReader->ReadNextInt(word); + unpackword=UnpackWord(word,0,5); + pmt=unpackword; + word=0; + unpackword=0; + fRawReader->ReadNextInt(word); + unpackword=UnpackWord(word,8,31); + time=unpackword; + sumMult->AddAt(time,im); + } + fDigits->SetSumMult(*sumMult); + + fTree->Fill(); + } + diff --git a/START/AliSTARTRawReader.h b/START/AliSTARTRawReader.h index d5cfadd4d9a..ee6dbfe96da 100644 --- a/START/AliSTARTRawReader.h +++ b/START/AliSTARTRawReader.h @@ -3,40 +3,27 @@ #include #include -#include "TArrayI.h" - -class AliRawReader; +#include "TTree.h" +#include "AliSTARTdigit.h" +#include "AliRawReader.h" class AliSTARTRawReader : public TTask { public : - AliSTARTRawReader() ; + AliSTARTRawReader(AliRawReader *rawReader, TTree* tree) ; virtual ~AliSTARTRawReader(); - Int_t GetPMTId () {return fPMTId;} UInt_t UnpackWord(UInt_t PackedWord, Int_t StartBit, Int_t StopBit); // unpack packed words - Bool_t NextThing(AliRawReader *rawReader); //read next raw digit - - TArrayI *TimeTDC1() {return fTimeTDC1;} - TArrayI *TimeTDC2() {return fTimeTDC2;} - TArrayI *ChargeADC1() {return fChargeADC1;} - TArrayI *ChargeADC2() {return fChargeADC2;} - virtual void GetTime (TArrayI &o); - virtual void GetADC (TArrayI &o); + void NextThing(); //read next raw digit + protected : -protected : - - UInt_t fData; // data read for file - + UInt_t fData; // data read for file + AliSTARTdigit* fDigits; + TTree* fTree; AliRawReader* fRawReader; // object for reading the raw data - Int_t fPMTId ; // PMT number - TArrayI *fTimeTDC1 ; //TDC signal - TArrayI *fChargeADC1 ; //ADC signal - TArrayI *fTimeTDC2 ; //amplified TDC signal - TArrayI *fChargeADC2 ; //amplified ADC signal ClassDef(AliSTARTRawReader, 0) //class for reading START Raw data }; diff --git a/START/AliSTARTRecPoint.cxx b/START/AliSTARTRecPoint.cxx index 71b23505a91..cf2ea5d58b5 100644 --- a/START/AliSTARTRecPoint.cxx +++ b/START/AliSTARTRecPoint.cxx @@ -28,7 +28,6 @@ -#include #include "AliSTARTRecPoint.h" #include @@ -38,60 +37,11 @@ ClassImp(AliSTARTRecPoint) AliSTARTRecPoint::AliSTARTRecPoint() : TObject() { //ctor - fTimeAverage=9999; - fTimeBestRight=9999; - fTimeBestLeft=9999; - - fTime = new TArrayI(24); - fADC = new TArrayI(24); -} -//----------------------------------- -AliSTARTRecPoint::~AliSTARTRecPoint() { - // destructor - delete fTime; - delete fADC; -} -//----------------------------------- -void AliSTARTRecPoint::SetTime (TArrayI &o) -{ - //////////////////////////////////////// - - Int_t i; - for (i=0; i<24; i++) - { - Int_t buf=o.At(i); - fTime->AddAt(buf,i); - } -} -//-------------------------------------------- -void AliSTARTRecPoint::GetTime (TArrayI &o) -{ - // - Int_t i; - for (i=0; i<24; i++) - { - o[i]=fTime->At(i); - } -} -//-------------------------------------------- -void AliSTARTRecPoint::GetADC (TArrayI &o) -{ - // - Int_t i; - for (i=0; i<24; i++) - { - o[i]=fADC->At(i); - } -} -//-------------------------------------------- -void AliSTARTRecPoint::SetADC (TArrayI &o) -{ - // - Int_t i; - // Float_t fProcessKoef=1; // for pb 0.001 - for (i=0; i<24; i++) - { - Int_t buf=(o.At(i)); - fADC->AddAt(buf,i); - } + fTimeAverage=99999; + fTimeBestRight=99999; + fTimeBestLeft=99999; + fVertexPosition=99999; + fMultA=0; + fMultC=0; + fMult=0; } diff --git a/START/AliSTARTRecPoint.h b/START/AliSTARTRecPoint.h index 6ef0fe537ba..2e735c015f7 100644 --- a/START/AliSTARTRecPoint.h +++ b/START/AliSTARTRecPoint.h @@ -12,31 +12,34 @@ class AliSTARTRecPoint: public TObject { //////////////////////////////////////////////////////////////////////// public: AliSTARTRecPoint(); - virtual ~AliSTARTRecPoint(); - void SetMeanTime(Int_t time) {fTimeAverage=time;} + virtual ~AliSTARTRecPoint() {} Int_t GetMeanTime() {return fTimeAverage;} Int_t GetBestTimeRight() {return fTimeBestRight ;} Int_t GetBestTimeLeft() {return fTimeBestLeft ;} + Int_t GetMultC() {return fMultC;} + Int_t GetMultA() {return fMultA;} + Int_t GetMult() {return fMult;} + Float_t GetVertex() {return fVertexPosition;} + + void SetMeanTime(Int_t time) {fTimeAverage=time;} void SetTimeBestRight( Int_t time) {fTimeBestRight = time;} void SetTimeBestLeft( Int_t time) {fTimeBestLeft = time;} - void SetTimeDifference( Int_t time) {fTimeDifference= time;} - Int_t GetTimeDifference() {return fTimeDifference;} - // void SetProcessKoef( Float_t pp) {fProcessKoef = pp;} - virtual void SetTime (TArrayI &o); - virtual void GetTime (TArrayI &o); - virtual void SetADC (TArrayI &o); - virtual void GetADC (TArrayI &o); - virtual const char* GetName() const {return "START_V";} + void SetVertex( Float_t vertex) {fVertexPosition= vertex;} + void SetMultC(Int_t mult) {fMultC = mult;} + void SetMultA(Int_t mult) {fMultA = mult;} + void SetMult(Int_t mult) {fMult = mult;} + private: // Float_t fProcessKoef; // for pp fProcessKoef=1 ; for Pb-Pb - 0.001 Int_t fTimeAverage; // Average time - Int_t fTimeDifference; // Diffrence time between left and right + Float_t fVertexPosition; // Diffrence time between left and right Int_t fTimeBestRight; //TOF first particle on the right Int_t fTimeBestLeft; //TOF first particle on the left - TArrayI *fTime; // array's TDC in ns - TArrayI *fADC; // array's ADC in number of photo electrons - - ClassDef(AliSTARTRecPoint,1) //Digit (Header) object for set:START + Int_t fMultC; // multiplicity on the + Int_t fMultA; // multiplicity on the + Int_t fMult; // multiplicity A && C + + ClassDef(AliSTARTRecPoint,2) //Digit (Header) object for set:START }; diff --git a/START/AliSTARTReconstructor.cxx b/START/AliSTARTReconstructor.cxx index 62c385b1ff5..56bd73a6e6e 100644 --- a/START/AliSTARTReconstructor.cxx +++ b/START/AliSTARTReconstructor.cxx @@ -25,56 +25,124 @@ #include "AliSTARTdigit.h" #include "AliSTARTReconstructor.h" #include - +#include +#include "AliSTARTRecPoint.h" +#include "AliRawReader.h" +#include "AliSTARTRawReader.h" +#include "AliLog.h" ClassImp(AliSTARTReconstructor) -void AliSTARTReconstructor::Reconstruct(AliRunLoader* /*runLoader*/) const + void AliSTARTReconstructor::ConvertDigits(AliRawReader* rawReader, TTree* digitsTree) const { -// nothing to be done + //START raw data-> digits conversion + // reconstruct time information from raw data + AliSTARTRawReader myrawreader(rawReader,digitsTree); + myrawreader.NextThing(); } + void AliSTARTReconstructor::Reconstruct(TTree*digitsTree, TTree*clustersTree) const +{ +// START digits reconstruction +// STARTRecPoint writing + + AliDebug(1,Form("Start DIGITS reconstruction ")); + Int_t channelWigth=25; //ps + TArrayI* fSumMult = new TArrayI(6); + Float_t ph2mV = 150./500.; + Float_t mV2channel=200000/(25*25); //5V -> 200ns + + TBranch *brDigits=digitsTree->GetBranch("START"); + AliSTARTdigit *fDigits = new AliSTARTdigit(); + if (brDigits) { + brDigits->SetAddress(&fDigits); + }else{ + cerr<<"EXEC Branch START digits not found"<GetEntry(0); + Int_t besttimeright=channelWigth * (fDigits->BestTimeRight()); + Int_t besttimeleft=channelWigth * (fDigits->BestTimeLeft()); + + //folding with experimental time distribution + // Float_t c = 29.9792; // cm/ns + Float_t c = 0.0299792; // cm/ps + Float_t lenr=TMath::Sqrt(350*350 + 6.5*6.5); + Float_t lenl=TMath::Sqrt(69.7*69.7 + 6.5*6.5); + Float_t timeDiff=channelWigth * (fDigits->TimeDiff()); + Int_t meanTime=channelWigth * (fDigits->MeanTime()); + Float_t ds=(c*(timeDiff)-(lenr-lenl))/2; + AliDebug(2,Form(" timediff in ns %f real point%f",timeDiff,ds)); + -void AliSTARTReconstructor::FillESD(AliRunLoader* rl, AliESD *pESD) const + fDigits->Print(); + fDigits->GetSumMult(*fSumMult); + Int_t multipl[6]; + for (Int_t i=0; i<6; i++) + { + Float_t mult=Float_t (fSumMult->At(i)); + Float_t realMultmV=TMath::Exp(mult/mV2channel); + multipl[i]=Int_t ((realMultmV/ph2mV)/500+0.5); + } + AliDebug(2,Form(" multiplicity Abs side %i multiplicity non-Abs side %i",multipl[1],multipl[2])); + + AliSTARTRecPoint* frecpoints= new AliSTARTRecPoint (); + clustersTree->Branch( "START", "AliSTARTRecPoint" ,&frecpoints, 405,1); + frecpoints->SetTimeBestRight(besttimeright); + frecpoints->SetTimeBestLeft(besttimeleft); + frecpoints->SetVertex(ds); + frecpoints->SetMeanTime(meanTime); + frecpoints->SetMult(multipl[0]); + frecpoints->SetMultA(multipl[2]); + frecpoints->SetMultC(multipl[1]); + + clustersTree->Fill(); +} + + +void AliSTARTReconstructor::FillESD(AliRunLoader* runLoader, AliESD *pESD) const { + /*************************************************** Resonstruct digits to vertex position ****************************************************/ - - Float_t c = 0.3; //speed of light mm/ps - Int_t channelWigth=25; //ps - if (!rl) { - Error("Reconstruct", "No run loader"); + + // Float_t c = 0.3; //speed of light mm/ps + // Float_t Zposition=0; + + if (!runLoader) { + AliError("Reconstruct >> No run loader"); return; } + + AliDebug(1,Form("Start FillESD START")); - if (rl->GetDebug()>1) Info("Reconstruct","START!!!"); - - AliSTARTLoader* pStartLoader = (AliSTARTLoader*) rl->GetLoader("STARTLoader"); + AliSTARTLoader* pStartLoader = (AliSTARTLoader*) runLoader->GetLoader("STARTLoader"); - pStartLoader->LoadDigits(); - AliSTARTdigit* pDigits=pStartLoader->Digits(); - if (!pDigits) { - Error("Reconstruct", "no digits found"); + pStartLoader->LoadRecPoints("READ"); + + TTree *treeR = pStartLoader->TreeR(); + + AliSTARTRecPoint* frecpoints= new AliSTARTRecPoint (); + if (!frecpoints) { + AliError("Reconstruct Fill ESD >> no recpoints found"); return; } - - if (rl->GetDebug()>1) pDigits->Dump(); - if(pDigits) { - Int_t besttimeright = pDigits->GetBestTimeRight(); - Int_t besttimeleft = pDigits->GetBestTimeLeft(); - Float_t besttimerightPs = Float_t (besttimeright*channelWigth); - Float_t besttimeleftPs = Float_t (besttimeleft*channelWigth); - Float_t Zposit=(c*(besttimerightPs-besttimeleftPs)-(3500.-697))/2; + AliDebug(1,Form("Start FillESD START")); + TBranch *brRec = treeR->GetBranch("START"); + if (brRec) { + brRec->SetAddress(&frecpoints); + }else{ + cerr<<"EXEC Branch START rec not found"<GetEntry(0); + Float_t Zposition=frecpoints->GetVertex(); - pESD->SetT0zVertex(Zposit); - - if (rl->GetDebug()>1) { - cout<<" vertex in ESD "<< pESD->GetT0zVertex()<SetT0zVertex(Zposition); + pStartLoader->UnloadRecPoints(); - } // vertex in 3 sigma - pStartLoader->UnloadDigits(); - } +} // vertex in 3 sigma diff --git a/START/AliSTARTReconstructor.h b/START/AliSTARTReconstructor.h index 53c4b327e4f..3b75dedc813 100644 --- a/START/AliSTARTReconstructor.h +++ b/START/AliSTARTReconstructor.h @@ -6,15 +6,27 @@ /* $Id$ */ #include "AliReconstructor.h" +#include "AliSTARTdigit.h" class AliSTARTReconstructor: public AliReconstructor { public: AliSTARTReconstructor(): AliReconstructor() {}; virtual ~AliSTARTReconstructor() {}; - virtual void Reconstruct(AliRunLoader* /*runLoader*/) const; + virtual void ConvertDigits( AliRawReader* rawReader, TTree* fdigits) const; + virtual void Reconstruct(TTree* fdigits, + TTree * frecpoints) const; + virtual void FillESD(AliRunLoader* runLoader, AliESD* esd) const; + virtual Bool_t HasLocalReconstruction() const {return kTRUE;}; + virtual Bool_t HasDigitConversion() const {return kTRUE;}; + public: + AliSTARTdigit *fdigits ; // digits + Float_t fZposition; // vertex position + ClassDef(AliSTARTReconstructor, 0) // class for the START reconstruction + + }; #endif diff --git a/START/AliSTARTdigit.cxx b/START/AliSTARTdigit.cxx index b32a2453f6a..372aa9165d7 100644 --- a/START/AliSTARTdigit.cxx +++ b/START/AliSTARTdigit.cxx @@ -25,41 +25,44 @@ // /////////////////////////////////////////////////////////////////////// - - - -#include #include "AliSTARTdigit.h" -#include +#include "TArrayI.h" ClassImp(AliSTARTdigit) -//------------------------------------ - AliSTARTdigit::AliSTARTdigit() : TObject() +//----------------------------------------------- + AliSTARTdigit::AliSTARTdigit() :TObject() { - //ctor - fTimeAverage=9999; - fTimeBestRight=9999; - fTimeBestLeft=9999; - fSumADCRight=0; - fTime = new TArrayI(36); - fADC = new TArrayI(36); + fTimeAverage = 99999; + fTimeDiff = 99999; + fBestTimeRight = 99999; + fBestTimeLeft = 99999; + + fTime = new TArrayI(24); + fADC = new TArrayI(24); + fTimeAmp = new TArrayI(24); + fADCAmp = new TArrayI(24); + fSumMult=new TArrayI(6); } + //----------------------------------- AliSTARTdigit::~AliSTARTdigit() { // destructor delete fTime; delete fADC; + delete fTimeAmp; + delete fADCAmp; + delete fSumMult; } //----------------------------------- void AliSTARTdigit::SetTime (TArrayI &o) { //////////////////////////////////////// - fTime = new TArrayI(36); + fTime = new TArrayI(24); Int_t i; - for (i=0; i<36; i++) + for (i=0; i<24; i++) { Int_t buf=o.At(i); fTime->AddAt(buf,i); @@ -70,7 +73,7 @@ void AliSTARTdigit::GetTime (TArrayI &o) { // Int_t i; - for (i=0; i<36; i++) + for (i=0; i<24; i++) { o[i]=fTime->At(i); } @@ -80,7 +83,7 @@ void AliSTARTdigit::GetADC (TArrayI &o) { // Int_t i; - for (i=0; i<36; i++) + for (i=0; i<24; i++) { o[i]=fADC->At(i); } @@ -89,12 +92,78 @@ void AliSTARTdigit::GetADC (TArrayI &o) void AliSTARTdigit::SetADC (TArrayI &o) { // - fADC = new TArrayI(36); + fADC = new TArrayI(24); Int_t i; - // Float_t fProcessKoef=1; // for pb 0.001 - for (i=0; i<36; i++) + for (i=0; i<24; i++) { Int_t buf=(o.At(i)); fADC->AddAt(buf,i); } } +//----------------------------------- +void AliSTARTdigit::SetTimeAmp (TArrayI &o) +{ + //////////////////////////////////////// + fTimeAmp = new TArrayI(24); + + Int_t i; + for (i=0; i<24; i++) + { + Int_t buf=o.At(i); + fTimeAmp->AddAt(buf,i); + } +} +//-------------------------------------------- +void AliSTARTdigit::GetTimeAmp (TArrayI &o) +{ + // + Int_t i; + for (i=0; i<24; i++) + { + o[i]=fTimeAmp->At(i); + } +} +//-------------------------------------------- +void AliSTARTdigit::GetADCAmp (TArrayI &o) +{ + // + Int_t i; + for (i=0; i<24; i++) + { + o[i]=fADCAmp->At(i); + } +} +//-------------------------------------------- +void AliSTARTdigit::SetADCAmp (TArrayI &o) +{ + // + fADCAmp = new TArrayI(24); + Int_t i; + for (i=0; i<24; i++) + { + Int_t buf=(o.At(i)); + fADCAmp->AddAt(buf,i); + } +} +//-------------------------------------------- +void AliSTARTdigit::GetSumMult (TArrayI &o) +{ + // + Int_t i; + for (i=0; i<6; i++) + { + o[i]=fSumMult->At(i); + } +} +//-------------------------------------------- +void AliSTARTdigit::SetSumMult (TArrayI &o) +{ + // + fSumMult = new TArrayI(24); + Int_t i; + for (i=0; i<6; i++) + { + Int_t buf=(o.At(i)); + fSumMult->AddAt(buf,i); + } +} diff --git a/START/AliSTARTdigit.h b/START/AliSTARTdigit.h index 57dad9931ac..4e1ae543175 100644 --- a/START/AliSTARTdigit.h +++ b/START/AliSTARTdigit.h @@ -5,42 +5,54 @@ /* $Id$ */ #include +class TClonesArray; class TArrayI; //___________________________________________ -class AliSTARTdigit: public TObject { -//////////////////////////////////////////////////////////////////////// +class AliSTARTdigit: public TObject { + //////////////////////////////////////////////////////////////////////// public: - AliSTARTdigit(); - virtual ~AliSTARTdigit(); - void SetMeanTime(Int_t time) {fTimeAverage=time;} - Int_t GetMeanTime() {return fTimeAverage;} - Int_t GetBestTimeRight() {return fTimeBestRight ;} - Int_t GetBestTimeLeft() {return fTimeBestLeft ;} - Int_t GetSumADCRight() {return fSumADCRight ;} - 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 SetTime (TArrayI &o); - virtual void GetTime (TArrayI &o); - virtual void SetADC (TArrayI &o); - virtual void GetADC (TArrayI &o); - virtual const char* GetName() const {return "START_D";} - private: - // Float_t fProcessKoef; // for pp fProcessKoef=1 ; for Pb-Pb - 0.001 - Int_t fTimeAverage; // Average time - 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 *fTime; // array's TDC - TArrayI *fADC; // array's ADC - - ClassDef(AliSTARTdigit,2) //Digit (Header) object for set:START -}; - + AliSTARTdigit(); + virtual ~AliSTARTdigit(); + Int_t BestTimeRight() {return fBestTimeRight;} + Int_t BestTimeLeft() {return fBestTimeLeft;} + Int_t MeanTime() {return fTimeAverage;} + Int_t TimeDiff() {return fTimeDiff;} + void SetTimeBestRight( Int_t time) {fBestTimeRight = time;} + void SetTimeBestLeft( Int_t time) {fBestTimeLeft = time;} + void SetMeanTime(Int_t time) {fTimeAverage=time;} + void SetDiffTime(Int_t time) {fTimeDiff=time;} + + virtual void SetTime (TArrayI &o); + virtual void GetTime (TArrayI &o); + virtual void SetADC (TArrayI &o); + virtual void GetADC (TArrayI &o); + virtual void SetSumMult( TArrayI &o); + virtual void GetSumMult( TArrayI &o); + + virtual void SetTimeAmp (TArrayI &o); + virtual void GetTimeAmp (TArrayI &o); + virtual void SetADCAmp (TArrayI &o); + virtual void GetADCAmp (TArrayI &o); + private: + + Int_t fBestTimeRight; // TOF first particle on the right + Int_t fBestTimeLeft; // TOF first particle on the left + Int_t fTimeAverage; // mean time (start signal) + Int_t fTimeDiff; // time difference (vertex position) + + TArrayI *fTime; // array's TDC + TArrayI *fADC; // array's ADC + TArrayI *fTimeAmp; // array's TDC + TArrayI *fADCAmp; // array's ADC + TArrayI *fSumMult; //multiplisity + + ClassDef(AliSTARTdigit,4) //Digit (Header) object for set:START + }; + #endif + diff --git a/START/AliSTARTv1.cxx b/START/AliSTARTv1.cxx index 2f6bb25c098..649986ce2ba 100755 --- a/START/AliSTARTv1.cxx +++ b/START/AliSTARTv1.cxx @@ -55,8 +55,14 @@ AliSTARTv1::AliSTARTv1(const char *name, const char *title): // fIdSens1=0; fIshunt = 2; -// setBufferSize(128000); } +//_____________________________________________________________________________ + +AliSTARTv1::~AliSTARTv1() +{ + // desctructor +} + //------------------------------------------------------------------------- void AliSTARTv1::CreateGeometry() { @@ -70,6 +76,7 @@ void AliSTARTv1::CreateGeometry() // + Int_t *idtmed = fIdtmed->GetArray(); Int_t is; @@ -86,14 +93,13 @@ void AliSTARTv1::CreateGeometry() Float_t pstart[3]={4.3, 12.,6.8}; Float_t pinstart[3]={0.,1.6,6.5}; Float_t ppmt[3]={0.,1.5,3.5}; - + Float_t ptop[3]={0.,1.,1.5}; Float_t preg[3]={0., 1.0, 0.005}; //photcathode dobavil bogdanov - + Float_t ptopout[3]={1.,1.01,1.5}; + // Float_t pregafter[3]={0.,1.0,0.005}; Float_t pdivider[3]={0.,1.2,1.75}; Float_t pdiv2[3]={0.,1.2,1.25}; Float_t pdiv1[3]={0.6,1.2,0.5}; - // Float_t ptop[3]={0.,1.0,1.5}; - Float_t ptop[3]={0., 1.0, 1.5}; Float_t pbot[3]={0.6,1.2,0.1}; Float_t pglass[3]={1.2,1.3,2.}; Float_t pcer[3]={0.9,1.1,0.09}; @@ -111,6 +117,7 @@ void AliSTARTv1::CreateGeometry() Float_t psupport5[3] = {1.44,1.5,6.5}; // stakanchik dlai feu C Float_t psupport6[3] = {0,1.5,0.05}; //kryshechka stakanchika Al Float_t psupport7[3] = {1.5,1.6,0.6}; //kolechko snaruzhu stakanchika Al + // Mother Volume katushka dlia krepezha vokrug truby k Absorbru AliMatrix(idrotm[901], 90., 0., 90., 90., 180., 0.); Float_t ppcon[70]; @@ -203,8 +210,9 @@ void AliSTARTv1::CreateGeometry() gMC->Gspos("0STL",1,"ALIC",0.,0.,zdetLeft+pstart[2],0,"ONLY"); //START interior - gMC->Gsvolu("0INS","TUBE",idtmed[kAir],pinstart,3); - gMC->Gsvolu("0PMT","TUBE",idtmed[kOpAir],ppmt,3); + gMC->Gsvolu("0INS","TUBE",idtmed[kAir],pinstart,3); + gMC->Gsvolu("0PMT","TUBE",idtmed[kAir],ppmt,3); + gMC->Gsvolu("0DIV","TUBE",idtmed[kVac],pdivider,3); gMC->Gsvolu("0SU1","TUBE",idtmed[kC],psupport1,3);//C kozhuh vnutri gMC->Gsvolu("0SU2","TUBE",idtmed[kC],psupport2,3);// snaruzhi C @@ -214,7 +222,7 @@ void AliSTARTv1::CreateGeometry() gMC->Gsvolu("0SU6","TUBE",idtmed[kC],psupport5,3);// stakanchik dlai feu C gMC->Gsvolu("0SU7","TUBE",idtmed[kAl],psupport6,3);//kryshechka stakanchika Al gMC->Gsvolu("0SU8","TUBE",idtmed[kAl],psupport7,3);//kolechko snaruzhu stakanchika Al - + // first ring: 12 units of Scintillator+PMT+divider Float_t theta = (180 / TMath::Pi()) * TMath::ATan(6.5 / zdetRight); printf(" theta %f", theta); @@ -239,21 +247,22 @@ void AliSTARTv1::CreateGeometry() z=-pstart[2]+pinstart[2]+0.2; gMC->Gspos ("0INS", is + 1, "0STR", x, y, z, idrotm[902 + is], "ONLY"); gMC->Gspos ("0INS", is + 13, "0STL", x, y, z, 0, "ONLY"); - - x = 9. * TMath::Sin(angle/2+is * angle); - y = 9. * TMath::Cos(angle/2+is * angle); + /* + x = 9.1 * TMath::Sin(angle/2+is * angle); + y = 9.1 * TMath::Cos(angle/2+is * angle); gMC->Gspos ("0INS", is + 25, "0STL", x, y, z, 0, "ONLY"); - + */ } x=0; y=0; - z=-pinstart[2]+ppmt[2]+2.*psupport6[2]+0.1; + // z=-pinstart[2]+ppmt[2]+2.*psupport6[2]+0.1; + z=-pinstart[2]+ppmt[2]; gMC->Gspos("0PMT",1,"0INS",x,y,z,0,"ONLY"); - z=z+pdivider[2]+ppmt[2]; - gMC->Gspos("0DIV",1,"0INS",x,y,z,0,"ONLY"); + // z=z+pdivider[2]+ppmt[2]; + // gMC->Gspos("0DIV",1,"0INS",x,y,z,0,"ONLY"); // PMT @@ -262,13 +271,20 @@ void AliSTARTv1::CreateGeometry() // gMC->Gsvolu("0TOP","TUBE",idtmed[12],ptop,3); //lucite z=-ppmt[2]+ptop[2]; gMC->Gspos("0TOP",1,"0PMT",0,0,z,0,"ONLY"); - + //metal volume to simulate reclection + gMC->Gsvolu("0TOO","TUBE",idtmed[kOpAir],ptopout,3); //glass + // gMC->Gsvolu("0TOP","TUBE",idtmed[12],ptop,3); //lucite + gMC->Gspos("0TOO",1,"0PMT",0,0,z,0,"ONLY"); + //Fotokatod - - gMC->Gsvolu ("0REG", "TUBE", idtmed[kOpGlass], preg, 3); //photocathode dobavil bogdanov(AliSTARTv2) - z = -ppmt[2] + 2 * ptop[2] + preg[2]; //photocathode dobavil bogdanov - gMC->Gspos ("0REG", 1, "0PMT", 0, 0, z, 0, "ONLY"); //photocathode dobavil bogdanov(AliSTARTv2) - + gMC->Gsvolu ("0REG", "TUBE", idtmed[kOpGlassCathode], preg, 3); + z = -ppmt[2] + 2 * ptop[2] + preg[2]; + gMC->Gspos ("0REG", 1, "0PMT", 0, 0, z, 0, "ONLY"); + //optical volume special to detect photons in cathode + // gMC->Gsvolu ("0RE1", "TUBE", idtmed[kOpAirNext], pregafter, 3); + // z = -ppmt[2] + 2 * ptop[2] + 2*preg[2] + pregafter[2]; + // gMC->Gspos ("0RE1", 1, "0PMT", 0, 0, z, 0, "ONLY"); + // Bottom glass gMC->Gsvolu("0BOT","TUBE",idtmed[kGlass],pbot,3); z=ppmt[2]-pbot[2]; @@ -327,15 +343,6 @@ void AliSTARTv1::CreateGeometry() //Support left side - /* - z=-pstart[2]+psupport1[2]; - gMC->Gspos("0SU1",2,"0STL",0,0,z,0,"ONLY"); //C kozhuh snaruzhi - gMC->Gspos("0SU2",2,"0STL",0,0,z,0,"ONLY"); //C kozhuh vnutri - z=-pstart[2]+psupport3[2]; - gMC->Gspos("0SU3",2,"0STL",0,0,z,0,"ONLY"); //peredniaia kryshka - z=-pstart[2]+2.*psupport1[2]; - gMC->Gspos("0SU4",2,"0STL",0,0,z,0,"MANY"); //zadnaiai kryshka - */ z=-pstart[2]+psupport1[2]+0.1; gMC->Gspos("0SU1",1,"0STR",0,0,z,0,"ONLY"); //C kozhuh snaruzhi gMC->Gspos("0SU2",1,"0STR",0,0,z,0,"ONLY"); //C kozhuh vnutri @@ -373,36 +380,8 @@ void AliSTARTv1::CreateGeometry() z += par[2]; gMC->Gspos("0SC2",1,"0SUP",0,0,z,0,"ONLY"); z += par[2]; - /* - Float_t parC[5]; - parC[0]=0.25; - parC[1]=5.1; - parC[2]=5.2; - parC[3]=5.5; - parC[4]=5.6; - gMC->Gsvolu("0SC3","CONE",idtmed[kC],parC,5); - z += parC[0]; - gMC->Gspos("0SC3",1,"0SUP",0,0,z,0,"ONLY"); - z += parC[0]; - par[0]=5.5; - par[1]=5.6; - par[2]=1.2/2; - gMC->Gsvolu("0SC4","TUBE",idtmed[kC],par,3); - z += par[2]; - gMC->Gspos("0SC4",1,"0SUP",0,0,z,0,"ONLY"); - par[0]=5.1; - par[1]=5.5; - par[2]=1.2/2; - gMC->Gsvolu("0SA0","TUBE",idtmed[kAl],par,3); - gMC->Gspos("0SA0",1,"0SUP",0,0,z,0,"ONLY"); - //gvozdi dlia skruchivaniia Al i C parts - par[0]=5.75; - par[1]=5.78; - gMC->Gsvolu("0SN1","TUBE",idtmed[kSteel],par,3); - gMC->Gspos("0SN1",1,"0SUP",0,0,z,0,"ONLY"); - z += par[2]; - */ - par[0]=3.15; + + par[0]=3.15; par[1]=4.9; par[2]=0.1/2; gMC->Gsvolu("0SA1","TUBE",idtmed[kAl],par,3); @@ -428,7 +407,7 @@ void AliSTARTv1::CreateGeometry() par[2]=0.01; gMC->Gsvolu("0SN2","TUBE",idtmed[kSteel],par,3); gMC->Gspos("0SN2",1,"0SUP",0,0,z,0,"ONLY"); - + } //------------------------------------------------------------------------ @@ -436,8 +415,8 @@ void AliSTARTv1::CreateMaterials() { 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; Int_t *idtmed = fIdtmed->GetArray(); // AIR @@ -463,7 +442,7 @@ void AliSTARTv1::CreateMaterials() Float_t wglass[2]={1.,2.}; Float_t dglass=2.65; // Ceramic 97.2% Al2O3 , 2.8% SiO2 - Float_t acer[2],zcer[2],wcer[2]={0.972,0.028}; + // Float_t wcer[2]={0.972,0.028}; Float_t aCeramic[2] = { 26.981539,15.9994 }; Float_t zCeramic[2] = { 13.,8. }; Float_t wCeramic[2] = { 2.,3. }; @@ -495,26 +474,32 @@ void AliSTARTv1::CreateMaterials() AliMixture( 3, "Ceramic $",aCeramic, zCeramic, denscer, -2, wCeramic); AliMixture( 4, "PMT glass $",aglass,zglass,dglass,-2,wglass); - char namate[21]=""; + /* + char namate[21]=""; + gMC->Gfmate((*fIdmate)[3], namate, a, z, d, radl, absl, buf, nbuf); - acer[0]=a; + acer[0]=a; + zcer[0]=z; gMC->Gfmate((*fIdmate)[4], namate, a, z, d, radl, absl, buf, nbuf); acer[1]=a; zcer[1]=z; - - - AliMixture( 9, "Ceramic $", acer, zcer, denscer, 2, wcer); - AliMixture( 5, "Scintillator$",ascin,zscin,denscin,-2,wscin); + AliMixture( 11, "Ceramic $", acer, zcer, denscer, 2, wcer); + */ + AliMixture( 5, "Scintillator$",ascin,zscin,denscin,-2,wscin); AliMixture( 6, "Brass $", abrass, zbrass, denbrass, 2, wbrass); AliMixture( 7, "Ribber $",aribber,zribber,denribber,-3,wribber); AliMixture( 8, "Lucite$",alucite,zlucite,denlucite,-3,wlucite); AliMixture( 9, "Penoplast$",asupport,zsupport,densupport,-2,wsupport); + AliMixture( 21, "PMT Optical glass $",aglass,zglass,dglass,-2,wglass); + AliMixture( 24, "PMT Optical glass cathode $",aglass,zglass,dglass,-2,wglass); + AliMixture(22, "START Opt Air$", aAir, zAir, dAir,4,wAir); + AliMixture(23, "START Opt Air Next$", aAir, zAir, dAir,4,wAir); 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(4, "Ceramic$", 3, 0, isxfld, sxmgmx, 10., .01, .1, .003, .003); AliMedium(6, "Glass$", 4, 1, 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); @@ -523,47 +508,65 @@ void AliSTARTv1::CreateMaterials() AliMedium(13, "CarbonPlastic$", 10, 0, isxfld, sxmgmx, 10., .01, 1., .003, .003); AliMedium(14, "PenoPlast$", 9, 0, isxfld, sxmgmx, 10., .01, 1., .003, .003); AliMedium(15, "Aluminium$", 11, 0, isxfld, sxmgmx, 10., .01, 1., .003, .003); - AliMedium(16, "OpticalGlass$", 4, 1, isxfld, sxmgmx, 10., .01, .1, .003, .003); - AliMedium(17, "START OpAir$", 2, 0, isxfld, sxmgmx, 10., .1, 1., .003, .003); - + AliMedium(16, "OpticalGlass$", 21, 1, isxfld, sxmgmx, 10., .01, .1, .003, .003); + AliMedium(17, "START OpAir$", 22, 0, isxfld, sxmgmx, 10., .1, 1., .003, .003); + AliMedium(18, "START OpAirNext$", 23, 0, isxfld, sxmgmx, 10., .1, 1., .003, .003); + AliMedium(19, "OpticalGlassCathode$", 24, 1, isxfld, sxmgmx, 10., .01, .1, .003, .003); + // Definition Cherenkov parameters int i; - // const Int_t kNbins=30; - const Int_t kNbins=27; + const Int_t kNbins=31; - // Float_t aPckov[kNbins]; - Float_t aRindexSiO2[kNbins], rindexAir[kNbins], efficAll[kNbins], absorAir[kNbins]; - + Float_t rindexSiO2[kNbins], efficAll[kNbins], rindexAir[kNbins], absorAir[kNbins],rindexCathodeNext[kNbins], absorbCathodeNext[kNbins]; + // quartz 20mm - Float_t aAbsSiO2[kNbins]={28.3, 27.7, 27.3, 26.7, 26.4, - 25.9, 25.3, 24.9, 24.5, 23.7, 23.2, - 22.8, 22.4, 21.8, 21.3, 22.8, - 22.1, 21.7, 21.2, 20.5, 19.9, - 19.3, 18.7, 18.0, 17.1, 16.3, 15.3 }; - - Float_t aPckov[kNbins] ={4.02, 4.11, 4.19, 4.29, 4.38, + Float_t aAbsSiO2[kNbins]={29.0, 28.6, 28.3, 27.7, 27.3, 26.7, 26.4, + 25.9, 25.3, 24.9, 24.5, 23.7, + 23.2, 22.8, 22.4, 21.8, 21.3, + 22.8, 22.1, 21.7, 21.2, 20.5, + 19.9, 19.3, 18.7, 18.0, 17.1, + 16.3, 15.3, 14.3, 14.3 }; + + Float_t aPckov[kNbins] ={3.87, 3.94, 4.02, 4.11, 4.19, 4.29, 4.38, 4.48, 4.58, 4.69, 4.81, 4.93, 5.05, 5.19, 5.33, 5.48, 5.63, 5.8, 5.97, 6.16, 6.36, 6.57, - 6.8, 7.04, 7.3, 7.58, 7.89, 8.22, 8.57}; - - // Float_t aAbsSiO2[kNbins]; + 6.8, 7.04, 7.3, 7.58, 7.89, + 8.22, 8.57, 8.97, 9.39 }; + /* + Float_t effCathode[kNbins]={0.11, 0.13, 0.15, 0.16, 0.18, 0.19, 0.20, + 0.21, 0.22, 0.23, 0.24, 0.26, + 0.27, 0.29, 0.30, 0.29, 0.29, + 0.28, 0.28, 0.27, 0.26, 0.25, + 0.25, 0.23, 0.20, 0.19, 0.17, + 0.17, 0.17, 0.2, 0.23}; + */ + // Float_t aAbsSiO2[kNbins]; //quartz 30mm for(i=0;iSetCerenkov (idtmed[kOpGlass], kNbins, aPckov, aAbsSiO2, efficAll, aRindexSiO2 ); - gMC->SetCerenkov (idtmed[kOpAir], kNbins , aPckov, absorAir, efficAll, rindexAir); + + + gMC->SetCerenkov (idtmed[kOpGlass], kNbins, aPckov, aAbsSiO2, efficAll, rindexSiO2 ); + // gMC->SetCerenkov (idtmed[kOpGlassCathode], kNbins, aPckov, aAbsSiO2, effCathode, rindexSiO2 ); + gMC->SetCerenkov (idtmed[kOpGlassCathode], kNbins, aPckov, aAbsSiO2,efficAll , rindexSiO2 ); + gMC->SetCerenkov (idtmed[kOpAir], kNbins, aPckov,absorAir , efficAll,rindexAir ); + gMC->SetCerenkov (idtmed[kOpAirNext], kNbins, aPckov,absorbCathodeNext , efficAll, rindexCathodeNext); + if(fDebug) cout<IsTrackAlive()) return; // particle has disappeared - + // If particles is photon then ... - - if (gMC->TrackPid() == 50000050) - { + + if (gMC->TrackPid() == 50000050) + { id=gMC->CurrentVolID(copy); // Check the sensetive volume - if(id==fIdSens1 ) { + if(id==fIdSens1 ) { if(gMC->IsTrackEntering()) { gMC->CurrentVolOffID(2,copy); vol[1]=copy; @@ -639,27 +642,33 @@ void AliSTARTv1::StepManager() hits[0] = pos[0]; hits[1] = pos[1]; hits[2] = pos[2]; - // printf(" pmt %i ", vol[1]); - // printf(" x %f y %f z %f \n", pos[0],pos[1],pos[2]); if(pos[2]<0) vol[0]=2; - if(pos[2]>=0) vol[0]=1; + if(pos[2]>=0) vol[0]=1; Float_t etot=gMC->Etot(); hits[3]=etot; Int_t iPart= gMC->TrackPid(); Int_t partID=gMC->IdFromPDG(iPart); hits[4]=partID; - // if (partID!=50) cout<TrackTime(); - hits[5]=ttime*1e9; + hits[5]=ttime*1e12; + AddHit(fIshunt,vol,hits); + // cout<< gAlice->GetMCApp()->GetCurrentTrackNumber()<<" hit added "<IsTrackExiting()) - new(lhits[fNhits++]) AliSTARThit(fIshunt,gAlice->GetMCApp()->GetCurrentTrackNumber(),vol,hits); - - } - } -//--------------------------------------------------------------------- + /* + printf("track(%i) alive(%i) disap(%i) enter(%i) exit(%i) inside(%i) out(%i) stop(%i) new(%i) \n", + gAlice->GetMCApp()->GetCurrentTrackNumber(), + gMC->IsTrackAlive(), + gMC->IsTrackDisappeared(), + gMC->IsTrackEntering(), + gMC->IsTrackExiting(), + gMC->IsTrackInside(), + gMC->IsTrackOut(), + gMC->IsTrackStop(), + gMC->IsNewTrack()); + */ + } //sensitive + } //photon } @@ -669,4 +678,3 @@ void AliSTARTv1::StepManager() - diff --git a/START/AliSTARTv1.h b/START/AliSTARTv1.h index ae7d6154674..bb8d2ca5d9d 100644 --- a/START/AliSTARTv1.h +++ b/START/AliSTARTv1.h @@ -14,12 +14,12 @@ class AliSTARTv1 : public AliSTART { public: - enum constants {kAir=1, kSc=2, kVac=3, kCer=4, kGlass=6, kSteel=8, kRibber=9, kBrass=11, kLucite=12, kC=13, kPP=14, kAl=15, kOpGlass=16, kOpAir=17}; + enum constants {kAir=1, kSc=2, kVac=3, kCer=4, kGlass=6, kSteel=8, kRibber=9, kBrass=11, kLucite=12, kC=13, kPP=14, kAl=15, kOpGlass=16, kOpAir=17, kOpAirNext=18, kOpGlassCathode=19}; AliSTARTv1() {}; AliSTARTv1(const char *name, const char *title); - virtual ~AliSTARTv1() {} + virtual ~AliSTARTv1(); virtual void CreateGeometry(); virtual void CreateMaterials(); virtual void DrawDetector(); diff --git a/START/STARTrecLinkDef.h b/START/STARTrecLinkDef.h index 8b2341b7471..81d37f45f9a 100755 --- a/START/STARTrecLinkDef.h +++ b/START/STARTrecLinkDef.h @@ -8,6 +8,8 @@ #pragma link off all classes; #pragma link off all functions; +#pragma link C++ class AliSTARTRecPoint+; #pragma link C++ class AliSTARTReconstructor+; +#pragma link C++ class AliSTARTRawReader+; #endif diff --git a/START/STARTsimLinkDef.h b/START/STARTsimLinkDef.h index 7d725c68395..450842e025f 100755 --- a/START/STARTsimLinkDef.h +++ b/START/STARTsimLinkDef.h @@ -12,7 +12,6 @@ #pragma link C++ class AliSTARTv0+; #pragma link C++ class AliSTARTv1+; #pragma link C++ class AliSTARThit+; -#pragma link C++ class AliSTARThitPhoton+; #pragma link C++ class AliSTARTDigitizer+; #pragma link C++ class AliSTARTRawData+; diff --git a/START/libSTARTrec.pkg b/START/libSTARTrec.pkg index 701c94bb1da..ebfa24f0386 100644 --- a/START/libSTARTrec.pkg +++ b/START/libSTARTrec.pkg @@ -1,7 +1,7 @@ #-*- Mode: Makefile -*- # $Id$ -SRCS= AliSTARTReconstructor.cxx +SRCS= AliSTARTRecPoint.cxx AliSTARTReconstructor.cxx AliSTARTRawReader.cxx HDRS= $(SRCS:.cxx=.h) diff --git a/START/libSTARTsim.pkg b/START/libSTARTsim.pkg index 9d919c5a4dc..4d29e82bca3 100644 --- a/START/libSTARTsim.pkg +++ b/START/libSTARTsim.pkg @@ -1,7 +1,7 @@ #-*- Mode: Makefile -*- # $Id$ -SRCS= AliSTART.cxx AliSTARTv0.cxx AliSTARTv1.cxx AliSTARThit.cxx AliSTARTDigitizer.cxx AliSTARThitPhoton.cxx AliSTARTRawData.cxx +SRCS= AliSTART.cxx AliSTARTv0.cxx AliSTARTv1.cxx AliSTARThit.cxx AliSTARTDigitizer.cxx AliSTARTRawData.cxx HDRS= $(SRCS:.cxx=.h) -- 2.39.3