y=-(-xdet+fYshift[fModule]);
z= -zdet+fZshift[fModule];
- q/=5.039; //to have MPV 1 MIP = 86.4 KeV
- q/=16.49; //to be consistent with SSD - provisional 06-APR-2007
+ q/=5.243; //to have MPV 1 MIP = 86.4 KeV --> this must go to calibr.
Float_t hit[5] = {y, z, 0.0030*0.0030, 0.0020*0.0020, q};
Int_t info[3] = {maxj-minj+1, maxi-mini+1, fNlayer[fModule]};
#include "AliITSRawStreamSSD.h"
#include <TClonesArray.h>
#include "AliITSdigitSSD.h"
+#include "AliITSCalibrationSSD.h"
ClassImp(AliITSClusterFinderV2SSD)
//------------------------------------------------------------
// Actual SSD cluster finder
//------------------------------------------------------------
+ AliITSCalibrationSSD* cal = (AliITSCalibrationSSD*)GetResp(fModule);
+ Float_t gain=0;
+
Int_t smaxall=alldigits->GetEntriesFast();
if (smaxall==0) return;
TObjArray *digits = new TObjArray;
for (Int_t i=0;i<smaxall; i++){
AliITSdigitSSD *d=(AliITSdigitSSD*)alldigits->UncheckedAt(i);
- Float_t q=d->GetSignal()/4.29;// temp. fix (for PID purposed - normalis. to be checked)
+
+ if(d->IsSideP()) gain = cal->GetGainP(d->GetStripNumber());
+ else gain = cal->GetGainN(d->GetStripNumber());
+
+ Float_t q=gain*d->GetSignal(); // calibration brings mip peaks around 120 (in ADC units)
+ q=cal->ADCToKeV(q); // converts the charge in KeV from ADC units
+ //Float_t q=d->GetSignal()/4.29;// temp. fix (for PID purposed - normalis. to be checked)
d->SetSignal(Int_t(q));
+
if (d->GetSignal()<3) continue;
digits->AddLast(d);
}
}
-void AliITSClusterFinderV2SSD::FindClustersSSD(AliITSRawStream* input,
+void AliITSClusterFinderV2SSD::FindClustersSSD(AliITSRawStreamSSD* input,
TClonesArray** clusters)
{
//------------------------------------------------------------
Int_t prevStrip = -1;
Int_t prevFlag = -1;
Int_t prevModule = -1;
+ Float_t gain=0;
+ AliITSCalibrationSSD* cal;
+
// read raw data input stream
while (kTRUE) {
Bool_t next = input->Next();
- if(input->GetSignal()<(3*4.29) && next) continue;
+ if(input->GetSignal()<(3*4.) && next) continue;
// check if a new cluster starts
Int_t strip = input->GetCoord2();
Int_t flag = input->GetCoord1();
nClusters[0] = nClusters[1] = 0;
y = q = 0.;
nDigits = 0;
+
+ cal = (AliITSCalibrationSSD*)GetResp(input->GetModuleID());
+
}
+ if(input->GetSideFlag()==0) gain = cal->GetGainP(input->GetStrip());
+ else gain = cal->GetGainN(input->GetStrip());
+
// add digit to current cluster
- q += input->GetSignal()/4.29;
- y += strip * input->GetSignal()/4.29;
+ q += cal->ADCToKeV( gain * input->GetSignal() ); // signal is corrected for gain and converted in KeV
+ y += strip * cal->ADCToKeV( gain * input->GetSignal() );
nDigits++;
prevStrip = strip;
prevFlag = flag;
// Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch
//--------------------------------------------------------------
#include "AliITSClusterFinderV2.h"
+#include "AliITSDetTypeRec.h"
class TClonesArray;
class AliRawReader;
class AliITSRawStream;
+class AliITSRawStreamSSD;
+class AliITSCalibrationSSD;
class AliITSClusterFinderV2SSD : public AliITSClusterFinderV2 {
public:
Ali1Dcluster* pos, Int_t np,
TClonesArray *clusters=0x0);
- void FindClustersSSD(AliITSRawStream* input,TClonesArray** clusters);
+ void FindClustersSSD(AliITSRawStreamSSD* input,TClonesArray** clusters);
+ virtual AliITSCalibrationSSD* GetResp(Int_t mod)const{
+ return (AliITSCalibrationSSD*) fDetTypeRec->GetCalibrationModel(mod);}
Int_t fLastSSD1; //index of the last SSD1 detector
Float_t fYpitchSSD; //strip pitch (cm)
// if strip is dead -> gain=0
if( ((k==0)&&(res->GetGainP(ix)==0)) || ((k==1)&&(res->GetGainN(ix)==0))) continue;
+ signal = fMapA2->GetSignal(k,ix);
// signal has to be uncalibrated
// In real life, gains are supposed to be calculated from calibration runs,
// stored in the calibration DB and used in the reconstruction
else signal /= res->GetGainN(ix);
// signal is converted in unit of ADC
- signal = res->GetDEvToADC(fMapA2->GetSignal(k,ix));
+ signal = res->GetDEvToADC(signal);
if(signal>4096.) signal = 4096.;//if exceeding, accumulate last one
// threshold for zero suppression is set on the basis of the noise