/* History of cvs commits:
*
* $Log$
+ * Revision 1.96 2006/04/07 08:41:59 hristov
+ * Follow AliAlignObj framework and remove AliPHOSAlignData (Yu.Kharlov)
+ *
* Revision 1.95 2006/03/14 19:40:41 kharlov
* Remove De-digitizing of raw data and digitizing the raw data fit
*
return;
}
- // get the digitizer
- loader->LoadDigitizer();
- AliPHOSDigitizer * digitizer = dynamic_cast<AliPHOSDigitizer *>(loader->Digitizer()) ;
-
// get the geometry
AliPHOSGeometry* geom = GetGeometry();
if (!geom) {
// some digitization constants
const Int_t kDDLOffset = 0x600; // assigned to PHOS
- const Int_t kThreshold = 1; // skip digits below this threshold
+// const Int_t kThreshold = 1; // skip digits below this threshold // YVK
+ const Float_t kThreshold = 0.001; // skip digits below 1 MeV
+ const Int_t kAdcThreshold = 1; // Lower ADC threshold to write to raw data
AliAltroBuffer* buffer = NULL;
Int_t prevDDL = -1;
// loop over digits (assume ordered digits)
for (Int_t iDigit = 0; iDigit < digits->GetEntries(); iDigit++) {
AliPHOSDigit* digit = dynamic_cast<AliPHOSDigit *>(digits->At(iDigit)) ;
- if (digit->GetAmp() < kThreshold)
+ if (digit->GetEnergy() < kThreshold)
continue;
Int_t relId[4];
geom->AbsToRelNumbering(digit->GetId(), relId);
// out of time range signal (?)
if (digit->GetTimeR() > GetRawFormatTimeMax() ) {
- buffer->FillBuffer(digit->GetAmp());
+ buffer->FillBuffer((Int_t)digit->GetEnergy());
buffer->FillBuffer(GetRawFormatTimeBins() ); // time bin
buffer->FillBuffer(3); // bunch length
buffer->WriteTrailer(3, relId[3], relId[2], module); // trailer
Double_t energy = 0 ;
Int_t module = relId[0];
if ( digit->GetId() <= geom->GetNModules() * geom->GetNCristalsInModule()) {
- energy=digit->GetAmp()*digitizer->GetEMCchannel() + digitizer->GetEMCpedestal();
+ energy=digit->GetEnergy();
}
else {
// energy = digit->GetAmp()*digitizer->GetCPVchannel()+digitizer->GetCPVpedestal();
if (lowgain)
buffer->WriteChannel(relId[3], relId[2], module + fLowGainOffset,
- GetRawFormatTimeBins(), adcValuesLow , kThreshold);
+ GetRawFormatTimeBins(), adcValuesLow , kAdcThreshold);
else
buffer->WriteChannel(relId[3], relId[2], module,
- GetRawFormatTimeBins(), adcValuesHigh, kThreshold);
+ GetRawFormatTimeBins(), adcValuesHigh, kAdcThreshold);
}
}
/* History of cvs commits:
*
* $Log$
+ * Revision 1.90 2006/04/11 15:22:59 hristov
+ * run number in query set to -1: forces AliCDBManager to use its run number (A.Colla)
+ *
* Revision 1.89 2006/03/13 14:05:42 kharlov
* Calibration objects for EMC and CPV
*
gime->Event(ievent ,"D"); // Read digits from simulated data
else
gime->Event(fRawReader,"W"); // Read digits from raw data
-
fNumberOfEmcClusters = fNumberOfCpvClusters = 0 ;
MakeClusters() ;
//increment the total number of recpoints per run
fRecPointsInRun += gime->EmcRecPoints()->GetEntriesFast() ;
fRecPointsInRun += gime->CpvRecPoints()->GetEntriesFast() ;
+ if (fRawReader != 0) {
+ AliRunLoader * rl = AliRunLoader::GetRunLoader(gime->PhosLoader()->GetTitle());
+ Int_t iEvent = ievent;
+ rl->SetEventNumber(++iEvent);
}
+ }
if(fWrite) //do not unload in "on flight" mode
Unload();
for(Int_t i=0; i<digits->GetEntriesFast(); i++){
AliPHOSDigit * digit = static_cast<AliPHOSDigit*>(digits->At(i)) ;
Float_t cut = IsInEmc(digit) ? fEmcMinE : fCpvMinE ;
- if(Calibrate(digit->GetAmp(),digit->GetId()) < cut)
+// if(Calibrate(digit->GetAmp(),digit->GetId()) < cut) //YVK
+ if(digit->GetEnergy() < cut)
digits->RemoveAt(i) ;
}
digits->Compress() ;
//Remove digits below threshold
CleanDigits(digits) ;
-
TClonesArray * digitsC = static_cast<TClonesArray*>( digits->Clone() ) ;
-
// Clusterization starts
TArrayI clusterdigitslist(1500) ;
Int_t index ;
- if (( IsInEmc (digit) && Calibrate(digit->GetAmp(),digit->GetId()) > fEmcClusteringThreshold ) ||
+ if (( IsInEmc (digit) && digit->GetEnergy() > fEmcClusteringThreshold ) ||
( IsInCpv (digit) && Calibrate(digit->GetAmp(),digit->GetId()) > fCpvClusteringThreshold ) ) {
Int_t iDigitInCluster = 0 ;
emcRecPoints->AddAt(new AliPHOSEmcRecPoint(""), fNumberOfEmcClusters) ;
clu = dynamic_cast<AliPHOSEmcRecPoint *>( emcRecPoints->At(fNumberOfEmcClusters) ) ;
fNumberOfEmcClusters++ ;
- clu->AddDigit(*digit, Calibrate(digit->GetAmp(),digit->GetId())) ;
+// clu->AddDigit(*digit, Calibrate(digit->GetAmp(),digit->GetId())) ; // YVK
+ clu->AddDigit(*digit, digit->GetEnergy()) ;
clusterdigitslist[iDigitInCluster] = digit->GetIndexInList() ;
iDigitInCluster++ ;
digitsC->Remove(digit) ;
case 0 : // not a neighbour
break ;
case 1 : // are neighbours
- clu->AddDigit(*digitN, Calibrate( digitN->GetAmp(), digitN->GetId() ) ) ;
+// clu->AddDigit(*digitN, Calibrate( digitN->GetAmp(), digitN->GetId() ) ) ; // YVK: distinguish EMC and CPV!!!
+ clu->AddDigit(*digitN, digitN->GetEnergy()) ;
clusterdigitslist[iDigitInCluster] = digitN->GetIndexInList() ;
iDigitInCluster++ ;
digitsC->Remove(digitN) ;
/* History of cvs commits:
*
* $Log$
+ * Revision 1.37 2005/05/28 14:19:04 schutz
+ * Compilation warnings fixed by T.P.
+ *
*/
//_________________________________________________________________________
// ctor with all data
fAmp = digEnergy ;
+ fEnergy = 0 ;
+ fTime = time ;
+ fTimeR = fTime ;
+ fId = id ;
+ fIndexInList = index ;
+ if( primary != -1){
+ fNprimary = 1 ;
+ fPrimary = new Int_t[fNprimary] ;
+ fPrimary[0] = primary ;
+ }
+ else{ //If the contribution of this primary smaller than fDigitThreshold (AliPHOSv1)
+ fNprimary = 0 ;
+ fPrimary = 0 ;
+ }
+}
+
+//____________________________________________________________________________
+AliPHOSDigit::AliPHOSDigit(Int_t primary, Int_t id, Float_t energy, Float_t time, Int_t index)
+{
+ // ctor with all data
+
+ fAmp = 0 ;
+ fEnergy = energy ;
fTime = time ;
fTimeR = fTime ;
fId = id ;
else
fPrimary = 0 ;
fAmp = digit.fAmp ;
+ fEnergy = digit.fEnergy ;
fTime = digit.fTime ;
fTimeR = digit.fTimeR ;
fId = digit.fId;
void AliPHOSDigit::Print(const Option_t *) const
{
// Print the digit together with list of primaries
- printf("PHOS digit: Amp=%d, Id=%d, Time=%e, TimeR=%e, NPrim=%d ",fAmp,fId,fTime,fTimeR,fNprimary);
+ printf("PHOS digit: Amp=%d/E=%.3f, Id=%d, Time=%.3e, TimeR=%.3e, NPrim=%d ",fAmp,fEnergy,fId,fTime,fTimeR,fNprimary);
for(Int_t index = 0; index <fNprimary; index ++ )
printf(" %d ",fPrimary[index]);
printf("\n") ;
// Adds the amplitude of digits and completes the list of primary particles
if(digit.fNprimary>0){
Int_t *tmp = new Int_t[fNprimary+digit.fNprimary] ;
- if(fAmp < digit.fAmp){//most energetic primary in second digit => first primaries in list from second digit
+ if(fAmp < digit.fAmp || fEnergy < digit.fEnergy){//most energetic primary in second digit => first primaries in list from second digit
for (Int_t index = 0 ; index < digit.fNprimary ; index++)
tmp[index]=(digit.fPrimary)[index] ;
for (Int_t index = 0 ; index < fNprimary ; index++)
fPrimary = tmp ;
}
fNprimary+=digit.fNprimary ;
- fAmp += digit.fAmp ;
+ fAmp += digit.fAmp ;
+ fEnergy += digit.fEnergy ;
if(fTime > digit.fTime)
fTime = digit.fTime ;
fTimeR = fTime ;
/* History of cvs commits:
*
* $Log$
+ * Revision 1.33 2005/05/28 14:19:04 schutz
+ * Compilation warnings fixed by T.P.
+ *
*/
//_________________________________________________________________________
AliPHOSDigit() ;
AliPHOSDigit(Int_t primary, Int_t id, Int_t DigEnergy, Float_t Time, Int_t index = -1) ;
+ AliPHOSDigit(Int_t primary, Int_t id, Float_t energy , Float_t Time, Int_t index = -1) ;
AliPHOSDigit(const AliPHOSDigit & digit) ;
virtual ~AliPHOSDigit() ;
// AliPHOSDigit& operator=(const AliPHOSDigit) {
// Fatal("operator = ", "not implemented") ; return *this ; }
Int_t Compare(const TObject * obj) const ;
- Int_t GetNprimary() const { return fNprimary ; }
+ Int_t GetNprimary() const { return fNprimary ; }
Int_t GetPrimary(Int_t index) const ;
- Float_t GetTime(void) const {return fTime ;}
- Float_t GetTimeR(void) const {return fTimeR ;}
- Bool_t IsSortable() const { return kTRUE ; }
+ Float_t GetEnergy(void) const {return fEnergy ;}
+ Float_t GetTime(void) const {return fTime ;}
+ Float_t GetTimeR(void) const {return fTimeR ;}
+ Bool_t IsSortable() const { return kTRUE ; }
void Print(const Option_t * = "") const;
- void SetAmp(Int_t Amp) { fAmp=Amp ; }
- void SetTime(Float_t time) {fTime = time ;}
+ void SetAmp(Int_t Amp) {fAmp = Amp ;}
+ void SetEnergy(Float_t E) {fEnergy= E ;}
+ void SetTime(Float_t time) {fTime = time ;}
void SetTimeR(Float_t time) {fTimeR = time ;}
void ShiftPrimary(Int_t shift); // shift to separate different TreeK in merging
private:
- Int_t fNprimary ; // Number of primaries
+ Int_t fNprimary ; // Number of primaries
Int_t * fPrimary ; //[fNprimary] Array of primaries
+ Float_t fEnergy ; // Deposited energy in GeV
Float_t fTime ; // Calculcated time
Float_t fTimeR ; // Earliest time: to be used by Digits2Raw
- ClassDef(AliPHOSDigit,3) // Digit in PHOS
+ ClassDef(AliPHOSDigit,4) // Digit in PHOS
} ;
/* History of cvs commits:
*
* $Log$
+ * Revision 1.89 2006/04/11 15:22:59 hristov
+ * run number in query set to -1: forces AliCDBManager to use its run number (A.Colla)
+ *
* Revision 1.88 2006/03/13 14:05:43 kharlov
* Calibration objects for EMC and CPV
*
sdigArray->AddAt(gime->SDigits(), i) ;
}
- //Find the first crystall with signal
+ //Find the first crystal with signal
Int_t nextSig = 200000 ;
TClonesArray * sdigits ;
for(i = 0 ; i < fInput ; i++){
//Put Noise contribution
for(absID = 1 ; absID <= nEMC ; absID++){
Float_t noise = gRandom->Gaus(0., fPinNoise) ;
- new((*digits)[absID-1]) AliPHOSDigit( -1, absID, sDigitizer->Digitize(noise), TimeOfNoise() ) ;
+ // YVK: do not digitize amplitudes for EMC
+// new((*digits)[absID-1]) AliPHOSDigit( -1, absID, sDigitizer->Digitize(noise), TimeOfNoise() ) ;
+ new((*digits)[absID-1]) AliPHOSDigit( -1, absID, noise, TimeOfNoise() ) ;
//look if we have to add signal?
digit = dynamic_cast<AliPHOSDigit *>(digits->At(absID-1)) ;
//Add SDigits from all inputs
ticks->Clear() ;
Int_t contrib = 0 ;
- Float_t a = digit->GetAmp() ;
+ Float_t a = digit->GetEnergy() ;
Float_t b = TMath::Abs( a / fTimeSignalLength) ;
//Mark the beginning of the signal
new((*ticks)[contrib++]) AliPHOSTick(digit->GetTime(),0, b);
- //Mark the end of the ignal
+ //Mark the end of the signal
new((*ticks)[contrib++]) AliPHOSTick(digit->GetTime()+fTimeSignalLength, -a, -b);
//loop over inputs
primaryoffset = 10000000*i ;
curSDigit->ShiftPrimary(primaryoffset) ;
- a = curSDigit->GetAmp() ;
+ a = curSDigit->GetEnergy() ;
b = a /fTimeSignalLength ;
new((*ticks)[contrib++]) AliPHOSTick(curSDigit->GetTime(),0, b);
new((*ticks)[contrib++]) AliPHOSTick(curSDigit->GetTime()+fTimeSignalLength, -a, -b);
*digit = *digit + *curSDigit ; //add energies
-
+
index[i]++ ;
if( dynamic_cast<TClonesArray *>(sdigArray->At(i))->GetEntriesFast() > index[i] )
curSDigit = dynamic_cast<AliPHOSDigit*>(dynamic_cast<TClonesArray *>(sdigArray->At(i))->At(index[i])) ;
//remove digits below thresholds
for(i = 0 ; i < nEMC ; i++){
digit = dynamic_cast<AliPHOSDigit*>( digits->At(i) ) ;
- if(sDigitizer->Calibrate( digit->GetAmp() ) < fEMCDigitThreshold)
+ // YVK: amplitude is in energy units
+// if(sDigitizer->Calibrate( digit->GetAmp() ) < fEMCDigitThreshold)
+ if(digit->GetEnergy() < fEMCDigitThreshold)
digits->RemoveAt(i) ;
else
digit->SetTime(gRandom->Gaus(digit->GetTime(),fTimeResolution) ) ;
for(i = nEMC; i < nCPV ; i++)
- if( sDigitizer->Calibrate( dynamic_cast<AliPHOSDigit*>(digits->At(i))->GetAmp() ) < fCPVDigitThreshold )
+// if( sDigitizer->Calibrate( dynamic_cast<AliPHOSDigit*>(digits->At(i))->GetAmp() ) < fCPVDigitThreshold )
+ if( dynamic_cast<AliPHOSDigit*>(digits->At(i))->GetEnergy() < fCPVDigitThreshold )
digits->RemoveAt(i) ;
digits->Compress() ;
for (i = 0 ; i < ndigits ; i++) {
digit = dynamic_cast<AliPHOSDigit*>( digits->At(i) ) ;
digit->SetIndexInList(i) ;
- Float_t energy = sDigitizer->Calibrate(digit->GetAmp()) ;
- digit->SetAmp(DigitizeEnergy(energy,digit->GetId()) ) ;
+ if(digit->GetId() > fEmcCrystals){ //digitize CPV only
+ digit->SetAmp(DigitizeEnergy(digit->GetEnergy(),digit->GetId()) ) ;
+ }
}
}
Int_t relId[4];
gime->PHOSGeometry()->AbsToRelNumbering(absId,relId);
Int_t module=relId[0];
- Int_t raw=relId[2];
+ Int_t row =relId[2];
Int_t column=relId[3];
Int_t chanel ;
//If no calibration DB found, accept default values.
if(gime->CalibData()) {
- fADCpedestalEmc = gime->CalibData()->GetADCpedestalEmc(module,column,raw);
- fADCchanelEmc = gime->CalibData()->GetADCchannelEmc(module,column,raw);
+ fADCpedestalEmc = gime->CalibData()->GetADCpedestalEmc(module,column,row);
+ fADCchanelEmc = gime->CalibData()->GetADCchannelEmc(module,column,row);
}
-// printf("\t\tabsId %d ==>>module=%d column=%d raw=%d ped=%.4f gain=%.4f\n",
-// absId,module,column,raw,fADCpedestalEmc,fADCchanelEmc);
chanel = (Int_t) TMath::Ceil((energy - fADCpedestalEmc)/fADCchanelEmc) ;
if(chanel > fNADCemc ) chanel = fNADCemc ;
}
else{ //Digitize as CPV
if(gime->CalibData()) {
- fADCpedestalCpv = gime->CalibData()->GetADCpedestalCpv(module,column,raw);
- fADCchanelCpv = gime->CalibData()->GetADCchannelCpv(module,column,raw);
+ fADCpedestalCpv = gime->CalibData()->GetADCpedestalCpv(module,column,row);
+ fADCchanelCpv = gime->CalibData()->GetADCchannelCpv(module,column,row);
}
chanel = (Int_t) TMath::Ceil((energy - fADCpedestalCpv)/fADCchanelCpv) ;
{
// Set initial parameters Digitizer
- fPinNoise = 0.004 ;
- fEMCDigitThreshold = 0.012 ;
- fCPVNoise = 0.01;
- fCPVDigitThreshold = 0.09 ;
- fTimeResolution = 0.5e-9 ;
- fTimeSignalLength = 1.0e-9 ;
+ fPinNoise = 0.004 ; // [GeV]
+ fEMCDigitThreshold = 0.012 ; // [GeV]
+ fCPVNoise = 0.01; // [aux units]
+ fCPVDigitThreshold = 0.09 ; // [aux units]
+ fTimeResolution = 0.5e-9 ; // [sec]
+ fTimeSignalLength = 1.0e-9 ; // [sec]
fDigitsInRun = 0 ;
fADCchanelEmc = 0.0015; // width of one ADC channel in GeV
fADCpedestalEmc = 0.005 ; //
fADCpedestalCpv = 0.012 ; //
fNADCcpv = (Int_t) TMath::Power(2,12); // number of channels in CPV ADC
- fTimeThreshold = 0.001*10000000 ; //Means 1 MeV in terms of SDigits amplitude
+// fTimeThreshold = 0.001*10000000 ; //Means 1 MeV in terms of SDigits amplitude
+ fTimeThreshold = 0.001 ; // [GeV]
SetEventRange(0,-1) ;
}
printf("\nWriting digits to %s", gime->GetDigitsFileName().Data()) ;
printf("\nWith following parameters:\n") ;
- printf(" Electronics noise in EMC (fPinNoise) = %f\n", fPinNoise ) ;
- printf(" Threshold in EMC (fEMCDigitThreshold) = %f\n", fEMCDigitThreshold ) ;
- printf(" Noise in CPV (fCPVNoise) = %f\n", fCPVNoise ) ;
- printf(" Threshold in CPV (fCPVDigitThreshold) = %f\n",fCPVDigitThreshold ) ;
+ printf(" Electronics noise in EMC (fPinNoise) = %f GeV\n", fPinNoise ) ;
+ printf(" Threshold in EMC (fEMCDigitThreshold) = %f GeV\n", fEMCDigitThreshold ) ;
+ printf(" Noise in CPV (fCPVNoise) = %f aux units\n", fCPVNoise ) ;
+ printf(" Threshold in CPV (fCPVDigitThreshold) = %f aux units\n",fCPVDigitThreshold ) ;
printf(" ---------------------------------------------------\n") ;
}
else
digit = (AliPHOSDigit * ) digits->At(index) ;
if(digit->GetNprimary() == 0)
continue;
- printf("%6d %8d %6.5e %4d %2d :",
- digit->GetId(), digit->GetAmp(), digit->GetTime(), digit->GetIndexInList(), digit->GetNprimary()) ;
+// printf("%6d %8d %6.5e %4d %2d :",
+// digit->GetId(), digit->GetAmp(), digit->GetTime(), digit->GetIndexInList(), digit->GetNprimary()) ; // YVK
+ printf("%6d %.4f %6.5e %4d %2d :",
+ digit->GetId(), digit->GetEnergy(), digit->GetTime(), digit->GetIndexInList(), digit->GetNprimary()) ;
Int_t iprimary;
for (iprimary=0; iprimary<digit->GetNprimary(); iprimary++) {
printf("%d ",digit->GetPrimary(iprimary+1) ) ;
/* History of cvs commits:
*
* $Log$
+ * Revision 1.47 2005/05/28 14:19:04 schutz
+ * Compilation warnings fixed by T.P.
+ *
*/
//_________________________________________________________________________
if( hit->GetEnergy() > fPrimThreshold)
new((*sdigits)[nSdigits]) AliPHOSDigit(hit->GetPrimary(),hit->GetId(),
- Digitize(hit->GetEnergy()), hit->GetTime()) ;
+ hit->GetEnergy() ,hit->GetTime()) ;
else
- new((*sdigits)[nSdigits]) AliPHOSDigit( -1 , hit->GetId(),
- Digitize(hit->GetEnergy()), hit->GetTime()) ;
+ new((*sdigits)[nSdigits]) AliPHOSDigit(-1 ,hit->GetId(),
+ hit->GetEnergy() ,hit->GetTime()) ;
nSdigits++ ;
}
digit = dynamic_cast<AliPHOSDigit *>( sdigits->At(index) ) ;
// if(digit->GetNprimary() == 0)
// continue;
- printf("%6d %8d %6.5e %4d %2d :\n",
- digit->GetId(), digit->GetAmp(), digit->GetTime(), digit->GetIndexInList(), digit->GetNprimary()) ;
+// printf("%6d %8d %6.5e %4d %2d :\n", // YVK
+ printf("%6d %.4f %6.5e %4d %2d :\n",
+ digit->GetId(), digit->GetEnergy(), digit->GetTime(), digit->GetIndexInList(), digit->GetNprimary()) ;
Int_t iprimary;
for (iprimary=0; iprimary<digit->GetNprimary(); iprimary++) {
printf("%d ",digit->GetPrimary(iprimary+1) ) ;